1 // Created on: 2016-04-07
2 // Copyright (c) 2016 OPEN CASCADE SAS
3 // Created by: Oleg AGASHIN
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <BRepMeshData_Wire.hxx>
17 #include <IMeshData_Edge.hxx>
19 IMPLEMENT_STANDARD_RTTIEXT(BRepMeshData_Wire, IMeshData_Wire)
21 //=======================================================================
22 // Function: Constructor
24 //=======================================================================
25 BRepMeshData_Wire::BRepMeshData_Wire (
26 const TopoDS_Wire& theWire,
27 const Standard_Integer theEdgeNb,
28 const Handle (NCollection_IncAllocator)& theAllocator)
29 : IMeshData_Wire (theWire),
30 myDEdges (theEdgeNb > 0 ? theEdgeNb : 256, theAllocator),
31 myDEdgesOri (theEdgeNb > 0 ? theEdgeNb : 256, theAllocator)
35 //=======================================================================
36 // Function: Destructor
38 //=======================================================================
39 BRepMeshData_Wire::~BRepMeshData_Wire ()
43 //=======================================================================
46 //=======================================================================
47 Standard_Integer BRepMeshData_Wire::EdgesNb () const
49 return myDEdges.Size ();
52 //=======================================================================
53 // Function: Destructor
55 //=======================================================================
56 Standard_Integer BRepMeshData_Wire::AddEdge (
57 const IMeshData::IEdgePtr& theDEdge,
58 const TopAbs_Orientation theOrientation)
60 const Standard_Integer aIndex = EdgesNb ();
62 myDEdges .Append (theDEdge);
63 myDEdgesOri.Append (theOrientation);
68 //=======================================================================
71 //=======================================================================
72 const IMeshData::IEdgePtr& BRepMeshData_Wire::GetEdge (
73 const Standard_Integer theIndex) const
75 return myDEdges (theIndex);
78 //=======================================================================
79 // Function: GetEdgeOrientation
81 //=======================================================================
82 TopAbs_Orientation BRepMeshData_Wire::GetEdgeOrientation (
83 const Standard_Integer theIndex) const
85 return myDEdgesOri (theIndex);