//#include <vtkUnstructuredGrid.h>
-static vtkFloatingPointType EPS = 1.0E-3;
+static double EPS = 1.0E-3;
#ifdef _DEBUG_
static int MYDEBUG = 0;
//----------------------------------------------------------------------------
-vtkDataSet*
+vtkAlgorithmOutput*
VISU_CutPlanesPL
::InsertCustomPL()
{
- return GetWarpVectorOutput();
+ return GetWarpVectorOutputPort();
}
SetPartPosition();
- vtkFloatingPointType aDir[3];
+ double aDir[3];
GetDir(aDir,
myAng[0],
myBasePlane[0]);
- vtkFloatingPointType aBounds[6];
+ double aBounds[6];
vtkDataSet* aFilterOutput = GetMergeFilterOutput();
//----------------------------------------------------------------------------
-vtkFloatingPointType*
+double*
VISU_CutPlanesPL::
-GetRx(vtkFloatingPointType theRx[3][3],
- vtkFloatingPointType thaAng)
+GetRx(double theRx[3][3],
+ double 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);
//----------------------------------------------------------------------------
-vtkFloatingPointType*
+double*
VISU_CutPlanesPL
-::GetRy(vtkFloatingPointType theRy[3][3],
- vtkFloatingPointType thaAng)
+::GetRy(double theRy[3][3],
+ double 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;
//----------------------------------------------------------------------------
-vtkFloatingPointType*
+double*
VISU_CutPlanesPL
-::GetRz(vtkFloatingPointType theRz[3][3],
- vtkFloatingPointType thaAng)
+::GetRz(double theRz[3][3],
+ double 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;
//----------------------------------------------------------------------------
void
VISU_CutPlanesPL
-::CorrectPnt(vtkFloatingPointType thePnt[3],
- const vtkFloatingPointType BoundPrj[6])
+::CorrectPnt(double thePnt[3],
+ const double BoundPrj[6])
{
for(int i = 0, j = 0; i < 3; ++i, j=2*i){
if(thePnt[i] < BoundPrj[j]) thePnt[i] = BoundPrj[j];
//----------------------------------------------------------------------------
void
VISU_CutPlanesPL
-::GetBoundProject(vtkFloatingPointType BoundPrj[3],
- const vtkFloatingPointType BoundBox[6],
- const vtkFloatingPointType Dir[3])
+::GetBoundProject(double BoundPrj[3],
+ const double BoundBox[6],
+ const double Dir[3])
{
- vtkFloatingPointType BoundPoints[8][3] = { {BoundBox[0],BoundBox[2],BoundBox[4]},
+ double 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[1],BoundBox[3],BoundBox[5]}};
BoundPrj[0] = vtkMath::Dot(Dir,BoundPoints[0]), BoundPrj[1] = BoundPrj[0];
for(int i = 1; i < 8; i++){
- vtkFloatingPointType tmp = vtkMath::Dot(Dir,BoundPoints[i]);
+ double 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,
- vtkFloatingPointType theXAng,
- vtkFloatingPointType theYAng,
+ double theXAng,
+ double theYAng,
int theNum)
{
myBasePlane[theNum] = theOrient;
return myBasePlane[theNum];
}
-vtkFloatingPointType
+double
VISU_CutPlanesPL
::GetRotateX(int theNum)
{
//----------------------------------------------------------------------------
-vtkFloatingPointType
+double
VISU_CutPlanesPL
::GetRotateY(int theNum)
{
//----------------------------------------------------------------------------
-vtkFloatingPointType
+double
VISU_CutPlanesPL
::GetDisplacement(int theNum)
{
//----------------------------------------------------------------------------
void
VISU_CutPlanesPL
-::SetDisplacement(vtkFloatingPointType theDisp,
+::SetDisplacement(double theDisp,
int theNum)
{
if(VISU::CheckIsSameValue(myDisplacement[theNum], theDisp))
void
VISU_CutPlanesPL
::SetPartPosition(int thePartNumber,
- vtkFloatingPointType thePartPosition)
+ double thePartPosition)
{
if(thePartNumber >= myNbParts)
return;
//----------------------------------------------------------------------------
-vtkFloatingPointType
+double
VISU_CutPlanesPL
::GetPartPosition(int thePartNumber,
int theNum)
if(thePartNumber >= myNbParts)
return 0;
- vtkFloatingPointType aPosition = myPartPosition[thePartNumber];
+ double aPosition = myPartPosition[thePartNumber];
if(myPartCondition[thePartNumber]){
- vtkFloatingPointType aDir[3], aBounds[6], aBoundPrj[3];
+ double aDir[3], aBounds[6], aBoundPrj[3];
if(!IsDeformed())
GetMergedInput()->GetBounds(aBounds);
else
aDir);
if(myNbParts > 1){
- vtkFloatingPointType aDBoundPrj = aBoundPrj[2]/(myNbParts - 1);
- vtkFloatingPointType aDisplacement = aDBoundPrj * myDisplacement[theNum];
- vtkFloatingPointType aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement;
+ double aDBoundPrj = aBoundPrj[2]/(myNbParts - 1);
+ double aDisplacement = aDBoundPrj * myDisplacement[theNum];
+ double aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement;
aPosition = aStartPosition + thePartNumber*aDBoundPrj;
}else
aPosition = aBoundPrj[0] + aBoundPrj[2]*myDisplacement[theNum];
//----------------------------------------------------------------------------
void
VISU_CutPlanesPL
-::GetDir(vtkFloatingPointType theDir[3],
- const vtkFloatingPointType theAng[3],
+::GetDir(double theDir[3],
+ const double theAng[3],
const PlaneOrientation& theBasePlane)
{
int iPlane = 0;
- vtkFloatingPointType aRx[3][3], aRy[3][3], aRz[3][3], aRotation[3][3];
+ double 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);
VISU_CutPlanesPL
::CutWithPlane(vtkAppendPolyData* theAppendPolyData,
vtkDataSet* theDataSet,
- vtkFloatingPointType theDir[3],
- vtkFloatingPointType theOrig[3])
+ double theDir[3],
+ double theOrig[3])
{
vtkEDFCutter *aCutPlane = vtkEDFCutter::New();
- aCutPlane->SetInput(theDataSet);
+ aCutPlane->SetInputData(theDataSet);
vtkPlane *aPlane = vtkPlane::New();
aPlane->SetOrigin(theOrig);
aPlane->SetNormal(theDir);
aCutPlane->SetCutFunction(aPlane);
aPlane->Delete();
- theAppendPolyData->AddInput(aCutPlane->GetOutput());
+ theAppendPolyData->AddInputConnection(aCutPlane->GetOutputPort());
aCutPlane->Delete();
}
::CutWithPlanes(vtkAppendPolyData* theAppendPolyData,
vtkDataSet* theDataSet,
int theNbPlanes,
- vtkFloatingPointType theDir[3],
- vtkFloatingPointType theBounds[6],
- const std::vector<vtkFloatingPointType>& thePlanePosition,
+ double theDir[3],
+ double theBounds[6],
+ const std::vector<double>& thePlanePosition,
const std::vector<int>& thePlaneCondition,
- vtkFloatingPointType theDisplacement)
+ double theDisplacement)
{
- vtkFloatingPointType aBoundPrj[3], aOrig[3], aPosition;
+ double aBoundPrj[3], aOrig[3], aPosition;
GetBoundProject(aBoundPrj, theBounds, theDir);
if(theNbPlanes > 1){
- vtkFloatingPointType aDBoundPrj = aBoundPrj[2]/(theNbPlanes - 1);
- vtkFloatingPointType aDisplacement = aDBoundPrj*theDisplacement;
- vtkFloatingPointType aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement;
+ double aDBoundPrj = aBoundPrj[2]/(theNbPlanes - 1);
+ double aDisplacement = aDBoundPrj*theDisplacement;
+ double aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement;
for (int i = 0; i < theNbPlanes; i++){
aPosition = aStartPosition + i*aDBoundPrj;
if(thePlaneCondition[i]){
CutWithPlane(theAppendPolyData,theDataSet,theDir,aOrig);
}
vtkPolyData *aPolyData = theAppendPolyData->GetOutput();
- aPolyData->Update();
theAppendPolyData->Update();
}
}
//----------------------------------------------------------------------------
-void VISU_CutPlanesPL::SetMapScale(vtkFloatingPointType theMapScale){
+void VISU_CutPlanesPL::SetMapScale(double theMapScale){
Superclass::SetMapScale(theMapScale);
if(IsDeformed())
VISU_OptionalDeformationPL::SetMapScale(theMapScale);