Nektar++
CADCurveOCE.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_OCE_CADCURVEOCE
36 #define NEKMESHUTILS_CADSYSTEM_OCE_CADCURVEOCE
37 
40 
41 namespace Nektar
42 {
43 namespace NekMeshUtils
44 {
45 
46 class CADCurveOCE : public CADCurve
47 {
48 public:
50  {
52  }
53 
54  static std::string key;
55 
57  {
58  }
59 
61  {
62  }
63 
65  virtual void GetBounds(NekDouble &tmin, NekDouble &tmax);
66  virtual NekDouble Length(NekDouble ti, NekDouble tf);
68  virtual void P(NekDouble t, NekDouble &x, NekDouble &y, NekDouble &z);
70  virtual NekDouble tAtArcLength(NekDouble s);
73  virtual NekDouble Curvature(NekDouble t);
75 
76  void Initialise(int i, TopoDS_Shape in);
77 
78 private:
79  /// OpenCascade edge
80  TopoDS_Edge m_occEdge;
81  /// object used for reverse lookups
82  Handle(Geom_Curve) m_c;
83  /// store the parametric bounds of the curve
85 };
86 }
87 }
88 
89 #endif
base class for CAD curves.
Definition: CADCurve.h:58
Handle(Geom_Curve) m_c
object used for reverse lookups
virtual Array< OneD, NekDouble > GetMinMax()
Gets the start and end of the curve.
virtual Array< OneD, NekDouble > P(NekDouble t)
Gets the location (x,y,z) in an array out of the curve at point t.
Definition: CADCurveOCE.cpp:90
void Initialise(int i, TopoDS_Shape in)
Definition: CADCurveOCE.cpp:47
virtual NekDouble tAtArcLength(NekDouble s)
Calculates the parametric coordinate and arclength location defined by s.
Definition: CADCurveOCE.cpp:61
virtual NekDouble Curvature(NekDouble t)
Calculates the radius of curvature of the curve at point t.
virtual Array< OneD, NekDouble > N(NekDouble t)
Returns the normal to a curve, it will always point in the concave direction.
virtual Array< OneD, NekDouble > D2(NekDouble t)
Gets the second derivatives at t.
std::shared_ptr< CADCurve > CADCurveSharedPtr
Definition: CADCurve.h:219
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
virtual Array< OneD, NekDouble > GetBounds()
Returns the minimum and maximum parametric coords t of the curve.
virtual NekDouble loct(Array< OneD, NekDouble > xyz, NekDouble &t)
Definition: CADCurveOCE.cpp:77
double NekDouble
virtual NekDouble Length(NekDouble ti, NekDouble tf)
Calculates the arclength between the two paremetric points ti and tf. ti must be less than tf...
Definition: CADCurveOCE.cpp:68
static CADCurveSharedPtr create()
Definition: CADCurveOCE.h:49
TopoDS_Edge m_occEdge
OpenCascade edge.
Definition: CADCurveOCE.h:80
Array< OneD, NekDouble > m_b
store the parametric bounds of the curve
Definition: CADCurveOCE.h:84