]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for a bug: prs3d offsets ("arrange actors" command) were not stored in Python...
authorasv <asv@opencascade.com>
Thu, 6 Apr 2006 13:24:06 +0000 (13:24 +0000)
committerasv <asv@opencascade.com>
Thu, 6 Apr 2006 13:24:06 +0000 (13:24 +0000)
src/VISU_I/VISU_DumpPython.cc

index 5101d1aa0f1ee9cadce8dca31f0cc20f9c7d0233..a012ca37e64d31bb4f9469d9aea1b29756d2675e 100644 (file)
@@ -141,6 +141,18 @@ namespace VISU{
               std::string thePrefix);
 
 
+  //===========================================================================
+  void
+  Prs3dToPython(VISU::Prs3d_i* theServant,
+               std::ostream& theStr,
+               std::string& theName,
+               std::string thePrefix)
+  {
+    float x, y, z;
+    theServant->GetOffset(x,y,z);
+    theStr<<thePrefix<<theName<<".SetOffset("<<x<<","<<y<<","<<z<<")"<<endl;
+  }
+
   //===========================================================================
   std::string
   ColoredPrs3dToPython(SALOMEDS::SObject_ptr theSObject,
@@ -184,6 +196,9 @@ namespace VISU{
     CORBA::String_var aNameInStudy = theSObject->GetName();
     theStr<<thePrefix<<"visu.SetName("<<theName<<",'"<<aNameInStudy.in()<<"')"<<endl;
 
+    // Set parameters common for all Prs3d objects (offset values)
+    Prs3dToPython(theServant,theStr,theName,thePrefix);
+
     // Set parameters
     theStr<<thePrefix<<theName<<".SetScalarMode("<<theServant->GetScalarMode()<<")"<<endl;
 
@@ -582,7 +597,7 @@ namespace VISU{
           }
           return;
         case VISU::TMESH:
-          if(Mesh_i* aServant = dynamic_cast<Mesh_i*>(GetServant(anObj).in())){
+          if(Mesh_i* aServant = dynamic_cast<Mesh_i*>(GetServant(anObj).in())){            
            VISU::Entity anEntity = aServant->GetEntity();
            const std::string& aSubMeshName = aServant->GetSubMeshName();
            if(anEntity >= 0){
@@ -629,6 +644,9 @@ namespace VISU{
            CORBA::String_var aNameInStudy = theSObject->GetName();
            theStr<<thePrefix<<"visu.SetName("<<aName<<",'"<<aNameInStudy.in()<<"')"<<endl;
 
+           // Set parameters common for all Prs3d objects (offset values)
+           Prs3dToPython(aServant,theStr,aName,thePrefix);
+
            // Set presentation parameters
            SALOMEDS::Color aColor;
            aColor = aServant->GetCellColor();