I would need some tips or ideas on how to reset a volume (vtkPolyData).
More specifically, I create a line (vtkPolyLine) using a start and end point which I expand to a 3D cylinder using a vtkTubeFilter. Now I move the start and end points (vtkPoints) from the vtkPolyData. The pipeline is connected and the pointer to this vtkPolyData is shared with other renders (each creating its own actor).
Now I want to allow the user to restore the original positions, meaning a reset of the displacement of all points.
My version is probably very slow. I store in a new variable m_initialPoints (vtkPoints) via DeepCopy the points from the original data m_polyObject (vtkPolyData). For each reset I make for the moved points (vtkPoints) in m_polyObject (vtkPolyData) again a DeepCopy of the startPoints m_initialPoints. Only in this way I can guarantee that I do not pass on my reset variable as a pointer and change it.
Is there a faster way to replace the coordinates of vtkPolyData quickly (and possibly keep the pipeline intact)?
void init()
{
// Copy Initial points of Volume
m_initialPoints->DeepCopy(m_polyObject->polyData()->GetPoints());
}
//Resets to the initial volume
void resetVolume()
{
m_polyObject->polyData()->GetPoints()->DeepCopy(m_initialPoints);
}