47 if (
Dot(cross,ref) > 0.0) {
50 return -
Angle(v1, v2);
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) {
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...
TGLVertex3 fActiveRingCenter
plane of the active ring (widget)
Abstract base class for viewer manipulators, which allow direct in viewer manipulation of a (TGlPhysi...
const UChar_t * ColorFor(UInt_t widget) const
Returns color to be used for given widget.
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
static const UChar_t fgYellow[4]
TVector3 cross(const TVector3 &v1, const TVector3 &v2)
virtual Bool_t HandleButton(const Event_t &event, const TGLCamera &camera)
Handle mouse button event over manipulator - returns kTRUE if redraw required kFALSE otherwise...
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, (head) size 'size', color 'rgba'.
const TGLBoundingBox & BoundingBox() const
TGLLine3 fRingLine
center of active ring
virtual Bool_t HandleButton(const Event_t &event, const TGLCamera &camera)
Handle a mouse button event - return kTRUE if processed, kFALSE otherwise.
TGLVertex3 Center() const
static const UChar_t fgGrey[4]
Bool_t fShallowFront
does active ring form shallow angle to eye?
UInt_t fSelectedWidget
manipulated shape
TGLVector3 EyeDirection() const
Extract the camera eye direction (vector), running from EyePoint() Camera must have valid frustum cac...
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
void Set(Double_t x, Double_t y, Double_t z)
TGLViewer::ECameraType camera
Concrete physical shape - a GL drawable.
TGLPlane fActiveRingPlane
front or back of the active shallow ring?
3 component (x/y/z) vertex class.
void Rotate(const TGLVertex3 &pivot, const TGLVector3 &axis, Double_t angle)
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'.
TGLRotateManip()
Construct rotation manipulator not bound to any physical shape.
TGLVertex3 ViewportToWorld(const TGLVertex3 &viewportVertex, TGLMatrix *modviewMat=0) const
Convert a '3D' viewport vertex to 3D world one.
3 component (x/y/z) vector class.
virtual void Draw(const TGLCamera &camera) const
Draw rotate manipulator - axis rings drawn from attached physical center, in plane defined by axis as...
TPoint fLastMouse
first (start) mouse position (in WINDOW coords)
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 ...
void Error(const char *location, const char *msgfmt,...)
Rotate manipulator - attaches to physical shape and draws local axes widgets - rings drawn from attac...
Bool_t fActive
active width (axis) component
void WindowToViewport(Int_t &, Int_t &y) const
static const UChar_t fgWhite[4]
const TGLVertex3 & Start() const
TGLPhysicalShape * fShape
3D space, fixed length, line class, with direction / length 'vector', passing through point 'vertex'...
TGLVertex3 NearestOn(const TGLVertex3 &point) const
Return nearest point on plane.
Double_t Dot(const TGLVector3 &v1, const TGLVector3 &v2)
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...
const TGLVector3 & Axis(UInt_t i, Bool_t normalised=kTRUE) const
const TGLVector3 & Vector() const
Concrete class describing an orientated (free) or axis aligned box of 8 vertices. ...
Double_t CalculateAngleDelta(const TPoint &mouse, const TGLCamera &camera)
Calculate angle delta for rotation based on new mouse position.
const TGLPlane & FrustumPlane(EFrustumPlane plane) const
TGLVector3 Cross(const TGLVector3 &v1, const TGLVector3 &v2)
static Double_t Angle(const TGLVector3 &v1, const TGLVector3 &v2)
Calculate unsigned angle between vectors v1 and v2.
TGLVector3 WorldDeltaToViewport(const TGLVertex3 &worldRef, const TGLVector3 &worldDelta) const
Convert a 3D vector worldDelta (shift) about vertex worldRef to a viewport (screen) '3D' vector...
TGLLine3 CalculateRingLine(const TPoint &mouse, const TGLCamera &camera) const
Calculated interaction line between 'mouse' viewport point, and current selected widget (ring)...
virtual ~TGLRotateManip()
Destroy the rotation manipulator.
void Set(const TGLPlane &other)
Assign from other.
std::pair< Bool_t, TGLLine3 > Intersection(const TGLPlane &p1, const TGLPlane &p2)
Find 3D line interestion of this plane with 'other'.