Open CASCADE Technology
7.4.0
|
The general interface for importing mesh data into XDE document. More...
#include <RWMesh_CafReader.hxx>
Public Member Functions | |
RWMesh_CafReader () | |
Empty constructor. More... | |
virtual | ~RWMesh_CafReader () |
Destructor. More... | |
const Handle< TDocStd_Document > & | Document () const |
Return target document. More... | |
void | SetDocument (const Handle< TDocStd_Document > &theDoc) |
Set target document. More... | |
const TCollection_AsciiString & | RootPrefix () const |
Return prefix for generating root labels names. More... | |
void | SetRootPrefix (const TCollection_AsciiString &theRootPrefix) |
Set prefix for generating root labels names. More... | |
Standard_Boolean | ToFillIncompleteDocument () const |
Flag indicating if partially read file content should be put into the XDE document, TRUE by default. More... | |
void | SetFillIncompleteDocument (Standard_Boolean theToFillIncomplete) |
Set flag allowing partially read file content to be put into the XDE document. More... | |
Standard_Integer | MemoryLimitMiB () const |
Return memory usage limit in MiB, -1 by default which means no limit. More... | |
void | SetMemoryLimitMiB (Standard_Integer theLimitMiB) |
Set memory usage limit in MiB; can be ignored by reader implementation! More... | |
const RWMesh_CoordinateSystemConverter & | CoordinateSystemConverter () const |
Return coordinate system converter. More... | |
void | SetCoordinateSystemConverter (const RWMesh_CoordinateSystemConverter &theConverter) |
Set coordinate system converter. More... | |
Standard_Real | SystemLengthUnit () const |
Return the length unit to convert into while reading the file, defined as scale factor for m (meters); -1.0 by default, which means that NO conversion will be applied. More... | |
void | SetSystemLengthUnit (Standard_Real theUnits) |
Set system length units to convert into while reading the file, defined as scale factor for m (meters). More... | |
Standard_Boolean | HasSystemCoordinateSystem () const |
Return TRUE if system coordinate system has been defined; FALSE by default. More... | |
const gp_Ax3 & | SystemCoordinateSystem () const |
Return system coordinate system; UNDEFINED by default, which means that no conversion will be done. More... | |
void | SetSystemCoordinateSystem (const gp_Ax3 &theCS) |
Set system origin coordinate system to perform conversion into during read. More... | |
void | SetSystemCoordinateSystem (RWMesh_CoordinateSystem theCS) |
Set system origin coordinate system to perform conversion into during read. More... | |
Standard_Real | FileLengthUnit () const |
Return the length unit to convert from while reading the file, defined as scale factor for m (meters). Can be undefined (-1.0) if file format is unitless. More... | |
void | SetFileLengthUnit (Standard_Real theUnits) |
Set (override) file length units to convert from while reading the file, defined as scale factor for m (meters). More... | |
Standard_Boolean | HasFileCoordinateSystem () const |
Return TRUE if file origin coordinate system has been defined. More... | |
const gp_Ax3 & | FileCoordinateSystem () const |
Return file origin coordinate system; can be UNDEFINED, which means no conversion will be done. More... | |
void | SetFileCoordinateSystem (const gp_Ax3 &theCS) |
Set (override) file origin coordinate system to perform conversion during read. More... | |
void | SetFileCoordinateSystem (RWMesh_CoordinateSystem theCS) |
Set (override) file origin coordinate system to perform conversion during read. More... | |
bool | Perform (const TCollection_AsciiString &theFile, const Handle< Message_ProgressIndicator > &theProgress) |
Read the data from specified file. The Document instance should be set beforehand. More... | |
Standard_Integer | ExtraStatus () const |
Return extended status flags. More... | |
TopoDS_Shape | SingleShape () const |
Return result as a single shape. More... | |
const NCollection_IndexedMap< TCollection_AsciiString > & | ExternalFiles () const |
Return the list of complementary files - external references (textures, data, etc.). More... | |
const TColStd_IndexedDataMapOfStringString & | Metadata () const |
Return metadata map. More... | |
Standard_Boolean | ProbeHeader (const TCollection_AsciiString &theFile, const Handle< Message_ProgressIndicator > &theProgress=Handle< Message_ProgressIndicator >()) |
Read the header data from specified file without reading entire model. The main purpose is collecting metadata and external references - for copying model into a new location, for example. Can be NOT implemented (unsupported by format / reader). More... | |
Public Member Functions inherited from Standard_Transient | |
Standard_Transient () | |
Empty constructor. More... | |
Standard_Transient (const Standard_Transient &) | |
Copy constructor – does nothing. More... | |
Standard_Transient & | operator= (const Standard_Transient &) |
Assignment operator, needed to avoid copying reference counter. More... | |
virtual | ~Standard_Transient () |
Destructor must be virtual. More... | |
virtual void | Delete () const |
Memory deallocator for transient classes. More... | |
virtual const opencascade::handle< Standard_Type > & | DynamicType () const |
Returns a type descriptor about this object. More... | |
Standard_Boolean | IsInstance (const opencascade::handle< Standard_Type > &theType) const |
Returns a true value if this is an instance of Type. More... | |
Standard_Boolean | IsInstance (const Standard_CString theTypeName) const |
Returns a true value if this is an instance of TypeName. More... | |
Standard_Boolean | IsKind (const opencascade::handle< Standard_Type > &theType) const |
Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More... | |
Standard_Boolean | IsKind (const Standard_CString theTypeName) const |
Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More... | |
Standard_Transient * | This () const |
Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. More... | |
Standard_Integer | GetRefCount () const |
Get the reference counter of this object. More... | |
void | IncrementRefCounter () const |
Increments the reference counter of this object. More... | |
Standard_Integer | DecrementRefCounter () const |
Decrements the reference counter of this object; returns the decremented value. More... | |
Protected Member Functions | |
virtual Standard_Boolean | perform (const TCollection_AsciiString &theFile, const Handle< Message_ProgressIndicator > &theProgress, const Standard_Boolean theToProbe) |
Read the data from specified file. Default implementation calls performMesh() and fills XDE document from collected shapes. More... | |
virtual Standard_Boolean | performMesh (const TCollection_AsciiString &theFile, const Handle< Message_ProgressIndicator > &theProgress, const Standard_Boolean theToProbe)=0 |
Read the mesh from specified file - interface to be implemented by sub-classes. More... | |
tools for filling XDE document | |
Handle< TDocStd_Document > | myXdeDoc |
target document More... | |
TColStd_IndexedDataMapOfStringString | myMetadata |
metadata map More... | |
NCollection_IndexedMap< TCollection_AsciiString > | myExternalFiles |
the list of complementary files - external references (textures, data, etc.) More... | |
TCollection_AsciiString | myRootPrefix |
root folder for generating root labels names More... | |
TopTools_SequenceOfShape | myRootShapes |
sequence of result root shapes More... | |
RWMesh_NodeAttributeMap | myAttribMap |
map of per-shape attributes More... | |
RWMesh_CoordinateSystemConverter | myCoordSysConverter |
coordinate system converter More... | |
Standard_Boolean | myToFillDoc |
fill document from shape sequence More... | |
Standard_Boolean | myToFillIncomplete |
fill the document with partially retrieved data even if reader has failed with error More... | |
Standard_Integer | myMemoryLimitMiB |
memory usage limit More... | |
Standard_Integer | myExtraStatus |
extra status bitmask More... | |
void | fillDocument () |
Fill document with new root shapes. More... | |
Standard_Boolean | addShapeIntoDoc (const TopoDS_Shape &theShape, const TDF_Label &theLabel, const TCollection_AsciiString &theParentName) |
Append new shape into the document (recursively). More... | |
void | generateNames (const TCollection_AsciiString &theFile, const Standard_Integer theRootLower, const Standard_Boolean theWithSubLabels) |
Generate names for root labels starting from specified index. More... | |
static TCollection_AsciiString | shapeTypeToString (TopAbs_ShapeEnum theType) |
Return shape type as string. More... | |
Additional Inherited Members | |
Public Types inherited from Standard_Transient | |
typedef void | base_type |
Returns a type descriptor about this object. More... | |
Static Public Member Functions inherited from Standard_Transient | |
static const char * | get_type_name () |
Returns a type descriptor about this object. More... | |
static const opencascade::handle< Standard_Type > & | get_type_descriptor () |
Returns type descriptor of Standard_Transient class. More... | |
The general interface for importing mesh data into XDE document.
The tool implements auxiliary structures for creating an XDE document in two steps: 1) Creating TopoDS_Shape hierarchy (myRootShapes) and Shape attributes (myAttribMap) separately within performMesh(). Attributes include names and styles. 2) Filling XDE document from these auxiliary structures. Named elements are expanded within document structure, while Compounds having no named children will remain collapsed. In addition, unnamed nodes can be filled with generated names like "Face", "Compound" via generateNames() method, and the very root unnamed node can be filled from file name like "MyModel.obj".
RWMesh_CafReader::RWMesh_CafReader | ( | ) |
Empty constructor.
|
virtual |
Destructor.
|
protected |
Append new shape into the document (recursively).
|
inline |
Return coordinate system converter.
|
inline |
Return target document.
|
inline |
Return the list of complementary files - external references (textures, data, etc.).
|
inline |
Return extended status flags.
|
inline |
Return file origin coordinate system; can be UNDEFINED, which means no conversion will be done.
|
inline |
Return the length unit to convert from while reading the file, defined as scale factor for m (meters). Can be undefined (-1.0) if file format is unitless.
|
protected |
Fill document with new root shapes.
|
protected |
Generate names for root labels starting from specified index.
|
inline |
Return TRUE if file origin coordinate system has been defined.
|
inline |
Return TRUE if system coordinate system has been defined; FALSE by default.
|
inline |
Return memory usage limit in MiB, -1 by default which means no limit.
|
inline |
Return metadata map.
|
inline |
Read the data from specified file. The Document instance should be set beforehand.
|
protectedvirtual |
Read the data from specified file. Default implementation calls performMesh() and fills XDE document from collected shapes.
theFile | file to read |
optional | progress indicator |
theToProbe | flag indicating that mesh data should be skipped and only basing information to be read |
|
protectedpure virtual |
Read the mesh from specified file - interface to be implemented by sub-classes.
Implemented in RWGltf_CafReader, and RWObj_CafReader.
|
inline |
Read the header data from specified file without reading entire model. The main purpose is collecting metadata and external references - for copying model into a new location, for example. Can be NOT implemented (unsupported by format / reader).
|
inline |
Return prefix for generating root labels names.
|
inline |
Set coordinate system converter.
|
inline |
Set target document.
|
inline |
Set (override) file origin coordinate system to perform conversion during read.
|
inline |
Set (override) file origin coordinate system to perform conversion during read.
|
inline |
Set (override) file length units to convert from while reading the file, defined as scale factor for m (meters).
|
inline |
Set flag allowing partially read file content to be put into the XDE document.
|
inline |
Set memory usage limit in MiB; can be ignored by reader implementation!
|
inline |
Set prefix for generating root labels names.
|
inline |
Set system origin coordinate system to perform conversion into during read.
|
inline |
Set system origin coordinate system to perform conversion into during read.
|
inline |
Set system length units to convert into while reading the file, defined as scale factor for m (meters).
|
inlinestaticprotected |
Return shape type as string.
TopoDS_Shape RWMesh_CafReader::SingleShape | ( | ) | const |
Return result as a single shape.
|
inline |
Return system coordinate system; UNDEFINED by default, which means that no conversion will be done.
|
inline |
Return the length unit to convert into while reading the file, defined as scale factor for m (meters); -1.0 by default, which means that NO conversion will be applied.
|
inline |
Flag indicating if partially read file content should be put into the XDE document, TRUE by default.
Partial read means unexpected end of file, critical parsing syntax errors in the middle of file, or reached memory limit indicated by performMesh() returning FALSE. Partial read allows importing a model even in case of formal reading failure, so that it will be up to user to decide if processed data has any value.
In case of partial read (performMesh() returns FALSE, but there are some data that could be put into document), Perform() will return TRUE and result flag will have failure bit set.
|
protected |
map of per-shape attributes
|
protected |
coordinate system converter
|
protected |
the list of complementary files - external references (textures, data, etc.)
|
protected |
extra status bitmask
|
protected |
memory usage limit
|
protected |
metadata map
|
protected |
root folder for generating root labels names
|
protected |
sequence of result root shapes
|
protected |
fill document from shape sequence
|
protected |
fill the document with partially retrieved data even if reader has failed with error
|
protected |
target document