OpenCOVER
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
opencover::coVR3DGizmoType Class Referenceabstract

#include <coVR3DGizmoType.h>

Inheritance diagram for opencover::coVR3DGizmoType:
Inheritance graph
[legend]
Collaboration diagram for opencover::coVR3DGizmoType:
Collaboration graph
[legend]

Public Member Functions

 coVR3DGizmoType (osg::Matrix m, float s, coInteraction::InteractionType type, const char *iconName, const char *interactorName, coInteraction::InteractionPriority priority, coVR3DGizmo *gizmoPointer=nullptr)
 
virtual ~coVR3DGizmoType ()
 
virtual void updateTransform (osg::Matrix m)
 
void preFrame () override
 
void startInteraction () override
 
void stopInteraction () override
 
int hit (vrui::vruiHit *hit) override
 
void miss () override
 
void resetState () override
 
void update () override
 
void setShared (bool state) override
 make state shared among partners in a collaborative session More...
 
virtual osg::Matrix getMoveMatrix_o () const
 
osg::Matrix getMoveMatrix_w () const
 
- Public Member Functions inherited from opencover::coVRIntersectionInteractor
 coVRIntersectionInteractor (float size, coInteraction::InteractionType buttonId, const char *iconName, const char *interactorName, enum coInteraction::InteractionPriority priority, bool highliteHitNodeOnly=false)
 
virtual ~coVRIntersectionInteractor ()
 
void enableIntersection ()
 
bool isEnabled ()
 
void disableIntersection ()
 
virtual int hit (vrui::vruiHit *hit)
 
virtual void miss ()
 
virtual void startInteraction ()
 
virtual void doInteraction ()
 
virtual void stopInteraction ()
 
void show ()
 
void hide ()
 
bool isInitializedThroughSharedState ()
 
virtual void setShared (bool state)
 make state shared among partners in a collaborative session More...
 
virtual bool isShared () const
 query whether Element state is shared among collaborative partners More...
 
virtual void addIcon ()
 
virtual void removeIcon ()
 
virtual void resetState ()
 
int isIntersected ()
 
bool wasHit ()
 
osg::Vec3 getHitPos ()
 
virtual void preFrame ()
 
char * getInteractorName ()
 class methods for traversing children More...
 
osg::Matrix getMatrix ()
 
const osg::Matrix & getMatrix () const
 
void setCaseTransform (osg::MatrixTransform *)
 
- Public Member Functions inherited from vrui::coAction
 coAction ()
 Constructor. More...
 
virtual ~coAction ()
 Destructor. More...
 
virtual int hit (vruiHit *hit)=0
 
virtual void miss ()
 
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::coCombinedButtonInteraction
 coCombinedButtonInteraction (InteractionType type, const std::string &name, InteractionPriority priority=Medium)
 
virtual ~coCombinedButtonInteraction ()
 
virtual void setHitByMouse (bool)
 
virtual bool isMouse () const
 
virtual vruiMatrixgetHandMatrix () const
 
virtual bool is2D () const
 
- Public Member Functions inherited from vrui::coButtonInteraction
 coButtonInteraction (InteractionType type, const std::string &name, InteractionPriority priority=Medium)
 
virtual ~coButtonInteraction ()
 
virtual void update ()
 
virtual void startInteraction ()
 
virtual void stopInteraction ()
 
virtual void doInteraction ()
 
virtual void cancelInteraction ()
 
virtual void resetState ()
 
int getWheelCount () const
 
- Public Member Functions inherited from vrui::coInteraction
 coInteraction (InteractionType type, const std::string &name, InteractionPriority priority=Medium)
 
virtual ~coInteraction ()
 
InteractionState getState () const
 
InteractionType getType () const
 
InteractionPriority getPriority () const
 
InteractionGroup getGroup () const
 
void setGroup (InteractionGroup group)
 
void requestActivation ()
 
virtual void update ()
 
virtual void cancelInteraction ()
 
virtual void setName (const std::string &name)
 
virtual void removeIcon ()
 
virtual void addIcon ()
 
virtual bool hasPriority ()
 
virtual void cancelPendingActivation ()
 
virtual void doActivation ()
 
virtual void pause ()
 
virtual const std::string & getName () const
 
virtual void resetState ()
 
bool activate ()
 
bool isRegistered ()
 
void setNotifyOnly (bool flag)
 
bool isNotifyOnly ()
 
bool wasStarted () const
 
bool isRunning () const
 
bool wasStopped () const
 
bool isIdle () const
 
InteractionState getState ()
 

Protected Types

typedef vrb::SharedState< osg::Matrix > SharedMatrix
 

Protected Member Functions

void createGeometry () override=0
 
void updateSharedState () override
 reimplement in derived class for updating value of m_sharedState More...
 
osg::Vec3 calcPlaneLineIntersection (const osg::Vec3 &lp0, const osg::Vec3 &lp1, osg::Vec3 axis) const
 
void calculatePointerDirection_w (osg::Vec3 &lp0, osg::Vec3 &lp1, osg::Vec3 &pointerDirVec) const
 
void calculatePointerDirection_o (osg::Vec3 &lp0_o, osg::Vec3 &lp1_o, osg::Vec3 &pointerDirVec) const
 
- Protected Member Functions inherited from opencover::coVRIntersectionInteractor
virtual void createGeometry ()=0
 
virtual void keepSize ()
 
float getScale () const
 
osg::Vec3 restrictToVisibleScene (osg::Vec3)
 
const osg::Matrix & getPointerMat () const
 
virtual void updateSharedState ()
 reimplement in derived class for updating value of m_sharedState More...
 
virtual void update ()
 
- Protected Member Functions inherited from vrui::coButtonInteraction
virtual bool conditionMet () const
 
virtual bool conditionBecameMet () const
 
void updateState (vruiButtons *button)
 
- Protected Member Functions inherited from vrui::coInteraction
void setState (InteractionState s)
 

Protected Attributes

float _distance {0}
 
osg::Vec3 _diff
 
osg::Vec4 _red {0.5, 0.2, 0.2, 1.0}
 
osg::Vec4 _blue {0.2, 0.2, 0.5, 1.0}
 
osg::Vec4 _green {0.2, 0.5, 0.2, 1.0}
 
osg::Vec4 _grey {0.5, 0.5, 0.5, 1}
 
osg::Matrix _interMat_o
 
osg::Matrix _startInterMat_w
 
osg::Matrix _startHandMat_o
 
osg::Matrix _startHandMat_w
 
std::unique_ptr< opencover::coPlane_helperPlane
 
std::unique_ptr< opencover::coLine_helperLine
 
- Protected Attributes inherited from opencover::coVRIntersectionInteractor
osg::ref_ptr< osg::Node > geometryNode
 Geometry node. More...
 
osg::ref_ptr< osg::MatrixTransform > moveTransform
 
osg::ref_ptr< osg::MatrixTransform > scaleTransform
 
osg::ref_ptr< osg::MatrixTransform > interactorCaseTransform
 
osg::MatrixTransform * parent = nullptr
 
char * _interactorName = nullptr
 
char * labelStr_ = nullptr
 
bool _hit = false
 
bool _intersectionEnabled = true
 
bool _justHit = false
 
bool _wasHit = false
 
bool _standardHL = true
 
osg::ref_ptr< osg::Node > _hitNode
 
osg::Node * _interactionHitNode = nullptr
 
osg::Vec3 _hitPos
 
vrui::OSGVruiNodevNode = nullptr
 
osg::ref_ptr< osg::StateSet > _selectedHl
 
osg::ref_ptr< osg::StateSet > _intersectedHl
 
osg::ref_ptr< osg::StateSet > _oldHl
 
coVRLabellabel_ = nullptr
 
bool m_isInitializedThroughSharedState = false
 
float _interSize
 
float _scale = 1.
 
std::unique_ptr< vrb::SharedStateBase > m_sharedState
 
- Protected Attributes inherited from vrui::coAction
std::string actionName
 
- Protected Attributes inherited from vrui::coCombinedButtonInteraction
bool mouse
 
- Protected Attributes inherited from vrui::coButtonInteraction
unsigned buttonmask = 0
 
int wheelCount = 0
 
vruiButtonsbutton = nullptr
 
- Protected Attributes inherited from vrui::coInteraction
std::string name
 
InteractionType type
 
InteractionPriority priority
 
InteractionGroup group = GroupNonexclusive
 
RunningState runningState
 
bool notifyOnly
 
bool hasPriorityFlag
 
bool registered
 

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::coInteraction
enum  InteractionState {
  Idle = 0 , PendingActive , Active , Paused ,
  RemoteActive , ActiveNotify , Stopped
}
 
enum  InteractionPriority {
  Low = 0 , Navigation , NavigationHigh , Medium ,
  High , Menu , Highest
}
 
enum  InteractionType {
  ButtonA = 0 , ButtonAction = ButtonA , ButtonB , ButtonDrive = ButtonB ,
  ButtonC , ButtonXform = ButtonC , ButtonD , ButtonForward = ButtonD ,
  ButtonE , ButtonBack = ButtonE , ButtonToggleDocuments , ButtonDrag ,
  ButtonZoom , ButtonMenu , ButtonQuit , ButtonNextInter ,
  ButtonPrevInter , ButtonNextPerson , ButtonPrevPerson , LastButton = ButtonPrevPerson ,
  WheelHorizontal , WheelVertical , Wheel = WheelVertical , Joystick ,
  AllButtons , NoButton , NumInteractorTypes
}
 
enum  InteractionGroup { GroupNonexclusive , GroupNavigation }
 
enum  RunningState { StateStarted = 0 , StateRunning , StateStopped , StateNotRunning }
 

Member Typedef Documentation

◆ SharedMatrix

Constructor & Destructor Documentation

◆ coVR3DGizmoType()

opencover::coVR3DGizmoType::coVR3DGizmoType ( osg::Matrix  m,
float  s,
coInteraction::InteractionType  type,
const char *  iconName,
const char *  interactorName,
coInteraction::InteractionPriority  priority,
coVR3DGizmo gizmoPointer = nullptr 
)

◆ ~coVR3DGizmoType()

virtual opencover::coVR3DGizmoType::~coVR3DGizmoType ( )
virtual

Member Function Documentation

◆ calcPlaneLineIntersection()

osg::Vec3 opencover::coVR3DGizmoType::calcPlaneLineIntersection ( const osg::Vec3 &  lp0,
const osg::Vec3 &  lp1,
osg::Vec3  axis 
) const
protected

◆ calculatePointerDirection_o()

void opencover::coVR3DGizmoType::calculatePointerDirection_o ( osg::Vec3 &  lp0_o,
osg::Vec3 &  lp1_o,
osg::Vec3 &  pointerDirVec 
) const
protected

◆ calculatePointerDirection_w()

void opencover::coVR3DGizmoType::calculatePointerDirection_w ( osg::Vec3 &  lp0,
osg::Vec3 &  lp1,
osg::Vec3 &  pointerDirVec 
) const
protected

◆ createGeometry()

void opencover::coVR3DGizmoType::createGeometry ( )
overrideprotectedpure virtual

◆ getMoveMatrix_o()

virtual osg::Matrix opencover::coVR3DGizmoType::getMoveMatrix_o ( ) const
virtual

Reimplemented in opencover::coVR3DScaleGizmo.

◆ getMoveMatrix_w()

osg::Matrix opencover::coVR3DGizmoType::getMoveMatrix_w ( ) const

◆ hit()

int opencover::coVR3DGizmoType::hit ( vrui::vruiHit hit)
overridevirtual

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

Reimplemented from opencover::coVRIntersectionInteractor.

Reimplemented in opencover::coVR3DScaleGizmo, and opencover::coVR3DTransGizmo.

◆ miss()

void opencover::coVR3DGizmoType::miss ( )
overridevirtual

miss is called once after a hit, if the node is not intersected anymore

Reimplemented from opencover::coVRIntersectionInteractor.

◆ preFrame()

void opencover::coVR3DGizmoType::preFrame ( )
overridevirtual

◆ resetState()

void opencover::coVR3DGizmoType::resetState ( )
overridevirtual

◆ setShared()

void opencover::coVR3DGizmoType::setShared ( bool  state)
overridevirtual

make state shared among partners in a collaborative session

Reimplemented from opencover::coVRIntersectionInteractor.

◆ startInteraction()

void opencover::coVR3DGizmoType::startInteraction ( )
overridevirtual

◆ stopInteraction()

void opencover::coVR3DGizmoType::stopInteraction ( )
overridevirtual

◆ update()

void opencover::coVR3DGizmoType::update ( )
overridevirtual

Reimplemented from vrui::coCombinedButtonInteraction.

◆ updateSharedState()

void opencover::coVR3DGizmoType::updateSharedState ( )
overrideprotectedvirtual

reimplement in derived class for updating value of m_sharedState

Reimplemented from opencover::coVRIntersectionInteractor.

◆ updateTransform()

virtual void opencover::coVR3DGizmoType::updateTransform ( osg::Matrix  m)
virtual

Reimplemented in opencover::coVR3DScaleGizmo.

Member Data Documentation

◆ _blue

osg::Vec4 opencover::coVR3DGizmoType::_blue {0.2, 0.2, 0.5, 1.0}
protected

◆ _diff

osg::Vec3 opencover::coVR3DGizmoType::_diff
protected

◆ _distance

float opencover::coVR3DGizmoType::_distance {0}
protected

◆ _green

osg::Vec4 opencover::coVR3DGizmoType::_green {0.2, 0.5, 0.2, 1.0}
protected

◆ _grey

osg::Vec4 opencover::coVR3DGizmoType::_grey {0.5, 0.5, 0.5, 1}
protected

◆ _helperLine

std::unique_ptr<opencover::coLine> opencover::coVR3DGizmoType::_helperLine
protected

◆ _helperPlane

std::unique_ptr<opencover::coPlane> opencover::coVR3DGizmoType::_helperPlane
protected

◆ _interMat_o

osg::Matrix opencover::coVR3DGizmoType::_interMat_o
protected

◆ _red

osg::Vec4 opencover::coVR3DGizmoType::_red {0.5, 0.2, 0.2, 1.0}
protected

◆ _startHandMat_o

osg::Matrix opencover::coVR3DGizmoType::_startHandMat_o
protected

◆ _startHandMat_w

osg::Matrix opencover::coVR3DGizmoType::_startHandMat_w
protected

◆ _startInterMat_w

osg::Matrix opencover::coVR3DGizmoType::_startInterMat_w
protected

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