Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
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 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 Attach (TGLPhysicalShape *shape)
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 GetActive () const
TGLPhysicalShapeGetAttached () const
UInt_t GetSelectedWidget () const
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.
TClassIsA () const override
Bool_t Select (const TGLCamera &, const TGLRect &, const TGLBoundingBox &) override
void SetActive (Bool_t a)
void SetSelectedWidget (UInt_t s)
void Streamer (TBuffer &) override
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)

Static Public Member Functions

static TClassClass ()
static const char * Class_Name ()
static constexpr Version_t Class_Version ()
static const char * DeclFileName ()

Protected Member Functions

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_tColorFor (UInt_t widget) const
 Returns color to be used for given widget.

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.

Protected Attributes

Bool_t fActive
 ! manipulator is active?
TPoint fFirstMouse
 ! first (start) mouse position (in WINDOW coords)
TPoint fLastMouse
 ! last (latest) mouse position (in WINDOW coords)
UInt_t fSelectedWidget
 ! active width (axis) component
TGLPhysicalShapefShape
 ! manipulated shape

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
 ! center of active ring
TGLPlane fActiveRingPlane
 ! plane of the active ring (widget)
TGLLine3 fRingLine
TGLLine3 fRingLineOld
Bool_t fShallowFront
 ! front or back of the active shallow ring?
Bool_t fShallowRing
 ! does active ring form shallow angle to eye?

#include <TGLRotateManip.h>

Inheritance diagram for TGLRotateManip:
TGLManip TVirtualGLManip

Constructor & Destructor Documentation

◆ TGLRotateManip() [1/2]

TGLRotateManip::TGLRotateManip ( )

Construct rotation manipulator not bound to any physical shape.

Definition at line 56 of file TGLRotateManip.cxx.

◆ TGLRotateManip() [2/2]

TGLRotateManip::TGLRotateManip ( TGLPhysicalShape * shape)

Construct rotation manipulator bound to TGLPhysicalShape 'shape'.

Definition at line 68 of file TGLRotateManip.cxx.

◆ ~TGLRotateManip()

TGLRotateManip::~TGLRotateManip ( )
override

Destroy the rotation manipulator.

Definition at line 81 of file TGLRotateManip.cxx.

Member Function Documentation

◆ Angle() [1/2]

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

Calculate unsigned angle between vectors v1 and v2.

Definition at line 32 of file TGLRotateManip.cxx.

◆ Angle() [2/2]

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 42 of file TGLRotateManip.cxx.

◆ Attach()

void TGLManip::Attach ( TGLPhysicalShape * shape)
inlineinherited

Definition at line 58 of file TGLManip.h.

◆ CalcDrawScale()

void TGLManip::CalcDrawScale ( const TGLBoundingBox & box,
const TGLCamera & camera,
Double_t & base,
TGLVector3 axis[3] ) const
protectedinherited

Calculates base and axis scale factor (in world units) for drawing manipulators with reasonable size range in current camera.

Definition at line 152 of file TGLManip.cxx.

◆ CalculateAngleDelta()

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

Calculate angle delta for rotation based on new mouse position.

Definition at line 237 of file TGLRotateManip.cxx.

◆ CalculateRingLine()

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 271 of file TGLRotateManip.cxx.

◆ Class()

TClass * TGLRotateManip::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

const char * TGLRotateManip::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

constexpr Version_t TGLRotateManip::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 53 of file TGLRotateManip.h.

◆ ColorFor()

const UChar_t * TGLManip::ColorFor ( UInt_t widget) const
protectedinherited

Returns color to be used for given widget.

Definition at line 93 of file TGLManip.cxx.

◆ DeclFileName()

const char * TGLRotateManip::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 53 of file TGLRotateManip.h.

◆ Draw()

void TGLRotateManip::Draw ( const TGLCamera & camera) const
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 91 of file TGLRotateManip.cxx.

◆ DrawAxisRing()

void TGLRotateManip::DrawAxisRing ( const TGLVertex3 & origin,
const TGLVector3 & axis,
Double_t radius,
Float_t rgba[4] ) const
private

◆ GetActive()

Bool_t TGLManip::GetActive ( ) const
inlineinherited

Definition at line 55 of file TGLManip.h.

◆ GetAttached()

TGLPhysicalShape * TGLManip::GetAttached ( ) const
inlineinherited

Definition at line 59 of file TGLManip.h.

◆ GetSelectedWidget()

UInt_t TGLManip::GetSelectedWidget ( ) const
inlineinherited

Definition at line 52 of file TGLManip.h.

◆ HandleButton()

Bool_t TGLRotateManip::HandleButton ( const Event_t & event,
const TGLCamera & camera )
overridevirtual

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

Reimplemented from TGLManip.

Definition at line 173 of file TGLRotateManip.cxx.

◆ HandleMotion()

Bool_t TGLRotateManip::HandleMotion ( const Event_t & event,
const TGLCamera & camera )
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 220 of file TGLRotateManip.cxx.

◆ IsA()

TClass * TGLRotateManip::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from TGLManip.

Definition at line 53 of file TGLRotateManip.h.

◆ Select()

Bool_t TGLManip::Select ( const TGLCamera & ,
const TGLRect & ,
const TGLBoundingBox &  )
inlineoverridevirtualinherited

Implements TVirtualGLManip.

Definition at line 63 of file TGLManip.h.

◆ SetActive()

void TGLManip::SetActive ( Bool_t a)
inlineinherited

Definition at line 56 of file TGLManip.h.

◆ SetSelectedWidget()

void TGLManip::SetSelectedWidget ( UInt_t s)
inlineinherited

Definition at line 53 of file TGLManip.h.

◆ Streamer()

void TGLRotateManip::Streamer ( TBuffer & )
overridevirtual

Reimplemented from TGLManip.

◆ StreamerNVirtual()

void TGLRotateManip::StreamerNVirtual ( TBuffer & ClassDef_StreamerNVirtual_b)
inline

Definition at line 53 of file TGLRotateManip.h.

Member Data Documentation

◆ fActive

Bool_t TGLManip::fActive
protectedinherited

! manipulator is active?

Definition at line 33 of file TGLManip.h.

◆ fActiveRingCenter

TGLVertex3 TGLRotateManip::fActiveRingCenter
private

! center of active ring

Definition at line 28 of file TGLRotateManip.h.

◆ fActiveRingPlane

TGLPlane TGLRotateManip::fActiveRingPlane
private

! plane of the active ring (widget)

Definition at line 27 of file TGLRotateManip.h.

◆ fFirstMouse

TPoint TGLManip::fFirstMouse
protectedinherited

! first (start) mouse position (in WINDOW coords)

Definition at line 36 of file TGLManip.h.

◆ fLastMouse

TPoint TGLManip::fLastMouse
protectedinherited

! last (latest) mouse position (in WINDOW coords)

Definition at line 37 of file TGLManip.h.

◆ fRingLine

TGLLine3 TGLRotateManip::fRingLine
private

Definition at line 32 of file TGLRotateManip.h.

◆ fRingLineOld

TGLLine3 TGLRotateManip::fRingLineOld
private

Definition at line 33 of file TGLRotateManip.h.

◆ fSelectedWidget

UInt_t TGLManip::fSelectedWidget
protectedinherited

! active width (axis) component

Definition at line 32 of file TGLManip.h.

◆ fShallowFront

Bool_t TGLRotateManip::fShallowFront
private

! front or back of the active shallow ring?

Definition at line 26 of file TGLRotateManip.h.

◆ fShallowRing

Bool_t TGLRotateManip::fShallowRing
private

! does active ring form shallow angle to eye?

Definition at line 25 of file TGLRotateManip.h.

◆ fShape

TGLPhysicalShape* TGLManip::fShape
protectedinherited

! manipulated shape

Definition at line 31 of file TGLManip.h.


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