30 #ifndef __SAIFUNCTIONS_H__
31 #define __SAIFUNCTIONS_H__
178 const string &_message =
"" ) :
179 H3DUtil::Exception::H3DException( _message ),
196 struct H3DAPI_API DOMNode {
202 ExecutionContext(
bool _clean_up =
false ) :
203 clean_up( _clean_up ) {
204 DEFNODES_DEBUG_NAME( named_nodes,
"SAI::ExecutionContext::named_nodes")
205 DEFNODES_DEBUG_NAME( exported_nodes, "SAI::ExecutionContext::exported_nodes")
206 AUTOREF_DEBUG_NAME( root_node, "SAI::ExecutionContext::root_node")
208 instances.push_back( this );
211 virtual ~ExecutionContext() {
212 instances.remove(
this );
215 static list< ExecutionContext * > instances;
217 static void cleanUp() {
218 for( list< ExecutionContext * >::iterator i = instances.begin();
219 i != instances.end(); i++ ) {
220 if( (*i)->clean_up ) {
221 (*i)->root_node.reset( NULL );
222 (*i)->named_nodes.clear();
223 (*i)->exported_nodes.clear();
224 (*i)->protos.clear();
225 (*i)->world_url =
"";
242 Node *createNode(
const string &node_name );
245 MFNode *getRootNodes();
257 AutoRef< X3DGroupingNode > root_node;
258 X3D::DEFNodes named_nodes;
259 X3D::DEFNodes exported_nodes;
260 X3D::PrototypeVector protos;
265 struct H3DAPI_API SAIScene:
public ExecutionContext {
318 class H3DAPI_API Browser {
324 inline string getName() {
329 inline void setName(
const string &n) {
336 inline string getVersion() {
341 inline void setVersion(
const string &n) {
362 const std::vector< ProfileInfo > &getSupportedProfiles();
372 const ProfileInfo &getProfile(
const string &profile );
377 const std::vector< ComponentInfo > &getSupportedComponents();
389 const ComponentInfo &getComponent(
const string &component,
404 ExecutionContext *getExecutionContext();
416 SAIScene *createScene( ProfileInfo *pi = NULL,
417 const vector< ComponentInfo > &cis =
418 std::vector< ComponentInfo>() );
439 void replaceWorld( SAIScene *scene );
464 SAIScene *importDocument( DOMNode *node );
493 void loadURL(
const string &url,
494 const std::vector< string > &property_list =
495 std::vector< string >() );
502 void setDescription(
const string &description );
569 const vector< string > &getRenderingProperties();
594 const vector< string > &getBrowserProperties();
628 void nextViewpoint(
H3DInt32 layer = 0 );
629 void previousViewpoint(
H3DInt32 layer = 0 );
630 void firstViewpoint(
H3DInt32 layer = 0 );
631 void lastViewpoint(
H3DInt32 layer = 0 );
644 void print(
const string &s );
667 string name, version;
Base header file that handles all configuration related settings.
Include this file to include the H3D specific types.
Contains the MFNode class.
Contains the MFString field class.
Header file for X3DGroupingNode, X3D scene-graph node.
This file contains functions for creating H3D nodes from X3D input.
This section defines the error types that may be generated in response to service requests.
Definition: SAIFunctions.h:55
ErrorType
SAIERROR error types.
Definition: SAIFunctions.h:58
@ SAI_INVALID_DOCUMENT
When the user has attempted to import a W3C DOM document into an X3D scene and the document cannot be...
Definition: SAIFunctions.h:106
@ SAI_INVALID_URL
The instance of SAIURL data type provided as part of the parameters to this service request is invali...
Definition: SAIFunctions.h:138
@ SAI_IMPORTED_NODE
An operation was attempted that used an imported node when it is not permitted as defined in 4....
Definition: SAIFunctions.h:83
@ SAI_INVALID_NAME
The name provided to a service request is invalid or cannot be found in the context of that object.
Definition: SAIFunctions.h:119
@ SAI_INVALID_FIELD
The instance of field data type provided as part of the parameters to this service request has been d...
Definition: SAIFunctions.h:115
@ SAI_NODE_IN_USE
Indication that a named node handling action has attempted to re-use a name that is already defined e...
Definition: SAIFunctions.h:149
@ SAI_INVALID_EXECUTION_CONTEXT
The instance of ExecutionContext data type provided as part of the parameters to this service request...
Definition: SAIFunctions.h:111
@ SAI_INVALID_NODE
The instance of the node type provided as part of the parameters to this service request has been dis...
Definition: SAIFunctions.h:123
@ SAI_NODE_NOT_AVAILABLE
An error condition used for IMPORTed nodes.
Definition: SAIFunctions.h:155
@ SAI_NOT_SHARED
A service request was made that assumed the browser was currently participating in a shared scene gra...
Definition: SAIFunctions.h:159
@ SAI_INVALID_BROWSER
The instance of browser data type provided as part of the parameters to the service request has been ...
Definition: SAIFunctions.h:99
@ SAI_DISPOSED
The request made of the current SAINode, SAIField or SAIBrowserRef reference is being made to an obje...
Definition: SAIFunctions.h:77
@ SAI_INVALID_ACCESS_TYPE
The attempt to perform an operation of a field failed because it is an invalid action for that field ...
Definition: SAIFunctions.h:94
@ SAI_INVALID_X3D
The SAIString or X3D file (for example as a result of the fetching of a URL reference) passed to this...
Definition: SAIFunctions.h:144
@ SAI_BROWSER_UNAVAILABLE
This error type appear in the errors definition of a service request.
Definition: SAIFunctions.h:64
@ SAI_INSUFFICIENT_CAPABILITIES
The user is attempting to add a node to an execution context that is greater than the capabilities de...
Definition: SAIFunctions.h:88
@ SAI_NOT_SUPPORTED
Generalised error for when a service request is made for a capability that is not available in this b...
Definition: SAIFunctions.h:166
@ SAI_CONNECTION_ERROR
An error has occurred that resulted in the connection between the browser and external application be...
Definition: SAIFunctions.h:72
@ SAI_INVALID_OPERATION_TIMING
The user is attempting to make a service request that is performed outside of the context that such o...
Definition: SAIFunctions.h:131
const string & getErrorMessage() const
Returns the error message of the SAIError.
Definition: SAIFunctions.h:188
ErrorType getErrorType() const
Returns the SAI error type.
Definition: SAIFunctions.h:183
SAIError(ErrorType _type, const string &_message="")
Constructor.
Definition: SAIFunctions.h:177
The Scene node is topmost node that takes care of the rendering of the scene graph both haptically an...
Definition: Scene.h:56
H3DAPI_API Group * createX3DFromStream(istream &in, DEFNodes *dn=NULL, DEFNodes *exported_nodes=NULL, PrototypeVector *prototypes=NULL, const string &system_id="<stream input>")
Create H3D nodes given X3D data as a istream.
Definition: X3D.cpp:242
H3DAPI_API Group * createX3DFromURL(const string &urn, DEFNodes *dn=NULL, DEFNodes *exported_nodes=NULL, PrototypeVector *prototypes=NULL, bool change_base_path_during_parsing=true)
Create H3D nodes given X3D data as a URL.
Definition: X3D.cpp:74
H3DAPI_API Group * createX3DFromString(const string &str, DEFNodes *dn=NULL, DEFNodes *exported_nodes=NULL, PrototypeVector *prototypes=NULL)
Create H3D nodes given X3D data as a string.
Definition: X3D.cpp:51
H3D API namespace.
Definition: Anchor.h:38
The ComponentInfo object stores information about a particular X3D component.
Definition: SAIFunctions.h:287
H3DUInt32 level
The level of support of this instance.
Definition: SAIFunctions.h:291
string providerUrl
If provided, The URL to the entity that wrote this component.
Definition: SAIFunctions.h:297
string name
The formal name of the component.
Definition: SAIFunctions.h:289
string title
A generic, freeform title string provided by the browser manufacturer.
Definition: SAIFunctions.h:293
This object stores information about a particular X3D profile.
Definition: SAIFunctions.h:301
vector< ComponentInfo > components
An array of the ComponentInfo object instances that make up this profile.
Definition: SAIFunctions.h:315
H3DUInt32 level
The level of support of this instance.
Definition: SAIFunctions.h:305
string providerUrl
If provided, the URL to the entity that wrote this component.
Definition: SAIFunctions.h:312
string title
A generic, freeform title string provided by the browser manufacturer.
Definition: SAIFunctions.h:308
string name
The formal name as defined in part 1 of ISO/IEC 19775.
Definition: SAIFunctions.h:303