Skip to content
Snippets Groups Projects
Commit 7c8e0546 authored by Ansgar Philippsen's avatar Ansgar Philippsen
Browse files

fixed missing position updates for backbone trace based renderings

parent 4b3c0e5c
Branches
Tags
No related merge requests found
......@@ -83,7 +83,7 @@ public:
NodeEntry entry={ca, GfxObj::Ele2Color(ca.GetElement()),
GfxObj::Ele2Color(ca.GetElement()),
geom::Vec3(), // this will be set by the gfx trace obj
geom::Normalize(res.GetCentralNormal()),
res.GetCentralNormal(),
1.0,
geom::Vec3(),geom::Vec3(),geom::Vec3(), // for later use in NA rendering
false,id_counter_++};
......@@ -149,6 +149,17 @@ void BackboneTrace::Rebuild()
}
}
void BackboneTrace::OnUpdatedPositions()
{
for(NodeEntryListList::iterator nitnit=node_list_list_.begin();nitnit!=node_list_list_.end();++nitnit) {
NodeEntryList& nlist=*nitnit;
for(NodeEntryList::iterator nit=nlist.begin();nit!=nlist.end();++nit) {
nit->normal=nit->atom.GetResidue().GetCentralNormal();
}
PrepList(nlist);
}
}
void BackboneTrace::AddNodeEntryList(const NodeEntryList& l)
{
if(l.size()>=3) {
......
......@@ -65,6 +65,9 @@ public:
// re-creates internal nodelist-list based on view
void Rebuild();
// entity has new positions
void OnUpdatedPositions();
// extract portions of this backbone trace for a subview
// this is faster then re-generating a trace
......
......@@ -79,6 +79,12 @@ TraceRendererBase::TraceRendererBase(BackboneTrace* trace, int n):
void TraceRendererBase::PrepareRendering()
{
if (state_ & DIRTY_VA) {
trace_->OnUpdatedPositions();
trace_subset_.OnUpdatedPositions();
if(this->HasSelection()) sel_subset_.OnUpdatedPositions();
// don't clear DIRTY_VA flag - derived classed may depend on it
}
}
void TraceRendererBase::UpdateViews()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment