//----------------------------------------------------------------------------
VISU_GaussPointsPL
::VISU_GaussPointsPL():
- myRelativeSize(0.1),
- myRelativeMinSize(0.03),
- myRelativeMaxSize(0.30),
- myMagnificationIncrement(0.1)
+ myClamp(200.0),
+ mySize(10),
+ myMinSize(3),
+ myMaxSize(33),
+ myMagnification(100),
+ myMagnificationIncrement(10),
+ myAlphaThreshold(0.1)
{
myPSMapper = VISU_OpenGLPointSpriteMapper::New();
//myPSMapper->DebugOn();
SetGaussPtsIDMapper(aPipeLine->GetGaussPtsIDMapper());
SetClamp(aPipeLine->GetClamp());
- SetRelativeSize(aPipeLine->GetRelativeSize());
- SetRelativeMinSize(aPipeLine->GetRelativeMinSize());
- SetRelativeMaxSize(aPipeLine->GetRelativeMaxSize());
+ SetSize(aPipeLine->GetSize());
+ SetMinSize(aPipeLine->GetMinSize());
+ SetMaxSize(aPipeLine->GetMaxSize());
SetMagnification(aPipeLine->GetMagnification());
SetMagnificationIncrement(aPipeLine->GetMagnificationIncrement());
+ SetAlphaThreshold(aPipeLine->GetAlphaThreshold());
Init();
}
}
return myMapperTable->GetBicolor();
}
-//----------------------------------------------------------------------------
-void
-VISU_GaussPointsPL
-::SetClamp(float theClamp)
-{
- myPSMapper->SetPointSpriteClamp( theClamp );
-
- Modified();
-}
-
//----------------------------------------------------------------------------
float
VISU_GaussPointsPL
-::GetClamp()
+::GetMaximumSupportedSize()
{
- return 200.0;
+ return myPSMapper->GetMaximumSupportedSize();
}
//----------------------------------------------------------------------------
-float
+void
VISU_GaussPointsPL
-::GetMaximumSupportedSize()
+::SetClamp(float theClamp)
{
- return myPSMapper->GetMaximumSupportedSize();
+ myClamp = theClamp;
+ myPSMapper->SetPointSpriteClamp( theClamp );
+
+ Modified();
}
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::SetRelativeSize(float theRelativeSize)
+::SetSize(float theSize)
{
- myRelativeSize = theRelativeSize;
-
- myPSMapper->SetPointSpriteSize( 1000.0 * myAverageCellSize * myRelativeSize );
+ mySize = theSize;
+ myPSMapper->SetPointSpriteSize( 1000.0 * myAverageCellSize * mySize / 100.0 );
Modified();
}
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::SetRelativeMinSize(float theRelativeMinSize)
+::SetMinSize(float theMinSize)
{
- myRelativeMinSize = theRelativeMinSize;
+ myMinSize = theMinSize;
myPSMapper->SetPointSpriteSize( 0.0 );
- myPSMapper->SetPointSpriteMinSize( 1000.0 * myAverageCellSize * myRelativeMinSize );
+ myPSMapper->SetPointSpriteMinSize( 1000.0 * myAverageCellSize * myMinSize / 100.0 );
Modified();
}
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::SetRelativeMaxSize(float theRelativeMaxSize)
+::SetMaxSize(float theMaxSize)
{
- myRelativeMaxSize = theRelativeMaxSize;
+ myMaxSize = theMaxSize;
myPSMapper->SetPointSpriteSize( 0.0 );
- myPSMapper->SetPointSpriteMaxSize( 1000.0 * myAverageCellSize * myRelativeMaxSize );
+ myPSMapper->SetPointSpriteMaxSize( 1000.0 * myAverageCellSize * myMaxSize / 100.0 );
Modified();
}
VISU_GaussPointsPL
::SetMagnification(float theMagnification)
{
- myPSMapper->SetPointSpriteMagnification( theMagnification );
+ myMagnification = theMagnification;
+ myPSMapper->SetPointSpriteMagnification( theMagnification / 100.0 );
Modified();
}
-//----------------------------------------------------------------------------
-float
-VISU_GaussPointsPL
-::GetMagnification()
-{
- return myPSMapper->GetPointSpriteMagnification();
-}
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
{
myMagnificationIncrement = theIncrement;
}
+
//----------------------------------------------------------------------------
-float
+void
VISU_GaussPointsPL
-::GetMagnificationIncrement()
+::SetAlphaThreshold(float theAlphaThreshold)
{
- return myMagnificationIncrement;
+ myAlphaThreshold = theAlphaThreshold;
+ myPSMapper->SetPointSpriteAlphaThreshold( theAlphaThreshold );
+
+ Modified();
}
+
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
float anIncrement = up ? myMagnificationIncrement : -myMagnificationIncrement;
SetMagnification( GetMagnification() + anIncrement );
}
+
//----------------------------------------------------------------------------
float
VISU_GaussPointsPL
::GetPointSize(vtkIdType theID, vtkDataArray* theScalarArray)
{
- float aMaxSize = myAverageCellSize*myRelativeMaxSize;
- float aMinSize = myAverageCellSize*myRelativeMinSize;
+ float aMaxSize = myAverageCellSize*myMaxSize/100.0;
+ float aMinSize = myAverageCellSize*myMinSize/100.0;
float aDelta = aMaxSize - aMinSize;
float aVal = theScalarArray->GetTuple1(theID);
return aMinSize + aDelta*(aVal - mySourceScalarRange[0])/myDeltaScalarRange;
}
-//----------------------------------------------------------------------------
-float
-VISU_GaussPointsPL
-::GetPointSize(vtkIdType theID)
-{
- vtkMapper* aMapper = GetMapper();
- vtkDataSet* aDataSet = aMapper->GetInput();
- vtkCellData* aCellData = aDataSet->GetCellData();
- vtkDataArray* aScalarArray = aCellData->GetScalars();
- return GetPointSize(theID,aScalarArray);
-}
-
//----------------------------------------------------------------------------
float
VISU_GaussPointsPL
::GetMaxPointSize()
{
- return myAverageCellSize*myRelativeMaxSize;
-}
-
-//----------------------------------------------------------------------------
-void
-VISU_GaussPointsPL
-::SetAlphaThreshold(float theAlphaThreshold)
-{
- myPSMapper->SetPointSpriteAlphaThreshold( theAlphaThreshold );
-
- Modified();
+ return myAverageCellSize*myMaxSize/100.0;
}
//----------------------------------------------------------------------------
float
VISU_GaussPointsPL
-::GetAlphaThreshold()
+::GetPointSize(vtkIdType theID)
{
- return myPSMapper->GetPointSpriteAlphaThreshold();
+ vtkMapper* aMapper = GetMapper();
+ vtkDataSet* aDataSet = aMapper->GetInput();
+ vtkCellData* aCellData = aDataSet->GetCellData();
+ vtkDataArray* aScalarArray = aCellData->GetScalars();
+ return GetPointSize(theID,aScalarArray);
}
//----------------------------------------------------------------------------
bool
GetBicolor();
+ float
+ GetMaximumSupportedSize();
+
void
SetClamp(float theClamp);
float
- GetClamp();
-
- float
- GetMaximumSupportedSize();
+ GetClamp() { return myClamp; }
void
- SetRelativeSize(float theRelativeSize);
+ SetSize(float theSize);
float
- GetRelativeSize()
- {
- return myRelativeSize;
- }
+ GetSize() { return mySize; }
void
- SetRelativeMinSize(float theRelativeMinSize);
+ SetMinSize(float theMinSize);
float
- GetRelativeMinSize()
- {
- return myRelativeMinSize;
- }
+ GetMinSize() { return myMinSize; }
void
- SetRelativeMaxSize(float theRelativeMaxSize);
+ SetMaxSize(float theMaxSize);
float
- GetRelativeMaxSize()
- {
- return myRelativeMaxSize;
- }
-
- float
- GetMaxPointSize();
+ GetMaxSize() { return myMaxSize; }
void
SetMagnification(float theMagnification);
float
- GetMagnification();
+ GetMagnification() { return myMagnification; }
void
SetMagnificationIncrement(float theIncrement);
float
- GetMagnificationIncrement();
+ GetMagnificationIncrement() { return myMagnificationIncrement; }
void
- ChangeMagnification( bool up );
+ SetAlphaThreshold(float theAlphaThreshold);
float
- GetPointSize(vtkIdType theID);
+ GetAlphaThreshold() { return myAlphaThreshold; }
+
+ void
+ ChangeMagnification( bool up );
float
- GetPointSize(vtkIdType theID, vtkDataArray* theScalarArray);
+ GetMaxPointSize();
- void
- SetAlphaThreshold(float theAlphaThreshold);
+ float
+ GetPointSize(vtkIdType theID);
float
- GetAlphaThreshold();
+ GetPointSize(vtkIdType theID, vtkDataArray* theScalarArray);
void
SetImageData(vtkImageData* theImageData);
float mySourceScalarRange[2];
float myDeltaScalarRange;
float myAverageCellSize;
- float myRelativeSize;
- float myRelativeMinSize;
- float myRelativeMaxSize;
+
+ float myClamp;
+ float mySize;
+ float myMinSize;
+ float myMaxSize;
+ float myMagnification;
float myMagnificationIncrement;
+ float myAlphaThreshold;
};
#endif