Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TGLScaleManip Class Reference

Scale manipulator - attaches to physical shape and draws local axes widgets with box heads.

User can mouse over (turns yellow) and L click/drag to scale along this axis.

Definition at line 28 of file TGLScaleManip.h.

Public Member Functions

 TGLScaleManip ()
 Construct scale manipulator not bound to any physical shape.
 TGLScaleManip (TGLPhysicalShape *shape)
 Construct scale manipulator bound to TGLPhysicalShape 'shape'.
 ~TGLScaleManip () override
 Destroy the scale manipulator.
void Attach (TGLPhysicalShape *shape)
void Draw (const TGLCamera &camera) const override
 Draw scale manipulator - tubes with box heads, in local axes of attached shape, 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) scale physical along selected widget (axis) of the manipulator, so it tracks mouse action.
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.

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

void LimitScale (Double_t &factor) const
 Clamp scale to sizable values: 1000 - 1/1000 Guards against div by zero problems.

Private Attributes

TGLVector3 fStartScale
 ! initial scaling factors

#include <TGLScaleManip.h>

Inheritance diagram for TGLScaleManip:
TGLManip TVirtualGLManip

Constructor & Destructor Documentation

◆ TGLScaleManip() [1/2]

TGLScaleManip::TGLScaleManip ( )

Construct scale manipulator not bound to any physical shape.

Definition at line 28 of file TGLScaleManip.cxx.

◆ TGLScaleManip() [2/2]

TGLScaleManip::TGLScaleManip ( TGLPhysicalShape * shape)

Construct scale manipulator bound to TGLPhysicalShape 'shape'.

Definition at line 35 of file TGLScaleManip.cxx.

◆ ~TGLScaleManip()

TGLScaleManip::~TGLScaleManip ( )
override

Destroy the scale manipulator.

Definition at line 43 of file TGLScaleManip.cxx.

Member Function Documentation

◆ 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.

◆ Class()

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

◆ Class_Name()

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

◆ Class_Version()

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

Definition at line 44 of file TGLScaleManip.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 * TGLScaleManip::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 44 of file TGLScaleManip.h.

◆ Draw()

void TGLScaleManip::Draw ( const TGLCamera & camera) const
overridevirtual

Draw scale manipulator - tubes with box heads, in local axes of attached shape, 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 52 of file TGLScaleManip.cxx.

◆ 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 TGLScaleManip::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 112 of file TGLScaleManip.cxx.

◆ HandleMotion()

Bool_t TGLScaleManip::HandleMotion ( const Event_t & event,
const TGLCamera & camera )
overridevirtual

Handle mouse motion over manipulator - if active (selected widget) scale physical along selected widget (axis) of the manipulator, so it tracks mouse action.

Returns kTRUE if redraw required kFALSE otherwise.

Reimplemented from TGLManip.

Definition at line 128 of file TGLScaleManip.cxx.

◆ IsA()

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

Reimplemented from TGLManip.

Definition at line 44 of file TGLScaleManip.h.

◆ LimitScale()

void TGLScaleManip::LimitScale ( Double_t & factor) const
private

Clamp scale to sizable values: 1000 - 1/1000 Guards against div by zero problems.

Definition at line 161 of file TGLScaleManip.cxx.

◆ 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 TGLScaleManip::Streamer ( TBuffer & )
overridevirtual

Reimplemented from TGLManip.

◆ StreamerNVirtual()

void TGLScaleManip::StreamerNVirtual ( TBuffer & ClassDef_StreamerNVirtual_b)
inline

Definition at line 44 of file TGLScaleManip.h.

Member Data Documentation

◆ fActive

Bool_t TGLManip::fActive
protectedinherited

! manipulator is active?

Definition at line 33 of file TGLManip.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.

◆ fSelectedWidget

UInt_t TGLManip::fSelectedWidget
protectedinherited

! active width (axis) component

Definition at line 32 of file TGLManip.h.

◆ fShape

TGLPhysicalShape* TGLManip::fShape
protectedinherited

! manipulated shape

Definition at line 31 of file TGLManip.h.

◆ fStartScale

TGLVector3 TGLScaleManip::fStartScale
private

! initial scaling factors

Definition at line 31 of file TGLScaleManip.h.


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