Overview | All Modules | Tutorial | User's Guide | Programming Guide |
Previous | COVISE Online Documentation | Next |
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>
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 coUIContainer * | getParent () |
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 coUIUserData * | getUserData () const |
Returns the current userdata object. More... | |
virtual vruiTransformNode * | getDCS () |
virtual vruiUIElementProvider * | getUIElementProvider () 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 vruiMatrix * | getMatrixFromPositionHprScale (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 vruiMatrix * | getTransformMatrix () |
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... | |
coCombinedButtonInteraction * | interactionA |
interaction for first button More... | |
coCombinedButtonInteraction * | interactionWheel [2] |
bool | unregister |
true if the interaction should be unregistered More... | |
float | dialSize |
size of slider dial More... | |
coSliderActor * | myActor |
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... | |
vruiUIElementProvider * | uiElementProvider |
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... | |
This class provides a basic 3D slider, which is based on a texture mapped tickmark field and a round slider position indicator.
vrui::coSlider::coSlider | ( | coSliderActor * | actor, |
bool | showValue = true |
||
) |
Constructor.
actor | pointer to the coSliderActor which is called on slider events |
showValue | true = slider value is to be displayed next to the slider position indicator (optional) |
|
virtual |
Destructor.
The slider is removed from all parents to which it is attached.
|
static |
|
protected |
|
inlinevirtual |
|
virtual |
get the Element's classname
Reimplemented from vrui::coUIElement.
float vrui::coSlider::getDialSize | ( | ) | const |
|
inlinevirtual |
Returns element height.
Implements vrui::coUIElement.
float vrui::coSlider::getLinearMax | ( | ) | const |
float vrui::coSlider::getLinearMin | ( | ) | const |
float vrui::coSlider::getLinearValue | ( | ) | const |
float vrui::coSlider::getMax | ( | ) | const |
Returns the maximum slider value.
float vrui::coSlider::getMin | ( | ) | const |
Returns the minimum slider value.
float vrui::coSlider::getNumTicks | ( | ) | const |
Returns the number of tickmarks used on the dial.
int vrui::coSlider::getPrecision | ( | ) | const |
Returns the number of decimals used for the slider value display.
bool vrui::coSlider::getShowValue | ( | ) | const |
float vrui::coSlider::getValue | ( | ) | const |
Returns the current slider value.
|
inlinevirtual |
Returns element width.
Implements vrui::coUIElement.
|
inlinevirtual |
Returns element x position.
Implements vrui::coUIElement.
|
inlinevirtual |
Returns element y position.
Implements vrui::coUIElement.
|
inlinevirtual |
|
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.
hit | hit |
Implements vrui::coAction.
bool vrui::coSlider::isInteger | ( | ) | const |
Returns true if only integer slider values are accepted.
bool vrui::coSlider::isLogarithmic | ( | ) | const |
|
virtual |
check if the Element or any ancestor is this classname
Reimplemented from vrui::coUIElement.
void vrui::coSlider::joystickDown | ( | ) |
decrementslidervalue
void vrui::coSlider::joystickUp | ( | ) |
increment slidervalue
|
virtual |
This method is called when the pointer leaves the slider. Then the highlight is removed.
Reimplemented from vrui::coAction.
void vrui::coSlider::resetLastPressAction | ( | ) |
no last press action
|
virtual |
functions activates or deactivates the slider
|
virtual |
void vrui::coSlider::setInteger | ( | bool | i | ) |
Sets the integer mode.
i | true = slider accepts only integer values, false = floating point values are accepted |
void vrui::coSlider::setLogarithmic | ( | bool | on | ) |
void vrui::coSlider::setMax | ( | float | ma | ) |
Sets a new maximum value for the slider range.
void vrui::coSlider::setMin | ( | float | mi | ) |
Sets a new minimum value for the slider range.
void vrui::coSlider::setNumTicks | ( | float | nt | ) |
Sets the number of tickmarks to be used on the dial.
|
virtual |
Sets the slider position in object space [mm].
Implements vrui::coUIElement.
void vrui::coSlider::setPrecision | ( | int | nt | ) |
Sets the number of digits to use for the slider value display.
|
virtual |
Sets the slider size.
The slider height is set to 1/3 the slider width, the depth is set to zero.
s | new slider width [mm] |
Reimplemented from vrui::coUIElement.
|
virtual |
Sets the slider size, using different values for all dimensions.
xs,ys,zs | new slider sizes [mm] |
Reimplemented from vrui::coUIElement.
void vrui::coSlider::setValue | ( | float | v, |
bool | generateEvent = false |
||
) |
Sets the slider to a new value.
The position indicator is adjusted accordingly.
v | new slider value |
generateEvent | true to generate a sliderEvent |
|
protectedvirtual |
This routine is called in each frame displayed by the system.
Implements vrui::coUpdateable.
|
protected |
flag if slider is active
|
protected |
size of slider dial
|
protected |
true = slider processes only integer values
|
protected |
interaction for first button
interaction for wheel
|
protected |
|
protected |
|
mutableprotected |
current linear slider value (=value or log(value))
|
protected |
true = slider shows logarithm of value
|
protected |
maximum slider value
|
protected |
minimum slider value
|
protected |
action listener for slider events
|
protected |
slider depth [mm]
|
protected |
slider height [mm]
|
protected |
slider width [mm]
|
protected |
slider element x position in object space [mm]
|
protected |
slider element y position in object space [mm]
|
protected |
slider element z position in object space [mm]
|
protected |
number of tickmarks on slider dial
|
protected |
precision of slider value display: number of decimals
|
protected |
true = the slider value is displayed
|
protected |
true if the interaction should be unregistered
|
mutableprotected |
current slider value
|
protected |
indicates a value change since last readout
Previous | Next |
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
|