Nektar++
CADSurfOCE.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 // 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 surface.
32 //
33 ////////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NekMeshUtils_CADSYSTEM_OCE_CADSURFOCE
36 #define NekMeshUtils_CADSYSTEM_OCE_CADSURFOCE
37 
40 
41 namespace Nektar
42 {
43 namespace NekMeshUtils
44 {
45 
46 class CADSurfOCE : public CADSurf
47 {
48 public:
50  {
52  }
53 
54  static std::string key;
55 
57  {
58  }
59 
61  {
62  }
63 
64  void Initialise(int i, TopoDS_Shape in);
65 
67  virtual void GetBounds(NekDouble &umin, NekDouble &umax, NekDouble &vmin,
68  NekDouble &vmax);
73  virtual void P(Array<OneD, NekDouble> uv, NekDouble &x, NekDouble &y,
74  NekDouble &z);
76  NekDouble &dist);
79  virtual bool IsPlanar();
80 
81 private:
82  /// Function which tests the the value of uv used is within the surface
84  /// OpenCascade object for surface.
85  Handle(Geom_Surface) m_s;
86  /// parametric bounds
88  /// locuv object (stored because it gets faster with stored information)
89  ShapeAnalysis_Surface *m_sas;
90  /// original shape
91  TopoDS_Shape m_shape;
92  ///
93  BRepTopAdaptor_FClass2d *m_2Dclass;
94 };
95 
96 } // namespace NekMeshUtils
97 } // namespace Nektar
98 
99 #endif
virtual Array< OneD, NekDouble > D1(Array< OneD, NekDouble > uv)
Get the set of first derivatives at parametric point u,v.
Definition: CADSurfOCE.cpp:212
std::shared_ptr< CADSurf > CADSurfSharedPtr
Definition: CADCurve.h:51
TopoDS_Shape m_shape
original shape
Definition: CADSurfOCE.h:91
virtual Array< OneD, NekDouble > N(Array< OneD, NekDouble > uv)
Get the normal vector at parametric point u,v.
Definition: CADSurfOCE.cpp:181
static CADSurfSharedPtr create()
Definition: CADSurfOCE.h:49
void Initialise(int i, TopoDS_Shape in)
Definition: CADSurfOCE.cpp:47
BRepTopAdaptor_FClass2d * m_2Dclass
Definition: CADSurfOCE.h:93
void Test(Array< OneD, NekDouble > uv)
Function which tests the the value of uv used is within the surface.
Definition: CADSurfOCE.cpp:269
base class for a cad surface
Definition: CADSurf.h:71
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Array< OneD, NekDouble > m_bounds
parametric bounds
Definition: CADSurfOCE.h:87
double NekDouble
virtual Array< OneD, NekDouble > BoundingBox()
Returns the bounding box of the surface.
Definition: CADSurfOCE.cpp:93
virtual NekDouble Curvature(Array< OneD, NekDouble > uv)
returns curvature at point uv
Definition: CADSurfOCE.cpp:142
virtual Array< OneD, NekDouble > D2(Array< OneD, NekDouble > uv)
Get the set of second derivatives at parametric point u,v.
Definition: CADSurfOCE.cpp:236
virtual Array< OneD, NekDouble > locuv(Array< OneD, NekDouble > p, NekDouble &dist)
Performs a reverse look up to find u,v and x,y,z. if xyz is off the surface it will return the closes...
Definition: CADSurfOCE.cpp:113
virtual Array< OneD, NekDouble > GetBounds()
Get the limits of the parametric space for the surface.
Definition: CADSurfOCE.cpp:69
ShapeAnalysis_Surface * m_sas
locuv object (stored because it gets faster with stored information)
Definition: CADSurfOCE.h:89
virtual Array< OneD, NekDouble > P(Array< OneD, NekDouble > uv)
Get the x,y,z at parametric point u,v.
Definition: CADSurfOCE.cpp:154
virtual bool IsPlanar()
Is the surface defined by a planar surface (i.e not nurbs and is flat)
Definition: CADSurfOCE.cpp:83
Handle(Geom_Surface) m_s
OpenCascade object for surface.