//----------------------------------------------------------------------------
template<class TOutputFilter>
-void ToCellCenters(TOutputFilter *theOutputFilter,
- vtkCellCenters *theCellCenters,
- vtkDataSet* theDataSet,
- VISU_UsedPointsFilter* theUsedPointsFilter)
+void ToCellCenters( TOutputFilter *theOutputFilter,
+ vtkCellCenters *theCellCenters,
+ vtkDataSet* theDataSet,
+ VISU_UsedPointsFilter* theUsedPointsFilter )
{
- if(VISU::IsDataOnCells(theDataSet)){
- theCellCenters->SetInput(theDataSet);
+ if ( VISU::IsDataOnCells( theDataSet ) ) {
+ theCellCenters->SetInput( theDataSet );
theCellCenters->VertexCellsOn();
- theOutputFilter->SetInput(theCellCenters->GetOutput());
+ theOutputFilter->SetInput( theCellCenters->GetOutput() );
}else {
- theUsedPointsFilter->SetInput(theDataSet);
- theOutputFilter->SetInput(theUsedPointsFilter->GetOutput());
+ theUsedPointsFilter->SetInput( theDataSet );
+ theOutputFilter->SetInput( theUsedPointsFilter->GetOutput() );
}
}
VISU_VectorsPL
::VISU_VectorsPL()
{
- SetIsShrinkable(false);
+ SetIsShrinkable( false );
- myBaseGlyph = vtkGlyph3D::New();
- myTransformedGlyph = vtkGlyph3D::New();
+ myGlyph = vtkGlyph3D::New();
myGlyphSource = vtkGlyphSource2D::New();
myConeSource = vtkConeSource::New();
VISU_VectorsPL
::~VISU_VectorsPL()
{
- myBaseGlyph->Delete();
- myTransformedGlyph->Delete();
+ myGlyph->Delete();
myCenters->Delete();
{
unsigned long int aTime = Superclass::GetMTime();
- aTime = std::max(aTime, myBaseGlyph->GetMTime());
- aTime = std::max(aTime, myTransformedGlyph->GetMTime());
+ aTime = std::max(aTime, myGlyph->GetMTime());
aTime = std::max(aTime, myCenters->GetMTime());
aTime = std::max(aTime, myGlyphSource->GetMTime());
aTime = std::max(aTime, myConeSource->GetMTime());
//----------------------------------------------------------------------------
void
VISU_VectorsPL
-::SetTransform(VTKViewer_Transform* theTransform)
+::SetTransform( VTKViewer_Transform* theTransform )
{
- GetFieldTransformFilter()->SetSpaceTransform(theTransform);
- myTransformFilter->SetTransform(theTransform);
+ myTransformFilter->SetTransform( theTransform );
myTransformFilter->Modified();
}
VISU_VectorsPL
::GetTransform()
{
- return GetFieldTransformFilter()->GetSpaceTransform();
+ return static_cast< VTKViewer_Transform* >( myTransformFilter->GetTransform() );
}
VISU_VectorsPL
::SetScale(vtkFloatingPointType theScale)
{
- if(myScaleFactor == theScale)
+ if ( VISU::CheckIsSameValue( myScaleFactor, theScale ) )
return;
- myScaleFactor = theScale;
+ myGlyph->SetScaleFactor( theScale );
- myBaseGlyph->SetScaleFactor(myScaleFactor);
- myTransformedGlyph->SetScaleFactor(myScaleFactor);
+ myScaleFactor = theScale;
Modified();
}
VISU_VectorsPL
::GetScale()
{
- return myTransformedGlyph->GetScaleFactor();
+ return myGlyph->GetScaleFactor();
}
{
Superclass::Build();
- ToCellCenters(myBaseGlyph,
- myCenters,
- GetMergedInput(),
- myUsedPointsFilter);
- myBaseGlyph->SetVectorModeToUseVector();
- myBaseGlyph->SetScaleModeToScaleByVector();
- myBaseGlyph->SetColorModeToColorByScalar();
-
- ToCellCenters(myTransformFilter,
- myCenters,
- GetMergedInput(),
- myUsedPointsFilter);
- myTransformedGlyph->SetInput(myTransformFilter->GetOutput());
- myTransformedGlyph->SetVectorModeToUseVector();
- myTransformedGlyph->SetScaleModeToScaleByVector();
- myTransformedGlyph->SetColorModeToColorByScalar();
+ ToCellCenters( myTransformFilter,
+ myCenters,
+ GetMergedInput(),
+ myUsedPointsFilter );
+
+ myGlyph->SetInput( myTransformFilter->GetOutput() );
+ myGlyph->SetVectorModeToUseVector();
+ myGlyph->SetScaleModeToScaleByVector();
+ myGlyph->SetColorModeToColorByScalar();
}
VISU_VectorsPL
::InsertCustomPL()
{
- return myTransformedGlyph->GetOutput();
+ return myGlyph->GetOutput();
}
case CENTER:
myGlyphSource->SetCenter(0.0, 0.0, 0.0);
}
- myBaseGlyph->SetSource(myGlyphSource->GetOutput());
- myTransformedGlyph->SetSource(myGlyphSource->GetOutput());
+ myGlyph->SetSource(myGlyphSource->GetOutput());
}
break;
case CONE2:
case CENTER:
myConeSource->SetCenter(0.0, 0.0, 0.0);
}
- myBaseGlyph->SetSource(myConeSource->GetOutput());
- myTransformedGlyph->SetSource(myConeSource->GetOutput());
+ myGlyph->SetSource(myConeSource->GetOutput());
}
break;
case NONE:
default: {
- myBaseGlyph->SetSource(myLineSource->GetOutput());
- myTransformedGlyph->SetSource(myLineSource->GetOutput());
+ myGlyph->SetSource(myLineSource->GetOutput());
}
}
{
unsigned long int aSize = Superclass::GetMemorySize();
- if(vtkDataSet* aDataSet = myBaseGlyph->GetOutput())
- aSize += aDataSet->GetActualMemorySize() * 1024;
-
- if(vtkDataSet* aDataSet = myTransformedGlyph->GetOutput())
+ if(vtkDataSet* aDataSet = myGlyph->GetOutput())
aSize += aDataSet->GetActualMemorySize() * 1024;
if(vtkDataSet* aDataSet = myCenters->GetOutput())
aSize += aDataSet->GetActualMemorySize() * 1024;
- if(myCellDataToPointData->GetInput())
- if(vtkDataSet* aDataSet = myCellDataToPointData->GetOutput())
- aSize += aDataSet->GetActualMemorySize() * 1024;
-
return aSize;
}
VISU_VectorsPL
::GetOutput()
{
- myBaseGlyph->Update();
- return myBaseGlyph->GetOutput();
+ myGlyph->Update();
+
+ return myGlyph->GetOutput();
}
VISU_ScalarMapPL::SetMapScale(theMapScale);
myMapScaleFactor = theMapScale;
- myBaseGlyph->SetScaleFactor(myScaleFactor*theMapScale);
- myTransformedGlyph->SetScaleFactor(myScaleFactor*theMapScale);
+ myGlyph->SetScaleFactor( myScaleFactor*theMapScale );
Modified();
}