#include "VTKViewer_GeometryFilter.h"
#include "VTKViewer_PassThroughFilter.h"
+#include "VISU_PipeLineUtils.hxx"
+
#include <stdexcept>
#include <sstream>
::ShallowCopyPL(VISU_PipeLine* thePipeLine)
{
myPipeLine->ShallowCopy(thePipeLine);
-
- vtkDataSet* aDatsSet = myMapper->GetInput();
- GetMapper()->ShallowCopy(thePipeLine->GetMapper());
-
- // To restore mapper input from pipeline
- myMapper->SetInput(aDatsSet);
+ VISU::CopyMapper(GetMapper(), thePipeLine->GetMapper());
}
//----------------------------------------------------------------------------
void
VISU_CutLinesPL
-::ShallowCopy(VISU_PipeLine *thePipeLine)
+::DoShallowCopy(VISU_PipeLine *thePipeLine)
{
if(VISU_CutLinesPL *aPipeLine = dynamic_cast<VISU_CutLinesPL*>(thePipeLine)){
SetOrientation(aPipeLine->GetPlaneOrientation(1),
else
SetPosition(aPipeLine->GetPosition());
}
- VISU_CutPlanesPL::ShallowCopy(thePipeLine);
+ Superclass::DoShallowCopy(thePipeLine);
}
void
VISU_CutLinesPL
::Init()
{
- VISU_CutPlanesPL::Init();
+ Superclass::Init();
myBasePlane[0] = XY;
myBasePlane[1] = YZ;
class VISU_CutLinesPL : public VISU_CutPlanesPL
{
-protected:
- VISU_CutLinesPL();
- VISU_CutLinesPL(const VISU_CutLinesPL&);
public:
vtkTypeMacro(VISU_CutLinesPL,VISU_CutPlanesPL);
VISU_CutLinesPL*
New();
- virtual
- void
- ShallowCopy(VISU_PipeLine *thePipeLine);
-
virtual
void
SetPosition(vtkFloatingPointType thePosition);
}
protected:
+ VISU_CutLinesPL();
+ VISU_CutLinesPL(const VISU_CutLinesPL&);
+
+ virtual
+ void
+ DoShallowCopy(VISU_PipeLine *thePipeLine);
+
vtkFloatingPointType myDirLn[3];
vtkFloatingPointType myRealDirLn[3];
vtkFloatingPointType myBoundPrjLn[3];
void
VISU_CutPlanesPL
-::ShallowCopy(VISU_PipeLine *thePipeLine)
+::DoShallowCopy(VISU_PipeLine *thePipeLine)
{
if(VISU_CutPlanesPL *aPipeLine = dynamic_cast<VISU_CutPlanesPL*>(thePipeLine)){
SetOrientation(aPipeLine->GetPlaneOrientation(),
for (int i = 0, iend = GetNbParts(); i < iend; i++)
if(!aPipeLine->IsPartDefault(i)) SetPartPosition(i, aPipeLine->GetPartPosition(i));
}
- Superclass::ShallowCopy(thePipeLine);
+ Superclass::DoShallowCopy(thePipeLine);
}
void
virtual
~VISU_CutPlanesPL();
- virtual
- void
- ShallowCopy(VISU_PipeLine *thePipeLine);
-
enum PlaneOrientation {XY, YZ, ZX};
virtual
THook*
DoHook();
+ virtual
+ void
+ DoShallowCopy(VISU_PipeLine *thePipeLine);
+
void
SetPartPosition(int theNum = 0);
void
VISU_DeformedShapePL
-::ShallowCopy(VISU_PipeLine *thePipeLine)
+::DoShallowCopy(VISU_PipeLine *thePipeLine)
{
if(VISU_DeformedShapePL *aPipeLine = dynamic_cast<VISU_DeformedShapePL*>(thePipeLine)){
SetScale(aPipeLine->GetScale());
}
- VISU_ScalarMapPL::ShallowCopy(thePipeLine);
+ Superclass::DoShallowCopy(thePipeLine);
}
vtkFloatingPointType
VISU_DeformedShapePL
::Init()
{
- VISU_ScalarMapPL::Init();
+ Superclass::Init();
vtkFloatingPointType aScalarRange[2];
GetSourceRange(aScalarRange);
VISU_DeformedShapePL
::Update()
{
- VISU_ScalarMapPL::Update();
+ Superclass::Update();
}
//----------------------------------------------------------------------------
::GetMemorySize()
{
unsigned long int aSize = 0;
- if(vtkDataSet* aDataSet = myWarpVector->GetInput())
+ if(myWarpVector->GetInput())
if(vtkDataSet* aDataSet = myWarpVector->GetOutput())
aSize += aDataSet->GetActualMemorySize() * 1024;
VISU_DeformedShapePL
::SetMapScale(vtkFloatingPointType theMapScale)
{
- VISU_ScalarMapPL::SetMapScale(theMapScale);
+ Superclass::SetMapScale(theMapScale);
myWarpVector->SetScaleFactor(myScaleFactor*theMapScale);
Modified();
class VISU_DeformedShapePL : public VISU_ScalarMapPL
{
-protected:
- VISU_DeformedShapePL();
- VISU_DeformedShapePL(const VISU_DeformedShapePL&);
-
- virtual
- ~VISU_DeformedShapePL();
-
public:
vtkTypeMacro(VISU_DeformedShapePL,VISU_ScalarMapPL);
VISU_DeformedShapePL*
New();
- virtual
- void
- ShallowCopy(VISU_PipeLine *thePipeLine);
-
virtual
void
SetScale(vtkFloatingPointType theScale);
GetScaleFactor(vtkDataSet* theDataSet);
protected:
+ VISU_DeformedShapePL();
+ VISU_DeformedShapePL(const VISU_DeformedShapePL&);
+
+ virtual
+ ~VISU_DeformedShapePL();
+
virtual
THook*
DoHook();
+ virtual
+ void
+ DoShallowCopy(VISU_PipeLine *thePipeLine);
+
vtkFloatingPointType myScaleFactor;
vtkWarpVector *myWarpVector;
vtkCellDataToPointData* myCellDataToPointData;
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::ShallowCopy(VISU_PipeLine *thePipeLine)
+::DoShallowCopy(VISU_PipeLine *thePipeLine)
{
if(VISU_GaussPointsPL *aPipeLine = dynamic_cast<VISU_GaussPointsPL*>(thePipeLine)){
- // To restore mapper input from pipeline
- vtkPolyData* aDatsSet = myPSMapper->GetInput();
- myPSMapper->ShallowCopy(aPipeLine->GetPSMapper());
- myPSMapper->SetInput(aDatsSet);
-
SetPrimitiveType(aPipeLine->GetPrimitiveType());
SetBicolor(aPipeLine->GetBicolor());
SetClamp(aPipeLine->GetClamp());
mySphereSource->SetRadius( aPipeLine->mySphereSource->GetRadius() );
CopyGlyph( aPipeLine->myGlyph, this->myGlyph );
}
- Superclass::ShallowCopy(thePipeLine);
+ Superclass::DoShallowCopy(thePipeLine);
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU_GaussPointsPL
+::DoCopyMapper(VISU_PipeLine *thePipeLine)
+{
+ if(VISU_GaussPointsPL* aPipeLine = dynamic_cast<VISU_GaussPointsPL*>(thePipeLine)){
+ VISU::CopyPointSpriteDataMapper(GetPSMapper(), aPipeLine->GetPSMapper());
+ }
}
*/
class VISU_GaussPointsPL : public VISU_ScalarMapPL
{
-protected:
- VISU_GaussPointsPL();
-
- virtual
- ~VISU_GaussPointsPL();
-
public:
vtkTypeMacro(VISU_GaussPointsPL,VISU_ScalarMapPL);
unsigned long int
GetMTime();
- virtual
- void
- ShallowCopy(VISU_PipeLine *thePipeLine);
-
//! Get the native mapper.
virtual
TMapper*
const char* theAlphaTexture );
public:
- virtual void SetIsDeformed( bool theIsDeformed );
- virtual bool GetIsDeformed() const;
+ virtual
+ void
+ SetIsDeformed( bool theIsDeformed );
+
+ virtual
+ bool
+ GetIsDeformed() const;
+
+ virtual
+ void
+ SetScale( vtkFloatingPointType theScale );
- virtual void SetScale( vtkFloatingPointType theScale );
- virtual vtkFloatingPointType GetScale();
- virtual void SetMapScale( vtkFloatingPointType theMapScale = 1.0 );
+ virtual
+ vtkFloatingPointType
+ GetScale();
+
+ virtual
+ void
+ SetMapScale( vtkFloatingPointType theMapScale = 1.0 );
protected:
+ VISU_GaussPointsPL();
+
+ virtual
+ ~VISU_GaussPointsPL();
+
+ virtual
+ void
+ DoShallowCopy(VISU_PipeLine *thePipeLine);
+
+ virtual
+ void
+ DoCopyMapper(VISU_PipeLine *thePipeLine);
+
bool myIsDeformed;
vtkFloatingPointType myScaleFactor;
vtkWarpVector *myWarpVector;
vtkSphereSource* mySphereSource;
int myResolution;
-protected:
VISU_OpenGLPointSpriteMapper* myPSMapper;
VISU::PGaussPtsIDMapper myGaussPtsIDMapper;
void
VISU_IsoSurfacesPL
-::ShallowCopy(VISU_PipeLine *thePipeLine)
+::DoShallowCopy(VISU_PipeLine *thePipeLine)
{
if(VISU_IsoSurfacesPL *aPipeLine = dynamic_cast<VISU_IsoSurfacesPL*>(thePipeLine)){
SetNbParts(aPipeLine->GetNbParts());
vtkFloatingPointType aRange[2] = {aPipeLine->GetMin(), aPipeLine->GetMax()};
SetRange(aRange);
}
- VISU_ScalarMapPL::ShallowCopy(thePipeLine);
+ Superclass::DoShallowCopy(thePipeLine);
}
int
VISU_IsoSurfacesPL
::SetScaling(int theScaling)
{
- VISU_ScalarMapPL::SetScaling(theScaling);
+ Superclass::SetScaling(theScaling);
SetRange(myRange);
}
void
VISU_IsoSurfacesPL
::Init()
{
- VISU_ScalarMapPL::Init();
+ Superclass::Init();
SetNbParts(10);
vtkFloatingPointType aScalarRange[2];
VISU_IsoSurfacesPL
::Update()
{
- VISU_ScalarMapPL::Update();
+ Superclass::Update();
}
//----------------------------------------------------------------------------
VISU_IsoSurfacesPL
::SetMapScale(vtkFloatingPointType theMapScale)
{
- VISU_ScalarMapPL::SetMapScale(theMapScale);
+ Superclass::SetMapScale(theMapScale);
vtkFloatingPointType aRange[2] = {GetMax() - theMapScale*(GetMax()-GetMin()), GetMax()};
vtkFloatingPointType aNewRange[2] = {aRange[0], aRange[1]};
class VISU_IsoSurfacesPL : public VISU_ScalarMapPL
{
-protected:
- VISU_IsoSurfacesPL();
- VISU_IsoSurfacesPL(const VISU_IsoSurfacesPL&);
-
- virtual
- ~VISU_IsoSurfacesPL();
-
public:
vtkTypeMacro(VISU_IsoSurfacesPL,VISU_ScalarMapPL);
VISU_IsoSurfacesPL*
New();
- virtual
- void
- ShallowCopy(VISU_PipeLine *thePipeLine);
-
virtual
int
GetNbParts();
SetMapScale(vtkFloatingPointType theMapScale = 1.0);
protected:
+ VISU_IsoSurfacesPL();
+ VISU_IsoSurfacesPL(const VISU_IsoSurfacesPL&);
+
+ virtual
+ ~VISU_IsoSurfacesPL();
+
+ virtual
+ void
+ DoShallowCopy(VISU_PipeLine *thePipeLine);
+
int myNbParts;
vtkFloatingPointType myRange[2];
vtkCellDataToPointData* myCellDataToPointData;
};
static bool IsARBInitialized = InitializeARB();
-static float Tolerance = 1.0 / VTK_LARGE_FLOAT;
+static vtkFloatingPointType Tolerance = 1.0 / VTK_LARGE_FLOAT;
//-----------------------------------------------------------------------------
// Construct empty object.
if( this->TempMapper )
this->TempMapper->Delete();
}
-//-----------------------------------------------------------------------------
-void VISU_OpenGLPointSpriteMapper::ShallowCopy( vtkAbstractMapper* mapper )
-{
- VISU_OpenGLPointSpriteMapper* m = VISU_OpenGLPointSpriteMapper::SafeDownCast(mapper);
- if( m != NULL )
- {
- this->SetPrimitiveType( m->GetPrimitiveType() );
-
- this->SetPointSpriteMode( m->GetPointSpriteMode() );
-
- this->SetPointSpriteClamp( m->GetPointSpriteClamp() );
- this->SetPointSpriteSize( m->GetPointSpriteSize() );
- this->SetPointSpriteMinSize( m->GetPointSpriteMinSize() );
- this->SetPointSpriteMaxSize( m->GetPointSpriteMaxSize() );
- this->SetPointSpriteMagnification( m->GetPointSpriteMagnification() );
- this->SetImageData( m->GetImageData() );
- this->SetPointSpriteAlphaThreshold( m->GetPointSpriteAlphaThreshold() );
- }
-
- this->TempMapper->ShallowCopy( m );
- this->TempMapper->SetInput( this->GetInput() );
- Superclass::ShallowCopy( this->TempMapper );
-
-}
//-----------------------------------------------------------------------------
char* readFromFile( std::string fileName )
{
act->GetProperty()->GetMTime() > this->BuildTime ||
ren->GetRenderWindow() != this->LastWindow)
{
+ /* To contol when the mapper is recalculated
+ cout<<"VISU_OpenGLPointSpriteMapper::RenderPiece - "
+ <<(this->GetMTime() > this->BuildTime)<<"; "
+ <<(input->GetMTime() > this->BuildTime)<<"; "
+ <<(act->GetProperty()->GetMTime() > this->BuildTime)<<"; "
+ <<endl;
+ */
// sets this->Colors as side effect
this->MapScalars( act->GetProperty()->GetOpacity() );
static VISU_OpenGLPointSpriteMapper *New();
vtkTypeRevisionMacro(VISU_OpenGLPointSpriteMapper,MAPPER_SUPERCLASS);
- void ShallowCopy(vtkAbstractMapper*);
-
//! Set the initial point size to be used.
/*!
* This value forms the base upon which the distance attenuation acts.
VISU_PipeLine
::DebugOn()
{
- myExtractGeometry->DebugOn();
+ //myExtractGeometry->DebugOn();
Superclass::DebugOn();
}
VISU_PipeLine
::DebugOff()
{
- myExtractGeometry->DebugOff();
+ //myExtractGeometry->DebugOff();
Superclass::DebugOff();
}
::ShallowCopy(VISU_PipeLine *thePipeLine)
{
SetImplicitFunction(thePipeLine->GetImplicitFunction());
+ DoShallowCopy(thePipeLine);
+}
- // To restore mapper input from pipeline
- vtkDataSet* aDatsSet = myMapper->GetInput();
- GetMapper()->ShallowCopy(thePipeLine->GetMapper());
- myMapper->SetInput(aDatsSet);
-
+//----------------------------------------------------------------------------
+void
+VISU_PipeLine
+::DoShallowCopy(VISU_PipeLine *thePipeLine)
+{
+ DoCopyMapper(thePipeLine);
Build();
}
+//----------------------------------------------------------------------------
+void
+VISU_PipeLine
+::DoCopyMapper(VISU_PipeLine *thePipeLine)
+{
+ VISU::CopyMapper(GetMapper(), thePipeLine->GetMapper());
+}
+
//----------------------------------------------------------------------------
void
VISU_PipeLine
::SameAs(VISU_PipeLine *thePipeLine)
{
- ShallowCopy(thePipeLine);
- SetImplicitFunction(vtkImplicitBoolean::New());
- GetImplicitFunction()->Delete();
+ DoShallowCopy(thePipeLine);
}
//----------------------------------------------------------------------------
virtual
~VISU_PipeLine();
+ virtual
+ void
+ DoShallowCopy(VISU_PipeLine *thePipeLine);
+
+ virtual
+ void
+ DoCopyMapper(VISU_PipeLine *thePipeLine);
+
virtual
TInput*
GetInput2() const;
#include "VISU_PipeLineUtils.hxx"
+#include "VISU_OpenGLPointSpriteMapper.hxx"
+
+#include <vtkDataSetMapper.h>
+#include <vtkPolyDataMapper.h>
+
void
VISU::Mul(const vtkFloatingPointType A[3],
vtkFloatingPointType b,
for(int i = 0; i < 3; i++) C[i] = A[i] - B[i];
}
+namespace VISU
+{
+ bool
+ CheckIsSameRange(vtkFloatingPointType* theTarget,
+ vtkFloatingPointType* theSource)
+ {
+ static vtkFloatingPointType TOL = 10.0 / VTK_LARGE_FLOAT;
+ return std::abs(theTarget[0] - theSource[0]) + std::abs(theTarget[1] - theSource[1]) < TOL;
+}
+
+ void
+ CopyMapper(vtkMapper* theTarget,
+ vtkMapper* theSource)
+ {
+ // To customize vtkMapper::ShallowCopy ...
+ theTarget->SetLookupTable(theSource->GetLookupTable());
+ theTarget->SetScalarVisibility(theSource->GetScalarVisibility());
+ if(!CheckIsSameRange(theTarget->GetScalarRange(), theSource->GetScalarRange()))
+ theTarget->SetScalarRange(theSource->GetScalarRange());
+ theTarget->SetColorMode(theSource->GetColorMode());
+ theTarget->SetScalarMode(theSource->GetScalarMode());
+ theTarget->SetImmediateModeRendering(theSource->GetImmediateModeRendering());
+ theTarget->SetUseLookupTableScalarRange(theSource->GetUseLookupTableScalarRange());
+ if(theSource->GetArrayAccessMode() == VTK_GET_ARRAY_BY_ID)
+ theTarget->ColorByArrayComponent(theSource->GetArrayId(), theSource->GetArrayComponent());
+ else
+ theTarget->ColorByArrayComponent(theSource->GetArrayName(), theSource->GetArrayComponent());
+
+ // To customize vtkAbstractMapper3D::ShallowCopy ...
+ theTarget->SetClippingPlanes(theSource->GetClippingPlanes());
+ }
+
+ void
+ CopyPolyDataMapper(vtkPolyDataMapper* theTarget,
+ vtkPolyDataMapper* theSource)
+ {
+ // To customize vtkPolyDataMapper::ShallowCopy ...
+ //aTargetMapper->SetInput(aMapper->GetInput());
+ theTarget->SetGhostLevel(theSource->GetGhostLevel());
+ theTarget->SetNumberOfPieces(theSource->GetNumberOfPieces());
+ theTarget->SetNumberOfSubPieces(theSource->GetNumberOfSubPieces());
+
+ CopyMapper(theTarget, theSource);
+ }
+
+ void
+ CopyPointSpriteDataMapper(VISU_OpenGLPointSpriteMapper* theTarget,
+ VISU_OpenGLPointSpriteMapper* theSource)
+ {
+ // To customize VISU_OpenGLPointSpriteMapper::ShallowCopy ...
+ theTarget->SetPrimitiveType( theSource->GetPrimitiveType() );
+
+ theTarget->SetPointSpriteMode( theSource->GetPointSpriteMode() );
+
+ theTarget->SetPointSpriteClamp( theSource->GetPointSpriteClamp() );
+ theTarget->SetPointSpriteSize( theSource->GetPointSpriteSize() );
+ theTarget->SetPointSpriteMinSize( theSource->GetPointSpriteMinSize() );
+ theTarget->SetPointSpriteMaxSize( theSource->GetPointSpriteMaxSize() );
+ theTarget->SetPointSpriteMagnification( theSource->GetPointSpriteMagnification() );
+
+ theTarget->SetImageData( theSource->GetImageData() );
+ theTarget->SetPointSpriteAlphaThreshold( theSource->GetPointSpriteAlphaThreshold() );
+
+ CopyPolyDataMapper(theTarget, theSource);
+ }
+}
#endif
+class VISU_OpenGLPointSpriteMapper;
+
namespace VISU
{
void
}else
theTItem->SetInput(theFieldTransform->GetUnstructuredGridOutput());
}
+
+ //! Checks whether the scalar range is the same or not
+ bool
+ CheckIsSameRange(vtkFloatingPointType* theTarget,
+ vtkFloatingPointType* theSource);
+
+ //! Customizes vtkMapper::ShallowCopy
+ void
+ CopyMapper(vtkMapper* theTarget, vtkMapper* theSource);
+
+ //! Customizes vtkPolyDataMapper::ShallowCopy
+ void
+ CopyPolyDataMapper(vtkPolyDataMapper* theTarget,
+ vtkPolyDataMapper* theSource);
+
+ //! Customizes VISU_OpenGLPointSpriteMapper::ShallowCopy
+ void
+ CopyPointSpriteDataMapper(VISU_OpenGLPointSpriteMapper* theTarget,
+ VISU_OpenGLPointSpriteMapper* theSource);
}
#endif
void
VISU_Plot3DPL::
-ShallowCopy(VISU_PipeLine *thePipeLine)
+DoShallowCopy(VISU_PipeLine *thePipeLine)
{
if(VISU_Plot3DPL *aPipeLine = dynamic_cast<VISU_Plot3DPL*>(thePipeLine)){
SetOrientation (aPipeLine->GetPlaneOrientation(),
SetContourPrs( aPipeLine->GetIsContourPrs() );
SetNumberOfContours( aPipeLine->GetNumberOfContours() );
}
- Superclass::ShallowCopy(thePipeLine);
+ Superclass::DoShallowCopy(thePipeLine);
}
VISU_CutPlanesPL::PlaneOrientation
class VISU_Plot3DPL : public VISU_ScalarMapPL
{
-protected:
- VISU_Plot3DPL();
- VISU_Plot3DPL(const VISU_Plot3DPL&);
-
public:
vtkTypeMacro(VISU_Plot3DPL,VISU_ScalarMapPL);
static VISU_Plot3DPL* New();
virtual ~VISU_Plot3DPL();
- virtual
- void
- ShallowCopy(VISU_PipeLine *thePipeLine);
-
VISU_CutPlanesPL::PlaneOrientation
GetPlaneOrientation() const;
void SetMapScale(vtkFloatingPointType theMapScale);
protected:
- virtual THook* DoHook();
+ VISU_Plot3DPL();
+ VISU_Plot3DPL(const VISU_Plot3DPL&);
+
+ virtual
+ THook*
+ DoHook();
+
+ virtual
+ void
+ DoShallowCopy(VISU_PipeLine *thePipeLine);
vtkFloatingPointType myAngle[3];
bool myIsRelative, myIsContour;
*/
void
VISU_ScalarMapOnDeformedShapePL
-::ShallowCopy(VISU_PipeLine *thePipeLine)
+::DoShallowCopy(VISU_PipeLine *thePipeLine)
{
- VISU_ScalarMapOnDeformedShapePL *aPipeLine = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(thePipeLine);
- if(aPipeLine){
+ if(VISU_ScalarMapOnDeformedShapePL *aPipeLine = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(thePipeLine)){
SetScale(aPipeLine->GetScale());
SetScalars(aPipeLine->GetScalars());
vtkFloatingPointType aRange[2];
aPipeLine->GetSourceRange(aRange);
SetScalarRange(aRange);
}
- Superclass::ShallowCopy(thePipeLine);
+ Superclass::DoShallowCopy(thePipeLine);
}
/*!
class VISU_ScalarMapOnDeformedShapePL : public VISU_ScalarMapPL
{
protected:
- VISU_ScalarMapOnDeformedShapePL();
-
- virtual ~VISU_ScalarMapOnDeformedShapePL();
-
- VISU_ScalarMapOnDeformedShapePL(const VISU_ScalarMapOnDeformedShapePL&);
public:
vtkTypeMacro(VISU_ScalarMapOnDeformedShapePL,VISU_ScalarMapPL);
VISU_ScalarMapOnDeformedShapePL*
New();
- virtual
- void
- ShallowCopy(VISU_PipeLine *thePipeLine);
-
virtual
void
SetScale(vtkFloatingPointType theScale);
SetMapScale(vtkFloatingPointType theMapScale = 1.0);
protected:
+ VISU_ScalarMapOnDeformedShapePL();
+
+ virtual
+ ~VISU_ScalarMapOnDeformedShapePL();
+
+ VISU_ScalarMapOnDeformedShapePL(const VISU_ScalarMapOnDeformedShapePL&);
+
+ virtual
+ void
+ DoShallowCopy(VISU_PipeLine *thePipeLine);
+
vtkFloatingPointType myScaleFactor;
vtkWarpVector *myDeformVectors;
vtkMergeFilter *myMergeFilter;
//----------------------------------------------------------------------------
void
VISU_ScalarMapPL
-::ShallowCopy(VISU_PipeLine *thePipeLine)
+::DoShallowCopy(VISU_PipeLine *thePipeLine)
{
if(VISU_ScalarMapPL *aPipeLine = dynamic_cast<VISU_ScalarMapPL*>(thePipeLine)){
SetScalarRange(aPipeLine->GetScalarRange());
SetScaling(aPipeLine->GetScaling());
SetMapScale(aPipeLine->GetMapScale());
}
- Superclass::ShallowCopy(thePipeLine);
+ Superclass::DoShallowCopy(thePipeLine);
}
VISU_ScalarMapPL
::SetScalarRange(vtkFloatingPointType theRange[2])
{
- myFieldTransform->SetScalarRange(theRange);
- myBarTable->SetRange(theRange);
- Modified();
+ if(!VISU::CheckIsSameRange(GetScalarRange(), theRange)){
+ myFieldTransform->SetScalarRange(theRange);
+ myBarTable->SetRange(theRange);
+ }
}
void
::SetScalarMin(vtkFloatingPointType theValue)
{
vtkFloatingPointType aScalarRange[2] = {theValue, GetScalarRange()[1]};
- SetScalarRange(aScalarRange);
+ if(!VISU::CheckIsSameRange(GetScalarRange(), aScalarRange))
+ SetScalarRange(aScalarRange);
}
void
::SetScalarMax(vtkFloatingPointType theValue)
{
vtkFloatingPointType aScalarRange[2] = {GetScalarRange()[0], theValue};
- SetScalarRange(aScalarRange);
+ if(!VISU::CheckIsSameRange(GetScalarRange(), aScalarRange))
+ SetScalarRange(aScalarRange);
}
VISU_ScalarMapPL
::Update()
{
- vtkFloatingPointType *aRange = myFieldTransform->GetScalarRange();
+ vtkFloatingPointType *aRange = GetScalarRange();
vtkFloatingPointType aScalarRange[2] = {aRange[0], aRange[1]};
if(myBarTable->GetScale() == VTK_SCALE_LOG10)
- VISU_LookupTable::ComputeLogRange(aRange,aScalarRange);
- myMapperTable->SetRange(aScalarRange);
+ VISU_LookupTable::ComputeLogRange(aRange, aScalarRange);
+
+ if(!VISU::CheckIsSameRange(myMapperTable->GetTableRange(), aScalarRange))
+ myMapperTable->SetRange(aScalarRange);
myMapperTable->Build();
myBarTable->Build();
myMapper->SetLookupTable(myMapperTable);
- myMapper->SetScalarRange(aScalarRange);
+ if(!VISU::CheckIsSameRange(myMapper->GetScalarRange(), aScalarRange))
+ myMapper->SetScalarRange(aScalarRange);
- VISU_PipeLine::Update();
+ Superclass::Update();
}
VISU_ScalarMapPL*
New();
- virtual
- void
- ShallowCopy(VISU_PipeLine *thePipeLine);
-
//----------------------------------------------------------------------------
virtual
int
typedef vtkDataSet THook;
virtual THook* DoHook();
+ virtual
+ void
+ DoShallowCopy(VISU_PipeLine *thePipeLine);
+
VISU_LookupTable* myMapperTable;
VISU_LookupTable* myBarTable;
VISU_FieldTransform* myFieldTransform;
vtkStandardNewMacro(VISU_StreamLinesPL);
-VISU_StreamLinesPL::VISU_StreamLinesPL(){
+VISU_StreamLinesPL
+::VISU_StreamLinesPL()
+{
myStream = vtkStreamLine::New();
myCenters = vtkCellCenters::New();
myGeomFilter = VTKViewer_GeometryFilter::New();
mySource = NULL;
}
-VISU_StreamLinesPL::~VISU_StreamLinesPL(){
+VISU_StreamLinesPL
+::~VISU_StreamLinesPL()
+{
myPointsFilter->UnRegisterAllOutputs();
myPointsFilter->Delete();
myStream->Delete();
}
-void VISU_StreamLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){
+void
+VISU_StreamLinesPL
+::DoShallowCopy(VISU_PipeLine *thePipeLine)
+{
if(VISU_StreamLinesPL *aPipeLine = dynamic_cast<VISU_StreamLinesPL*>(thePipeLine)){
SetParams(aPipeLine->GetIntegrationStep(),
aPipeLine->GetPropagationTime(),
aPipeLine->GetUsedPoints(),
aPipeLine->GetDirection());
}
- VISU_DeformedShapePL::ShallowCopy(thePipeLine);
+ Superclass::DoShallowCopy(thePipeLine);
}
VISU_StreamLinesPL*
New();
- virtual
- void
- ShallowCopy(VISU_PipeLine *thePipeLine);
-
virtual
size_t
SetParams(vtkFloatingPointType theIntStep,
vtkFloatingPointType thePercents = 0.3);
protected:
+ virtual
+ void
+ DoShallowCopy(VISU_PipeLine *thePipeLine);
+
static
size_t
GetNecasseryMemorySize(vtkIdType theNbOfPoints,
void
VISU_VectorsPL
-::ShallowCopy(VISU_PipeLine *thePipeLine)
+::DoShallowCopy(VISU_PipeLine *thePipeLine)
{
if(VISU_VectorsPL *aPipeLine = dynamic_cast<VISU_VectorsPL*>(thePipeLine)){
SetGlyphType(aPipeLine->GetGlyphType());
SetGlyphPos(aPipeLine->GetGlyphPos());
}
- Superclass::ShallowCopy(thePipeLine);
+ Superclass::DoShallowCopy(thePipeLine);
}
VISU_VectorsPL*
New();
- virtual
- void
- ShallowCopy(VISU_PipeLine *thePipeLine);
-
virtual
void
SetScale(vtkFloatingPointType theScale);
THook*
DoHook();
+ virtual
+ void
+ DoShallowCopy(VISU_PipeLine *thePipeLine);
+
GlyphType myTypeGlyph;
GlyphPos myPosGlyph;
vtkGlyph3D *myBaseGlyph;