Open CASCADE Technology 7.8.2.dev
|
The main class for working with CAD file exchange. Loads and Saves special CAD transfer property. Consolidates all supported Formats and Vendors. Automatically recognizes CAD format and uses the preferred existed Vendor. Note: If Vendor's format is not binded, the configuration loading doesn't affect on its property. More...
#include <DE_Wrapper.hxx>
Public Member Functions | |
DE_Wrapper () | |
Initializes all field by default. | |
DE_Wrapper (const Handle< DE_Wrapper > &theWrapper) | |
Copies values of all fields. | |
Standard_Boolean | Read (const TCollection_AsciiString &thePath, const Handle< TDocStd_Document > &theDocument, Handle< XSControl_WorkSession > &theWS, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Reads a CAD file, according internal configuration. | |
Standard_Boolean | Write (const TCollection_AsciiString &thePath, const Handle< TDocStd_Document > &theDocument, Handle< XSControl_WorkSession > &theWS, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Writes a CAD file, according internal configuration. | |
Standard_Boolean | Read (const TCollection_AsciiString &thePath, const Handle< TDocStd_Document > &theDocument, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Reads a CAD file, according internal configuration. | |
Standard_Boolean | Write (const TCollection_AsciiString &thePath, const Handle< TDocStd_Document > &theDocument, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Writes a CAD file, according internal configuration. | |
Standard_Boolean | Read (const TCollection_AsciiString &thePath, TopoDS_Shape &theShape, Handle< XSControl_WorkSession > &theWS, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Reads a CAD file, according internal configuration. | |
Standard_Boolean | Write (const TCollection_AsciiString &thePath, const TopoDS_Shape &theShape, Handle< XSControl_WorkSession > &theWS, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Writes a CAD file, according internal configuration. | |
Standard_Boolean | Read (const TCollection_AsciiString &thePath, TopoDS_Shape &theShape, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Reads a CAD file, according internal configuration. | |
Standard_Boolean | Write (const TCollection_AsciiString &thePath, const TopoDS_Shape &theShape, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Writes a CAD file, according internal configuration. | |
Standard_Boolean | Load (const TCollection_AsciiString &theResource="", const Standard_Boolean theIsRecursive=Standard_True) |
Updates values according the resource file. | |
Standard_Boolean | Load (const Handle< DE_ConfigurationContext > &theResource, const Standard_Boolean theIsRecursive=Standard_True) |
Updates values according the resource. | |
Standard_Boolean | Save (const TCollection_AsciiString &theResourcePath, const Standard_Boolean theIsRecursive=Standard_True, const TColStd_ListOfAsciiString &theFormats=TColStd_ListOfAsciiString(), const TColStd_ListOfAsciiString &theVendors=TColStd_ListOfAsciiString()) |
Writes configuration to the resource file. | |
TCollection_AsciiString | Save (const Standard_Boolean theIsRecursive=Standard_True, const TColStd_ListOfAsciiString &theFormats=TColStd_ListOfAsciiString(), const TColStd_ListOfAsciiString &theVendors=TColStd_ListOfAsciiString()) |
Writes configuration to the string. | |
Standard_Boolean | Bind (const Handle< DE_ConfigurationNode > &theNode) |
Creates new node copy and adds to the map. | |
Standard_Boolean | UnBind (const Handle< DE_ConfigurationNode > &theNode) |
Removes node with the same type from the map. | |
Standard_Boolean | Find (const TCollection_AsciiString &theFormat, const TCollection_AsciiString &theVendor, Handle< DE_ConfigurationNode > &theNode) const |
Finds a node associated with input format and vendor. | |
void | ChangePriority (const TCollection_AsciiString &theFormat, const TColStd_ListOfAsciiString &theVendorPriority, const Standard_Boolean theToDisable=Standard_False) |
Changes provider priority to one format if it exists. | |
void | ChangePriority (const TColStd_ListOfAsciiString &theVendorPriority, const Standard_Boolean theToDisable=Standard_False) |
Changes provider priority to all loaded nodes. | |
virtual Standard_Boolean | FindProvider (const TCollection_AsciiString &thePath, const Standard_Boolean theToImport, Handle< DE_Provider > &theProvider) const |
Find available provider from the configuration. If there are several providers, choose the one with the highest priority. | |
void | UpdateLoad (const Standard_Boolean theToForceUpdate=Standard_False) const |
Updates all registered nodes, all changes will be saved in nodes. | |
Standard_Boolean | KeepUpdates () const |
Gets flag that keeps changes on configuration nodes which are being updated, false by default. | |
void | SetKeepUpdates (const Standard_Boolean theToKeepUpdates) |
Sets flag that keeps changes on configuration nodes which are being updated, false by default. | |
const DE_ConfigurationFormatMap & | Nodes () const |
Gets format map, contains vendor map with nodes. | |
virtual Handle< DE_Wrapper > | Copy () const |
Copies values of all fields. | |
Public Member Functions inherited from Standard_Transient | |
Standard_Transient () | |
Empty constructor. | |
Standard_Transient (const Standard_Transient &) | |
Copy constructor – does nothing. | |
Standard_Transient & | operator= (const Standard_Transient &) |
Assignment operator, needed to avoid copying reference counter. | |
virtual | ~Standard_Transient () |
Destructor must be virtual. | |
virtual const opencascade::handle< Standard_Type > & | DynamicType () const |
Returns a type descriptor about this object. | |
Standard_Boolean | IsInstance (const opencascade::handle< Standard_Type > &theType) const |
Returns a true value if this is an instance of Type. | |
Standard_Boolean | IsInstance (const Standard_CString theTypeName) const |
Returns a true value if this is an instance of TypeName. | |
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. | |
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. | |
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. | |
Standard_Integer | GetRefCount () const noexcept |
Get the reference counter of this object. | |
void | IncrementRefCounter () noexcept |
Increments the reference counter of this object. | |
Standard_Integer | DecrementRefCounter () noexcept |
Decrements the reference counter of this object; returns the decremented value. | |
virtual void | Delete () const |
Memory deallocator for transient classes. | |
Static Public Member Functions | |
static const Handle< DE_Wrapper > & | GlobalWrapper () |
Gets global configuration singleton. If wrapper is not set, create it by default as base class object. | |
static void | SetGlobalWrapper (const Handle< DE_Wrapper > &theWrapper) |
Sets global configuration singleton. | |
static Standard_Mutex & | GlobalLoadMutex () |
Static Public Member Functions inherited from Standard_Transient | |
static constexpr const char * | get_type_name () |
Returns a type descriptor about this object. | |
static const opencascade::handle< Standard_Type > & | get_type_descriptor () |
Returns type descriptor of Standard_Transient class. | |
Data Fields | |
DE_ConfigurationNode::DE_SectionGlobal | GlobalParameters |
Internal parameters for the all translators. | |
Protected Member Functions | |
void | sort (const Handle< DE_ConfigurationContext > &theResource) |
Sorts the vendors according to the priority to work Formats omitted from the resource are not modified Vendors omitted from the format scope are disabled. | |
Additional Inherited Members | |
Public Types inherited from Standard_Transient | |
typedef void | base_type |
Returns a type descriptor about this object. | |
The main class for working with CAD file exchange. Loads and Saves special CAD transfer property. Consolidates all supported Formats and Vendors. Automatically recognizes CAD format and uses the preferred existed Vendor. Note: If Vendor's format is not binded, the configuration loading doesn't affect on its property.
Nodes are grouped by Vendor's name and Format's type. The Vendors may have the same supported CAD formats. Use a Vendor's priority for transfer operations.
The algorithm for standalone transfer operation: 1) Work with global wrapper directly or make deep copy and work with it 2) Update the supported vendors and formats 2.1) Create and initialize specialized configuration node of the required format and Vendor. 2.2) Bind the created node to the internal map(::Bind) 3) Configure the transfer property by resource string or file (Load) 3.1) Configuration can disable or enable some Vendors and formats 3.2) Configuration can change the priority of Vendors 4) Initiate the transfer process by calling "::Write" or "::Read" methods 5) Validate the transfer process output
DE_Wrapper::DE_Wrapper | ( | ) |
Initializes all field by default.
DE_Wrapper::DE_Wrapper | ( | const Handle< DE_Wrapper > & | theWrapper | ) |
Copies values of all fields.
[in] | theWrapper | object to copy |
Standard_Boolean DE_Wrapper::Bind | ( | const Handle< DE_ConfigurationNode > & | theNode | ) |
Creates new node copy and adds to the map.
[in] | theNode | input node to copy |
void DE_Wrapper::ChangePriority | ( | const TCollection_AsciiString & | theFormat, |
const TColStd_ListOfAsciiString & | theVendorPriority, | ||
const Standard_Boolean | theToDisable = Standard_False ) |
Changes provider priority to one format if it exists.
[in] | theFormat | input node CAD format |
[in] | theVendorPriority | priority of work with vendors |
[in] | theToDisable | flag for disabling nodes that are not included in the priority |
void DE_Wrapper::ChangePriority | ( | const TColStd_ListOfAsciiString & | theVendorPriority, |
const Standard_Boolean | theToDisable = Standard_False ) |
Changes provider priority to all loaded nodes.
[in] | theVendorPriority | priority of work with vendors |
[in] | theToDisable | flag for disabling nodes that are not included in the priority |
|
virtual |
Copies values of all fields.
Standard_Boolean DE_Wrapper::Find | ( | const TCollection_AsciiString & | theFormat, |
const TCollection_AsciiString & | theVendor, | ||
Handle< DE_ConfigurationNode > & | theNode ) const |
Finds a node associated with input format and vendor.
[in] | theFormat | input node CAD format |
[in] | theVendor | input node vendor name |
[out] | theNode | output node |
|
virtual |
Find available provider from the configuration. If there are several providers, choose the one with the highest priority.
[in] | thePath | path to the CAD file |
[in] | theToImport | flag to finds for import. Standard_True-import, Standard_False-export |
[out] | theProvider | created new provider |
|
static |
|
static |
Gets global configuration singleton. If wrapper is not set, create it by default as base class object.
|
inline |
Gets flag that keeps changes on configuration nodes which are being updated, false by default.
Standard_Boolean DE_Wrapper::Load | ( | const Handle< DE_ConfigurationContext > & | theResource, |
const Standard_Boolean | theIsRecursive = Standard_True ) |
Updates values according the resource.
[in] | theResource | input resource to use |
[in] | theIsRecursive | flag to update all nodes |
Standard_Boolean DE_Wrapper::Load | ( | const TCollection_AsciiString & | theResource = "", |
const Standard_Boolean | theIsRecursive = Standard_True ) |
Updates values according the resource file.
[in] | theResource | file path to resource or resource value |
[in] | theIsRecursive | flag to update all nodes |
const DE_ConfigurationFormatMap & DE_Wrapper::Nodes | ( | ) | const |
Gets format map, contains vendor map with nodes.
Standard_Boolean DE_Wrapper::Read | ( | const TCollection_AsciiString & | thePath, |
const Handle< TDocStd_Document > & | theDocument, | ||
const Message_ProgressRange & | theProgress = Message_ProgressRange() ) |
Reads a CAD file, according internal configuration.
[in] | thePath | path to the import CAD file |
[out] | theDocument | document to save result |
theProgress[in] | progress indicator |
Standard_Boolean DE_Wrapper::Read | ( | const TCollection_AsciiString & | thePath, |
const Handle< TDocStd_Document > & | theDocument, | ||
Handle< XSControl_WorkSession > & | theWS, | ||
const Message_ProgressRange & | theProgress = Message_ProgressRange() ) |
Reads a CAD file, according internal configuration.
[in] | thePath | path to the import CAD file |
[out] | theDocument | document to save result |
[in] | theWS | current work session |
theProgress[in] | progress indicator |
Standard_Boolean DE_Wrapper::Read | ( | const TCollection_AsciiString & | thePath, |
TopoDS_Shape & | theShape, | ||
const Message_ProgressRange & | theProgress = Message_ProgressRange() ) |
Reads a CAD file, according internal configuration.
[in] | thePath | path to the import CAD file |
[out] | theShape | shape to save result |
theProgress[in] | progress indicator |
Standard_Boolean DE_Wrapper::Read | ( | const TCollection_AsciiString & | thePath, |
TopoDS_Shape & | theShape, | ||
Handle< XSControl_WorkSession > & | theWS, | ||
const Message_ProgressRange & | theProgress = Message_ProgressRange() ) |
Reads a CAD file, according internal configuration.
[in] | thePath | path to the import CAD file |
[out] | theShape | shape to save result |
[in] | theWS | current work session |
theProgress[in] | progress indicator |
TCollection_AsciiString DE_Wrapper::Save | ( | const Standard_Boolean | theIsRecursive = Standard_True, |
const TColStd_ListOfAsciiString & | theFormats = TColStd_ListOfAsciiString(), | ||
const TColStd_ListOfAsciiString & | theVendors = TColStd_ListOfAsciiString() ) |
Writes configuration to the string.
[in] | theIsRecursive | flag to write values of all nodes |
[in] | theFormats | list of formats to save. If empty, saves all available |
[in] | theVendors | list of providers to save. If empty, saves all available |
Standard_Boolean DE_Wrapper::Save | ( | const TCollection_AsciiString & | theResourcePath, |
const Standard_Boolean | theIsRecursive = Standard_True, | ||
const TColStd_ListOfAsciiString & | theFormats = TColStd_ListOfAsciiString(), | ||
const TColStd_ListOfAsciiString & | theVendors = TColStd_ListOfAsciiString() ) |
Writes configuration to the resource file.
[in] | theResourcePath | file path to resource |
[in] | theIsRecursive | flag to write values of all nodes |
[in] | theFormats | list of formats to save. If empty, saves all available |
[in] | theVendors | list of providers to save. If empty, saves all available |
|
static |
Sets global configuration singleton.
[in] | theWrapper | object to set as global configuration |
|
inline |
Sets flag that keeps changes on configuration nodes which are being updated, false by default.
|
protected |
Sorts the vendors according to the priority to work Formats omitted from the resource are not modified Vendors omitted from the format scope are disabled.
[in] | theResource | resource to get priority |
Standard_Boolean DE_Wrapper::UnBind | ( | const Handle< DE_ConfigurationNode > & | theNode | ) |
Removes node with the same type from the map.
[in] | theNode | input node to remove the same |
void DE_Wrapper::UpdateLoad | ( | const Standard_Boolean | theToForceUpdate = Standard_False | ) | const |
Updates all registered nodes, all changes will be saved in nodes.
[in] | theToForceUpdate | flag that turns on/of nodes, according to updated ability to import/export |
Standard_Boolean DE_Wrapper::Write | ( | const TCollection_AsciiString & | thePath, |
const Handle< TDocStd_Document > & | theDocument, | ||
const Message_ProgressRange & | theProgress = Message_ProgressRange() ) |
Writes a CAD file, according internal configuration.
[in] | thePath | path to the export CAD file |
[out] | theDocument | document to export |
theProgress[in] | progress indicator |
Standard_Boolean DE_Wrapper::Write | ( | const TCollection_AsciiString & | thePath, |
const Handle< TDocStd_Document > & | theDocument, | ||
Handle< XSControl_WorkSession > & | theWS, | ||
const Message_ProgressRange & | theProgress = Message_ProgressRange() ) |
Writes a CAD file, according internal configuration.
[in] | thePath | path to the export CAD file |
[out] | theDocument | document to export |
[in] | theWS | current work session |
theProgress[in] | progress indicator |
Standard_Boolean DE_Wrapper::Write | ( | const TCollection_AsciiString & | thePath, |
const TopoDS_Shape & | theShape, | ||
const Message_ProgressRange & | theProgress = Message_ProgressRange() ) |
Writes a CAD file, according internal configuration.
[in] | thePath | path to the export CAD file |
[out] | theShape | shape to export |
theProgress[in] | progress indicator |
Standard_Boolean DE_Wrapper::Write | ( | const TCollection_AsciiString & | thePath, |
const TopoDS_Shape & | theShape, | ||
Handle< XSControl_WorkSession > & | theWS, | ||
const Message_ProgressRange & | theProgress = Message_ProgressRange() ) |
Writes a CAD file, according internal configuration.
[in] | thePath | path to the export CAD file |
[out] | theShape | shape to export |
[in] | theWS | current work session |
theProgress[in] | progress indicator |
DE_ConfigurationNode::DE_SectionGlobal DE_Wrapper::GlobalParameters |
Internal parameters for the all translators.