Overview | All Modules | Tutorial | User's Guide | Programming Guide
Previous

COVISE Online Documentation

Next

Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vrui::coSlider Class Reference

This class provides a basic 3D slider, which is based on a texture mapped tickmark field and a round slider position indicator. More...

#include <coSlider.h>

Inheritance diagram for vrui::coSlider:
vrui::coAction vrui::coUIElement vrui::coUpdateable

Public Member Functions

 coSlider (coSliderActor *actor, bool showValue=true)
 Constructor. More...
 
virtual ~coSlider ()
 Destructor. More...
 
virtual int hit (vruiHit *hit)
 This method is called when the input device intersects the slider. More...
 
virtual void miss ()
 This method is called when the pointer leaves the slider. Then the highlight is removed. More...
 
void joystickUp ()
 increment slidervalue More...
 
void joystickDown ()
 decrementslidervalue More...
 
void resetLastPressAction ()
 no last press action More...
 
void setValue (float val, bool generateEvent=false)
 Sets the slider to a new value. More...
 
float getValue () const
 Returns the current slider value. More...
 
float getLinearValue () const
 
void setMin (float mi)
 Sets a new minimum value for the slider range. More...
 
float getMin () const
 Returns the minimum slider value. More...
 
float getLinearMin () const
 
void setMax (float ma)
 Sets a new maximum value for the slider range. More...
 
float getMax () const
 Returns the maximum slider value. More...
 
float getLinearMax () const
 
void setNumTicks (float nt)
 Sets the number of tickmarks to be used on the dial. More...
 
float getNumTicks () const
 Returns the number of tickmarks used on the dial. More...
 
void setPrecision (int nt)
 Sets the number of digits to use for the slider value display. More...
 
int getPrecision () const
 Returns the number of decimals used for the slider value display. More...
 
void setInteger (bool on)
 Sets the integer mode. More...
 
bool isInteger () const
 Returns true if only integer slider values are accepted. More...
 
void setLogarithmic (bool on)
 
bool isLogarithmic () const
 
float getDialSize () const
 
void setPos (float x, float y, float z=0.0f)
 Sets the slider position in object space [mm]. More...
 
virtual void setHighlighted (bool highlighted)
 Set highlight state. More...
 
virtual void setSize (float x, float y, float z)
 Sets the slider size, using different values for all dimensions. More...
 
virtual void setSize (float size)
 Sets the slider size. More...
 
virtual float getWidth () const
 Returns element width. More...
 
virtual float getHeight () const
 Returns element height. More...
 
virtual float getXpos () const
 Returns element x position. More...
 
virtual float getYpos () const
 Returns element y position. More...
 
virtual float getZpos () const
 Get z position. More...
 
virtual void setActive (bool a)
 functions activates or deactivates the slider More...
 
virtual bool getActive ()
 
bool getShowValue () const
 
virtual const char * getClassName () const
 get the Element's classname More...
 
virtual bool isOfClassName (const char *) const
 check if the Element or any ancestor is this classname More...
 
- Public Member Functions inherited from vrui::coAction
 coAction ()
 Constructor. More...
 
virtual ~coAction ()
 Destructor. More...
 
virtual int hit (vruiHit *hit)=0
 hit is called whenever the node, or any node underneath the node with this action is intersected return ACTION_CALL_ON_MISS if you want miss to be called otherwise return ACTION_DONE More...
 
virtual void miss ()
 miss is called once after a hit, if the node is not intersected anymore More...
 
void setFrame (unsigned int frame)
 INTERNAL set the framecounter (used to produce the miss call) More...
 
unsigned int getFrame () const
 INTERNAL get the framecounter (used to produce the miss call) More...
 
void setNode (vruiNode *)
 INTERNAL set the node this action belongs to. More...
 
void addChild (coAction *)
 INTERNAL add a child action. More...
 
virtual int hitAll (vruiHit *hit)
 INTERNAL same as miss/hit, but do it for all children as well. More...
 
virtual void missAll ()
 INTERNAL same as miss/hit, but do it for all children as well. More...
 
- Public Member Functions inherited from vrui::coUIElement
 coUIElement ()
 
virtual ~coUIElement ()
 Destructor. More...
 
virtual void createGeometry ()
 
virtual void setParent (coUIContainer *)
 Set parent container. More...
 
virtual coUIContainergetParent ()
 Get parent container. More...
 
virtual void setEnabled (bool enabled)
 Set activation state. More...
 
virtual void setHighlighted (bool highlighted)
 Set highlight state. More...
 
virtual void setVisible (bool visible)
 Set element visibility. More...
 
virtual bool isEnabled () const
 Get activation state. More...
 
virtual bool isHighlighted () const
 Get highlight state. More...
 
virtual bool isVisible () const
 Get visibility state. More...
 
virtual float getWidth () const =0
 Returns element width. More...
 
virtual float getHeight () const =0
 Returns element height. More...
 
virtual float getDepth () const
 Get z axis object size. More...
 
virtual float getXpos () const =0
 Returns element x position. More...
 
virtual float getYpos () const =0
 Returns element y position. More...
 
virtual float getZpos () const
 Get z position. More...
 
virtual void childResized (bool shrink=true)
 This method is called by children whenever they change their size Implementations of this method should call the childResized() of their parent container. More...
 
virtual void resizeToParent (float, float, float, bool shrink=true)
 This method is called by containers after they resized to allow children to adjust their geometry to the new parents' size Children must not call childResized() of their parent here, as this could lead to an infinite loop. More...
 
virtual void shrinkToMin ()
 Set element location in space. More...
 
virtual void setPos (float, float, float)=0
 
virtual void setSize (float, float, float)
 Set UI element size. More...
 
virtual void setSize (float)
 Set UI element size, use equal values for all dimensions. More...
 
virtual float getResizePref ()
 
virtual void setUserData (coUIUserData *)
 Set the current userdata object. More...
 
virtual coUIUserDatagetUserData () const
 Returns the current userdata object. More...
 
virtual vruiTransformNodegetDCS ()
 
virtual vruiUIElementProvidergetUIElementProvider () const
 
virtual void setAttachment (int)
 sets the attachment border More...
 
virtual int getAttachment () const
 returns the attachment border More...
 
void setUniqueName (const char *)
 
const char * getUniqueName () const
 
virtual const char * getClassName () const
 get the Element's classname More...
 
virtual bool isOfClassName (const char *) const
 check if the Element or any ancestor is this classname More...
 
- Public Member Functions inherited from vrui::coUpdateable
 coUpdateable ()
 Constructor. More...
 
virtual ~coUpdateable ()
 you should adds this object to the update manager in your constructor More...
 
virtual bool update ()=0
 this method is called once per frame as long as it returns true. More...
 

Static Public Member Functions

static void adjustSlider (float &mini, float &maxi, float &, float &step, int &digits)
 
- Static Public Member Functions inherited from vrui::coUIElement
static vruiMatrixgetMatrixFromPositionHprScale (float x, float y, float z, float h, float p, float r, float scale)
 Constructor. More...
 

Protected Member Functions

void clamp () const
 
virtual bool update ()
 This routine is called in each frame displayed by the system. More...
 
- Protected Member Functions inherited from vrui::coUIElement
virtual void resizeGeometry ()
 
virtual const vruiMatrixgetTransformMatrix ()
 

Protected Attributes

bool integer
 true = slider processes only integer values More...
 
bool logarithmic
 true = slider shows logarithm of value More...
 
bool showValue
 true = the slider value is displayed More...
 
coCombinedButtonInteractioninteractionA
 interaction for first button More...
 
coCombinedButtonInteractioninteractionWheel [2]
 
bool unregister
 true if the interaction should be unregistered More...
 
float dialSize
 size of slider dial More...
 
coSliderActormyActor
 action listener for slider events More...
 
float myX
 slider element x position in object space [mm] More...
 
float myY
 slider element y position in object space [mm] More...
 
float myZ
 slider element z position in object space [mm] More...
 
float myWidth
 slider width [mm] More...
 
float myHeight
 slider height [mm] More...
 
float myDepth
 slider depth [mm] More...
 
float minVal
 minimum slider value More...
 
float maxVal
 maximum slider value More...
 
float value
 current slider value More...
 
float linearValue
 current linear slider value (=value or log(value)) More...
 
float numTicks
 number of tickmarks on slider dial More...
 
int precision
 precision of slider value display: number of decimals More...
 
bool valueChanged
 indicates a value change since last readout More...
 
bool active_
 flag if slider is active More...
 
long lastPressAction
 
- Protected Attributes inherited from vrui::coAction
std::string actionName
 name of this action this can be used to distinguish betwenn different types of actions like touch and intersection actions More...
 
- Protected Attributes inherited from vrui::coUIElement
float xScaleFactor
 UI element x axis scale factor. More...
 
float yScaleFactor
 UI element y axis scale factor. More...
 
float zScaleFactor
 UI element z axis scale factor. More...
 
bool enabled
 true if UI element is enabled, false if UI element cannot be used More...
 
bool highlighted
 true if highlighted More...
 
bool visible
 true if UI element is visible, false if not visible but still present in scene tree More...
 
vruiUIElementProvideruiElementProvider
 

Additional Inherited Members

- Public Types inherited from vrui::coAction
enum  Result { ACTION_DONE = 0x00 , ACTION_CALL_ON_MISS = 0x01 , ACTION_UNDEF = 0x02 }
 
- Public Types inherited from vrui::coUIElement
enum  Material {
  RED = 0 , GREEN , BLUE , YELLOW ,
  GREY , WHITE , BLACK , DARK_YELLOW ,
  WHITE_NL , ITEM_BACKGROUND_NORMAL , ITEM_BACKGROUND_HIGHLIGHTED , ITEM_BACKGROUND_DISABLED ,
  HANDLE_BACKGROUND_NORMAL , HANDLE_BACKGROUND_HIGHLIGHTED , HANDLE_BACKGROUND_DISABLED , BACKGROUND ,
  NUM_MATERIALS
}
 Color definitions, to be used whenever a material is needed. More...
 
enum  {
  LEFT = 0 , TOP , RIGHT , BOTTOM ,
  REPLACE
}
 attachment order is counterclockwise like this and describes the side/border which the item is attached to! More...
 
- Public Attributes inherited from vrui::coUIElement
enum vrui::coUIElement:: { ... }  Attachments
 attachment order is counterclockwise like this and describes the side/border which the item is attached to! More...
 

Detailed Description

This class provides a basic 3D slider, which is based on a texture mapped tickmark field and a round slider position indicator.

Constructor & Destructor Documentation

◆ coSlider()

vrui::coSlider::coSlider ( coSliderActor actor,
bool  showValue = true 
)

Constructor.

Parameters
actorpointer to the coSliderActor which is called on slider events
showValuetrue = slider value is to be displayed next to the slider position indicator (optional)

◆ ~coSlider()

vrui::coSlider::~coSlider ( )
virtual

Destructor.

The slider is removed from all parents to which it is attached.

Member Function Documentation

◆ adjustSlider()

void vrui::coSlider::adjustSlider ( float &  mini,
float &  maxi,
float &  ,
float &  step,
int &  digits 
)
static

◆ clamp()

void vrui::coSlider::clamp ( ) const
protected

◆ getActive()

virtual bool vrui::coSlider::getActive ( )
inlinevirtual

◆ getClassName()

const char * vrui::coSlider::getClassName ( ) const
virtual

get the Element's classname

Reimplemented from vrui::coUIElement.

◆ getDialSize()

float vrui::coSlider::getDialSize ( ) const

◆ getHeight()

virtual float vrui::coSlider::getHeight ( ) const
inlinevirtual

Returns element height.

Implements vrui::coUIElement.

◆ getLinearMax()

float vrui::coSlider::getLinearMax ( ) const

◆ getLinearMin()

float vrui::coSlider::getLinearMin ( ) const

◆ getLinearValue()

float vrui::coSlider::getLinearValue ( ) const

◆ getMax()

float vrui::coSlider::getMax ( ) const

Returns the maximum slider value.

◆ getMin()

float vrui::coSlider::getMin ( ) const

Returns the minimum slider value.

◆ getNumTicks()

float vrui::coSlider::getNumTicks ( ) const

Returns the number of tickmarks used on the dial.

◆ getPrecision()

int vrui::coSlider::getPrecision ( ) const

Returns the number of decimals used for the slider value display.

◆ getShowValue()

bool vrui::coSlider::getShowValue ( ) const
Returns
true if the slider value is displayed

◆ getValue()

float vrui::coSlider::getValue ( ) const

Returns the current slider value.

◆ getWidth()

virtual float vrui::coSlider::getWidth ( ) const
inlinevirtual

Returns element width.

Implements vrui::coUIElement.

◆ getXpos()

virtual float vrui::coSlider::getXpos ( ) const
inlinevirtual

Returns element x position.

Implements vrui::coUIElement.

◆ getYpos()

virtual float vrui::coSlider::getYpos ( ) const
inlinevirtual

Returns element y position.

Implements vrui::coUIElement.

◆ getZpos()

virtual float vrui::coSlider::getZpos ( ) const
inlinevirtual

Get z position.

Returns
z position

Reimplemented from vrui::coUIElement.

◆ hit()

int vrui::coSlider::hit ( vruiHit hit)
virtual

This method is called when the input device intersects the slider.

If it does, the slider is highlighted and the pointer is grabbed and slider value changes are computed accordingly.

Parameters
hithit

Implements vrui::coAction.

◆ isInteger()

bool vrui::coSlider::isInteger ( ) const

Returns true if only integer slider values are accepted.

◆ isLogarithmic()

bool vrui::coSlider::isLogarithmic ( ) const

◆ isOfClassName()

bool vrui::coSlider::isOfClassName ( const char *  classname) const
virtual

check if the Element or any ancestor is this classname

Reimplemented from vrui::coUIElement.

◆ joystickDown()

void vrui::coSlider::joystickDown ( )

decrementslidervalue

◆ joystickUp()

void vrui::coSlider::joystickUp ( )

increment slidervalue

◆ miss()

void vrui::coSlider::miss ( )
virtual

This method is called when the pointer leaves the slider. Then the highlight is removed.

Reimplemented from vrui::coAction.

◆ resetLastPressAction()

void vrui::coSlider::resetLastPressAction ( )

no last press action

◆ setActive()

void vrui::coSlider::setActive ( bool  a)
virtual

functions activates or deactivates the slider

◆ setHighlighted()

void vrui::coSlider::setHighlighted ( bool  hl)
virtual

Set highlight state.

Parameters
hltrue = element highlighted

Reimplemented from vrui::coUIElement.

◆ setInteger()

void vrui::coSlider::setInteger ( bool  i)

Sets the integer mode.

Parameters
itrue = slider accepts only integer values, false = floating point values are accepted

◆ setLogarithmic()

void vrui::coSlider::setLogarithmic ( bool  on)

◆ setMax()

void vrui::coSlider::setMax ( float  ma)

Sets a new maximum value for the slider range.

◆ setMin()

void vrui::coSlider::setMin ( float  mi)

Sets a new minimum value for the slider range.

◆ setNumTicks()

void vrui::coSlider::setNumTicks ( float  nt)

Sets the number of tickmarks to be used on the dial.

◆ setPos()

void vrui::coSlider::setPos ( float  x,
float  y,
float  z = 0.0f 
)
virtual

Sets the slider position in object space [mm].

Implements vrui::coUIElement.

◆ setPrecision()

void vrui::coSlider::setPrecision ( int  nt)

Sets the number of digits to use for the slider value display.

◆ setSize() [1/2]

void vrui::coSlider::setSize ( float  s)
virtual

Sets the slider size.

The slider height is set to 1/3 the slider width, the depth is set to zero.

Parameters
snew slider width [mm]

Reimplemented from vrui::coUIElement.

◆ setSize() [2/2]

void vrui::coSlider::setSize ( float  xs,
float  ys,
float  zs 
)
virtual

Sets the slider size, using different values for all dimensions.

Parameters
xs,ys,zsnew slider sizes [mm]

Reimplemented from vrui::coUIElement.

◆ setValue()

void vrui::coSlider::setValue ( float  v,
bool  generateEvent = false 
)

Sets the slider to a new value.

The position indicator is adjusted accordingly.

Parameters
vnew slider value
generateEventtrue to generate a sliderEvent

◆ update()

bool vrui::coSlider::update ( )
protectedvirtual

This routine is called in each frame displayed by the system.

Implements vrui::coUpdateable.

Member Data Documentation

◆ active_

bool vrui::coSlider::active_
protected

flag if slider is active

◆ dialSize

float vrui::coSlider::dialSize
protected

size of slider dial

◆ integer

bool vrui::coSlider::integer
protected

true = slider processes only integer values

◆ interactionA

coCombinedButtonInteraction* vrui::coSlider::interactionA
protected

interaction for first button

interaction for wheel

◆ interactionWheel

coCombinedButtonInteraction* vrui::coSlider::interactionWheel[2]
protected

◆ lastPressAction

long vrui::coSlider::lastPressAction
protected

◆ linearValue

float vrui::coSlider::linearValue
mutableprotected

current linear slider value (=value or log(value))

◆ logarithmic

bool vrui::coSlider::logarithmic
protected

true = slider shows logarithm of value

◆ maxVal

float vrui::coSlider::maxVal
protected

maximum slider value

◆ minVal

float vrui::coSlider::minVal
protected

minimum slider value

◆ myActor

coSliderActor* vrui::coSlider::myActor
protected

action listener for slider events

◆ myDepth

float vrui::coSlider::myDepth
protected

slider depth [mm]

◆ myHeight

float vrui::coSlider::myHeight
protected

slider height [mm]

◆ myWidth

float vrui::coSlider::myWidth
protected

slider width [mm]

◆ myX

float vrui::coSlider::myX
protected

slider element x position in object space [mm]

◆ myY

float vrui::coSlider::myY
protected

slider element y position in object space [mm]

◆ myZ

float vrui::coSlider::myZ
protected

slider element z position in object space [mm]

◆ numTicks

float vrui::coSlider::numTicks
protected

number of tickmarks on slider dial

◆ precision

int vrui::coSlider::precision
protected

precision of slider value display: number of decimals

◆ showValue

bool vrui::coSlider::showValue
protected

true = the slider value is displayed

◆ unregister

bool vrui::coSlider::unregister
protected

true if the interaction should be unregistered

◆ value

float vrui::coSlider::value
mutableprotected

current slider value

◆ valueChanged

bool vrui::coSlider::valueChanged
protected

indicates a value change since last readout


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

Authors: Martin Aumüller, Ruth Lang, Daniela Rainer, Jürgen Schulze-Döbold, Andreas Werner, Peter Wolf, Uwe Wössner
Copyright © 1993-2009 HLRS, 2004-2009 RRZK, 2005-2009 Visenso
COVISE Version 6.5 Academic