vtkIdList *cellPts;
vtkCell *cell;
int numCellPts;
- float *x;
- float multiplier;
+ vtkFloatingPointType *x;
+ vtkFloatingPointType multiplier;
vtkPoints *newPts;
vtkIdList *newCellPts;
vtkDataSet *input = this->GetInput();
// To extract boundary cells, we have to create supplemental information
if ( this->ExtractBoundaryCells )
{
- float val;
+ vtkFloatingPointType val;
newScalars = vtkFloatArray::New();
newScalars->SetNumberOfValues(numPts);
vtkStandardNewMacro(VISU_CutLinesPL);
-VISU_CutLinesPL::VISU_CutLinesPL(){
+VISU_CutLinesPL
+::VISU_CutLinesPL()
+{
myCondition = 1;
myPosition = 0;
}
-void VISU_CutLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){
+void
+VISU_CutLinesPL
+::ShallowCopy(VISU_PipeLine *thePipeLine)
+{
if(VISU_CutLinesPL *aPipeLine = dynamic_cast<VISU_CutLinesPL*>(thePipeLine)){
SetOrientation(aPipeLine->GetPlaneOrientation(1),
aPipeLine->GetRotateX(1),aPipeLine->GetRotateY(1),1);
VISU_CutPlanesPL::ShallowCopy(thePipeLine);
}
-void VISU_CutLinesPL::Init(){
+void
+VISU_CutLinesPL
+::Init()
+{
VISU_CutPlanesPL::Init();
myBasePlane[0] = XY;
}
-void VISU_CutLinesPL::SetPosition(float thePosition){
+void
+VISU_CutLinesPL
+::SetPosition(vtkFloatingPointType thePosition)
+{
myPosition = thePosition;
myCondition = 0;
Modified();
}
-float VISU_CutLinesPL::GetPosition(){
- float aPosition = myPosition;
+vtkFloatingPointType
+VISU_CutLinesPL
+::GetPosition()
+{
+ vtkFloatingPointType aPosition = myPosition;
if(myCondition){
- float aDir[3], aBounds[6], aBoundPrj[3];
+ vtkFloatingPointType aDir[3], aBounds[6], aBoundPrj[3];
GetInput2()->GetBounds(aBounds);
GetDir(aDir,myAng[0],myBasePlane[0]);
GetBoundProject(aBoundPrj,aBounds,aDir);
return aPosition;
}
-void VISU_CutLinesPL::SetDefault(){
+void
+VISU_CutLinesPL
+::SetDefault()
+{
myCondition = 1;
Modified();
}
-int VISU_CutLinesPL::IsDefault(){
+int
+VISU_CutLinesPL
+::IsDefault()
+{
return myCondition;
}
-void VISU_CutLinesPL::Update(){
+void
+VISU_CutLinesPL
+::Update()
+{
ClearAppendPolyData(myAppendPolyData);
SetPartPosition(1);
vtkAppendPolyData *anAppendPolyData = vtkAppendPolyData::New();
//Build base plane
- float aDir[2][3], aBaseBounds[6];
+ vtkFloatingPointType aDir[2][3], aBaseBounds[6];
GetInput2()->GetBounds(aBaseBounds);
GetDir(aDir[0],myAng[0],myBasePlane[0]);
vtkUnstructuredGrid* anUnstructuredGrid =
CutWithPlanes(anAppendPolyData,anUnstructuredGrid,1,aDir[0],aBaseBounds,
myPosition,myCondition,myDisplacement[0]);
//Build lines
- float aBounds[6];
+ vtkFloatingPointType aBounds[6];
vtkDataSet *aDataSet = anAppendPolyData->GetOutput();
aDataSet->Update();
if(aDataSet->GetNumberOfCells() == 0)
}
-void VISU_CutLinesPL::CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet,
- int theNbPlanes, float theDir[3], float theBounds[6],
- float thePartPosition, int thePartCondition,
- float theDisplacement)
+void
+VISU_CutLinesPL
+::CutWithPlanes(vtkAppendPolyData* theAppendPolyData,
+ vtkDataSet* theDataSet,
+ int theNbPlanes,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theBounds[6],
+ vtkFloatingPointType thePartPosition,
+ int thePartCondition,
+ vtkFloatingPointType theDisplacement)
{
- vector<float> aPartPosition(1,thePartPosition);
+ vector<vtkFloatingPointType> aPartPosition(1,thePartPosition);
vector<int> aPartCondition(1,thePartCondition);
VISU_CutPlanesPL::CutWithPlanes(theAppendPolyData,theDataSet,theNbPlanes,theDir,theBounds,
aPartPosition,aPartCondition,theDisplacement);
VISU_CutLinesPL(const VISU_CutLinesPL&);
public:
vtkTypeMacro(VISU_CutLinesPL,VISU_CutPlanesPL);
- static VISU_CutLinesPL* New();
- virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
- virtual void SetPosition(float thePosition);
- virtual float GetPosition();
+ static
+ VISU_CutLinesPL*
+ New();
- virtual void SetDefault();
- virtual int IsDefault();
+ virtual
+ void
+ ShallowCopy(VISU_PipeLine *thePipeLine);
+
+ virtual
+ void
+ SetPosition(vtkFloatingPointType thePosition);
+
+ virtual
+ vtkFloatingPointType
+ GetPosition();
+
+ virtual
+ void
+ SetDefault();
+
+ virtual
+ int
+ IsDefault();
public:
- virtual void Init();
- virtual void Update();
+ virtual
+ void
+ Init();
+
+ virtual
+ void
+ Update();
+
+ static
+ void
+ CutWithPlanes(vtkAppendPolyData* theAppendPolyData,
+ vtkDataSet* theDataSet,
+ int theNbPlanes,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theBounds[6],
+ vtkFloatingPointType thePlanePosition,
+ int thePlaneCondition,
+ vtkFloatingPointType theDisplacement);
+
+ const vtkFloatingPointType*
+ GetDirLn()
+ {
+ return myDirLn;
+ }
- static void CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet,
- int theNbPlanes, float theDir[3], float theBounds[6],
- float thePlanePosition, int thePlaneCondition,
- float theDisplacement);
+ const vtkFloatingPointType*
+ GetBoundPrjLn()
+ {
+ return myBoundPrjLn;
+ }
- const float* GetDirLn(){ return myDirLn;}
- const float* GetBoundPrjLn(){ return myBoundPrjLn;}
- const float* GetBasePnt(){ return myBasePnt;}
+ const vtkFloatingPointType*
+ GetBasePnt()
+ {
+ return myBasePnt;
+ }
protected:
- float myDirLn[3], myBoundPrjLn[3], myBasePnt[3];
- float myPosition;
+ vtkFloatingPointType myDirLn[3];
+ vtkFloatingPointType myBoundPrjLn[3];
+ vtkFloatingPointType myBasePnt[3];
+ vtkFloatingPointType myPosition;
int myCondition;
};
using namespace std;
-static float EPS = 1.0E-3;
+static vtkFloatingPointType EPS = 1.0E-3;
vtkStandardNewMacro(VISU_CutPlanesPL);
-VISU_CutPlanesPL::VISU_CutPlanesPL(){
+VISU_CutPlanesPL
+::VISU_CutPlanesPL()
+{
myAppendPolyData = vtkAppendPolyData::New();
myIsShrinkable = false;
myAng[1][0] = myAng[1][1] = myAng[1][2] = 0.0;
}
-VISU_CutPlanesPL::~VISU_CutPlanesPL(){
+VISU_CutPlanesPL
+::~VISU_CutPlanesPL()
+{
myAppendPolyData->Delete();
}
-void VISU_CutPlanesPL::ShallowCopy(VISU_PipeLine *thePipeLine){
+void
+VISU_CutPlanesPL
+::ShallowCopy(VISU_PipeLine *thePipeLine)
+{
if(VISU_CutPlanesPL *aPipeLine = dynamic_cast<VISU_CutPlanesPL*>(thePipeLine)){
SetOrientation(aPipeLine->GetPlaneOrientation(),
aPipeLine->GetRotateX(),aPipeLine->GetRotateY());
VISU_ScalarMapPL::ShallowCopy(thePipeLine);
}
-void VISU_CutPlanesPL::Init(){
+void
+VISU_CutPlanesPL
+::Init()
+{
VISU_ScalarMapPL::Init();
SetNbParts(10);
myAng[0][0] = myAng[0][1] = myAng[0][2] = 0.0;
}
-VISU_ScalarMapPL::THook* VISU_CutPlanesPL::DoHook(){
+VISU_ScalarMapPL::THook*
+VISU_CutPlanesPL
+::DoHook()
+{
return myAppendPolyData->GetOutput();
}
-void VISU_CutPlanesPL::Update(){
+void
+VISU_CutPlanesPL
+::Update()
+{
ClearAppendPolyData(myAppendPolyData);
SetPartPosition();
- float aDir[3];
+ vtkFloatingPointType aDir[3];
GetDir(aDir,myAng[0],myBasePlane[0]);
- float aBounds[6];
+ vtkFloatingPointType aBounds[6];
GetInput2()->GetBounds(aBounds);
vtkDataSet* aDataSet = myFieldTransform->GetUnstructuredGridOutput();
CutWithPlanes(myAppendPolyData,aDataSet,myNbParts,aDir,aBounds,
VISU_ScalarMapPL::Update();
}
-void VISU_CutPlanesPL::SetPartPosition(int theNum){
+void
+VISU_CutPlanesPL
+::SetPartPosition(int theNum)
+{
for(int i = 0; i < myNbParts; i++)
myPartPosition[i] = GetPartPosition(i,theNum);
}
-void VISU_CutPlanesPL::ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData){
+void
+VISU_CutPlanesPL
+::ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData)
+{
int iEnd = theAppendPolyData->GetNumberOfInputs();
for(int i = iEnd-1; i >= 0; i--)
theAppendPolyData->RemoveInput(theAppendPolyData->GetInput(i));
}
-float* VISU_CutPlanesPL::GetRx(float theRx[3][3], float thaAng){
+vtkFloatingPointType*
+VISU_CutPlanesPL::
+GetRx(vtkFloatingPointType theRx[3][3],
+ vtkFloatingPointType thaAng)
+{
theRx[0][0] = 1.0; theRx[0][1] = 0.0; theRx[0][2] = 0.0;
theRx[1][0] = 0.0; theRx[1][1] = cos(thaAng); theRx[1][2] = -sin(thaAng);
theRx[2][0] = 0.0; theRx[2][1] = sin(thaAng); theRx[2][2] = cos(thaAng);
}
-float* VISU_CutPlanesPL::GetRy(float theRy[3][3], float thaAng){
+vtkFloatingPointType*
+VISU_CutPlanesPL
+::GetRy(vtkFloatingPointType theRy[3][3],
+ vtkFloatingPointType thaAng)
+{
theRy[0][0] = cos(thaAng); theRy[0][1] = 0.0; theRy[0][2] = sin(thaAng);
theRy[1][0] = 0.0; theRy[1][1] = 1.0; theRy[1][2] = 0.0;
theRy[2][0] = -sin(thaAng); theRy[2][1] = 0.0; theRy[2][2] = cos(thaAng);
}
-float* VISU_CutPlanesPL::GetRz(float theRz[3][3], float thaAng){
+vtkFloatingPointType*
+VISU_CutPlanesPL
+::GetRz(vtkFloatingPointType theRz[3][3],
+ vtkFloatingPointType thaAng)
+{
theRz[0][0] = cos(thaAng); theRz[0][1] = -sin(thaAng); theRz[0][2] = 0.0;
theRz[1][0] = sin(thaAng); theRz[1][1] = cos(thaAng); theRz[1][2] = 0.0;
theRz[2][0] = 0.0; theRz[2][1] = 0.0; theRz[2][2] = 1.0;
}
-void VISU_CutPlanesPL::CorrectPnt(float thePnt[3], const float BoundPrj[6]){
+void
+VISU_CutPlanesPL
+::CorrectPnt(vtkFloatingPointType thePnt[3],
+ const vtkFloatingPointType BoundPrj[6])
+{
for(int i = 0, j = 0; i < 3; ++i, j=2*i){
if(thePnt[i] < BoundPrj[j]) thePnt[i] = BoundPrj[j];
if(thePnt[i] > BoundPrj[j+1]) thePnt[i] = BoundPrj[j+1];
}
}
-void VISU_CutPlanesPL::GetBoundProject(float BoundPrj[3], const float BoundBox[6], const float Dir[3]){
- float BoundPoints[8][3] = { {BoundBox[0],BoundBox[2],BoundBox[4]},
- {BoundBox[1],BoundBox[2],BoundBox[4]},
- {BoundBox[0],BoundBox[3],BoundBox[4]},
- {BoundBox[1],BoundBox[3],BoundBox[4]},
- {BoundBox[0],BoundBox[2],BoundBox[5]},
- {BoundBox[1],BoundBox[2],BoundBox[5]},
- {BoundBox[0],BoundBox[3],BoundBox[5]},
- {BoundBox[1],BoundBox[3],BoundBox[5]}};
+void
+VISU_CutPlanesPL
+::GetBoundProject(vtkFloatingPointType BoundPrj[3],
+ const vtkFloatingPointType BoundBox[6],
+ const vtkFloatingPointType Dir[3])
+{
+ vtkFloatingPointType BoundPoints[8][3] = { {BoundBox[0],BoundBox[2],BoundBox[4]},
+ {BoundBox[1],BoundBox[2],BoundBox[4]},
+ {BoundBox[0],BoundBox[3],BoundBox[4]},
+ {BoundBox[1],BoundBox[3],BoundBox[4]},
+ {BoundBox[0],BoundBox[2],BoundBox[5]},
+ {BoundBox[1],BoundBox[2],BoundBox[5]},
+ {BoundBox[0],BoundBox[3],BoundBox[5]},
+ {BoundBox[1],BoundBox[3],BoundBox[5]}};
BoundPrj[0] = vtkMath::Dot(Dir,BoundPoints[0]), BoundPrj[1] = BoundPrj[0];
for(int i = 1; i < 8; i++){
- float tmp = vtkMath::Dot(Dir,BoundPoints[i]);
+ vtkFloatingPointType tmp = vtkMath::Dot(Dir,BoundPoints[i]);
if(BoundPrj[1] < tmp) BoundPrj[1] = tmp;
if(BoundPrj[0] > tmp) BoundPrj[0] = tmp;
}
}
-void VISU_CutPlanesPL::SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient,
- float theXAng, float theYAng, int theNum)
+void
+VISU_CutPlanesPL
+::SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient,
+ vtkFloatingPointType theXAng,
+ vtkFloatingPointType theYAng,
+ int theNum)
{
myBasePlane[theNum] = theOrient;
switch(myBasePlane[theNum]){
}
-const VISU_CutPlanesPL::PlaneOrientation& VISU_CutPlanesPL::GetPlaneOrientation(int theNum){
+const VISU_CutPlanesPL::PlaneOrientation&
+VISU_CutPlanesPL
+::GetPlaneOrientation(int theNum)
+{
return myBasePlane[theNum];
}
-float VISU_CutPlanesPL::GetRotateX(int theNum){
+vtkFloatingPointType
+VISU_CutPlanesPL
+::GetRotateX(int theNum)
+{
switch(myBasePlane[theNum]){
case XY: return myAng[theNum][0];
case YZ: return myAng[theNum][1];
return 0;
}
-float VISU_CutPlanesPL::GetRotateY(int theNum){
+vtkFloatingPointType
+VISU_CutPlanesPL
+::GetRotateY(int theNum)
+{
switch(myBasePlane[theNum]){
case XY: return myAng[theNum][1];
case YZ: return myAng[theNum][2];
}
-void VISU_CutPlanesPL::SetNbParts(int theNb) {
+void
+VISU_CutPlanesPL
+::SetNbParts(int theNb)
+{
myNbParts = theNb;
myPartPosition.resize(myNbParts);
myPartCondition.resize(myNbParts,1);
}
-void VISU_CutPlanesPL::SetPartPosition(int thePartNumber, float thePartPosition){
+void
+VISU_CutPlanesPL
+::SetPartPosition(int thePartNumber,
+ vtkFloatingPointType thePartPosition)
+{
if(thePartNumber >= myNbParts) return;
myPartPosition[thePartNumber] = thePartPosition;
myPartCondition[thePartNumber] = 0;
Modified();
}
-float VISU_CutPlanesPL::GetPartPosition(int thePartNumber, int theNum){
+
+vtkFloatingPointType
+VISU_CutPlanesPL
+::GetPartPosition(int thePartNumber,
+ int theNum)
+{
if(thePartNumber >= myNbParts) return 0;
- float aPosition = myPartPosition[thePartNumber];
+ vtkFloatingPointType aPosition = myPartPosition[thePartNumber];
if(myPartCondition[thePartNumber]){
- float aDir[3], aBounds[6], aBoundPrj[3];
+ vtkFloatingPointType aDir[3], aBounds[6], aBoundPrj[3];
GetInput2()->GetBounds(aBounds);
GetDir(aDir,myAng[theNum],myBasePlane[theNum]);
GetBoundProject(aBoundPrj,aBounds,aDir);
if (myNbParts > 1){
- float aDBoundPrj = aBoundPrj[2]/(myNbParts - 1);
- float aDisplacement = aDBoundPrj * myDisplacement[theNum];
- float aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement;
+ vtkFloatingPointType aDBoundPrj = aBoundPrj[2]/(myNbParts - 1);
+ vtkFloatingPointType aDisplacement = aDBoundPrj * myDisplacement[theNum];
+ vtkFloatingPointType aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement;
aPosition = aStartPosition + thePartNumber*aDBoundPrj;
}else
aPosition = aBoundPrj[0] + aBoundPrj[2]*myDisplacement[theNum];
}
-void VISU_CutPlanesPL::SetPartDefault(int thePartNumber){
+void
+VISU_CutPlanesPL
+::SetPartDefault(int thePartNumber)
+{
if(thePartNumber >= myNbParts) return;
myPartPosition[thePartNumber] = GetPartPosition(thePartNumber);
myPartCondition[thePartNumber] = 1;
Modified();
}
-int VISU_CutPlanesPL::IsPartDefault(int thePartNumber){
+int
+VISU_CutPlanesPL
+::IsPartDefault(int thePartNumber)
+{
if(thePartNumber >= myNbParts) return 1;
return myPartCondition[thePartNumber];
}
-void VISU_CutPlanesPL::GetDir(float theDir[3],
- const float theAng[3],
- const PlaneOrientation& theBasePlane)
+void
+VISU_CutPlanesPL
+::GetDir(vtkFloatingPointType theDir[3],
+ const vtkFloatingPointType theAng[3],
+ const PlaneOrientation& theBasePlane)
{
int iPlane = 0;
- float aRx[3][3], aRy[3][3], aRz[3][3], aRotation[3][3];
+ vtkFloatingPointType aRx[3][3], aRy[3][3], aRz[3][3], aRotation[3][3];
switch(theBasePlane){
case XY:
if(fabs(theAng[0]) > EPS) GetRx(aRx,theAng[0]); else vtkMath::Identity3x3(aRx);
}
-void VISU_CutPlanesPL::CutWithPlane(vtkAppendPolyData* theAppendPolyData,
- vtkDataSet* theDataSet,
- float theDir[3], float theOrig[3])
+void
+VISU_CutPlanesPL
+::CutWithPlane(vtkAppendPolyData* theAppendPolyData,
+ vtkDataSet* theDataSet,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theOrig[3])
{
vtkCutter *aCutPlane = vtkCutter::New();
aCutPlane->SetInput(theDataSet);
}
-void VISU_CutPlanesPL::CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet,
- int theNbPlanes, float theDir[3], float theBounds[6],
- const vector<float>& thePlanePosition,
- const vector<int>& thePlaneCondition,
- float theDisplacement)
+void
+VISU_CutPlanesPL
+::CutWithPlanes(vtkAppendPolyData* theAppendPolyData,
+ vtkDataSet* theDataSet,
+ int theNbPlanes,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theBounds[6],
+ const vector<vtkFloatingPointType>& thePlanePosition,
+ const vector<int>& thePlaneCondition,
+ vtkFloatingPointType theDisplacement)
{
- float aBoundPrj[3], aOrig[3], aPosition;
+ vtkFloatingPointType aBoundPrj[3], aOrig[3], aPosition;
GetBoundProject(aBoundPrj, theBounds, theDir);
if(theNbPlanes > 1){
- float aDBoundPrj = aBoundPrj[2]/(theNbPlanes - 1);
- float aDisplacement = aDBoundPrj*theDisplacement;
- float aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement;
+ vtkFloatingPointType aDBoundPrj = aBoundPrj[2]/(theNbPlanes - 1);
+ vtkFloatingPointType aDisplacement = aDBoundPrj*theDisplacement;
+ vtkFloatingPointType aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement;
for (int i = 0; i < theNbPlanes; i++){
aPosition = aStartPosition + i*aDBoundPrj;
if(thePlaneCondition[i]){
public:
vtkTypeMacro(VISU_CutPlanesPL,VISU_ScalarMapPL);
static VISU_CutPlanesPL* New();
- virtual ~VISU_CutPlanesPL();
- virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
- enum PlaneOrientation {XY, YZ, ZX};
- virtual void SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient,
- float theXAng, float theYAng, int theNum = 0);
+ virtual
+ ~VISU_CutPlanesPL();
- virtual const PlaneOrientation& GetPlaneOrientation(int theNum = 0);
- virtual float GetRotateX(int theNum = 0);
- virtual float GetRotateY(int theNum = 0);
+ virtual
+ void
+ ShallowCopy(VISU_PipeLine *thePipeLine);
- virtual float GetDisplacement(int theNum = 0) { return myDisplacement[theNum];}
- virtual void SetDisplacement(float theDisp, int theNum = 0) { myDisplacement[theNum] = theDisp;}
+ enum PlaneOrientation {XY, YZ, ZX};
- virtual void SetPartPosition(int thePartNumber, float thePartPosition);
- virtual float GetPartPosition(int thePartNumber, int theNum = 0);
+ virtual
+ void
+ SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient,
+ vtkFloatingPointType theXAng,
+ vtkFloatingPointType theYAng,
+ int theNum = 0);
+
+ virtual
+ const PlaneOrientation&
+ GetPlaneOrientation(int theNum = 0);
+
+ virtual
+ vtkFloatingPointType
+ GetRotateX(int theNum = 0);
+
+ virtual
+ vtkFloatingPointType
+ GetRotateY(int theNum = 0);
+
+ virtual
+ vtkFloatingPointType
+ GetDisplacement(int theNum = 0)
+ {
+ return myDisplacement[theNum];
+ }
+
+ virtual
+ void
+ SetDisplacement(vtkFloatingPointType theDisp,
+ int theNum = 0)
+ {
+ myDisplacement[theNum] = theDisp;
+ }
+
+ virtual
+ void
+ SetPartPosition(int thePartNumber,
+ vtkFloatingPointType thePartPosition);
+
+ virtual
+ vtkFloatingPointType
+ GetPartPosition(int thePartNumber,
+ int theNum = 0);
+
+ virtual
+ void
+ SetPartDefault(int thePartNumber);
+
+ virtual
+ int
+ IsPartDefault(int thePartNumber);
+
+ virtual
+ void
+ SetNbParts(int theNb);
+
+ virtual
+ int
+ GetNbParts()
+ {
+ return myNbParts;
+ }
- virtual void SetPartDefault(int thePartNumber);
- virtual int IsPartDefault(int thePartNumber);
+public:
+ virtual
+ void
+ Init();
- virtual void SetNbParts(int theNb);
- virtual int GetNbParts(){ return myNbParts;}
+ virtual
+ void
+ Update();
-public:
- virtual void Init();
- virtual void Update();
- virtual vtkAppendPolyData* GetAppendPolyData() { return myAppendPolyData; }
+ virtual
+ vtkAppendPolyData*
+ GetAppendPolyData()
+ {
+ return myAppendPolyData;
+ }
public:
- static float* GetRx(float theRx[3][3], float thaAng);
- static float* GetRy(float theRy[3][3], float thaAng);
- static float* GetRz(float theRz[3][3], float thaAng);
-
- static void CorrectPnt(float thePnt[3], const float BoundPrj[6]);
- static void GetBoundProject(float BoundPrj[3], const float BoundBox[6], const float Dir[3]);
-
- static void GetDir(float theDir[3],
- const float theAng[3],
- const PlaneOrientation& theBasePlane);
-
- static void ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData);
-
- static void CutWithPlane(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet,
- float theDir[3], float theOrig[3]);
- static void CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet,
- int theNbPlanes, float theDir[3], float theBounds[6],
- const std::vector<float>& thePlanePosition,
- const std::vector<int>& thePlaneCondition,
- float theDisplacement);
+ static
+ vtkFloatingPointType*
+ GetRx(vtkFloatingPointType theRx[3][3],
+ vtkFloatingPointType thaAng);
+
+ static
+ vtkFloatingPointType*
+ GetRy(vtkFloatingPointType theRy[3][3],
+ vtkFloatingPointType thaAng);
+
+ static
+ vtkFloatingPointType*
+ GetRz(vtkFloatingPointType theRz[3][3],
+ vtkFloatingPointType thaAng);
+
+ static
+ void
+ CorrectPnt(vtkFloatingPointType thePnt[3],
+ const vtkFloatingPointType BoundPrj[6]);
+
+ static
+ void
+ GetBoundProject(vtkFloatingPointType BoundPrj[3],
+ const vtkFloatingPointType BoundBox[6],
+ const vtkFloatingPointType Dir[3]);
+
+ static
+ void
+ GetDir(vtkFloatingPointType theDir[3],
+ const vtkFloatingPointType theAng[3],
+ const PlaneOrientation& theBasePlane);
+
+ static
+ void
+ ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData);
+
+ static
+ void
+ CutWithPlane(vtkAppendPolyData* theAppendPolyData,
+ vtkDataSet* theDataSet,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theOrig[3]);
+
+ static
+ void
+ CutWithPlanes(vtkAppendPolyData* theAppendPolyData,
+ vtkDataSet* theDataSet,
+ int theNbPlanes,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theBounds[6],
+ const std::vector<vtkFloatingPointType>& thePlanePosition,
+ const std::vector<int>& thePlaneCondition,
+ vtkFloatingPointType theDisplacement);
protected:
- virtual THook* DoHook();
- void SetPartPosition(int theNum = 0);
+ virtual
+ THook*
+ DoHook();
+
+ void
+ SetPartPosition(int theNum = 0);
int myNbParts;
PlaneOrientation myBasePlane[2];
- float myAng[2][3], myDisplacement[2];
+ vtkFloatingPointType myAng[2][3], myDisplacement[2];
vtkAppendPolyData *myAppendPolyData;
- std::vector<float> myPartPosition;
+ std::vector<vtkFloatingPointType> myPartPosition;
std::vector<int> myPartCondition;
};
vtkStandardNewMacro(VISU_DeformedShapePL);
-VISU_DeformedShapePL::VISU_DeformedShapePL(){
+VISU_DeformedShapePL
+::VISU_DeformedShapePL()
+{
myWarpVector = vtkWarpVector::New();
myCellDataToPointData = vtkCellDataToPointData::New();
}
-VISU_DeformedShapePL::~VISU_DeformedShapePL(){
+VISU_DeformedShapePL
+::~VISU_DeformedShapePL()
+{
myWarpVector->UnRegisterAllOutputs();
myWarpVector->Delete();
myCellDataToPointData->Delete();
}
-void VISU_DeformedShapePL::ShallowCopy(VISU_PipeLine *thePipeLine){
+void
+VISU_DeformedShapePL
+::ShallowCopy(VISU_PipeLine *thePipeLine)
+{
if(VISU_DeformedShapePL *aPipeLine = dynamic_cast<VISU_DeformedShapePL*>(thePipeLine)){
SetScale(aPipeLine->GetScale());
}
VISU_ScalarMapPL::ShallowCopy(thePipeLine);
}
-float VISU_DeformedShapePL::GetScaleFactor(vtkDataSet* theDataSet){
+vtkFloatingPointType
+VISU_DeformedShapePL
+::GetScaleFactor(vtkDataSet* theDataSet)
+{
if(!theDataSet) return 0.0;
theDataSet->Update();
int aNbCells = theDataSet->GetNumberOfCells();
int aNbPoints = theDataSet->GetNumberOfPoints();
int aNbElem = aNbCells? aNbCells: aNbPoints;
- float* aBounds = theDataSet->GetBounds();
- float aVolume = 1, aVol, idim = 0;
+ vtkFloatingPointType* aBounds = theDataSet->GetBounds();
+ vtkFloatingPointType aVolume = 1, aVol, idim = 0;
for(int i = 0; i < 6; i += 2){
aVol = fabs(aBounds[i+1] - aBounds[i]);
if(aVol > 0) {
}
}
aVolume /= aNbElem;
- return pow(aVolume,float(1.0/idim));
+ return pow(aVolume,vtkFloatingPointType(1.0/idim));
}
-void VISU_DeformedShapePL::SetScale(float theScale) {
+void
+VISU_DeformedShapePL
+::SetScale(vtkFloatingPointType theScale)
+{
myWarpVector->SetScaleFactor(theScale);
myScaleFactor = theScale;
Modified();
}
-float VISU_DeformedShapePL::GetScale() {
+
+vtkFloatingPointType
+VISU_DeformedShapePL
+::GetScale()
+{
return myScaleFactor;
}
-void VISU_DeformedShapePL::Init(){
+void
+VISU_DeformedShapePL
+::Init()
+{
VISU_ScalarMapPL::Init();
- float aScalarRange[2];
+ vtkFloatingPointType aScalarRange[2];
GetSourceRange(aScalarRange);
vtkDataSet* aDataSet = GetInput2();
- float aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet );
+ vtkFloatingPointType aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet );
static double EPS = 1.0 / VTK_LARGE_FLOAT;
if(fabs(aScalarRange[1]) > EPS)
SetScale(0.0);
}
-VISU_ScalarMapPL::THook* VISU_DeformedShapePL::DoHook(){
+VISU_ScalarMapPL::THook*
+VISU_DeformedShapePL
+::DoHook()
+{
VISU::CellDataToPoint(myWarpVector,myCellDataToPointData,GetInput2(),myFieldTransform);
return myWarpVector->GetOutput();
}
-void VISU_DeformedShapePL::Update(){
+void
+VISU_DeformedShapePL
+::Update()
+{
VISU_ScalarMapPL::Update();
}
-void VISU_DeformedShapePL::SetMapScale(float theMapScale){
+void
+VISU_DeformedShapePL
+::SetMapScale(vtkFloatingPointType theMapScale)
+{
VISU_ScalarMapPL::SetMapScale(theMapScale);
myWarpVector->SetScaleFactor(myScaleFactor*theMapScale);
class SALOME_Transform;
class vtkWarpVector;
-class VISU_DeformedShapePL : public VISU_ScalarMapPL{
+class VISU_DeformedShapePL : public VISU_ScalarMapPL
+{
protected:
VISU_DeformedShapePL();
VISU_DeformedShapePL(const VISU_DeformedShapePL&);
+
+ virtual
+ ~VISU_DeformedShapePL();
+
public:
vtkTypeMacro(VISU_DeformedShapePL,VISU_ScalarMapPL);
- static VISU_DeformedShapePL* New();
- virtual ~VISU_DeformedShapePL();
- virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
- virtual void SetScale(float theScale);
- virtual float GetScale();
+ static
+ VISU_DeformedShapePL*
+ New();
+
+ virtual
+ void
+ ShallowCopy(VISU_PipeLine *thePipeLine);
+
+ virtual
+ void
+ SetScale(vtkFloatingPointType theScale);
+
+ virtual
+ vtkFloatingPointType
+ GetScale();
public:
- virtual void Init();
- virtual void Update();
- virtual void SetMapScale(float theMapScale = 1.0);
+ virtual
+ void
+ Init();
+
+ virtual
+ void
+ Update();
+
+ virtual
+ void
+ SetMapScale(vtkFloatingPointType theMapScale = 1.0);
- static float GetScaleFactor(vtkDataSet* theDataSet);
+ static
+ vtkFloatingPointType
+ GetScaleFactor(vtkDataSet* theDataSet);
protected:
- virtual THook* DoHook();
+ virtual
+ THook*
+ DoHook();
- float myScaleFactor;
+ vtkFloatingPointType myScaleFactor;
vtkWarpVector *myWarpVector;
vtkCellDataToPointData* myCellDataToPointData;
};
vtkDataArray* aFieldArray = theInputData->GetArray("VISU_FIELD");
if(vtkFloatArray *aFloatArray = dynamic_cast<vtkFloatArray*>(aFieldArray)){
int aNbComp = aFloatArray->GetNumberOfComponents();
- std::vector<float> anArray(aNbComp < 3? 3: aNbComp);
+ std::vector<vtkFloatingPointType> anArray(aNbComp < 3? 3: aNbComp);
//
vtkFloatArray *aScalars = vtkFloatArray::New();
aScalars->SetNumberOfTuples(theNbElems);
if(!theScalarMode){
for(int anId = 0; anId < theNbElems; anId++){
aFloatArray->GetTuple(anId,&anArray[0]);
- float aVector[3] = {anArray[0], anArray[1], anArray[2]};
- float aScalar = sqrt(aVector[0]*aVector[0] + aVector[1]*aVector[1] + aVector[2]*aVector[2]);
+ vtkFloatingPointType aVector[3] = {anArray[0], anArray[1], anArray[2]};
+ vtkFloatingPointType aScalar = sqrt(aVector[0]*aVector[0] + aVector[1]*aVector[1] + aVector[2]*aVector[2]);
aScalars->SetTuple1(anId,aScalar);
}
}else{
#include <vtkDataSet.h>
#include <vtkMath.h>
-static float Tolerance = 1.0 / VTK_LARGE_FLOAT;
+static vtkFloatingPointType Tolerance = 1.0 / VTK_LARGE_FLOAT;
using namespace std;
void
VISU_FieldTransform
-::SetScalarRange(float theScalarRange[2])
+::SetScalarRange(vtkFloatingPointType theScalarRange[2])
{
- float aDelta =
+ vtkFloatingPointType aDelta =
fabs(myScalarRange[0] - theScalarRange[0]) +
fabs(myScalarRange[1] - theScalarRange[1]);
if(aDelta < Tolerance)
void
VISU_FieldTransform
-::SetScalarMin(float theValue)
+::SetScalarMin(vtkFloatingPointType theValue)
{
- float aScalarRange[2] = {theValue, GetScalarRange()[1]};
+ vtkFloatingPointType aScalarRange[2] = {theValue, GetScalarRange()[1]};
SetScalarRange(aScalarRange);
}
void
VISU_FieldTransform
-::SetScalarMax(float theValue)
+::SetScalarMax(vtkFloatingPointType theValue)
{
- float aScalarRange[2] = {GetScalarRange()[0], theValue};
+ vtkFloatingPointType aScalarRange[2] = {GetScalarRange()[0], theValue};
SetScalarRange(aScalarRange);
}
template<typename TypeData> void
ExecVectors(VISU_FieldTransform::TTransformFun theFunction,
VTKViewer_Transform* theTransform,
- float theScalarRange[2],
+ vtkFloatingPointType theScalarRange[2],
int theNbOfTuples,
TypeData* theInputData,
TypeData* theOutputData)
vtkFloatArray *aNewVectors = vtkFloatArray::New();
aNewVectors->SetNumberOfComponents(3);
aNewVectors->SetNumberOfTuples(theNbOfTuples);
- float aScalarRange[2] = {(*theFunction)(theScalarRange[0]),(*theFunction)(theScalarRange[1])};
- float aDelta = aScalarRange[1] - aScalarRange[0];
- float aScale[3] = {1.0, 1.0, 1.0};
- static float EPS = 1.0 / VTK_LARGE_FLOAT;
+ vtkFloatingPointType aScalarRange[2] = {(*theFunction)(theScalarRange[0]),(*theFunction)(theScalarRange[1])};
+ vtkFloatingPointType aDelta = aScalarRange[1] - aScalarRange[0];
+ vtkFloatingPointType aScale[3] = {1.0, 1.0, 1.0};
+ static vtkFloatingPointType EPS = 1.0 / VTK_LARGE_FLOAT;
if(theTransform){
aScale[0] = theTransform->GetScale()[0];
aScale[1] = theTransform->GetScale()[1];
}
if(theFunction == &(VISU_FieldTransform::Ident)){
for (int aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++) {
- float anInVec[3];
+ vtkFloatingPointType anInVec[3];
anInVectors->GetTuple(aTupleId,anInVec);
- float anNewVec[3];
+ vtkFloatingPointType anNewVec[3];
anNewVec[0] = anInVec[0]*aScale[0];
anNewVec[1] = anInVec[1]*aScale[1];
anNewVec[2] = anInVec[2]*aScale[2];
}
}else{
for (int aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++) {
- float anInVec[3];
+ vtkFloatingPointType anInVec[3];
anInVectors->GetTuple(aTupleId,anInVec);
- float aMagn = vtkMath::Norm(anInVec);
+ vtkFloatingPointType aMagn = vtkMath::Norm(anInVec);
if(aMagn > EPS)
aMagn = ((*theFunction)(aMagn) - aScalarRange[0]) / aDelta * theScalarRange[1] / aMagn;
if(aMagn < 0.0)
aMagn = 0.0;
- float anNewVec[3];
+ vtkFloatingPointType anNewVec[3];
anNewVec[0] = anInVec[0]*aMagn*aScale[0];
anNewVec[1] = anInVec[1]*aMagn*aScale[1];
anNewVec[2] = anInVec[2]*aMagn*aScale[2];
template<typename TypeData> void
ExecScalars(VISU_FieldTransform::TTransformFun theFunction,
- float theScalarRange[2],
+ vtkFloatingPointType theScalarRange[2],
int theNbOfTuples,
TypeData* theInputData,
TypeData* theOutputData)
vtkFloatArray *aNewScalars = vtkFloatArray::New();
aNewScalars->SetNumberOfComponents(1);
aNewScalars->SetNumberOfTuples(theNbOfTuples);
- float aScalarRange[2] = {(*theFunction)(theScalarRange[0]),(*theFunction)(theScalarRange[1])};
+ vtkFloatingPointType aScalarRange[2] = {(*theFunction)(theScalarRange[0]),(*theFunction)(theScalarRange[1])};
for (int aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++) {
- float aScalar = (*theFunction)(anInScalars->GetTuple1(aTupleId));
+ vtkFloatingPointType aScalar = (*theFunction)(anInScalars->GetTuple1(aTupleId));
if(aScalar < aScalarRange[0])
aScalar = aScalarRange[0];
aNewScalars->SetTuple1(aTupleId,aScalar);
void SetSpaceTransform(VTKViewer_Transform* theTransform);
VTKViewer_Transform* GetSpaceTransform() { return myTransform;}
- float* GetScalarRange(){ return myScalarRange; }
- void SetScalarRange(float theScalarRange[2]);
- void SetScalarMin(float theValue);
- void SetScalarMax(float theValue);
+ vtkFloatingPointType* GetScalarRange(){ return myScalarRange; }
+ void SetScalarRange(vtkFloatingPointType theScalarRange[2]);
+ void SetScalarMin(vtkFloatingPointType theValue);
+ void SetScalarMax(vtkFloatingPointType theValue);
protected:
VISU_FieldTransform();
VTKViewer_Transform *myTransform;
TTransformFun myFunction;
- float myScalarRange[2];
+ vtkFloatingPointType myScalarRange[2];
};
#endif
Superclass::Init();
vtkDataSet* aDataSet = GetParentMesh();
- float aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet );
+ vtkFloatingPointType aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet );
- float* aScalarRange = GetScalarRange();
+ vtkFloatingPointType* aScalarRange = GetScalarRange();
static double EPS = 1.0 / VTK_LARGE_FLOAT;
if(fabs(aScalarRange[1]) > EPS)
SetScale( aScaleFactor / aScalarRange[1] );
::Update()
{
//cout << "VISU_GaussPointsPL::Update()" << endl;
- float* aScalarRange = GetScalarRange();
+ vtkFloatingPointType* aScalarRange = GetScalarRange();
mySourceScalarRange[0] = aScalarRange[0];
mySourceScalarRange[1] = aScalarRange[1];
myDeltaScalarRange = aScalarRange[1] - aScalarRange[0];
{
//cout << "VISU_GaussPointsPL::UpdateGlyph()" << endl;
- float* aScalarRange = GetScalarRange();
+ vtkFloatingPointType* aScalarRange = GetScalarRange();
if( myPSMapper->GetPointSpriteMode() == 0 ) // Results
{
myGlyph->SetScaleModeToScaleByScalar();
myGlyph->SetColorModeToColorByScalar();
- float aRange = 0;
- float aMinSize = GetMinSize();
- float aMaxSize = GetMaxSize();
+ vtkFloatingPointType aRange = 0;
+ vtkFloatingPointType aMinSize = GetMinSize();
+ vtkFloatingPointType aMaxSize = GetMaxSize();
if( fabs( aMaxSize - aMinSize ) > 0.0001 )
aRange = ( aScalarRange[1] - aScalarRange[0] ) / ( aMaxSize - aMinSize );
- float aMinRange = aScalarRange[0] - aMinSize * aRange;
- float aMaxRange = aMinRange + aRange;
+ vtkFloatingPointType aMinRange = aScalarRange[0] - aMinSize * aRange;
+ vtkFloatingPointType aMaxRange = aMinRange + aRange;
myGlyph->SetRange( aMinRange, aMaxRange );
myGlyph->SetScaleFactor( 1.0 );
return myGaussPtsIDMapper->GetObjID(theID);
}
-float*
+vtkFloatingPointType*
VISU_GaussPointsPL
::GetNodeCoord(int theObjID)
{
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetMaximumSupportedSize()
{
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::SetClamp(float theClamp)
+::SetClamp(vtkFloatingPointType theClamp)
{
myPSMapper->SetPointSpriteClamp( theClamp );
Modified();
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetClamp()
{
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::SetSize(float theSize)
+::SetSize(vtkFloatingPointType theSize)
{
myPSMapper->SetPointSpriteSize( theSize );
Modified();
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetSize()
{
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::SetMinSize(float theMinSize)
+::SetMinSize(vtkFloatingPointType theMinSize)
{
myPSMapper->SetPointSpriteMinSize( theMinSize );
Modified();
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetMinSize()
{
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::SetMaxSize(float theMaxSize)
+::SetMaxSize(vtkFloatingPointType theMaxSize)
{
myPSMapper->SetPointSpriteMaxSize( theMaxSize );
Modified();
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetMaxSize()
{
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::SetMagnification(float theMagnification)
+::SetMagnification(vtkFloatingPointType theMagnification)
{
myPSMapper->SetPointSpriteMagnification( theMagnification );
Modified();
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetMagnification()
{
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::SetMagnificationIncrement(float theIncrement)
+::SetMagnificationIncrement(vtkFloatingPointType theIncrement)
{
myMagnificationIncrement = theIncrement;
}
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::SetAlphaThreshold(float theAlphaThreshold)
+::SetAlphaThreshold(vtkFloatingPointType theAlphaThreshold)
{
myPSMapper->SetPointSpriteAlphaThreshold( theAlphaThreshold );
Modified();
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetAlphaThreshold()
{
VISU_GaussPointsPL
::ChangeMagnification( bool up )
{
- float anIncrement = up ? myMagnificationIncrement : 1.0 / myMagnificationIncrement;
+ vtkFloatingPointType anIncrement = up ? myMagnificationIncrement : 1.0 / myMagnificationIncrement;
SetMagnification( GetMagnification() * anIncrement );
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetPointSize(vtkIdType theID, vtkDataArray* theScalarArray)
{
- float aMaxSize = GetAverageCellSize() * GetMaxSize();
- float aMinSize = GetAverageCellSize() * GetMinSize();
- float aDelta = aMaxSize - aMinSize;
- float aVal = theScalarArray->GetTuple1(theID);
+ vtkFloatingPointType aMaxSize = GetAverageCellSize() * GetMaxSize();
+ vtkFloatingPointType aMinSize = GetAverageCellSize() * GetMinSize();
+ vtkFloatingPointType aDelta = aMaxSize - aMinSize;
+ vtkFloatingPointType aVal = theScalarArray->GetTuple1(theID);
return aMinSize + aDelta*(aVal - mySourceScalarRange[0])/myDeltaScalarRange;
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetMaxPointSize()
{
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetPointSize(vtkIdType theID)
{
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::SetAverageCellSize(float theAverageCellSize)
+::SetAverageCellSize(vtkFloatingPointType theAverageCellSize)
{
myPSMapper->SetAverageCellSize( theAverageCellSize );
Modified();
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetAverageCellSize()
{
return aCompositeImageData;
}
-void VISU_GaussPointsPL::SetScale( float theScale )
+void VISU_GaussPointsPL::SetScale( vtkFloatingPointType theScale )
{
myWarpVector->SetScaleFactor( theScale );
myScaleFactor = GetScale();
Modified();
}
-float VISU_GaussPointsPL::GetScale()
+vtkFloatingPointType VISU_GaussPointsPL::GetScale()
{
return myWarpVector->GetScaleFactor();
}
-void VISU_GaussPointsPL::SetMapScale( float theMapScale )
+void VISU_GaussPointsPL::SetMapScale( vtkFloatingPointType theMapScale )
{
VISU_ScalarMapPL::SetMapScale( theMapScale );
GetObjID(vtkIdType theID) const;
virtual
- float*
+ vtkFloatingPointType*
GetNodeCoord(vtkIdType theObjID);
void
GetPrimitiveType();
//! Get the maximum Point Sprite size, which is supported by hardware.
- float
+ vtkFloatingPointType
GetMaximumSupportedSize();
//! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteClamp.
void
- SetClamp(float theClamp);
+ SetClamp(vtkFloatingPointType theClamp);
- //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteClamp, float).
- float
+ //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteClamp, vtkFloatingPointType).
+ vtkFloatingPointType
GetClamp();
//! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteSize.
void
- SetSize(float theSize);
+ SetSize(vtkFloatingPointType theSize);
- //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteSize, float).
- float
+ //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteSize, vtkFloatingPointType).
+ vtkFloatingPointType
GetSize();
//! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteMinSize.
void
- SetMinSize(float theMinSize);
+ SetMinSize(vtkFloatingPointType theMinSize);
- //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMinSize, float).
- float
+ //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMinSize, vtkFloatingPointType).
+ vtkFloatingPointType
GetMinSize();
//! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteMinSize.
void
- SetMaxSize(float theMaxSize);
+ SetMaxSize(vtkFloatingPointType theMaxSize);
- //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMaxSize, float).
- float
+ //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMaxSize, vtkFloatingPointType).
+ vtkFloatingPointType
GetMaxSize();
//! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteMagnification.
void
- SetMagnification(float theMagnification);
+ SetMagnification(vtkFloatingPointType theMagnification);
- //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMagnification, float).
- float
+ //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMagnification, vtkFloatingPointType).
+ vtkFloatingPointType
GetMagnification();
//! Set the increment of changing Magnification parameter.
void
- SetMagnificationIncrement(float theIncrement);
+ SetMagnificationIncrement(vtkFloatingPointType theIncrement);
//! Get the increment of changing Magnification parameter.
- float
+ vtkFloatingPointType
GetMagnificationIncrement() { return myMagnificationIncrement; }
//! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteAlphaThreshold.
void
- SetAlphaThreshold(float theAlphaThreshold);
+ SetAlphaThreshold(vtkFloatingPointType theAlphaThreshold);
- //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteAlphaThreshold, float).
- float
+ //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteAlphaThreshold, vtkFloatingPointType).
+ vtkFloatingPointType
GetAlphaThreshold();
//! Set resolution of the Geometrical Sphere.
ChangeMagnification( bool up );
//! Get the maximum size of Point Sprites in the presentation.
- float
+ vtkFloatingPointType
GetMaxPointSize();
//! Get point size by element's Id.
- float
+ vtkFloatingPointType
GetPointSize(vtkIdType theID);
//! Get point size by element's Id using the specified scalar array.
- float
+ vtkFloatingPointType
GetPointSize(vtkIdType theID, vtkDataArray* theScalarArray);
- //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkSetMacro(AverageCellSize, float).
+ //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkSetMacro(AverageCellSize, vtkFloatingPointType).
void
- SetAverageCellSize(float AverageCellSize);
+ SetAverageCellSize(vtkFloatingPointType AverageCellSize);
- //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(AverageCellSize, float).
- float
+ //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(AverageCellSize, vtkFloatingPointType).
+ vtkFloatingPointType
GetAverageCellSize();
//! Set image data for the Point Sprite texture.
virtual void SetIsDeformed( bool theIsDeformed );
virtual bool GetIsDeformed() const;
- virtual void SetScale( float theScale );
- virtual float GetScale();
- virtual void SetMapScale( float theMapScale = 1.0 );
+ virtual void SetScale( vtkFloatingPointType theScale );
+ virtual vtkFloatingPointType GetScale();
+ virtual void SetMapScale( vtkFloatingPointType theMapScale = 1.0 );
protected:
bool myIsDeformed;
- float myScaleFactor;
+ vtkFloatingPointType myScaleFactor;
vtkWarpVector *myWarpVector;
vtkCellDataToPointData* myCellDataToPointData;
std::vector<VTKViewer_PassThroughFilter*> myPassFilter;
vtkGeometryFilter* myGeomFilter;
vtkDataArray *myScalarArray;
- float mySourceScalarRange[2];
- float myDeltaScalarRange;
+ vtkFloatingPointType mySourceScalarRange[2];
+ vtkFloatingPointType myDeltaScalarRange;
int myPrimitiveType;
- float myMagnificationIncrement;
+ vtkFloatingPointType myMagnificationIncrement;
};
#endif
// function: SetCenter
// purpose:
//====================================================================
-void VISU_UnScaledActor::SetCenter(float *pC)
+void VISU_UnScaledActor::SetCenter(vtkFloatingPointType *pC)
{
for (int i=0; i<3; ++i){
myCenter[i]=pC[i];
// function:GetBounds
// purpose:
//====================================================================
-float* VISU_UnScaledActor::GetBounds()
+vtkFloatingPointType* VISU_UnScaledActor::GetBounds()
{
Superclass::GetBounds();
//
void VISU_UnScaledActor::Render(vtkRenderer *theRenderer)
{
if(theRenderer){
- float P[2][3] = {{-1.0, -1.0, 0.0},{+1.0, +1.0, 0.0}};
+ vtkFloatingPointType P[2][3] = {{-1.0, -1.0, 0.0},{+1.0, +1.0, 0.0}};
theRenderer->ViewToWorld(P[0][0],P[0][1],P[0][2]);
theRenderer->ViewToWorld(P[1][0],P[1][1],P[1][2]);
- float aWorldDiag = sqrt((P[1][0]-P[0][0])*(P[1][0]-P[0][0])+
- (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+
- (P[1][2]-P[0][2])*(P[1][2]-P[0][2]));
+ vtkFloatingPointType aWorldDiag = sqrt((P[1][0]-P[0][0])*(P[1][0]-P[0][0])+
+ (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+
+ (P[1][2]-P[0][2])*(P[1][2]-P[0][2]));
int* aSize = theRenderer->GetRenderWindow()->GetSize();
- float aWinDiag = sqrt(float(aSize[0]*aSize[0]+aSize[1]*aSize[1]));
+ vtkFloatingPointType aWinDiag = sqrt(vtkFloatingPointType(aSize[0]*aSize[0]+aSize[1]*aSize[1]));
vtkDataSet* aDataSet = GetMapper()->GetInput();
- float aLength = aDataSet->GetLength();
- float aPrecision = 1.e-3;
- float anOldScale = GetScale()[0];
- float aScale =
- mySize*aWorldDiag/aWinDiag/aLength*sqrt(float(aSize[0])/float(aSize[1]));
+ vtkFloatingPointType aLength = aDataSet->GetLength();
+ vtkFloatingPointType aPrecision = 1.e-3;
+ vtkFloatingPointType anOldScale = GetScale()[0];
+ vtkFloatingPointType aScale =
+ mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(aSize[0])/vtkFloatingPointType(aSize[1]));
SetOrigin(myCenter);
//
static VISU_UnScaledActor *New();
- void SetCenter(float *);
+ void SetCenter(vtkFloatingPointType *);
virtual void SetSize(int theSize);
virtual void Render(vtkRenderer *theRenderer);
- virtual float *GetBounds();
+ virtual vtkFloatingPointType *GetBounds();
protected:
VISU_UnScaledActor();
~VISU_UnScaledActor(){}
- float myCenter[3];
+ vtkFloatingPointType myCenter[3];
int mySize;
};
vtkStandardNewMacro(VISU_IsoSurfacesPL);
-VISU_IsoSurfacesPL::VISU_IsoSurfacesPL(){
+VISU_IsoSurfacesPL
+::VISU_IsoSurfacesPL()
+{
myContourFilter = vtkContourFilter::New();
myCellDataToPointData = vtkCellDataToPointData::New();
myIsShrinkable = false;
}
-VISU_IsoSurfacesPL::~VISU_IsoSurfacesPL(){
+VISU_IsoSurfacesPL
+::~VISU_IsoSurfacesPL()
+{
myContourFilter->UnRegisterAllOutputs();
myContourFilter->Delete();
myCellDataToPointData->Delete();
}
-void VISU_IsoSurfacesPL::ShallowCopy(VISU_PipeLine *thePipeLine){
+void
+VISU_IsoSurfacesPL
+::ShallowCopy(VISU_PipeLine *thePipeLine)
+{
if(VISU_IsoSurfacesPL *aPipeLine = dynamic_cast<VISU_IsoSurfacesPL*>(thePipeLine)){
SetNbParts(aPipeLine->GetNbParts());
- float aRange[2] = {aPipeLine->GetMin(), aPipeLine->GetMax()};
+ vtkFloatingPointType aRange[2] = {aPipeLine->GetMin(), aPipeLine->GetMax()};
SetRange(aRange);
}
VISU_ScalarMapPL::ShallowCopy(thePipeLine);
}
-int VISU_IsoSurfacesPL::GetNbParts() {
+int
+VISU_IsoSurfacesPL
+::GetNbParts()
+{
return myContourFilter->GetNumberOfContours();
}
-void VISU_IsoSurfacesPL::SetNbParts(int theNb) {
+void
+VISU_IsoSurfacesPL
+::SetNbParts(int theNb)
+{
myContourFilter->SetNumberOfContours(theNb);
Modified();
}
-void VISU_IsoSurfacesPL::SetScaling(int theScaling) {
+void
+VISU_IsoSurfacesPL
+::SetScaling(int theScaling)
+{
VISU_ScalarMapPL::SetScaling(theScaling);
SetRange(myRange);
}
-void VISU_IsoSurfacesPL::SetRange(float theRange[2]){
+void
+VISU_IsoSurfacesPL
+::SetRange(vtkFloatingPointType theRange[2])
+{
if(theRange[0] <= theRange[1]){
myRange[0] = theRange[0]; myRange[1] = theRange[1];
- float aRange[2] = {myRange[0], myRange[1]};
+ vtkFloatingPointType aRange[2] = {myRange[0], myRange[1]};
if(GetScaling() == VTK_SCALE_LOG10)
VISU_LookupTable::ComputeLogRange(theRange,aRange);
myContourFilter->GenerateValues(GetNbParts(),aRange);
Modified();
}
}
-float VISU_IsoSurfacesPL::GetMin() {
+
+vtkFloatingPointType
+VISU_IsoSurfacesPL
+::GetMin()
+{
return myRange[0];
}
-float VISU_IsoSurfacesPL::GetMax() {
+
+vtkFloatingPointType
+VISU_IsoSurfacesPL
+::GetMax()
+{
return myRange[1];
}
-void VISU_IsoSurfacesPL::Init(){
+void
+VISU_IsoSurfacesPL
+::Init()
+{
VISU_ScalarMapPL::Init();
SetNbParts(10);
- float aScalarRange[2];
+ vtkFloatingPointType aScalarRange[2];
GetSourceRange(aScalarRange);
SetRange(aScalarRange);
}
-VISU_ScalarMapPL::THook* VISU_IsoSurfacesPL::DoHook(){
+VISU_ScalarMapPL::THook*
+VISU_IsoSurfacesPL
+::DoHook()
+{
VISU::CellDataToPoint(myContourFilter,myCellDataToPointData,GetInput2(),myFieldTransform);
return myContourFilter->GetOutput();
}
-void VISU_IsoSurfacesPL::Update()
+void
+VISU_IsoSurfacesPL
+::Update()
{
VISU_ScalarMapPL::Update();
}
-void VISU_IsoSurfacesPL::SetMapScale(float theMapScale){
+void
+VISU_IsoSurfacesPL
+::SetMapScale(vtkFloatingPointType theMapScale)
+{
VISU_ScalarMapPL::SetMapScale(theMapScale);
- float aRange[2] = {GetMax() - theMapScale*(GetMax()-GetMin()), GetMax()};
- float aNewRange[2] = {aRange[0], aRange[1]};
+ vtkFloatingPointType aRange[2] = {GetMax() - theMapScale*(GetMax()-GetMin()), GetMax()};
+ vtkFloatingPointType aNewRange[2] = {aRange[0], aRange[1]};
if(GetScaling() == VTK_SCALE_LOG10)
VISU_LookupTable::ComputeLogRange(aRange,aNewRange);
myContourFilter->GenerateValues(GetNbParts(),aNewRange);
class vtkContourFilter;
class vtkCellDataToPointData;
-class VISU_IsoSurfacesPL : public VISU_ScalarMapPL{
+class VISU_IsoSurfacesPL : public VISU_ScalarMapPL
+{
protected:
VISU_IsoSurfacesPL();
VISU_IsoSurfacesPL(const VISU_IsoSurfacesPL&);
+
+ virtual
+ ~VISU_IsoSurfacesPL();
+
public:
vtkTypeMacro(VISU_IsoSurfacesPL,VISU_ScalarMapPL);
- static VISU_IsoSurfacesPL* New();
- virtual ~VISU_IsoSurfacesPL();
- virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
- virtual int GetNbParts();
- virtual void SetNbParts(int theNb = 10);
+ static
+ VISU_IsoSurfacesPL*
+ New();
+
+ virtual
+ void
+ ShallowCopy(VISU_PipeLine *thePipeLine);
+
+ virtual
+ int
+ GetNbParts();
+
+ virtual
+ void
+ SetNbParts(int theNb = 10);
+
+ virtual
+ void
+ SetScaling(int theScaling = VTK_SCALE_LINEAR);
- virtual void SetScaling(int theScaling = VTK_SCALE_LINEAR);
- virtual void SetRange(float theRange[2]);
- virtual float GetMin();
- virtual float GetMax();
+ virtual
+ void
+ SetRange(vtkFloatingPointType theRange[2]);
+
+ virtual
+ vtkFloatingPointType
+ GetMin();
+
+ virtual
+ vtkFloatingPointType
+ GetMax();
public:
- virtual void Init();
- virtual void Update();
- virtual THook* DoHook();
- virtual void SetMapScale(float theMapScale = 1.0);
+ virtual
+ void
+ Init();
+
+ virtual
+ void
+ Update();
+
+ virtual
+ THook*
+ DoHook();
+
+ virtual
+ void
+ SetMapScale(vtkFloatingPointType theMapScale = 1.0);
protected:
int myNbParts;
- float myRange[2];
+ vtkFloatingPointType myRange[2];
vtkCellDataToPointData* myCellDataToPointData;
vtkContourFilter *myContourFilter;
};
using namespace std;
-VISU_LookupTable *VISU_LookupTable::New() {
- vtkObject* ret = vtkObjectFactory::CreateInstance("VISU_LookupTable");
- if(ret)
- return (VISU_LookupTable*)ret;
- return new VISU_LookupTable;
-}
+vtkStandardNewMacro(VISU_LookupTable);
-VISU_LookupTable::VISU_LookupTable(int sze, int ext)
- : vtkLookupTable(sze, ext), myScale(1.0), myBicolor(false) {}
+VISU_LookupTable
+::VISU_LookupTable(int sze, int ext):
+ vtkLookupTable(sze, ext),
+ myScale(1.0),
+ myBicolor(false)
+{}
-void VISU_LookupTable::SetMapScale(float theScale)
+void
+VISU_LookupTable
+::SetMapScale(vtkFloatingPointType theScale)
{
if( myScale != theScale )
{
}
-int VISU_LookupTable::ComputeLogRange(float inRange[2], float outRange[2]){
+int
+VISU_LookupTable
+::ComputeLogRange(vtkFloatingPointType inRange[2],
+ vtkFloatingPointType outRange[2])
+{
if(inRange[0] >= inRange[1])
return -1;
if(0.0 <= inRange[0] && 0.0 < inRange[1]){
return -1;
}
-unsigned char* VISU_LookupTable::MapValue(float v) {
+unsigned char*
+VISU_LookupTable
+::MapValue(vtkFloatingPointType v)
+{
if(GetScale() == VTK_SCALE_LOG10) {
- float aLowBound = log10(this->TableRange[0]);
+ vtkFloatingPointType aLowBound = log10(this->TableRange[0]);
v = pow(10.0f,aLowBound + (v - aLowBound)*myScale);
return vtkLookupTable::MapValue(v);
} else if (!myBicolor) {
}
// Apply log to value, with appropriate constraints.
-inline float VISU_ApplyLogScale(float v, float range[2],
- float logRange[2])
+inline
+vtkFloatingPointType
+VISU_ApplyLogScale(vtkFloatingPointType v,
+ vtkFloatingPointType range[2],
+ vtkFloatingPointType logRange[2])
{
// is the range set for negative numbers?
if (range[0] < 0)
}
// Apply shift/scale to the scalar value v and do table lookup.
-inline unsigned char *VISU_LinearLookup(float v,
- unsigned char *table,
- float maxIndex,
- float shift, float scale,
- bool bicolor)
+inline
+unsigned char *
+VISU_LinearLookup(vtkFloatingPointType v,
+ unsigned char *table,
+ vtkFloatingPointType maxIndex,
+ vtkFloatingPointType shift,
+ vtkFloatingPointType scale,
+ bool bicolor)
{
if( !bicolor )
{
- float findx = (v + shift)*scale;
+ vtkFloatingPointType findx = (v + shift)*scale;
if (findx < 0)
findx = 0;
if (findx > maxIndex)
// accelerate the mapping by copying the data in 32-bit chunks instead
// of 8-bit chunks
template<class T>
-void VISU_LookupTableMapData(vtkLookupTable *self, T *input,
- unsigned char *output, int length,
- int inIncr, int outFormat,
- float theMapScale, bool bicolor)
+void
+VISU_LookupTableMapData(vtkLookupTable *self,
+ T *input,
+ unsigned char *output,
+ int length,
+ int inIncr,
+ int outFormat,
+ vtkFloatingPointType theMapScale,
+ bool bicolor)
{
int i = length;
- float *range = self->GetTableRange();
- float maxIndex = self->GetNumberOfColors() - 1;
- float shift, scale;
+ vtkFloatingPointType *range = self->GetTableRange();
+ vtkFloatingPointType maxIndex = self->GetNumberOfColors() - 1;
+ vtkFloatingPointType shift, scale;
unsigned char *table = self->GetPointer(0);
unsigned char *cptr;
- float alpha;
+ vtkFloatingPointType alpha;
if ( (alpha=self->GetAlpha()) >= 1.0 ) //no blending required
{
if (self->GetScale() == VTK_SCALE_LOG10)
{
- float val;
- float logRange[2];
+ vtkFloatingPointType val;
+ vtkFloatingPointType logRange[2];
VISU_LookupTable::ComputeLogRange(range, logRange);
shift = -logRange[0];
if (logRange[1] <= logRange[0])
{
if (self->GetScale() == VTK_SCALE_LOG10)
{
- float val;
- float logRange[2];
+ vtkFloatingPointType val;
+ vtkFloatingPointType logRange[2];
VISU_LookupTable::ComputeLogRange(range, logRange);
shift = -logRange[0];
if (logRange[1] <= logRange[0])
// it is only done on the first render. Colors are cached
// for subsequent renders.
template<class T>
-void VISU_LookupTableMapMag(vtkLookupTable *self, T *input,
- unsigned char *output, int length,
- int inIncr, int outFormat,
- float theMapScale, bool bicolor)
+void
+VISU_LookupTableMapMag(vtkLookupTable *self,
+ T *input,
+ unsigned char *output,
+ int length,
+ int inIncr,
+ int outFormat,
+ vtkFloatingPointType theMapScale,
+ bool bicolor)
{
double tmp, sum;
double *mag;
int inputDataType, int numberOfValues,
int inputIncrement, int outputIncrement);
- float GetMapScale() { return myScale; }
- void SetMapScale(float theScale = 1.0);
+ vtkFloatingPointType GetMapScale() { return myScale; }
+ void SetMapScale(vtkFloatingPointType theScale = 1.0);
- float GetBicolor() { return myBicolor; }
+ bool GetBicolor() { return myBicolor; }
void SetBicolor( bool theBicolor );
- static int ComputeLogRange(float inRange[2], float outRange[2]);
- unsigned char *MapValue(float v);
+ static int ComputeLogRange(vtkFloatingPointType inRange[2], vtkFloatingPointType outRange[2]);
+ unsigned char *MapValue(vtkFloatingPointType v);
protected:
VISU_LookupTable(int sze=256, int ext=256);
~VISU_LookupTable() {};
- float myScale;
+ vtkFloatingPointType myScale;
bool myBicolor;
};
//-----------------------------------------------------------------------------
float ViewToDisplay( vtkRenderer* theRenderer )
{
- float p1[3], p2[3];
+ vtkFloatingPointType p1[3], p2[3];
theRenderer->SetViewPoint( 0.0, 0.0, 0.0 );
theRenderer->ViewToDisplay();
theRenderer->ViewToDisplay();
theRenderer->GetDisplayPoint( p2 );
- float coefficient = sqrt( pow( p2[0] - p1[0], 2 ) + pow( p2[1] - p1[1], 2 ) ) / sqrt( 2 );
+ vtkFloatingPointType coefficient = sqrt( pow( p2[0] - p1[0], 2 ) + pow( p2[1] - p1[1], 2 ) ) / sqrt( 2 );
//cout << p1[0] << " " << p1[1] << " " << p1[2] << endl;
//cout << p2[0] << " " << p2[1] << " " << p2[2] << endl;
//cout << "ZOOM : " << coefficient << endl;
TVertex* aVertexArr = new TVertex[ this->TotalCells ];
- float* aPropertyColor = theActor->GetProperty()->GetColor();
+ vtkFloatingPointType* aPropertyColor = theActor->GetProperty()->GetColor();
float aColor[3] = {aPropertyColor[0], aPropertyColor[1], aPropertyColor[2]};
unsigned long i = 0;
{
TVertex& aVertex = aVertexArr[i];
vtkIdType aPointId = pts[0];
- float* aCoords = thePoints->GetPoint( aPointId );
+ vtkFloatingPointType* aCoords = thePoints->GetPoint( aPointId );
aVertex.vx = aCoords[0];
aVertex.vy = aCoords[1];
aVertex.vz = aCoords[2];
int
VISU_PipeLine
-::CheckAvailableMemory(const float& theSize)
+::CheckAvailableMemory(const vtkFloatingPointType& theSize)
{
try{
if(theSize > ULONG_MAX) return 0;
return 0;
}
-float
+vtkFloatingPointType
VISU_PipeLine
-::GetAvailableMemory(float theSize,
- float theMinSize)
+::GetAvailableMemory(vtkFloatingPointType theSize,
+ vtkFloatingPointType theMinSize)
{
while(!CheckAvailableMemory(theSize))
if(theSize > theMinSize)
static
void
ComputeBoundsParam (vtkDataSet* theDataSet,
- float theDirection[3],
- float theMinPnt[3],
- float& theMaxBoundPrj,
- float& theMinBoundPrj)
+ vtkFloatingPointType theDirection[3],
+ vtkFloatingPointType theMinPnt[3],
+ vtkFloatingPointType& theMaxBoundPrj,
+ vtkFloatingPointType& theMinBoundPrj)
{
- float aBounds[6];
+ vtkFloatingPointType aBounds[6];
theDataSet->GetBounds(aBounds);
//Enlarge bounds in order to avoid conflicts of precision
for(int i = 0; i < 6; i += 2){
static double EPS = 1.0E-3;
- float aDelta = (aBounds[i+1] - aBounds[i])*EPS;
+ vtkFloatingPointType aDelta = (aBounds[i+1] - aBounds[i])*EPS;
aBounds[i] -= aDelta;
aBounds[i+1] += aDelta;
}
- float aBoundPoints[8][3] = { {aBounds[0],aBounds[2],aBounds[4]},
- {aBounds[1],aBounds[2],aBounds[4]},
- {aBounds[0],aBounds[3],aBounds[4]},
- {aBounds[1],aBounds[3],aBounds[4]},
- {aBounds[0],aBounds[2],aBounds[5]},
- {aBounds[1],aBounds[2],aBounds[5]},
- {aBounds[0],aBounds[3],aBounds[5]},
- {aBounds[1],aBounds[3],aBounds[5]}};
+ vtkFloatingPointType aBoundPoints[8][3] = { {aBounds[0],aBounds[2],aBounds[4]},
+ {aBounds[1],aBounds[2],aBounds[4]},
+ {aBounds[0],aBounds[3],aBounds[4]},
+ {aBounds[1],aBounds[3],aBounds[4]},
+ {aBounds[0],aBounds[2],aBounds[5]},
+ {aBounds[1],aBounds[2],aBounds[5]},
+ {aBounds[0],aBounds[3],aBounds[5]},
+ {aBounds[1],aBounds[3],aBounds[5]}};
int aMaxId = 0, aMinId = aMaxId;
theMaxBoundPrj = vtkMath::Dot(theDirection,aBoundPoints[aMaxId]);
theMinBoundPrj = theMaxBoundPrj;
for(int i = 1; i < 8; i++){
- float aTmp = vtkMath::Dot(theDirection,aBoundPoints[i]);
+ vtkFloatingPointType aTmp = vtkMath::Dot(theDirection,aBoundPoints[i]);
if(theMaxBoundPrj < aTmp){
theMaxBoundPrj = aTmp;
aMaxId = i;
aMinId = i;
}
}
- float *aMinPnt = aBoundPoints[aMaxId];
+ vtkFloatingPointType *aMinPnt = aBoundPoints[aMaxId];
theMinPnt[0] = aMinPnt[0];
theMinPnt[1] = aMinPnt[1];
theMinPnt[2] = aMinPnt[2];
static
void
DistanceToPosition(vtkDataSet* theDataSet,
- float theDirection[3],
- float theDist,
- float thePos[3])
+ vtkFloatingPointType theDirection[3],
+ vtkFloatingPointType theDist,
+ vtkFloatingPointType thePos[3])
{
- float aMaxBoundPrj, aMinBoundPrj, aMinPnt[3];
+ vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3];
ComputeBoundsParam(theDataSet,theDirection,aMinPnt,aMaxBoundPrj,aMinBoundPrj);
- float aLength = (aMaxBoundPrj-aMinBoundPrj)*theDist;
+ vtkFloatingPointType aLength = (aMaxBoundPrj-aMinBoundPrj)*theDist;
thePos[0] = aMinPnt[0]-theDirection[0]*aLength;
thePos[1] = aMinPnt[1]-theDirection[1]*aLength;
thePos[2] = aMinPnt[2]-theDirection[2]*aLength;
static
void
PositionToDistance (vtkDataSet* theDataSet,
- float theDirection[3],
- float thePos[3],
- float& theDist)
+ vtkFloatingPointType theDirection[3],
+ vtkFloatingPointType thePos[3],
+ vtkFloatingPointType& theDist)
{
- float aMaxBoundPrj, aMinBoundPrj, aMinPnt[3];
+ vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3];
ComputeBoundsParam(theDataSet,theDirection,aMinPnt,aMaxBoundPrj,aMinBoundPrj);
- float aPrj = vtkMath::Dot(theDirection,thePos);
+ vtkFloatingPointType aPrj = vtkMath::Dot(theDirection,thePos);
theDist = (aPrj-aMinBoundPrj)/(aMaxBoundPrj-aMinBoundPrj);
}
void
VISU_PipeLine
-::SetPlaneParam(float theDir[3],
- float theDist,
+::SetPlaneParam(vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theDist,
vtkPlane* thePlane)
{
thePlane->SetNormal(theDir);
- float anOrigin[3];
+ vtkFloatingPointType anOrigin[3];
::DistanceToPosition(GetInput(),theDir,theDist,anOrigin);
thePlane->SetOrigin(anOrigin);
}
void
VISU_PipeLine
-::GetPlaneParam(float theDir[3],
- float& theDist,
+::GetPlaneParam(vtkFloatingPointType theDir[3],
+ vtkFloatingPointType& theDist,
vtkPlane* thePlane)
{
thePlane->GetNormal(theDir);
- float anOrigin[3];
+ vtkFloatingPointType anOrigin[3];
thePlane->GetOrigin(anOrigin);
::PositionToDistance(GetInput(),theDir,anOrigin,theDist);
}
VISU_PipeLine
::IsPlanarInput() const
{
- float aBounds[6];
+ vtkFloatingPointType aBounds[6];
GetInput()->GetBounds( aBounds ); // xmin,xmax, ymin,ymax, zmin,zmax
if (fabs( aBounds[0] - aBounds[1] ) <= FLT_MIN ||
fabs( aBounds[2] - aBounds[3] ) <= FLT_MIN ||
return myExtractGeometry->GetNodeVTKId(anID);
}
-float*
+vtkFloatingPointType*
VISU_PipeLine
::GetNodeCoord(int theObjID)
{
static
int
- CheckAvailableMemory(const float& theSize);
+ CheckAvailableMemory(const vtkFloatingPointType& theSize);
static
- float
- GetAvailableMemory(float theSize = 16*1024*1024.0,
- float theMinSize = 1024*1024.0);
+ vtkFloatingPointType
+ GetAvailableMemory(vtkFloatingPointType theSize = 16*1024*1024.0,
+ vtkFloatingPointType theMinSize = 1024*1024.0);
// Clipping planes
void
GetClippingPlane(vtkIdType theID) const;
void
- SetPlaneParam(float theDir[3],
- float theDist,
+ SetPlaneParam(vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theDist,
vtkPlane* thePlane);
void
- GetPlaneParam(float theDir[3],
- float& theDist,
+ GetPlaneParam(vtkFloatingPointType theDir[3],
+ vtkFloatingPointType& theDist,
vtkPlane* thePlane);
bool
GetNodeVTKID(vtkIdType theID);
virtual
- float*
+ vtkFloatingPointType*
GetNodeCoord(vtkIdType theObjID);
virtual
#include "VISU_PipeLineUtils.hxx"
-void VISU::Mul(const float A[3], float b, float C[3]){ // A*b;
+void
+VISU::Mul(const vtkFloatingPointType A[3],
+ vtkFloatingPointType b,
+ vtkFloatingPointType C[3])
+{ // A*b;
for(int i = 0; i < 3; i++) C[i] = A[i]*b;
}
-void VISU::Sub(const float A[3], const float B[3], float C[3]){ //A-B
+void
+VISU::Sub(const vtkFloatingPointType A[3],
+ const vtkFloatingPointType B[3],
+ vtkFloatingPointType C[3])
+{ //A-B
for(int i = 0; i < 3; i++) C[i] = A[i] - B[i];
}
#endif
-namespace VISU{
- void Mul(const float A[3], float b, float C[3]); // C = A * b
- void Sub(const float A[3], const float B[3], float C[3]); // C = A - B
+namespace VISU
+{
+ void
+ Mul(const vtkFloatingPointType A[3],
+ vtkFloatingPointType b,
+ vtkFloatingPointType C[3]); // C = A * b
+
+ void
+ Sub(const vtkFloatingPointType A[3],
+ const vtkFloatingPointType B[3],
+ vtkFloatingPointType C[3]); // C = A - B
template<class TItem>
void
#include <vtkRenderWindow.h>
static
- bool IsValidPlane2Position(vtkPlane *pPx,
- vtkDataSet *pDataSet,
- float aTol=0.003);
+bool
+IsValidPlane2Position(vtkPlane *pPx,
+ vtkDataSet *pDataSet,
+ vtkFloatingPointType aTol=0.003);
static
- void GetBndPoints(vtkDataSet *pDataSet,
- float aPnts[24]);
+void
+GetBndPoints(vtkDataSet *pDataSet,
+ vtkFloatingPointType aPnts[24]);
static
- float DistanceToPlane(const float x[3],
- const float n[3],
- const float p0[3]);
+vtkFloatingPointType
+DistanceToPlane(const vtkFloatingPointType x[3],
+ const vtkFloatingPointType n[3],
+ const vtkFloatingPointType p0[3]);
vtkCxxRevisionMacro(VISU_PlanesWidget, "$Revision$");
vtkStandardNewMacro(VISU_PlanesWidget);
this->Transform = vtkTransform::New();
// Define the point coordinates
- float bounds[6];
+ vtkFloatingPointType bounds[6];
bounds[0] = -0.5;
bounds[1] = 0.5;
bounds[2] = -0.5;
// function: SetDistance
// purpose :
//==================================================================
-void VISU_PlanesWidget::SetDistance(const float theDistance)
+void
+VISU_PlanesWidget
+::SetDistance(const vtkFloatingPointType theDistance)
{
if( theDistance <= 0.0 || theDistance == myDistance )
return;
myDistance=theDistance;
//
- float *origin, *normal, oNew[3], aN2[3];
+ vtkFloatingPointType *origin, *normal, oNew[3], aN2[3];
origin = myPlane1->GetOrigin();
normal = myPlane1->GetNormal();
vtkMath::Normalize(normal);
// function: Distance
// purpose :
//==================================================================
-float VISU_PlanesWidget::Distance()const
+vtkFloatingPointType
+VISU_PlanesWidget
+::Distance() const
{
return myDistance;
}
{
//Get the motion vector
int i;
- float v[3];
+ vtkFloatingPointType v[3];
//
for (i=0; i<3; ++i){
v[i] = p2[i] - p1[i];
}
//
- float aOr1[3], aNr1[3], aNr2[3], aD, z1;
+ vtkFloatingPointType aOr1[3], aNr1[3], aNr2[3], aD, z1;
//
myPlane1->GetOrigin(aOr1);
myPlane1->GetNormal(aNr1);
}
//
//Add to the current point, project back down onto plane
- float *o = myPlane1->GetOrigin();
- float *n = myPlane1->GetNormal();
- float newOrigin[3];
+ vtkFloatingPointType *o = myPlane1->GetOrigin();
+ vtkFloatingPointType *n = myPlane1->GetNormal();
+ vtkFloatingPointType newOrigin[3];
//
for (i=0; i<3; ++i){
newOrigin[i]=o[i] + v[i];
// function: SetOriginInternal
// purpose : Set the origin of the plane.(for Internal calls)
//==================================================================
-void VISU_PlanesWidget::SetOriginInternal(float x[3])
+void VISU_PlanesWidget::SetOriginInternal(vtkFloatingPointType x[3])
{
- float *bounds = this->myOutline->GetOutput()->GetBounds();
+ vtkFloatingPointType *bounds = this->myOutline->GetOutput()->GetBounds();
int i, j;
for (i=0; i<3; ++i) {
j=2*i;
}
//
bool bFlag;
- float aOr2[3], aNr2[3], aNr1[3];
+ vtkFloatingPointType aOr2[3], aNr2[3], aNr1[3];
vtkPlane *pPx;
//
myPlane1->GetNormal(aNr1);
v[i] = p2[i] - p1[i];
}
//
- float *origin = myPlane1->GetOrigin();
- float *normal = myPlane1->GetNormal();
+ vtkFloatingPointType *origin = myPlane1->GetOrigin();
+ vtkFloatingPointType *normal = myPlane1->GetNormal();
// Create axis of rotation and angle of rotation
vtkMath::Cross(vpn,v,axis);
this->Transform->Translate(-origin[0],-origin[1],-origin[2]);
//Set the new normal
- float nNew[3], aN2[3], oNew[3];
+ vtkFloatingPointType nNew[3], aN2[3], oNew[3];
this->Transform->TransformNormal(normal,nNew);
//
for (i=0; i<3; ++i){
void VISU_PlanesWidget::PushDistance(double *p1, double *p2)
{
int i;
- float v[3], *anOrigin1, *aN1, *anOrigin2, *aN2, aD;
+ vtkFloatingPointType v[3], *anOrigin1, *aN1, *anOrigin2, *aN2, aD;
//Get the motion vector
for (i=0; i<3; ++i){
v[i] = p2[i] - p1[i];
vtkMath::Normalize(aN1);
- float origin[3];
+ vtkFloatingPointType origin[3];
double distance = vtkMath::Dot( v, aN2 );
for(i=0; i<3; ++i) {
origin[i] = anOrigin2[i] + distance * aN2[i];
}
- float d = DistanceToPlane(origin, aN1, anOrigin1);
+ vtkFloatingPointType d = DistanceToPlane(origin, aN1, anOrigin1);
if( d <= 0.0 )
return;
//
bool bFlag;
- float aOr2[3], aNr2[3];
+ vtkFloatingPointType aOr2[3], aNr2[3];
vtkPlane *pPx;
//
myPlane2->GetOrigin(aOr2);
v[2] = p2[2] - p1[2];
//Translate the plane
- float oNew[3];
- float *origin = myPlane1->GetOrigin();
+ vtkFloatingPointType oNew[3];
+ vtkFloatingPointType *origin = myPlane1->GetOrigin();
oNew[0] = origin[0] + v[0];
oNew[1] = origin[1] + v[1];
oNew[2] = origin[2] + v[2];
v[2] = p2[2] - p1[2];
//Translate the bounding box
- float *origin = myBox->GetOrigin();
- float oNew[3];
+ vtkFloatingPointType *origin = myBox->GetOrigin();
+ vtkFloatingPointType oNew[3];
oNew[0] = origin[0] + v[0];
oNew[1] = origin[1] + v[1];
oNew[2] = origin[2] + v[2];
v[2] = p2[2] - p1[2];
//int res = this->PlaneSource->GetXResolution();
- float *o = myPlane1->GetOrigin();
+ vtkFloatingPointType *o = myPlane1->GetOrigin();
// Compute the scale factor
- float sf = vtkMath::Norm(v) / this->myOutline->GetOutput()->GetLength();
+ vtkFloatingPointType sf = vtkMath::Norm(v) / this->myOutline->GetOutput()->GetLength();
if ( Y > this->Interactor->GetLastEventPosition()[1] ) {
sf = 1.0 + sf;
}
this->Transform->Scale(sf,sf,sf);
this->Transform->Translate(-o[0],-o[1],-o[2]);
- float *origin = myBox->GetOrigin();
- float *spacing = myBox->GetSpacing();
- float oNew[3], p[3], pNew[3];
+ vtkFloatingPointType *origin = myBox->GetOrigin();
+ vtkFloatingPointType *spacing = myBox->GetSpacing();
+ vtkFloatingPointType oNew[3], p[3], pNew[3];
p[0] = origin[0] + spacing[0];
p[1] = origin[1] + spacing[1];
p[2] = origin[2] + spacing[2];
// function: InitialPlaceWidget
// purpose :
//==================================================================
-void VISU_PlanesWidget::InitialPlaceWidget(float bds[6])
+void VISU_PlanesWidget::InitialPlaceWidget(vtkFloatingPointType bds[6])
{
- float bounds[6], origin[3];
+ vtkFloatingPointType bounds[6], origin[3];
PlaceWidget(bds);
//
(bounds[3]+bounds[2])/2.0,
(bounds[5]+bounds[4])/2.0);
- static float DIST_COEFF = 0.1;
+ static vtkFloatingPointType DIST_COEFF = 0.1;
SetDistance(this->InitialLength*DIST_COEFF);
//
this->UpdateRepresentation();
// function: PlaceWidget
// purpose :
//==================================================================
-void VISU_PlanesWidget::PlaceWidget(float bds[6])
+void VISU_PlanesWidget::PlaceWidget(vtkFloatingPointType bds[6])
{
int i;
- float bounds[6], origin[3];
+ vtkFloatingPointType bounds[6], origin[3];
this->AdjustBounds(bds, bounds, origin);
// function: SetOrigin
// purpose :Set the origin of the plane.(for external calls)
//==================================================================
-void VISU_PlanesWidget::SetOrigin(float x, float y, float z)
+void VISU_PlanesWidget::SetOrigin(vtkFloatingPointType x, vtkFloatingPointType y, vtkFloatingPointType z)
{
- float origin[3];
+ vtkFloatingPointType origin[3];
origin[0] = x;
origin[1] = y;
origin[2] = z;
// function: SetOrigin
// purpose : Set the origin of the plane.(for external calls)
//==================================================================
-void VISU_PlanesWidget::SetOrigin(float x[3])
+void VISU_PlanesWidget::SetOrigin(vtkFloatingPointType x[3])
{
- float *bounds = this->myOutline->GetOutput()->GetBounds();
+ vtkFloatingPointType *bounds = this->myOutline->GetOutput()->GetBounds();
for (int i=0; i<3; i++) {
if ( x[i] < bounds[2*i] ) {
x[i] = bounds[2*i];
}
}
myPlane1->SetOrigin(x);
- float *origin, *normal, oNew[3];
+ vtkFloatingPointType *origin, *normal, oNew[3];
origin = myPlane1->GetOrigin();
normal = myPlane1->GetNormal();
vtkMath::Normalize(normal);
// function: GetOrigin
// purpose :Get the origin of the plane.
//==================================================================
-float* VISU_PlanesWidget::GetOrigin()
+vtkFloatingPointType* VISU_PlanesWidget::GetOrigin()
{
return myPlane1->GetOrigin();
}
-void VISU_PlanesWidget::GetOrigin(float xyz[3])
+void VISU_PlanesWidget::GetOrigin(vtkFloatingPointType xyz[3])
{
myPlane1->GetOrigin(xyz);
}
// function: SetNormal
// purpose :Set the normal to the plane.
//==================================================================
-void VISU_PlanesWidget::SetNormal(float x, float y, float z)
+void VISU_PlanesWidget::SetNormal(vtkFloatingPointType x, vtkFloatingPointType y, vtkFloatingPointType z)
{
- float n[3];
+ vtkFloatingPointType n[3];
n[0] = x;
n[1] = y;
n[2] = z;
// function: SetNormal
// purpose :Set the normal to the plane.
//==================================================================
-void VISU_PlanesWidget::SetNormal(float n[3])
+void VISU_PlanesWidget::SetNormal(vtkFloatingPointType n[3])
{
this->SetNormal(n[0], n[1], n[2]);
}
// function: GetNormal
// purpose :Get the normal to the plane.
//==================================================================
-float* VISU_PlanesWidget::GetNormal()
+vtkFloatingPointType* VISU_PlanesWidget::GetNormal()
{
return myPlane1->GetNormal();
}
// function: GetNormal
// purpose :Get the normal to the plane.
//==================================================================
-void VISU_PlanesWidget::GetNormal(float xyz[3])
+void VISU_PlanesWidget::GetNormal(vtkFloatingPointType xyz[3])
{
myPlane1->GetNormal(xyz);
}
return;
}
- float *origin = myPlane1->GetOrigin();
- float *normal = myPlane1->GetNormal();
- float p2[3];
+ vtkFloatingPointType *origin = myPlane1->GetOrigin();
+ vtkFloatingPointType *normal = myPlane1->GetNormal();
+ vtkFloatingPointType p2[3];
// Setup the plane normal
- float d = this->myOutline->GetOutput()->GetLength();
+ vtkFloatingPointType d = this->myOutline->GetOutput()->GetLength();
p2[0] = origin[0] + 0.30 * d * normal[0];
p2[1] = origin[1] + 0.30 * d * normal[1];
//==================================================================
bool IsValidPlane2Position(vtkPlane *pPx,
vtkDataSet *pDataSet,
- float aTol)
+ vtkFloatingPointType aTol)
{
bool bRet;
int i, iFound;
- float aD, aDmax, aPnts[24], aDiagonal;
- float aTol1, aOr[3], aN[3];
+ vtkFloatingPointType aD, aDmax, aPnts[24], aDiagonal;
+ vtkFloatingPointType aTol1, aOr[3], aN[3];
//
bRet=false;
aDiagonal=pDataSet->GetLength();
// function: GetBndPoints
// purpose :
//==================================================================
-void GetBndPoints(vtkDataSet *pDataSet,
- float aPnts[24])
+void
+GetBndPoints(vtkDataSet *pDataSet,
+ vtkFloatingPointType aPnts[24])
{
- int aIndx[24]={
+ int aIndx[24] = {
0,2,4,1,2,4,1,3,4,0,3,4,
0,2,5,1,2,5,1,3,5,0,3,5
};
int i;
- float *pBounds=pDataSet->GetBounds();
+ vtkFloatingPointType *pBounds=pDataSet->GetBounds();
//
for (i=0; i<24; ++i){
aPnts[i]=pBounds[aIndx[i]];
// function: DistanceToPlane
// purpose :
//==================================================================
-float DistanceToPlane(const float x[3],
- const float n[3],
- const float p0[3])
+vtkFloatingPointType
+DistanceToPlane(const vtkFloatingPointType x[3],
+ const vtkFloatingPointType n[3],
+ const vtkFloatingPointType p0[3])
{
- return ((float) (n[0]*(x[0]-p0[0]) +
- n[1]*(x[1]-p0[1]) +
- n[2]*(x[2]-p0[2])));
+ return ((n[0]*(x[0]-p0[0]) +
+ n[1]*(x[1]-p0[1]) +
+ n[2]*(x[2]-p0[2])));
}
/*
//==================================================================
//==================================================================
void VISU_PlanesWidget::SizeHandles()
{
- // float radius =
+ // vtkFloatingPointType radius =
this->vtk3DWidget::SizeHandles(1.35);
}
*/
vtkTypeRevisionMacro(VISU_PlanesWidget,VISU_ImplicitFunctionWidget);
void PrintSelf(ostream& os, vtkIndent indent);
- void SetDistance (const float theDistance);
- float Distance()const;
+ void
+ SetDistance(const vtkFloatingPointType theDistance);
- vtkGetMacro(InitialLength,float);
+ vtkFloatingPointType
+ Distance() const;
- virtual vtkImplicitFunction* ImplicitFunction();
+ vtkGetMacro(InitialLength,vtkFloatingPointType);
+
+ virtual
+ vtkImplicitFunction*
+ ImplicitFunction();
// Description:
// Methods that satisfy the superclass' API.
- virtual void SetEnabled(int);
- virtual void PlaceWidget(float bounds[6]);
+ virtual
+ void
+ SetEnabled(int);
+
+ virtual
+ void
+ PlaceWidget(vtkFloatingPointType bounds[6]);
// Description:
// Get the origin of the plane.
- void SetOrigin(float x, float y, float z);
- void SetOrigin(float x[3]);
- float* GetOrigin();
- void GetOrigin(float xyz[3]);
+ void
+ SetOrigin(vtkFloatingPointType x,
+ vtkFloatingPointType y,
+ vtkFloatingPointType z);
+
+ void
+ SetOrigin(vtkFloatingPointType x[3]);
+
+ vtkFloatingPointType*
+ GetOrigin();
+
+ void
+ GetOrigin(vtkFloatingPointType xyz[3]);
// Description:
// Get the normal to the plane.
- void SetNormal(float x, float y, float z);
- void SetNormal(float x[3]);
- float* GetNormal();
- void GetNormal(float xyz[3]);
+ void
+ SetNormal(vtkFloatingPointType x,
+ vtkFloatingPointType y,
+ vtkFloatingPointType z);
+
+ void
+ SetNormal(vtkFloatingPointType x[3]);
+
+ vtkFloatingPointType*
+ GetNormal();
+
+ void
+ GetNormal(vtkFloatingPointType xyz[3]);
// Description:
// Force the plane widget to be aligned with one of the x-y-z axes.
// Remember that when the state changes, a ModifiedEvent is invoked.
// This can be used to snap the plane to the axes if it is orginally
// not aligned.
- void SetNormalToXAxis(int);
+ void
+ SetNormalToXAxis(int);
+
vtkGetMacro(NormalToXAxis,int);
vtkBooleanMacro(NormalToXAxis,int);
- void SetNormalToYAxis(int);
+
+ void
+ SetNormalToYAxis(int);
+
vtkGetMacro(NormalToYAxis,int);
vtkBooleanMacro(NormalToYAxis,int);
- void SetNormalToZAxis(int);
+
+ void
+ SetNormalToZAxis(int);
vtkGetMacro(NormalToZAxis,int);
vtkBooleanMacro(NormalToZAxis,int);
// interferes with the object that it is operating on (i.e., the
// plane interferes with the cut surface it produces producing
// z-buffer artifacts.)
- void SetDrawPlane(int plane);
- int GetDrawPlane(){
+ void
+ SetDrawPlane(int plane);
+
+ int
+ GetDrawPlane()
+ {
return myDrawPlane;
}
// Description:
// Grab the polydata that defines the plane. The polydata contains a single
// polygon that is clipped by the bounding box.
- void GetPolyData(vtkPolyData *pd);
+ void
+ GetPolyData(vtkPolyData *pd);
// Description:
// Satisfies superclass API. This returns a pointer to the underlying
// instance of the class vtkPlane. Note that vtkPlane is a subclass of
// vtkImplicitFunction, meaning that it can be used by a variety of filters
// to perform clipping, cutting, and selection of data.
- void GetPlane(vtkPlane *plane);
+ void
+ GetPlane(vtkPlane *plane);
// Description:
// Satisfies the superclass API. This will change the state of the widget
// to match changes that have been made to the underlying PolyDataSource
- void UpdatePlacement(void);
+ void
+ UpdatePlacement(void);
// Description:
// Get the properties on the normal (line and cone).
// applies to the edges when tubed.)
vtkGetObjectMacro(EdgesProperty,vtkProperty);
- void InitialPlaceWidget(float bds[6]);
+ void
+ InitialPlaceWidget(vtkFloatingPointType bds[6]);
protected:
VISU_PlanesWidget();
//ETX
//handles the events
- static void ProcessEvents(vtkObject* object, unsigned long event,
- void* clientdata, void* calldata);
+ static
+ void
+ ProcessEvents(vtkObject* object, unsigned long event,
+ void* clientdata, void* calldata);
// ProcessEvents() dispatches to these methods.
void OnLeftButtonDown();
void OnMouseMove();
//
// Methods to manipulate the plane
- void ConstrainOrigin(float x[3]);
+ void ConstrainOrigin(vtkFloatingPointType x[3]);
void Rotate(int X, int Y, double *p1, double *p2, double *vpn);
void TranslatePlane(double *p1, double *p2);
void TranslateOutline(double *p1, double *p2);
void HighlightNormal(int highlight);
void HighlightOutline(int highlight);
void UpdateRepresentation();
- void SetOriginInternal(float x[3]);
+ void SetOriginInternal(vtkFloatingPointType x[3]);
// Controlling ivars
int NormalToXAxis;
vtkPlane *myPlane1;
vtkPlane *myPlane2;
- float myDistance;
+ vtkFloatingPointType myDistance;
vtkImplicitBoolean *myImplicitFunction;
// The bounding box is represented by a single voxel image data
{
theDataSet->Update();
- float aBounds[6];
+ vtkFloatingPointType aBounds[6];
theDataSet->GetBounds(aBounds);
- float aDelta[3] = {aBounds[1] - aBounds[0], aBounds[3] - aBounds[2], aBounds[5] - aBounds[4]};
+ vtkFloatingPointType aDelta[3] = {aBounds[1] - aBounds[0], aBounds[3] - aBounds[2], aBounds[5] - aBounds[4]};
if(aDelta[0] >= aDelta[1] && aDelta[0] >= aDelta[2])
if(aDelta[1] >= aDelta[2])
return VISU_CutPlanesPL::XY;
}
-float
+vtkFloatingPointType
VISU_Plot3DPL::
GetScaleFactor(vtkDataSet* theDataSet)
{
theDataSet->Update();
- float aLength = theDataSet->GetLength(); // diagonal length
+ vtkFloatingPointType aLength = theDataSet->GetLength(); // diagonal length
- float aScalarRange[2];
+ vtkFloatingPointType aScalarRange[2];
GetSourceRange(aScalarRange);
- static float EPS = 0.3;
- float aRange = aScalarRange[1];
+ static vtkFloatingPointType EPS = 0.3;
+ vtkFloatingPointType aRange = aScalarRange[1];
if(aRange > 0.0)
return aLength / aRange * EPS;
VISU_Plot3DPL::
Update()
{
- float aPlaneNormal[3];
- float anOrigin[3];
+ vtkFloatingPointType aPlaneNormal[3];
+ vtkFloatingPointType anOrigin[3];
GetBasePlane( anOrigin, aPlaneNormal );
vtkPolyData* aPolyData = 0;
}else
myContourFilter->SetInput(aPolyData);
- float aScalarRange[2];
+ vtkFloatingPointType aScalarRange[2];
GetSourceRange(aScalarRange);
myContourFilter->GenerateValues(GetNumberOfContours(),aScalarRange);
void
VISU_Plot3DPL::
-SetScaleFactor(float theScaleFactor)
+SetScaleFactor(vtkFloatingPointType theScaleFactor)
{
myScaleFactor = theScaleFactor;
myWarpScalar->SetScaleFactor(theScaleFactor);
}
-float
+vtkFloatingPointType
VISU_Plot3DPL::
GetScaleFactor() const
{
void
VISU_Plot3DPL::
-SetPlanePosition(float thePosition,
+SetPlanePosition(vtkFloatingPointType thePosition,
bool theIsRelative)
{
myIsRelative = theIsRelative;
}
-float
+vtkFloatingPointType
VISU_Plot3DPL::
GetRotateX()
{
return 0;
}
-float
+vtkFloatingPointType
VISU_Plot3DPL::
GetRotateY(){
switch(myOrientation){
void
VISU_Plot3DPL::
SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation,
- float theXAngle,
- float theYAngle)
+ vtkFloatingPointType theXAngle,
+ vtkFloatingPointType theYAngle)
{
switch(theOrientation){
case VISU_CutPlanesPL::XY: myAngle[0] = theXAngle; break;
myOrientation = theOrientation;
}
-float
+vtkFloatingPointType
VISU_Plot3DPL::
GetPlanePosition() const
{
//purpose :
//=======================================================================
-void VISU_Plot3DPL::GetBasePlane(float theOrigin[3],
- float theNormal[3],
+void VISU_Plot3DPL::GetBasePlane(vtkFloatingPointType theOrigin[3],
+ vtkFloatingPointType theNormal[3],
bool theCenterOrigine ) const
{
VISU_CutPlanesPL::GetDir(theNormal,myAngle,myOrientation);
- float aPosition = myPosition;
- float aBounds[6], aBoundPrj[3];
+ vtkFloatingPointType aPosition = myPosition;
+ vtkFloatingPointType aBounds[6], aBoundPrj[3];
if ( myIsRelative )
{
GetInput()->GetBounds(aBounds);
if ( theCenterOrigine ) {
// move theOrigin to the center of aBounds projections to the plane
GetInput2()->GetBounds(aBounds);
- float boundPoints[8][3] = {
+ vtkFloatingPointType boundPoints[8][3] = {
{aBounds[0],aBounds[2],aBounds[4]},
{aBounds[1],aBounds[2],aBounds[4]},
{aBounds[0],aBounds[3],aBounds[4]},
{aBounds[1],aBounds[2],aBounds[5]},
{aBounds[0],aBounds[3],aBounds[5]},
{aBounds[1],aBounds[3],aBounds[5]}};
- float newOrigin[3] = { 0,0,0 };
+ vtkFloatingPointType newOrigin[3] = { 0,0,0 };
for(int i = 0; i < 8; i++) {
- float proj[3];
+ vtkFloatingPointType proj[3];
vtkPlane::ProjectPoint( boundPoints[i], theOrigin, theNormal, proj );
newOrigin[0] += proj[0];
newOrigin[1] += proj[1];
//purpose : return absolute position range
//=======================================================================
-void VISU_Plot3DPL::GetMinMaxPosition( float& minPos, float& maxPos ) const
+void VISU_Plot3DPL::GetMinMaxPosition( vtkFloatingPointType& minPos,
+ vtkFloatingPointType& maxPos ) const
{
- float aBounds[6], aBoundPrj[3], aNormal[3];
+ vtkFloatingPointType aBounds[6], aBoundPrj[3], aNormal[3];
VISU_CutPlanesPL::GetDir(aNormal,myAngle,myOrientation);
GetInput()->GetBounds(aBounds);
VISU_CutPlanesPL::GetBoundProject(aBoundPrj,aBounds,aNormal);
//purpose :
//=======================================================================
-void VISU_Plot3DPL::SetMapScale(float theMapScale)
+void VISU_Plot3DPL::SetMapScale(vtkFloatingPointType theMapScale)
{
VISU_ScalarMapPL::SetMapScale(theMapScale);
if ( myIsContour ) {
- float aRange[2];
+ vtkFloatingPointType aRange[2];
GetSourceRange(aRange);
- float aNewRange[] = { aRange[1] - theMapScale*(aRange[1]-aRange[0]), aRange[1] };
+ vtkFloatingPointType aNewRange[] = { aRange[1] - theMapScale*(aRange[1]-aRange[0]), aRange[1] };
myContourFilter->GenerateValues(GetNumberOfContours(),aNewRange);
}
myWarpScalar->SetScaleFactor(myScaleFactor*theMapScale);
VISU_CutPlanesPL::PlaneOrientation
GetPlaneOrientation() const;
- float
+ vtkFloatingPointType
GetRotateX();
- float
+ vtkFloatingPointType
GetRotateY();
void
SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation,
- float theXAngle = 0.0,
- float theYAngle = 0.0);
+ vtkFloatingPointType theXAngle = 0.0,
+ vtkFloatingPointType theYAngle = 0.0);
- float
+ vtkFloatingPointType
GetPlanePosition() const;
bool
IsPositionRelative() const;
void
- SetPlanePosition(float thePosition,
+ SetPlanePosition(vtkFloatingPointType thePosition,
bool theIsRelative);
void
- SetScaleFactor(float theScaleFactor);
+ SetScaleFactor(vtkFloatingPointType theScaleFactor);
- float
+ vtkFloatingPointType
GetScaleFactor() const;
void
int
GetNumberOfContours() const;
- void GetBasePlane (float theOrigin[3],
- float theNormal[3],
+ void GetBasePlane (vtkFloatingPointType theOrigin[3],
+ vtkFloatingPointType theNormal[3],
bool theCenterOrigine = false ) const;
- void GetMinMaxPosition( float& minPos, float& maxPos ) const;
+ void GetMinMaxPosition( vtkFloatingPointType& minPos,
+ vtkFloatingPointType& maxPos ) const;
public:
virtual void Init();
VISU_CutPlanesPL::PlaneOrientation
GetOrientation(vtkDataSet* theDataSet);
- float
+ vtkFloatingPointType
GetScaleFactor(vtkDataSet* theDataSet);
- void SetMapScale(float theMapScale);
+ void SetMapScale(vtkFloatingPointType theMapScale);
protected:
virtual THook* DoHook();
- float myAngle[3];
+ vtkFloatingPointType myAngle[3];
bool myIsRelative, myIsContour;
- float myPosition, myScaleFactor;
+ vtkFloatingPointType myPosition, myScaleFactor;
VISU_CutPlanesPL::PlaneOrientation myOrientation;
TVTKSmartPtr<vtkCellDataToPointData> myCellDataToPointData;
// we hard code how many steps to display
int numColors = this->MaximumNumberOfColors;
- float *range = lut->GetRange();
+ vtkFloatingPointType *range = lut->GetRange();
int numPts = 2*(numColors + 1);
vtkPoints *pts = vtkPoints::New();
this->NumberOfLabelsBuilt = this->NumberOfLabels;
// generate points
- float x[3]; x[2] = 0.0;
- float delta, val;
+ vtkFloatingPointType x[3]; x[2] = 0.0;
+ vtkFloatingPointType delta, val;
if ( this->Orientation == VTK_ORIENT_VERTICAL )
{
barWidth = size[0] - 4 - labelSize[0];
barHeight = (int)(0.86*size[1]);
- delta=(float)barHeight/numColors;
+ delta=(vtkFloatingPointType)barHeight/numColors;
for (i=0; i<numPts/2; i++)
{
x[0] = 0;
{
barWidth = size[0];
barHeight = (int)(0.4*size[1]);
- delta=(float)barWidth/numColors;
+ delta=(vtkFloatingPointType)barWidth/numColors;
for (i=0; i<numPts/2; i++)
{
x[0] = i*delta;
polys->InsertNextCell(4,ptIds);
if ( isLogTable ){ //SALOME specific
- float rgbval = log10(range[0]) +
+ vtkFloatingPointType rgbval = log10(range[0]) +
i*(log10(range[1])-log10(range[0]))/(numColors -1);
rgba = lut->MapValue(rgbval);
}else{
rgba = lut->MapValue(range[0] + (range[1] - range[0])*
- ((float)i /(numColors-1.0)));
+ ((vtkFloatingPointType)i /(numColors-1.0)));
}
rgb = colors->GetPointer(3*i); //write into array directly
for (i=0; i < this->NumberOfLabels; i++)
{
- val = (float)i/(this->NumberOfLabels-1) *barHeight;
+ val = (vtkFloatingPointType)i/(this->NumberOfLabels-1) *barHeight;
this->TextMappers[i]->GetSize(viewport,sizeTextData);
this->TextMappers[i]->GetTextProperty()->SetJustificationToLeft();
this->TextActors[i]->SetPosition(barWidth+3,
for (i=0; i < this->NumberOfLabels; i++)
{
this->TextMappers[i]->GetTextProperty()->SetJustificationToCentered();
- val = (float)i/(this->NumberOfLabels-1) * barWidth;
+ val = (vtkFloatingPointType)i/(this->NumberOfLabels-1) * barWidth;
this->TextActors[i]->SetPosition(val, barHeight + 0.05*size[1]);
}
}
void VISU_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, int *size,
vtkViewport *viewport,
- float *range)
+ vtkFloatingPointType *range)
{
labelSize[0] = labelSize[1] = 0;
char string[512];
- float val;
+ vtkFloatingPointType val;
int i;
// TODO: this should be optimized, maybe by keeping a list of
this->TextMappers[i] = vtkTextMapper::New();
if(isLogTable && 0 < i && i < this->NumberOfLabels - 1){ // SALOME specific
- float lval = log10(range[0]) + (float)i/(this->NumberOfLabels-1) *
+ vtkFloatingPointType lval = log10(range[0]) + (vtkFloatingPointType)i/(this->NumberOfLabels-1) *
(log10(range[1])-log10(range[0]));
val = pow(10,lval);
}else{
- val = range[0] + (float)i/(this->NumberOfLabels-1) * (range[1]-range[0]);
+ val = range[0] + (vtkFloatingPointType)i/(this->NumberOfLabels-1) * (range[1]-range[0]);
}
sprintf(string, this->LabelFormat, val);
this->TextMappers[i]->SetInput(string);
vtkTextMapper **TextMappers;
virtual void AllocateAndSizeLabels(int *labelSize, int *size,
- vtkViewport *viewport, float *range);
+ vtkViewport *viewport, vtkFloatingPointType *range);
private:
vtkTextMapper *TitleMapper;
inline
void
MarkValueByColor(vtkLookupTable* theTable,
- float theValue,
+ vtkFloatingPointType theValue,
unsigned char* theColor)
{
vtkIdType anIndex = theTable->GetIndex(theValue);
unsigned char aRedPtr[3] = {255, 0, 0};
unsigned char aBluePtr[3] = {0, 0, 255};
- float aRange[2];
+ vtkFloatingPointType aRange[2];
theTable->GetTableRange(aRange);
vtkIdType aNbColors = theTable->GetNumberOfColors();
- float aDelta = (aRange[1]-aRange[0])/aNbColors;
- float aValue = aRange[0]+0.5*aDelta;
+ vtkFloatingPointType aDelta = (aRange[1]-aRange[0])/aNbColors;
+ vtkFloatingPointType aValue = aRange[0]+0.5*aDelta;
for(int i = 0; i < aNbColors; i++){
vtkIdType anIndex = theTable->GetIndex(aValue);
unsigned char* aTablePtr = theTable->GetPointer(anIndex);
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetRangeLocal(float *theRange)
+::SetRangeLocal(vtkFloatingPointType *theRange)
{
myLocalLookupTable->SetTableRange(theRange);
}
void
VISU_ScalarBarCtrl
-::SetRangeLocal(float theMin,
- float theMax)
+::SetRangeLocal(vtkFloatingPointType theMin,
+ vtkFloatingPointType theMax)
{
myLocalLookupTable->SetTableRange(theMin,theMax);
}
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetRangeGlobal(float *theRange)
+::SetRangeGlobal(vtkFloatingPointType *theRange)
{
myGlobalLookupTable->SetTableRange(theRange);
}
void
VISU_ScalarBarCtrl
-::SetRangeGlobal(float theMin,
- float theMax)
+::SetRangeGlobal(vtkFloatingPointType theMin,
+ vtkFloatingPointType theMax)
{
myGlobalLookupTable->SetTableRange(theMin,theMax);
}
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetWidth(float theWidth)
+::SetWidth(vtkFloatingPointType theWidth)
{
myGlobalScalarBar->SetWidth(theWidth);
myLocalScalarBar->SetWidth(theWidth);
}
-float
+vtkFloatingPointType
VISU_ScalarBarCtrl
::GetWidth() const
{
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetHeight(float theHeight)
+::SetHeight(vtkFloatingPointType theHeight)
{
myGlobalScalarBar->SetHeight(theHeight);
myLocalScalarBar->SetHeight(theHeight);
}
-float
+vtkFloatingPointType
VISU_ScalarBarCtrl
::GetHeight() const
{
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetPosition(const float* thePosition)
+::SetPosition(const vtkFloatingPointType* thePosition)
{
myPosition[0] = thePosition[0];
myPosition[1] = thePosition[1];
}
-const float*
+const vtkFloatingPointType*
VISU_ScalarBarCtrl::GetPosition() const
{
return myPosition;
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetSpacing(const float theSpacing)
+::SetSpacing(const vtkFloatingPointType theSpacing)
{
myDistance = theSpacing;
}
-float
+vtkFloatingPointType
VISU_ScalarBarCtrl
::GetSpacing() const
{
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetMarkValue(const float theValue)
+::SetMarkValue(const vtkFloatingPointType theValue)
{
myMarkedValue = theValue;
}
-float
+vtkFloatingPointType
VISU_ScalarBarCtrl
::GetMarkValue() const
{
}
}
if(myGlobalRangeIsDefined){
- float aLocalRange[2];
+ vtkFloatingPointType aLocalRange[2];
myLocalLookupTable->GetTableRange(aLocalRange);
MarkValueByColor(myGlobalLookupTable, aLocalRange[0], myBlack);
MarkValueByColor(myGlobalLookupTable, aLocalRange[1], myBlack);
vtkCoordinate * aCoordinate = theScalarBarActor->GetPositionCoordinate();
aCoordinate->SetCoordinateSystemToNormalizedViewport();
if(theScalarBarActor->GetOrientation() == VTK_ORIENT_VERTICAL){
- float aWidth = theScalarBarActor->GetWidth();
+ vtkFloatingPointType aWidth = theScalarBarActor->GetWidth();
aCoordinate->SetValue(myPosition[0]+theId*(aWidth+myDistance), myPosition[1]);
}else{
- float aHeight = theScalarBarActor->GetHeight();
+ vtkFloatingPointType aHeight = theScalarBarActor->GetHeight();
aCoordinate->SetValue(myPosition[0], myPosition[1]+theId*(aHeight+myDistance));
}
// Initialize Lookup Tables and Scalar Bars
{
public:
vtkTypeMacro(VISU_ScalarBarCtrl, vtkObject);
- static VISU_ScalarBarCtrl* New();
+ static
+ VISU_ScalarBarCtrl*
+ New();
enum EMode {eSimple, eGlobal, eLocal};
// Mode
- void SetMode(EMode theMode);
- EMode GetMode() const;
+ void
+ SetMode(EMode theMode);
+
+ EMode
+ GetMode() const;
// Ranges
- void SetRangeGlobal(float theMin,
- float theMax);
- void SetRangeGlobal(float *theRange);
+ void
+ SetRangeGlobal(vtkFloatingPointType theMin,
+ vtkFloatingPointType theMax);
+ void
+ SetRangeGlobal(vtkFloatingPointType *theRange);
- void SetGlobalRangeIsDefined(bool theIsDefined);
+ void
+ SetGlobalRangeIsDefined(bool theIsDefined);
- void SetRangeLocal(float theMin,
- float theMax);
- void SetRangeLocal(float *theRange);
+ void
+ SetRangeLocal(vtkFloatingPointType theMin,
+ vtkFloatingPointType theMax);
+ void
+ SetRangeLocal(vtkFloatingPointType *theRange);
// Selectors
- vtkScalarBarActor* GetLocalBar();
- vtkLookupTable* GetLocalTable();
+ vtkScalarBarActor*
+ GetLocalBar();
+
+ vtkLookupTable*
+ GetLocalTable();
- vtkScalarBarActor* GetGlobalBar();
- vtkLookupTable* GetGlobalTable();
+ vtkScalarBarActor*
+ GetGlobalBar();
+
+ vtkLookupTable*
+ GetGlobalTable();
//
// Renderer
- void AddToRender(vtkRenderer* theRenderer);
- void RemoveFromRender(vtkRenderer* theRenderer);
+ void
+ AddToRender(vtkRenderer* theRenderer);
+
+ void
+ RemoveFromRender(vtkRenderer* theRenderer);
//
// Visibility
- void SetVisibility(int theFlag);
- int GetVisibility() const;
- //
+ void
+ SetVisibility(int theFlag);
+
+ int
+ GetVisibility() const;
+
// Visibility
- void SetCtrlVisibility(int theFlag);
- int GetCtrlVisibility() const;
- //
+ void
+ SetCtrlVisibility(int theFlag);
+
+ int
+ GetCtrlVisibility() const;
+
// Build
void Update();
- //
+
// Position
- void SetWidth(const float theWidth);
- float GetWidth()const;
- void SetHeight(const float theHeight);
- float GetHeight()const;
- void SetPosition(const float* thePosition);
- const float* GetPosition()const;
+ void
+ SetWidth(const vtkFloatingPointType theWidth);
+
+ vtkFloatingPointType
+ GetWidth() const;
+
+ void
+ SetHeight(const vtkFloatingPointType theHeight);
+
+ vtkFloatingPointType
+ GetHeight() const;
+
+ void
+ SetPosition(const vtkFloatingPointType* thePosition);
+
+ const vtkFloatingPointType*
+ GetPosition() const;
//
// Spacing
- void SetSpacing(const float theSpacing);
- float GetSpacing()const;
+ void
+ SetSpacing(const vtkFloatingPointType theSpacing);
+
+ vtkFloatingPointType
+ GetSpacing() const;
//
// Rainbow/bicolor
- bool GetBicolor() const;
- void SetBicolor(const bool theBicolor);
+ bool
+ GetBicolor() const;
+
+ void
+ SetBicolor(const bool theBicolor);
//
// Misc
- void SetMarkValue (const float theValue);
- float GetMarkValue ()const;
- void SetIsMarked(const bool theFlag);
- bool GetIsMarked()const;
+ void
+ SetMarkValue(const vtkFloatingPointType theValue);
+
+ vtkFloatingPointType
+ GetMarkValue() const;
+
+ void
+ SetIsMarked(const bool theFlag);
+
+ bool
+ GetIsMarked()const;
//
protected:
VISU_ScalarBarCtrl();
- virtual ~VISU_ScalarBarCtrl();
+
+ virtual
+ ~VISU_ScalarBarCtrl();
- void UpdateForBicolor();
- void UpdateForColor();
- void UpdateMarkValue();
- void PrepareTables();
+ void
+ UpdateForBicolor();
+
+ void
+ UpdateForColor();
+
+ void
+ UpdateMarkValue();
+
+ void
+ PrepareTables();
- void PrepareTables(vtkScalarBarActor* theScalarBarActor,
- vtkLookupTable *theLookupTable,
- vtkIdType theId);
+ void
+ PrepareTables(vtkScalarBarActor* theScalarBarActor,
+ vtkLookupTable *theLookupTable,
+ vtkIdType theId);
protected:
EMode myMode;
bool myGlobalRangeIsDefined;
- float myDistance;
- float myPosition[2];
+ vtkFloatingPointType myDistance;
+ vtkFloatingPointType myPosition[2];
bool myBicolor;
int myCtrlVisibility;
unsigned char myGrey[3];
//
bool myMarked;
- float myMarkedValue;
+ vtkFloatingPointType myMarkedValue;
//
vtkScalarBarActor *myGlobalScalarBar;
vtkLookupTable *myGlobalLookupTable;
* Merge filter which unify the deformation and scalars
* \li myScalars is vtk shared pointer to vtkUnstructuredGrid - scalars data
*/
-VISU_ScalarMapOnDeformedShapePL::VISU_ScalarMapOnDeformedShapePL(){
+VISU_ScalarMapOnDeformedShapePL
+::VISU_ScalarMapOnDeformedShapePL()
+{
myDeformVectors = vtkWarpVector::New();
myMergeFilter = vtkMergeFilter::New();
myExtractorScalars = VISU_Extractor::New();
* Destructor.
* Delete all fields.
*/
-VISU_ScalarMapOnDeformedShapePL::~VISU_ScalarMapOnDeformedShapePL(){
+VISU_ScalarMapOnDeformedShapePL
+::~VISU_ScalarMapOnDeformedShapePL()
+{
myDeformVectors->UnRegisterAllOutputs();
myDeformVectors->Delete();
/*!
* Initial method
*/
-void VISU_ScalarMapOnDeformedShapePL::Init(){
-
+void
+VISU_ScalarMapOnDeformedShapePL
+::Init()
+{
if (GetScalars() == NULL) SetScalars(GetInput2());
Superclass::Init();
- float aScalarRange[2];
+ vtkFloatingPointType aScalarRange[2];
GetSourceRange(aScalarRange);
static double EPS = 1.0 / VTK_LARGE_FLOAT;
if(aScalarRange[1] > EPS)
* Build method
* Building of deformation and puts result to merge filter.
*/
-void VISU_ScalarMapOnDeformedShapePL::Build()
+void
+VISU_ScalarMapOnDeformedShapePL
+::Build()
{
// Set input for extractor
myExtractor->SetInput(GetInput2());
/*!
* Update method
*/
-void VISU_ScalarMapOnDeformedShapePL::Update(){
+void
+VISU_ScalarMapOnDeformedShapePL
+::Update()
+{
this->UpdateScalars();
- float aRange[2];
+ vtkFloatingPointType aRange[2];
GetSourceRange(aRange);
- float aScalarRange[2] = {aRange[0], aRange[1]};
+ vtkFloatingPointType aScalarRange[2] = {aRange[0], aRange[1]};
if(myBarTable->GetScale() == VTK_SCALE_LOG10)
VISU_LookupTable::ComputeLogRange(aRange,aScalarRange);
* Update scalars method.
* Put scalars to merge filter.
*/
-void VISU_ScalarMapOnDeformedShapePL::UpdateScalars(){
+void
+VISU_ScalarMapOnDeformedShapePL
+::UpdateScalars()
+{
if(myScalars->GetCellData()->GetVectors() != NULL ||
myScalars->GetPointData()->GetVectors() != NULL)
myMergeFilter->SetScalars(myExtractorScalars->GetOutput());
* Copy information about pipline.
* Copy scale and scalars.
*/
-void VISU_ScalarMapOnDeformedShapePL::ShallowCopy(VISU_PipeLine *thePipeLine){
+void
+VISU_ScalarMapOnDeformedShapePL
+::ShallowCopy(VISU_PipeLine *thePipeLine)
+{
VISU_ScalarMapOnDeformedShapePL *aPipeLine = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(thePipeLine);
if(aPipeLine){
SetScale(aPipeLine->GetScale());
SetScalars(aPipeLine->GetScalars());
- float aRange[2];
+ vtkFloatingPointType aRange[2];
aPipeLine->GetSourceRange(aRange);
SetScalarRange(aRange);
}
* Set scalars.
* Sets vtkDataSet with scalars values to VISU_Extractor filter for scalars extraction.
*/
-void VISU_ScalarMapOnDeformedShapePL::SetScalars(vtkDataSet *theScalars){
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetScalars(vtkDataSet *theScalars)
+{
myScalars = theScalars;
vtkUnstructuredGrid* aScalars = GetScalars();
myExtractorScalars->SetInput(aScalars);
/*!
* Get pointer to input scalars.
*/
-vtkUnstructuredGrid* VISU_ScalarMapOnDeformedShapePL::GetScalars(){
+vtkUnstructuredGrid*
+VISU_ScalarMapOnDeformedShapePL
+::GetScalars()
+{
return myScalars.GetPointer();
}
/*!
* Sets scale for deformed shape
*/
-void VISU_ScalarMapOnDeformedShapePL::SetScale(float theScale) {
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetScale(vtkFloatingPointType theScale)
+{
if(myScaleFactor == theScale) return;
myScaleFactor = theScale;
myDeformVectors->SetScaleFactor(myScaleFactor);
/*!
* Gets scale of deformed shape.
*/
-float VISU_ScalarMapOnDeformedShapePL::GetScale() {
- float aScale=myDeformVectors->GetScaleFactor();
+vtkFloatingPointType
+VISU_ScalarMapOnDeformedShapePL
+::GetScale()
+{
+ vtkFloatingPointType aScale=myDeformVectors->GetScaleFactor();
return aScale;
}
/*!
* Set scale factor of deformation.
*/
-void VISU_ScalarMapOnDeformedShapePL::SetMapScale(float theMapScale){
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetMapScale(vtkFloatingPointType theMapScale)
+{
myDeformVectors->SetScaleFactor(myScaleFactor*theMapScale);
Modified();
}
/*!
* Gets scalar mode.
*/
-int VISU_ScalarMapOnDeformedShapePL::GetScalarMode(){
+int
+VISU_ScalarMapOnDeformedShapePL
+::GetScalarMode()
+{
int aMode=myExtractorScalars->GetScalarMode();
return aMode;
}
/*!
* Sets scalar mode.
*/
-void VISU_ScalarMapOnDeformedShapePL::SetScalarMode(int theScalarMode){
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetScalarMode(int theScalarMode)
+{
myExtractorScalars->SetScalarMode(theScalarMode);
Modified();
}
* \li theRange[0] - minimum value
* \li theRange[1] - maximum value
*/
-void VISU_ScalarMapOnDeformedShapePL::GetSourceRange(float theRange[2]){
+void
+VISU_ScalarMapOnDeformedShapePL
+::GetSourceRange(vtkFloatingPointType theRange[2])
+{
myExtractorScalars->Update();
myExtractorScalars->GetUnstructuredGridOutput()->GetScalarRange(theRange);
}
virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
- virtual void SetScale(float theScale);
- virtual float GetScale();
+ virtual void SetScale(vtkFloatingPointType theScale);
+ virtual vtkFloatingPointType GetScale();
virtual int GetScalarMode();
virtual void SetScalarMode(int theScalarMode = 0);
- virtual void GetSourceRange(float theRange[2]);
+ virtual void GetSourceRange(vtkFloatingPointType theRange[2]);
virtual void SetScalars(vtkDataSet *theScalars);
virtual vtkUnstructuredGrid* GetScalars();
void
UpdateScalars();
- virtual void SetMapScale(float theMapScale = 1.0);
+ virtual void SetMapScale(vtkFloatingPointType theMapScale = 1.0);
protected:
- float myScaleFactor;
+ vtkFloatingPointType myScaleFactor;
vtkWarpVector *myDeformVectors;
vtkMergeFilter *myMergeFilter;
vtkSmartPointer<vtkUnstructuredGrid> myScalars;
//----------------------------------------------------------------------------
-float*
+vtkFloatingPointType*
VISU_ScalarMapPL
::GetScalarRange()
{
void
VISU_ScalarMapPL
-::SetScalarRange(float theRange[2])
+::SetScalarRange(vtkFloatingPointType theRange[2])
{
myFieldTransform->SetScalarRange(theRange);
myBarTable->SetRange(theRange);
void
VISU_ScalarMapPL
-::SetScalarMin(float theValue)
+::SetScalarMin(vtkFloatingPointType theValue)
{
- float aScalarRange[2] = {theValue, GetScalarRange()[1]};
+ vtkFloatingPointType aScalarRange[2] = {theValue, GetScalarRange()[1]};
SetScalarRange(aScalarRange);
}
void
VISU_ScalarMapPL
-::SetScalarMax(float theValue)
+::SetScalarMax(vtkFloatingPointType theValue)
{
- float aScalarRange[2] = {GetScalarRange()[0], theValue};
+ vtkFloatingPointType aScalarRange[2] = {GetScalarRange()[0], theValue};
SetScalarRange(aScalarRange);
}
VISU_ScalarMapPL
::Update()
{
- float *aRange = myFieldTransform->GetScalarRange();
- float aScalarRange[2] = {aRange[0], aRange[1]};
+ vtkFloatingPointType *aRange = myFieldTransform->GetScalarRange();
+ vtkFloatingPointType aScalarRange[2] = {aRange[0], aRange[1]};
if(myBarTable->GetScale() == VTK_SCALE_LOG10)
VISU_LookupTable::ComputeLogRange(aRange,aScalarRange);
myMapperTable->SetRange(aScalarRange);
//----------------------------------------------------------------------------
void
VISU_ScalarMapPL
-::SetMapScale(float theMapScale)
+::SetMapScale(vtkFloatingPointType theMapScale)
{
myMapperTable->SetMapScale(theMapScale);
myMapperTable->Build();
}
-float
+vtkFloatingPointType
VISU_ScalarMapPL::GetMapScale()
{
return myMapperTable->GetMapScale();
//----------------------------------------------------------------------------
void
VISU_ScalarMapPL
-::GetSourceRange(float theRange[2])
+::GetSourceRange(vtkFloatingPointType theRange[2])
{
myExtractor->Update();
myExtractor->GetOutput()->GetScalarRange(theRange);
VISU_ScalarMapPL
::SetSourceRange()
{
- float aRange[2];
+ vtkFloatingPointType aRange[2];
GetSourceRange(aRange);
SetScalarRange(aRange);
}
SetScaling(int theScaling = VTK_SCALE_LINEAR);
virtual
- float*
+ vtkFloatingPointType*
GetScalarRange();
virtual
void
- SetScalarRange(float theRange[2]);
+ SetScalarRange(vtkFloatingPointType theRange[2]);
virtual
void
- SetScalarMin(float theValue);
+ SetScalarMin(vtkFloatingPointType theValue);
virtual
void
- SetScalarMax(float theValue);
+ SetScalarMax(vtkFloatingPointType theValue);
virtual
void
virtual
void
- SetMapScale(float theMapScale = 1.0);
+ SetMapScale(vtkFloatingPointType theMapScale = 1.0);
virtual
- float
+ vtkFloatingPointType
GetMapScale();
virtual
void
- GetSourceRange(float theRange[2]);
+ GetSourceRange(vtkFloatingPointType theRange[2]);
virtual
void
mySphereActor->SetMapper(mySphereMapper);
//
// Define the point coordinates
- float bounds[6];
+ vtkFloatingPointType bounds[6];
for(int i = 0; i < 6; i += 2){
bounds[i]=-.5;
bounds[i+1]=-bounds[i];
// function: SetRadius
// purpose :
//====================================================================
-void VISU_SphereWidget::SetRadius(float theRadius)
+void VISU_SphereWidget::SetRadius(vtkFloatingPointType theRadius)
{
if ( theRadius <= myRmin ) {
theRadius = myRmin;
// function: GetRadius
// purpose :
//====================================================================
-float VISU_SphereWidget::GetRadius()
+vtkFloatingPointType VISU_SphereWidget::GetRadius()
{
return mySphereSource->GetRadius();
}
// function: SetCenter
// purpose :
//====================================================================
-void VISU_SphereWidget::SetCenter(float theCenter[3])
+void VISU_SphereWidget::SetCenter(vtkFloatingPointType theCenter[3])
{
mySphereSource->SetCenter(theCenter);
mySphere->SetCenter(theCenter);
// function: SetCenter
// purpose :
//====================================================================
-void VISU_SphereWidget::SetCenter(float theX, float theY, float theZ)
+void VISU_SphereWidget::SetCenter(vtkFloatingPointType theX, vtkFloatingPointType theY, vtkFloatingPointType theZ)
{
- float aCenter[3] = {theX, theY, theZ};
+ vtkFloatingPointType aCenter[3] = {theX, theY, theZ};
SetCenter(aCenter);
}
// function: GetCenter
// purpose :
//====================================================================
-float* VISU_SphereWidget::GetCenter()
+vtkFloatingPointType* VISU_SphereWidget::GetCenter()
{
return mySphereSource->GetCenter();
}
// function: GetCenter
// purpose :
//====================================================================
-void VISU_SphereWidget::GetCenter(float theCenter[3])
+void VISU_SphereWidget::GetCenter(vtkFloatingPointType theCenter[3])
{
mySphereSource->GetCenter(theCenter);
}
//====================================================================
void VISU_SphereWidget::Translate(double *p1, double *p2)
{
- float v[3], aC[3], aC1[3];
+ vtkFloatingPointType v[3], aC[3], aC1[3];
//
v[0] = p2[0] - p1[0];
v[1] = p2[1] - p1[1];
v[1] = p2[1] - p1[1];
v[2] = p2[2] - p1[2];
//
- float aC[3], aR, sf, aR1;
+ vtkFloatingPointType aC[3], aR, sf, aR1;
aR=mySphereSource->GetRadius();
mySphereSource->GetCenter(aC);
sf=vtkMath::Norm(v)/aR;
// function:PlaceWidget
// purpose:
//====================================================================
-void VISU_SphereWidget::PlaceWidget(float bds[6])
+void VISU_SphereWidget::PlaceWidget(vtkFloatingPointType bds[6])
{
- float bounds[6], center[3], radius;
+ vtkFloatingPointType bounds[6], center[3], radius;
this->AdjustBounds(bds, bounds, center);
- float dX, dY, dZ;
+ vtkFloatingPointType dX, dY, dZ;
//
dX=bounds[1]-bounds[0];
dY=bounds[3]-bounds[2];
(bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
(bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
- static float EPS = 1.0E-1;
+ static vtkFloatingPointType EPS = 1.0E-1;
myRmin = EPS*InitialLength;
}
virtual void SetEnabled(int);
//
//PlaceWidget
- virtual void PlaceWidget(float bounds[6]);
+ virtual void PlaceWidget(vtkFloatingPointType bounds[6]);
//
// Description:
// Set/Get the resolution of the sphere in the Theta direction.
// Description:
// Set/Get the radius of sphere. Default is .5.
- void SetRadius(float r);
- float GetRadius();
+ void SetRadius(vtkFloatingPointType r);
+ vtkFloatingPointType GetRadius();
// Description:
// Set/Get the center of the sphere.
- void SetCenter(float x, float y, float z);
- void SetCenter(float x[3]);
+ void SetCenter(vtkFloatingPointType x,
+ vtkFloatingPointType y,
+ vtkFloatingPointType z);
+ void SetCenter(vtkFloatingPointType x[3]);
- float* GetCenter();
- void GetCenter(float xyz[3]);
+ vtkFloatingPointType* GetCenter();
+ void GetCenter(vtkFloatingPointType xyz[3]);
// Description:
// Set the ratio of the radius changing.
- void SetRatio(float r) { myRatio = r; }
- float GetRatio() { return myRatio; }
+ void SetRatio(vtkFloatingPointType r) { myRatio = r; }
+ vtkFloatingPointType GetRatio() { return myRatio; }
void ChangeRadius(bool up);
// the manipulator in general.
vtkProperty *mySphereProperty;
vtkProperty *mySelectedSphereProperty;
- float myRmin;
+ vtkFloatingPointType myRmin;
vtkSphere *mySphere;
vtkImplicitSum* myImplicitSum;
- float myRatio;
+ vtkFloatingPointType myRatio;
private:
VISU_SphereWidget(const VISU_SphereWidget&); //Not implemented
void operator=(const VISU_SphereWidget&); //Not implemented
static int MYDEBUG = 0;
#endif
-static float EPS = 1.0e-7;
-static float aMinNbOfSteps = 1.0E+2;
-//static float aMaxNbOfSteps = 1.0E+3;
-static float aCoeffOfIntStep = 1.0E+1;
+static vtkFloatingPointType EPS = 1.0e-7;
+static vtkFloatingPointType aMinNbOfSteps = 1.0E+2;
+//static vtkFloatingPointType aMaxNbOfSteps = 1.0E+3;
+static vtkFloatingPointType aCoeffOfIntStep = 1.0E+1;
vtkStandardNewMacro(VISU_StreamLinesPL);
}
-float VISU_StreamLinesPL::GetNecasseryMemorySize(vtkIdType theNbOfPoints, float theStepLength,
- float thePropogationTime, float thePercents)
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetNecasseryMemorySize(vtkIdType theNbOfPoints,
+ vtkFloatingPointType theStepLength,
+ vtkFloatingPointType thePropogationTime,
+ vtkFloatingPointType thePercents)
{
- static float aStreamPointSize = sizeof(float)*15 + sizeof(vtkIdType)*2;
- static float aStreamArraySize = aStreamPointSize*1024; // == 69632
+ static vtkFloatingPointType aStreamPointSize = sizeof(vtkFloatingPointType)*15 + sizeof(vtkIdType)*2;
+ static vtkFloatingPointType aStreamArraySize = aStreamPointSize*1024; // == 69632
- float aNbCells = thePercents*theNbOfPoints*2.0;
- float aNbPointsPerCell = thePropogationTime/theStepLength;
- float aCellsSize = aNbCells*(1+aNbPointsPerCell);
- float aPointsSize = aCellsSize*3.0*sizeof(float);
+ vtkFloatingPointType aNbCells = thePercents*theNbOfPoints*2.0;
+ vtkFloatingPointType aNbPointsPerCell = thePropogationTime/theStepLength;
+ vtkFloatingPointType aCellsSize = aNbCells*(1+aNbPointsPerCell);
+ vtkFloatingPointType aPointsSize = aCellsSize*3.0*sizeof(vtkFloatingPointType);
- float aConnectivitySize = aCellsSize*sizeof(vtkIdType);
- float aTypesSize = aNbCells*sizeof(char);
- float aLocationsSize = aNbCells*sizeof(int);
- //float aNbCellsPerPoint = aCellsSize / aNbCells - 1;
- float aMeshSize = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize;
+ vtkFloatingPointType aConnectivitySize = aCellsSize*sizeof(vtkIdType);
+ vtkFloatingPointType aTypesSize = aNbCells*sizeof(char);
+ vtkFloatingPointType aLocationsSize = aNbCells*sizeof(int);
+ //vtkFloatingPointType aNbCellsPerPoint = aCellsSize / aNbCells - 1;
+ vtkFloatingPointType aMeshSize = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize;
- float anAssignedDataSize = aCellsSize*4.0*sizeof(float);
- float anOutputDataSetSize = aMeshSize + anAssignedDataSize;
+ vtkFloatingPointType anAssignedDataSize = aCellsSize*4.0*sizeof(vtkFloatingPointType);
+ vtkFloatingPointType anOutputDataSetSize = aMeshSize + anAssignedDataSize;
- float aResult = aStreamArraySize*aNbCells + anOutputDataSetSize;
+ vtkFloatingPointType aResult = aStreamArraySize*aNbCells + anOutputDataSetSize;
return aResult;
}
-int VISU_StreamLinesPL::FindPossibleParams(vtkPointSet* theDataSet, float& theStepLength,
- float& thePropogationTime, float& thePercents)
+int
+VISU_StreamLinesPL
+::FindPossibleParams(vtkPointSet* theDataSet,
+ vtkFloatingPointType& theStepLength,
+ vtkFloatingPointType& thePropogationTime,
+ vtkFloatingPointType& thePercents)
{
- static float aPercentsDecrease = 3.0, aStepLengthIncrease = 9.0;
+ static vtkFloatingPointType aPercentsDecrease = 3.0, aStepLengthIncrease = 9.0;
vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints();
- float aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents);
+ vtkFloatingPointType aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents);
int isPoss = CheckAvailableMemory(aSize);
if(!isPoss){
- float aMaxStepLength = max(GetMaxStepLength(theDataSet),thePropogationTime);
- float aMinStepLength = GetMinStepLength(theDataSet);
- float aDeltaStepLength = (aMaxStepLength - aMinStepLength)/aStepLengthIncrease;
+ vtkFloatingPointType aMaxStepLength = max(GetMaxStepLength(theDataSet),thePropogationTime);
+ vtkFloatingPointType aMinStepLength = GetMinStepLength(theDataSet);
+ vtkFloatingPointType aDeltaStepLength = (aMaxStepLength - aMinStepLength)/aStepLengthIncrease;
for(int i = 2, aStepChanged = 1, aPerecentsChanged = 1; aStepChanged || aPerecentsChanged; i++){
- float aStepLength = theStepLength + aDeltaStepLength;
+ vtkFloatingPointType aStepLength = theStepLength + aDeltaStepLength;
if(aStepLength < aMaxStepLength) theStepLength = aStepLength;
else if(aStepChanged){
aStepLength = aMaxStepLength;
aStepChanged = 0;
}
- float aPercents = thePercents /= aPercentsDecrease;
+ vtkFloatingPointType aPercents = thePercents /= aPercentsDecrease;
if(aPercents*aNbOfPoints > 1) thePercents = aPercents;
else if(aPerecentsChanged) {
thePercents = 1.1 / aNbOfPoints;
}
-int VISU_StreamLinesPL::SetParams(float theIntStep,
- float thePropogationTime,
- float theStepLength,
- vtkPointSet* theSource,
- float thePercents,
- int theDirection,
- int isOnlyTry)
+int
+VISU_StreamLinesPL
+::SetParams(vtkFloatingPointType theIntStep,
+ vtkFloatingPointType thePropogationTime,
+ vtkFloatingPointType theStepLength,
+ vtkPointSet* theSource,
+ vtkFloatingPointType thePercents,
+ int theDirection,
+ int isOnlyTry)
{
vtkPointSet* aDataSet = theSource? theSource: myFieldTransform->GetUnstructuredGridOutput();
aDataSet->Update();
}
-vtkPointSet* VISU_StreamLinesPL::GetSource() {
+vtkPointSet*
+VISU_StreamLinesPL
+::GetSource()
+{
return mySource;
}
-float VISU_StreamLinesPL::GetUsedPoints() {
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetUsedPoints()
+{
return myPercents;
}
-vtkDataSet* VISU_StreamLinesPL::GetStreamerSource(){
+vtkDataSet*
+VISU_StreamLinesPL
+::GetStreamerSource()
+{
return myStream->GetSource();
}
-float VISU_StreamLinesPL::GetVelocityCoeff(){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetVelocityCoeff()
+{
return GetVelocityCoeff(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::GetVelocityCoeff(vtkPointSet* theDataSet){
- float* aScalarRange = theDataSet->GetScalarRange();
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetVelocityCoeff(vtkPointSet* theDataSet)
+{
+ vtkFloatingPointType* aScalarRange = theDataSet->GetScalarRange();
return (fabs(aScalarRange[1]) + fabs(aScalarRange[0]))/2.0;
}
-int VISU_StreamLinesPL::IsPossible(vtkPointSet* theDataSet, float thePercents){
- float aStepLength = GetBaseStepLength(theDataSet);
- float aBasePropTime = GetBasePropagationTime(theDataSet);
+int
+VISU_StreamLinesPL
+::IsPossible(vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents)
+{
+ vtkFloatingPointType aStepLength = GetBaseStepLength(theDataSet);
+ vtkFloatingPointType aBasePropTime = GetBasePropagationTime(theDataSet);
VISU_UsedPointsFilter *aPointsFilter = VISU_UsedPointsFilter::New();
aPointsFilter->SetInput(theDataSet);
vtkPointSet* aDataSet = aPointsFilter->GetOutput();
}
-float VISU_StreamLinesPL::GetIntegrationStep(){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetIntegrationStep()
+{
return myStream->GetIntegrationStepLength();
}
-float VISU_StreamLinesPL::GetStepLength() {
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetStepLength()
+{
return myStream->GetStepLength();
}
-float VISU_StreamLinesPL::GetPropagationTime() {
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetPropagationTime()
+{
return myStream->GetMaximumPropagationTime();
}
-int VISU_StreamLinesPL::GetDirection(){
+
+int
+VISU_StreamLinesPL
+::GetDirection()
+{
return myStream->GetIntegrationDirection();
}
-float VISU_StreamLinesPL::GetMinIntegrationStep(vtkPointSet* theDataSet, float thePercents) {
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinIntegrationStep(vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents)
+{
if(!theDataSet) return -1.0;
- float aVolume = 1.0;
+ vtkFloatingPointType aVolume = 1.0;
int degree = 0;
theDataSet->Update();
- float* aBounds = theDataSet->GetBounds();
+ vtkFloatingPointType* aBounds = theDataSet->GetBounds();
for(int i = 0, j = 0; i < 3; ++i, j = 2*i){
- float tmp = aBounds[j+1] - aBounds[j];
+ vtkFloatingPointType tmp = aBounds[j+1] - aBounds[j];
if (tmp > EPS ) {
aVolume *= tmp;
degree += 1;
}
}
if (degree < 1) return 0.0; // absolutely empty object
- float anStepLength = GetMaxIntegrationStep(theDataSet)/aCoeffOfIntStep;
- float aBasePropTime = GetBasePropagationTime(theDataSet)/GetVelocityCoeff(theDataSet);
+ vtkFloatingPointType anStepLength = GetMaxIntegrationStep(theDataSet)/aCoeffOfIntStep;
+ vtkFloatingPointType aBasePropTime = GetBasePropagationTime(theDataSet)/GetVelocityCoeff(theDataSet);
thePercents = 1.0;
vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints();
- float aSize = GetNecasseryMemorySize(aNbOfPoints,anStepLength,aBasePropTime,thePercents);
- float aRealSize = GetAvailableMemory(aSize);
- float anAverageVolume = aVolume / aRealSize;
- float aStep = pow(double(anAverageVolume), double(1.0/double(degree)));
+ vtkFloatingPointType aSize = GetNecasseryMemorySize(aNbOfPoints,anStepLength,aBasePropTime,thePercents);
+ vtkFloatingPointType aRealSize = GetAvailableMemory(aSize);
+ vtkFloatingPointType anAverageVolume = aVolume / aRealSize;
+ vtkFloatingPointType aStep = pow(double(anAverageVolume), double(1.0/double(degree)));
return aStep;
}
-float VISU_StreamLinesPL::GetMinIntegrationStep(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinIntegrationStep()
+{
return GetMinIntegrationStep(myExtractor->GetOutput(),GetUsedPoints());
}
-float VISU_StreamLinesPL::GetMaxIntegrationStep(vtkPointSet* theDataSet) {
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMaxIntegrationStep(vtkPointSet* theDataSet)
+{
if(!theDataSet) return -1.0;
theDataSet->Update();
- float aLength = theDataSet->GetLength();
- float* aBounds = theDataSet->GetBounds();
- float aMaxSizeY = (aBounds[3]-aBounds[2])/aLength;
- float aMaxSizeZ = (aBounds[5]-aBounds[4])/aLength;
- float aMinMax = (aBounds[1] - aBounds[0])/aLength;
+ vtkFloatingPointType aLength = theDataSet->GetLength();
+ vtkFloatingPointType* aBounds = theDataSet->GetBounds();
+ vtkFloatingPointType aMaxSizeY = (aBounds[3]-aBounds[2])/aLength;
+ vtkFloatingPointType aMaxSizeZ = (aBounds[5]-aBounds[4])/aLength;
+ vtkFloatingPointType aMinMax = (aBounds[1] - aBounds[0])/aLength;
if (aMinMax < EPS || (aMaxSizeY < aMinMax && aMaxSizeY > EPS)) aMinMax = aMaxSizeY;
if (aMinMax < EPS || (aMaxSizeZ < aMinMax && aMaxSizeZ > EPS)) aMinMax = aMaxSizeZ;
return aMinMax*aLength/2.0;
}
-float VISU_StreamLinesPL::GetMaxIntegrationStep(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMaxIntegrationStep()
+{
return GetMaxIntegrationStep(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::GetBaseIntegrationStep(vtkPointSet* theDataSet, float thePercents){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetBaseIntegrationStep(vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents)
+{
theDataSet->Update();
- float aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents);
- float aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet);
- float anIntegrationStep = aMaxIntegrationStep / aCoeffOfIntStep;
- float aMinMax = theDataSet->GetLength()/theDataSet->GetNumberOfPoints();
+ vtkFloatingPointType aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents);
+ vtkFloatingPointType aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet);
+ vtkFloatingPointType anIntegrationStep = aMaxIntegrationStep / aCoeffOfIntStep;
+ vtkFloatingPointType aMinMax = theDataSet->GetLength()/theDataSet->GetNumberOfPoints();
if(aMinMax > anIntegrationStep)
anIntegrationStep = (anIntegrationStep*aCoeffOfIntStep*0.9+aMinMax)/aCoeffOfIntStep;
if(aMinIntegrationStep > anIntegrationStep)
return anIntegrationStep;
}
-float VISU_StreamLinesPL::CorrectIntegrationStep(float theStep, vtkPointSet* theDataSet, float thePercents){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::CorrectIntegrationStep(vtkFloatingPointType theStep,
+ vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents)
+{
theDataSet->Update();
- float aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents);
- float aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet);
+ vtkFloatingPointType aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents);
+ vtkFloatingPointType aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet);
if(aMinIntegrationStep > theStep)
theStep = aMinIntegrationStep;
if(aMaxIntegrationStep < theStep)
}
-float VISU_StreamLinesPL::GetMinPropagationTime(vtkPointSet* theDataSet){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinPropagationTime(vtkPointSet* theDataSet)
+{
if(!theDataSet) return -1.0;
return GetMinStepLength(theDataSet);
}
-float VISU_StreamLinesPL::GetMinPropagationTime(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinPropagationTime()
+{
return GetMinPropagationTime(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::GetMaxPropagationTime(vtkPointSet* theDataSet){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMaxPropagationTime(vtkPointSet* theDataSet)
+{
if(!theDataSet) return -1.0;
return GetBasePropagationTime(theDataSet)*aMinNbOfSteps;
}
-float VISU_StreamLinesPL::GetMaxPropagationTime(){
+
+vtkFloatingPointType VISU_StreamLinesPL::GetMaxPropagationTime(){
return GetMaxPropagationTime(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::CorrectPropagationTime(float thePropagationTime, vtkPointSet* theDataSet){
- float aMinPropagationTime = GetMinPropagationTime(theDataSet);
- float aMaxPropagationTime = GetMaxPropagationTime(theDataSet);
+vtkFloatingPointType
+VISU_StreamLinesPL
+::CorrectPropagationTime(vtkFloatingPointType thePropagationTime,
+ vtkPointSet* theDataSet)
+{
+ vtkFloatingPointType aMinPropagationTime = GetMinPropagationTime(theDataSet);
+ vtkFloatingPointType aMaxPropagationTime = GetMaxPropagationTime(theDataSet);
if(aMinPropagationTime > thePropagationTime)
thePropagationTime = aMinPropagationTime;
if(aMaxPropagationTime < thePropagationTime)
thePropagationTime = aMaxPropagationTime;
return thePropagationTime;
}
-float VISU_StreamLinesPL::GetBasePropagationTime(vtkPointSet* theDataSet){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetBasePropagationTime(vtkPointSet* theDataSet)
+{
if(!theDataSet) return -1.0;
theDataSet->Update();
- float aPropagationTime = theDataSet->GetLength()/GetVelocityCoeff(theDataSet);
+ vtkFloatingPointType aPropagationTime = theDataSet->GetLength()/GetVelocityCoeff(theDataSet);
return aPropagationTime;
}
-float VISU_StreamLinesPL::GetBasePropagationTime(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetBasePropagationTime()
+{
return GetBasePropagationTime(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::GetMinStepLength(vtkPointSet* theDataSet){
- static float aNbOfStepsOfIntStep = 1.0E+1;
- float anIntStep = GetMinIntegrationStep(theDataSet);
- float aStepLength = anIntStep*aNbOfStepsOfIntStep/GetVelocityCoeff(theDataSet);
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinStepLength(vtkPointSet* theDataSet)
+{
+ static vtkFloatingPointType aNbOfStepsOfIntStep = 1.0E+1;
+ vtkFloatingPointType anIntStep = GetMinIntegrationStep(theDataSet);
+ vtkFloatingPointType aStepLength = anIntStep*aNbOfStepsOfIntStep/GetVelocityCoeff(theDataSet);
return aStepLength;
}
-float VISU_StreamLinesPL::GetMinStepLength(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinStepLength()
+{
return GetMinStepLength(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::GetMaxStepLength(vtkPointSet* theDataSet){
- float aStepLength = GetBasePropagationTime(theDataSet);
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMaxStepLength(vtkPointSet* theDataSet)
+{
+ vtkFloatingPointType aStepLength = GetBasePropagationTime(theDataSet);
return aStepLength;
}
-float VISU_StreamLinesPL::GetMaxStepLength(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMaxStepLength()
+{
return GetMaxStepLength(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::CorrectStepLength(float theStep, vtkPointSet* theDataSet){
- float aMinStep = GetMinStepLength(theDataSet);
+vtkFloatingPointType
+VISU_StreamLinesPL
+::CorrectStepLength(vtkFloatingPointType theStep,
+ vtkPointSet* theDataSet)
+{
+ vtkFloatingPointType aMinStep = GetMinStepLength(theDataSet);
if(theStep < aMinStep) theStep = aMinStep;
- float aMaxStep = GetMaxStepLength(theDataSet);
+ vtkFloatingPointType aMaxStep = GetMaxStepLength(theDataSet);
if(theStep > aMaxStep) theStep = aMaxStep;
return theStep;
}
-float VISU_StreamLinesPL::GetBaseStepLength(vtkPointSet* theDataSet){
- static float anAvgNbOfSteps = 1.0E+2;
- float aPropagationTime = GetBasePropagationTime(theDataSet);
- float aStepLength = aPropagationTime/anAvgNbOfSteps;
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetBaseStepLength(vtkPointSet* theDataSet)
+{
+ static vtkFloatingPointType anAvgNbOfSteps = 1.0E+2;
+ vtkFloatingPointType aPropagationTime = GetBasePropagationTime(theDataSet);
+ vtkFloatingPointType aStepLength = aPropagationTime/anAvgNbOfSteps;
aStepLength = CorrectStepLength(aStepLength,theDataSet);
return aStepLength;
}
-void VISU_StreamLinesPL::Init(){
+void
+VISU_StreamLinesPL
+::Init()
+{
VISU_ScalarMapPL::Init();
vtkPointSet* aDataSet = myExtractor->GetOutput();
- float anIntStep = GetBaseIntegrationStep(aDataSet);
- float aPropagationTime = GetBasePropagationTime(aDataSet);
- float aStepLength = GetBaseStepLength(aDataSet);
+ vtkFloatingPointType anIntStep = GetBaseIntegrationStep(aDataSet);
+ vtkFloatingPointType aPropagationTime = GetBasePropagationTime(aDataSet);
+ vtkFloatingPointType aStepLength = GetBaseStepLength(aDataSet);
SetParams(anIntStep,aPropagationTime,aStepLength);
}
-VISU_ScalarMapPL::THook* VISU_StreamLinesPL::DoHook(){
+VISU_ScalarMapPL::THook*
+VISU_StreamLinesPL
+::DoHook()
+{
GetInput2()->Update();
VISU::CellDataToPoint(myStream,myCellDataToPointData,GetInput2(),myFieldTransform);
- float *aBounds = GetInput2()->GetBounds();
+ vtkFloatingPointType *aBounds = GetInput2()->GetBounds();
myGeomFilter->SetExtent(aBounds);
myGeomFilter->ExtentClippingOn();
myGeomFilter->SetInput(myStream->GetOutput());
return myGeomFilter->GetOutput();
}
-void VISU_StreamLinesPL::Update(){
+void
+VISU_StreamLinesPL
+::Update()
+{
VISU_ScalarMapPL::Update();
}
-void VISU_StreamLinesPL::SetMapScale(float theMapScale){
+void
+VISU_StreamLinesPL
+::SetMapScale(vtkFloatingPointType theMapScale)
+{
VISU_ScalarMapPL::SetMapScale(theMapScale);
}
class VTKViewer_GeometryFilter;
class VISU_UsedPointsFilter;
-class VISU_StreamLinesPL : public VISU_DeformedShapePL{
+class VISU_StreamLinesPL : public VISU_DeformedShapePL
+{
protected:
VISU_StreamLinesPL();
VISU_StreamLinesPL(const VISU_StreamLinesPL&);
+
+ virtual
+ ~VISU_StreamLinesPL();
+
public:
vtkTypeMacro(VISU_StreamLinesPL,VISU_DeformedShapePL);
- static VISU_StreamLinesPL* New();
- virtual ~VISU_StreamLinesPL();
- virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
-
- virtual int SetParams(float theIntStep,
- float thePropogationTime,
- float theStepLength,
- vtkPointSet* theSource = NULL,
- float thePercents = 0.3,
- int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS,
- int isOnlyTry = false);
- virtual vtkPointSet* GetSource();
- virtual float GetUsedPoints();
- virtual float GetIntegrationStep();
- virtual float GetPropagationTime();
- virtual float GetStepLength();
- virtual int GetDirection();
-
- virtual vtkDataSet* GetStreamerSource();
- virtual float GetVelocityCoeff();
-
- virtual float GetMaxIntegrationStep();
- virtual float GetMinIntegrationStep();
-
- virtual float GetMinStepLength();
- virtual float GetMaxStepLength();
-
- virtual float GetMinPropagationTime();
- virtual float GetMaxPropagationTime();
- virtual float GetBasePropagationTime();
+
+ static
+ VISU_StreamLinesPL*
+ New();
+
+ virtual
+ void
+ ShallowCopy(VISU_PipeLine *thePipeLine);
+
+ virtual
+ int
+ SetParams(vtkFloatingPointType theIntStep,
+ vtkFloatingPointType thePropogationTime,
+ vtkFloatingPointType theStepLength,
+ vtkPointSet* theSource = NULL,
+ vtkFloatingPointType thePercents = 0.3,
+ int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS,
+ int isOnlyTry = false);
+
+ virtual
+ vtkPointSet*
+ GetSource();
+
+ virtual
+ vtkFloatingPointType
+ GetUsedPoints();
+
+ virtual
+ vtkFloatingPointType
+ GetIntegrationStep();
+
+ virtual
+ vtkFloatingPointType
+ GetPropagationTime();
+
+ virtual
+ vtkFloatingPointType
+ GetStepLength();
+
+ virtual
+ int
+ GetDirection();
+
+ virtual
+ vtkDataSet*
+ GetStreamerSource();
+
+ virtual
+ vtkFloatingPointType
+ GetVelocityCoeff();
+
+ virtual
+ vtkFloatingPointType
+ GetMaxIntegrationStep();
+
+ virtual
+ vtkFloatingPointType
+ GetMinIntegrationStep();
+
+ virtual
+ vtkFloatingPointType
+ GetMinStepLength();
+
+ virtual
+ vtkFloatingPointType
+ GetMaxStepLength();
+
+ virtual
+ vtkFloatingPointType
+ GetMinPropagationTime();
+
+ virtual
+ vtkFloatingPointType
+ GetMaxPropagationTime();
+
+ virtual
+ vtkFloatingPointType
+ GetBasePropagationTime();
public:
- virtual THook* DoHook();
- virtual void Init();
- virtual void Update();
- virtual void SetMapScale(float theMapScale = 1.0);
+ virtual
+ THook*
+ DoHook();
+
+ virtual
+ void
+ Init();
+
+ virtual
+ void
+ Update();
+
+ virtual
+ void
+ SetMapScale(vtkFloatingPointType theMapScale = 1.0);
public:
- static float GetMaxIntegrationStep(vtkPointSet* theDataSet);
- static float GetMinIntegrationStep(vtkPointSet* theDataSet, float thePercents = 0.3);
- static float GetBaseIntegrationStep(vtkPointSet* theDataSet, float thePercents = 0.3);
+ static
+ vtkFloatingPointType
+ GetMaxIntegrationStep(vtkPointSet* theDataSet);
+
+ static
+ vtkFloatingPointType
+ GetMinIntegrationStep(vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents = 0.3);
+ static
+ vtkFloatingPointType
+ GetBaseIntegrationStep(vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents = 0.3);
- static float GetMinPropagationTime(vtkPointSet* theDataSet);
- static float GetMaxPropagationTime(vtkPointSet* theDataSet);
- static float GetBasePropagationTime(vtkPointSet* theDataSet);
+ static
+ vtkFloatingPointType
+ GetMinPropagationTime(vtkPointSet* theDataSet);
+
+ static
+ vtkFloatingPointType
+ GetMaxPropagationTime(vtkPointSet* theDataSet);
+
+ static
+ vtkFloatingPointType
+ GetBasePropagationTime(vtkPointSet* theDataSet);
+
+ static
+ vtkFloatingPointType
+ GetMinStepLength(vtkPointSet* theDataSet);
+
+ static
+ vtkFloatingPointType
+ GetMaxStepLength(vtkPointSet* theDataSet);
- static float GetMinStepLength(vtkPointSet* theDataSet);
- static float GetMaxStepLength(vtkPointSet* theDataSet);
- static float GetBaseStepLength(vtkPointSet* theDataSet);
+ static
+ vtkFloatingPointType
+ GetBaseStepLength(vtkPointSet* theDataSet);
- static float GetVelocityCoeff(vtkPointSet* theDataSet);
+ static
+ vtkFloatingPointType
+ GetVelocityCoeff(vtkPointSet* theDataSet);
- static int IsPossible(vtkPointSet* theDataSet, float thePercents = 0.3);
+ static
+ int
+ IsPossible(vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents = 0.3);
protected:
- static float GetNecasseryMemorySize(vtkIdType theNbOfPoints, float theStepLength,
- float thePropogationTime, float thePercents = 0.3);
- static int FindPossibleParams(vtkPointSet* theDataSet, float& theStepLength,
- float& thePropogationTime, float& thePercents);
+ static
+ vtkFloatingPointType
+ GetNecasseryMemorySize(vtkIdType theNbOfPoints,
+ vtkFloatingPointType theStepLength,
+ vtkFloatingPointType thePropogationTime,
+ vtkFloatingPointType thePercents = 0.3);
+
+ static
+ int
+ FindPossibleParams(vtkPointSet* theDataSet,
+ vtkFloatingPointType& theStepLength,
+ vtkFloatingPointType& thePropogationTime,
+ vtkFloatingPointType& thePercents);
- static float CorrectIntegrationStep(float theStep, vtkPointSet* theDataSet, float thePercents = 0.3);
- static float CorrectPropagationTime(float thePropagationTime, vtkPointSet* theDataSet);
- static float CorrectStepLength(float theStep, vtkPointSet* theDataSet);
+ static
+ vtkFloatingPointType
+ CorrectIntegrationStep(vtkFloatingPointType theStep,
+ vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents = 0.3);
+
+ static
+ vtkFloatingPointType
+ CorrectPropagationTime(vtkFloatingPointType thePropagationTime,
+ vtkPointSet* theDataSet);
+
+ static
+ vtkFloatingPointType
+ CorrectStepLength(vtkFloatingPointType theStep,
+ vtkPointSet* theDataSet);
vtkStreamLine* myStream;
vtkPointSet* mySource;
vtkCellCenters* myCenters;
VTKViewer_GeometryFilter *myGeomFilter;
VISU_UsedPointsFilter *myPointsFilter;
- float myPercents;
+ vtkFloatingPointType myPercents;
};
void
VISU_VectorsPL
-::SetScale(float theScale)
+::SetScale(vtkFloatingPointType theScale)
{
if(myScaleFactor == theScale)
return;
Modified();
}
-float
+vtkFloatingPointType
VISU_VectorsPL
::GetScale()
{
void
VISU_VectorsPL
-::SetMapScale(float theMapScale)
+::SetMapScale(vtkFloatingPointType theMapScale)
{
VISU_ScalarMapPL::SetMapScale(theMapScale);
class vtkGlyph3D;
-class VISU_VectorsPL : public VISU_DeformedShapePL{
+class VISU_VectorsPL : public VISU_DeformedShapePL
+{
protected:
VISU_VectorsPL();
VISU_VectorsPL(const VISU_VectorsPL&);
+
+ virtual
+ ~VISU_VectorsPL();
+
public:
vtkTypeMacro(VISU_VectorsPL,VISU_DeformedShapePL);
- static VISU_VectorsPL* New();
- virtual ~VISU_VectorsPL();
- virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
- virtual void SetScale(float theScale);
- virtual float GetScale();
+ static
+ VISU_VectorsPL*
+ New();
+
+ virtual
+ void
+ ShallowCopy(VISU_PipeLine *thePipeLine);
+
+ virtual
+ void
+ SetScale(vtkFloatingPointType theScale);
+
+ virtual
+ vtkFloatingPointType
+ GetScale();
enum GlyphType{ ARROW, CONE2, CONE6, NONE};
- virtual void SetGlyphType(GlyphType theType) { myTypeGlyph = theType;}
- virtual GlyphType GetGlyphType() { return myTypeGlyph;}
+
+ virtual
+ void
+ SetGlyphType(GlyphType theType)
+ {
+ myTypeGlyph = theType;
+ }
+
+ virtual
+ GlyphType
+ GetGlyphType()
+ {
+ return myTypeGlyph;
+ }
enum GlyphPos{ CENTER, TAIL,HEAD};
- virtual void SetGlyphPos(GlyphPos thePos) { myPosGlyph = thePos;}
- virtual GlyphPos GetGlyphPos() { return myPosGlyph;}
+
+ virtual
+ void
+ SetGlyphPos(GlyphPos thePos)
+ {
+ myPosGlyph = thePos;
+ }
+
+ virtual
+ GlyphPos
+ GetGlyphPos()
+ {
+ return myPosGlyph;
+ }
public:
- virtual void Init();
- virtual void Update();
+ virtual
+ void
+ Init();
+
+ virtual
+ void
+ Update();
vtkDataSet*
GetOutput();
- virtual void SetTransform(VTKViewer_Transform* theTransform);
- virtual VTKViewer_Transform* GetTransform();
+ virtual
+ void
+ SetTransform(VTKViewer_Transform* theTransform);
+
+ virtual
+ VTKViewer_Transform*
+ GetTransform();
- virtual void SetMapScale(float theMapScale = 1.0);
+ virtual
+ void
+ SetMapScale(vtkFloatingPointType theMapScale = 1.0);
protected:
- virtual THook* DoHook();
+ virtual
+ THook*
+ DoHook();
GlyphType myTypeGlyph;
GlyphPos myPosGlyph;
// function: PlaceWidget
// purpose :
//==================================================================
-void VISU_WidgetCtrl::PlaceWidget(float theBounds[6])
+void VISU_WidgetCtrl::PlaceWidget(vtkFloatingPointType theBounds[6])
{
for (int i=0; i<myNbWidgets; ++i) {
myWidgets[i]->PlaceWidget(theBounds);
// function: SetPlaceFactor
// purpose :
//==================================================================
-void VISU_WidgetCtrl::SetPlaceFactor(float theFactor)
+void VISU_WidgetCtrl::SetPlaceFactor(vtkFloatingPointType theFactor)
{
for (int i=0; i<myNbWidgets; ++i) {
myWidgets[i]->SetPlaceFactor(theFactor);
// function: GetPlaceFactor
// purpose :
//==================================================================
-float VISU_WidgetCtrl::GetPlaceFactor()
+vtkFloatingPointType VISU_WidgetCtrl::GetPlaceFactor()
{
return myWidgets[0]->GetPlaceFactor();
}
}
//==================================================================
-float
+vtkFloatingPointType
VISU_WidgetCtrl
-::EvaluateFunction(float theX[3])
+::EvaluateFunction(vtkFloatingPointType theX[3])
{
if(VISU_ImplicitFunctionWidget* aWidget = GetActiveWidget()){
if(vtkImplicitFunction* aFunction = aWidget->ImplicitFunction())
//==================================================================
void
VISU_WidgetCtrl
-::EvaluateGradient(float theX[3], float theG[3])
+::EvaluateGradient(vtkFloatingPointType theX[3],
+ vtkFloatingPointType theG[3])
{
theG[0] = theG[1] = theG[2] = 0.0;
if(VISU_ImplicitFunctionWidget* aWidget = GetActiveWidget()){
vtkImplicitFunction* ImplicitFunction();
virtual
- float
- EvaluateFunction(float theX[3]);
+ vtkFloatingPointType
+ EvaluateFunction(vtkFloatingPointType theX[3]);
virtual
void
- EvaluateGradient(float theX[3], float theG[3]);
+ EvaluateGradient(vtkFloatingPointType theX[3],
+ vtkFloatingPointType theG[3]);
virtual
unsigned long
GetMTime();
- void PlaceWidget(float theBounds[6]);
+ void PlaceWidget(vtkFloatingPointType theBounds[6]);
void SetEnabled(int theFlag);
int GetEnabled();
void On() {SetEnabled(1);}
void SetInteractor(vtkRenderWindowInteractor* theRWI);
vtkRenderWindowInteractor* GetInteractor();
//
- void SetPlaceFactor(float theFactor);
- float GetPlaceFactor();
+ void
+ SetPlaceFactor(vtkFloatingPointType theFactor);
+
+ vtkFloatingPointType
+ GetPlaceFactor();
//
void SetActiveIndex(const int theFlag);
int GetActiveIndex()const;
int myActiveIndex;
int myCounter;
int myDisableAll;
- float myPriority;
+ vtkFloatingPointType myPriority;
VISU_ImplicitFunctionWidget *myWidgets[2];
VISU_ImplicitFunctionWidget *myDummyWidget;
VISU_PlanesWidget *myPlanesWidget;