Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-12 08:46:29

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