Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-09 09:33:06

0001 // Created on: 1995-04-25
0002 // Created by: Marie Jose MARTZ
0003 // Copyright (c) 1995-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 _BRepToIGESBRep_Entity_HeaderFile
0018 #define _BRepToIGESBRep_Entity_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TopTools_ShapeMapHasher.hxx>
0025 #include <NCollection_IndexedMap.hxx>
0026 #include <Standard_Transient.hxx>
0027 #include <NCollection_Sequence.hxx>
0028 #include <BRepToIGES_BREntity.hxx>
0029 #include <Standard_Integer.hxx>
0030 #include <Message_ProgressRange.hxx>
0031 
0032 class IGESSolid_EdgeList;
0033 class IGESSolid_VertexList;
0034 class TopoDS_Vertex;
0035 class TopoDS_Edge;
0036 class IGESData_IGESEntity;
0037 class TopoDS_Shape;
0038 class TopoDS_Face;
0039 class IGESSolid_Loop;
0040 class TopoDS_Wire;
0041 class IGESSolid_Face;
0042 class IGESSolid_Shell;
0043 class TopoDS_Shell;
0044 class IGESSolid_ManifoldSolid;
0045 class TopoDS_Solid;
0046 class TopoDS_CompSolid;
0047 class TopoDS_Compound;
0048 
0049 //! provides methods to transfer BRep entity from CASCADE to IGESBRep.
0050 class BRepToIGESBRep_Entity : public BRepToIGES_BREntity
0051 {
0052 public:
0053   DEFINE_STANDARD_ALLOC
0054 
0055   //! Creates a tool Entity
0056   Standard_EXPORT BRepToIGESBRep_Entity();
0057 
0058   //! Clears the contents of the fields
0059   Standard_EXPORT void Clear();
0060 
0061   //! Create the VertexList entity
0062   Standard_EXPORT void TransferVertexList();
0063 
0064   //! Returns the index of <myvertex> in "myVertices"
0065   Standard_EXPORT int IndexVertex(const TopoDS_Vertex& myvertex) const;
0066 
0067   //! Stores <myvertex> in "myVertices"
0068   //! Returns the index of <myvertex>.
0069   Standard_EXPORT int AddVertex(const TopoDS_Vertex& myvertex);
0070 
0071   //! Transfer an Edge entity from TopoDS to IGES
0072   Standard_EXPORT void TransferEdgeList();
0073 
0074   //! Returns the index of <myedge> in "myEdges"
0075   Standard_EXPORT int IndexEdge(const TopoDS_Edge& myedge) const;
0076 
0077   //! Stores <myedge> in "myEdges" and <mycurve3d> in "myCurves".
0078   //! Returns the index of <myedge>.
0079   Standard_EXPORT int AddEdge(const TopoDS_Edge&                      myedge,
0080                               const occ::handle<IGESData_IGESEntity>& mycurve3d);
0081 
0082   //! Returns the result of the transfert of any Shape
0083   //! If the transfer has failed, this member returns a NullEntity.
0084   Standard_EXPORT occ::handle<IGESData_IGESEntity> TransferShape(
0085     const TopoDS_Shape&          start,
0086     const Message_ProgressRange& theProgress = Message_ProgressRange()) override;
0087 
0088   //! Transfer an Edge entity from TopoDS to IGES
0089   //! If this Entity could not be converted, this member returns a NullEntity.
0090   Standard_EXPORT occ::handle<IGESData_IGESEntity> TransferEdge(const TopoDS_Edge& myedge);
0091 
0092   //! Transfer an Edge entity from TopoDS to IGES
0093   //! If this Entity could not be converted, this member returns a NullEntity.
0094   Standard_EXPORT occ::handle<IGESData_IGESEntity> TransferEdge(const TopoDS_Edge& myedge,
0095                                                                 const TopoDS_Face& myface,
0096                                                                 const double       length);
0097 
0098   //! Transfer a Wire entity from TopoDS to IGES.
0099   //! Returns the curve associated to mywire in the parametric space of myface.
0100   //! If this Entity could not be converted, this member returns a NullEntity.
0101   Standard_EXPORT occ::handle<IGESSolid_Loop> TransferWire(const TopoDS_Wire& mywire,
0102                                                            const TopoDS_Face& myface,
0103                                                            const double       length);
0104 
0105   //! Transfer a Face entity from TopoDS to IGES
0106   //! If this Entity could not be converted, this member returns a NullEntity.
0107   Standard_EXPORT occ::handle<IGESSolid_Face> TransferFace(const TopoDS_Face& start);
0108 
0109   //! Transfer an Shell entity from TopoDS to IGES
0110   //! If this Entity could not be converted, this member returns a NullEntity.
0111   Standard_EXPORT occ::handle<IGESSolid_Shell> TransferShell(
0112     const TopoDS_Shell&          start,
0113     const Message_ProgressRange& theProgress = Message_ProgressRange());
0114 
0115   //! Transfer a Solid entity from TopoDS to IGES
0116   //! If this Entity could not be converted, this member returns a NullEntity.
0117   Standard_EXPORT occ::handle<IGESSolid_ManifoldSolid> TransferSolid(
0118     const TopoDS_Solid&          start,
0119     const Message_ProgressRange& theProgress = Message_ProgressRange());
0120 
0121   //! Transfer an CompSolid entity from TopoDS to IGES
0122   //! If this Entity could not be converted, this member returns a NullEntity.
0123   Standard_EXPORT occ::handle<IGESData_IGESEntity> TransferCompSolid(
0124     const TopoDS_CompSolid&      start,
0125     const Message_ProgressRange& theProgress = Message_ProgressRange());
0126 
0127   //! Transfer a Compound entity from TopoDS to IGES
0128   //! If this Entity could not be converted, this member returns a NullEntity.
0129   Standard_EXPORT occ::handle<IGESData_IGESEntity> TransferCompound(
0130     const TopoDS_Compound&       start,
0131     const Message_ProgressRange& theProgress = Message_ProgressRange());
0132 
0133 private:
0134   NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher> myVertices;
0135   NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher> myEdges;
0136   NCollection_Sequence<occ::handle<Standard_Transient>>         myCurves;
0137   occ::handle<IGESSolid_EdgeList>                               myEdgeList;
0138   occ::handle<IGESSolid_VertexList>                             myVertexList;
0139 };
0140 
0141 #endif // _BRepToIGESBRep_Entity_HeaderFile