Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Engine.Select] Automatically find topology in MeshBoundaryROI #5116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ class BaseROI : public core::DataEngine
void draw(const core::visual::VisualParams* vparams) final;
void computeBBox(const core::ExecParams* params, bool onlyVisible) final;

virtual void roiInit() {};
virtual bool roiDoUpdate() { return true; };
virtual void roiDraw(const core::visual::VisualParams*) {};
virtual void roiComputeBBox(const core::ExecParams*, type::BoundingBox&) {};
virtual void roiInit() {}
virtual bool roiDoUpdate() { return true; }
virtual void roiDraw(const core::visual::VisualParams*) {}
virtual void roiComputeBBox(const core::ExecParams*, type::BoundingBox&) {}

public:
//Input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,35 @@ MeshBoundaryROI::MeshBoundaryROI(): Inherit1()

void MeshBoundaryROI::init()
{
Inherit1::init();

if (!d_triangles.isSet() || !d_quads.isSet() )
{
msg_info(this) << "No topology given. Searching for a BaseMeshTopology in the current context.\n";
core::topology::BaseMeshTopology* topology = nullptr;
this->getContext()->get(topology, core::objectmodel::BaseContext::Local);

if (topology)
Copy link
Contributor

@hugtalbot hugtalbot Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add an error if not found?
+ invalid component state

{
if (!d_triangles.isSet())
{
if (core::BaseData* tparent = topology->findData("triangles"))
{
d_triangles.setParent(tparent);
d_triangles.setReadOnly(true);
}
}
if (!d_quads.isSet())
{
if (core::BaseData* tparent = topology->findData("quads"))
{
d_quads.setParent(tparent);
d_quads.setReadOnly(true);
}
}
}
}

setDirtyValue();
}

Expand Down
Loading