ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Protected Member Functions | Private Member Functions | Private Attributes | List of all members
TGLRotateManip Class Reference

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 20 of file TGLRotateManip.h.

Public Member Functions

 TGLRotateManip ()
 Construct rotation manipulator not bound to any physical shape. More...
 
 TGLRotateManip (TGLPhysicalShape *shape)
 Construct rotation manipulator bound to TGLPhysicalShape 'shape'. More...
 
virtual ~TGLRotateManip ()
 Destroy the rotation manipulator. More...
 
virtual void Draw (const TGLCamera &camera) const
 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. More...
 
virtual Bool_t HandleButton (const Event_t &event, const TGLCamera &camera)
 Handle mouse button event over manipulator - returns kTRUE if redraw required kFALSE otherwise. More...
 
virtual Bool_t HandleMotion (const Event_t &event, const TGLCamera &camera)
 Handle mouse motion over manipulator - if active (selected widget) rotate physical around selected ring widget plane normal. More...
 
 ClassDef (TGLRotateManip, 0)
 
- Public Member Functions inherited from TGLManip
 TGLManip ()
 Construct a manipulator object, bound to supplied viewer, and no physical shape. More...
 
 TGLManip (TGLPhysicalShape *shape)
 Construct a manipulator object, bound to supplied physical shape. More...
 
virtual ~TGLManip ()
 Destroy manipulator object. More...
 
UInt_t GetSelectedWidget () const
 
void SetSelectedWidget (UInt_t s)
 
Bool_t GetActive () const
 
void SetActive (Bool_t a)
 
void Attach (TGLPhysicalShape *shape)
 
TGLPhysicalShapeGetAttached () const
 
virtual Bool_t Select (const TGLCamera &, const TGLRect &, const TGLBoundingBox &)
 
 ClassDef (TGLManip, 0)
 
- Public Member Functions inherited from TVirtualGLManip
virtual ~TVirtualGLManip ()
 
 ClassDef (TVirtualGLManip, 0)
 

Static Protected Member Functions

static Double_t Angle (const TGLVector3 &v1, const TGLVector3 &v2)
 Calculate unsigned angle between vectors v1 and v2. More...
 
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. More...
 

Private Member Functions

void DrawAxisRing (const TGLVertex3 &origin, const TGLVector3 &axis, Double_t radius, Float_t rgba[4]) const
 
Double_t CalculateAngleDelta (const TPoint &mouse, const TGLCamera &camera)
 Calculate angle delta for rotation based on new mouse position. More...
 
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. More...
 

Private Attributes

Bool_t fShallowRing
 
Bool_t fShallowFront
 does active ring form shallow angle to eye? More...
 
TGLPlane fActiveRingPlane
 front or back of the active shallow ring? More...
 
TGLVertex3 fActiveRingCenter
 plane of the active ring (widget) More...
 
TGLLine3 fRingLine
 center of active ring More...
 
TGLLine3 fRingLineOld
 

Additional Inherited Members

- Protected Member Functions inherited from TGLManip
 TGLManip (const TGLManip &)
 last (latest) mouse position (in WINDOW coords) More...
 
TGLManipoperator= (const TGLManip &)
 Assignment operator. More...
 
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. More...
 
const UChar_tColorFor (UInt_t widget) const
 Returns color to be used for given widget. More...
 
- Protected Attributes inherited from TGLManip
TGLPhysicalShapefShape
 
UInt_t fSelectedWidget
 manipulated shape More...
 
Bool_t fActive
 active width (axis) component More...
 
TPoint fFirstMouse
 manipulator is active? More...
 
TPoint fLastMouse
 first (start) mouse position (in WINDOW coords) More...
 

#include <TGLRotateManip.h>

Inheritance diagram for TGLRotateManip:
[legend]

Constructor & Destructor Documentation

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.

TGLRotateManip::~TGLRotateManip ( )
virtual

Destroy the rotation manipulator.

Definition at line 82 of file TGLRotateManip.cxx.

Member Function Documentation

Double_t TGLRotateManip::Angle ( const TGLVector3 v1,
const TGLVector3 v2 
)
staticprotected

Calculate unsigned angle between vectors v1 and v2.

Definition at line 33 of file TGLRotateManip.cxx.

Referenced by Angle(), CalculateAngleDelta(), and HandleButton().

Double_t TGLRotateManip::Angle ( const TGLVector3 v1,
const TGLVector3 v2,
const TGLVector3 ref 
)
staticprotected

Calculate signed angle between vectors v1 and v2, using ref to define right handed coord system.

  • If v1.v2 parallel to ref vector: +ive for clockwise, -ive for anticlockwise
  • If v1.v2 antiparallel to ref vector: -ive for clockwise, +ive for anticlockwise

Definition at line 43 of file TGLRotateManip.cxx.

Double_t TGLRotateManip::CalculateAngleDelta ( const TPoint mouse,
const TGLCamera camera 
)
private

Calculate angle delta for rotation based on new mouse position.

Definition at line 238 of file TGLRotateManip.cxx.

Referenced by HandleMotion().

TGLLine3 TGLRotateManip::CalculateRingLine ( const TPoint mouse,
const TGLCamera camera 
) const
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.

Referenced by CalculateAngleDelta(), and HandleButton().

TGLRotateManip::ClassDef ( TGLRotateManip  ,
 
)
void TGLRotateManip::Draw ( const TGLCamera camera) const
virtual

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.

void TGLRotateManip::DrawAxisRing ( const TGLVertex3 origin,
const TGLVector3 axis,
Double_t  radius,
Float_t  rgba[4] 
) const
private
Bool_t TGLRotateManip::HandleButton ( const Event_t event,
const TGLCamera camera 
)
virtual

Handle mouse button event over manipulator - returns kTRUE if redraw required kFALSE otherwise.

Reimplemented from TGLManip.

Definition at line 174 of file TGLRotateManip.cxx.

Bool_t TGLRotateManip::HandleMotion ( const Event_t event,
const TGLCamera camera 
)
virtual

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.

Member Data Documentation

TGLVertex3 TGLRotateManip::fActiveRingCenter
private

plane of the active ring (widget)

Definition at line 30 of file TGLRotateManip.h.

Referenced by CalculateRingLine(), Draw(), HandleButton(), and HandleMotion().

TGLPlane TGLRotateManip::fActiveRingPlane
private

front or back of the active shallow ring?

Definition at line 29 of file TGLRotateManip.h.

Referenced by CalculateAngleDelta(), CalculateRingLine(), Draw(), HandleButton(), and HandleMotion().

TGLLine3 TGLRotateManip::fRingLine
private

center of active ring

Definition at line 34 of file TGLRotateManip.h.

Referenced by CalculateAngleDelta(), Draw(), and HandleButton().

TGLLine3 TGLRotateManip::fRingLineOld
private

Definition at line 35 of file TGLRotateManip.h.

Referenced by CalculateAngleDelta(), and HandleButton().

Bool_t TGLRotateManip::fShallowFront
private

does active ring form shallow angle to eye?

Definition at line 28 of file TGLRotateManip.h.

Referenced by CalculateAngleDelta(), Draw(), and HandleButton().

Bool_t TGLRotateManip::fShallowRing
private

Definition at line 27 of file TGLRotateManip.h.

Referenced by CalculateAngleDelta(), Draw(), and HandleButton().

Collaboration diagram for TGLRotateManip:
[legend]

The documentation for this class was generated from the following files: