H3D API  2.4.1
X3D.h
Go to the documentation of this file.
1 // Copyright 2004-2019, SenseGraphics AB
3 //
4 // This file is part of H3D API.
5 //
6 // H3D API is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // H3D API is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with H3D API; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // A commercial license is also available. Please contact us at
21 // www.sensegraphics.com for more information.
22 //
23 //
26 //
28 
29 #ifndef __X3D_H__
30 #define __X3D_H__
31 
32 #include <iostream>
33 #ifdef __BORLANDC__
34 #include <H3D/mem.h>
35 #endif
36 
37 #include <H3D/H3DApi.h>
38 #include <H3D/Group.h>
39 #include <H3D/DEFNodes.h>
40 #include <H3DUtil/AutoRef.h>
41 #include <H3D/PrototypeVector.h>
42 
43 namespace H3D {
45  namespace X3D {
46 
57  H3DAPI_API Group*createX3DFromStream(
58  istream &in,
59  DEFNodes *dn = NULL,
60  DEFNodes *exported_nodes = NULL,
61  PrototypeVector *prototypes = NULL,
62  const string & system_id = "<stream input>"
63  );
64 
74  H3DAPI_API Group* createX3DFromString( const string &str,
75  DEFNodes *dn = NULL,
76  DEFNodes *exported_nodes = NULL,
77  PrototypeVector *prototypes = NULL );
78 
79 
94  H3DAPI_API Group* createX3DFromURL( const string &urn,
95  DEFNodes *dn = NULL,
96  DEFNodes *exported_nodes = NULL,
97  PrototypeVector *prototypes = NULL,
98  bool change_base_path_during_parsing = true);
99 
110  H3DAPI_API AutoRef<Node> createX3DNodeFromStream(
111  istream &in,
112  DEFNodes *dn = NULL,
113  DEFNodes *exported_nodes = NULL,
114  PrototypeVector *prototypes = NULL,
115  const string & system_id = "<stream input>"
116  );
117 
127  H3DAPI_API AutoRef<Node> createX3DNodeFromString(
128  const string &str,
129  DEFNodes *dn = NULL,
130  DEFNodes *exported_nodes = NULL,
131  PrototypeVector *prototypes = NULL );
132 
133 
148  H3DAPI_API AutoRef<Node> createX3DNodeFromURL(
149  const string &urn,
150  DEFNodes *dn = NULL,
151  DEFNodes *exported_nodes = NULL,
152  PrototypeVector *prototypes = NULL,
153  bool change_base_path_during_parsing = true );
154 
157  H3DAPI_API void writeNodeAsX3D( ostream& os,
158  Node *node,
159  const string &container_field = "" );
160 
163  H3DAPI_API void writeNodeAsVRML( ostream& os,
164  Node *node );
165 
166 
170  H3DAPI_API void writeGeometryAsSTL( ostream &os,
171  X3DGeometryNode *geom,
172  const string &name = "",
173  bool use_binary_format = false );
174 
177  H3DAPI_API void writeNodeAsX3DHelp( ostream& os,
178  Node *node,
179  const string& container_field,
180  const string & prefix,
181  std::set< Node * > &visited_nodes,
182  unsigned int output_type = 0 );
183 
184  }
185 }
186 
187 #endif
Contains the DEFNodes class.
Header file for Group, X3D scene-graph node.
Base header file that handles all configuration related settings.
Used by VRMLParser and X3D to implement a PROTO declaration.
H3DAPI_API void writeNodeAsVRML(ostream &os, Node *node)
Write the scene graph part of the node given in X3D/VRML format to the given ostream.
Definition: X3D.cpp:479
H3DAPI_API AutoRef< Node > createX3DNodeFromURL(const string &urn, DEFNodes *dn=NULL, DEFNodes *exported_nodes=NULL, PrototypeVector *prototypes=NULL, bool change_base_path_during_parsing=true)
Create a H3D Node given X3D data as a URL.
Definition: X3D.cpp:291
H3DAPI_API void writeGeometryAsSTL(ostream &os, X3DGeometryNode *geom, const string &name="", bool use_binary_format=false)
Write the triangles rendered by the geometry node as STL to the given ostream.
Definition: X3D.cpp:809
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 void writeNodeAsX3D(ostream &os, Node *node, const string &container_field="")
Write the scene graph part of the node given in X3D/XML format to the given ostream.
Definition: X3D.cpp:471
H3DAPI_API AutoRef< Node > createX3DNodeFromString(const string &str, DEFNodes *dn=NULL, DEFNodes *exported_nodes=NULL, PrototypeVector *prototypes=NULL)
Create a H3D Node given X3D data as a string.
Definition: X3D.cpp:264
H3DAPI_API void writeNodeAsX3DHelp(ostream &os, Node *node, const string &container_field, const string &prefix, std::set< Node * > &visited_nodes, unsigned int output_type=0)
Help function for writeNodeAsX3D and writeNodeAsVRML output_type = 0 means xml output,...
Definition: X3D.cpp:493
H3DAPI_API AutoRef< Node > createX3DNodeFromStream(istream &in, DEFNodes *dn=NULL, DEFNodes *exported_nodes=NULL, PrototypeVector *prototypes=NULL, const string &system_id="<stream input>")
Create a H3D Node given X3D data as a istream.
Definition: X3D.cpp:446
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