#include <VrmlData_Scene.hxx>
Public Types | |
typedef VrmlData_ListOfNode::Iterator | Iterator |
Public Member Functions | |
Standard_EXPORT | VrmlData_Scene (const Handle(NCollection_IncAllocator)&=0L) |
VrmlData_ErrorStatus | Status () const |
Standard_EXPORT void | SetVrmlDir (const TCollection_ExtendedString &) |
void | SetLinearScale (const Standard_Real theScale) |
NCollection_List< TCollection_ExtendedString >::Iterator | VrmlDirIterator () const |
Iterator | GetIterator () const |
VrmlData_MapOfNode::Iterator | NamedNodesIterator () const |
const | Handle (NCollection_IncAllocator)&Allocator() const |
Standard_EXPORT const | Handle (VrmlData_Node)&AddNode(const Handle(VrmlData_Node)&theN |
Standard_EXPORT | Handle (VrmlData_Node) FindNode(const char *theName |
Standard_EXPORT const | Handle (Standard_Type)&theType=0L) const |
Standard_EXPORT | Handle (VrmlData_Node) FindNode(const char *theName |
Standard_EXPORT VrmlData_Scene & | operator<< (Standard_IStream &theInput) |
Standard_EXPORT | operator TopoDS_Shape () const |
Standard_EXPORT TopoDS_Shape | GetShape (VrmlData_DataMapOfShapeAppearance &M) |
Standard_EXPORT const Handle_VrmlData_WorldInfo & | WorldInfo () const |
Standard_EXPORT void | Dump (Standard_OStream &theStream) const |
Standard_EXPORT VrmlData_ErrorStatus | ReadReal (VrmlData_InBuffer &theBuffer, Standard_Real &theResult, Standard_Boolean isApplyScale, Standard_Boolean isOnlyPositive) const |
Standard_EXPORT VrmlData_ErrorStatus | ReadXYZ (VrmlData_InBuffer &theBuffer, gp_XYZ &theXYZ, Standard_Boolean isApplyScale, Standard_Boolean isOnlyPositive) const |
Standard_EXPORT VrmlData_ErrorStatus | ReadXY (VrmlData_InBuffer &theBuffer, gp_XY &theXYZ, Standard_Boolean isApplyScale, Standard_Boolean isOnlyPositive) const |
Standard_EXPORT VrmlData_ErrorStatus | ReadArrIndex (VrmlData_InBuffer &theBuffer, const Standard_Integer **&theArr, Standard_Size &theNBl) const |
Standard_Integer | GetLineError () const |
void | SetIndent (const Standard_Integer nSpc) |
Standard_EXPORT VrmlData_ErrorStatus | WriteXYZ (const gp_XYZ &theXYZ, const Standard_Boolean isScale, const char *thePostfix=0L) const |
Standard_EXPORT VrmlData_ErrorStatus | WriteArrIndex (const char *thePrefix, const Standard_Integer **theArr, const Standard_Size theNbBl) const |
Standard_EXPORT VrmlData_ErrorStatus | WriteLine (const char *theLine0, const char *theLine1=0L, const Standard_Integer theIndent=0) const |
Standard_EXPORT VrmlData_ErrorStatus | WriteNode (const char *thePrefix, const Handle_VrmlData_Node &) const |
Standard_Boolean | IsDummyWrite () const |
Static Public Member Functions | |
static Standard_EXPORT VrmlData_ErrorStatus | ReadLine (VrmlData_InBuffer &theBuffer) |
static Standard_EXPORT VrmlData_ErrorStatus | ReadWord (VrmlData_InBuffer &theBuffer, TCollection_AsciiString &theStr) |
Data Fields | |
Standard_EXPORT const const Standard_Boolean | isTopLevel = Standard_True) |
Standard_EXPORT gp_Trsf &theLocation | const |
Protected Member Functions | |
Standard_EXPORT VrmlData_ErrorStatus | createNode (VrmlData_InBuffer &theBuffer, Handle(VrmlData_Node)&theNode, const Handle(Standard_Type)&Type) |
Static Protected Member Functions | |
static Standard_EXPORT VrmlData_ErrorStatus | readLine (VrmlData_InBuffer &theBuffer) |
static Standard_EXPORT VrmlData_ErrorStatus | readHeader (VrmlData_InBuffer &theBuffer) |
static Standard_EXPORT void | createShape (TopoDS_Shape &outShape, const VrmlData_ListOfNode &, VrmlData_DataMapOfShapeAppearance *) |
Private Member Functions | |
VrmlData_Scene (const VrmlData_Scene &) | |
VrmlData_Scene & | operator= (const VrmlData_Scene &) |
Private Attributes | |
Standard_Real | myLinearScale |
VrmlData_ListOfNode | myLstNodes |
VrmlData_ListOfNode | myAllNodes |
! top-level nodes | |
VrmlData_ErrorStatus | myStatus |
! all nodes | |
Handle_NCollection_IncAllocator | myAllocator |
Handle_VrmlData_WorldInfo | myWorldInfo |
VrmlData_MapOfNode | myNamedNodes |
NCollection_List< TCollection_ExtendedString > | myVrmlDir |
Standard_Mutex | myMutex |
Standard_Integer | myLineError |
Standard_OStream * | myOutput |
! #0 if error | |
Standard_Integer | myIndent |
Standard_Integer | myCurrentIndent |
VrmlData_MapOfNode | myNamedNodesOut |
NCollection_Map< Standard_Address > | myUnnamedNodesOut |
Standard_Integer | myAutoNameCounter |
Friends | |
Standard_EXPORT Standard_OStream & | operator<< (Standard_OStream &theOutput, const VrmlData_Scene &theScene) |
|
Iterator type to get all contained Nodes one-by-one. |
|
Constructor. |
|
|
|
Create the node.
|
|
Create a single Shape object from all geometric nodes in the list. |
|
Diagnostic dump of the contents |
|
Iterator of Nodes |
|
Query the line where the error occurred (if the status is not OK) |
|
Convert the scene to a Shape, with the information on materials defined for each sub-shape. This method should be used instead of TopoDS_Shape explicit conversion operator when you need to retrieve the material aspect for each face or edge in the returned topological object.
|
|
Find a node by its name.
|
|
|
|
Find a node by its name.
|
|
Add a Node. If theN belongs to another Scene, it is cloned. VrmlData_WorldInfo cannot be added, in this case the method returns a NULL handle. |
|
Allocator used by all nodes contained in the Scene. |
|
Query if the current write operation is dummy, i.e., for the purpose of collecting information before the real write is commenced. |
|
Get the iterator of named nodes. |
|
Convert the scene to a Shape. |
|
Import from text stream (file or else). This method is protected by Mutex, it is not allowed to read/write two VRML streams concurrently. |
|
|
|
Read an array of integer indices, for IndexedfaceSet and IndexedLineSet. |
|
Read and verify the VRML header (the 1st line of the file) |
|
Read whatever line from the input checking the istream flags. |
|
Read a VRML line. Empty lines and comments are skipped. The processing starts here from theBuffer.LinePtr; if there is at least one non-empty character (neither space nor comment), this line is used without reading the next one.
|
|
Read one real value. |
|
Read a singel word from the input stream, delimited by whitespace. |
|
Read one doublet of real values. |
|
Read one triplet of real values. |
|
Store the indentation for VRML output.
|
|
Set the scale factor that would be further used in methods ReadReal, ReadXYZ and ReadXY. All coordinates, distances and sized are multiplied by this factor during reading the data. |
|
Add the given directory path to the list of VRML file search directories. This method forms the list of directories ordered according to the sequence of this method calls. When an Inline node is found, the URLs in that node are matched with these directories. The last (implicit) search directory is the current process directory ("."). It takes effect if the list is empty or if there is no match with exisiting directories. |
|
Query the status of the previous operation. Normally it should be equal to VrmlData_StatusOK (no error). |
|
Returns the directory iterator, to check the presence of requested VRML file in each iterated directory. |
|
Query the WorldInfo member. |
|
Write an array of integer indices, for IndexedFaceSet and IndexedLineSet. |
|
Write a string to the output stream respecting the indentation. The string can be defined as two substrings that will be separated by a space. Each of the substrings can be NULL, then it is ignored. If both are NULL, then a single newline is output (without indent).
|
|
Write the given node to output stream 'myOutput'. |
|
Write a triplet of real values on a separate line.
|
|
Export to text stream (file or else). This method is protected by Mutex, it is not allowed to read/write two VRML streams concurrently. The stream should give as the first line the VRML header: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This map is used to avoid multiple storage of the same named node: each named node is added here when it is written the first time. |
|
|
|
|
|
This map allows to resolve multiple reference to any unnamed node. It is used during the dummy write (myOutput == 0L). When a node is processed the first time it is added to this map, the second time it is automatically assigned a name. |
|
|
|
|