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

COVISE Online Documentation

Next

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vrui::coValuePoti Class Reference

This class offers a poti GUI element which can be used to set integer or floating point values. More...

#include <coValuePoti.h>

Inheritance diagram for vrui::coValuePoti:
vrui::coAction vrui::coUIElement vrui::vruiCollabInterface vrui::coUpdateable vrui::coSlopePoti

Public Types

enum  { MAX_SLOPE = 1000 }
 
- 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 Types inherited from vrui::vruiCollabInterface
enum  {
  NONE = 10 , VALUEPOTI = 11 , HSVWHEEL = 12 , PUSHBUTTON = 13 ,
  TOGGLEBUTTON = 14 , FunctionEditor = 15 , PinEditor = 16
}
 

Public Member Functions

 coValuePoti (const std::string &buttonText, coValuePotiActor *actor, const std::string &backgroundTexture, vruiCOIM *cInterfaceManager=0, const std::string &interfaceName="")
 Constructor. More...
 
virtual ~coValuePoti ()
 Destructor. 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 bool update ()
 Update poti value depending on user input. More...
 
virtual void setValue (float value)
 Set poti value. More...
 
virtual void setMin (float min)
 Set minimum poti value. More...
 
virtual void setMax (float max)
 Set maximum poti value. More...
 
virtual float getValue () const
 Get poti value. More...
 
virtual int hit (vruiHit *hit)
 This method is called on intersections of the input device with the poti . More...
 
virtual void miss ()
 Called when input device leaves the element. More...
 
void joystickUp ()
 
void joystickDown ()
 
void setPos (float x, float y, float z=0.0f)
 Set poti location. More...
 
void setSize (float size)
 Set poti size. More...
 
void setSize (float width, float height, float depth)
 Set different sizes for each dimension (see setSize) More...
 
void setInteger (bool on)
 Set number type for poti value. More...
 
void setIncrement (float increment)
 Set increment for discreet poti. More...
 
void setLogarithmic (bool on)
 
void setState (float min, float max, float value, bool isInt, float inc=0.0f)
 Set maximum poti value. More...
 
virtual float getMin () const
 
virtual float getMax () const
 
virtual bool isInteger () const
 
virtual bool isDiscrete () const
 
virtual float getIncrement () const
 
virtual bool isLogarithmic () const
 
virtual float getXSize () const
 
virtual float getYSize () const
 
virtual float getZSize () const
 
virtual void setLabelVisible (bool)
 Set the poti label visibility. More...
 
virtual bool isLabelVisible ()
 This method checks if the label is visible. More...
 
const std::string & getBackgroundTexture () const
 
const std::string & getButtonText () const
 
float discreteValue (float value) 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::vruiCollabInterface
 vruiCollabInterface (vruiCOIM *manager, const std::string &interfaceName, int iType=NONE)
 Constructor. More...
 
virtual ~vruiCollabInterface ()
 Destructor, removes references to this interface from its coim. More...
 
int getType () const
 get the interface type More...
 
vruiCOIMgetManager ()
 
virtual void parseMessage (int type, unsigned int len, const char *message)
 this method is called when a message from a remote UI arrives 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...
 

Protected Member Functions

virtual void remoteLock (const char *message)
 Disable poti. More...
 
virtual void remoteOngoing (const char *message)
 Inform collaborators about value changes. More...
 
virtual void releaseRemoteLock (const char *message)
 Re-enable poti. More...
 
virtual void setEnabled (bool on)
 Set activation state. More...
 
virtual void setText (const std::string &buttonText)
 Set button text. More...
 
void displayValue (float value)
 Set the poti value to actually display. More...
 
- Protected Member Functions inherited from vrui::coUIElement
virtual void resizeGeometry ()
 
virtual const vruiMatrixgetTransformMatrix ()
 
- Protected Member Functions inherited from vrui::vruiCollabInterface
void setType (int interfaceType)
 set the type of the this interface More...
 
void sendLockMessage (const char *message)
 lock the interaction with remote interfaces More...
 
void sendOngoingMessage (const char *message)
 send interactions to remote interfaces More...
 
void sendReleaseMessage (const char *message)
 unlock the interaction with remote interfaces More...
 
virtual void remoteLock (const char *message)
 this method is called whenever a remote interaction is started. More...
 
virtual void remoteOngoing (const char *message)
 this method is called whenever a remote interaction is going on. More...
 
virtual void releaseRemoteLock (const char *message)
 this method is called whenever a remote interaction is finished. More...
 

Protected Attributes

float myX
 poti x location More...
 
float myY
 poti y location More...
 
float minValue
 poti minimum value More...
 
float maxValue
 poti maximum value More...
 
float value
 current value represented by this poti More...
 
coCombinedButtonInteractioninteractionA
 interaction for first button More...
 
coCombinedButtonInteractioninteractionB
 interaction for second button (fine Tune) More...
 
coCombinedButtonInteractioninteractionW
 wheel interaction More...
 
bool unregister
 true if the interaction should be unregistered More...
 
float lastRoll
 previous mouse orientation More...
 
std::string buttonText
 value display text More...
 
std::string baseButtonText
 
std::string backgroundTexture
 
coValuePotiActormyActor
 action listener More...
 
bool integer
 true if adjustable value is an integer More...
 
float increment
 step size this poti, 0.0 if continuous More...
 
bool discrete
 
bool logarithmic = false
 true if scale is logarithmic More...
 
bool labelVisible
 true if label is visible More...
 
- 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
 
- Protected Attributes inherited from vrui::vruiCollabInterface
int remoteContext
 a remote context (if this UI element is used in several contexts) More...
 

Additional Inherited Members

- 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...
 
- 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 offers a poti GUI element which can be used to set integer or floating point values.

To change the value, the user clicks on the poti and twists the hand to turn the poti. Action events are processed by coValuePotiActor and coAction.

See also
coUIElement
vruiCollabInterface
coUpdateable

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_SLOPE 

Constructor & Destructor Documentation

◆ coValuePoti()

vrui::coValuePoti::coValuePoti ( const std::string &  buttonText,
coValuePotiActor actor,
const std::string &  backgroundTexture,
vruiCOIM cInterfaceManager = 0,
const std::string &  interfaceName = "" 
)

Constructor.

Parameters
buttonTextbutton text
actoraction listener for poti value changes
backgroundTexturebackground texture file name
cInterfaceManagercollaborative interface manager (optional)
interfaceNameunique ID string for collaboration (optional)

◆ ~coValuePoti()

vrui::coValuePoti::~coValuePoti ( )
virtual

Destructor.

Member Function Documentation

◆ discreteValue()

float vrui::coValuePoti::discreteValue ( float  value) const

◆ displayValue()

void vrui::coValuePoti::displayValue ( float  value)
protected

Set the poti value to actually display.

Parameters
valuepoti value to display

◆ getBackgroundTexture()

const std::string & vrui::coValuePoti::getBackgroundTexture ( ) const
inline

◆ getButtonText()

const std::string & vrui::coValuePoti::getButtonText ( ) const
inline

◆ getClassName()

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

get the Element's classname

Reimplemented from vrui::coUIElement.

Reimplemented in vrui::coSlopePoti.

◆ getHeight()

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

Returns element height.

Implements vrui::coUIElement.

◆ getIncrement()

float vrui::coValuePoti::getIncrement ( ) const
virtual

◆ getMax()

float vrui::coValuePoti::getMax ( ) const
virtual

◆ getMin()

float vrui::coValuePoti::getMin ( ) const
virtual

◆ getValue()

float vrui::coValuePoti::getValue ( ) const
virtual

Get poti value.

Returns
current poti value

Reimplemented in vrui::coSlopePoti.

◆ getWidth()

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

Returns element width.

Implements vrui::coUIElement.

◆ getXpos()

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

Returns element x position.

Implements vrui::coUIElement.

◆ getXSize()

float vrui::coValuePoti::getXSize ( ) const
virtual

◆ getYpos()

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

Returns element y position.

Implements vrui::coUIElement.

◆ getYSize()

float vrui::coValuePoti::getYSize ( ) const
virtual

◆ getZSize()

float vrui::coValuePoti::getZSize ( ) const
virtual

◆ hit()

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

This method is called on intersections of the input device with the poti .

Returns
ACTION_CALL_ON_MISS

Implements vrui::coAction.

◆ isDiscrete()

bool vrui::coValuePoti::isDiscrete ( ) const
virtual

◆ isInteger()

bool vrui::coValuePoti::isInteger ( ) const
virtual

◆ isLabelVisible()

bool vrui::coValuePoti::isLabelVisible ( )
virtual

This method checks if the label is visible.

◆ isLogarithmic()

bool vrui::coValuePoti::isLogarithmic ( ) const
virtual

◆ isOfClassName()

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

check if the Element or any ancestor is this classname

Reimplemented from vrui::coUIElement.

Reimplemented in vrui::coSlopePoti.

◆ joystickDown()

void vrui::coValuePoti::joystickDown ( )

◆ joystickUp()

void vrui::coValuePoti::joystickUp ( )

◆ miss()

void vrui::coValuePoti::miss ( )
virtual

Called when input device leaves the element.

Reimplemented from vrui::coAction.

◆ releaseRemoteLock()

void vrui::coValuePoti::releaseRemoteLock ( const char *  message)
protectedvirtual

Re-enable poti.

This is needed when remote collaborators may continue using the element.

Parameters
messagemessage string passed to collaborators

Reimplemented from vrui::vruiCollabInterface.

◆ remoteLock()

void vrui::coValuePoti::remoteLock ( const char *  message)
protectedvirtual

Disable poti.

This is needed when the element is used and should not be available for remote collaborators any more.

Parameters
messagemessage string passed to collaborators

Reimplemented from vrui::vruiCollabInterface.

◆ remoteOngoing()

void vrui::coValuePoti::remoteOngoing ( const char *  message)
protectedvirtual

Inform collaborators about value changes.

Parameters
messagemessage string passed to collaborators

Reimplemented from vrui::vruiCollabInterface.

Reimplemented in vrui::coSlopePoti.

◆ setEnabled()

void vrui::coValuePoti::setEnabled ( bool  en)
protectedvirtual

Set activation state.

Parameters
entrue = poti enabled

Reimplemented from vrui::coUIElement.

◆ setIncrement()

void vrui::coValuePoti::setIncrement ( float  increment)

Set increment for discreet poti.

Parameters
incrementincrement

◆ setInteger()

void vrui::coValuePoti::setInteger ( bool  on)

Set number type for poti value.

Parameters
itrue = integer, false = floating point

◆ setLabelVisible()

void vrui::coValuePoti::setLabelVisible ( bool  visible)
virtual

Set the poti label visibility.

◆ setLogarithmic()

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

◆ setMax()

void vrui::coValuePoti::setMax ( float  max)
virtual

Set maximum poti value.

Parameters
mmaximum value

◆ setMin()

void vrui::coValuePoti::setMin ( float  min)
virtual

Set minimum poti value.

Parameters
mminimum value

◆ setPos()

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

Set poti location.

Parameters
x,y,zlocation of top left corner of poti element

Implements vrui::coUIElement.

◆ setSize() [1/2]

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

Set poti size.

Parameters
sfactor relative to original poti VRML file size

Reimplemented from vrui::coUIElement.

◆ setSize() [2/2]

void vrui::coValuePoti::setSize ( float  width,
float  height,
float  depth 
)
virtual

Set different sizes for each dimension (see setSize)

Reimplemented from vrui::coUIElement.

◆ setState()

void vrui::coValuePoti::setState ( float  min,
float  max,
float  val,
bool  isInt,
float  inc = 0.0f 
)

Set maximum poti value.

Parameters
mmaximum value
mminimum value
incincrement

◆ setText()

void vrui::coValuePoti::setText ( const std::string &  buttonText)
protectedvirtual

Set button text.

Parameters
btbutton text string

◆ setValue()

void vrui::coValuePoti::setValue ( float  val)
virtual

Set poti value.

Parameters
valnew poti value [0..1]

Reimplemented in vrui::coSlopePoti.

◆ update()

bool vrui::coValuePoti::update ( )
virtual

Update poti value depending on user input.

Returns
true

Implements vrui::coUpdateable.

Reimplemented in vrui::coSlopePoti.

Member Data Documentation

◆ backgroundTexture

std::string vrui::coValuePoti::backgroundTexture
protected

◆ baseButtonText

std::string vrui::coValuePoti::baseButtonText
protected

◆ buttonText

std::string vrui::coValuePoti::buttonText
protected

value display text

◆ discrete

bool vrui::coValuePoti::discrete
protected

◆ increment

float vrui::coValuePoti::increment
protected

step size this poti, 0.0 if continuous

◆ integer

bool vrui::coValuePoti::integer
protected

true if adjustable value is an integer

◆ interactionA

coCombinedButtonInteraction* vrui::coValuePoti::interactionA
protected

interaction for first button

◆ interactionB

coCombinedButtonInteraction* vrui::coValuePoti::interactionB
protected

interaction for second button (fine Tune)

◆ interactionW

coCombinedButtonInteraction* vrui::coValuePoti::interactionW
protected

wheel interaction

◆ labelVisible

bool vrui::coValuePoti::labelVisible
protected

true if label is visible

◆ lastRoll

float vrui::coValuePoti::lastRoll
protected

previous mouse orientation

◆ logarithmic

bool vrui::coValuePoti::logarithmic = false
protected

true if scale is logarithmic

◆ maxValue

float vrui::coValuePoti::maxValue
protected

poti maximum value

◆ minValue

float vrui::coValuePoti::minValue
protected

poti minimum value

◆ myActor

coValuePotiActor* vrui::coValuePoti::myActor
protected

action listener

◆ myX

float vrui::coValuePoti::myX
protected

poti x location

◆ myY

float vrui::coValuePoti::myY
protected

poti y location

◆ unregister

bool vrui::coValuePoti::unregister
protected

true if the interaction should be unregistered

◆ value

float vrui::coValuePoti::value
protected

current value represented by this poti


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