29 #ifndef __X3DPOINTINGDEVICESENSORNODE_H__
30 #define __X3DPOINTINGDEVICESENSORNODE_H__
114 Inst< SFBool > _enabled = 0,
115 Inst< SFNode > _metadata = 0,
116 Inst< SFBool > _isActive = 0,
117 Inst< SFBool > _isOver = 0 );
156 static void updateX3DPointingDeviceSensors(
Node * n,
162 static void updateButtonDependentFields(
bool primary_button );
166 static bool anyIsOver();
170 static bool anyIsActive();
174 return !instances.empty();
190 class H3DAPI_API SetIsEnabled:
193 virtual void setValue(
const bool &b,
int _id = 0 ) {
200 virtual void update() {
208 friend class SetIsEnabled;
222 virtual void onIsOver( NodeIntersectResult * = 0,
unsigned int = 0,
224 if( is_enabled && ( isActive->getValue() || number_of_active == 0 ) ) {
225 if( new_value != isOver->getValue() )
226 isOver->setValue( new_value,
id );
231 static int number_of_active;
243 static bool last_primary_button_value;
244 static Vec3f last_from;
245 static Vec3f last_to;
248 void setIsEnabled(
bool primary_button );
250 void setIsActive(
bool primary_button );
259 virtual void setDragOutputEvents(
bool ,
265 static vector< X3DPointingDeviceSensorNode * > instances;
Contains the SFString field class.
Header file for X3DGeometryNode, X3D scene-graph node.
Header file for X3DSensorNode, X3D scene-graph node.
Node is the base class for all classes that can be part of the H3D scene-graph.
Definition: Node.h:46
This abstract node type is the base type for all pointing device sensors.
Definition: X3DPointingDeviceSensorNode.h:109
static bool instancesExists()
Returns true if there are any X3DPointingDeviceSensors in the scene.
Definition: X3DPointingDeviceSensorNode.h:173
H3DUniquePtr< SetIsEnabled > setIsEnabledField
Used to call setIsEnabled function when the enabled field is changed.
Definition: X3DPointingDeviceSensorNode.h:239
H3DUniquePtr< SFString > description
The description field in a X3DPointingDeviceSensorNode node specifies a textual description of the X3...
Definition: X3DPointingDeviceSensorNode.h:130
void setIsEnabled(bool primary_button)
Handles the enabled logic.
Definition: X3DPointingDeviceSensorNode.cpp:273
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: X3DPointingDeviceSensorNode.h:178
H3DUniquePtr< SFBool > isOver
The isOver field reflects the state of the pointing device with regard to whether it is pointing towa...
Definition: X3DPointingDeviceSensorNode.h:149
This abstract node type is the base type for all sensors.
Definition: X3DSensorNode.h:40
H3D API namespace.
Definition: Anchor.h:38
The AutoUpdate field is a template to force the BaseField to update itself as soon as an event is rec...
Definition: FieldTemplates.h:130
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194