]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug IPAL16146
authorapo <apo@opencascade.com>
Mon, 18 Jun 2007 07:10:21 +0000 (07:10 +0000)
committerapo <apo@opencascade.com>
Mon, 18 Jun 2007 07:10:21 +0000 (07:10 +0000)
 - IOLS. Loaded study has wrong order and displaying, no arrange actors for 3D presentations

idl/VISU_Gen.idl
src/VISUGUI/VisuGUI_GaussPointsDlg.cxx
src/VISUGUI/VisuGUI_Prs3dDlg.cxx
src/VISU_I/VISU_ColoredPrs3dCache_i.hh
src/VISU_I/VISU_ColoredPrs3d_i.cc
src/VISU_I/VISU_ColoredPrs3d_i.hh
src/VISU_I/VISU_DumpPython.cc
src/VISU_I/VISU_ScalarMap_i.cc
src/VISU_I/VISU_ScalarMap_i.hh

index d35c649e5a6237c1a962dfb60b6b0b29be667b32..560a870aa4dd468acebb00c954a720e513eeaedd 100644 (file)
@@ -520,6 +520,24 @@ module VISU {
      * Gets the title of the scalar bar.
      */
     string GetTitle();
+
+    /*! %Orientation of the scalar bar (to provide backward compatibility). */
+    enum Orientation {
+      HORIZONTAL, /*!< Horizontal orientation of the scalar bar.*/
+      VERTICAL    /*!< Vertical orientation of the scalar bar.*/
+    };
+
+    /*!
+     * Sets the type of orientation of the scalar bar (to provide backward compatibility).
+     * \param theOrientation This parameter defines the orientation of the scalar bar.
+     *                       It is taken from the <VAR>Orientaton</VAR> enumeration.
+     */
+    void SetBarOrientation(in Orientation theOrientation);
+
+    /*!
+     * Gets the type of orientation of the scalar bar (to provide backward compatibility).
+     */
+    Orientation GetBarOrientation();
   };
 
 
@@ -680,24 +698,6 @@ module VISU {
      */
     void SetSourceRange();
 
-    /*! %Orientation of the scalar bar (to provide backward compatibility). */
-    enum Orientation {
-      HORIZONTAL, /*!< Horizontal orientation of the scalar bar.*/
-      VERTICAL    /*!< Vertical orientation of the scalar bar.*/
-    };
-
-    /*!
-     * Sets the type of orientation of the scalar bar (to provide backward compatibility).
-     * \param theOrientation This parameter defines the orientation of the scalar bar.
-     *                       It is taken from the <VAR>Orientaton</VAR> enumeration.
-     */
-    void SetBarOrientation(in Orientation theOrientation);
-
-    /*!
-     * Gets the type of orientation of the scalar bar (to provide backward compatibility).
-     */
-    Orientation GetBarOrientation();
-
     /*!
      * Add group as geometry of presentation.
      * \param theMeshName  - mesh name
index 8097d4681dab28a78467551bd5c32505c5f49305..696e75d930ad169a2a1b98e1babbec3e92582556 100644 (file)
@@ -380,7 +380,7 @@ int VisuGUI_GaussScalarBarPane::storeToPrsObject(VISU::GaussPoints_i* thePrs) {
   thePrs->SetPosition(XSpin->value(), YSpin->value());
   thePrs->SetSize(WidthSpin->value(), HeightSpin->value());
   thePrs->SetSpacing(SpacingSpin->value());
-  thePrs->SetBarOrientation((RBvert->isChecked())? VISU::ScalarMap::VERTICAL : VISU::ScalarMap::HORIZONTAL);
+  thePrs->SetBarOrientation((RBvert->isChecked())? VISU::ColoredPrs3d::VERTICAL : VISU::ColoredPrs3d::HORIZONTAL);
   thePrs->SetIsActiveLocalScalarBar(myRBLocal->isChecked());
   thePrs->SetIsDispGlobalScalarBar(myCBDisplayed->isChecked());
   thePrs->SetNbColors(ColorSpin->value());
index 892c3051171a033a1b2797e524f52796ec98ebd6..6fcd97efd8e66e251b2b86430a5302a7d9feaad8 100644 (file)
@@ -950,7 +950,7 @@ int VisuGUI_ScalarBarPane::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs) {
   myScalarMap->SetScalarMode(myModeCombo->currentItem());
   myScalarMap->SetPosition(XSpin->value(), YSpin->value());
   myScalarMap->SetSize(WidthSpin->value(), HeightSpin->value());
-  myScalarMap->SetBarOrientation((RBvert->isChecked())? VISU::ScalarMap::VERTICAL : VISU::ScalarMap::HORIZONTAL);
+  myScalarMap->SetBarOrientation((RBvert->isChecked())? VISU::ColoredPrs3d::VERTICAL : VISU::ColoredPrs3d::HORIZONTAL);
   if(isLogarithmic())
     myScalarMap->SetScaling(VISU::LOGARITHMIC);
   else
index 8017b59bfb163674a3b0c54d74233e355f0ab2d5..56ab4a22005ef6fe193a3c27c0d56dc2f2bc0ce1 100644 (file)
@@ -240,9 +240,6 @@ namespace VISU
     void
     RemoveHolder(VISU::ColoredPrs3dHolder_i* theHolder);
 
-    TColoredPrs3dHolderMap
-    GetHolderMap() { return myHolderMap; }
-
   public:
     static const std::string myComment;
 
index 72a0c0edaba90858a415ac613d77d327818a1c67..13246cfc774f8a97fde2485311a7c1aabbd10583 100644 (file)
@@ -633,7 +633,7 @@ VISU::ColoredPrs3d_i
 //----------------------------------------------------------------------------
 void
 VISU::ColoredPrs3d_i
-::SetBarOrientation(VISU::ScalarMap::Orientation theOrientation)
+::SetBarOrientation(VISU::ColoredPrs3d::Orientation theOrientation)
 {
   if(myOrientation != theOrientation){
     myOrientation = theOrientation;
@@ -642,7 +642,7 @@ VISU::ColoredPrs3d_i
 }
 
 //----------------------------------------------------------------------------
-VISU::ScalarMap::Orientation 
+VISU::ColoredPrs3d::Orientation 
 VISU::ColoredPrs3d_i
 ::GetBarOrientation() 
 {
@@ -1043,26 +1043,26 @@ VISU::ColoredPrs3d_i
   // Orientation
   int anOrientation = aResourceMgr->integerValue("VISU", "scalar_bar_orientation", 0);
   if(anOrientation == 1)
-    SetBarOrientation(VISU::ScalarMap::HORIZONTAL);
+    SetBarOrientation(VISU::ColoredPrs3d::HORIZONTAL);
   else
-    SetBarOrientation(VISU::ScalarMap::VERTICAL);
+    SetBarOrientation(VISU::ColoredPrs3d::VERTICAL);
 
   // Scalar Bar origin
   QString propertyName = QString( "scalar_bar_%1_" ).arg( anOrientation == 0 ? "vertical" : "horizontal" );
 
-  vtkFloatingPointType aXorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.01 : 0.2;
+  vtkFloatingPointType aXorigin = (myOrientation == VISU::ColoredPrs3d::VERTICAL) ? 0.01 : 0.2;
   aXorigin = aResourceMgr->doubleValue("VISU", propertyName + "x", aXorigin);
   myPosition[0] = aXorigin;
 
-  vtkFloatingPointType aYorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.1 : 0.012;
+  vtkFloatingPointType aYorigin = (myOrientation == VISU::ColoredPrs3d::VERTICAL) ? 0.1 : 0.012;
   aYorigin = aResourceMgr->doubleValue("VISU", propertyName + "y", aYorigin);
   myPosition[1] = aYorigin;
 
   // Scalar Bar size
-  myWidth = (myOrientation == VISU::ScalarMap::VERTICAL)? 0.1 : 0.6;
+  myWidth = (myOrientation == VISU::ColoredPrs3d::VERTICAL)? 0.1 : 0.6;
   myWidth = aResourceMgr->doubleValue("VISU", propertyName + "width", myWidth);
 
-  myHeight = (myOrientation == VISU::ScalarMap::VERTICAL)? 0.8:0.12;
+  myHeight = (myOrientation == VISU::ColoredPrs3d::VERTICAL)? 0.8:0.12;
   myHeight = aResourceMgr->doubleValue("VISU", propertyName + "height", myHeight);
 
   // scalar bar default position
@@ -1071,7 +1071,7 @@ VISU::ColoredPrs3d_i
   if (anIsArrangeBar){
     aPlace = aResourceMgr->integerValue("VISU", "scalar_bar_position_num",0);
   }
-  if(myOrientation == VISU::ScalarMap::HORIZONTAL){
+  if(myOrientation == VISU::ColoredPrs3d::HORIZONTAL){
     myPosition[1] += myHeight*(aPlace-1);
   } else {
     myPosition[0] += myWidth*(aPlace-1);
@@ -1174,7 +1174,7 @@ VISU::ColoredPrs3d_i
 
   SetScalarMode(VISU::Storable::FindValue(theMap,"myScalarMode").toInt());
   SetNbColors(VISU::Storable::FindValue(theMap,"myNumberOfColors").toInt());
-  SetBarOrientation((VISU::ScalarMap::Orientation)VISU::Storable::FindValue(theMap,"myOrientation").toInt());
+  SetBarOrientation((VISU::ColoredPrs3d::Orientation)VISU::Storable::FindValue(theMap,"myOrientation").toInt());
   
   SetTitle(VISU::Storable::FindValue(theMap,"myTitle").latin1());
   myNumberOfLabels = VISU::Storable::FindValue(theMap,"myNumberOfLabels").toInt();
index 30e68db65354f933d1c3749f4a2b164f958b8439..de53ef4dffb4b3164985b803975c536ae3ee6f1e 100644 (file)
@@ -169,10 +169,10 @@ namespace VISU
 
     virtual
     void
-    SetBarOrientation(VISU::ScalarMap::Orientation theOrientation);
+    SetBarOrientation(VISU::ColoredPrs3d::Orientation theOrientation);
 
     virtual 
-    VISU::ScalarMap::Orientation 
+    VISU::ColoredPrs3d::Orientation 
     GetBarOrientation();
 
     virtual
@@ -479,7 +479,7 @@ namespace VISU
     std::string myScalarBarTitle;
 
     int myNumberOfLabels;
-    VISU::ScalarMap::Orientation myOrientation;
+    VISU::ColoredPrs3d::Orientation myOrientation;
     vtkFloatingPointType myPosition[2], myWidth, myHeight;
 
     //Font management
index 688ec9945e6e2fe08ecb5990f657e21fc7de8fb6..d40749fdc9ce3d6425c03134def70fa4e53d3a9f 100644 (file)
@@ -122,7 +122,7 @@ namespace VISU
   }
 
 
-  //===========================================================================
+  //---------------------------------------------------------------------------
   typedef void (*TDumpToPython)(SALOMEDS::Study_ptr theStudy,
                                CORBA::Boolean theIsPublished,
                                CORBA::Boolean& theIsValidScript,
@@ -146,87 +146,142 @@ namespace VISU
               std::string thePrefix);
 
 
-  //===========================================================================
+  //---------------------------------------------------------------------------
   void
   Prs3dToPython(VISU::Prs3d_i* theServant,
                std::ostream& theStr,
-               std::string& theName,
+               const std::string& theName,
                std::string thePrefix)
   {
     float x, y, z;
     theServant->GetOffset(x,y,z);
-    theStr<<thePrefix<<theName<<".SetOffset("<<x<<","<<y<<","<<z<<")"<<endl;
+    theStr<<thePrefix<<theName<<".SetOffset("<<x<<", "<<y<<", "<<z<<")"<<endl;
   }
 
-  //===========================================================================
-  std::string
-  ColoredPrs3dToPython(SALOMEDS::SObject_ptr theSObject,
-                      VISU::ColoredPrs3d_i* theServant,
-                      std::ostream& theStr,
-                      std::string& theName,
-                      const std::string& theConstructorName,
-                      const std::string& theArgumentName,
-                      std::string thePrefix)
+  //---------------------------------------------------------------------------
+  struct TColoredPrs3dFactory
   {
-    std::string aParam;
-    switch(theServant->GetEntity()){
-    case NODE:
-      aParam = "VISU.NODE";
-      break;
-    case EDGE:
-      aParam = "VISU.EDGE";
-      break;
-    case FACE:
-      aParam = "VISU.FACE";
-      break;
-    case CELL:
-      aParam = "VISU.CELL";
-      break;
+    virtual
+    std::string
+    operator()(std::ostream& theStr,
+              std::string thePrefix)
+    {
+
+      return thePrefix;
     }
+  };
 
-    theStr<<thePrefix<<theName<<" = aVisu."<<theConstructorName<<"("<<theArgumentName<<
-      ",'"<<theServant->GetCMeshName()<<"'"<<
-      ","<<aParam<<
-      ",'"<<theServant->GetCFieldName()<<"'"<<
-      ","<<theServant->GetTimeStampNumber()<<
-      ")"<<endl;
 
-    theStr<<thePrefix<<"if "<<theName<<":"<<endl;
-    thePrefix += PREFIX;
+  struct TCreateFromResult: TColoredPrs3dFactory
+  {
+    VISU::ColoredPrs3d_i* myServant;
+    std::string myConstructorName;
+    std::string myArgumentName;
+
+    SALOMEDS::SObject_var mySObject;
+    std::string myName;
+
+    TCreateFromResult(const SALOMEDS::SObject_var& theSObject,
+                     VISU::ColoredPrs3d_i* theServant,
+                     const std::string& theName,
+                     const std::string& theConstructorName,
+                     const std::string& theArgumentName):
+      myServant(theServant),
+      myConstructorName(theConstructorName),
+      myArgumentName(theArgumentName),
+      mySObject(theSObject),
+      myName(theName)
+    {}
+
+    virtual
+    std::string
+    operator()(std::ostream& theStr,
+              std::string thePrefix)
+    {
+      std::string aParam;
+      switch(myServant->GetEntity()){
+      case NODE:
+       aParam = "VISU.NODE";
+       break;
+      case EDGE:
+       aParam = "VISU.EDGE";
+       break;
+      case FACE:
+       aParam = "VISU.FACE";
+       break;
+      case CELL:
+       aParam = "VISU.CELL";
+       break;
+      }
 
-    // Add to Name->Object map
-    theStr<<thePrefix<<"aName2ObjectMap['"<<theName<<"'] = "<<theName<<endl;
+      theStr<<thePrefix<<myName<<" = aVisu."<<myConstructorName<<"("<<myArgumentName<<
+       ", '"<<myServant->GetCMeshName()<<"'"<<
+       ", "<<aParam<<
+       ", '"<<myServant->GetCFieldName()<<"'"<<
+       ", "<<myServant->GetTimeStampNumber()<<
+       ")"<<endl;
+      
+      theStr<<thePrefix<<"if "<<myName<<" != None:"<<endl;
+      thePrefix += PREFIX;
+      
+      // Add to Name->Object map
+      theStr<<thePrefix<<"aName2ObjectMap['"<<myName<<"'] = "<<myName<<endl;
 
-    // Set name (as this object could be renamed by user)
-    CORBA::String_var aNameInStudy = theSObject->GetName();
-    theStr<<thePrefix<<"visu.SetName("<<theName<<",'"<<aNameInStudy.in()<<"')"<<endl;
+      // Set name (as this object could be renamed by user)
+      CORBA::String_var aNameInStudy = mySObject->GetName();
+      theStr<<thePrefix<<"visu.SetName("<<myName<<", '"<<aNameInStudy.in()<<"')"<<endl;
 
-    // Set parameters common for all Prs3d objects (offset values)
-    Prs3dToPython(theServant,theStr,theName,thePrefix);
+      return thePrefix;
+    }
+  };
 
-    // Set parameters
-    theStr<<thePrefix<<theName<<".SetScalarMode("<<theServant->GetScalarMode()<<")"<<endl;
 
-    theStr<<thePrefix<<theName<<".SetPosition("<<theServant->GetPosX()<<","<<theServant->GetPosY()<<")"<<endl;
-    theStr<<thePrefix<<theName<<".SetSize("<<theServant->GetWidth()<<","<<theServant->GetHeight()<<")"<<endl;
+  //---------------------------------------------------------------------------
+  std::string
+  ColoredPrs3dToPython(SALOMEDS::SObject_ptr theSObject,
+                      VISU::ColoredPrs3d_i* theServant,
+                      std::ostream& theStr,
+                      const std::string& theName,
+                      TColoredPrs3dFactory& thePrsFactory,
+                      std::string thePrefix)
+  {
+    thePrefix = thePrsFactory(theStr, thePrefix);
+
+    // Set parameters common for all Prs3d objects (offset values)
+    Prs3dToPython(theServant, theStr, theName, thePrefix);
+
+    theStr<<thePrefix<<theName<<".SetPosition("<<theServant->GetPosX()<<", "<<theServant->GetPosY()<<")"<<endl;
+    theStr<<thePrefix<<theName<<".SetSize("<<theServant->GetWidth()<<", "<<theServant->GetHeight()<<")"<<endl;
     theStr<<thePrefix<<theName<<".SetNbColors("<<theServant->GetNbColors()<<")"<<endl;
     theStr<<thePrefix<<theName<<".SetLabels("<<theServant->GetLabels()<<")"<<endl;
     theStr<<thePrefix<<theName<<".SetTitle('"<<theServant->GetTitle()<<"')"<<endl;
 
+    std::string aParam;
+    switch(theServant->GetBarOrientation()){
+    case ColoredPrs3d::HORIZONTAL:
+      aParam = "VISU.ColoredPrs3d.HORIZONTAL";
+      break;
+    case ColoredPrs3d::VERTICAL:
+      aParam = "VISU.ColoredPrs3d.VERTICAL";
+      break;
+    }
+    theStr<<thePrefix<<theName<<".SetBarOrientation("<<aParam<<")"<<endl;
+
+    theStr<<thePrefix<<theName<<".SetScalarMode("<<theServant->GetScalarMode()<<")"<<endl;
+
     return thePrefix;
   }
 
-  //===========================================================================
+  //---------------------------------------------------------------------------
   std::string
   ScalarMapToPython(SALOMEDS::SObject_ptr theSObject,
                    VISU::ScalarMap_i* theServant,
                    std::ostream& theStr,
-                   std::string& theName,
-                   const std::string& theConstructorName,
-                   const std::string& theArgumentName,
+                   const std::string& theName,
+                   TColoredPrs3dFactory& thePrsFactory,
                    std::string thePrefix)
   {
-    thePrefix = ColoredPrs3dToPython(theSObject,theServant,theStr,theName,theConstructorName,theArgumentName,thePrefix);
+    thePrefix = ColoredPrs3dToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
 
     std::string aParam;
     switch(theServant->GetScaling()){
@@ -238,17 +293,7 @@ namespace VISU
       break;
     }
     theStr<<thePrefix<<theName<<".SetScaling("<<aParam<<")"<<endl;
-    theStr<<thePrefix<<theName<<".SetRange("<<theServant->GetMin()<<","<<theServant->GetMax()<<")"<<endl;
-
-    switch(theServant->GetBarOrientation()){
-    case ScalarMap::HORIZONTAL:
-      aParam = "VISU.ScalarMap.HORIZONTAL";
-      break;
-    case ScalarMap::VERTICAL:
-      aParam = "VISU.ScalarMap.VERTICAL";
-      break;
-    }
-    theStr<<thePrefix<<theName<<".SetBarOrientation("<<aParam<<")"<<endl;
+    theStr<<thePrefix<<theName<<".SetRange("<<theServant->GetMin()<<", "<<theServant->GetMax()<<")"<<endl;
 
     const VISU::ScalarMap_i::TGroupNames aGroupNames = theServant->GetGroupNames();
     VISU::ScalarMap_i::TGroupNames::const_iterator anIter = aGroupNames.begin();
@@ -259,27 +304,316 @@ namespace VISU
     return thePrefix;
   }
 
-  //===========================================================================
+
+  //---------------------------------------------------------------------------
   std::string
   DeformedShapeToPython(SALOMEDS::SObject_ptr theSObject,
                        VISU::DeformedShape_i* theServant,
                        std::ostream& theStr,
-                       std::string& theName,
-                       const std::string& theConstructorName,
-                       const std::string& theArgumentName,
+                       const std::string& theName,
+                       TColoredPrs3dFactory& thePrsFactory,
                        std::string thePrefix)
   {
-    thePrefix = ScalarMapToPython(theSObject,theServant,theStr,theName,theConstructorName,theArgumentName,thePrefix);
+    thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
     theStr<<thePrefix<<theName<<".SetScale("<<theServant->GetScale()<<")"<<endl;
     theStr<<thePrefix<<theName<<".ShowColored("<<theServant->IsColored()<<")"<<endl;
     SALOMEDS::Color aColor = theServant->GetColor();
     theStr<<thePrefix<<theName<<".SetColor(SALOMEDS.Color("<<
-      aColor.R<<","<<aColor.G<<","<<aColor.B<<"))"<<endl;
+      aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
+
+    return thePrefix;
+  }
+
+
+  //---------------------------------------------------------------------------
+  std::string
+  StreamLinesToPython(SALOMEDS::SObject_ptr theSObject,
+                     VISU::StreamLines_i* theServant,
+                     std::ostream& theStr,
+                     TEntry2NameMap& theEntry2NameMap,
+                     const std::string& theName,
+                     TColoredPrs3dFactory& thePrsFactory,
+                     std::string thePrefix)
+  {
+    thePrefix = DeformedShapeToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+    
+    std::string aParam;
+    switch(theServant->GetDirection()){
+    case StreamLines::FORWARD:
+      aParam = "VISU.StreamLines.FORWARD";
+      break;
+    case StreamLines::BACKWARD:
+      aParam = "VISU.StreamLines.BACKWARD";
+      break;
+    case StreamLines::BOTH:
+      aParam = "VISU.StreamLines.BOTH";
+      break;
+    }
+    
+    theStr<<thePrefix<<"aPrs3d = None"<<endl;
+    VISU::Prs3d_var aPrs3d = theServant->GetSource();
+    if(!CORBA::is_nil(aPrs3d)){
+      if(Prs3d_i* aServant3d = dynamic_cast<Prs3d_i*>(GetServant(aPrs3d).in())){
+       SALOMEDS::SObject_var aSObject = aServant3d->GetSObject();
+       CORBA::String_var anID = aSObject->GetID();
+       std::string anArg = theEntry2NameMap[anID.in()];
+       theStr<<thePrefix<<"if aName2ObjectMap.has_key('"<<anArg<<"'):"<<endl;
+       thePrefix += PREFIX;
+       theStr<<thePrefix<<"aPrs3d = aName2ObjectMap['"<<anArg<<"']"<<endl;
+      }
+    }
+    
+    theStr<<thePrefix<<theName<<".SetParams("<<
+      theServant->GetIntegrationStep()<<", "<<
+      theServant->GetPropagationTime()<<", "<<
+      theServant->GetStepLength()<<", "<<
+      "aPrs3d"<<", "<<
+      theServant->GetUsedPoints()<<", "<<
+      aParam<<
+      ")"<<endl;
+    
+    return thePrefix;
+  }
+
+
+  //---------------------------------------------------------------------------
+  std::string
+  ScalarMapOnDeformedShapeToPython(SALOMEDS::SObject_ptr theSObject,
+                                  VISU::ScalarMapOnDeformedShape_i* theServant,
+                                  std::ostream& theStr,
+                                  const std::string& theName,
+                                  TColoredPrs3dFactory& thePrsFactory,
+                                  std::string thePrefix)
+  {
+    thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+
+    theStr<<thePrefix<<theName<<".SetRange("<<theServant->GetMin()<<", "<<theServant->GetMax()<<")"<<endl;
+    theStr<<thePrefix<<theName<<".SetScale("<<theServant->GetScale()<<")"<<endl;
+
+    std::string aParam;
+    VISU::Entity anEntity = theServant->GetScalarEntity();
+    switch(anEntity){
+    case NODE:
+      aParam = "VISU.NODE";
+      break;
+    case EDGE:
+      aParam = "VISU.EDGE";
+      break;
+    case FACE:
+      aParam = "VISU.FACE";
+      break;
+    case CELL:
+      aParam = "VISU.CELL";
+      break;
+    }
+    
+    CORBA::String_var aFieldName = theServant->GetScalarFieldName();
+    CORBA::Long aTimeStampNumber = theServant->GetScalarTimeStampNumber();
+    
+    theStr<<thePrefix<<theName<<".SetScalarField("<<
+      aParam<<", "<<
+      "'"<<aFieldName<<"', "<<
+      aTimeStampNumber<<
+      ")"<<endl;
 
     return thePrefix;
   }
 
-  //===========================================================================
+
+  //---------------------------------------------------------------------------
+  std::string
+  VectorsToPython(SALOMEDS::SObject_ptr theSObject,
+                 VISU::Vectors_i* theServant,
+                 std::ostream& theStr,
+                 const std::string& theName,
+                 TColoredPrs3dFactory& thePrsFactory,
+                 std::string thePrefix)
+  {
+    thePrefix = DeformedShapeToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+
+    theStr<<thePrefix<<theName<<".SetLineWidth("<<theServant->GetLineWidth()<<")"<<endl;
+
+    std::string aParam;
+    switch(theServant->GetGlyphType()){
+    case Vectors::ARROW:
+      aParam = "VISU.Vectors.ARROW";
+      break;
+    case Vectors::CONE2:
+      aParam = "VISU.Vectors.CONE2";
+      break;
+    case Vectors::CONE6:
+      aParam = "VISU.Vectors.CONE6";
+      break;
+    case Vectors::NONE:
+      aParam = "VISU.Vectors.NONE";
+      break;
+    }
+    theStr<<thePrefix<<theName<<".SetGlyphType("<<aParam<<")"<<endl;
+    
+    switch(theServant->GetGlyphPos()){
+    case Vectors::CENTER:
+      aParam = "VISU.Vectors.CENTER";
+      break;
+    case Vectors::TAIL:
+      aParam = "VISU.Vectors.TAIL";
+      break;
+    case Vectors::HEAD:
+      aParam = "VISU.Vectors.HEAD";
+      break;
+    }
+    theStr<<thePrefix<<theName<<".SetGlyphPos("<<aParam<<")"<<endl;
+    
+    return thePrefix;
+  }
+
+
+  //---------------------------------------------------------------------------
+  std::string
+  IsoSurfacesToPython(SALOMEDS::SObject_ptr theSObject,
+                     VISU::IsoSurfaces_i* theServant,
+                     std::ostream& theStr,
+                     const std::string& theName,
+                     TColoredPrs3dFactory& thePrsFactory,
+                     std::string thePrefix)
+  {
+    thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+    theStr<<thePrefix<<theName<<".SetNbSurfaces("<<theServant->GetNbSurfaces()<<")"<<endl;
+
+    return thePrefix;
+  }
+
+
+  //---------------------------------------------------------------------------
+  std::string
+  CutPlanesToPython(SALOMEDS::SObject_ptr theSObject,
+                   VISU::CutPlanes_i* theServant,
+                   std::ostream& theStr,
+                   const std::string& theName,
+                   TColoredPrs3dFactory& thePrsFactory,
+                   std::string thePrefix)
+  {
+    thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+
+    std::string aParam;
+    switch(theServant->GetOrientationType()){
+    case CutPlanes::XY:
+      aParam = "VISU.CutPlanes.XY";
+      break;
+    case CutPlanes::YZ:
+      aParam = "VISU.CutPlanes.YZ";
+      break;
+    case CutPlanes::ZX:
+      aParam = "VISU.CutPlanes.ZX";
+      break;
+    }
+    theStr<<thePrefix<<theName<<".SetOrientation("<<aParam<<", "<<theServant->GetRotateX()<<", "<<theServant->GetRotateY()<<")"<<endl;
+    
+    theStr<<thePrefix<<theName<<".SetDisplacement("<<theServant->GetDisplacement()<<")"<<endl;
+    CORBA::Long aNbPlanes = theServant->GetNbPlanes();
+    theStr<<thePrefix<<theName<<".SetNbPlanes("<<aNbPlanes<<")"<<endl;
+    
+    for(CORBA::Long anId = 0; anId < aNbPlanes; anId++){
+      if(!theServant->IsDefault(anId))
+       theStr<<thePrefix<<theName<<".SetPlanePosition("<<anId<<", "<<theServant->GetPlanePosition(anId)<<")"<<endl;
+    }
+
+    return thePrefix;
+  }
+
+
+  //---------------------------------------------------------------------------
+  std::string
+  CutLinesToPython(SALOMEDS::SObject_ptr theSObject,
+                  VISU::CutLines_i* theServant,
+                  std::ostream& theStr,
+                  const std::string& theName,
+                  TColoredPrs3dFactory& thePrsFactory,
+                  std::string thePrefix)
+  {
+    thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+
+    std::string aParam;
+    switch(theServant->GetOrientationType()){
+    case CutPlanes::XY:
+      aParam = "VISU.CutPlanes.XY";
+      break;
+    case CutPlanes::YZ:
+      aParam = "VISU.CutPlanes.YZ";
+      break;
+    case CutPlanes::ZX:
+      aParam = "VISU.CutPlanes.ZX";
+      break;
+    }
+    theStr<<thePrefix<<theName<<".SetOrientation("<<aParam<<", "<<theServant->GetRotateX()<<", "<<theServant->GetRotateY()<<")"<<endl;
+    
+    switch(theServant->GetOrientationType2()){
+    case CutPlanes::XY:
+      aParam = "VISU.CutPlanes.XY";
+      break;
+    case CutPlanes::YZ:
+      aParam = "VISU.CutPlanes.YZ";
+      break;
+    case CutPlanes::ZX:
+      aParam = "VISU.CutPlanes.ZX";
+      break;
+    }
+    theStr<<thePrefix<<theName<<".SetOrientation2("<<aParam<<", "<<theServant->GetRotateX2()<<", "<<theServant->GetRotateY2()<<")"<<endl;
+    
+    theStr<<thePrefix<<theName<<".SetDisplacement("<<theServant->GetDisplacement()<<")"<<endl;
+    theStr<<thePrefix<<theName<<".SetDisplacement2("<<theServant->GetDisplacement2()<<")"<<endl;
+    
+    if(!theServant->IsDefault())
+      theStr<<thePrefix<<theName<<".SetBasePlanePosition("<<theServant->GetBasePlanePosition()<<")"<<endl;
+    
+    CORBA::Boolean aUseAbsLength = theServant->IsUseAbsoluteLength();
+    theStr<<thePrefix<<theName<<".SetUseAbsoluteLength("<<aUseAbsLength<<")"<<endl;
+    
+    CORBA::Long aNbLines = theServant->GetNbLines();
+    theStr<<thePrefix<<theName<<".SetNbLines("<<aNbLines<<")"<<endl;
+    for(CORBA::Long anId = 0; anId < aNbLines; anId++){
+      if(!theServant->IsDefaultPosition(anId))
+       theStr<<thePrefix<<theName<<".SetLinePosition("<<anId<<", "<<theServant->GetLinePosition(anId)<<")"<<endl;
+    }
+    
+    return thePrefix;
+  }
+
+
+  //---------------------------------------------------------------------------
+  std::string
+  Plot3DToPython(SALOMEDS::SObject_ptr theSObject,
+                VISU::Plot3D_i* theServant,
+                std::ostream& theStr,
+                const std::string& theName,
+                TColoredPrs3dFactory& thePrsFactory,
+                std::string thePrefix)
+  {
+    thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+
+    std::string aParam;
+    switch(theServant->GetOrientationType()){
+    case CutPlanes::XY: 
+      aParam = "VISU.Plot3D.XY"; 
+      break;
+    case CutPlanes::YZ: 
+      aParam = "VISU.Plot3D.YZ"; 
+      break;
+    case CutPlanes::ZX: 
+      aParam = "VISU.Plot3D.ZX"; 
+      break;
+    }
+    theStr<<thePrefix<<theName<<".SetOrientation("<<aParam<<", "<<theServant->GetRotateX()<<", "<<theServant->GetRotateY()<<")"<<endl;
+
+    theStr<<thePrefix<<theName<<".SetPlanePosition("<<theServant->GetPlanePosition()<<", "<<theServant->IsPositionRelative()<<")"<<endl;
+    theStr<<thePrefix<<theName<<".SetScaleFactor("<<theServant->GetScaleFactor()<<")"<<endl;
+    theStr<<thePrefix<<theName<<".SetContourPrs("<<theServant->GetIsContourPrs()<<")"<<endl;
+    theStr<<thePrefix<<theName<<".SetNbOfContours("<<theServant->GetNbOfContours()<<")"<<endl;
+
+    return thePrefix;
+  }
+
+
+  //---------------------------------------------------------------------------
   // declaration
   void DumpChildrenToPython(SALOMEDS::Study_ptr theStudy,
                            CORBA::Boolean theIsPublished,
@@ -291,7 +625,7 @@ namespace VISU
                            std::string theArgumentName,
                            std::string thePrefix);
 
-  //===========================================================================
+  //---------------------------------------------------------------------------
   template<class TTableAttr>
   void
   TableAttrToPython(SALOMEDS::Study_ptr theStudy,
@@ -331,7 +665,7 @@ namespace VISU
     theStr<<thePrefix<<"aBuilder.SetName("<<aSObjectName<<", \""<<theSObject->GetName()<<"\")"<<endl; // Fix for IPAL13165
     std::string aName = "aTableAttr";
     theStr<<thePrefix<<aName<<" = aBuilder.FindOrCreateAttribute("<<
-      aSObjectName<<",'"<<theAttrName<<"')"<<endl;
+      aSObjectName<<", '"<<theAttrName<<"')"<<endl;
 
     theStr<<thePrefix<<"if "<<aName<<":"<<endl;
     std::string aPrefix = thePrefix;
@@ -431,7 +765,7 @@ namespace VISU
   }
 
 
-  //===========================================================================
+  //---------------------------------------------------------------------------
   void
   DumpChildrenToPython(SALOMEDS::Study_ptr theStudy,
                       CORBA::Boolean theIsPublished,
@@ -459,7 +793,7 @@ namespace VISU
   }
 
 
-  //===========================================================================
+  //---------------------------------------------------------------------------
   void
   DumpTableAttrToPython(SALOMEDS::Study_ptr theStudy,
                        CORBA::Boolean theIsPublished,
@@ -507,7 +841,7 @@ namespace VISU
   }
 
 
-  //===========================================================================
+  //---------------------------------------------------------------------------
   void
   DumpToPython(SALOMEDS::Study_ptr theStudy,
               CORBA::Boolean theIsPublished,
@@ -550,7 +884,7 @@ namespace VISU
                  endl;
 
                theStr<<thePrefix<<aName<<".SetBuildFields("<<
-                 aServant->IsFieldsDone()<<","<<
+                 aServant->IsFieldsDone()<<", "<<
                  aServant->IsMinMaxDone()<<")"<<
                  endl;
 
@@ -647,19 +981,19 @@ namespace VISU
 
              if(aSubMeshName == "")
                theStr<<thePrefix<<aName<<" = aVisu.MeshOnEntity("<<theArgumentName<<
-                 ",'"<<aServant->GetCMeshName()<<"'"<<
-                 ","<<aParam<<
+                 ", '"<<aServant->GetCMeshName()<<"'"<<
+                 ", "<<aParam<<
                  ")"<<endl;
              else
                theStr<<thePrefix<<aName<<" = aVisu.FamilyMeshOnEntity("<<theArgumentName<<
-                 ",'"<<aServant->GetCMeshName()<<"'"<<
-                 ","<<aParam<<
-                 ",'"<<aSubMeshName<<"'"<<
+                 ", '"<<aServant->GetCMeshName()<<"'"<<
+                 ", "<<aParam<<
+                 ", '"<<aSubMeshName<<"'"<<
                  ")"<<endl;
            }else
              theStr<<thePrefix<<aName<<" = aVisu.GroupMesh("<<theArgumentName<<
-               ",'"<<aServant->GetCMeshName()<<"'"<<
-               ",'"<<aSubMeshName<<"'"<<
+               ", '"<<aServant->GetCMeshName()<<"'"<<
+               ", '"<<aSubMeshName<<"'"<<
                ")"<<endl;
 
            theStr<<thePrefix<<"if "<<aName<<":"<<endl;
@@ -669,7 +1003,7 @@ namespace VISU
            theStr<<thePrefix<<"aName2ObjectMap['"<<aName<<"'] = "<<aName<<endl;
 
            // Set name (as this object could be renamed by user)
-           theStr<<thePrefix<<"visu.SetName("<<aName<<",'"<<aNameInStudy.in()<<"')"<<endl;
+           theStr<<thePrefix<<"visu.SetName("<<aName<<", '"<<aNameInStudy.in()<<"')"<<endl;
 
            // Set parameters common for all Prs3d objects (offset values)
            Prs3dToPython(aServant,theStr,aName,thePrefix);
@@ -678,15 +1012,15 @@ namespace VISU
            SALOMEDS::Color aColor;
            aColor = aServant->GetCellColor();
            theStr<<thePrefix<<aName<<".SetCellColor(SALOMEDS.Color("<<
-             aColor.R<<","<<aColor.G<<","<<aColor.B<<"))"<<endl;
+             aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
 
            aColor = aServant->GetNodeColor();
            theStr<<thePrefix<<aName<<".SetNodeColor(SALOMEDS.Color("<<
-             aColor.R<<","<<aColor.G<<","<<aColor.B<<"))"<<endl;
+             aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
 
            aColor = aServant->GetLinkColor();
            theStr<<thePrefix<<aName<<".SetLinkColor(SALOMEDS.Color("<<
-             aColor.R<<","<<aColor.G<<","<<aColor.B<<"))"<<endl;
+             aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
 
            std::string aParam;
            switch(aServant->GetPresentationType()){
@@ -728,218 +1062,57 @@ namespace VISU
           break;
         case VISU::TSCALARMAP:
           if(ScalarMap_i* aServant = dynamic_cast<ScalarMap_i*>(GetServant(anObj).in())){
-           thePrefix = ScalarMapToPython(theSObject,aServant,theStr,aName,"ScalarMapOnField",theArgumentName,thePrefix);
+           TCreateFromResult aPrsFactory(theSObject, aServant, aName, "ScalarMapOnField", theArgumentName);
+           thePrefix = ScalarMapToPython(theSObject, aServant, theStr,aName, aPrsFactory, thePrefix);
            theStr<<thePrefix<<"pass"<<endl<<endl;
           }
           return;
         case VISU::TDEFORMEDSHAPE:
           if(DeformedShape_i* aServant = dynamic_cast<DeformedShape_i*>(GetServant(anObj).in())){
-           thePrefix = DeformedShapeToPython(theSObject,aServant,theStr,aName,"DeformedShapeOnField",theArgumentName,thePrefix);
+           TCreateFromResult aPrsFactory(theSObject, aServant, aName, "DeformedShapeOnField", theArgumentName);
+           thePrefix = DeformedShapeToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
            theStr<<thePrefix<<"pass"<<endl<<endl;
           }
           return;
         case VISU::TSTREAMLINES:
           if(StreamLines_i* aServant = dynamic_cast<StreamLines_i*>(GetServant(anObj).in())){
-           thePrefix = DeformedShapeToPython(theSObject,aServant,theStr,aName,"StreamLinesOnField",theArgumentName,thePrefix);
-
-           std::string aParam;
-           switch(aServant->GetDirection()){
-           case StreamLines::FORWARD:
-             aParam = "VISU.StreamLines.FORWARD";
-             break;
-           case StreamLines::BACKWARD:
-             aParam = "VISU.StreamLines.BACKWARD";
-             break;
-           case StreamLines::BOTH:
-             aParam = "VISU.StreamLines.BOTH";
-             break;
-           }
-
-           theStr<<thePrefix<<"aPrs3d = None"<<endl;
-           VISU::Prs3d_var aPrs3d = aServant->GetSource();
-           if(!CORBA::is_nil(aPrs3d)){
-             if(Prs3d_i* aServant3d = dynamic_cast<Prs3d_i*>(GetServant(aPrs3d).in())){
-               SALOMEDS::SObject_var aSObject = aServant3d->GetSObject();
-               CORBA::String_var anID = aSObject->GetID();
-               std::string anArg = theEntry2NameMap[anID.in()];
-               theStr<<thePrefix<<"if aName2ObjectMap.has_key('"<<anArg<<"'):"<<endl;
-               thePrefix += PREFIX;
-               theStr<<thePrefix<<"aPrs3d = aName2ObjectMap['"<<anArg<<"']"<<endl;
-             }
-           }
-
-           theStr<<thePrefix<<aName<<".SetParams("<<
-             aServant->GetIntegrationStep()<<","<<
-             aServant->GetPropagationTime()<<","<<
-             aServant->GetStepLength()<<","<<
-             "aPrs3d"<<","<<
-             aServant->GetUsedPoints()<<","<<
-             aParam<<
-             ")"<<endl;
-
+           TCreateFromResult aPrsFactory(theSObject, aServant, aName, "StreamLinesOnField", theArgumentName);
+           thePrefix = StreamLinesToPython(theSObject, aServant, theStr, theEntry2NameMap, aName, aPrsFactory, thePrefix);
            theStr<<thePrefix<<"pass"<<endl<<endl;
           }
           return;
         case VISU::TSCALARMAPONDEFORMEDSHAPE:
           if(ScalarMapOnDeformedShape_i* aServant = dynamic_cast<ScalarMapOnDeformedShape_i*>(GetServant(anObj).in())){
-           thePrefix = ScalarMapToPython(theSObject,aServant,theStr,aName,"ScalarMapOnDeformedShapeOnField",theArgumentName,thePrefix);
-
-           theStr<<thePrefix<<aName<<".SetRange("<<aServant->GetMin()<<","<<aServant->GetMax()<<")"<<endl;
-           theStr<<thePrefix<<aName<<".SetScale("<<aServant->GetScale()<<")"<<endl;
-
-           std::string aParam;
-           VISU::Entity anEntity = aServant->GetScalarEntity();
-           switch(anEntity){
-           case NODE:
-             aParam = "VISU.NODE";
-             break;
-           case EDGE:
-             aParam = "VISU.EDGE";
-             break;
-           case FACE:
-             aParam = "VISU.FACE";
-             break;
-           case CELL:
-             aParam = "VISU.CELL";
-             break;
-           }
-
-           CORBA::String_var aFieldName = aServant->GetScalarFieldName();
-           CORBA::Long aTimeStampNumber = aServant->GetScalarTimeStampNumber();
-
-           theStr<<thePrefix<<aName<<".SetScalarField("<<
-             aParam<<","<<
-             "'"<<aFieldName<<"',"<<
-             aTimeStampNumber<<
-             ")"<<endl;
-
+           TCreateFromResult aPrsFactory(theSObject, aServant, aName, "ScalarMapOnDeformedShapeOnField", theArgumentName);
+           thePrefix = ScalarMapOnDeformedShapeToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
            theStr<<thePrefix<<"pass"<<endl<<endl;
           }
           return;
         case VISU::TVECTORS:
           if(Vectors_i* aServant = dynamic_cast<Vectors_i*>(GetServant(anObj).in())){
-           thePrefix = DeformedShapeToPython(theSObject,aServant,theStr,aName,"VectorsOnField",theArgumentName,thePrefix);
-
-           theStr<<thePrefix<<aName<<".SetLineWidth("<<aServant->GetLineWidth()<<")"<<endl;
-
-           std::string aParam;
-           switch(aServant->GetGlyphType()){
-           case Vectors::ARROW:
-             aParam = "VISU.Vectors.ARROW";
-             break;
-           case Vectors::CONE2:
-             aParam = "VISU.Vectors.CONE2";
-             break;
-           case Vectors::CONE6:
-             aParam = "VISU.Vectors.CONE6";
-             break;
-           case Vectors::NONE:
-             aParam = "VISU.Vectors.NONE";
-             break;
-           }
-           theStr<<thePrefix<<aName<<".SetGlyphType("<<aParam<<")"<<endl;
-
-           switch(aServant->GetGlyphPos()){
-           case Vectors::CENTER:
-             aParam = "VISU.Vectors.CENTER";
-             break;
-           case Vectors::TAIL:
-             aParam = "VISU.Vectors.TAIL";
-             break;
-           case Vectors::HEAD:
-             aParam = "VISU.Vectors.HEAD";
-             break;
-           }
-           theStr<<thePrefix<<aName<<".SetGlyphPos("<<aParam<<")"<<endl;
-
+           TCreateFromResult aPrsFactory(theSObject, aServant, aName, "VectorsOnField", theArgumentName);
+           thePrefix = VectorsToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
            theStr<<thePrefix<<"pass"<<endl<<endl;
           }
           return;
         case VISU::TISOSURFACES:
           if(IsoSurfaces_i* aServant = dynamic_cast<IsoSurfaces_i*>(GetServant(anObj).in())){
-           thePrefix = ScalarMapToPython(theSObject,aServant,theStr,aName,"IsoSurfacesOnField",theArgumentName,thePrefix);
-           theStr<<thePrefix<<aName<<".SetNbSurfaces("<<aServant->GetNbSurfaces()<<")"<<endl;
+           TCreateFromResult aPrsFactory(theSObject, aServant, aName, "IsoSurfacesOnField", theArgumentName);
+           thePrefix = IsoSurfacesToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
            theStr<<thePrefix<<"pass"<<endl<<endl;
           }
           return;
         case VISU::TCUTPLANES:
           if(CutPlanes_i* aServant = dynamic_cast<CutPlanes_i*>(GetServant(anObj).in())){
-           thePrefix = ScalarMapToPython(theSObject,aServant,theStr,aName,"CutPlanesOnField",theArgumentName,thePrefix);
-
-           std::string aParam;
-           switch(aServant->GetOrientationType()){
-           case CutPlanes::XY:
-             aParam = "VISU.CutPlanes.XY";
-             break;
-           case CutPlanes::YZ:
-             aParam = "VISU.CutPlanes.YZ";
-             break;
-           case CutPlanes::ZX:
-             aParam = "VISU.CutPlanes.ZX";
-             break;
-           }
-           theStr<<thePrefix<<aName<<".SetOrientation("<<aParam<<","<<aServant->GetRotateX()<<","<<aServant->GetRotateY()<<")"<<endl;
-
-           theStr<<thePrefix<<aName<<".SetDisplacement("<<aServant->GetDisplacement()<<")"<<endl;
-           CORBA::Long aNbPlanes = aServant->GetNbPlanes();
-           theStr<<thePrefix<<aName<<".SetNbPlanes("<<aNbPlanes<<")"<<endl;
-
-           for(CORBA::Long anId = 0; anId < aNbPlanes; anId++){
-             if(!aServant->IsDefault(anId))
-               theStr<<thePrefix<<aName<<".SetPlanePosition("<<anId<<","<<aServant->GetPlanePosition(anId)<<")"<<endl;
-           }
-
+           TCreateFromResult aPrsFactory(theSObject, aServant, aName, "CutPlanesOnField", theArgumentName);
+           thePrefix = CutPlanesToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
            theStr<<thePrefix<<"pass"<<endl<<endl;
           }
           return;
         case VISU::TCUTLINES:
           if(CutLines_i* aServant = dynamic_cast<CutLines_i*>(GetServant(anObj).in())){
-           thePrefix = ScalarMapToPython(theSObject,aServant,theStr,aName,"CutLinesOnField",theArgumentName,thePrefix);
-
-           std::string aParam;
-           switch(aServant->GetOrientationType()){
-           case CutPlanes::XY:
-             aParam = "VISU.CutPlanes.XY";
-             break;
-           case CutPlanes::YZ:
-             aParam = "VISU.CutPlanes.YZ";
-             break;
-           case CutPlanes::ZX:
-             aParam = "VISU.CutPlanes.ZX";
-             break;
-           }
-           theStr<<thePrefix<<aName<<".SetOrientation("<<aParam<<","<<aServant->GetRotateX()<<","<<aServant->GetRotateY()<<")"<<endl;
-
-           switch(aServant->GetOrientationType2()){
-           case CutPlanes::XY:
-             aParam = "VISU.CutPlanes.XY";
-             break;
-           case CutPlanes::YZ:
-             aParam = "VISU.CutPlanes.YZ";
-             break;
-           case CutPlanes::ZX:
-             aParam = "VISU.CutPlanes.ZX";
-             break;
-           }
-           theStr<<thePrefix<<aName<<".SetOrientation2("<<aParam<<","<<aServant->GetRotateX2()<<","<<aServant->GetRotateY2()<<")"<<endl;
-
-           theStr<<thePrefix<<aName<<".SetDisplacement("<<aServant->GetDisplacement()<<")"<<endl;
-           theStr<<thePrefix<<aName<<".SetDisplacement2("<<aServant->GetDisplacement2()<<")"<<endl;
-
-           if(!aServant->IsDefault())
-             theStr<<thePrefix<<aName<<".SetBasePlanePosition("<<aServant->GetBasePlanePosition()<<")"<<endl;
-
-            CORBA::Boolean aUseAbsLength = aServant->IsUseAbsoluteLength();
-           theStr<<thePrefix<<aName<<".SetUseAbsoluteLength("<<aUseAbsLength<<")"<<endl;
-           
-           CORBA::Long aNbLines = aServant->GetNbLines();
-           theStr<<thePrefix<<aName<<".SetNbLines("<<aNbLines<<")"<<endl;
-           for(CORBA::Long anId = 0; anId < aNbLines; anId++){
-             if(!aServant->IsDefaultPosition(anId))
-               theStr<<thePrefix<<aName<<".SetLinePosition("<<anId<<","<<aServant->GetLinePosition(anId)<<")"<<endl;
-           }
-
-           theStr<<endl;
+           TCreateFromResult aPrsFactory(theSObject, aServant, aName, "CutLinesOnField", theArgumentName);
+           thePrefix = CutLinesToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
 
            theArgumentName = aName;
            DumpChildrenToPython(theStudy,
@@ -957,26 +1130,15 @@ namespace VISU
           return;
         case VISU::TPLOT3D:
           if (Plot3D_i* aServant = dynamic_cast<Plot3D_i*>(GetServant(anObj).in())) {
-            thePrefix = ScalarMapToPython(theSObject, aServant, theStr, aName,"Plot3DOnField", theArgumentName, thePrefix);
-
-           std::string aParam;
-           switch(aServant->GetOrientationType()){
-           case CutPlanes::XY: aParam = "VISU.Plot3D.XY"; break;
-           case CutPlanes::YZ: aParam = "VISU.Plot3D.YZ"; break;
-           case CutPlanes::ZX: aParam = "VISU.Plot3D.ZX"; break;
-           }
-           theStr<<thePrefix<<aName<<".SetOrientation("<<aParam<<","<<aServant->GetRotateX()<<","<<aServant->GetRotateY()<<")"<<endl;
-
-           theStr<<thePrefix<<aName<<".SetPlanePosition("<<aServant->GetPlanePosition()<<","<<aServant->IsPositionRelative()<<")"<<endl;
-           theStr<<thePrefix<<aName<<".SetScaleFactor("<<aServant->GetScaleFactor()<<")"<<endl;
-            theStr<<thePrefix<<aName<<".SetContourPrs("<<aServant->GetIsContourPrs()<<")"<<endl;
-            theStr<<thePrefix<<aName<<".SetNbOfContours("<<aServant->GetNbOfContours()<<")"<<endl;
+           TCreateFromResult aPrsFactory(theSObject, aServant, aName, "Plot3DOnField", theArgumentName);
+            thePrefix = Plot3DToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
             theStr<<thePrefix<<"pass"<<endl<<endl;
           }
           return;
         case VISU::TGAUSSPOINTS:
           if(GaussPoints_i* aServant = dynamic_cast<GaussPoints_i*>(GetServant(anObj).in())){
-           thePrefix = ColoredPrs3dToPython(theSObject,aServant,theStr,aName,"GaussPointsOnField",theArgumentName,thePrefix);
+           TCreateFromResult aPrsFactory(theSObject, aServant, aName, "GaussPointsOnField", theArgumentName);
+           thePrefix = ColoredPrs3dToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
            theStr<<thePrefix<<"pass"<<endl<<endl;
           }
           return;
@@ -990,15 +1152,15 @@ namespace VISU
              theStr << "WithZ";
            theStr << "(" <<
               theArgumentName<< // table
-                ","<<aServant->GetHRow()<< // H row
-                  ","<<aServant->GetVRow(); // V row
+                ", "<<aServant->GetHRow()<< // H row
+                  ", "<<aServant->GetVRow(); // V row
            if( withZ )
-             theStr << "," << aServant->GetZRow(); // Z row
+             theStr << ", " << aServant->GetZRow(); // Z row
 
-           theStr << ",'"<<aServant->GetTitle()<<"'"; // title
+           theStr << ", '"<<aServant->GetTitle()<<"'"; // title
            SALOMEDS::Color aColor = aServant->GetColor();
            theStr << ",SALOMEDS.Color("<<
-             aColor.R<<","<<aColor.G<<","<<aColor.B<<")"; // color
+             aColor.R<<", "<<aColor.G<<", "<<aColor.B<<")"; // color
 
            std::string aParam;
            switch(aServant->GetMarker()){
@@ -1013,7 +1175,7 @@ namespace VISU
            case Curve::CROSS:     aParam = "VISU.Curve.CROSS";     break;
            case Curve::XCROSS:    aParam = "VISU.Curve.XCROSS";    break;
            }
-           theStr<<","<<aParam; // marker
+           theStr<<", "<<aParam; // marker
 
            switch(aServant->GetLine()){
            case Curve::VOIDLINE:       aParam = "VISU.Curve.VOIDLINE";       break;
@@ -1023,7 +1185,7 @@ namespace VISU
            case Curve::DASHDOTLINE:    aParam = "VISU.Curve.DASHDOTLINE";    break;
            case Curve::DASHDOTDOTLINE: aParam = "VISU.Curve.DASHDOTDOTLINE"; break;
            }
-           theStr<<","<<aParam<<","<<aServant->GetLineWidth()<<")"<<endl; // line type,width
+           theStr<<", "<<aParam<<", "<<aServant->GetLineWidth()<<")"<<endl; // line type,width
           }
          return;
         case VISU::TTABLE:
@@ -1113,31 +1275,96 @@ namespace VISU
           }
           return;
         case VISU::TCOLOREDPRS3DCACHE:
-          if(ColoredPrs3dCache_i* aServant = dynamic_cast<ColoredPrs3dCache_i*>(GetServant(anObj).in())){
-           theStr<<thePrefix<<"aCache = aVisu.GetColoredPrs3dCache(aVisu.GetCurrentStudy())"<<endl<<endl;
-           TColoredPrs3dHolderMap aHolderMap = aServant->GetHolderMap();
-           TColoredPrs3dHolderMap::const_iterator aHolderIter = aHolderMap.begin();
-           TColoredPrs3dHolderMap::const_iterator aHolderIterEnd = aHolderMap.end();
-           for(; aHolderIter != aHolderIterEnd; aHolderIter++){
-             const TLastVisitedPrsList& aPrsList = aHolderIter->second;
-             if(TPrs3dPtr aPrs3d = aPrsList.front())
-             {
-               ColoredPrs3dHolder::BasicInput_var anInput = aPrs3d->GetBasicInput();
-
-               std::string anEntity;
-               switch(anInput->myEntity){
-                 case VISU::NODE : anEntity = "VISU.NODE"; break;
-                 case VISU::EDGE : anEntity = "VISU.EDGE"; break;
-                 case VISU::FACE : anEntity = "VISU.FACE"; break;
-                 case VISU::CELL : anEntity = "VISU.CELL"; break;
+         theStr<<thePrefix<<"aCache = aVisu.GetColoredPrs3dCache(aVisu.GetCurrentStudy())"<<endl<<endl;
+         SALOMEDS::ChildIterator_var aChildItet = theStudy->NewChildIterator(theSObject);
+         for(aChildItet->InitEx(false); aChildItet->More(); aChildItet->Next()){
+           SALOMEDS::SObject_var aSObject = aChildItet->Value();
+           CORBA::Object_var anObject = SObjectToObject(aSObject);
+           if (CORBA::is_nil(anObject))
+             continue;
+           if(ColoredPrs3dHolder_i* aServant = dynamic_cast<ColoredPrs3dHolder_i*>(GetServant(anObject).in())){
+             ColoredPrs3dHolder::BasicInput_var anInput = aServant->GetBasicInput();
+             std::string anEntity;
+             switch(anInput->myEntity){
+             case VISU::NODE : anEntity = "VISU.NODE"; break;
+             case VISU::EDGE : anEntity = "VISU.EDGE"; break;
+             case VISU::FACE : anEntity = "VISU.FACE"; break;
+             case VISU::CELL : anEntity = "VISU.CELL"; break;
+             }
+             
+             ColoredPrs3d_var aDevice = aServant->GetDevice();
+             theStr<<thePrefix<<"anInput = VISU.ColoredPrs3dHolder.BasicInput("<<
+               aResultName<<", '"<<
+               anInput->myMeshName<<"', "<<
+               anEntity<<", '"<<
+               anInput->myFieldName<<"', "<<
+               anInput->myTimeStampNumber<<")"<<
+               endl;
+             
+             if(Prs3d_i* aPrs3d = dynamic_cast<Prs3d_i*>(GetServant(aDevice).in())){
+               std::string aComment = aPrs3d->GetComment();
+               theStr<<thePrefix<<"aHolder = aCache.CreateHolder(VISU.T"<<aComment<<", anInput)"<<endl;
+               theStr<<thePrefix<<"if aHolder != None:"<<endl;
+               {
+                 std::string aPrefix = thePrefix + PREFIX;
+                 CORBA::String_var aNameInStudy = aSObject->GetName();
+                 theStr<<aPrefix<<"visu.SetName(aHolder, '"<<aNameInStudy.in()<<"')"<<endl;
+                 theStr<<aPrefix<<"aDevice = aHolder.GetDevice()"<<endl;
+                 TColoredPrs3dFactory aPrsFactory;
+                 switch(aPrs3d->GetType()){
+                 case VISU::TSCALARMAP:
+                   if(ScalarMap_i* aServant = dynamic_cast<ScalarMap_i*>(aPrs3d)){
+                     aPrefix = ScalarMapToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
+                     break;
+                   }
+                 case VISU::TDEFORMEDSHAPE:
+                   if(DeformedShape_i* aServant = dynamic_cast<DeformedShape_i*>(aPrs3d)){
+                     aPrefix = DeformedShapeToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
+                     break;
+                   }
+                 case VISU::TSTREAMLINES:
+                   if(StreamLines_i* aServant = dynamic_cast<StreamLines_i*>(aPrs3d)){
+                     aPrefix = StreamLinesToPython(aSObject, aServant, theStr, theEntry2NameMap, "aDevice", aPrsFactory, aPrefix);
+                     break;
+                   }
+                 case VISU::TSCALARMAPONDEFORMEDSHAPE:
+                   if(ScalarMapOnDeformedShape_i* aServant = dynamic_cast<ScalarMapOnDeformedShape_i*>(aPrs3d)){
+                     aPrefix = ScalarMapOnDeformedShapeToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
+                     break;
+                   }
+                 case VISU::TVECTORS:
+                   if(Vectors_i* aServant = dynamic_cast<Vectors_i*>(aPrs3d)){
+                     aPrefix = VectorsToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
+                     break;
+                   }
+                 case VISU::TISOSURFACES:
+                   if(IsoSurfaces_i* aServant = dynamic_cast<IsoSurfaces_i*>(aPrs3d)){
+                     aPrefix = IsoSurfacesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
+                     break;
+                   }
+                 case VISU::TCUTPLANES:
+                   if(CutPlanes_i* aServant = dynamic_cast<CutPlanes_i*>(aPrs3d)){
+                     aPrefix = CutPlanesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
+                     break;
+                   }
+                 case VISU::TCUTLINES:
+                   if(CutLines_i* aServant = dynamic_cast<CutLines_i*>(aPrs3d)){
+                     aPrefix = CutLinesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
+                     break;
+                   }
+                 case VISU::TPLOT3D:
+                   if (Plot3D_i* aServant = dynamic_cast<Plot3D_i*>(aPrs3d)) {
+                     aPrefix = Plot3DToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
+                     break;
+                   }
+                 case VISU::TGAUSSPOINTS:
+                   if(GaussPoints_i* aServant = dynamic_cast<GaussPoints_i*>(aPrs3d)){
+                     aPrefix = ColoredPrs3dToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
+                     break;
+                   }
+                 }
+                 theStr<<aPrefix<<"pass"<<endl<<endl;
                }
-
-               theStr<<thePrefix<<"anInput = VISU.ColoredPrs3dHolder.BasicInput("<<aResultName<<",'"<<
-                 anInput->myMeshName<<"',"<<anEntity<<",'"<<
-                 anInput->myFieldName<<"',"<<anInput->myTimeStampNumber<<")"<<endl;
-
-               std::string aType = aPrs3d->GetComment();
-               theStr<<thePrefix<<"aHolder = aCache.CreateHolder(VISU.T"<<aType<<",anInput)"<<endl<<endl;
              }
            }
           }
@@ -1208,19 +1435,19 @@ namespace VISU
            }
 
            if (aTypeName == "ENTITY" ) {
-             theStr<<thePrefix<<"aVisu.RenameEntityInStudy("<<theArgumentName<<",'"<<aMeshName
-                   <<"',"<<anEntityType<<",'"<<aNameInStudy.in()<<"')"<<endl;
+             theStr<<thePrefix<<"aVisu.RenameEntityInStudy("<<theArgumentName<<", '"<<aMeshName
+                   <<"', "<<anEntityType<<", '"<<aNameInStudy.in()<<"')"<<endl;
            }
            else if (aTypeName == "FAMILY") {
              if (aSubMeshName != aNameInStudy.in()) {
-               theStr<<thePrefix<<"aVisu.RenameFamilyInStudy("<<theArgumentName<<",'"<<aMeshName
-                     <<"',"<<anEntityType<<",'"<<aSubMeshName<<"','"<<aNameInStudy.in()<<"')"<<endl;
+               theStr<<thePrefix<<"aVisu.RenameFamilyInStudy("<<theArgumentName<<", '"<<aMeshName
+                     <<"', "<<anEntityType<<", '"<<aSubMeshName<<"', '"<<aNameInStudy.in()<<"')"<<endl;
              }
            }
            else { // "GROUP"
              if (aSubMeshName != aNameInStudy.in()) {
-               theStr<<thePrefix<<"aVisu.RenameGroupInStudy("<<theArgumentName<<",'"<<aMeshName
-                     <<"','"<<aSubMeshName<<"','"<<aNameInStudy.in()<<"')"<<endl;
+               theStr<<thePrefix<<"aVisu.RenameGroupInStudy("<<theArgumentName<<", '"<<aMeshName
+                     <<"', '"<<aSubMeshName<<"', '"<<aNameInStudy.in()<<"')"<<endl;
              }
            }
          }
@@ -1250,7 +1477,7 @@ namespace VISU
   }
 
 
-  //===========================================================================
+  //---------------------------------------------------------------------------
   void
   DumpCurveToPython(SALOMEDS::Study_ptr theStudy,
                    CORBA::Boolean theIsPublished,
@@ -1285,7 +1512,7 @@ namespace VISU
   }
 
 
-  //===========================================================================
+  //---------------------------------------------------------------------------
   void
   DumpContainersToPython(SALOMEDS::Study_ptr theStudy,
                         CORBA::Boolean theIsPublished,
@@ -1318,7 +1545,7 @@ namespace VISU
 
        // Set name (as this object could be renamed by user)
        CORBA::String_var aNameInStudy = aSObject->GetName();
-       theStr<<aPrefix<<"visu.SetName("<<aName<<",'"<<aNameInStudy.in()<<"')"<<endl;
+       theStr<<aPrefix<<"visu.SetName("<<aName<<", '"<<aNameInStudy.in()<<"')"<<endl;
 
        SALOMEDS::ChildIterator_var aCurveIter = theStudy->NewChildIterator(aSObject);
        for(aCurveIter->InitEx(false); aCurveIter->More(); aCurveIter->Next()){
@@ -1331,7 +1558,7 @@ namespace VISU
     }
   }
 
-  //===========================================================================
+  //---------------------------------------------------------------------------
   void
   DumpAnimationsToPython(SALOMEDS::Study_ptr theStudy,
                         CORBA::Boolean theIsPublished,
@@ -1391,7 +1618,7 @@ namespace VISU
          value = refObj->GetName();
          QString path(theStudy->GetObjectPath(father));
          //The following code requierd as a field name can contain '/' character
-         theStr<<thePrefix<<"aBuilder.Addreference(fieldSO,getSObjectByFatherPathAndName(theStudy,'"<<path<<"','"<<value<<"'))"<<endl;
+         theStr<<thePrefix<<"aBuilder.Addreference(fieldSO,getSObjectByFatherPathAndName(theStudy, '"<<path<<"', '"<<value<<"'))"<<endl;
        }
        value = anObj->GetName();
        if(!value.isEmpty()) theStr<<thePrefix<<"aBuilder.SetName(fieldSO, '"<<value<<"')"<< endl;
@@ -1418,7 +1645,7 @@ namespace VISU
     theStr<<endl;
   }
 
-  //===========================================================================
+  //---------------------------------------------------------------------------
   Engines::TMPFile*
   VISU_Gen_i::
   DumpPython(CORBA::Object_ptr theStudy,
index 58996e3f9bb65e244efc4ada3f72af6b1064c1fb..3a82f2be5abe911149e3635ae9e19ccb81446d93 100644 (file)
@@ -308,22 +308,6 @@ VISU::ScalarMap_i
 }
 
 
-//----------------------------------------------------------------------------
-void
-VISU::ScalarMap_i
-::SetBarOrientation(VISU::ScalarMap::Orientation theOrientation)
-{
-  TSuperClass::SetBarOrientation(theOrientation);
-}
-
-//----------------------------------------------------------------------------
-VISU::ScalarMap::Orientation 
-VISU::ScalarMap_i
-::GetBarOrientation() 
-{
-  return TSuperClass::GetBarOrientation();
-}
-
 //----------------------------------------------------------------------------
 VISU::Scaling 
 VISU::ScalarMap_i
index 0ca9404c9703e96ac6e7bb95ba21e9a2e7f9618a..6d73120b0252f9b471d07655832a4101e7bfc778 100644 (file)
@@ -84,15 +84,6 @@ namespace VISU
     void
     SetSourceRange();
     
-    // To provide backward compatibility
-    virtual
-    void
-    SetBarOrientation(VISU::ScalarMap::Orientation theOrientation);
-
-    virtual 
-    VISU::ScalarMap::Orientation 
-    GetBarOrientation();
-
     //----------------------------------------------------------------------------
     //! Sets initial source geometry
     virtual