Nektar++
CADSurf.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: CADSurf.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 surface.
33 //
34 ////////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_LIB_UTILITIES_CADSYSTEM_CADSURF_H
37 #define NEKTAR_LIB_UTILITIES_CADSYSTEM_CADSURF_H
38 
39 #include <boost/shared_ptr.hpp>
40 
44 
46 
47 namespace Nektar {
48 namespace LibUtilities {
49 
50 class CADSurf
51 {
52  public:
53  friend class MemoryManager<CADSurf>;
54 
55  /**
56  * @brief Default constructor.
57  */
58  CADSurf(int i, TopoDS_Shape in,
59  std::vector<std::vector<std::pair<int,int> > > ein);
60 
61  /**
62  * @brief Get the IDs of the edges which bound the surface.
63  *
64  * The edges are organsised into two vectors, which are grouped into the
65  * continuous loops of the bounding edges, then the edges, which are a
66  * pair of integers. The first item is the edge ID and the second is an
67  * integer that indicates whether this edge is orientated forwards or
68  * backwards on this surface to form the loop.
69  */
70  std::vector<std::vector<std::pair<int,int> > > GetEdges()
71  {
72  return m_edges;
73  }
74 
75  /**
76  * @brief Get the limits of the parametric space for the surface.
77  *
78  * @return Array of 4 entries with parametric umin,umax,vmin,vmax.
79  */
81  {
83 
84  b[0] = m_occSurface.FirstUParameter();
85  b[1] = m_occSurface.LastUParameter();
86  b[2] = m_occSurface.FirstVParameter();
87  b[3] = m_occSurface.LastVParameter();
88 
89  return b;
90  }
91 
97 
98  private:
99  /// ID of surface.
100  int m_ID;
101  /// OpenCascade object for surface.
102  BRepAdaptor_Surface m_occSurface;
103  /// Alternate OpenCascade object for surface. Used by reverse lookup.
104  Handle(Geom_Surface) m_s;
105  /// List of bounding edges in loops with orientation.
106  std::vector<std::vector<std::pair<int,int> > > m_edges;
107 };
108 
109 typedef boost::shared_ptr<CADSurf> CADSurfSharedPtr;
110 
111 }
112 }
113 
114 #endif
Handle(Geom_Surface) m_s
Alternate OpenCascade object for surface. Used by reverse lookup.
Array< OneD, NekDouble > D1(Array< OneD, NekDouble > uv)
Get the set of first derivatives at parametric point u,v.
Definition: CADSurf.cpp:151
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
STL namespace.
Array< OneD, NekDouble > GetBounds()
Get the limits of the parametric space for the surface.
Definition: CADSurf.h:80
Array< OneD, NekDouble > locuv(Array< OneD, NekDouble > p)
Performs a reverse look up to find u,v and x,y,z.
Definition: CADSurf.cpp:63
Array< OneD, NekDouble > P(Array< OneD, NekDouble > uv)
Get the x,y,z at parametric point u,v.
Definition: CADSurf.cpp:100
std::vector< std::vector< std::pair< int, int > > > GetEdges()
Get the IDs of the edges which bound the surface.
Definition: CADSurf.h:70
Array< OneD, NekDouble > N(Array< OneD, NekDouble > uv)
Get the normal vector at parametric point u,v.
Definition: CADSurf.cpp:118
boost::shared_ptr< CADSurf > CADSurfSharedPtr
Definition: CADSurf.h:109
BRepAdaptor_Surface m_occSurface
OpenCascade object for surface.
Definition: CADSurf.h:102
CADSurf(int i, TopoDS_Shape in, std::vector< std::vector< std::pair< int, int > > > ein)
Default constructor.
Definition: CADSurf.cpp:43
Array< OneD, NekDouble > D2(Array< OneD, NekDouble > uv)
Get the set of second derivatives at parametric point u,v.
Definition: CADSurf.cpp:178
int m_ID
ID of surface.
Definition: CADSurf.h:100
std::vector< std::vector< std::pair< int, int > > > m_edges
List of bounding edges in loops with orientation.
Definition: CADSurf.h:106