File indexing completed on 2025-01-18 10:05:05
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _STEPCAFControl_Reader_HeaderFile
0017 #define _STEPCAFControl_Reader_HeaderFile
0018
0019 #include <STEPControl_Reader.hxx>
0020 #include <IFSelect_ReturnStatus.hxx>
0021 #include <TDF_LabelSequence.hxx>
0022 #include <TopTools_MapOfShape.hxx>
0023 #include <STEPCAFControl_DataMapOfShapePD.hxx>
0024 #include <STEPCAFControl_DataMapOfPDExternFile.hxx>
0025 #include <XCAFDoc_DataMapOfShapeLabel.hxx>
0026 #include <TColStd_HSequenceOfTransient.hxx>
0027 #include <XCAFDimTolObjects_DatumModifiersSequence.hxx>
0028 #include <XCAFDimTolObjects_DatumModifWithValue.hxx>
0029
0030 class XSControl_WorkSession;
0031 class TDocStd_Document;
0032 class STEPCAFControl_ExternFile;
0033 class TopoDS_Shape;
0034 class XCAFDoc_ShapeTool;
0035 class StepRepr_RepresentationItem;
0036 class Transfer_TransientProcess;
0037 class StepShape_ConnectedFaceSet;
0038 class StepRepr_NextAssemblyUsageOccurrence;
0039 class STEPConstruct_Tool;
0040 class StepDimTol_Datum;
0041 class StepData_Factors;
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055 class STEPCAFControl_Reader
0056 {
0057 public:
0058
0059 DEFINE_STANDARD_ALLOC
0060
0061
0062
0063
0064
0065 Standard_EXPORT STEPCAFControl_Reader();
0066
0067
0068
0069 Standard_EXPORT STEPCAFControl_Reader(const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
0070
0071
0072 Standard_EXPORT virtual ~STEPCAFControl_Reader();
0073
0074
0075
0076 Standard_EXPORT void Init (const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
0077
0078
0079
0080
0081
0082 Standard_EXPORT IFSelect_ReturnStatus ReadFile (const Standard_CString theFileName);
0083
0084
0085
0086
0087
0088
0089 Standard_EXPORT IFSelect_ReturnStatus ReadFile(const Standard_CString theFileName,
0090 const StepData_ConfParameters& theParams);
0091
0092
0093
0094
0095
0096 Standard_EXPORT IFSelect_ReturnStatus ReadStream (const Standard_CString theName,
0097 std::istream& theIStream);
0098
0099
0100
0101 Standard_EXPORT Standard_Integer NbRootsForTransfer();
0102
0103
0104
0105
0106 Standard_EXPORT Standard_Boolean TransferOneRoot (const Standard_Integer num,
0107 const Handle(TDocStd_Document)& doc,
0108 const Message_ProgressRange& theProgress = Message_ProgressRange());
0109
0110
0111
0112
0113 Standard_EXPORT Standard_Boolean Transfer (const Handle(TDocStd_Document)& doc,
0114 const Message_ProgressRange& theProgress = Message_ProgressRange());
0115
0116 Standard_EXPORT Standard_Boolean Perform (const TCollection_AsciiString& filename,
0117 const Handle(TDocStd_Document)& doc,
0118 const Message_ProgressRange& theProgress = Message_ProgressRange());
0119
0120 Standard_EXPORT Standard_Boolean Perform (const TCollection_AsciiString& filename,
0121 const Handle(TDocStd_Document)& doc,
0122 const StepData_ConfParameters& theParams,
0123 const Message_ProgressRange& theProgress = Message_ProgressRange());
0124
0125
0126
0127 Standard_EXPORT Standard_Boolean Perform (const Standard_CString filename,
0128 const Handle(TDocStd_Document)& doc,
0129 const Message_ProgressRange& theProgress = Message_ProgressRange());
0130
0131
0132
0133 Standard_EXPORT Standard_Boolean Perform (const Standard_CString filename,
0134 const Handle(TDocStd_Document)& doc,
0135 const StepData_ConfParameters& theParams,
0136 const Message_ProgressRange& theProgress = Message_ProgressRange());
0137
0138
0139
0140 Standard_EXPORT const NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)> & ExternFiles() const;
0141
0142
0143
0144 Standard_EXPORT Standard_Boolean ExternFile (const Standard_CString name, Handle(STEPCAFControl_ExternFile)& ef) const;
0145
0146
0147 Standard_EXPORT STEPControl_Reader& ChangeReader();
0148
0149
0150 Standard_EXPORT const STEPControl_Reader& Reader() const;
0151
0152
0153
0154 Standard_EXPORT static TDF_Label FindInstance
0155 (const Handle(StepRepr_NextAssemblyUsageOccurrence)& NAUO,
0156 const Handle(XCAFDoc_ShapeTool)& STool,
0157 const STEPConstruct_Tool& Tool,
0158 const XCAFDoc_DataMapOfShapeLabel& ShapeLabelMap);
0159
0160
0161 Standard_EXPORT void SetColorMode (const Standard_Boolean colormode);
0162
0163 Standard_EXPORT Standard_Boolean GetColorMode() const;
0164
0165
0166 Standard_EXPORT void SetNameMode (const Standard_Boolean namemode);
0167
0168 Standard_EXPORT Standard_Boolean GetNameMode() const;
0169
0170
0171 Standard_EXPORT void SetLayerMode (const Standard_Boolean layermode);
0172
0173 Standard_EXPORT Standard_Boolean GetLayerMode() const;
0174
0175
0176 Standard_EXPORT void SetPropsMode (const Standard_Boolean propsmode);
0177
0178 Standard_EXPORT Standard_Boolean GetPropsMode() const;
0179
0180
0181 Standard_EXPORT void SetSHUOMode (const Standard_Boolean shuomode);
0182
0183 Standard_EXPORT Standard_Boolean GetSHUOMode() const;
0184
0185
0186 Standard_EXPORT void SetGDTMode (const Standard_Boolean gdtmode);
0187
0188 Standard_EXPORT Standard_Boolean GetGDTMode() const;
0189
0190
0191 Standard_EXPORT void SetMatMode (const Standard_Boolean matmode);
0192
0193 Standard_EXPORT Standard_Boolean GetMatMode() const;
0194
0195
0196 Standard_EXPORT void SetViewMode(const Standard_Boolean viewmode);
0197
0198
0199 Standard_EXPORT Standard_Boolean GetViewMode() const;
0200
0201 const XCAFDoc_DataMapOfShapeLabel& GetShapeLabelMap() const { return myMap; }
0202
0203 protected:
0204
0205
0206
0207
0208
0209
0210
0211
0212 Standard_EXPORT Standard_Boolean Transfer (STEPControl_Reader& rd,
0213 const Standard_Integer num,
0214 const Handle(TDocStd_Document)& doc,
0215 TDF_LabelSequence& Lseq,
0216 const Standard_Boolean asOne = Standard_False,
0217 const Message_ProgressRange& theProgress = Message_ProgressRange());
0218
0219
0220
0221
0222
0223 Standard_EXPORT TDF_Label AddShape (const TopoDS_Shape& S, const Handle(XCAFDoc_ShapeTool)& STool, const TopTools_MapOfShape& NewShapesMap, const STEPCAFControl_DataMapOfShapePD& ShapePDMap, const STEPCAFControl_DataMapOfPDExternFile& PDFileMap);
0224
0225
0226
0227 Standard_EXPORT Handle(STEPCAFControl_ExternFile) ReadExternFile (const Standard_CString file,
0228 const Standard_CString fullpath,
0229 const Handle(TDocStd_Document)& doc,
0230 const Message_ProgressRange& theProgress = Message_ProgressRange());
0231
0232
0233
0234 Standard_EXPORT Standard_Boolean ReadColors
0235 (const Handle(XSControl_WorkSession)& WS,
0236 const Handle(TDocStd_Document)& doc,
0237 const StepData_Factors& theLocalFactors) const;
0238
0239
0240
0241 Standard_EXPORT Standard_Boolean ReadNames (const Handle(XSControl_WorkSession)& WS, const Handle(TDocStd_Document)& doc, const STEPCAFControl_DataMapOfPDExternFile& PDFileMap) const;
0242
0243
0244
0245
0246 Standard_EXPORT Standard_Boolean ReadValProps (const Handle(XSControl_WorkSession)& WS,
0247 const Handle(TDocStd_Document)& doc,
0248 const STEPCAFControl_DataMapOfPDExternFile& PDFileMap,
0249 const StepData_Factors& theLocalFactors) const;
0250
0251
0252
0253 Standard_EXPORT Standard_Boolean ReadLayers (const Handle(XSControl_WorkSession)& WS, const Handle(TDocStd_Document)& doc) const;
0254
0255
0256
0257 Standard_EXPORT Standard_Boolean ReadSHUOs (const Handle(XSControl_WorkSession)& WS, const Handle(TDocStd_Document)& doc, const STEPCAFControl_DataMapOfPDExternFile& PDFileMap) const;
0258
0259
0260
0261 Standard_EXPORT Standard_Boolean ReadGDTs (const Handle(XSControl_WorkSession)& WS,
0262 const Handle(TDocStd_Document)& doc,
0263 const StepData_Factors& theLocalFactors);
0264
0265
0266
0267 Standard_EXPORT Standard_Boolean ReadMaterials (const Handle(XSControl_WorkSession)& WS,
0268 const Handle(TDocStd_Document)& doc,
0269 const Handle(TColStd_HSequenceOfTransient)& SeqPDS,
0270 const StepData_Factors& theLocalFactors) const;
0271
0272
0273 Standard_EXPORT Standard_Boolean ReadViews(const Handle(XSControl_WorkSession)& theWS,
0274 const Handle(TDocStd_Document)& theDoc,
0275 const StepData_Factors& theLocalFactors) const;
0276
0277
0278
0279
0280 Standard_EXPORT TDF_Label SettleShapeData (const Handle(StepRepr_RepresentationItem)& theItem, const TDF_Label& theLab, const Handle(XCAFDoc_ShapeTool)& theShapeTool, const Handle(Transfer_TransientProcess)& theTP) const;
0281
0282
0283
0284
0285
0286 Standard_EXPORT void ExpandSubShapes (const Handle(XCAFDoc_ShapeTool)& theShapeTool, const STEPCAFControl_DataMapOfShapePD& theShapePDMap) const;
0287
0288
0289
0290
0291 Standard_EXPORT void ExpandManifoldSolidBrep (TDF_Label& theLab, const Handle(StepRepr_RepresentationItem)& theItem, const Handle(Transfer_TransientProcess)& theTP, const Handle(XCAFDoc_ShapeTool)& theShapeTool) const;
0292
0293
0294
0295
0296 Standard_EXPORT void ExpandSBSM (TDF_Label& theLab, const Handle(StepRepr_RepresentationItem)& theItem, const Handle(Transfer_TransientProcess)& theTP, const Handle(XCAFDoc_ShapeTool)& theShapeTool) const;
0297
0298
0299
0300
0301 Standard_EXPORT void ExpandShell (const Handle(StepShape_ConnectedFaceSet)& theShell, TDF_Label& theLab, const Handle(Transfer_TransientProcess)& theTP, const Handle(XCAFDoc_ShapeTool)& theShapeTool) const;
0302
0303
0304 Standard_EXPORT virtual TCollection_ExtendedString convertName (const TCollection_AsciiString& theName) const;
0305
0306 private:
0307
0308
0309 Standard_Boolean setDatumToXCAF(const Handle(StepDimTol_Datum)& theDat,
0310 const TDF_Label theGDTL,
0311 const Standard_Integer thePositionCounter,
0312 const XCAFDimTolObjects_DatumModifiersSequence& theXCAFModifiers,
0313 const XCAFDimTolObjects_DatumModifWithValue theXCAFModifWithVal,
0314 const Standard_Real theModifValue,
0315 const Handle(TDocStd_Document)& theDoc,
0316 const Handle(XSControl_WorkSession)& theWS,
0317 const StepData_Factors& theLocalFactors);
0318
0319
0320 Standard_Boolean readDatumsAP242(const Handle(Standard_Transient)& theEnt,
0321 const TDF_Label theGDTL,
0322 const Handle(TDocStd_Document)& theDoc,
0323 const Handle(XSControl_WorkSession)& theWS,
0324 const StepData_Factors& theLocalFactors);
0325
0326
0327 TDF_Label createGDTObjectInXCAF(const Handle(Standard_Transient)& theEnt,
0328 const Handle(TDocStd_Document)& theDoc,
0329 const Handle(XSControl_WorkSession)& theWS,
0330 const StepData_Factors& theLocalFactors);
0331
0332
0333 void prepareUnits(const Handle(StepData_StepModel)& theModel,
0334 const Handle(TDocStd_Document)& theDoc,
0335 StepData_Factors& theLocalFactors) const;
0336
0337 private:
0338
0339 STEPControl_Reader myReader;
0340 NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)> myFiles;
0341 XCAFDoc_DataMapOfShapeLabel myMap;
0342 Standard_Boolean myColorMode;
0343 Standard_Boolean myNameMode;
0344 Standard_Boolean myLayerMode;
0345 Standard_Boolean myPropsMode;
0346 Standard_Boolean mySHUOMode;
0347 Standard_Boolean myGDTMode;
0348 Standard_Boolean myMatMode;
0349 Standard_Boolean myViewMode;
0350 NCollection_DataMap<Handle(Standard_Transient), TDF_Label> myGDTMap;
0351
0352 };
0353
0354 #endif