OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    VrmlData_Scene Class Reference

    #include <VrmlData_Scene.hxx>

    Public Types

    typedef NCollection_List< occ::handle< VrmlData_Node > >::Iterator Iterator

    Public Member Functions

     VrmlData_Scene (const occ::handle< NCollection_IncAllocator > &=nullptr)
    VrmlData_ErrorStatus Status () const
    void SetVrmlDir (const TCollection_ExtendedString &)
    void SetLinearScale (const double theScale)
    NCollection_List< TCollection_ExtendedString >::Iterator VrmlDirIterator () const
    Iterator GetIterator () const
    NCollection_Map< occ::handle< VrmlData_Node > >::Iterator NamedNodesIterator () const
    const occ::handle< NCollection_IncAllocator > & Allocator () const
    const occ::handle< VrmlData_Node > & AddNode (const occ::handle< VrmlData_Node > &theN, const bool isTopLevel=true)
    occ::handle< VrmlData_Node > FindNode (const char *theName, const occ::handle< Standard_Type > &theType=nullptr) const
    occ::handle< VrmlData_Node > FindNode (const char *theName, gp_Trsf &theLocation) const
    VrmlData_Scene & operator<< (Standard_IStream &theInput)
     operator TopoDS_Shape () const
    TopoDS_Shape GetShape (NCollection_DataMap< occ::handle< TopoDS_TShape >, occ::handle< VrmlData_Appearance > > &M)
    const occ::handle< VrmlData_WorldInfo > & WorldInfo () const
    void Dump (Standard_OStream &theStream) const
    VrmlData_ErrorStatus ReadReal (VrmlData_InBuffer &theBuffer, double &theResult, bool isApplyScale, bool isOnlyPositive) const
    VrmlData_ErrorStatus ReadXYZ (VrmlData_InBuffer &theBuffer, gp_XYZ &theXYZ, bool isApplyScale, bool isOnlyPositive) const
    VrmlData_ErrorStatus ReadXY (VrmlData_InBuffer &theBuffer, gp_XY &theXYZ, bool isApplyScale, bool isOnlyPositive) const
    VrmlData_ErrorStatus ReadArrIndex (VrmlData_InBuffer &theBuffer, const int **&theArr, size_t &theNBl) const
    int GetLineError () const
    void SetIndent (const int nSpc)
    VrmlData_ErrorStatus WriteXYZ (const gp_XYZ &theXYZ, const bool isScale, const char *thePostfix=nullptr) const
    VrmlData_ErrorStatus WriteArrIndex (const char *thePrefix, const int **theArr, const size_t theNbBl) const
    VrmlData_ErrorStatus WriteLine (const char *theLine0, const char *theLine1=nullptr, const int theIndent=0) const
    VrmlData_ErrorStatus WriteNode (const char *thePrefix, const occ::handle< VrmlData_Node > &) const
    bool IsDummyWrite () const

    Static Public Member Functions

    static VrmlData_ErrorStatus ReadLine (VrmlData_InBuffer &theBuffer)
    static VrmlData_ErrorStatus ReadWord (VrmlData_InBuffer &theBuffer, TCollection_AsciiString &theStr)

    Protected Member Functions

    VrmlData_ErrorStatus createNode (VrmlData_InBuffer &theBuffer, occ::handle< VrmlData_Node > &theNode, const occ::handle< Standard_Type > &Type)

    Static Protected Member Functions

    static VrmlData_ErrorStatus readLine (VrmlData_InBuffer &theBuffer)
    static VrmlData_ErrorStatus readHeader (VrmlData_InBuffer &theBuffer)
    static void createShape (TopoDS_Shape &outShape, const NCollection_List< occ::handle< VrmlData_Node > > &, NCollection_DataMap< occ::handle< TopoDS_TShape >, occ::handle< VrmlData_Appearance > > *)

    Detailed Description

    Block of comments describing class VrmlData_Scene

    Member Typedef Documentation

    ◆ Iterator

    Iterator type to get all contained Nodes one-by-one.

    Constructor & Destructor Documentation

    ◆ VrmlData_Scene()

    VrmlData_Scene::VrmlData_Scene ( const occ::handle< NCollection_IncAllocator > & = nullptr)

    Constructor.

    Member Function Documentation

    ◆ AddNode()

    const occ::handle< VrmlData_Node > & VrmlData_Scene::AddNode ( const occ::handle< VrmlData_Node > & theN,
    const bool isTopLevel = true )

    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()

    const occ::handle< NCollection_IncAllocator > & VrmlData_Scene::Allocator ( ) const
    inline

    Allocator used by all nodes contained in the Scene.

    ◆ createNode()

    VrmlData_ErrorStatus VrmlData_Scene::createNode ( VrmlData_InBuffer & theBuffer,
    occ::handle< VrmlData_Node > & theNode,
    const occ::handle< Standard_Type > & Type )
    protected

    Create the node.

    Parameters
    theBufferInput buffer from where the node is created
    theNodeOutput parameter, contains the created node on exit
    TypeNode type to be checked. If it is NULL no type checking is done. Otherwise the created node is matched and an error is returned if no match detected.

    ◆ createShape()

    void VrmlData_Scene::createShape ( TopoDS_Shape & outShape,
    const NCollection_List< occ::handle< VrmlData_Node > > & ,
    NCollection_DataMap< occ::handle< TopoDS_TShape >, occ::handle< VrmlData_Appearance > > *  )
    staticprotected

    Create a single Shape object from all geometric nodes in the list.

    ◆ Dump()

    void VrmlData_Scene::Dump ( Standard_OStream & theStream) const

    Diagnostic dump of the contents

    ◆ FindNode() [1/2]

    occ::handle< VrmlData_Node > VrmlData_Scene::FindNode ( const char * theName,
    const occ::handle< Standard_Type > & theType = nullptr ) const

    Find a node by its name.

    Parameters
    theNameName of the node to find.
    theTypeType to match. If this value is NULL, the first found node with the given name is returned. If theType is given, only the node that has that type is returned.

    ◆ FindNode() [2/2]

    occ::handle< VrmlData_Node > VrmlData_Scene::FindNode ( const char * theName,
    gp_Trsf & theLocation ) const

    Find a node by its name.

    Parameters
    theNameName of the node to search for.
    theLocationLocation of the found node with respect to the whole VRML shape.

    ◆ GetIterator()

    Iterator VrmlData_Scene::GetIterator ( ) const
    inline

    Iterator of Nodes

    ◆ GetLineError()

    int VrmlData_Scene::GetLineError ( ) const
    inline

    Query the line where the error occurred (if the status is not OK)

    ◆ GetShape()

    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.

    Parameters
    MData Map that binds an Appearance instance to each created TFace or TEdge if the Appearance node is defined in VRML scene for that geometry.
    Returns
    TopoDS_Shape (Compound) holding all the scene, similar to the result of explicit TopoDS_Shape conversion operator.

    ◆ IsDummyWrite()

    bool VrmlData_Scene::IsDummyWrite ( ) const
    inline

    Query if the current write operation is dummy, i.e., for the purpose of collecting information before the real write is commenced.

    ◆ NamedNodesIterator()

    NCollection_Map< occ::handle< VrmlData_Node > >::Iterator VrmlData_Scene::NamedNodesIterator ( ) const
    inline

    Get the iterator of named nodes.

    ◆ operator TopoDS_Shape()

    VrmlData_Scene::operator TopoDS_Shape ( ) const

    Convert the scene to a Shape.

    ◆ operator<<()

    VrmlData_Scene & VrmlData_Scene::operator<< ( Standard_IStream & theInput)

    Import from text stream (file or else). This method is protected by Mutex, it is not allowed to read/write two VRML streams concurrently.

    ◆ ReadArrIndex()

    VrmlData_ErrorStatus VrmlData_Scene::ReadArrIndex ( VrmlData_InBuffer & theBuffer,
    const int **& theArr,
    size_t & theNBl ) const

    Read an array of integer indices, for IndexedfaceSet and IndexedLineSet.

    ◆ readHeader()

    VrmlData_ErrorStatus VrmlData_Scene::readHeader ( VrmlData_InBuffer & theBuffer)
    staticprotected

    Read and verify the VRML header (the 1st line of the file)

    ◆ ReadLine()

    VrmlData_ErrorStatus VrmlData_Scene::ReadLine ( VrmlData_InBuffer & theBuffer)
    static

    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.

    Parameters
    theLineBuffer receiving the input line
    theInputInput stream
    theLenLength of the input buffer (maximal line length)

    ◆ readLine()

    VrmlData_ErrorStatus VrmlData_Scene::readLine ( VrmlData_InBuffer & theBuffer)
    staticprotected

    Read whatever line from the input checking the std::istream flags.

    ◆ ReadReal()

    VrmlData_ErrorStatus VrmlData_Scene::ReadReal ( VrmlData_InBuffer & theBuffer,
    double & theResult,
    bool isApplyScale,
    bool isOnlyPositive ) const

    Read one real value.

    ◆ ReadWord()

    VrmlData_ErrorStatus VrmlData_Scene::ReadWord ( VrmlData_InBuffer & theBuffer,
    TCollection_AsciiString & theStr )
    static

    Read a single word from the input stream, delimited by whitespace.

    ◆ ReadXY()

    VrmlData_ErrorStatus VrmlData_Scene::ReadXY ( VrmlData_InBuffer & theBuffer,
    gp_XY & theXYZ,
    bool isApplyScale,
    bool isOnlyPositive ) const

    Read one doublet of real values.

    ◆ ReadXYZ()

    VrmlData_ErrorStatus VrmlData_Scene::ReadXYZ ( VrmlData_InBuffer & theBuffer,
    gp_XYZ & theXYZ,
    bool isApplyScale,
    bool isOnlyPositive ) const

    Read one triplet of real values.

    ◆ SetIndent()

    void VrmlData_Scene::SetIndent ( const int nSpc)
    inline

    Store the indentation for VRML output.

    Parameters
    nSpcnumber of spaces to insert at every indentation level

    ◆ SetLinearScale()

    void VrmlData_Scene::SetLinearScale ( const double theScale)
    inline

    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.

    ◆ SetVrmlDir()

    void VrmlData_Scene::SetVrmlDir ( const TCollection_ExtendedString & )

    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 existing directories.

    ◆ Status()

    VrmlData_ErrorStatus VrmlData_Scene::Status ( ) const
    inline

    Query the status of the previous operation. Normally it should be equal to VrmlData_StatusOK (no error).

    ◆ VrmlDirIterator()

    NCollection_List< TCollection_ExtendedString >::Iterator VrmlData_Scene::VrmlDirIterator ( ) const
    inline

    Returns the directory iterator, to check the presence of requested VRML file in each iterated directory.

    ◆ WorldInfo()

    const occ::handle< VrmlData_WorldInfo > & VrmlData_Scene::WorldInfo ( ) const

    Query the WorldInfo member.

    ◆ WriteArrIndex()

    VrmlData_ErrorStatus VrmlData_Scene::WriteArrIndex ( const char * thePrefix,
    const int ** theArr,
    const size_t theNbBl ) const

    Write an array of integer indices, for IndexedFaceSet and IndexedLineSet.

    ◆ WriteLine()

    VrmlData_ErrorStatus VrmlData_Scene::WriteLine ( const char * theLine0,
    const char * theLine1 = nullptr,
    const int theIndent = 0 ) const

    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).

    Parameters
    theLine0The first part of string to output
    theLine1The second part of string to output
    theIndent
    • 0 value ignored.
    • negative decreases the current indent and then outputs.
    • positive outputs and then increases the current indent.
    Returns
    Error status of the stream, or a special error if myOutput == NULL.

    ◆ WriteNode()

    VrmlData_ErrorStatus VrmlData_Scene::WriteNode ( const char * thePrefix,
    const occ::handle< VrmlData_Node > &  ) const

    Write the given node to output stream 'myOutput'.

    ◆ WriteXYZ()

    VrmlData_ErrorStatus VrmlData_Scene::WriteXYZ ( const gp_XYZ & theXYZ,
    const bool isScale,
    const char * thePostfix = nullptr ) const

    Write a triplet of real values on a separate line.

    Parameters
    theXYZThe value to be output.
    isScaleIf True, then each component is divided by myLinearScale.
    thePostfixOptional string that is added before the end of the line.

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