Nektar++
CADObject.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: CADObj.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 curve.
32 //
33 ////////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKMESHUTILS_CADSYSTEM_CADOBJ
36 #define NEKMESHUTILS_CADSYSTEM_CADOBJ
37 
39 
40 namespace Nektar
41 {
42 namespace NekMeshUtils
43 {
44 
45 namespace CADType
46 {
47 enum cadType
48 {
52 };
53 }
54 
55 namespace CADOrientation
56 {
58 {
62 };
63 }
64 
65 class CADObject
66 {
67 public:
68  friend class MemoryManager<CADObject>;
69 
70  /**
71  * @brief Default constructor.
72  */
74  {
75  }
76 
77  virtual ~CADObject()
78  {
79  }
80 
81  /**
82  * @brief Return ID of the CAD object
83  */
84  int GetId()
85  {
86  return m_id;
87  }
88 
89  /**
90  * @brief Get the type of the CAD object
91  */
93  {
94  return m_type;
95  }
96 
97  /**
98  * @brief Get the Orientation of the CAD object
99  */
101  {
102  ASSERTL0(false,"must be implemented at the cad object level");
104  }
105 
106  /**
107  * @brief Give the CAD object a string name
108  */
109  void SetName(std::string i)
110  {
111  m_name = i;
112  }
113 
114  /**
115  * @brief Get the name of a CAD object
116  */
117  std::string GetName()
118  {
119  return m_name;
120  }
121 
122 protected:
123  /// ID of the vert.
124  int m_id;
125  /// type of the cad object
127  /// orientation of the CADObject
129  /// string name of the cad
130  std::string m_name;
131 };
132 
133 typedef std::shared_ptr<CADObject> CADObjectSharedPtr;
134 }
135 }
136 
137 #endif
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
CADType::cadType m_type
type of the cad object
Definition: CADObject.h:126
CADType::cadType GetType()
Get the type of the CAD object.
Definition: CADObject.h:92
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
int GetId()
Return ID of the CAD object.
Definition: CADObject.h:84
virtual CADOrientation::Orientation Orientation()
Get the Orientation of the CAD object.
Definition: CADObject.h:100
std::string GetName()
Get the name of a CAD object.
Definition: CADObject.h:117
CADOrientation::Orientation m_orientation
orientation of the CADObject
Definition: CADObject.h:128
void SetName(std::string i)
Give the CAD object a string name.
Definition: CADObject.h:109
int m_id
ID of the vert.
Definition: CADObject.h:124
std::shared_ptr< CADObject > CADObjectSharedPtr
Definition: CADObject.h:133
std::string m_name
string name of the cad
Definition: CADObject.h:130
CADObject()
Default constructor.
Definition: CADObject.h:73