Nektar++
Loading...
Searching...
No Matches
CADCurveOCE.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////////////
2//
3// File: CADCurveOCE.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 NEKTAR_SPATIALDOMAINS_CADSYSTEM_OCE_CADCURVEOCE
36#define NEKTAR_SPATIALDOMAINS_CADSYSTEM_OCE_CADCURVEOCE
37
40
42{
43
44class CADCurveOCE : public CADCurve
45{
46public:
51
52 static std::string key;
53
55 {
56 }
57
58 ~CADCurveOCE() override
59 {
60 }
61
62 std::array<NekDouble, 2> GetBounds() override;
63 void GetBounds(NekDouble &tmin, NekDouble &tmax) override;
64 NekDouble Length(NekDouble ti, NekDouble tf) override;
65 std::array<NekDouble, 3> P(NekDouble t) override;
66 void P(NekDouble t, NekDouble &x, NekDouble &y, NekDouble &z) override;
67 std::array<NekDouble, 9> D2(NekDouble t) override;
69 std::array<NekDouble, 6> GetMinMax() override;
70 NekDouble loct(std::array<NekDouble, 3> xyz, NekDouble &t) override;
71 NekDouble GetMinDistance(std::array<NekDouble, 3> &xyz) override;
72 NekDouble Curvature(NekDouble t) override;
73 std::array<NekDouble, 3> N(NekDouble t) override;
74 std::array<NekDouble, 6> BoundingBox(NekDouble scale) override;
75
76 void Initialise(int i, TopoDS_Shape in);
77
78 NekDouble loct(std::array<NekDouble, 3> xyz, NekDouble &t, NekDouble cf,
79 NekDouble cl) override;
80
81 /// The underlying OpenCASCADE edge, for engine-internal use.
82 const TopoDS_Edge &GetOccEdge() const
83 {
84 return m_occEdge;
85 }
86
87private:
88 /// OpenCascade edge
89 TopoDS_Edge m_occEdge;
90 /// object used for reverse lookups
91 Handle(Geom_Curve) m_c;
92 /// store the parametric bounds of the curve
93 std::array<NekDouble, 2> m_b;
94};
95} // namespace Nektar::SpatialDomains
96
97#endif
#define N
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
base class for CAD curves.
Definition CADCurve.h:58
const TopoDS_Edge & GetOccEdge() const
The underlying OpenCASCADE edge, for engine-internal use.
Definition CADCurveOCE.h:82
std::array< NekDouble, 2 > GetBounds() override
Returns the minimum and maximum parametric coords t of the curve.
NekDouble GetMinDistance(std::array< NekDouble, 3 > &xyz) override
Locates a point xyz in the parametric space. returns the distance to the point.
static CADCurveSharedPtr create()
Definition CADCurveOCE.h:47
std::array< NekDouble, 6 > BoundingBox(NekDouble scale) override
Returns the bounding box of a curve enlarged by 5e-3mm * scale.
std::array< NekDouble, 6 > GetMinMax() override
Gets the start and end of the curve.
void Initialise(int i, TopoDS_Shape in)
NekDouble loct(std::array< NekDouble, 3 > xyz, NekDouble &t) override
locates a point in the parametric space. returns the distance to the point and passes t by reference ...
std::array< NekDouble, 2 > m_b
store the parametric bounds of the curve
Definition CADCurveOCE.h:93
TopoDS_Edge m_occEdge
OpenCascade edge.
Definition CADCurveOCE.h:89
NekDouble Curvature(NekDouble t) override
Calculates the radius of curvature of the curve at point t.
std::array< NekDouble, 9 > D2(NekDouble t) override
Gets the second derivatives at t.
NekDouble tAtArcLength(NekDouble s) override
Calculates the parametric coordinate and arclength location defined by s.
Handle(Geom_Curve) m_c
object used for reverse lookups
NekDouble Length(NekDouble ti, NekDouble tf) override
Calculates the arclength between the two paremetric points ti and tf. ti must be less than tf.
std::shared_ptr< CADCurve > CADCurveSharedPtr
Definition CADCurve.h:247