H3D API  2.4.1
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
H3D::GlobalSettings Class Reference

GlobalSettings is a X3DBindableNode that specifies default settings for use in H3D API, such as caching options, haptic rendering options etc. More...

#include <H3D/GlobalSettings.h>

Inheritance diagram for H3D::GlobalSettings:
Inheritance graph

Public Member Functions

 GlobalSettings (Inst< SFSetBind > _set_bind=0, Inst< SFNode > _metadata=0, Inst< SFTime > _bindTime=0, Inst< SFBool > _isBound=0, Inst< MFOptionNode > _options=0, Inst< SFBool > _x3dROUTESendsEvent=0, Inst< SFBool > _loadTexturesInThread=0, Inst< SFString > _renderMode=0, Inst< SFBool > _multiThreadedPython=0)
 Construtor.
 
 ~GlobalSettings ()
 Destructor.
 
template<class OptionNodeType >
void getOptionNode (OptionNodeType *&option)
 Get the first option node of the type of the pointer given as argument. More...
 
bool optionNodesUpdated ()
 check whether option nodes has updated since last scene graph loop
 
- Public Member Functions inherited from H3D::X3DBindableNode
 X3DBindableNode (const string &_bindable_stack_name, Inst< SFSetBind > _set_bind=0, Inst< SFNode > _metadata=0, Inst< SFTime > _bindTime=0, Inst< SFBool > _isBound=0)
 Constructor.
 
virtual ~X3DBindableNode ()
 Destructor.
 
virtual void initialize ()
 Initialize this bindable stack, toStackTop is done.
 
virtual void toStackTop ()
 Move this instance to the stack top.
 
virtual void removeFromStack ()
 Remove the bindable node from the stack.
 
bool isStackTop ()
 Is this node at the top of the stack.
 
- Public Member Functions inherited from H3D::X3DChildNode
 X3DChildNode (Inst< SFNode > _metadata=0)
 Constructor.
 
- Public Member Functions inherited from H3D::X3DNode
 X3DNode (Inst< SFNode > _metadata=0)
 Constructor.
 
X3DMetadataObjectgetMetadataByName (const string &_name)
 Given a name, the first X3DMetadataObject in the metadata field that matches that name is returned. More...
 
- Public Member Functions inherited from H3D::Node
 Node ()
 Constructor.
 
virtual Nodeclone (bool deepCopy=true, DeepCopyMap *deepCopyMap=NULL)
 Returns a new instance of this node type with the same state as this one. More...
 
virtual ~Node ()
 Destructor.
 
X3DPrototypeInstancegetProtoInstanceParent ()
 If this node is the root node in the proto body of a X3DPrototypeInstance then this will return that node. More...
 
void setProtoInstanceParent (X3DPrototypeInstance *p)
 Set the X3DPrototypeInstance this node is the the root node if applicaple.
 
virtual void render ()
 the render() function is used for the depth-first rendering traversal of the scene-graph. More...
 
virtual void traverseSG (TraverseInfo &ti)
 traverseSG is called once per scenegraph loop on the scene in order to traverse the scenegraph. More...
 
virtual bool lineIntersect (const Vec3f &from, const Vec3f &to, LineIntersectResult &result)
 Detect intersection between a line segment and the Node. More...
 
virtual void closestPoint (const Vec3f &p, NodeIntersectResult &result)
 Find closest point on Node to p. More...
 
virtual bool movingSphereIntersect (H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result)
 Detect collision between a moving sphere and the Node. More...
 
virtual string defaultXMLContainerField ()
 Returns the default xml containerField attribute value. More...
 
virtual FieldgetField (const string &_name) const
 return a pointer to the field specified by name within this instance
 
int addDestructCallback (void(*func)(Node *, void *), void *args)
 Add a callback function to be run on destruction of node. More...
 
int removeDestructCallback (void(*func)(Node *, void *), void *args)
 Add a callback function to be run on destruction of node. More...
 

Static Public Member Functions

static GlobalSettingsgetActive ()
 Convenience function to get the top of the DeviceInfo stack.
 
- Static Public Member Functions inherited from H3D::X3DBindableNode
static X3DBindableNodegetActive (const string &bindable_stack_name)
 Returns the active bindable instance, i.e. More...
 
static const StackType & getStack (const string &bindable_stack_name)
 Get the stack for a given name.
 
static const StackMapType & getStackMap ()
 Return the map of all bindable nodes available.
 
- Static Public Member Functions inherited from H3D::Node
static unsigned int nrNodesAlive ()
 Returns the nr of nodes currently alive, i.e. nodes created but not destructed.
 
static int nrNodesCreated ()
 Returns the number of nodes created in total since the start of the program.
 

Public Attributes

H3DUniquePtr< MFOptionNode > options
 Contains the H3DOptionNode to be use as default settings. More...
 
H3DUniquePtr< SFBoolx3dROUTESendsEvent
 According to the X3D specification the ROUTE statement in an X3D file is not supposed to send an event. More...
 
H3DUniquePtr< SFBoolloadTexturesInThread
 Controls if the downloading/reading of texture image data from file should be done in a separate thread or in the main thread. More...
 
H3DUniquePtr< SFStringrenderMode
 Controls the render mode of all geometries in the scene. More...
 
H3DUniquePtr< SFBoolmultiThreadedPython
 If true then the embedded Python interpreter is initialized to support multi-threaded use of the Python C API by calling PyEval_InitThreads(). More...
 
- Public Attributes inherited from H3D::X3DBindableNode
H3DUniquePtr< SFSetBindset_bind
 Input field to bind or unbind the node. More...
 
H3DUniquePtr< SFTimebindTime
 The bindTime field is the time at which the Viewpoint node is bound or unbound. More...
 
H3DUniquePtr< SFBoolisBound
 Output field telling if this node is bound or not. More...
 
- Public Attributes inherited from H3D::X3DNode
H3DUniquePtr< SFNodemetadata
 Meta data about the node. More...
 

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 
static bool default_x3d_route_sends_event = true
 The default value for the x3dROUTESendsEvent field.
 
- Static Public Attributes inherited from H3D::X3DBindableNode
static H3DNodeDatabase database
 The H3DNodedatabase for this node.
 
- Static Public Attributes inherited from H3D::X3DNode
static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 

Additional Inherited Members

- Public Types inherited from H3D::Node
typedef std::map< Node *, Node * > DeepCopyMap
 A map type used during a deep copy clone() to map from original nodes to cloned nodes.
 
- Protected Member Functions inherited from H3D::Node
void cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for the clone() method. More...
 
- Static Protected Member Functions inherited from H3D::Node
static NodegetClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for nodes that implement clone() More...
 
- Static Protected Attributes inherited from H3D::X3DBindableNode
static StackMapType stack
 The bindable stack.
 

Detailed Description

GlobalSettings is a X3DBindableNode that specifies default settings for use in H3D API, such as caching options, haptic rendering options etc.

According to the X3D specification the ROUTE statement in an X3D file is not supposed to send an event. H3D has always done this by default up until 2.2 though. The x3dROUTESendsEvent lets you control if an event should be sent or not.

The loadTexturesInThread controls if the downloading/reading of texture image data from file should be done in a separate thread or in the main thread. The result for doing it in separate thread is that the main program can start up faster and the textures will be applied later when they are loaded versus having to wait for all textures to be read before program starts.

Controls the render mode of all geometries in the scene. The possible values are:

"DEFAULT"Render as X3D scene nodes say.
"FILLED"Draw filled polygons always.
"WIREFRAME"Draw wireframe polygons always.
"POINTS"Draw points at vertices for polygons always.

For a way to set fill mode per object see the X3D node FillProperties.

Access type: inputOutput
Default value: "DEFAULT"

The options field contains H3DOptionNode instances for various options.

Examples:

Member Function Documentation

◆ getOptionNode()

template<class OptionNodeType >
void H3D::GlobalSettings::getOptionNode ( OptionNodeType *&  option)
inline

Member Data Documentation

◆ loadTexturesInThread

H3DUniquePtr< SFBool > H3D::GlobalSettings::loadTexturesInThread

Controls if the downloading/reading of texture image data from file should be done in a separate thread or in the main thread.

The result for doing it in separate thread is that the main program can start up faster and the textures will be applied later when they are loaded versus having to wait for all textures to be read before program starts.

Access type: inputOutput
Default value: X3DTextureNode::load_images_in_separate_thread (in H3DLoad and H3DViewer this is true)

Referenced by GlobalSettings(), H3D::Image3DTexture::SFImage::update(), and H3D::ImageTexture::SFImage::update().

◆ multiThreadedPython

H3DUniquePtr< SFBool > H3D::GlobalSettings::multiThreadedPython

If true then the embedded Python interpreter is initialized to support multi-threaded use of the Python C API by calling PyEval_InitThreads().

This is not required to use threads created in a Python script, but is required if threads other than the main thread, not created by Python, will call the Python C API.

There is a small overhead if enabled, and this option should be disabled for most applications.

This field has no effect if modified after a PythonScript node instance has been created.

Note
This field has no effect if python version used to compile H3DAPI is 3.7 or later since by then multi threaded is always on.

Access type: inputOutput
Default value: false

Referenced by GlobalSettings().

◆ options

H3DUniquePtr< MFOptionNode > H3D::GlobalSettings::options

Contains the H3DOptionNode to be use as default settings.

If several nodes of the same type exist the first one will be used.

Access type: inputOutput

Referenced by GlobalSettings().

◆ renderMode

H3DUniquePtr< SFString > H3D::GlobalSettings::renderMode

Controls the render mode of all geometries in the scene.

The possible values are:

"DEFAULT"Render as X3D scene nodes say.
"FILLED"Draw filled polygons always.
"WIREFRAME"Draw wireframe polygons always.
"POINTS"Draw points at vertices for polygons always.

For a way to set fill mode per object see the X3D node FillProperties.

Access type: inputOutput
Default value: "DEFAULT"

Referenced by GlobalSettings(), H3D::X3DShapeNode::render(), and H3D::X3DShapeNode::traverseSG().

◆ x3dROUTESendsEvent

H3DUniquePtr< SFBool > H3D::GlobalSettings::x3dROUTESendsEvent

According to the X3D specification the ROUTE statement in an X3D file is not supposed to send an event.

H3D has always done this by default up until 2.2 though. This field lets you control if an event should be sent or not. The default value is the value of GlobalSettings::default_x3d_route_sends_event.

Access type: inputOutput
Default value: GlobalSettings::default_x3d_route_sends_event (in H3DLoad and H3DViewer this is false)

Referenced by GlobalSettings().


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