X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPIPELINE%2FVISU_CutLinesPL.cxx;h=b518dfad7996c974b88c36c7abaadfb077cf746a;hb=953451df51750a1d9910c0325f01d5ca7b6e0330;hp=367139faf2fd350fc966431e407a823da1738127;hpb=1470190682148c950f0c1a941034e9e2b6c10318;p=modules%2Fvisu.git diff --git a/src/PIPELINE/VISU_CutLinesPL.cxx b/src/PIPELINE/VISU_CutLinesPL.cxx index 367139fa..b518dfad 100644 --- a/src/PIPELINE/VISU_CutLinesPL.cxx +++ b/src/PIPELINE/VISU_CutLinesPL.cxx @@ -1,22 +1,22 @@ // // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org // // // File: VISU_PipeLine.cxx @@ -26,7 +26,7 @@ #include "VISU_CutLinesPL.hxx" #include "VISU_PipeLineUtils.hxx" -#include "SALOME_GeometryFilter.h" +#include "VTKViewer_GeometryFilter.h" #include @@ -37,15 +37,14 @@ vtkStandardNewMacro(VISU_CutLinesPL); VISU_CutLinesPL::VISU_CutLinesPL(){} void VISU_CutLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ - VISU_CutPlanesPL::ShallowCopy(thePipeLine); if(VISU_CutLinesPL *aPipeLine = dynamic_cast(thePipeLine)){ - SetPlaneOrientation(aPipeLine->GetPlaneOrientation(1),1); + SetOrientation(aPipeLine->GetPlaneOrientation(1), + aPipeLine->GetRotateX(1),aPipeLine->GetRotateY(1),1); SetDisplacement(aPipeLine->GetDisplacement(1),1); - SetDefault(); + SetDefault(); if (!aPipeLine->IsDefault()) SetPosition(aPipeLine->GetPosition()); - SetRotateX(aPipeLine->GetRotateX(1),1); - SetRotateY(aPipeLine->GetRotateY(1),1); } + VISU_CutPlanesPL::ShallowCopy(thePipeLine); } void VISU_CutLinesPL::Init(){ @@ -71,7 +70,7 @@ float VISU_CutLinesPL::GetPosition(){ float aPosition = myPosition; if(myCondition){ float aDir[3], aBounds[6], aBoundPrj[3]; - myInput->GetBounds(aBounds); + GetInput2()->GetBounds(aBounds); GetDir(aDir,myAng[0],myBasePlane[0]); GetBoundProject(aBoundPrj,aBounds,aDir); aPosition = aBoundPrj[0] + aBoundPrj[2]*myDisplacement[0]; @@ -94,9 +93,9 @@ void VISU_CutLinesPL::Update(){ vtkAppendPolyData *anAppendPolyData = vtkAppendPolyData::New(); //Build base plane float aDir[2][3], aBaseBounds[6]; - myInput->GetBounds(aBaseBounds); + GetInput2()->GetBounds(aBaseBounds); GetDir(aDir[0],myAng[0],myBasePlane[0]); - vtkUnstructuredGrid* anUnstructuredGrid = + vtkUnstructuredGrid* anUnstructuredGrid = myFieldTransform->GetUnstructuredGridOutput(); CutWithPlanes(anAppendPolyData,anUnstructuredGrid,1,aDir[0],aBaseBounds, myPosition,myCondition,myDisplacement[0]); @@ -113,7 +112,8 @@ void VISU_CutLinesPL::Update(){ anAppendPolyData->Register(myAppendPolyData); anAppendPolyData->Delete(); //Calculate values for building of table - vtkMath::Cross(aDir[0],aDir[1],myDirLn); + 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 GetBoundProject(myBoundPrjLn, aBaseBounds, myDirLn); VISU::Mul(myDirLn,myBoundPrjLn[0],myBasePnt); CorrectPnt(myBasePnt,aBaseBounds); @@ -123,7 +123,7 @@ void VISU_CutLinesPL::Update(){ void VISU_CutLinesPL::CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet, - int theNbPlanes, float theDir[3], float theBounds[6], + int theNbPlanes, float theDir[3], float theBounds[6], float thePartPosition, int thePartCondition, float theDisplacement) {