myIsFeatureEdgesAllowed(true)
{
if(MYDEBUG) MESSAGE("VISU_PipeLine::VISU_PipeLine - "<<this);
+
+ vtkMath::UninitializeBounds(myVisibleBounds);
}
{
GetMapperHolder()->ShallowCopy(thePipeLine->GetMapperHolder(),
theIsCopyInput);
+ for( int i =0 ; i < 6 ; i++)
+ myVisibleBounds[i] = thePipeLine->myVisibleBounds[i];
+
+ myVisibleComputeTime = thePipeLine->myVisibleComputeTime;
}
thePlane->SetNormal(theDir);
vtkFloatingPointType anOrigin[3];
- VISU::DistanceToPosition(GetInput(),
+
+ //Make sure that bounds are calculated
+ ComputeVisibleBounds();
+ VISU::DistanceToPosition(myVisibleBounds,
theDir,
theDist,
anOrigin);
vtkPlane* thePlane)
{
thePlane->GetNormal(theDir);
-
+
vtkFloatingPointType anOrigin[3];
thePlane->GetOrigin(anOrigin);
-
- VISU::PositionToDistance(GetInput(),
- theDir,
- anOrigin,
- theDist);
+
+ //Make sure that bounds are calculated
+ ComputeVisibleBounds();
+ VISU::PositionToDistance(myVisibleBounds,
+ theDir,
+ anOrigin,
+ theDist);
}
}
+//----------------------------------------------------------------------------
+// Re-compute visible bounds if need
+void VISU_PipeLine::ComputeVisibleBounds() {
+ if(GetMTime() > myVisibleComputeTime) {
+ VISU::ComputeVisibleBounds(GetMapperHolder()->GetOutput(), myVisibleBounds);
+ myVisibleComputeTime.Modified();
+ }
+}
+
+//----------------------------------------------------------------------------
+void VISU_PipeLine::GetVisibleBounds(vtkFloatingPointType theBounds[6]) {
+ // Compute or get cached bounds
+ ComputeVisibleBounds();
+ for (int i=0; i<6; i++) {
+ theBounds[i] = myVisibleBounds[i];
+ }
+}
+
//----------------------------------------------------------------------------