48const std::vector<CADLink> g_noLinks;
54 return it ==
m_links.end() ? g_noLinks : it->second;
60 std::vector<CADLink> ret;
76 cnt += (link.Type() == t) ? 1 : 0;
86 if (link.Type() == t && link.Id() == cadId)
111 : std::static_pointer_cast<CADSurf>(link->
obj);
118 : std::static_pointer_cast<CADCurve>(link->
obj);
125 : std::static_pointer_cast<CADVert>(link->
obj);
131 std::vector<CADSurfSharedPtr> ret;
136 ret.push_back(std::static_pointer_cast<CADSurf>(link.obj));
145 std::vector<CADCurveSharedPtr> ret;
150 ret.push_back(std::static_pointer_cast<CADCurve>(link.obj));
161 "The desired CADSurf is not associated with this entity.");
169 "The desired CADCurve is not associated with this entity.");
170 return link->
param[0];
175 ASSERTL1(link.
obj !=
nullptr,
"Cannot associate a null CAD object.");
178 for (
auto &existing : links)
182 if (existing.Type() == link.
Type() && existing.Id() == link.
Id())
184 existing = std::move(link);
188 links.push_back(std::move(link));
193 ASSERTL1(link.
obj !=
nullptr,
"Cannot associate a null CAD object.");
198 links.erase(std::remove_if(links.begin(), links.end(),
200 return existing.Type() == t;
203 links.push_back(std::move(link));
221 for (
auto *pt : curve->m_points)
232 if (it->first->GetShapeDim() > 0)
238 auto &links = it->second;
239 links.erase(std::remove_if(
240 links.begin(), links.end(),
241 [t](
const CADLink &link) { return link.Type() == t; }),
244 it = links.empty() ?
m_links.erase(it) : std::next(it);
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
CADVertSharedPtr GetVert(const Geometry *geom) const
The CAD vertex geom coincides with, or nullptr.
const CADLink * GetLink(const Geometry *geom, CADType::cadType t, int cadId) const
The link to the CAD object of type t and ID cadId, or nullptr if geom is not associated with it.
size_t Count(const Geometry *geom, CADType::cadType t) const
Number of CAD objects of type t that geom is associated with.
std::unordered_map< const Geometry *, std::vector< CADLink > > m_links
CADCurveSharedPtr GetCurve(const Geometry *geom) const
The first CAD curve geom lies on, or nullptr.
CADSurfSharedPtr GetSurf(const Geometry *geom) const
The first CAD surface geom lies on, or nullptr.
std::array< NekDouble, 2 > GetSurfUV(const Geometry *geom, int cadId) const
The of geom on the CAD surface of ID cadId.
void ClearVertLinks(CADType::cadType t)
Drop links of type t from zero-dimensional entities (vertices and curvature nodes),...
std::vector< CADSurfSharedPtr > GetSurfs(const Geometry *geom) const
All CAD surfaces geom lies on.
const std::vector< CADLink > & GetLinks(const Geometry *geom) const
All links held by geom, in insertion order.
void Add(const Geometry *geom, CADLink link)
Associate geom with the CAD object in link.
void Remove(Geometry *geom)
Drop every association held by geom.
void Set(const Geometry *geom, CADLink link)
Associate geom with link, replacing any link it already holds of the same CAD type.
NekDouble GetCurveT(const Geometry *geom, int cadId) const
The of geom on the CAD curve of ID cadId.
std::vector< CADCurveSharedPtr > GetCurves(const Geometry *geom) const
All CAD curves geom lies on.
int GetShapeDim() const
Dimension of the shape itself, which may be less than GetCoordim().
virtual Curve * GetCurve()
The curvature attached to this object, or nullptr if it is straight-sided. Only valid for shapes that...
std::shared_ptr< CADCurve > CADCurveSharedPtr
std::shared_ptr< CADVert > CADVertSharedPtr
std::shared_ptr< CADSurf > CADSurfSharedPtr
Where a single mesh entity sits on the CAD.
CADType::cadType Type() const
std::array< NekDouble, 2 > param
Parametric position on obj: t in [0], or (u,v) in [0],[1].
CADObjectSharedPtr obj
The CAD curve, surface or vertex this entity lies on.