7bd071ed |
1 | // Created on: 2016-04-07 |
2 | // Copyright (c) 2016 OPEN CASCADE SAS |
3 | // Created by: Oleg AGASHIN |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
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. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
16 | #include <BRepMeshData_Face.hxx> |
17 | #include <BRepMeshData_Wire.hxx> |
18 | #include <BRepMesh_OrientedEdge.hxx> |
19 | #include <BRepMesh_Vertex.hxx> |
20 | |
21 | //======================================================================= |
22 | // Function: Constructor |
23 | // Purpose : |
24 | //======================================================================= |
25 | BRepMeshData_Face::BRepMeshData_Face ( |
26 | const TopoDS_Face& theFace, |
27 | const Handle (NCollection_IncAllocator)& theAllocator) |
28 | : IMeshData_Face (theFace), |
29 | myAllocator (theAllocator), |
30 | myDWires (256, myAllocator) |
31 | { |
32 | } |
33 | |
34 | //======================================================================= |
35 | // Function: Destructor |
36 | // Purpose : |
37 | //======================================================================= |
38 | BRepMeshData_Face::~BRepMeshData_Face () |
39 | { |
40 | } |
41 | |
42 | //======================================================================= |
43 | // Function: WiresNb |
44 | // Purpose : |
45 | //======================================================================= |
46 | Standard_Integer BRepMeshData_Face::WiresNb () const |
47 | { |
48 | return myDWires.Size (); |
49 | } |
50 | |
51 | //======================================================================= |
52 | // Function: AddWire |
53 | // Purpose : |
54 | //======================================================================= |
55 | const IMeshData::IWireHandle& BRepMeshData_Face::AddWire ( |
56 | const TopoDS_Wire& theWire, |
57 | const Standard_Integer theEdgeNb) |
58 | { |
59 | IMeshData::IWireHandle aWire (new (myAllocator) BRepMeshData_Wire (theWire, theEdgeNb, myAllocator)); |
60 | myDWires.Append (aWire); |
61 | return GetWire (WiresNb () - 1); |
62 | } |
63 | |
64 | //======================================================================= |
65 | // Function: GetWire |
66 | // Purpose : |
67 | //======================================================================= |
68 | const IMeshData::IWireHandle& BRepMeshData_Face::GetWire ( |
69 | const Standard_Integer theIndex) const |
70 | { |
71 | return myDWires (theIndex); |
72 | } |