Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-08 08:22:52

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 <StepData_Factors.hxx>
0024 #include <StepToTopoDS_NMTool.hxx>
0025 #include <Transfer_ActorOfTransientProcess.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <TopTools_ListOfShape.hxx>
0028 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
0029 #include <Message_ProgressRange.hxx>
0030 #include <Interface_InterfaceModel.hxx>
0031 
0032 class StepRepr_Representation;
0033 class Standard_Transient;
0034 class Transfer_Binder;
0035 class Transfer_TransientProcess;
0036 class StepGeom_Axis2Placement3d;
0037 class gp_Trsf;
0038 class StepRepr_RepresentationRelationship;
0039 class TransferBRep_ShapeBinder;
0040 class StepBasic_ProductDefinition;
0041 class StepRepr_NextAssemblyUsageOccurrence;
0042 class StepShape_ShapeRepresentation;
0043 class StepShape_ContextDependentShapeRepresentation;
0044 class StepRepr_ShapeRepresentationRelationship;
0045 class StepGeom_GeometricRepresentationItem;
0046 class StepRepr_MappedItem;
0047 class StepShape_FaceSurface;
0048 class TopoDS_Shell;
0049 class TopoDS_Compound;
0050 class StepRepr_ConstructiveGeometryRepresentationRelationship;
0051 class StepRepr_MechanicalDesignAndDraughtingRelationship;
0052 class StepData_StepModel;
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   Standard_EXPORT STEPControl_ActorRead(const Handle(Interface_InterfaceModel)& theModel);
0067 
0068   Standard_EXPORT virtual Standard_Boolean Recognize(const Handle(Standard_Transient)& start)
0069     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
0077   //! shape
0078   Standard_EXPORT Handle(Transfer_Binder) TransferShape(
0079     const Handle(Standard_Transient)&        start,
0080     const Handle(Transfer_TransientProcess)& TP,
0081     const StepData_Factors&                  theLocalFactors = StepData_Factors(),
0082     const Standard_Boolean                   isManifold      = Standard_True,
0083     const Standard_Boolean                   theUseTrsf      = Standard_False,
0084     const Message_ProgressRange&             theProgress     = Message_ProgressRange());
0085 
0086   //! set units and tolerances context by given ShapeRepresentation
0087   Standard_EXPORT void PrepareUnits(const Handle(StepRepr_Representation)&   rep,
0088                                     const Handle(Transfer_TransientProcess)& TP,
0089                                     StepData_Factors&                        theLocalFactors);
0090 
0091   //! reset units and tolerances context to default
0092   //! (mm, radians, read.precision.val, etc.)
0093   Standard_EXPORT void ResetUnits(Handle(StepData_StepModel)& theModel,
0094                                   StepData_Factors&           theLocalFactors);
0095 
0096   //! Set model
0097   Standard_EXPORT void SetModel(const Handle(Interface_InterfaceModel)& theModel);
0098 
0099   //! Computes transformation defined by two axis placements (in MAPPED_ITEM
0100   //! or ITEM_DEFINED_TRANSFORMATION) taking into account their
0101   //! representation contexts (i.e. units, which may be different)
0102   //! Returns True if transformation is computed and is not an identity.
0103   Standard_EXPORT Standard_Boolean
0104     ComputeTransformation(const Handle(StepGeom_Axis2Placement3d)& Origin,
0105                           const Handle(StepGeom_Axis2Placement3d)& Target,
0106                           const Handle(StepRepr_Representation)&   OrigContext,
0107                           const Handle(StepRepr_Representation)&   TargContext,
0108                           const Handle(Transfer_TransientProcess)& TP,
0109                           gp_Trsf&                                 Trsf,
0110                           const StepData_Factors& theLocalFactors = StepData_Factors());
0111 
0112   //! Computes transformation defined by given
0113   //! REPRESENTATION_RELATIONSHIP_WITH_TRANSFORMATION
0114   Standard_EXPORT Standard_Boolean
0115     ComputeSRRWT(const Handle(StepRepr_RepresentationRelationship)& SRR,
0116                  const Handle(Transfer_TransientProcess)&           TP,
0117                  gp_Trsf&                                           Trsf,
0118                  const StepData_Factors& theLocalFactors = StepData_Factors());
0119 
0120   DEFINE_STANDARD_RTTIEXT(STEPControl_ActorRead, Transfer_ActorOfTransientProcess)
0121 
0122 protected:
0123   //! Transfers product definition entity
0124   //! theUseTrsf - special flag for using Axis2Placement from ShapeRepresentation for transform root
0125   //! shape
0126   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity(
0127     const Handle(StepBasic_ProductDefinition)& PD,
0128     const Handle(Transfer_TransientProcess)&   TP,
0129     const StepData_Factors&                    theLocalFactors = StepData_Factors(),
0130     const Standard_Boolean                     theUseTrsf      = Standard_False,
0131     const Message_ProgressRange&               theProgress     = Message_ProgressRange());
0132 
0133   //! Transfers next assembly usage occurrence entity
0134   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity(
0135     const Handle(StepRepr_NextAssemblyUsageOccurrence)& NAUO,
0136     const Handle(Transfer_TransientProcess)&            TP,
0137     const StepData_Factors&                             theLocalFactors = StepData_Factors(),
0138     const Message_ProgressRange&                        theProgress     = Message_ProgressRange());
0139 
0140   //! Transfers shape representation entity
0141   //! theUseTrsf - special flag for using Axis2Placement from ShapeRepresentation for transform root
0142   //! 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 = StepData_Factors(),
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
0160   //! shape
0161   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity(
0162     const Handle(StepRepr_ShapeRepresentationRelationship)& und,
0163     const Handle(Transfer_TransientProcess)&                TP,
0164     const StepData_Factors&                                 theLocalFactors,
0165     const Standard_Integer                                  nbrep       = 0,
0166     const Standard_Boolean                                  theUseTrsf  = Standard_False,
0167     const Message_ProgressRange&                            theProgress = Message_ProgressRange());
0168 
0169   //! Transfers  geometric representation item entity such as ManifoldSolidBRep ,...etc
0170   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity(
0171     const Handle(StepGeom_GeometricRepresentationItem)& git,
0172     const Handle(Transfer_TransientProcess)&            TP,
0173     const StepData_Factors&                             theLocalFactors,
0174     const Standard_Boolean                              isManifold,
0175     const Message_ProgressRange&                        theProgress);
0176 
0177   //! Transfers  mapped item
0178   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity(
0179     const Handle(StepRepr_MappedItem)&       mapit,
0180     const Handle(Transfer_TransientProcess)& TP,
0181     const StepData_Factors&                  theLocalFactors,
0182     const Message_ProgressRange&             theProgress);
0183 
0184   //! Transfers  FaceSurface entity
0185   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity(
0186     const Handle(StepShape_FaceSurface)&     fs,
0187     const Handle(Transfer_TransientProcess)& TP,
0188     const StepData_Factors&                  theLocalFactors,
0189     const Message_ProgressRange&             theProgress);
0190 
0191   Handle(TransferBRep_ShapeBinder) TransferEntity(
0192     const Handle(StepRepr_ConstructiveGeometryRepresentationRelationship)& theCGRR,
0193     const Handle(Transfer_TransientProcess)&                               theTP,
0194     const StepData_Factors& theLocalFactors = StepData_Factors());
0195 
0196   //! Transfers MechanicalDesignAndDraughtingRelationship entity
0197   Handle(TransferBRep_ShapeBinder) TransferEntity(
0198     const Handle(StepRepr_MechanicalDesignAndDraughtingRelationship)& theMDADR,
0199     const Handle(Transfer_TransientProcess)&                          theTP,
0200     const StepData_Factors&                                           theLocalFactors,
0201     const Message_ProgressRange&                                      theProgress);
0202 
0203   //! Translates file by old way when CDSR are roots . Acts only if "read.step.product_mode" is
0204   //! equal Off.
0205   Standard_EXPORT Handle(TransferBRep_ShapeBinder) OldWay(
0206     const Handle(Standard_Transient)&        start,
0207     const Handle(Transfer_TransientProcess)& TP,
0208     const Message_ProgressRange&             theProgress);
0209 
0210 private:
0211   Standard_EXPORT TopoDS_Shell closeIDEASShell(const TopoDS_Shell&         shell,
0212                                                const TopTools_ListOfShape& closingShells);
0213 
0214   Standard_EXPORT void computeIDEASClosings(
0215     const TopoDS_Compound&                     comp,
0216     TopTools_IndexedDataMapOfShapeListOfShape& shellClosingMap);
0217 
0218   Standard_EXPORT TopoDS_Shape
0219     TransferRelatedSRR(const Handle(Transfer_TransientProcess)&     theTP,
0220                        const Handle(StepShape_ShapeRepresentation)& theRep,
0221                        const Standard_Boolean                       theUseTrsf,
0222                        const Standard_Boolean                       theReadConstructiveGeomRR,
0223                        const StepData_Factors&                      theLocalFactors,
0224                        TopoDS_Compound&                             theCund,
0225                        Message_ProgressScope&                       thePS);
0226 
0227 private:
0228   StepToTopoDS_NMTool              myNMTool;
0229   Standard_Real                    myPrecision;
0230   Standard_Real                    myMaxTol;
0231   Handle(StepRepr_Representation)  mySRContext;
0232   Handle(Interface_InterfaceModel) myModel;
0233 };
0234 
0235 #endif // _STEPControl_ActorRead_HeaderFile