Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CADVert.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: CADCurve.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 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: CAD object curve.
33 //
34 ////////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKMESHUTILS_CADSYSTEM_CADVERT
37 #define NEKMESHUTILS_CADSYSTEM_CADVERT
38 
39 #include <boost/shared_ptr.hpp>
40 
43 
46 
47 namespace Nektar
48 {
49 namespace NekMeshUtils
50 {
51 
52 /**
53  * @brief base class for CAD verticies.
54  *
55  */
56 class CADVert : public CADObject
57 {
58 public:
59  friend class MemoryManager<CADVert>;
60 
61  /**
62  * @brief Default constructor.
63  */
65  {
67  }
68 
69  ~CADVert(){};
70 
71  /**
72  * @brief Get x,y,z location of the vertex
73  */
75  {
77  out[0] = m_node->m_x;
78  out[1] = m_node->m_y;
79  out[2] = m_node->m_z;
80  return out;
81  }
82 
83  /**
84  * @brief returns a node object of the cad vertex
85  */
87  {
88  return m_node;
89  }
90 
91  /**
92  * @brief if the vertex is degenerate manually set uv for that surface
93  */
95  {
96  degen = true;
97  degensurf = s;
99  uv[0] = u;
100  uv[1] = v;
101  m_node->SetCADSurf(s, su, uv);
102  }
103 
104  /**
105  * @brief query is degenerate
106  */
107  int IsDegen()
108  {
109  if (degen)
110  {
111  return degensurf;
112  }
113  else
114  {
115  return -1;
116  }
117  }
118 
119 protected:
120  /// mesh convert object of vert
122  /// degen marker
123  bool degen;
124  /// degen surface
126 };
127 
128 typedef boost::shared_ptr<CADVert> CADVertSharedPtr;
129 
131 
132 CADVertFactory& GetCADVertFactory();
133 
134 }
135 }
136 
137 #endif
CADType::cadType m_type
type of the cad object
Definition: CADObject.h:107
NodeSharedPtr m_node
mesh convert object of vert
Definition: CADVert.h:121
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
CADVertFactory & GetCADVertFactory()
Definition: CADSystem.cpp:56
CADVert()
Default constructor.
Definition: CADVert.h:64
int degensurf
degen surface
Definition: CADVert.h:125
boost::shared_ptr< Node > NodeSharedPtr
Definition: Node.h:50
double NekDouble
int IsDegen()
query is degenerate
Definition: CADVert.h:107
Array< OneD, NekDouble > GetLoc()
Get x,y,z location of the vertex.
Definition: CADVert.h:74
base class for CAD verticies.
Definition: CADVert.h:56
boost::shared_ptr< CADSurf > CADSurfSharedPtr
Definition: CADSurf.h:172
LibUtilities::NekFactory< std::string, CADVert > CADVertFactory
Definition: CADVert.h:130
NodeSharedPtr GetNode()
returns a node object of the cad vertex
Definition: CADVert.h:86
boost::shared_ptr< CADVert > CADVertSharedPtr
Definition: CADSystem.h:54
bool degen
degen marker
Definition: CADVert.h:123
void SetDegen(int s, CADSurfSharedPtr su, NekDouble u, NekDouble v)
if the vertex is degenerate manually set uv for that surface
Definition: CADVert.h:94
Provides a generic Factory class.
Definition: NekFactory.hpp:116