15#include "TGLIncludes.h"
46 if (
Dot(cross,ref) > 0.0) {
102 Double_t ringRadius = baseScale*10.0;
108 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
109 glDisable(GL_CULL_FACE);
159 activeVector *= ringRadius;
165 glEnable(GL_CULL_FACE);
192 if ((planeEyeAngle > -shallowDelta) && (planeEyeAngle < shallowDelta)) {
242 if (!nearLineIntersection.first) {
243 Error(
"TGLRotateManip::CalculateAngleDelta",
"active ring plane parallel to near clip?");
246 TGLLine3 nearLine = nearLineIntersection.second;
253 Double_t angle =
Dot(activePlaneNear, mouseDelta) / 150.0;
274 TPoint mouseViewport(mouse);
285 if (!ringPlaneInter.first) {
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
Double_t Dot(const TGLVector3 &v1, const TGLVector3 &v2)
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.
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...
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
TGLVertex3 ViewportToWorld(const TGLVertex3 &viewportVertex, TGLMatrix *modviewMat=nullptr) const
Convert a '3D' viewport vertex to 3D world one.
3D space, fixed length, line class, with direction / length 'vector', passing through point 'vertex'.
const TGLVector3 & Vector() const
const TGLVertex3 & Start() const
TPoint fLastMouse
! last (latest) 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
! manipulator is active?
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
! active width (axis) component
TGLPhysicalShape * fShape
! manipulated shape
TGLManip(const TGLManip &)
Copy constructor.
Concrete physical shape - a GL drawable.
Bool_t fShallowFront
! front or back of the active shallow ring?
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
! plane of the active ring (widget)
void Draw(const TGLCamera &camera) const override
Draw rotate manipulator - axis rings drawn from attached physical center, in plane defined by axis as...
Bool_t HandleMotion(const Event_t &event, const TGLCamera &camera) override
Handle mouse motion over manipulator - if active (selected widget) rotate physical around selected ri...
TGLVertex3 fActiveRingCenter
! center of active ring
~TGLRotateManip() override
Destroy the rotation manipulator.
TGLRotateManip()
Construct rotation manipulator not bound to any physical shape.
Bool_t HandleButton(const Event_t &event, const TGLCamera &camera) override
Handle mouse button event over manipulator - returns kTRUE if redraw required kFALSE otherwise.
Bool_t fShallowRing
! does active ring form shallow angle to eye?
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 box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Double_t ACos(Double_t)
Returns the principal value of the arc cosine of x, expressed in radians.
Double_t ASin(Double_t)
Returns the principal value of the arc sine of x, expressed in radians.
Int_t fY
pointer x, y coordinates in event window