15#include "TGLIncludes.h"
47 if (
Dot(cross,ref) > 0.0) {
103 Double_t ringRadius = baseScale*10.0;
109 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
110 glDisable(GL_CULL_FACE);
160 activeVector *= ringRadius;
166 glEnable(GL_CULL_FACE);
193 if ((planeEyeAngle > -shallowDelta) && (planeEyeAngle < shallowDelta)) {
243 if (!nearLineIntersection.first) {
244 Error(
"TGLRotateManip::CalculateAngleDelta",
"active ring plane parallel to near clip?");
247 TGLLine3 nearLine = nearLineIntersection.second;
254 Double_t angle =
Dot(activePlaneNear, mouseDelta) / 150.0;
275 TPoint mouseViewport(mouse);
286 if (!ringPlaneInter.first) {
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
std::pair< Bool_t, TGLLine3 > Intersection(const TGLPlane &p1, const TGLPlane &p2)
Find 3D line interestion of this plane with 'other'.
TGLVector3 Cross(const TGLVector3 &v1, const TGLVector3 &v2)
Concrete class describing an orientated (free) or axis aligned box of 8 vertices.
TGLVertex3 Center() const
const TGLVector3 & Axis(UInt_t i, Bool_t normalised=kTRUE) const
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
TGLVector3 EyeDirection() const
Extract the camera eye direction (vector), running from EyePoint() Camera must have valid frustum cac...
TGLVertex3 ViewportToWorld(const TGLVertex3 &viewportVertex, TGLMatrix *modviewMat=0) const
Convert a '3D' viewport vertex to 3D world one.
TGLVector3 WorldDeltaToViewport(const TGLVertex3 &worldRef, const TGLVector3 &worldDelta) const
Convert a 3D vector worldDelta (shift) about vertex worldRef to a viewport (screen) '3D' vector.
void WindowToViewport(Int_t &, Int_t &y) const
const TGLPlane & FrustumPlane(EFrustumPlane plane) const
3D space, fixed length, line class, with direction / length 'vector', passing through point 'vertex'.
const TGLVector3 & Vector() const
const TGLVertex3 & Start() const
Abstract base class for viewer manipulators, which allow direct in viewer manipulation of a (TGlPhysi...
TPoint fLastMouse
first (start) mouse position (in WINDOW coords)
const UChar_t * ColorFor(UInt_t widget) const
Returns color to be used for given widget.
virtual Bool_t HandleButton(const Event_t &event, const TGLCamera &camera)
Handle a mouse button event - return kTRUE if processed, kFALSE otherwise.
Bool_t fActive
active width (axis) component
void CalcDrawScale(const TGLBoundingBox &box, const TGLCamera &camera, Double_t &base, TGLVector3 axis[3]) const
Calculates base and axis scale factor (in world units) for drawing manipulators with reasonable size ...
UInt_t fSelectedWidget
manipulated shape
TGLPhysicalShape * fShape
Concrete physical shape - a GL drawable.
const TGLBoundingBox & BoundingBox() const
void Rotate(const TGLVertex3 &pivot, const TGLVector3 &axis, Double_t angle)
void Set(const TGLPlane &other)
Assign from other.
TGLVertex3 NearestOn(const TGLVertex3 &point) const
Return nearest point on plane.
Rotate manipulator - attaches to physical shape and draws local axes widgets - rings drawn from attac...
virtual Bool_t HandleMotion(const Event_t &event, const TGLCamera &camera)
Handle mouse motion over manipulator - if active (selected widget) rotate physical around selected ri...
Bool_t fShallowFront
does active ring form shallow angle to eye?
TGLLine3 CalculateRingLine(const TPoint &mouse, const TGLCamera &camera) const
Calculated interaction line between 'mouse' viewport point, and current selected widget (ring),...
Double_t CalculateAngleDelta(const TPoint &mouse, const TGLCamera &camera)
Calculate angle delta for rotation based on new mouse position.
TGLPlane fActiveRingPlane
front or back of the active shallow ring?
virtual void Draw(const TGLCamera &camera) const
Draw rotate manipulator - axis rings drawn from attached physical center, in plane defined by axis as...
TGLLine3 fRingLine
center of active ring
virtual Bool_t HandleButton(const Event_t &event, const TGLCamera &camera)
Handle mouse button event over manipulator - returns kTRUE if redraw required kFALSE otherwise.
TGLVertex3 fActiveRingCenter
plane of the active ring (widget)
TGLRotateManip()
Construct rotation manipulator not bound to any physical shape.
virtual ~TGLRotateManip()
Destroy the rotation manipulator.
static Double_t Angle(const TGLVector3 &v1, const TGLVector3 &v2)
Calculate unsigned angle between vectors v1 and v2.
static void DrawSphere(const TGLVertex3 &position, Double_t radius, const UChar_t rgba[4])
Draw sphere, centered on vertex 'position', with radius 'radius', color 'rgba'.
static const UChar_t fgWhite[4]
static void DrawLine(const TGLLine3 &line, ELineHeadShape head, Double_t size, const UChar_t rgba[4])
Draw thick line (tube) defined by 'line', with head at end shape 'head' - box/arrow/none,...
static void DrawRing(const TGLVertex3 ¢er, const TGLVector3 &normal, Double_t radius, const UChar_t *rgba)
Draw ring, centered on 'center', lying on plane defined by 'center' & 'normal' of outer radius 'radiu...
static const UChar_t fgGrey[4]
static const UChar_t fgYellow[4]
3 component (x/y/z) vector class.
3 component (x/y/z) vertex class.
void Set(Double_t x, Double_t y, Double_t z)
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)