Nektar++
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 // 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_CADVERT
36 #define NEKMESHUTILS_CADSYSTEM_CADVERT
37 
40 
42 
43 namespace Nektar
44 {
45 namespace NekMeshUtils
46 {
47 
48 //forward decleration
49 class Node;
50 typedef std::shared_ptr<Node> NodeSharedPtr;
51 class CADSurf;
52 typedef std::shared_ptr<CADSurf> CADSurfSharedPtr;
53 class CADCurve;
54 typedef std::shared_ptr<CADCurve> CADCurveSharedPtr;
55 
56 /**
57  * @brief base class for CAD verticies.
58  *
59  */
60 class CADVert : public CADObject
61 {
62 public:
63  friend class MemoryManager<CADVert>;
64 
65  /**
66  * @brief Default constructor.
67  */
69  {
71  }
72 
73  virtual ~CADVert(){};
74 
75  /**
76  * @brief Get x,y,z location of the vertex
77  */
79 
80  /**
81  * @brief returns a node object of the cad vertex
82  */
83  NodeSharedPtr GetNode()
84  {
85  return m_node;
86  }
87 
88  /**
89  * @brief if the vertex is degenerate manually set uv for that surface
90  */
91  void SetDegen(int s, CADSurfSharedPtr su, NekDouble u, NekDouble v);
92 
93  /**
94  * @brief query is degenerate
95  */
96  int IsDegen()
97  {
98  if (degen)
99  {
100  return degensurf;
101  }
102  else
103  {
104  return -1;
105  }
106  }
107 
108  /**
109  * @brief Calcuate the distance to a vertex from a point l(x,y,z)
110  */
112 
113  void AddAdjCurve(CADCurveSharedPtr c)
114  {
115  curves.push_back(c);
116  }
117 
118  /**
119  * @brief Get list of CAD curves which are bound by this vertex
120  */
121  std::vector<CADCurveSharedPtr> GetAdjCurves()
122  {
123  return curves;
124  }
125 
126 protected:
127  /// mesh convert object of vert
128  NodeSharedPtr m_node;
129  /// degen marker
130  bool degen;
131  /// degen surface
133  /// adjacent curves
134  std::vector<CADCurveSharedPtr> curves;
135 };
136 
137 typedef std::shared_ptr<CADVert> CADVertSharedPtr;
138 
140 
141 CADVertFactory& GetCADVertFactory();
142 
143 }
144 }
145 
146 #endif
Array< OneD, NekDouble > GetLoc()
Get x,y,z location of the vertex.
Definition: CADVert.cpp:54
std::shared_ptr< CADSurf > CADSurfSharedPtr
Definition: CADCurve.h:51
base class for CAD curves.
Definition: CADCurve.h:58
CADType::cadType m_type
type of the cad object
Definition: CADObject.h:126
NodeSharedPtr m_node
mesh convert object of vert
Definition: CADVert.h:128
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
std::shared_ptr< CADVert > CADVertSharedPtr
Definition: CADCurve.h:49
CADVertFactory & GetCADVertFactory()
Definition: CADSystem.cpp:53
CADVert()
Default constructor.
Definition: CADVert.h:68
Represents a point in the domain.
Definition: Node.h:62
std::shared_ptr< Node > NodeSharedPtr
Definition: CADVert.h:49
virtual NekDouble DistanceTo(Array< OneD, NekDouble > l)=0
Calcuate the distance to a vertex from a point l(x,y,z)
Definition: CADVert.cpp:63
int degensurf
degen surface
Definition: CADVert.h:132
std::shared_ptr< CADCurve > CADCurveSharedPtr
Definition: CADCurve.h:219
base class for a cad surface
Definition: CADSurf.h:71
std::vector< CADCurveSharedPtr > curves
adjacent curves
Definition: CADVert.h:134
double NekDouble
int IsDegen()
query is degenerate
Definition: CADVert.h:96
base class for CAD verticies.
Definition: CADVert.h:60
std::vector< CADCurveSharedPtr > GetAdjCurves()
Get list of CAD curves which are bound by this vertex.
Definition: CADVert.h:121
LibUtilities::NekFactory< std::string, CADVert > CADVertFactory
Definition: CADVert.h:139
NodeSharedPtr GetNode()
returns a node object of the cad vertex
Definition: CADVert.h:83
void AddAdjCurve(CADCurveSharedPtr c)
Definition: CADVert.h:113
bool degen
degen marker
Definition: CADVert.h:130
void SetDegen(int s, CADSurfSharedPtr su, NekDouble u, NekDouble v)
if the vertex is degenerate manually set uv for that surface
Definition: CADVert.cpp:44
Provides a generic Factory class.
Definition: NekFactory.hpp:103