Rotate manipulator - attaches to physical shape and draws local axes widgets - rings drawn from attached physical center, in plane defined by axis.
User can mouse over (turns yellow) and L click/drag to rotate attached physical round the ring center. Widgets use standard 3D package axes colours: X red, Y green, Z blue.
Definition at line 18 of file TGLRotateManip.h.
Public Member Functions | |
TGLRotateManip () | |
Construct rotation manipulator not bound to any physical shape. | |
TGLRotateManip (TGLPhysicalShape *shape) | |
Construct rotation manipulator bound to TGLPhysicalShape 'shape'. | |
~TGLRotateManip () override | |
Destroy the rotation manipulator. | |
void | Draw (const TGLCamera &camera) const override |
Draw rotate manipulator - axis rings drawn from attached physical center, in plane defined by axis as normal, in red(X), green(Y) and blue(Z), with white center sphere. | |
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 | HandleMotion (const Event_t &event, const TGLCamera &camera) override |
Handle mouse motion over manipulator - if active (selected widget) rotate physical around selected ring widget plane normal. | |
TClass * | IsA () const override |
void | Streamer (TBuffer &) override |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
Public Member Functions inherited from TGLManip | |
TGLManip () | |
Construct a manipulator object, bound to supplied viewer, and no physical shape. | |
TGLManip (TGLPhysicalShape *shape) | |
Construct a manipulator object, bound to supplied physical shape. | |
~TGLManip () override | |
Destroy manipulator object. | |
void | Attach (TGLPhysicalShape *shape) |
Bool_t | GetActive () const |
TGLPhysicalShape * | GetAttached () const |
UInt_t | GetSelectedWidget () const |
Bool_t | Select (const TGLCamera &, const TGLRect &, const TGLBoundingBox &) override |
void | SetActive (Bool_t a) |
void | SetSelectedWidget (UInt_t s) |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
Public Member Functions inherited from TVirtualGLManip | |
virtual | ~TVirtualGLManip () |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
Static Public Member Functions | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
Static Public Member Functions inherited from TGLManip | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
Static Public Member Functions inherited from TVirtualGLManip | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
Static Protected Member Functions | |
static Double_t | Angle (const TGLVector3 &v1, const TGLVector3 &v2) |
Calculate unsigned angle between vectors v1 and v2. | |
static Double_t | Angle (const TGLVector3 &v1, const TGLVector3 &v2, const TGLVector3 &ref) |
Calculate signed angle between vectors v1 and v2, using ref to define right handed coord system. | |
Private Member Functions | |
Double_t | CalculateAngleDelta (const TPoint &mouse, const TGLCamera &camera) |
Calculate angle delta for rotation based on new mouse position. | |
TGLLine3 | CalculateRingLine (const TPoint &mouse, const TGLCamera &camera) const |
Calculated interaction line between 'mouse' viewport point, and current selected widget (ring), under supplied 'camera' projection. | |
void | DrawAxisRing (const TGLVertex3 &origin, const TGLVector3 &axis, Double_t radius, Float_t rgba[4]) const |
Private Attributes | |
TGLVertex3 | fActiveRingCenter |
plane of the active ring (widget) | |
TGLPlane | fActiveRingPlane |
front or back of the active shallow ring? | |
TGLLine3 | fRingLine |
center of active ring | |
TGLLine3 | fRingLineOld |
Bool_t | fShallowFront |
does active ring form shallow angle to eye? | |
Bool_t | fShallowRing |
Additional Inherited Members | |
Protected Member Functions inherited from TGLManip | |
TGLManip (const TGLManip &) | |
last (latest) 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 range in current camera. | |
const UChar_t * | ColorFor (UInt_t widget) const |
Returns color to be used for given widget. | |
TGLManip & | operator= (const TGLManip &) |
Assignment operator. | |
Protected Attributes inherited from TGLManip | |
Bool_t | fActive |
active width (axis) component | |
TPoint | fFirstMouse |
manipulator is active? | |
TPoint | fLastMouse |
first (start) mouse position (in WINDOW coords) | |
UInt_t | fSelectedWidget |
manipulated shape | |
TGLPhysicalShape * | fShape |
#include <TGLRotateManip.h>
TGLRotateManip::TGLRotateManip | ( | ) |
Construct rotation manipulator not bound to any physical shape.
Definition at line 57 of file TGLRotateManip.cxx.
TGLRotateManip::TGLRotateManip | ( | TGLPhysicalShape * | shape | ) |
Construct rotation manipulator bound to TGLPhysicalShape 'shape'.
Definition at line 69 of file TGLRotateManip.cxx.
|
override |
Destroy the rotation manipulator.
Definition at line 82 of file TGLRotateManip.cxx.
|
staticprotected |
Calculate unsigned angle between vectors v1 and v2.
Definition at line 33 of file TGLRotateManip.cxx.
|
staticprotected |
Calculate signed angle between vectors v1 and v2, using ref to define right handed coord system.
Definition at line 43 of file TGLRotateManip.cxx.
|
private |
Calculate angle delta for rotation based on new mouse position.
Definition at line 238 of file TGLRotateManip.cxx.
|
private |
Calculated interaction line between 'mouse' viewport point, and current selected widget (ring), under supplied 'camera' projection.
Definition at line 272 of file TGLRotateManip.cxx.
|
static |
|
inlinestaticconstexpr |
Definition at line 53 of file TGLRotateManip.h.
|
inlinestatic |
Definition at line 53 of file TGLRotateManip.h.
|
overridevirtual |
Draw rotate manipulator - axis rings drawn from attached physical center, in plane defined by axis as normal, in red(X), green(Y) and blue(Z), with white center sphere.
If selected widget (mouse over) this is drawn in active colour (yellow).
Implements TGLManip.
Definition at line 92 of file TGLRotateManip.cxx.
|
private |
|
overridevirtual |
Handle mouse button event over manipulator - returns kTRUE if redraw required kFALSE otherwise.
Reimplemented from TGLManip.
Definition at line 174 of file TGLRotateManip.cxx.
|
overridevirtual |
Handle mouse motion over manipulator - if active (selected widget) rotate physical around selected ring widget plane normal.
Returns kTRUE if redraw required kFALSE otherwise.
Reimplemented from TGLManip.
Definition at line 221 of file TGLRotateManip.cxx.
|
inlineoverridevirtual |
Reimplemented from TGLManip.
Definition at line 53 of file TGLRotateManip.h.
|
inline |
Definition at line 53 of file TGLRotateManip.h.
|
private |
plane of the active ring (widget)
Definition at line 28 of file TGLRotateManip.h.
|
private |
front or back of the active shallow ring?
Definition at line 27 of file TGLRotateManip.h.
|
private |
center of active ring
Definition at line 32 of file TGLRotateManip.h.
|
private |
Definition at line 33 of file TGLRotateManip.h.
|
private |
does active ring form shallow angle to eye?
Definition at line 26 of file TGLRotateManip.h.
|
private |
Definition at line 25 of file TGLRotateManip.h.