]> SALOME platform Git repositories - modules/visu.git/blobdiff - src/PIPELINE/VISU_CutPlanesPL.cxx
Salome HOME
MPV: Merge V1_2d
[modules/visu.git] / src / PIPELINE / VISU_CutPlanesPL.cxx
index a6cb0665877de8c077a48367cc21ea1ec8c13f5c..2cbdba5744354669518e4c04c10124b18db17737 100644 (file)
@@ -50,13 +50,12 @@ VISU_CutPlanesPL::~VISU_CutPlanesPL(){
 void VISU_CutPlanesPL::ShallowCopy(VISU_PipeLine *thePipeLine){
   VISU_ScalarMapPL::ShallowCopy(thePipeLine);
   if(VISU_CutPlanesPL *aPipeLine = dynamic_cast<VISU_CutPlanesPL*>(thePipeLine)){
-    SetPlaneOrientation(aPipeLine->GetPlaneOrientation());
+    SetOrientation(aPipeLine->GetPlaneOrientation(),
+                  aPipeLine->GetRotateX(),aPipeLine->GetRotateY());
     SetDisplacement(aPipeLine->GetDisplacement());
     SetNbParts(aPipeLine->GetNbParts());
     for (int i = 0, iend = GetNbParts(); i < iend; i++)
       if(!aPipeLine->IsPartDefault(i))         SetPartPosition(i, aPipeLine->GetPartPosition(i));
-    SetRotateX(aPipeLine->GetRotateX());
-    SetRotateY(aPipeLine->GetRotateY());
   }
 }
 
@@ -150,14 +149,28 @@ void VISU_CutPlanesPL::GetBoundProject(float BoundPrj[3], const float BoundBox[6
   BoundPrj[2] = BoundPrj[1] - BoundPrj[0];
 }
 
-void VISU_CutPlanesPL::SetRotateX(float theAng, int theNum){
+
+void VISU_CutPlanesPL::SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient, 
+                                     float theXAng, float theYAng, int theNum)
+{ 
+  myBasePlane[theNum] = theOrient;
+  switch(myBasePlane[theNum]){
+  case XY: myAng[theNum][0] = theXAng; break;
+  case YZ: myAng[theNum][1] = theXAng; break;
+  case ZX: myAng[theNum][2] = theXAng; break;
+  }
   switch(myBasePlane[theNum]){
-  case XY: myAng[theNum][0] = theAng; break;
-  case YZ: myAng[theNum][1] = theAng; break;
-  case ZX: myAng[theNum][2] = theAng; break;
+  case XY: myAng[theNum][1] = theYAng; break;
+  case YZ: myAng[theNum][2] = theYAng; break;
+  case ZX: myAng[theNum][0] = theYAng; break;
   }
 }
 
+
+const VISU_CutPlanesPL::PlaneOrientation& VISU_CutPlanesPL::GetPlaneOrientation(int theNum){ 
+  return myBasePlane[theNum];
+}
+
 float VISU_CutPlanesPL::GetRotateX(int theNum){
   switch(myBasePlane[theNum]){
   case XY: return myAng[theNum][0];
@@ -166,14 +179,6 @@ float VISU_CutPlanesPL::GetRotateX(int theNum){
   }
 }
 
-void VISU_CutPlanesPL::SetRotateY(float theAng, int theNum){
-  switch(myBasePlane[theNum]){
-  case XY: myAng[theNum][1] = theAng; break;
-  case YZ: myAng[theNum][2] = theAng; break;
-  case ZX: myAng[theNum][0] = theAng; break;
-  }
-}
-
 float VISU_CutPlanesPL::GetRotateY(int theNum){
   switch(myBasePlane[theNum]){
   case XY: return myAng[theNum][1];