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)
anAppendPolyData->Delete();
//Calculate values for building of table
vtkMath::Cross(aDir[0],aDir[1],myDirLn);
- for (int i=0; i<3 ; i++) if(myDirLn[i]<0) myDirLn[i] = (-1)*myDirLn[i];//enk:: correction of bug Bug PAL10401
+ for (int i=0; i<3 ; i++) {
+ myRealDirLn[i] = myDirLn[i];
+ if(myDirLn[i]<0) myDirLn[i] = (-1)*myDirLn[i];//enk:: correction of bug Bug PAL10401
+ }
GetBoundProject(myBoundPrjLn, aBaseBounds, myDirLn);
VISU::Mul(myDirLn,myBoundPrjLn[0],myBasePnt);
+
CorrectPnt(myBasePnt,aBaseBounds);
VISU_ScalarMapPL::Update();
}
-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);