Open CASCADE Technology 7.9.0
|
Provides a tool to read STEP file and put it into DECAF document. Besides transfer of shapes (including assemblies) provided by STEPControl, supports also colors and part names. More...
#include <STEPCAFControl_Reader.hxx>
Public Member Functions | |
STEPCAFControl_Reader () | |
Creates a reader with an empty STEP model and sets ColorMode, LayerMode, NameMode and PropsMode to Standard_True. | |
STEPCAFControl_Reader (const Handle< XSControl_WorkSession > &WS, const Standard_Boolean scratch=Standard_True) | |
Creates a reader tool and attaches it to an already existing Session Clears the session if it was not yet set for STEP. | |
virtual | ~STEPCAFControl_Reader () |
Destructor. | |
void | Init (const Handle< XSControl_WorkSession > &WS, const Standard_Boolean scratch=Standard_True) |
Clears the internal data structures and attaches to a new session Clears the session if it was not yet set for STEP. | |
IFSelect_ReturnStatus | ReadFile (const Standard_CString theFileName) |
Loads a file and returns the read status Provided for use like single-file reader. | |
IFSelect_ReturnStatus | ReadFile (const Standard_CString theFileName, const DESTEP_Parameters &theParams) |
Loads a file and returns the read status Provided for use like single-file reader. | |
IFSelect_ReturnStatus | ReadStream (const Standard_CString theName, std::istream &theIStream) |
Loads a file from stream and returns the read status. | |
Standard_Integer | NbRootsForTransfer () |
Returns number of roots recognized for transfer Shortcut for Reader().NbRootsForTransfer() | |
Standard_Boolean | TransferOneRoot (const Standard_Integer num, const Handle< TDocStd_Document > &doc, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Translates currently loaded STEP file into the document Returns True if succeeded, and False in case of fail Provided for use like single-file reader. | |
Standard_Boolean | Transfer (const Handle< TDocStd_Document > &doc, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Translates currently loaded STEP file into the document Returns True if succeeded, and False in case of fail Provided for use like single-file reader. | |
Standard_Boolean | Perform (const TCollection_AsciiString &filename, const Handle< TDocStd_Document > &doc, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Standard_Boolean | Perform (const TCollection_AsciiString &filename, const Handle< TDocStd_Document > &doc, const DESTEP_Parameters &theParams, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Standard_Boolean | Perform (const Standard_CString filename, const Handle< TDocStd_Document > &doc, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Translate STEP file given by filename into the document Return True if succeeded, and False in case of fail. | |
Standard_Boolean | Perform (const Standard_CString filename, const Handle< TDocStd_Document > &doc, const DESTEP_Parameters &theParams, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Translate STEP file given by filename into the document Return True if succeeded, and False in case of fail. | |
const NCollection_DataMap< TCollection_AsciiString, Handle< STEPCAFControl_ExternFile > > & | ExternFiles () const |
Returns data on external files Returns Null handle if no external files are read. | |
Standard_Boolean | ExternFile (const Standard_CString name, Handle< STEPCAFControl_ExternFile > &ef) const |
Returns data on external file by its name Returns False if no external file with given name is read. | |
STEPControl_Reader & | ChangeReader () |
Returns basic reader. | |
const STEPControl_Reader & | Reader () const |
Returns basic reader as const. | |
void | SetColorMode (const Standard_Boolean colormode) |
Set ColorMode for indicate read Colors or not. | |
Standard_Boolean | GetColorMode () const |
void | SetNameMode (const Standard_Boolean namemode) |
Set NameMode for indicate read Name or not. | |
Standard_Boolean | GetNameMode () const |
void | SetLayerMode (const Standard_Boolean layermode) |
Set LayerMode for indicate read Layers or not. | |
Standard_Boolean | GetLayerMode () const |
void | SetPropsMode (const Standard_Boolean propsmode) |
PropsMode for indicate read Validation properties or not. | |
Standard_Boolean | GetPropsMode () const |
void | SetMetaMode (const Standard_Boolean theMetaMode) |
MetaMode for indicate read Metadata or not. | |
Standard_Boolean | GetMetaMode () const |
void | SetProductMetaMode (const Standard_Boolean theProductMetaMode) |
MetaMode for indicate whether to read Product Metadata or not. | |
Standard_Boolean | GetProductMetaMode () const |
void | SetSHUOMode (const Standard_Boolean shuomode) |
Set SHUO mode for indicate write SHUO or not. | |
Standard_Boolean | GetSHUOMode () const |
void | SetGDTMode (const Standard_Boolean gdtmode) |
Set GDT mode for indicate write GDT or not. | |
Standard_Boolean | GetGDTMode () const |
void | SetMatMode (const Standard_Boolean matmode) |
Set Material mode. | |
Standard_Boolean | GetMatMode () const |
void | SetViewMode (const Standard_Boolean viewmode) |
Set View mode. | |
Standard_Boolean | GetViewMode () const |
Get View mode. | |
const XCAFDoc_DataMapOfShapeLabel & | GetShapeLabelMap () const |
void | SetShapeFixParameters (const XSAlgo_ShapeProcessor::ParameterMap &theParameters) |
Sets parameters for shape processing. | |
void | SetShapeFixParameters (XSAlgo_ShapeProcessor::ParameterMap &&theParameters) |
Sets parameters for shape processing. Parameters are moved from the input map. | |
void | SetShapeFixParameters (const DE_ShapeFixParameters &theParameters, const XSAlgo_ShapeProcessor::ParameterMap &theAdditionalParameters={}) |
Sets parameters for shape processing. Parameters from theParameters are copied to the internal map. Parameters from theAdditionalParameters are copied to the internal map if they are not present in theParameters . | |
const XSAlgo_ShapeProcessor::ParameterMap & | GetShapeFixParameters () const |
Returns parameters for shape processing that was set by SetParameters() method. | |
void | SetShapeProcessFlags (const ShapeProcess::OperationsFlags &theFlags) |
Sets flags defining operations to be performed on shapes. | |
const XSAlgo_ShapeProcessor::ProcessingFlags & | GetShapeProcessFlags () const |
Returns flags defining operations to be performed on shapes. | |
Static Public Member Functions | |
static TDF_Label | FindInstance (const Handle< StepRepr_NextAssemblyUsageOccurrence > &NAUO, const Handle< XCAFDoc_ShapeTool > &STool, const STEPConstruct_Tool &Tool, const XCAFDoc_DataMapOfShapeLabel &ShapeLabelMap) |
Returns label of instance of an assembly component corresponding to a given NAUO. | |
Protected Member Functions | |
Standard_Boolean | Transfer (STEPControl_Reader &rd, const Standard_Integer num, const Handle< TDocStd_Document > &doc, TDF_LabelSequence &Lseq, const Standard_Boolean asOne=Standard_False, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Translates STEP file already loaded into the reader into the document If num==0, translates all roots, else only root number num Returns True if succeeded, and False in case of fail If asOne is True, in case of multiple results composes them into assembly. Fills sequence of produced labels. | |
TDF_Label | AddShape (const TopoDS_Shape &S, const Handle< XCAFDoc_ShapeTool > &STool, const TopTools_MapOfShape &NewShapesMap, const STEPCAFControl_DataMapOfShapePD &ShapePDMap, const STEPCAFControl_DataMapOfPDExternFile &PDFileMap) |
Add a shape to a document Depending on a case, this shape can be added as one, or as assembly, or (in case if it is associated with external reference) taken as that referred shape. | |
Handle< STEPCAFControl_ExternFile > | ReadExternFile (const Standard_CString file, const Standard_CString fullpath, const Handle< TDocStd_Document > &doc, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Reads (or if returns already read) extern file with given name. | |
Standard_Boolean | ReadColors (const Handle< XSControl_WorkSession > &WS, const Handle< TDocStd_Document > &doc, const StepData_Factors &theLocalFactors=StepData_Factors()) const |
Reads style assignments from STEP model and sets corresponding color assignments in the DECAF document. | |
Standard_Boolean | ReadNames (const Handle< XSControl_WorkSession > &WS, const Handle< TDocStd_Document > &doc, const STEPCAFControl_DataMapOfPDExternFile &PDFileMap) const |
Reads names of parts defined in the STEP model and assigns them to corresponding labels in the DECAF document. | |
Standard_Boolean | ReadValProps (const Handle< XSControl_WorkSession > &WS, const Handle< TDocStd_Document > &doc, const STEPCAFControl_DataMapOfPDExternFile &PDFileMap, const StepData_Factors &theLocalFactors=StepData_Factors()) const |
Reads validation properties assigned to shapes in the STEP model and assigns them to corresponding labels in the DECAF document. | |
Standard_Boolean | ReadMetadata (const Handle< XSControl_WorkSession > &theWS, const Handle< TDocStd_Document > &theDoc, const StepData_Factors &theLocalFactors=StepData_Factors()) const |
Reads metadata assigned to shapes in the STEP model and assigns them to corresponding labels in the DECAF document. | |
Standard_Boolean | ReadProductMetadata (const Handle< XSControl_WorkSession > &theWS, const Handle< TDocStd_Document > &theDoc) const |
Standard_Boolean | ReadLayers (const Handle< XSControl_WorkSession > &WS, const Handle< TDocStd_Document > &doc) const |
Reads layers of parts defined in the STEP model and set reference between shape and layers in the DECAF document. | |
Standard_Boolean | ReadSHUOs (const Handle< XSControl_WorkSession > &WS, const Handle< TDocStd_Document > &doc, const STEPCAFControl_DataMapOfPDExternFile &PDFileMap) const |
Reads SHUO for instances defined in the STEP model and set reference between shape instances from different assemblyes. | |
Standard_Boolean | ReadGDTs (const Handle< XSControl_WorkSession > &WS, const Handle< TDocStd_Document > &doc, const StepData_Factors &theLocalFactors=StepData_Factors()) |
Reads D> for instances defined in the STEP model and set reference between shape instances from different assemblyes. | |
Standard_Boolean | ReadMaterials (const Handle< XSControl_WorkSession > &WS, const Handle< TDocStd_Document > &doc, const Handle< TColStd_HSequenceOfTransient > &SeqPDS, const StepData_Factors &theLocalFactors=StepData_Factors()) const |
Reads materials for instances defined in the STEP model and set reference between shape instances from different assemblyes. | |
Standard_Boolean | ReadViews (const Handle< XSControl_WorkSession > &theWS, const Handle< TDocStd_Document > &theDoc, const StepData_Factors &theLocalFactors=StepData_Factors()) const |
Reads Views for instances defined in the STEP model. | |
TDF_Label | SettleShapeData (const Handle< StepRepr_RepresentationItem > &theItem, const TDF_Label &theLab, const Handle< XCAFDoc_ShapeTool > &theShapeTool, const Handle< Transfer_TransientProcess > &theTP) const |
Populates the sub-Label of the passed TDF Label with shape data associated with the given STEP Representation Item, including naming and topological information. | |
void | ExpandSubShapes (const Handle< XCAFDoc_ShapeTool > &theShapeTool, const STEPCAFControl_DataMapOfShapePD &theShapePDMap) const |
Given the maps of already translated shapes, this method expands their correspondent Labels in XDE Document so that to have a dedicated sub-Label for each sub-shape coming with associated name in its STEP Representation Item. | |
void | ExpandManifoldSolidBrep (TDF_Label &theLab, const Handle< StepRepr_RepresentationItem > &theItem, const Handle< Transfer_TransientProcess > &theTP, const Handle< XCAFDoc_ShapeTool > &theShapeTool) const |
Expands the topological structure of Manifold Solid BRep STEP entity to OCAF sub-tree. Entities having no names associated via their Representation Items are skipped. | |
void | ExpandSBSM (TDF_Label &theLab, const Handle< StepRepr_RepresentationItem > &theItem, const Handle< Transfer_TransientProcess > &theTP, const Handle< XCAFDoc_ShapeTool > &theShapeTool) const |
Expands the topological structure of Shell-Based Surface Model STEP entity to OCAF sub-tree. Entities having no names associated via their Representation Items are skipped. | |
void | ExpandShell (const Handle< StepShape_ConnectedFaceSet > &theShell, TDF_Label &theLab, const Handle< Transfer_TransientProcess > &theTP, const Handle< XCAFDoc_ShapeTool > &theShapeTool) const |
Expands STEP Shell structure to OCAF sub-tree. Entities having no names associated via their Representation Items are skipped. | |
virtual TCollection_ExtendedString | convertName (const TCollection_AsciiString &theName) const |
Convert name into UNICODE text. | |
Provides a tool to read STEP file and put it into DECAF document. Besides transfer of shapes (including assemblies) provided by STEPControl, supports also colors and part names.
This reader supports reading files with external references i.e. multifile reading It behaves as usual Reader (from STEPControl) for the main file (e.g. if it is single file) Results of reading other files can be accessed by name of the file or by iterating on a readers
STEPCAFControl_Reader::STEPCAFControl_Reader | ( | ) |
Creates a reader with an empty STEP model and sets ColorMode, LayerMode, NameMode and PropsMode to Standard_True.
STEPCAFControl_Reader::STEPCAFControl_Reader | ( | const Handle< XSControl_WorkSession > & | WS, |
const Standard_Boolean | scratch = Standard_True ) |
Creates a reader tool and attaches it to an already existing Session Clears the session if it was not yet set for STEP.
|
virtual |
Destructor.
|
protected |
Add a shape to a document Depending on a case, this shape can be added as one, or as assembly, or (in case if it is associated with external reference) taken as that referred shape.
STEPControl_Reader & STEPCAFControl_Reader::ChangeReader | ( | ) |
Returns basic reader.
|
protectedvirtual |
Convert name into UNICODE text.
|
protected |
Expands the topological structure of Manifold Solid BRep STEP entity to OCAF sub-tree. Entities having no names associated via their Representation Items are skipped.
|
protected |
Expands the topological structure of Shell-Based Surface Model STEP entity to OCAF sub-tree. Entities having no names associated via their Representation Items are skipped.
|
protected |
Expands STEP Shell structure to OCAF sub-tree. Entities having no names associated via their Representation Items are skipped.
|
protected |
Given the maps of already translated shapes, this method expands their correspondent Labels in XDE Document so that to have a dedicated sub-Label for each sub-shape coming with associated name in its STEP Representation Item.
Standard_Boolean STEPCAFControl_Reader::ExternFile | ( | const Standard_CString | name, |
Handle< STEPCAFControl_ExternFile > & | ef ) const |
Returns data on external file by its name Returns False if no external file with given name is read.
const NCollection_DataMap< TCollection_AsciiString, Handle< STEPCAFControl_ExternFile > > & STEPCAFControl_Reader::ExternFiles | ( | ) | const |
Returns data on external files Returns Null handle if no external files are read.
|
static |
Returns label of instance of an assembly component corresponding to a given NAUO.
Standard_Boolean STEPCAFControl_Reader::GetColorMode | ( | ) | const |
Standard_Boolean STEPCAFControl_Reader::GetGDTMode | ( | ) | const |
Standard_Boolean STEPCAFControl_Reader::GetLayerMode | ( | ) | const |
Standard_Boolean STEPCAFControl_Reader::GetMatMode | ( | ) | const |
Standard_Boolean STEPCAFControl_Reader::GetMetaMode | ( | ) | const |
Standard_Boolean STEPCAFControl_Reader::GetNameMode | ( | ) | const |
Standard_Boolean STEPCAFControl_Reader::GetProductMetaMode | ( | ) | const |
Standard_Boolean STEPCAFControl_Reader::GetPropsMode | ( | ) | const |
const XSAlgo_ShapeProcessor::ParameterMap & STEPCAFControl_Reader::GetShapeFixParameters | ( | ) | const |
Returns parameters for shape processing that was set by SetParameters() method.
|
inline |
const XSAlgo_ShapeProcessor::ProcessingFlags & STEPCAFControl_Reader::GetShapeProcessFlags | ( | ) | const |
Returns flags defining operations to be performed on shapes.
Standard_Boolean STEPCAFControl_Reader::GetSHUOMode | ( | ) | const |
Standard_Boolean STEPCAFControl_Reader::GetViewMode | ( | ) | const |
Get View mode.
void STEPCAFControl_Reader::Init | ( | const Handle< XSControl_WorkSession > & | WS, |
const Standard_Boolean | scratch = Standard_True ) |
Clears the internal data structures and attaches to a new session Clears the session if it was not yet set for STEP.
Standard_Integer STEPCAFControl_Reader::NbRootsForTransfer | ( | ) |
Returns number of roots recognized for transfer Shortcut for Reader().NbRootsForTransfer()
Standard_Boolean STEPCAFControl_Reader::Perform | ( | const Standard_CString | filename, |
const Handle< TDocStd_Document > & | doc, | ||
const DESTEP_Parameters & | theParams, | ||
const Message_ProgressRange & | theProgress = Message_ProgressRange() ) |
Translate STEP file given by filename into the document Return True if succeeded, and False in case of fail.
Standard_Boolean STEPCAFControl_Reader::Perform | ( | const Standard_CString | filename, |
const Handle< TDocStd_Document > & | doc, | ||
const Message_ProgressRange & | theProgress = Message_ProgressRange() ) |
Translate STEP file given by filename into the document Return True if succeeded, and False in case of fail.
Standard_Boolean STEPCAFControl_Reader::Perform | ( | const TCollection_AsciiString & | filename, |
const Handle< TDocStd_Document > & | doc, | ||
const DESTEP_Parameters & | theParams, | ||
const Message_ProgressRange & | theProgress = Message_ProgressRange() ) |
Standard_Boolean STEPCAFControl_Reader::Perform | ( | const TCollection_AsciiString & | filename, |
const Handle< TDocStd_Document > & | doc, | ||
const Message_ProgressRange & | theProgress = Message_ProgressRange() ) |
|
protected |
Reads style assignments from STEP model and sets corresponding color assignments in the DECAF document.
const STEPControl_Reader & STEPCAFControl_Reader::Reader | ( | ) | const |
Returns basic reader as const.
|
protected |
Reads (or if returns already read) extern file with given name.
IFSelect_ReturnStatus STEPCAFControl_Reader::ReadFile | ( | const Standard_CString | theFileName | ) |
Loads a file and returns the read status Provided for use like single-file reader.
[in] | theFileName | file to open |
IFSelect_ReturnStatus STEPCAFControl_Reader::ReadFile | ( | const Standard_CString | theFileName, |
const DESTEP_Parameters & | theParams ) |
Loads a file and returns the read status Provided for use like single-file reader.
[in] | theFileName | file to open |
[in] | theParams | default configuration parameters |
|
protected |
Reads D> for instances defined in the STEP model and set reference between shape instances from different assemblyes.
|
protected |
Reads layers of parts defined in the STEP model and set reference between shape and layers in the DECAF document.
|
protected |
Reads materials for instances defined in the STEP model and set reference between shape instances from different assemblyes.
|
protected |
Reads metadata assigned to shapes in the STEP model and assigns them to corresponding labels in the DECAF document.
|
protected |
Reads names of parts defined in the STEP model and assigns them to corresponding labels in the DECAF document.
|
protected |
|
protected |
Reads SHUO for instances defined in the STEP model and set reference between shape instances from different assemblyes.
IFSelect_ReturnStatus STEPCAFControl_Reader::ReadStream | ( | const Standard_CString | theName, |
std::istream & | theIStream ) |
Loads a file from stream and returns the read status.
[in] | theName | auxiliary stream name |
[in] | theIStream | stream to read from |
|
protected |
Reads validation properties assigned to shapes in the STEP model and assigns them to corresponding labels in the DECAF document.
|
protected |
Reads Views for instances defined in the STEP model.
void STEPCAFControl_Reader::SetColorMode | ( | const Standard_Boolean | colormode | ) |
Set ColorMode for indicate read Colors or not.
void STEPCAFControl_Reader::SetGDTMode | ( | const Standard_Boolean | gdtmode | ) |
Set GDT mode for indicate write GDT or not.
void STEPCAFControl_Reader::SetLayerMode | ( | const Standard_Boolean | layermode | ) |
Set LayerMode for indicate read Layers or not.
void STEPCAFControl_Reader::SetMatMode | ( | const Standard_Boolean | matmode | ) |
Set Material mode.
void STEPCAFControl_Reader::SetMetaMode | ( | const Standard_Boolean | theMetaMode | ) |
MetaMode for indicate read Metadata or not.
void STEPCAFControl_Reader::SetNameMode | ( | const Standard_Boolean | namemode | ) |
Set NameMode for indicate read Name or not.
void STEPCAFControl_Reader::SetProductMetaMode | ( | const Standard_Boolean | theProductMetaMode | ) |
MetaMode for indicate whether to read Product Metadata or not.
void STEPCAFControl_Reader::SetPropsMode | ( | const Standard_Boolean | propsmode | ) |
PropsMode for indicate read Validation properties or not.
void STEPCAFControl_Reader::SetShapeFixParameters | ( | const DE_ShapeFixParameters & | theParameters, |
const XSAlgo_ShapeProcessor::ParameterMap & | theAdditionalParameters = {} ) |
Sets parameters for shape processing. Parameters from theParameters
are copied to the internal map. Parameters from theAdditionalParameters
are copied to the internal map if they are not present in theParameters
.
theParameters | the parameters for shape processing. |
theAdditionalParameters | the additional parameters for shape processing. |
void STEPCAFControl_Reader::SetShapeFixParameters | ( | const XSAlgo_ShapeProcessor::ParameterMap & | theParameters | ) |
Sets parameters for shape processing.
theParameters | the parameters for shape processing. |
void STEPCAFControl_Reader::SetShapeFixParameters | ( | XSAlgo_ShapeProcessor::ParameterMap && | theParameters | ) |
Sets parameters for shape processing. Parameters are moved from the input map.
theParameters | the parameters for shape processing. |
void STEPCAFControl_Reader::SetShapeProcessFlags | ( | const ShapeProcess::OperationsFlags & | theFlags | ) |
Sets flags defining operations to be performed on shapes.
theFlags | The flags defining operations to be performed on shapes. |
void STEPCAFControl_Reader::SetSHUOMode | ( | const Standard_Boolean | shuomode | ) |
Set SHUO mode for indicate write SHUO or not.
|
protected |
Populates the sub-Label of the passed TDF Label with shape data associated with the given STEP Representation Item, including naming and topological information.
void STEPCAFControl_Reader::SetViewMode | ( | const Standard_Boolean | viewmode | ) |
Set View mode.
Standard_Boolean STEPCAFControl_Reader::Transfer | ( | const Handle< TDocStd_Document > & | doc, |
const Message_ProgressRange & | theProgress = Message_ProgressRange() ) |
Translates currently loaded STEP file into the document Returns True if succeeded, and False in case of fail Provided for use like single-file reader.
|
protected |
Translates STEP file already loaded into the reader into the document If num==0, translates all roots, else only root number num Returns True if succeeded, and False in case of fail If asOne is True, in case of multiple results composes them into assembly. Fills sequence of produced labels.
Standard_Boolean STEPCAFControl_Reader::TransferOneRoot | ( | const Standard_Integer | num, |
const Handle< TDocStd_Document > & | doc, | ||
const Message_ProgressRange & | theProgress = Message_ProgressRange() ) |
Translates currently loaded STEP file into the document Returns True if succeeded, and False in case of fail Provided for use like single-file reader.