Nektar++
CADSystemOCE.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: CADSystem.h
4 //
5 // For more information, please see: http://www.nektar.info/
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: cad object methods.
32 //
33 ////////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NekMeshUtils_CADSYSTEM_OCE_CADSYSTEMOCE
36 #define NekMeshUtils_CADSYSTEM_OCE_CADSYSTEMOCE
37 
40 
41 namespace Nektar
42 {
43 namespace NekMeshUtils
44 {
45 
46 class CADSystemOCE : public CADSystem
47 {
48 public:
49 
50  static CADSystemSharedPtr create(std::string name)
51  {
53  }
54 
55  static std::string key;
56 
57  /**
58  * @brief Default constructor.
59  */
60  CADSystemOCE(std::string name) : CADSystem(name) {}
62 
63  bool LoadCAD();
64 
66 
67  TopoDS_Shape GetShape()
68  {
69  return shape;
70  }
71 
72 
73 private:
74  /// Function to add curve to CADSystem::m_verts.
75  void AddVert(int i, TopoDS_Shape in);
76  /// Function to add curve to CADSystem::m_curves.
77  void AddCurve(int i, TopoDS_Shape in);
78  /// Function to add surface to CADSystem::m_surfs.
79  void AddSurf(int i, TopoDS_Shape in);
80 
81  TopoDS_Shape BuildNACA(std::string naca);
82  TopoDS_Shape BuildGeo(std::string geo);
83  /// OCC master object
84  TopoDS_Shape shape;
85  TopTools_IndexedMapOfShape mapOfVerts, mapOfEdges, mapOfFaces;
86 };
87 
88 typedef std::shared_ptr<CADSystemOCE> CADSystemOCESharedPtr;
89 
90 
91 }
92 }
93 
94 #endif
static CADSystemSharedPtr create(std::string name)
Definition: CADSystemOCE.h:50
Base class for CAD interface system.
Definition: CADSystem.h:66
std::shared_ptr< CADSystem > CADSystemSharedPtr
Definition: CADSystem.h:240
void AddVert(int i, TopoDS_Shape in)
Function to add curve to CADSystem::m_verts.
TopoDS_Shape BuildGeo(std::string geo)
void AddCurve(int i, TopoDS_Shape in)
Function to add curve to CADSystem::m_curves.
TopoDS_Shape shape
OCC master object.
Definition: CADSystemOCE.h:84
std::shared_ptr< CADSystemOCE > CADSystemOCESharedPtr
Definition: CADSystemOCE.h:88
TopoDS_Shape BuildNACA(std::string naca)
CADSystemOCE(std::string name)
Default constructor.
Definition: CADSystemOCE.h:60
Array< OneD, NekDouble > GetBoundingBox()
Returns bounding box of the domain.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
TopTools_IndexedMapOfShape mapOfFaces
Definition: CADSystemOCE.h:85
TopTools_IndexedMapOfShape mapOfVerts
Definition: CADSystemOCE.h:85
bool LoadCAD()
Initialises CAD and makes surface, curve and vertex maps.
TopTools_IndexedMapOfShape mapOfEdges
Definition: CADSystemOCE.h:85
void AddSurf(int i, TopoDS_Shape in)
Function to add surface to CADSystem::m_surfs.