Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:05

0001 // Created on: 1994-12-21
0002 // Created by: Dieter THIEMANN
0003 // Copyright (c) 1994-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _STEPControl_ActorRead_HeaderFile
0018 #define _STEPControl_ActorRead_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <StepToTopoDS_NMTool.hxx>
0024 #include <Transfer_ActorOfTransientProcess.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <TopTools_ListOfShape.hxx>
0027 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
0028 #include <Message_ProgressRange.hxx>
0029 #include <Interface_InterfaceModel.hxx>
0030 
0031 class StepRepr_Representation;
0032 class Standard_Transient;
0033 class Transfer_Binder;
0034 class Transfer_TransientProcess;
0035 class StepGeom_Axis2Placement3d;
0036 class gp_Trsf;
0037 class StepRepr_RepresentationRelationship;
0038 class TransferBRep_ShapeBinder;
0039 class StepBasic_ProductDefinition;
0040 class StepRepr_NextAssemblyUsageOccurrence;
0041 class StepShape_ShapeRepresentation;
0042 class StepShape_ContextDependentShapeRepresentation;
0043 class StepRepr_ShapeRepresentationRelationship;
0044 class StepGeom_GeometricRepresentationItem;
0045 class StepRepr_MappedItem;
0046 class StepShape_FaceSurface;
0047 class TopoDS_Shell;
0048 class TopoDS_Compound;
0049 class StepRepr_ConstructiveGeometryRepresentationRelationship;
0050 class StepData_Factors;
0051 class StepData_StepModel;
0052 
0053 
0054 class STEPControl_ActorRead;
0055 DEFINE_STANDARD_HANDLE(STEPControl_ActorRead, Transfer_ActorOfTransientProcess)
0056 
0057 //! This class performs the transfer of an Entity from
0058 //! AP214 and AP203, either Geometric or Topologic.
0059 //!
0060 //! I.E. for each type of Entity, it invokes the appropriate Tool
0061 //! then returns the Binder which contains the Result
0062 class STEPControl_ActorRead : public Transfer_ActorOfTransientProcess
0063 {
0064 
0065 public:
0066 
0067   Standard_EXPORT STEPControl_ActorRead(const Handle(Interface_InterfaceModel)& theModel);
0068 
0069   Standard_EXPORT virtual Standard_Boolean Recognize (const Handle(Standard_Transient)& start) Standard_OVERRIDE;
0070 
0071   Standard_EXPORT virtual Handle(Transfer_Binder) Transfer
0072                    (const Handle(Standard_Transient)& start,
0073                     const Handle(Transfer_TransientProcess)& TP,
0074                     const Message_ProgressRange& theProgress = Message_ProgressRange()) Standard_OVERRIDE;
0075 
0076   //! theUseTrsf - special flag for using Axis2Placement from ShapeRepresentation for transform root shape
0077   Standard_EXPORT Handle(Transfer_Binder) TransferShape (
0078       const Handle(Standard_Transient)& start,
0079       const Handle(Transfer_TransientProcess)& TP,
0080       const StepData_Factors& theLocalFactors,
0081       const Standard_Boolean isManifold = Standard_True,
0082       const Standard_Boolean theUseTrsf = Standard_False,
0083       const Message_ProgressRange& theProgress = Message_ProgressRange());
0084 
0085   //! set units and tolerances context by given ShapeRepresentation
0086   Standard_EXPORT void PrepareUnits (const Handle(StepRepr_Representation)& rep,
0087                                      const Handle(Transfer_TransientProcess)& TP,
0088                                      StepData_Factors& theLocalFactors);
0089 
0090   //! reset units and tolerances context to default
0091   //! (mm, radians, read.precision.val, etc.)
0092   Standard_EXPORT void ResetUnits(Handle(StepData_StepModel)& theModel,
0093                                   StepData_Factors& theLocalFactors);
0094 
0095   //! Set model
0096   Standard_EXPORT void SetModel(const Handle(Interface_InterfaceModel)& theModel);
0097 
0098   //! Computes transformation defined by two axis placements (in MAPPED_ITEM
0099   //! or ITEM_DEFINED_TRANSFORMATION) taking into account their
0100   //! representation contexts (i.e. units, which may be different)
0101   //! Returns True if transformation is computed and is not an identity.
0102   Standard_EXPORT Standard_Boolean ComputeTransformation (const Handle(StepGeom_Axis2Placement3d)& Origin,
0103                                                           const Handle(StepGeom_Axis2Placement3d)& Target,
0104                                                           const Handle(StepRepr_Representation)& OrigContext,
0105                                                           const Handle(StepRepr_Representation)& TargContext,
0106                                                           const Handle(Transfer_TransientProcess)& TP,
0107                                                           gp_Trsf& Trsf,
0108                                                           const StepData_Factors& theLocalFactors);
0109 
0110   //! Computes transformation defined by given
0111   //! REPRESENTATION_RELATIONSHIP_WITH_TRANSFORMATION
0112   Standard_EXPORT Standard_Boolean ComputeSRRWT (const Handle(StepRepr_RepresentationRelationship)& SRR,
0113                                                  const Handle(Transfer_TransientProcess)& TP,
0114                                                  gp_Trsf& Trsf,
0115                                                  const StepData_Factors& theLocalFactors);
0116 
0117 
0118 
0119 
0120   DEFINE_STANDARD_RTTIEXT(STEPControl_ActorRead,Transfer_ActorOfTransientProcess)
0121 
0122 protected:
0123 
0124 
0125   //! Transfers product definition entity
0126   //! theUseTrsf - special flag for using Axis2Placement from ShapeRepresentation for transform root shape
0127     Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (
0128       const Handle(StepBasic_ProductDefinition)& PD,
0129       const Handle(Transfer_TransientProcess)& TP,
0130       const StepData_Factors& theLocalFactors,
0131       const Standard_Boolean theUseTrsf = Standard_False,
0132       const Message_ProgressRange& theProgress = Message_ProgressRange());
0133 
0134   //! Transfers next assembly usage occurrence entity
0135   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity
0136                    (const Handle(StepRepr_NextAssemblyUsageOccurrence)& NAUO,
0137                     const Handle(Transfer_TransientProcess)& TP,
0138                     const StepData_Factors& theLocalFactors,
0139                     const Message_ProgressRange& theProgress = Message_ProgressRange());
0140 
0141   //! Transfers shape representation entity
0142   //! theUseTrsf - special flag for using Axis2Placement from ShapeRepresentation for transform root shape
0143   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (
0144       const Handle(StepShape_ShapeRepresentation)& sr,
0145       const Handle(Transfer_TransientProcess)& TP,
0146       const StepData_Factors& theLocalFactors,
0147       Standard_Boolean& isBound,
0148       const Standard_Boolean theUseTrsf = Standard_False,
0149       const Message_ProgressRange& theProgress = Message_ProgressRange());
0150 
0151   //! Transfers context dependent shape representation entity
0152   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity
0153                    (const Handle(StepShape_ContextDependentShapeRepresentation)& CDSR,
0154                     const Handle(Transfer_TransientProcess)& TP,
0155                     const StepData_Factors& theLocalFactors,
0156                     const Message_ProgressRange& theProgress = Message_ProgressRange());
0157 
0158   //! Transfers  shape representation relationship entity
0159   //! theUseTrsf - special flag for using Axis2Placement from ShapeRepresentation for transform root shape
0160   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (
0161       const Handle(StepRepr_ShapeRepresentationRelationship)& und,
0162       const Handle(Transfer_TransientProcess)& TP,
0163       const StepData_Factors& theLocalFactors,
0164       const Standard_Integer nbrep = 0,
0165       const Standard_Boolean theUseTrsf = Standard_False,
0166       const Message_ProgressRange& theProgress = Message_ProgressRange());
0167 
0168   //! Transfers  geometric representation item entity such as ManifoldSolidBRep ,...etc
0169   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity
0170                    (const Handle(StepGeom_GeometricRepresentationItem)& git,
0171                     const Handle(Transfer_TransientProcess)& TP,
0172                     const StepData_Factors& theLocalFactors,
0173                     const Standard_Boolean isManifold,
0174                     const Message_ProgressRange& theProgress);
0175 
0176   //! Transfers  mapped item
0177   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity
0178                    (const Handle(StepRepr_MappedItem)& mapit,
0179                     const Handle(Transfer_TransientProcess)& TP,
0180                     const StepData_Factors& theLocalFactors,
0181                     const Message_ProgressRange& theProgress);
0182 
0183   //! Transfers  FaceSurface entity
0184   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity
0185                    (const Handle(StepShape_FaceSurface)& fs,
0186                     const Handle(Transfer_TransientProcess)& TP,
0187                     const StepData_Factors& theLocalFactors,
0188                     const Message_ProgressRange& theProgress);
0189 
0190   Handle(TransferBRep_ShapeBinder) TransferEntity( const Handle(StepRepr_ConstructiveGeometryRepresentationRelationship)& theCGRR,
0191                                                    const Handle(Transfer_TransientProcess)& theTP,
0192                                                    const StepData_Factors& theLocalFactors);
0193 
0194   //! Translates file by old way when CDSR are roots . Acts only if "read.step.product_mode" is equal Off.
0195   Standard_EXPORT Handle(TransferBRep_ShapeBinder) OldWay
0196                    (const Handle(Standard_Transient)& start,
0197                     const Handle(Transfer_TransientProcess)& TP,
0198                     const Message_ProgressRange& theProgress);
0199 
0200 
0201 
0202 private:
0203 
0204 
0205   Standard_EXPORT TopoDS_Shell closeIDEASShell (const TopoDS_Shell& shell, const TopTools_ListOfShape& closingShells);
0206 
0207   Standard_EXPORT void computeIDEASClosings (const TopoDS_Compound& comp, TopTools_IndexedDataMapOfShapeListOfShape& shellClosingMap);
0208 
0209   Standard_EXPORT TopoDS_Shape TransferRelatedSRR(const Handle(Transfer_TransientProcess)& theTP,
0210                                                   const Handle(StepShape_ShapeRepresentation)& theRep,
0211                                                   const Standard_Boolean theUseTrsf,
0212                                                   const Standard_Integer theReadConstructiveGeomRR,
0213                                                   const StepData_Factors& theLocalFactors,
0214                                                   TopoDS_Compound& theCund,
0215                                                   Message_ProgressScope& thePS);
0216 
0217   StepToTopoDS_NMTool myNMTool;
0218   Standard_Real myPrecision;
0219   Standard_Real myMaxTol;
0220   Handle(StepRepr_Representation) mySRContext;
0221   Handle(Interface_InterfaceModel) myModel;
0222 
0223 };
0224 
0225 
0226 
0227 
0228 
0229 
0230 
0231 #endif // _STEPControl_ActorRead_HeaderFile