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)
{