Nektar++
CADCurve.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 NEKTAR_LIB_UTILITIES_CADSYSTEM_CADCURVE_H
37 #define NEKTAR_LIB_UTILITIES_CADSYSTEM_CADCURVE_H
38 
39 #include <boost/shared_ptr.hpp>
40 
44 
46 
47 namespace Nektar {
48 namespace LibUtilities {
49 
50 /**
51  * @brief class for CAD curves.
52  *
53  * This class wraps the OpenCascade BRepAdaptor_Curve class for use with
54  * Nektar++.
55  */
56 class CADCurve
57 {
58  public:
59  friend class MemoryManager<CADCurve>;
60 
61  CADCurve(int i, TopoDS_Shape in);
67 
68  int GetID()
69  {
70  return m_ID;
71  }
72 
73  void SetAdjSurf(std::vector<int> i)
74  {
75  m_adjSurfs = i;
76  }
77 
78  std::vector<int> GetAdjSurf()
79  {
80  return m_adjSurfs;
81  }
82 
83  private:
84  /// ID of the curve.
85  int m_ID;
86  /// OpenCascade object of the curve.
87  BRepAdaptor_Curve m_occCurve;
88  /// List of surfaces which this curve belongs to.
89  std::vector<int> m_adjSurfs;
90 };
91 
92 typedef boost::shared_ptr<CADCurve> CADCurveSharedPtr;
93 
94 }
95 }
96 
97 #endif
Array< OneD, NekDouble > P(NekDouble t)
Gets the location (x,y,z) in an array out of the curve at point t.
Definition: CADCurve.cpp:124
Array< OneD, NekDouble > Bounds()
Returns the minimum and maximum parametric coords t of the curve.
Definition: CADCurve.cpp:142
NekDouble Length(NekDouble ti, NekDouble tf)
Calculates the arclength between the two paremetric points ti and tf. ti must be less than tf...
Definition: CADCurve.cpp:96
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
int m_ID
ID of the curve.
Definition: CADCurve.h:85
boost::shared_ptr< CADCurve > CADCurveSharedPtr
Definition: CADCurve.h:92
Array< OneD, NekDouble > GetMinMax()
Gets OpenCascade point objects for the start and end of the curve.
Definition: CADCurve.cpp:157
std::vector< int > GetAdjSurf()
Definition: CADCurve.h:78
CADCurve(int i, TopoDS_Shape in)
Default constructor.
Definition: CADCurve.cpp:46
double NekDouble
std::vector< int > m_adjSurfs
List of surfaces which this curve belongs to.
Definition: CADCurve.h:89
void SetAdjSurf(std::vector< int > i)
Definition: CADCurve.h:73
BRepAdaptor_Curve m_occCurve
OpenCascade object of the curve.
Definition: CADCurve.h:87
class for CAD curves.
Definition: CADCurve.h:56
NekDouble tAtArcLength(NekDouble s)
Calculates the parametric coordinate and arclength location defined by s.
Definition: CADCurve.cpp:65