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

[WireRestShape] Remove unnecessary use of Edge2QuatTopologyMapping #64

Merged
merged 2 commits into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/BeamAdapter/component/engine/WireRestShape.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,6 @@ class WireRestShape : public core::objectmodel::BaseObject
SingleLink<WireRestShape<DataTypes>, MeshLoader, BaseLink::FLAG_STOREPATH | BaseLink::FLAG_STRONGLINK> l_loader;
/// Pointer to the MeshLoader, should be set using @sa l_loader, otherwise will search for one in current Node.
MeshLoader* loader{ nullptr };

/// Link to a Edge2QuadTopologicalMapping, usually used for beam surface rendering to be set to propagate topological changes
SingleLink<WireRestShape<DataTypes>, Edge2QuadTopologicalMapping, BaseLink::FLAG_STOREPATH | BaseLink::FLAG_STRONGLINK> l_edge2QuadMapping;
/// Pointer to a Edge2QuadTopologicalMapping usually used for beam surface rendering. To be set using @sa l_edge2QuadMapping
Edge2QuadTopologicalMapping* edge2QuadMap{ nullptr };

};


Expand Down
25 changes: 1 addition & 24 deletions src/BeamAdapter/component/engine/WireRestShape.inl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ WireRestShape<DataTypes>::WireRestShape() :
, d_drawRestShape(initData(&d_drawRestShape, (bool)false, "draw", "draw rest shape"))
, l_topology(initLink("topology", "link to the topology container"))
, l_loader(initLink("loader", "link to the MeshLoader"))
, l_edge2QuadMapping(initLink("edge2QuadMapping", "link to the edge2QuadMapping to render this beam"))
{
d_spireDiameter.setGroup("Procedural");
d_spireHeight.setGroup("Procedural");
Expand Down Expand Up @@ -211,16 +210,6 @@ void WireRestShape<DataTypes>::init()
for (int i=0; i<d_numEdges.getValue(); i++)
_topology->addEdge(i,i+1);

/// Get possible edge2Quad Mapping if one set.
// TODO epernod 2022-08-05: check if the pointer to the mapping is still useful. Only used in releaseWirePart which should be now automatically handle by Topological changes mechanism.
edge2QuadMap = l_edge2QuadMapping.get();

const TagSet& tags = this->getTags();
if (!tags.empty())
{
msg_warning() << "Using tags to find edge2QuadMapping has been depreciate. Please use 'edge2QuadMapping' link to set the path to the correct topological mapping.";
}


////////////////////////////////////////////////////////
////////// keyPoint list and Density Assignement ///////
Expand Down Expand Up @@ -317,19 +306,7 @@ void WireRestShape<DataTypes>::releaseWirePart(){
edgeMod->removeEdges(edge_remove,false); // remove the single edge and do not remove any point...

msg_info() << "WireRestShape _topology name="<<_topology->getName()<<" - numEdges ="<<_topology->getNbEdges() ;

// propagate the topological change to the topological mapping //
if(edge2QuadMap!=nullptr)
{
edge2QuadMap->updateTopologicalMappingTopDown();
sofa::component::topology::container::dynamic::QuadSetTopologyModifier *quadMod;
edge2QuadMap->getContext()->get(quadMod);
quadMod->notifyEndingEvent();
}


_topology->resetTopologyChangeList();


return;
}
}
Expand Down