]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To introduce first version of the functionality
authorapo <apo@opencascade.com>
Fri, 27 Oct 2006 13:40:24 +0000 (13:40 +0000)
committerapo <apo@opencascade.com>
Fri, 27 Oct 2006 13:40:24 +0000 (13:40 +0000)
44 files changed:
idl/VISU_Gen.idl
src/ENGINE/VISU_Engine_i.cc
src/ENGINE/VISU_Engine_i.hh
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_ClippingDlg.cxx
src/VISUGUI/VisuGUI_CutLinesDlg.cxx
src/VISUGUI/VisuGUI_CutPlanesDlg.cxx
src/VISUGUI/VisuGUI_Plot3DDlg.cxx
src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx
src/VISUGUI/VisuGUI_StreamLinesDlg.cxx
src/VISU_I/VISU_ColoredPrs3d_i.cc
src/VISU_I/VISU_ColoredPrs3d_i.hh
src/VISU_I/VISU_CutLines_i.cc
src/VISU_I/VISU_CutLines_i.hh
src/VISU_I/VISU_CutPlanes_i.cc
src/VISU_I/VISU_CutPlanes_i.hh
src/VISU_I/VISU_DeformedShape_i.cc
src/VISU_I/VISU_DeformedShape_i.hh
src/VISU_I/VISU_DumpPython.cc
src/VISU_I/VISU_GaussPoints_i.cc
src/VISU_I/VISU_GaussPoints_i.hh
src/VISU_I/VISU_Gen_i.cc
src/VISU_I/VISU_Gen_i.hh
src/VISU_I/VISU_IsoSurfaces_i.cc
src/VISU_I/VISU_IsoSurfaces_i.hh
src/VISU_I/VISU_Mesh_i.cc
src/VISU_I/VISU_Mesh_i.hh
src/VISU_I/VISU_Plot3D_i.cc
src/VISU_I/VISU_Plot3D_i.hh
src/VISU_I/VISU_Prs3d_i.cc
src/VISU_I/VISU_Prs3d_i.hh
src/VISU_I/VISU_PrsObject_i.cc
src/VISU_I/VISU_PrsObject_i.hh
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh
src/VISU_I/VISU_ScalarMap_i.cc
src/VISU_I/VISU_ScalarMap_i.hh
src/VISU_I/VISU_StreamLines_i.cc
src/VISU_I/VISU_StreamLines_i.hh
src/VISU_I/VISU_Table_i.cc
src/VISU_I/VISU_Vectors_i.cc
src/VISU_I/VISU_Vectors_i.hh
src/VISU_I/VISU_View_i.cc
src/VISU_SWIG/visu_change_input.py [new file with mode: 0644]

index 2f1d27f9c008597788b7deadc7c690724a4c0ff7..986f8ea316a9d2b59ebc0467426f42364ed9a9ac 100644 (file)
@@ -307,13 +307,34 @@ module VISU {
   };
 
   //-------------------------------------------------------
+  interface Result;
   /*! \brief 3D presentation interface
    *
    * This is a root class for all 3D presentations, which can be displayed in %VISU module.
    */
   interface Prs3d : PrsObject, SALOME::GenericObj {
-    //interface Prs3d : PrsObject{
+    /*!
+     * Applies a set basic input parameters to the 3D presentation
+     * \return True of the set of input parameters is correct and was succesfully applied,
+     * False otherwise
+     */
+    boolean Apply(); 
+
+    void SetResultObject(in Result theResult);
+    Result GetResultObject();
+
+    void SetMeshName(in string theMeshName);
+    string GetMeshName();
+
+    /*!
+     * Move the 3D presentation according to the given offset parameters
+     */
     void SetOffset(in float theDx, in float theDy, in float theDz);
+
+
+    /*!
+     * Gets offset parameters for the 3D presentation
+     */
     void GetOffset(out float theDx, out float theDy, out float theDz);
   };
 
@@ -392,7 +413,17 @@ module VISU {
    * bar is displayed along with each colored field presentation and serves for
    * consulting the correspondance between colors and data values.
    */
-  interface ColoredPrs3d : Prs3d {
+  interface ColoredPrs3d : Prs3d 
+  {
+    void SetEntity(in Entity theEntity);
+    Entity GetEntity();
+
+    void SetFieldName(in string theName);
+    string GetFieldName();
+
+    void SetTimeStampNumber(in long theTimeStampNumber);
+    long GetTimeStampNumber();
+
     /*! Sets the method of coloring of the elements composing a 3D presentation.
      */
     void SetScalarMode(in long theScalarMode);
@@ -1435,6 +1466,12 @@ module VISU {
                            in string theSubMeshName,
                            in string theNewName);
 
+    /*!
+     * Creates a VISU 3D presentation according to the given type
+     * \param theType Type that defines what kind of 3D presentation should be created
+     */
+    Prs3d CreatePrs3d(in VISUType theType, in SALOMEDS::Study theStudy);
+
     /*!
      * Creates a mesh on the basis of the data generated in other sources (MED object or file).
      * \param theResult   Data generated in other sources. (MED object or file)
index 0563dad2b58238f88a1bdb38a619b98c493b8334..fcce515b7888c1944e570e2e0baaf123b7f04637 100644 (file)
@@ -189,6 +189,12 @@ namespace VISU{
     return myVisuGen->MeshOnEntity(theResult,theMeshName,theEntity);
   }
 
+  Prs3d_ptr VISU_Gen_i::CreatePrs3d(VISUType theType,
+                                  SALOMEDS::Study_ptr theStudy)
+  {
+    return myVisuGen->CreatePrs3d(theType,theStudy);
+  }
+
   Mesh_ptr VISU_Gen_i::FamilyMeshOnEntity(Result_ptr theResult, 
                                          const char* theMeshName, 
                                          VISU::Entity theEntity, 
index 3f605b435e65e61e1ca1a7eaa3f048b7d0419a4f..0b6727a1f39d342a719bf5172461386777b1f24e 100644 (file)
@@ -29,7 +29,8 @@
 
 #include "SALOME_Component_i.hxx"
 
-namespace VISU{
+namespace VISU
+{
   class VISU_Gen_i : public virtual POA_VISU::VISU_Gen,
                     public virtual ::Engines_Component_i
   {
@@ -62,6 +63,10 @@ namespace VISU{
     virtual Result_ptr ImportMed(SALOMEDS::SObject_ptr theMedSObject);
     virtual Result_ptr ImportMedField(SALOME_MED::FIELD_ptr theField);
 
+    Prs3d_ptr
+    CreatePrs3d(VISUType theType,
+               SALOMEDS::Study_ptr theStudy);
+
     //Create Presentation Of Submeshes
     virtual Mesh_ptr MeshOnEntity(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity);
     virtual Mesh_ptr FamilyMeshOnEntity(Result_ptr theResult, const char* theMeshName,
index 8266ce946340111e04c392d9c4a006a855177532..aee24b7f518206f9fc0309f69e10f74a5b76b82a 100644 (file)
@@ -1792,7 +1792,7 @@ OnCopyPresentation()
   case VISU::TPLOT3D:
     {
       VISU::Plot3D_i* aPlot3DPrs = dynamic_cast<VISU::Plot3D_i*>(aPrsObject);
-      VISU::Plot3D_i* aSamePlot3D = new VISU::Plot3D_i(aPlot3DPrs->GetResult());
+      VISU::Plot3D_i* aSamePlot3D = new VISU::Plot3D_i(aPlot3DPrs->GetResult(),true);
       aSamePlot3D->SameAs(aPlot3DPrs);
     }
     break;
index 87195d3193366917fb153598090a4f82d9b36d89..f0b526a0b23072c92594318f2a5f843ce3fb947e 100644 (file)
@@ -958,8 +958,9 @@ void VisuGUI_ClippingDlg::SetCurrentPlaneIJKParam()
   int i, axId = ButtonGroupIJKAxis->id (ButtonGroupIJKAxis->selected());
   VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) axId;
   gp_Dir dir;
+  CORBA::String_var aMeshName = myPrs3d->GetMeshName();
   const vector<vtkFloatingPointType> * values =
-    result->GetAxisInfo(myPrs3d->GetMeshName(), axis, dir);
+    result->GetAxisInfo(aMeshName.in(), axis, dir);
   if (!values)
     return;
 
@@ -1038,7 +1039,8 @@ void VisuGUI_ClippingDlg::setIJKByNonStructured()
   VISU::Result_i* result = myPrs3d->GetResult();
   for (i = 0; i < 3; ++i) {
     VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) i;
-    curValues = result->GetAxisInfo(myPrs3d->GetMeshName(), axis, dir);
+    CORBA::String_var aMeshName = myPrs3d->GetMeshName();
+    curValues = result->GetAxisInfo(aMeshName.in(), axis, dir);
     if (curValues) {
       double dot = normal * dir;
       if (Abs(dot) > Abs(maxDot)) {
@@ -1090,7 +1092,8 @@ bool VisuGUI_ClippingDlg::isStructured() const
   VISU::Result_i* result = myPrs3d ? myPrs3d->GetResult() : 0;
   if (result) {
     gp_Dir dir;
-    return result->GetAxisInfo(myPrs3d->GetMeshName(),
+    CORBA::String_var aMeshName = myPrs3d->GetMeshName();
+    return result->GetAxisInfo(aMeshName.in(),
                                VISU::Result_i::AXIS_X,
                                dir);
   }
@@ -1109,7 +1112,8 @@ void VisuGUI_ClippingDlg::onIJKAxisChanged(int axisId)
   if (result) {
     VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) axisId;
     gp_Dir dir;
-    const vector<vtkFloatingPointType> * indices = result->GetAxisInfo(myPrs3d->GetMeshName(),
+    CORBA::String_var aMeshName = myPrs3d->GetMeshName();
+    const vector<vtkFloatingPointType> * indices = result->GetAxisInfo(aMeshName.in(),
                                                                       axis, dir);
     if (indices)
       maxIndex = indices->size() - 1;
index d189683ffedef1ed5f16db779633026331f91bb8..96d8cddf6aa984bbbb86439ff55a1e9778d7cfa2 100644 (file)
@@ -355,7 +355,7 @@ void VisuGUI_CutLinesDlg::createPlanes()
 
   storeToPrsObject(myCutLines);
   myCutLines->GetPL()->Update();
-  vtkAppendPolyData* aPolyData = myCutLines->GetCutLinesPL()->GetAppendPolyData();
+  vtkAppendPolyData* aPolyData = myCutLines->GetSpecificPL()->GetAppendPolyData();
   vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New();
   aPlaneMapper->SetInput(aPolyData->GetOutput());
   aPlaneMapper->ScalarVisibilityOff();
@@ -562,12 +562,12 @@ void VisuGUI_CutLinesDlg::DrawTable()
 
 void VisuGUI_CutLinesDlg::updateGlyphs(bool update){
   if (myPreviewActorGlyphs == 0 ) return;
-  const vtkFloatingPointType *aDirLn = myCutLines->GetCutLinesPL()->GetRealDirLn();
-  const vtkFloatingPointType *aBasePnt = myCutLines->GetCutLinesPL()->GetBasePnt();
+  const vtkFloatingPointType *aDirLn = myCutLines->GetSpecificPL()->GetRealDirLn();
+  const vtkFloatingPointType *aBasePnt = myCutLines->GetSpecificPL()->GetBasePnt();
   vtkFloatingPointType aSecondPnt[3];
   vtkFloatingPointType aBoundCenter[3];
 
-  vtkAppendPolyData* aPolyData = myCutLines->GetCutLinesPL()->GetAppendPolyData();
+  vtkAppendPolyData* aPolyData = myCutLines->GetSpecificPL()->GetAppendPolyData();
   vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New();
   aPlaneMapper->SetInput(aPolyData->GetOutput());
   vtkFloatingPointType bounds[6];
index 2666f0cf775a7ca455ef6532a9d3cd3feec73072..aadb2de3ec9de9a94bc4ee463b92d377f2d767b1 100644 (file)
@@ -201,7 +201,7 @@ void VisuGUI_CutPlanesPane::createPlanes()
   if (myCutPlanes == NULL) return;
   if (myPreviewActor != 0) return;
 
-  vtkAppendPolyData* aPolyData = myCutPlanes->GetCutPlanesPL()->GetAppendPolyData();
+  vtkAppendPolyData* aPolyData = myCutPlanes->GetSpecificPL()->GetAppendPolyData();
   if (!aPolyData->GetOutput()->GetNumberOfCells()) {
     onPreviewCheck(false);
     return;
index 79564c950d1578a485fa1f1736f30694f09978ca..b49e8a54cbd9a4bd9c522b15df830d0ab3e34635 100644 (file)
@@ -287,7 +287,7 @@ void VisuGUI_Plot3DPane::onPositionSpn()
   if (myPrs && !RelativeChkB->isChecked()) {
     vtkFloatingPointType minPos, maxPos;
     storePrsParams();
-    myPrs->GetPlot3DPL()->GetMinMaxPosition(minPos, maxPos);
+    myPrs->GetSpecificPL()->GetMinMaxPosition(minPos, maxPos);
     restorePrsParams();
     if (minPos > PositionSpn->value())
       minPos = PositionSpn->value();
@@ -326,7 +326,7 @@ void VisuGUI_Plot3DPane::onRelativePos(bool isRelativePos)
   vtkFloatingPointType minPos = 0., maxPos = 1., pos = PositionSpn->value();
   if (myPrs) {
     storePrsParams();
-    myPrs->GetPlot3DPL()->GetMinMaxPosition(minPos, maxPos);
+    myPrs->GetSpecificPL()->GetMinMaxPosition(minPos, maxPos);
     restorePrsParams();
     if (-1e-7 < (maxPos - minPos) && (maxPos - minPos) < 1e-7) {
       pos = 0;
@@ -382,7 +382,7 @@ void VisuGUI_Plot3DPane::updatePreview()
     // set plane parameters corresponding to control values
     storePrsParams();
     vtkFloatingPointType normal[3], origin[3];
-    myPrs->GetPlot3DPL()->GetBasePlane(origin, normal, true);
+    myPrs->GetSpecificPL()->GetBasePlane(origin, normal, true);
     planePreview->Set(origin, normal);
     restorePrsParams();
   }
@@ -496,7 +496,6 @@ bool VisuGUI_Plot3DPane::check()
 {
   if(!myPreviewActor) return true;
   
-  SVTK_ViewWindow* aView;
   vtkRenderer* aRend    = myPreviewActor->GetRenderer();
   vtkRenderWindow* aWnd = aRend->GetRenderWindow();
   if(aRend && aWnd){
index b65bf0c282ed8e167c7b22e3bde0c1602a2436cf..1160cc6edfb186e47965281fc473c818969dfee2 100644 (file)
@@ -169,7 +169,8 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject
   myTimeStampsCombo->setDisabled(isAnim);
 
   QString aFieldName(myPrs->GetScalarFieldName().c_str());
-  float aIterFloat = GetFloatValueOfTimeStamp(myPrs->GetMeshName().c_str(),
+  CORBA::String_var aMeshName = myPrs->GetMeshName();
+  float aIterFloat = GetFloatValueOfTimeStamp(aMeshName.in(),
                                              myPrs->GetScalarFieldName().c_str(),
                                              myPrs->GetScalarIteration(),
                                              myPrs->GetScalarEntity());
@@ -257,12 +258,13 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject
           VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
           if (isExist) {
             if ((aType == VISU::TTIMESTAMP)) {
-              _PTR(GenericAttribute) aNameAttr;
-              if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) {
-                _PTR(AttributeName) aName (aNameAttr);
+              _PTR(GenericAttribute) anAttr;
+              if (aChildSObj->FindAttribute(anAttr, "AttributeName")) {
+                _PTR(AttributeName) aNameAttr(anAttr);
                 VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
-                QString aMeshName = VISU::getValue(aChildSObj, "myMeshName");
-                if (QString(myPrs->GetMeshName().c_str()) != aMeshName) continue;
+                QString aName = VISU::getValue(aChildSObj, "myMeshName");
+               CORBA::String_var aMeshName = aPrsObj->GetMeshName();
+                if (QString(aMeshName.in()) != aName) continue;
                 myCurrMeshName = aMeshName;
                 QString aFieldName = VISU::getValue(aChildSObj, "myFieldName");
                 QString aTimeIter  = VISU::getValue(aChildSObj, "myTimeStampId");
@@ -274,10 +276,10 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject
                 case 2: anEntity = VISU::FACE_ENTITY; break;
                 case 3: anEntity = VISU::CELL_ENTITY; break;
                 }
-                TFT &aFieldsMap = myMeshFieldsTimes[aMeshName.latin1()];
+                TFT &aFieldsMap = myMeshFieldsTimes[aMeshName.in()];
                 TFE aKey (aFieldName.latin1(), anEntity);
                 aFieldsMap[aKey][aTimeIter.toInt()] = 
-                  GetFloatValueOfTimeStamp(myPrs->GetMeshName().c_str(),
+                  GetFloatValueOfTimeStamp(aMeshName.in(),
                                            aFieldName.latin1(),
                                            aTimeIter.toInt(),
                                            anEntity);
index 7a1820c13868dad69bc36c110c3d0fef1ba81b69..4f81711ef29f7a83404e8cda659c17f3ec296539 100644 (file)
@@ -313,7 +313,7 @@ void VisuGUI_StreamLinesDlg::initFromPrsObject (VISU::StreamLines_i* thePrs)
 
   myPrs = thePrs;
   static int aNbOfSteps = 30;
-  VISU_StreamLinesPL* aStreamLinesPL = thePrs->GetStreamLinesPL();
+  VISU_StreamLinesPL* aStreamLinesPL = thePrs->GetSpecificPL();
   float aMin, aMax;
   aMin = aStreamLinesPL->GetMinPropagationTime();
   aMax = aStreamLinesPL->GetMaxPropagationTime();
index 275d3e2e92fa7d8a1db3c37a92cb81238acd9f6f..89f06a2eb621d411f1372f2118284b3811691c4a 100644 (file)
@@ -35,9 +35,6 @@
 
 #include <vtkMapper.h>
 
-using namespace VISU;
-using namespace std;
-
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
 //#define _DEXCEPT_
@@ -50,21 +47,25 @@ static int MYDEBUG = 0;
 VISU::ColoredPrs3d_i::
 ColoredPrs3d_i(Result_i* theResult,
               bool theAddToStudy) :
-  PrsObject_i(theResult->GetStudyDocument()),
+  PrsObject_i(SALOMEDS::Study::_nil()),
   Prs3d_i(theResult,theAddToStudy),
   myScalarMapPL(NULL),
   myIsFixedRange(false)
 {}
 
+
+//---------------------------------------------------------------
 VISU::ColoredPrs3d_i::
 ColoredPrs3d_i(Result_i* theResult,
               SALOMEDS::SObject_ptr theSObject) :
-  PrsObject_i(theResult->GetStudyDocument()),
+  PrsObject_i(theSObject->GetStudy()),
   Prs3d_i(theResult,theSObject),
   myScalarMapPL(NULL),
   myIsFixedRange(false)
 {}
 
+
+//---------------------------------------------------------------
 VISU::ColoredPrs3d_i
 ::~ColoredPrs3d_i()
 {}
@@ -95,23 +96,100 @@ VISU::ColoredPrs3d_i
   ProcessVoidEvent(new TRemoveFromStudy(this));
 }
 
+//---------------------------------------------------------------
+bool 
+VISU::ColoredPrs3d_i
+::SetInput()
+{
+  if(TSuperClass::SetInput()){
+    if(CheckIsPossible()){
+      if(ApplyInput()){
+       if(Create(GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber()))
+         return true;
+      }else
+       return true;
+    }
+  }
+  return false;
+}
+
+
+//---------------------------------------------------------------
+bool 
+VISU::ColoredPrs3d_i
+::ApplyInput()
+{
+  bool anIsNotCreated = GetPL() == NULL;
+  if(anIsNotCreated)
+    CreatePipeLine(); // to create proper pipeline
+
+  DoSetInput();
+
+  return anIsNotCreated;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::SetEntity(VISU::Entity theEntity)
+{
+  myEntity = theEntity;
+}
+
+
+//---------------------------------------------------------------
+VISU::Entity
+VISU::ColoredPrs3d_i
+::GetEntity()
+{
+  return myEntity;
+}
+
+void 
+VISU::ColoredPrs3d_i
+::SetFieldName(const char* theFieldName)
+{
+  myFieldName = theFieldName;
+}
+
+char*
+VISU::ColoredPrs3d_i
+::GetFieldName()
+{
+  return CORBA::string_dup(myFieldName.c_str());
+}
+
+void 
+VISU::ColoredPrs3d_i
+::SetTimeStampNumber(CORBA::Long theTimeStampNumber)
+{
+  myTimeStampNumber = theTimeStampNumber;
+}
+
+CORBA::Long
+VISU::ColoredPrs3d_i
+::GetTimeStampNumber()
+{
+  return myTimeStampNumber;
+}
+
+
 //---------------------------------------------------------------
 void
 VISU::ColoredPrs3d_i
 ::SameAs(const Prs3d_i* theOrigin)
 {
   if(const ColoredPrs3d_i* aPrs3d = dynamic_cast<const ColoredPrs3d_i*>(theOrigin)){
-    DoHook();
-
     ColoredPrs3d_i* anOrigin = const_cast<ColoredPrs3d_i*>(aPrs3d);
  
-    myField = anOrigin->GetField();
-    myMeshName = myField->myMeshName;
-    myEntity = VISU::TEntity(anOrigin->GetEntity());//myField->myEntity;
-    myIteration = anOrigin->GetIteration();
-    myFieldName = anOrigin->GetFieldName();
-    
-    Build(-1);
+    SetMeshName(anOrigin->GetMeshName());
+    SetEntity(anOrigin->GetEntity());
+    SetFieldName(anOrigin->GetFieldName());
+    SetTimeStampNumber(anOrigin->GetTimeStampNumber());
+    ApplyInput();
+
+    Build(ESameAs);
     
     TSuperClass::SameAs(theOrigin);
     
@@ -145,11 +223,12 @@ void
 VISU::ColoredPrs3d_i
 ::SameAsParams(const ColoredPrs3d_i* theOrigin)
 {
-  int anIteration = GetIteration();
+  int aTimeStampNumber = GetTimeStampNumber();
   SameAs(theOrigin);
-  myIteration = anIteration;
+  SetTimeStampNumber(aTimeStampNumber);
+  ApplyInput();
 
-  Build(-1);
+  Build(ESameAs);
   Update();
 }
 
@@ -449,16 +528,15 @@ VISU::ColoredPrs3d_i
 ::Create(const char* theMeshName, 
         VISU::Entity theEntity,
         const char* theFieldName, 
-        int theIteration)
+        int theTimeStampNumber)
 {
-  DoHook(); // to create proper pipeline
-
-  myMeshName = theMeshName;
-  myEntity = (VISU::TEntity)theEntity;
-  myFieldName =theFieldName;
-  myIteration = theIteration;
+  SetMeshName(theMeshName);
+  SetEntity(theEntity);
+  SetFieldName(theFieldName);
+  SetTimeStampNumber(theTimeStampNumber);
+  ApplyInput();
 
-  Build(false); // to get corresponding input from result and initilize the pipeline
+  Build(ECreateNew); // to get corresponding input from result and initilize the pipeline
 
   SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
 
@@ -562,16 +640,15 @@ VISU::Storable*
 VISU::ColoredPrs3d_i
 ::Restore(const Storable::TRestoringMap& theMap)
 {
-  DoHook();
-
-  myMeshName = VISU::Storable::FindValue(theMap,"myMeshName").latin1();
-  myEntity = (VISU::TEntity)VISU::Storable::FindValue(theMap,"myEntity").toInt();
-  myFieldName = VISU::Storable::FindValue(theMap,"myFieldName").latin1();
-  myIteration = VISU::Storable::FindValue(theMap,"myIteration").toInt();
+  SetMeshName(VISU::Storable::FindValue(theMap,"myMeshName").latin1());
+  SetEntity((VISU::Entity)VISU::Storable::FindValue(theMap,"myEntity").toInt());
+  SetFieldName(VISU::Storable::FindValue(theMap,"myFieldName").latin1());
+  SetTimeStampNumber(VISU::Storable::FindValue(theMap,"myIteration").toInt());
+  ApplyInput();
 
   myAddToStudy = false; //SRN Added 21/06/2003 SAL2983: to avoid addition of the new ScalarMap to study.
 
-  Build(true);
+  Build(ERestore);
 
   TSuperClass::Restore(theMap);
 
@@ -618,7 +695,7 @@ VISU::ColoredPrs3d_i
   Storable::DataToStream( theStr, "myMeshName",       myMeshName.c_str() );
   Storable::DataToStream( theStr, "myEntity",         myEntity );
   Storable::DataToStream( theStr, "myFieldName",      myFieldName.c_str() );
-  Storable::DataToStream( theStr, "myIteration",      myIteration );
+  Storable::DataToStream( theStr, "myIteration",      int(myTimeStampNumber) );
 
   Storable::DataToStream( theStr, "myTitle",          myTitle.c_str() );
   Storable::DataToStream( theStr, "myNumberOfLabels", myNumberOfLabels );
@@ -648,9 +725,9 @@ VISU::ColoredPrs3d_i
 //----------------------------------------------------------------------------
 void
 VISU::ColoredPrs3d_i
-::DoHook()
+::CreatePipeLine()
 {
-  if(MYDEBUG) MESSAGE("ColoredPrs3d_i::DoHook() - "<<myPipeLine);
+  if(MYDEBUG) MESSAGE("ColoredPrs3d_i::CreatePipeLine() - "<<myPipeLine);
   if(!myPipeLine){
     myPipeLine = VISU_ScalarMapPL::New();
     myPipeLine->GetMapper()->SetScalarVisibility(1);
@@ -661,40 +738,41 @@ VISU::ColoredPrs3d_i
 //----------------------------------------------------------------------------
 VISU::Storable* 
 VISU::ColoredPrs3d_i
-::Build(int theRestoring)
+::Build(EBuildMode theBuildMode)
 {
   if(MYDEBUG)
-    MESSAGE("ColoredPrs3d_i::Build - "<<myFieldName<<"; theRestoring = "<<theRestoring);
-  SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+    MESSAGE("ColoredPrs3d_i::Build - "<<myFieldName<<"; theBuildMode = "<<theBuildMode);
+  SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
   if(myAddToStudy) 
     aStudyBuilder->NewCommand();  // There is a transaction
 #ifndef _DEXCEPT_
   try{
 #endif
-    DoSetInput(myResult);
     QString aComment;
     myName = "NoName";
-    if(theRestoring <= 0){
-      if(theRestoring == 0) myScalarMapPL->Init();
-      if(!myIsFixedRange) myScalarMapPL->SetSourceRange();
+    if(theBuildMode == ECreateNew || theBuildMode == ESameAs){
+      if(!myIsFixedRange) 
+       myScalarMapPL->SetSourceRange();
       const VISU::TValField& aValField = myField->myValField;
-      const VISU::PValForTime aValForTime = aValField.find(myIteration)->second;
+      const VISU::PValForTime aValForTime = aValField.find(myTimeStampNumber)->second;
       aComment.sprintf("%s %s",myFieldName.c_str(),VISU_Convertor::GenerateName(aValForTime->myTime).c_str());
-      if (theRestoring == 0) myTitle = aComment.simplifyWhiteSpace().latin1();
+      if(theBuildMode == ECreateNew) 
+       myTitle = aComment.simplifyWhiteSpace().latin1();
     }
     if(myAddToStudy){
       myName = GenerateName().latin1();
       aComment.sprintf("myComment=TIMESTAMP;myType=%d;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
-                      VISU::TTIMESTAMP,myMeshName.c_str(),myEntity,myFieldName.c_str(),myIteration,myField->myNbComp);
-      string aResultEntry = myResult->GetEntry();
-      string aRefFatherEntry = myResult->GetRefFatherEntry();
-      string anEntry = myResult->GetEntry(aComment.latin1());
-      if(anEntry == "") throw std::runtime_error("There is no Entry for binding the presentation !!!");
+                      VISU::TTIMESTAMP,myMeshName.c_str(),myEntity,myFieldName.c_str(),myTimeStampNumber,myField->myNbComp);
+      std::string aResultEntry = myResult->GetEntry();
+      std::string aRefFatherEntry = myResult->GetRefFatherEntry();
+      std::string anEntry = myResult->GetEntry(aComment.latin1());
+      if(anEntry == "") 
+       throw std::runtime_error("There is no Entry for binding the presentation !!!");
       aComment.sprintf("myComment=%s;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
-                      GetComment(),myMeshName.c_str(),myEntity,myFieldName.c_str(),myIteration,myField->myNbComp);
+                      GetComment(),myMeshName.c_str(),myEntity,myFieldName.c_str(),myTimeStampNumber,myField->myNbComp);
       CORBA::String_var anIOR = GetID();
-      CreateAttributes(myStudy,anEntry.c_str(),aRefFatherEntry.c_str(),anIOR,myName.c_str(),"",aComment.latin1(),true);
-      mySObject = myStudy->FindObjectIOR(anIOR);
+      CreateAttributes(GetStudyDocument(),anEntry.c_str(),aRefFatherEntry.c_str(),anIOR,myName.c_str(),"",aComment.latin1(),true);
+      mySObject = GetStudyDocument()->FindObjectIOR(anIOR);
     }
 #ifndef _DEXCEPT_
   }catch(std::exception& exc){
@@ -719,32 +797,11 @@ VISU::ColoredPrs3d_i
   return myField;
 }
 
-const std::string&
-VISU::ColoredPrs3d_i
-::GetMeshName() const 
-{ 
-  return myMeshName;
-}
-
-VISU::Entity
-VISU::ColoredPrs3d_i
-::GetEntity() const 
-{ 
-  return VISU::Entity(myEntity);
-}
-
-const std::string&
-VISU::ColoredPrs3d_i
-::GetFieldName() const 
-{ 
-  return myFieldName;
-}
-
-int
+VISU::TEntity
 VISU::ColoredPrs3d_i
-::GetIteration() const 
+::GetTEntity() const 
 { 
-  return myIteration;
+  return VISU::TEntity(int(myEntity));
 }
 
 VISU_ScalarMapPL*
index b5417b22a32dde891548d36b3b4f34ccf6400579..b131e32522a8531e180848c128c70fd1c3850f30 100644 (file)
@@ -57,6 +57,31 @@ namespace VISU
     void
     RemoveFromStudy();
 
+    //----------------------------------------------------------------------------
+    virtual
+    void
+    SetEntity(Entity theEntity);
+
+    virtual
+    Entity
+    GetEntity();
+
+    virtual
+    void
+    SetFieldName(const char* theFieldName);
+
+    virtual
+    char*
+    GetFieldName();
+
+    virtual
+    void 
+    SetTimeStampNumber(CORBA::Long theTimeStampNumber);
+
+    virtual
+    CORBA::Long
+    GetTimeStampNumber();
+
     //----------------------------------------------------------------------------
     virtual
     CORBA::Long
@@ -138,49 +163,51 @@ namespace VISU
     vtkFloatingPointType myPosition[2], myWidth, myHeight;
 
   public:
-    //----------------------------------------------------------------------------
+    /*!
+      Initlizes the in first time presentation
+    */
     virtual
     Storable* 
     Create(const char* theMeshName, 
           VISU::Entity theEntity,
           const char* theFieldName, 
-          int theIteration);
+          int theTimeStampNumber);
 
+    /*!
+      Retores state of the presentation
+    */
     virtual 
     Storable* 
     Restore(const Storable::TRestoringMap& theMap);
 
+    /*!
+      Writes persistent params of the presentation into the given stream
+    */
     virtual 
     void
     ToStream(std::ostringstream& theStr);
 
+    /*!
+      Update state of the presentation according to the input.
+    */
     virtual 
     void
     SameAs(const Prs3d_i* theOrigin);
 
     /*!
-     *  \brief Works like SameAs() method, but keep myIteration value unchanged.
+     *  \brief Works like SameAs() method, but keep myTimeStampNumber value unchanged.
      *
      *  Is used in VISU_TimeAnimation class implementation.
      */
     void
     SameAsParams(const ColoredPrs3d_i* theOrigin);
 
+    TEntity
+    GetTEntity() const;
+
     virtual const VISU::PField&
     GetField() const;
 
-    const std::string& 
-    GetMeshName() const;
-
-    VISU::Entity
-    GetEntity() const;
-
-    const std::string& 
-    GetFieldName() const;
-
-    int
-    GetIteration() const;
-
     VISU_ScalarMapPL* 
     GetScalarMapPL();
 
@@ -272,13 +299,74 @@ namespace VISU
                  vtkFloatingPointType theG, 
                  vtkFloatingPointType theB);
 
+    VISU_ScalarMapPL* 
+    GetSpecificPL() const
+    { 
+      return myScalarMapPL; 
+    }
+    
     //----------------------------------------------------------------------------
   protected:
-    PField myField;
-    TEntity myEntity;
+    /*!
+      Applyes basic input parameters to the presentation.
+      Returns true if all are right.
+    */
+    virtual 
+    bool 
+    SetInput();
+
+    /*!
+      Checks whether it is possible to create presentation 
+      with the given basic parameters or not.
+    */
+    virtual 
+    bool 
+    CheckIsPossible() = 0;
+
+    /*!
+      Creates proper instance of VTK pipeline.
+    */
+    virtual
+    void 
+    CreatePipeLine();
+
+    /*!
+      First checks whether corresponding VTK pipeline exists and create it if not. 
+      Then calls VISU_ColoredPrs3d_i::DoSetInput.
+      Returns true if during the call corresponding VTK pipeline was created,
+      false otherwise.
+    */
+    virtual 
+    bool
+    ApplyInput();
+
+   /*!
+      Sets input data set according to basic input parameters -
+      Result, MeshName, Entity, FieldName and TimeStampNumber.
+    */
+    virtual 
+    void
+    DoSetInput() = 0;
+
+    /*! 
+      The enumeration allow to define what mode should be used for the presentation building.
+    */
+    enum EBuildMode {ECreateNew, ESameAs, ERestore};
+
+    /*! 
+      The enumeration allow to define what mode should be used for the presentation building.
+    */
+    Storable* 
+    Build(EBuildMode theBuildMode);
+
+  protected:
+    // Decalare basic input parameters
+    Entity myEntity;
     std::string myFieldName;
-    int myIteration;
+    CORBA::Long myTimeStampNumber;
 
+    PField myField;
+    
     //Font management
     bool myIsBoldTitle;
     bool myIsItalicTitle;
@@ -294,17 +382,6 @@ namespace VISU
 
     VISU_ScalarMapPL* myScalarMapPL;
     bool myIsFixedRange;
-
-    virtual 
-    void
-    DoSetInput(Result_i* theResult) = 0;
-
-    Storable* 
-    Build(int theRestoring);
-
-    virtual
-    void 
-    DoHook();
   };
 
 }
index a44b5216b7274eb92ac8c2745cb447cf854a5442..8af03cfbe419ad85eb47e86afc3f62de6d1b6f3b 100644 (file)
@@ -36,9 +36,6 @@
 
 #include <vtkAppendPolyData.h>
 
-using namespace VISU;
-using namespace std;
-
 static vtkFloatingPointType EPS_machine = 1.0E-7;
 
 #ifdef _DEBUG_
@@ -47,23 +44,52 @@ static int MYDEBUG = 0;
 static int MYDEBUG = 0;
 #endif
 
-int VISU::CutLines_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity, 
-                                const char* theFieldName, int theIteration, int isMemoryCheck)
+
+//---------------------------------------------------------------
+int
+VISU::CutLines_i
+::IsPossible(Result_i* theResult, 
+            const char* theMeshName, 
+            VISU::Entity theEntity, 
+            const char* theFieldName, 
+            int theTimeStampNumber, 
+            int isMemoryCheck)
 {
-  return VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
+  return TSuperClass::IsPossible(theResult,
+                                theMeshName,
+                                theEntity,
+                                theFieldName,
+                                theTimeStampNumber,
+                                isMemoryCheck);
 }
 
+//---------------------------------------------------------------
 int VISU::CutLines_i::myNbPresent = 0;
-QString VISU::CutLines_i::GenerateName() { return VISU::GenerateName("CutLines",myNbPresent++);}
 
+//---------------------------------------------------------------
+QString 
+VISU::CutLines_i::GenerateName() 
+{ 
+  return VISU::GenerateName("CutLines",myNbPresent++);
+}
+
+//---------------------------------------------------------------
 const string VISU::CutLines_i::myComment = "CUTLINES";
-const char* VISU::CutLines_i::GetComment() const { return myComment.c_str();}
+
+//---------------------------------------------------------------
+const char* 
+VISU::CutLines_i
+::GetComment() const 
+{ 
+  return myComment.c_str();
+}
 
 
+//---------------------------------------------------------------
 VISU::CutLines_i::
 CutLines_i(Result_i* theResult, 
           bool theAddToStudy) :
-  PrsObject_i(theResult->GetStudyDocument()), 
+  PrsObject_i(SALOMEDS::Study::_nil()), 
   Prs3d_i(theResult,theAddToStudy),
   ColoredPrs3d_i(theResult,theAddToStudy),
   ScalarMap_i(theResult,theAddToStudy),
@@ -71,33 +97,45 @@ CutLines_i(Result_i* theResult,
 {}
 
 
+//---------------------------------------------------------------
 VISU::CutLines_i::
 CutLines_i(Result_i* theResult, 
           SALOMEDS::SObject_ptr theSObject) :
-  PrsObject_i(theResult->GetStudyDocument()), 
+  PrsObject_i(theSObject->GetStudy()), 
   Prs3d_i(theResult,theSObject),
   ColoredPrs3d_i(theResult,theSObject),
   ScalarMap_i(theResult,theSObject),
   myCutLinesPL(NULL)
-{
-}
+{}
 
 
 /*! Copy map to /a myMapCurvesInverted.
  * \param theCurves - map
  */
-void VISU::CutLines_i::CopyCurvesInverted(const TCurvesInv& theCurves){
+void 
+VISU::CutLines_i
+::CopyCurvesInverted(const TCurvesInv& theCurves)
+{
   myMapCurvesInverted = theCurves;
 }
 
-VISU::Storable* VISU::CutLines_i::Create(const char* theMeshName, VISU::Entity theEntity, 
-                                        const char* theFieldName, int theIteration)
+
+//---------------------------------------------------------------
+VISU::Storable* 
+VISU::CutLines_i
+::Create(const char* theMeshName, 
+        VISU::Entity theEntity,
+        const char* theFieldName, 
+        int theTimeStampNumber)
 {
-  return ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+  return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
 }
 
 
-VISU::Storable* VISU::CutLines_i::Restore(const Storable::TRestoringMap& theMap)
+//---------------------------------------------------------------
+VISU::Storable* 
+VISU::CutLines_i
+::Restore(const Storable::TRestoringMap& theMap)
 {
   TSuperClass::Restore(theMap);
 
@@ -139,8 +177,12 @@ VISU::Storable* VISU::CutLines_i::Restore(const Storable::TRestoringMap& theMap)
 }
 
 
-void VISU::CutLines_i::ToStream(std::ostringstream& theStr){
-  ScalarMap_i::ToStream(theStr);
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::ToStream(std::ostringstream& theStr)
+{
+  TSuperClass::ToStream(theStr);
 
   int aNbLines = GetNbLines();
   
@@ -171,91 +213,187 @@ void VISU::CutLines_i::ToStream(std::ostringstream& theStr){
   Storable::DataToStream( theStr, "myMapCurvesInverted", aStrCurvesInverted.latin1());
 }
 
-VISU::CutLines_i::~CutLines_i(){
+
+//---------------------------------------------------------------
+VISU::CutLines_i
+::~CutLines_i()
+{
   if(MYDEBUG) MESSAGE("CutLines_i::~CutLines_i()");
 }
 
 
-void VISU::CutLines_i::SetOrientation(VISU::CutPlanes::Orientation theOrient,
-                                     CORBA::Double theXAngle, CORBA::Double theYAngle)
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::SetOrientation(VISU::CutPlanes::Orientation theOrient,
+                CORBA::Double theXAngle, 
+                CORBA::Double theYAngle)
 {
   myCutLinesPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(theOrient),
-                              theXAngle,theYAngle);
+                              theXAngle,
+                              theYAngle);
 }
-void VISU::CutLines_i::SetOrientation2(VISU::CutPlanes::Orientation theOrient,
-                                      CORBA::Double theXAngle, CORBA::Double theYAngle)
+
+//---------------------------------------------------------------
+void 
+VISU::CutLines_i
+::SetOrientation2(VISU::CutPlanes::Orientation theOrient,
+                 CORBA::Double theXAngle, 
+                 CORBA::Double theYAngle)
 {
   myCutLinesPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(theOrient),
-                              theXAngle,theYAngle,1);
+                              theXAngle,
+                              theYAngle,
+                              1);
 }
 
-VISU::CutPlanes::Orientation VISU::CutLines_i::GetOrientationType() { 
+//---------------------------------------------------------------
+VISU::CutPlanes::Orientation 
+VISU::CutLines_i
+::GetOrientationType() 
+{ 
   return VISU::CutPlanes::Orientation(myCutLinesPL->GetPlaneOrientation());
 }
-VISU::CutPlanes::Orientation VISU::CutLines_i::GetOrientationType2() { 
+
+//---------------------------------------------------------------
+VISU::CutPlanes::Orientation 
+VISU::CutLines_i
+::GetOrientationType2() 
+{ 
   return VISU::CutPlanes::Orientation(myCutLinesPL->GetPlaneOrientation(1));
 }
 
-CORBA::Double VISU::CutLines_i::GetRotateX(){
+//---------------------------------------------------------------
+CORBA::Double
+VISU::CutLines_i
+::GetRotateX()
+{
   return myCutLinesPL->GetRotateX();
 }
-CORBA::Double VISU::CutLines_i::GetRotateY(){
+
+//---------------------------------------------------------------
+CORBA::Double 
+VISU::CutLines_i
+::GetRotateY()
+{
   return myCutLinesPL->GetRotateY();
 }
 
-CORBA::Double VISU::CutLines_i::GetRotateX2(){
+
+//---------------------------------------------------------------
+CORBA::Double 
+VISU::CutLines_i
+::GetRotateX2()
+{
   return myCutLinesPL->GetRotateX(1);
 }
-CORBA::Double VISU::CutLines_i::GetRotateY2(){
+
+//---------------------------------------------------------------
+CORBA::Double 
+VISU::CutLines_i
+::GetRotateY2()
+{
   return myCutLinesPL->GetRotateY(1);
 }
 
 
-void VISU::CutLines_i::SetDisplacement(CORBA::Double theDisp) { 
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::SetDisplacement(CORBA::Double theDisp) 
+{ 
   myCutLinesPL->SetDisplacement(theDisp);
 }
-void VISU::CutLines_i::SetDisplacement2(CORBA::Double theDisp) { 
+
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::SetDisplacement2(CORBA::Double theDisp) 
+{ 
   myCutLinesPL->SetDisplacement(theDisp,1);
 }
 
-CORBA::Double VISU::CutLines_i::GetDisplacement() { 
+
+//---------------------------------------------------------------
+CORBA::Double 
+VISU::CutLines_i
+::GetDisplacement() 
+{ 
   return myCutLinesPL->GetDisplacement();
 }
-CORBA::Double VISU::CutLines_i::GetDisplacement2() { 
+
+//---------------------------------------------------------------
+CORBA::Double 
+VISU::CutLines_i
+::GetDisplacement2() 
+{ 
   return myCutLinesPL->GetDisplacement(1);
 }
 
 
-void VISU::CutLines_i::SetBasePlanePosition(CORBA::Double thePlanePosition){
+//---------------------------------------------------------------
+void 
+VISU::CutLines_i
+::SetBasePlanePosition(CORBA::Double thePlanePosition)
+{
   myCutLinesPL->SetPosition(thePlanePosition);
 }
 
-CORBA::Double VISU::CutLines_i::GetBasePlanePosition(){ 
+//---------------------------------------------------------------
+CORBA::Double 
+VISU::CutLines_i
+::GetBasePlanePosition()
+{ 
   return myCutLinesPL->GetPosition();
 }
 
-void VISU::CutLines_i::SetLinePosition(CORBA::Long thePlaneNumber, CORBA::Double thePlanePosition){
+//---------------------------------------------------------------
+void 
+VISU::CutLines_i
+::SetLinePosition(CORBA::Long thePlaneNumber, 
+                 CORBA::Double thePlanePosition)
+{
   myCutLinesPL->SetPartPosition(thePlaneNumber,thePlanePosition);
 }
 
-CORBA::Double VISU::CutLines_i::GetLinePosition(CORBA::Long thePlaneNumber){ 
+//---------------------------------------------------------------
+CORBA::Double 
+VISU::CutLines_i
+::GetLinePosition(CORBA::Long thePlaneNumber)
+{ 
   return myCutLinesPL->GetPartPosition(thePlaneNumber,1);
 }
 
 
-void VISU::CutLines_i::SetDefault(){
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::SetDefault()
+{
   myCutLinesPL->SetDefault();
 }
 
-CORBA::Boolean VISU::CutLines_i::IsDefault(){ 
+//---------------------------------------------------------------
+CORBA::Boolean
+VISU::CutLines_i
+::IsDefault()
+{ 
   return myCutLinesPL->IsDefault();
 }
 
-void VISU::CutLines_i::SetDefaultPosition(CORBA::Long thePlaneNumber){
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::SetDefaultPosition(CORBA::Long thePlaneNumber)
+{
   myCutLinesPL->SetPartDefault(thePlaneNumber);
 }
 
-CORBA::Boolean VISU::CutLines_i::IsDefaultPosition(CORBA::Long thePlaneNumber){ 
+//---------------------------------------------------------------
+CORBA::Boolean
+VISU::CutLines_i
+::IsDefaultPosition(CORBA::Long thePlaneNumber)
+{ 
   return myCutLinesPL->IsPartDefault(thePlaneNumber);
 }
 
@@ -263,14 +401,20 @@ CORBA::Boolean VISU::CutLines_i::IsDefaultPosition(CORBA::Long thePlaneNumber){
  * see void VISU::CutLines_i::SetCurveInverted(CORBA::Long theCurveNumber,CORBA::Boolean theInvert)
  * \param theInvert - Invert all curves, if value is TRUE, else not.
  */
-void VISU::CutLines_i::SetAllCurvesInverted(CORBA::Boolean theInvert){
+void
+VISU::CutLines_i
+::SetAllCurvesInverted(CORBA::Boolean theInvert)
+{
   for (int i=0; i<GetNbLines(); i++) SetCurveInverted(i,theInvert);
 }
 
 /*! Checks the orientation of all curves
  * \retval TRUE - if all curves are inverted, else FALSE
  */
-CORBA::Boolean VISU::CutLines_i::IsAllCurvesInverted(){
+CORBA::Boolean 
+VISU::CutLines_i
+::IsAllCurvesInverted()
+{
   for (int i=0; i<GetNbLines(); i++)
     if (!IsCurveInverted(i)) return false;
   return true;
@@ -280,7 +424,10 @@ CORBA::Boolean VISU::CutLines_i::IsAllCurvesInverted(){
  * \param theCurveNumber - integer value, number of cut line.
  * \param theInvert      - boolean value, TRUE or false.
  */
-void VISU::CutLines_i::SetCurveInverted(CORBA::Long theCurveNumber,CORBA::Boolean theInvert){
+void
+VISU::CutLines_i
+::SetCurveInverted(CORBA::Long theCurveNumber,CORBA::Boolean theInvert)
+{
   myMapCurvesInverted[theCurveNumber] = theInvert;
 }
 
@@ -288,30 +435,58 @@ void VISU::CutLines_i::SetCurveInverted(CORBA::Long theCurveNumber,CORBA::Boolea
  * \param theCurveNumber - integer value, number of cut line.
  * \retval TRUE - if line in the table is inverted, else FALSE.
  */
-CORBA::Boolean VISU::CutLines_i::IsCurveInverted(CORBA::Long theCurveNumber){
+CORBA::Boolean
+VISU::CutLines_i
+::IsCurveInverted(CORBA::Long theCurveNumber)
+{
   return myMapCurvesInverted[theCurveNumber];
 }
 
-void VISU::CutLines_i::SetNbLines(CORBA::Long theNb) { 
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::SetNbLines(CORBA::Long theNb) 
+{ 
   myCutLinesPL->SetNbParts(theNb);
 }
-CORBA::Long VISU::CutLines_i::GetNbLines() { 
+
+//---------------------------------------------------------------
+CORBA::Long
+VISU::CutLines_i
+::GetNbLines() 
+{ 
   return myCutLinesPL->GetNbParts();
 }
 
 
-void VISU::CutLines_i::DoHook(){
-  if(!myPipeLine) myPipeLine = VISU_CutLinesPL::New();
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::CreatePipeLine()
+{
+  if(!myPipeLine) 
+    myPipeLine = VISU_CutLinesPL::New();
   myCutLinesPL = dynamic_cast<VISU_CutLinesPL*>(myPipeLine);
 
-  ScalarMap_i::DoHook();
+  TSuperClass::CreatePipeLine();
 }
 
+
+//----------------------------------------------------------------------------
+bool
+VISU::CutLines_i
+::CheckIsPossible() 
+{
+  return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+}
+
+
+//---------------------------------------------------------------
 VISU_Actor* 
 VISU::CutLines_i
 ::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
 {
-  if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
+  if(VISU_Actor* anActor = TSuperClass::CreateActor(theIO)){
     anActor->SetVTKMapping(true);
     SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
     int aDispMode = aResourceMgr->integerValue("VISU" , "cut_lines_represent", 2);
@@ -321,12 +496,16 @@ VISU::CutLines_i
   return NULL;
 }
 
-void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject)
+{
   try{
     if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal");
     Update();
     SALOMEDS::GenericAttribute_var anAttr;
-    SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+    SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
     anAttr = aStudyBuilder->FindOrCreateAttribute(theSObject, "AttributeTableOfReal");
     SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
     
index 6464d210f074838a299d6fe1edb4c6a37d9b0c25..9ccf70820df45312b0ee6186b00525451c06fc12 100644 (file)
@@ -31,7 +31,8 @@
 
 class VISU_CutLinesPL;
 
-namespace VISU{
+namespace VISU
+{
   class CutLines_i : public virtual POA_VISU::CutLines,
                      public virtual ScalarMap_i
   {
@@ -48,72 +49,188 @@ namespace VISU{
     explicit
     CutLines_i(Result_i* theResult,
               SALOMEDS::SObject_ptr theSObject);
-    virtual ~CutLines_i();
+    virtual
+    ~CutLines_i();
+
+    virtual
+    VISU::VISUType
+    GetType() 
+    {
+      return VISU::TCUTLINES;
+    }
+
+    virtual
+    void
+    SetOrientation(VISU::CutPlanes::Orientation theOrient,
+                  CORBA::Double theXAngle, 
+                  CORBA::Double theYAngle);
+    
+    virtual
+    void
+    SetOrientation2(VISU::CutPlanes::Orientation theOrient,
+                   CORBA::Double theXAngle, 
+                   CORBA::Double theYAngle);
+
+    virtual 
+    VISU::CutPlanes::Orientation 
+    GetOrientationType();
+
+    virtual
+    VISU::CutPlanes::Orientation 
+    GetOrientationType2();
 
-    virtual VISU::VISUType GetType() { return VISU::TCUTLINES;};
+    virtual 
+    CORBA::Double 
+    GetRotateX();
 
-    virtual void SetOrientation(VISU::CutPlanes::Orientation theOrient,
-                               CORBA::Double theXAngle, CORBA::Double theYAngle);
-    virtual void SetOrientation2(VISU::CutPlanes::Orientation theOrient,
-                                CORBA::Double theXAngle, CORBA::Double theYAngle);
+    virtual
+    CORBA::Double 
+    GetRotateY();
 
-    virtual VISU::CutPlanes::Orientation GetOrientationType();
-    virtual VISU::CutPlanes::Orientation GetOrientationType2();
+    virtual
+    CORBA::Double 
+    GetRotateX2();
 
-    virtual CORBA::Double GetRotateX();
-    virtual CORBA::Double GetRotateY();
+    virtual 
+    CORBA::Double 
+    GetRotateY2();
 
-    virtual CORBA::Double GetRotateX2();
-    virtual CORBA::Double GetRotateY2();
+    virtual
+    void 
+    SetDisplacement(CORBA::Double theDisp);
 
-    virtual void SetDisplacement(CORBA::Double theDisp);
-    virtual CORBA::Double GetDisplacement();
+    virtual
+    CORBA::Double 
+    GetDisplacement();
 
-    virtual void SetDisplacement2(CORBA::Double theDisp);
-    virtual CORBA::Double GetDisplacement2();
+    virtual
+    void 
+    SetDisplacement2(CORBA::Double theDisp);
 
-    virtual void SetBasePlanePosition(CORBA::Double thePlanePosition);
-    virtual CORBA::Double GetBasePlanePosition();
+    virtual
+    CORBA::Double 
+    GetDisplacement2();
 
-    virtual void SetLinePosition(CORBA::Long thePlaneNumber, CORBA::Double thePlanePosition);
-    virtual CORBA::Double GetLinePosition(CORBA::Long thePlaneNumber);
+    virtual
+    void 
+    SetBasePlanePosition(CORBA::Double thePlanePosition);
 
-    virtual void SetDefault();
-    virtual CORBA::Boolean IsDefault();
+    virtual
+    CORBA::Double 
+    GetBasePlanePosition();
 
-    virtual void SetDefaultPosition(CORBA::Long thePlaneNumber);
-    virtual CORBA::Boolean IsDefaultPosition(CORBA::Long thePlaneNumber);
+    virtual
+    void 
+    SetLinePosition(CORBA::Long thePlaneNumber, 
+                   CORBA::Double thePlanePosition);
 
-    virtual void SetAllCurvesInverted(CORBA::Boolean theInvert);
-    virtual CORBA::Boolean IsAllCurvesInverted();
-    virtual void SetCurveInverted(CORBA::Long theCurveNumber,CORBA::Boolean theInvert);
-    virtual CORBA::Boolean IsCurveInverted(CORBA::Long theCurveNumber);
+    virtual
+    CORBA::Double
+    GetLinePosition(CORBA::Long thePlaneNumber);
+
+    virtual
+    void 
+    SetDefault();
+
+    virtual 
+    CORBA::Boolean 
+    IsDefault();
+
+    virtual
+    void 
+    SetDefaultPosition(CORBA::Long thePlaneNumber);
+
+    virtual
+    CORBA::Boolean 
+    IsDefaultPosition(CORBA::Long thePlaneNumber);
+
+    virtual
+    void
+    SetAllCurvesInverted(CORBA::Boolean theInvert);
+
+    virtual
+    CORBA::Boolean
+    IsAllCurvesInverted();
+
+    virtual
+    void
+    SetCurveInverted(CORBA::Long theCurveNumber,
+                    CORBA::Boolean theInvert);
+
+    virtual
+    CORBA::Boolean
+    IsCurveInverted(CORBA::Long theCurveNumber);
+
+    virtual 
+    void 
+    SetNbLines(CORBA::Long theNb);
+
+    virtual
+    CORBA::Long
+    GetNbLines();
 
-    virtual void SetNbLines(CORBA::Long theNb);
-    virtual CORBA::Long GetNbLines();
-    typedef VISU::CutLines TInterface;
-    VISU_CutLinesPL* GetCutLinesPL(){ return myCutLinesPL;}
-    
     typedef std::map<int,bool> TCurvesInv;
-    TCurvesInv GetCurvesInverted() {return myMapCurvesInverted;}
-    void CopyCurvesInverted(const TCurvesInv& theCurves);
+    TCurvesInv
+    GetCurvesInverted() 
+    {
+      return myMapCurvesInverted;
+    }
 
+    void
+    CopyCurvesInverted(const TCurvesInv& theCurves);
+
+    typedef VISU::CutLines TInterface;
+
+    VISU_CutLinesPL* 
+    GetSpecificPL() const
+    { 
+      return myCutLinesPL; 
+    }
+    
   protected:
-    virtual void DoHook();
+    //! Extends VISU_ColoredPrs3d_i::CreatePipeLine
+    virtual 
+    void
+    CreatePipeLine();
+
+    //! Extends VISU_ColoredPrs3d_i::CheckIsPossible
+    virtual 
+    bool 
+    CheckIsPossible();
 
     VISU_CutLinesPL *myCutLinesPL;
     TCurvesInv myMapCurvesInverted;
 
   public:
-    static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
-                         const char* theFieldName, int theIteration, int isMemoryCheck = true);
-    virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity,
-                            const char* theFieldName, int theIteration);
+    //! Extends VISU_ColoredPrs3d_i::IsPossible
+    static
+    int
+    IsPossible(Result_i* theResult, 
+              const char* theMeshName, 
+              VISU::Entity theEntity,
+              const char* theFieldName, 
+              int theTimeStampNumber, 
+              int isMemoryCheck = true);
+
+    //! Extends VISU_ColoredPrs3d_i::Create
+    virtual 
+    Storable* 
+    Create(const char* theMeshName, 
+          VISU::Entity theEntity,
+          const char* theFieldName, 
+          int theTimeStampNumber);
 
-    virtual void ToStream(std::ostringstream& theStr);
+    //! Extends VISU_ColoredPrs3d_i::ToStream
+    virtual 
+    void
+    ToStream(std::ostringstream& theStr);
 
-    virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+    //! Extends VISU_ColoredPrs3d_i::Restore
+    virtual
+    Storable* 
+    Restore(const Storable::TRestoringMap& theMap);
 
+    //! Extends VISU_ColoredPrs3d_i::CreateActor
     virtual 
     VISU_Actor* 
     CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
@@ -121,8 +238,14 @@ namespace VISU{
     void BuildTableOfReal(SALOMEDS::SObject_ptr theSObject);
 
     static const std::string myComment;
-    virtual const char* GetComment() const;
-    virtual QString GenerateName();
+
+    virtual
+    const char* 
+    GetComment() const;
+
+    virtual
+    QString 
+    GenerateName();
   };
 }
 
index c4b952e594f443d0349300035b7275d033483f24..cfcc4ce42740754adb3fd42bbb1dd96b1bea6a0a 100644 (file)
 
 #include "SUIT_ResourceMgr.h"
 
-using namespace VISU;
-using namespace std;
-
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
 #else
 static int MYDEBUG = 0;
 #endif
 
-int VISU::CutPlanes_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity, 
-                                 const char* theFieldName, int theIteration, int isMemoryCheck)
+
+//----------------------------------------------------------------------------
+int 
+VISU::CutPlanes_i
+::IsPossible(Result_i* theResult, 
+            const char* theMeshName, 
+            VISU::Entity theEntity, 
+            const char* theFieldName, 
+            int theTimeStampNumber, 
+            int isMemoryCheck)
 {
-  return VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
+  return TSuperClass::IsPossible(theResult,theMeshName,theEntity,theFieldName,theTimeStampNumber,isMemoryCheck);
 }
 
 
+//----------------------------------------------------------------------------
 int VISU::CutPlanes_i::myNbPresent = 0;
-QString VISU::CutPlanes_i::GenerateName() { return VISU::GenerateName("CutPlanes",myNbPresent++);}
 
+//----------------------------------------------------------------------------
+QString
+VISU::CutPlanes_i
+::GenerateName() 
+{ 
+  return VISU::GenerateName("CutPlanes",myNbPresent++);
+}
 
+//----------------------------------------------------------------------------
 const string VISU::CutPlanes_i::myComment = "CUTPLANES";
-const char* VISU::CutPlanes_i::GetComment() const { return myComment.c_str();}
+
+//----------------------------------------------------------------------------
+const char* 
+VISU::CutPlanes_i
+::GetComment() const 
+{ 
+  return myComment.c_str();
+}
 
 
-VISU::CutPlanes_i::
-CutPlanes_i(Result_i* theResult, 
-           bool theAddToStudy) :
-  PrsObject_i(theResult->GetStudyDocument()), 
+//----------------------------------------------------------------------------
+VISU::CutPlanes_i
+::CutPlanes_i(Result_i* theResult, 
+             bool theAddToStudy):
+  PrsObject_i(SALOMEDS::Study::_nil()), 
   Prs3d_i(theResult,theAddToStudy),
   ColoredPrs3d_i(theResult,theAddToStudy),
   ScalarMap_i(theResult,theAddToStudy),
@@ -66,26 +87,34 @@ CutPlanes_i(Result_i* theResult,
 {}
 
 
-VISU::CutPlanes_i::
-CutPlanes_i(Result_i* theResult, 
-           SALOMEDS::SObject_ptr theSObject) :
-  PrsObject_i(theResult->GetStudyDocument()), 
+//----------------------------------------------------------------------------
+VISU::CutPlanes_i
+::CutPlanes_i(Result_i* theResult, 
+             SALOMEDS::SObject_ptr theSObject):
+  PrsObject_i(theSObject->GetStudy()), 
   Prs3d_i(theResult,theSObject),
   ColoredPrs3d_i(theResult,theSObject),
   ScalarMap_i(theResult,theSObject),
   myCutPlanesPL(NULL)
-{
-}
+{}
 
 
-VISU::Storable* VISU::CutPlanes_i::Create(const char* theMeshName, VISU::Entity theEntity, 
-                                         const char* theFieldName, int theIteration)
+//----------------------------------------------------------------------------
+VISU::Storable* 
+VISU::CutPlanes_i
+::Create(const char* theMeshName, 
+        VISU::Entity theEntity,
+        const char* theFieldName, 
+        int theTimeStampNumber)
 {
-  return ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+  return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
 }
 
 
-VISU::Storable* VISU::CutPlanes_i::Restore(const Storable::TRestoringMap& theMap)
+//----------------------------------------------------------------------------
+VISU::Storable* 
+VISU::CutPlanes_i
+::Restore(const Storable::TRestoringMap& theMap)
 {
   TSuperClass::Restore(theMap);
 
@@ -104,6 +133,7 @@ VISU::Storable* VISU::CutPlanes_i::Restore(const Storable::TRestoringMap& theMap
 }
 
 
+//----------------------------------------------------------------------------
 void VISU::CutPlanes_i::ToStream(std::ostringstream& theStr){
   ScalarMap_i::ToStream(theStr);
 
@@ -123,73 +153,147 @@ void VISU::CutPlanes_i::ToStream(std::ostringstream& theStr){
 }
 
 
-VISU::CutPlanes_i::~CutPlanes_i(){
+//----------------------------------------------------------------------------
+VISU::CutPlanes_i
+::~CutPlanes_i()
+{
   if(MYDEBUG) MESSAGE("CutPlanes_i::~CutPlanes_i()");
 }
 
 
-void VISU::CutPlanes_i::SetOrientation(VISU::CutPlanes::Orientation theOrient,
-                                      CORBA::Double theXAngle, CORBA::Double theYAngle)
+//----------------------------------------------------------------------------
+void
+VISU::CutPlanes_i
+::SetOrientation(VISU::CutPlanes::Orientation theOrient,
+                CORBA::Double theXAngle, 
+                CORBA::Double theYAngle)
 {
   myCutPlanesPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(theOrient),
-                               theXAngle,theYAngle);
+                               theXAngle,
+                               theYAngle);
 }
 
-VISU::CutPlanes::Orientation VISU::CutPlanes_i::GetOrientationType() { 
+//----------------------------------------------------------------------------
+VISU::CutPlanes::Orientation 
+VISU::CutPlanes_i
+::GetOrientationType() 
+{ 
   return VISU::CutPlanes::Orientation(myCutPlanesPL->GetPlaneOrientation());
 }
-CORBA::Double VISU::CutPlanes_i::GetRotateX(){
+
+//----------------------------------------------------------------------------
+CORBA::Double 
+VISU::CutPlanes_i
+::GetRotateX()
+{
   return myCutPlanesPL->GetRotateX();
 }
-CORBA::Double VISU::CutPlanes_i::GetRotateY(){
+
+//----------------------------------------------------------------------------
+CORBA::Double 
+VISU::CutPlanes_i
+::GetRotateY()
+{
   return myCutPlanesPL->GetRotateY();
 }
 
 
-void VISU::CutPlanes_i::SetDisplacement(CORBA::Double theDisp) { 
+//----------------------------------------------------------------------------
+void
+VISU::CutPlanes_i
+::SetDisplacement(CORBA::Double theDisp) 
+{  
   myCutPlanesPL->SetDisplacement(theDisp);
 }
-CORBA::Double VISU::CutPlanes_i::GetDisplacement() { 
+
+//----------------------------------------------------------------------------
+CORBA::Double
+VISU::CutPlanes_i
+::GetDisplacement() 
+{ 
   return myCutPlanesPL->GetDisplacement();
 }
 
 
-void VISU::CutPlanes_i::SetPlanePosition(CORBA::Long thePlaneNumber, CORBA::Double thePlanePosition){
+//----------------------------------------------------------------------------
+void
+VISU::CutPlanes_i
+::SetPlanePosition(CORBA::Long thePlaneNumber, 
+                  CORBA::Double thePlanePosition)
+{
   myCutPlanesPL->SetPartPosition(thePlaneNumber,thePlanePosition);
 }
-CORBA::Double VISU::CutPlanes_i::GetPlanePosition(CORBA::Long thePlaneNumber){ 
+
+//----------------------------------------------------------------------------
+CORBA::Double 
+VISU::CutPlanes_i
+::GetPlanePosition(CORBA::Long thePlaneNumber)
+{ 
   return myCutPlanesPL->GetPartPosition(thePlaneNumber);
 }
 
 
-void VISU::CutPlanes_i::SetDefault(CORBA::Long thePlaneNumber){
+//----------------------------------------------------------------------------
+void
+VISU::CutPlanes_i
+::SetDefault(CORBA::Long thePlaneNumber)
+{
   myCutPlanesPL->SetPartDefault(thePlaneNumber);
 }
-CORBA::Boolean VISU::CutPlanes_i::IsDefault(CORBA::Long thePlaneNumber){ 
+
+//----------------------------------------------------------------------------
+CORBA::Boolean 
+VISU::CutPlanes_i
+::IsDefault(CORBA::Long thePlaneNumber)
+{ 
   return myCutPlanesPL->IsPartDefault(thePlaneNumber);
 }
 
 
-void VISU::CutPlanes_i::SetNbPlanes(CORBA::Long theNb) { 
+//----------------------------------------------------------------------------
+void 
+VISU::CutPlanes_i
+::SetNbPlanes(CORBA::Long theNb) 
+{ 
   myCutPlanesPL->SetNbParts(theNb);
 }
-CORBA::Long VISU::CutPlanes_i::GetNbPlanes() { 
+
+//----------------------------------------------------------------------------
+CORBA::Long
+VISU::CutPlanes_i
+::GetNbPlanes() 
+{ 
   return myCutPlanesPL->GetNbParts();
 }
 
 
-void VISU::CutPlanes_i::DoHook(){
-  if(!myPipeLine) myPipeLine = VISU_CutPlanesPL::New();
+//----------------------------------------------------------------------------
+void 
+VISU::CutPlanes_i
+::CreatePipeLine()
+{
+  if(!myPipeLine) 
+    myPipeLine = VISU_CutPlanesPL::New();
   myCutPlanesPL = dynamic_cast<VISU_CutPlanesPL*>(myPipeLine);
 
-  ScalarMap_i::DoHook();
+  TSuperClass::CreatePipeLine();
+}
+
+
+//---------------------------------------------------------------
+bool
+VISU::CutPlanes_i
+::CheckIsPossible() 
+{
+  return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
 }
 
+//----------------------------------------------------------------------------
 VISU_Actor* 
 VISU::CutPlanes_i
 ::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
 {
-  if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
+  if(VISU_Actor* anActor = TSuperClass::CreateActor(theIO)){
     anActor->SetVTKMapping(true);
     SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
     int aDispMode = aResourceMgr->integerValue("VISU" , "cut_planes_represent", 1);
index de65dbb7911c6f083bfdc30361da31d7d350970b..006c8c7ee66722c6305982a19680dabbdb92e0a9 100644 (file)
@@ -31,7 +31,8 @@
 
 class VISU_CutPlanesPL;
 
-namespace VISU{
+namespace VISU
+{
   class CutPlanes_i : public virtual POA_VISU::CutPlanes,
                      public virtual ScalarMap_i
   {
@@ -48,54 +49,132 @@ namespace VISU{
     explicit
     CutPlanes_i(Result_i* theResult,
                SALOMEDS::SObject_ptr theSObject);
-    virtual ~CutPlanes_i();
+    virtual
+    ~CutPlanes_i();
+
+    virtual
+    VISU::VISUType 
+    GetType() 
+    { 
+      return VISU::TCUTPLANES;
+    }
+
+    virtual
+    void
+    SetOrientation(VISU::CutPlanes::Orientation theOrient,
+                  CORBA::Double theXAngle, 
+                  CORBA::Double theYAngle);
 
-    virtual VISU::VISUType GetType() { return VISU::TCUTPLANES;};
+    virtual 
+    VISU::CutPlanes::Orientation 
+    GetOrientationType();
+
+    virtual
+    CORBA::Double
+    GetRotateX();
 
-    virtual void SetOrientation(VISU::CutPlanes::Orientation theOrient,
-                               CORBA::Double theXAngle, CORBA::Double theYAngle);
+    virtual
+    CORBA::Double
+    GetRotateY();
 
-    virtual VISU::CutPlanes::Orientation GetOrientationType();
-    virtual CORBA::Double GetRotateX();
-    virtual CORBA::Double GetRotateY();
+    virtual
+    void
+    SetDisplacement(CORBA::Double theDisp);
 
-    virtual void SetDisplacement(CORBA::Double theDisp);
-    virtual CORBA::Double GetDisplacement();
+    virtual
+    CORBA::Double
+    GetDisplacement();
+
+    virtual
+    void
+    SetPlanePosition(CORBA::Long thePlaneNumber, 
+                    CORBA::Double thePlanePosition);
+    virtual 
+    CORBA::Double 
+    GetPlanePosition(CORBA::Long thePlaneNumber);
 
-    virtual void SetPlanePosition(CORBA::Long thePlaneNumber, CORBA::Double thePlanePosition);
-    virtual CORBA::Double GetPlanePosition(CORBA::Long thePlaneNumber);
+    virtual
+    void
+    SetDefault(CORBA::Long thePlaneNumber);
 
-    virtual void SetDefault(CORBA::Long thePlaneNumber);
-    virtual CORBA::Boolean IsDefault(CORBA::Long thePlaneNumber);
+    virtual
+    CORBA::Boolean 
+    IsDefault(CORBA::Long thePlaneNumber);
 
-    virtual void SetNbPlanes(CORBA::Long theNb);
-    virtual CORBA::Long GetNbPlanes();
+    virtual
+    void
+    SetNbPlanes(CORBA::Long theNb);
+
+    virtual
+    CORBA::Long
+    GetNbPlanes();
 
     typedef VISU::CutPlanes TInterface;
-    VISU_CutPlanesPL* GetCutPlanesPL(){ return myCutPlanesPL;}
 
+    VISU_CutPlanesPL* 
+    GetSpecificPL() const
+    { 
+      return myCutPlanesPL; 
+    }
+    
   protected:
-    virtual void DoHook();
+    //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
+    virtual
+    void
+    CreatePipeLine();
+
+    //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
+    virtual 
+    bool 
+    CheckIsPossible();
 
     VISU_CutPlanesPL *myCutPlanesPL;
 
   public:
-    static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
-                         const char* theFieldName, int theIteration, int isMemoryCheck = true);
-    virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity,
-                            const char* theFieldName, int theIteration);
-
-    virtual void ToStream(std::ostringstream& theStr);
-
-    virtual Storable* Restore(const Storable::TRestoringMap& theMap);
-
+    //! Redefines VISU_ColoredPrs3d_i::IsPossible
+    static
+    int
+    IsPossible(Result_i* theResult, 
+              const char* theMeshName, 
+              VISU::Entity theEntity,
+              const char* theFieldName, 
+              int theTimeStampNumber, 
+              int isMemoryCheck = true);
+
+    //! Redefines VISU_ColoredPrs3d_i::Create
+    virtual 
+    Storable* 
+    Create(const char* theMeshName, 
+          VISU::Entity theEntity,
+          const char* theFieldName, 
+          int theTimeStampNumber);
+
+    //! Redefines VISU_ColoredPrs3d_i::ToStream
+    virtual
+    void
+    ToStream(std::ostringstream& theStr);
+
+    //! Redefines VISU_ColoredPrs3d_i::Restore
+    virtual
+    Storable* 
+    Restore(const Storable::TRestoringMap& theMap);
+
+    //! Redefines VISU_ColoredPrs3d_i::CreateActor
     virtual 
     VISU_Actor* 
     CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
 
     static const std::string myComment;
-    virtual const char* GetComment() const;
-    virtual QString GenerateName();
+
+    //! Redefines VISU_ColoredPrs3d_i::GetComment
+    virtual 
+    const char* 
+    GetComment() const;
+
+    //! Redefines VISU_ColoredPrs3d_i::GenerateName
+    virtual
+    QString
+    GenerateName();
   };
 }
 
index 8c2920dccd005ea1c7522027ecdfe7e0e527fbb9..0dbfdbe32a2565fd5d2be085c8c0ca9c7d31f7a6 100644 (file)
 #include <vtkDataSetMapper.h>
 #include <vtkProperty.h>
 
-using namespace VISU;
-using namespace std;
-
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
 #else
 static int MYDEBUG = 0;
 #endif
 
-int VISU::DeformedShape_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity, 
-                                     const char* theFieldName, int theIteration, int isMemoryCheck)
+
+//---------------------------------------------------------------
+int
+VISU::DeformedShape_i
+::IsPossible(Result_i* theResult, 
+            const char* theMeshName, 
+            VISU::Entity theEntity, 
+            const char* theFieldName, 
+            int theTimeStampNumber, 
+            int isMemoryCheck)
 {
   try{
-    if(!VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck)) return 0;
-    const VISU::PField aField = theResult->GetInput()->GetField(theMeshName,(VISU::TEntity)theEntity,theFieldName);
-    return aField->myNbComp > 1;
+    bool aResult = TSuperClass::IsPossible(theResult,
+                                          theMeshName,
+                                          theEntity,
+                                          theFieldName,
+                                          theTimeStampNumber,
+                                          isMemoryCheck);
+    if(aResult){
+      VISU::Result_i::TInput* anInput = theResult->GetInput();
+      VISU::PField aField = anInput->GetField(theMeshName,
+                                             (VISU::TEntity)theEntity,
+                                             theFieldName);
+      return aField->myNbComp > 1;
+    }
   }catch(std::exception& exc){
     INFOS("Follow exception was occured :\n"<<exc.what());
   }catch(...){
@@ -60,17 +75,35 @@ int VISU::DeformedShape_i::IsPossible(Result_i* theResult, const char* theMeshNa
   return 0;
 }
 
+
+//---------------------------------------------------------------
 int VISU::DeformedShape_i::myNbPresent = 0;
-QString VISU::DeformedShape_i::GenerateName() { return VISU::GenerateName("Def.Shape",myNbPresent++);}
 
+//---------------------------------------------------------------
+QString 
+VISU::DeformedShape_i
+::GenerateName() 
+{ 
+  return VISU::GenerateName("Def.Shape",myNbPresent++);
+}
+
+//---------------------------------------------------------------
 const string VISU::DeformedShape_i::myComment = "DEFORMEDSHAPE";
-const char* VISU::DeformedShape_i::GetComment() const { return myComment.c_str();}
 
+//---------------------------------------------------------------
+const char* 
+VISU::DeformedShape_i
+::GetComment() const 
+{ 
+  return myComment.c_str();
+}
 
-VISU::DeformedShape_i::
-DeformedShape_i(Result_i* theResult, 
-               bool theAddToStudy) : 
-  PrsObject_i(theResult->GetStudyDocument()), 
+
+//---------------------------------------------------------------
+VISU::DeformedShape_i
+::DeformedShape_i(Result_i* theResult, 
+                 bool theAddToStudy):
+  PrsObject_i(SALOMEDS::Study::_nil()), 
   Prs3d_i(theResult,theAddToStudy),
   ColoredPrs3d_i(theResult,theAddToStudy),
   ScalarMap_i(theResult,theAddToStudy),
@@ -80,10 +113,11 @@ DeformedShape_i(Result_i* theResult,
 }
 
 
-VISU::DeformedShape_i::
-DeformedShape_i(Result_i* theResult, 
-               SALOMEDS::SObject_ptr theSObject) : 
-  PrsObject_i(theResult->GetStudyDocument()), 
+//---------------------------------------------------------------
+VISU::DeformedShape_i
+::DeformedShape_i(Result_i* theResult, 
+                 SALOMEDS::SObject_ptr theSObject):
+  PrsObject_i(theSObject->GetStudy()), 
   Prs3d_i(theResult,theSObject),
   ColoredPrs3d_i(theResult,theSObject),
   ScalarMap_i(theResult,theSObject),
@@ -93,7 +127,10 @@ DeformedShape_i(Result_i* theResult,
 }
 
 
-void VISU::DeformedShape_i::SameAs(const Prs3d_i* theOrigin)
+//---------------------------------------------------------------
+void 
+VISU::DeformedShape_i
+::SameAs(const Prs3d_i* theOrigin)
 {
   TSuperClass::SameAs(theOrigin);
 
@@ -105,16 +142,24 @@ void VISU::DeformedShape_i::SameAs(const Prs3d_i* theOrigin)
 }
 
 
-VISU::Storable* VISU::DeformedShape_i::Create(const char* theMeshName, VISU::Entity theEntity, 
-                                             const char* theFieldName, int theIteration)
+//---------------------------------------------------------------
+VISU::Storable* 
+VISU::DeformedShape_i
+::Create(const char* theMeshName, 
+        VISU::Entity theEntity,
+        const char* theFieldName, 
+        int theTimeStampNumber)
 {
   myIsColored = false;
   myColor.R = myColor.G = myColor.B = 0.5;
-  return ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+  return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
 }
 
 
-VISU::Storable* VISU::DeformedShape_i::Restore(const Storable::TRestoringMap& theMap)
+//---------------------------------------------------------------
+VISU::Storable* 
+VISU::DeformedShape_i
+::Restore(const Storable::TRestoringMap& theMap)
 {
   TSuperClass::Restore(theMap);
 
@@ -128,8 +173,12 @@ VISU::Storable* VISU::DeformedShape_i::Restore(const Storable::TRestoringMap& th
 }
 
 
-void VISU::DeformedShape_i::ToStream(std::ostringstream& theStr){
-  ScalarMap_i::ToStream(theStr);
+//---------------------------------------------------------------
+void
+VISU::DeformedShape_i
+::ToStream(std::ostringstream& theStr)
+{
+  TSuperClass::ToStream(theStr);
 
   Storable::DataToStream( theStr, "myFactor", GetScale() );
 
@@ -140,38 +189,70 @@ void VISU::DeformedShape_i::ToStream(std::ostringstream& theStr){
 }
 
 
-VISU::DeformedShape_i::~DeformedShape_i(){
+//---------------------------------------------------------------
+VISU::DeformedShape_i
+::~DeformedShape_i()
+{
   if(MYDEBUG) MESSAGE("DeformedShape_i::~DeformedShape_i()");
 }
 
 
-void VISU::DeformedShape_i::SetScale(CORBA::Double theScale) { 
+//---------------------------------------------------------------
+void 
+VISU::DeformedShape_i
+::SetScale(CORBA::Double theScale) 
+{ 
   myDeformedShapePL->SetScale(theScale);
 }
-CORBA::Double VISU::DeformedShape_i::GetScale(){
+
+//---------------------------------------------------------------
+CORBA::Double 
+VISU::DeformedShape_i
+::GetScale()
+{
   return myDeformedShapePL->GetScale();
 }
 
 
-void VISU::DeformedShape_i::DoHook(){
-  if(!myPipeLine) myPipeLine = VISU_DeformedShapePL::New();
+//---------------------------------------------------------------
+void
+VISU::DeformedShape_i
+::CreatePipeLine()
+{
+  if(!myPipeLine) 
+    myPipeLine = VISU_DeformedShapePL::New();
   myDeformedShapePL = dynamic_cast<VISU_DeformedShapePL*>(myPipeLine);
   myPipeLine->GetMapper()->SetScalarVisibility(IsColored());
 
-  ScalarMap_i::DoHook();
+  TSuperClass::CreatePipeLine();
+}
+
+
+//---------------------------------------------------------------
+bool
+VISU::DeformedShape_i
+::CheckIsPossible() 
+{
+  return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
 }
 
 
-void VISU::DeformedShape_i::SetMapScale(double theMapScale){
+//---------------------------------------------------------------
+void 
+VISU::DeformedShape_i
+::SetMapScale(double theMapScale)
+{
   myDeformedShapePL->SetMapScale(theMapScale);
 }
 
 
+//---------------------------------------------------------------
 VISU_Actor* 
 VISU::DeformedShape_i
-::CreateActor(const Handle(SALOME_InteractiveObject)& theIO, bool toSupressShrinking) 
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO, 
+             bool toSupressShrinking) 
 {
-  VISU_Actor* anActor = VISU::ScalarMap_i::CreateActor(theIO, true);
+  VISU_Actor* anActor = TSuperClass::CreateActor(theIO, true);
   anActor->SetVTKMapping(false);
   SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
   int  aDispMode = aResourceMgr->integerValue("VISU", "deformed_shape_represent", 1);
@@ -182,6 +263,8 @@ VISU::DeformedShape_i
   return anActor;
 }
 
+
+//---------------------------------------------------------------
 VISU_Actor* 
 VISU::DeformedShape_i
 ::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) 
@@ -189,7 +272,12 @@ VISU::DeformedShape_i
   return CreateActor(theIO, false);
 }
 
-void VISU::DeformedShape_i::UpdateActor(VISU_Actor* theActor) {
+
+//---------------------------------------------------------------
+void
+VISU::DeformedShape_i
+::UpdateActor(VISU_Actor* theActor) 
+{
   if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
     if(IsColored()){
       anActor->SetBarVisibility(true);
@@ -199,6 +287,6 @@ void VISU::DeformedShape_i::UpdateActor(VISU_Actor* theActor) {
       myPipeLine->GetMapper()->SetScalarVisibility(0);
       anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
     }
-    VISU::ScalarMap_i::UpdateActor(theActor);
+    TSuperClass::UpdateActor(theActor);
   }
 }
index 42854699e5679991f2f24fa8ba90cf8d8f2b4555..be727c748dae86c40135e90a967c85a3911cb03b 100644 (file)
@@ -31,7 +31,8 @@
 
 class VISU_DeformedShapePL;
 
-namespace VISU{
+namespace VISU
+{
   class DeformedShape_i : public virtual POA_VISU::DeformedShape,
                          public virtual ScalarMap_i
   {
@@ -48,45 +49,116 @@ namespace VISU{
     explicit
     DeformedShape_i(Result_i* theResult,
                    SALOMEDS::SObject_ptr theSObject);
-    virtual void SameAs(const Prs3d_i* theOrigin);
-    virtual ~DeformedShape_i();
+    virtual 
+    void 
+    SameAs(const Prs3d_i* theOrigin);
 
-    virtual VISU::VISUType GetType() { return VISU::TDEFORMEDSHAPE;};
+    virtual 
+    ~DeformedShape_i();
 
-    virtual void SetScale(CORBA::Double theScale);
-    virtual CORBA::Double GetScale();
+    virtual 
+    VISU::VISUType 
+    GetType() 
+    { 
+      return VISU::TDEFORMEDSHAPE;
+    }
 
-    virtual CORBA::Boolean IsColored() { return myIsColored; }
-    virtual void ShowColored(CORBA::Boolean theColored) { myIsColored = theColored; }
+    virtual
+    void 
+    SetScale(CORBA::Double theScale);
 
-    virtual SALOMEDS::Color GetColor() { return myColor;}
-    virtual void SetColor(const SALOMEDS::Color& theColor) { myColor = theColor;}
+    virtual
+    CORBA::Double 
+    GetScale();
+
+    virtual 
+    CORBA::Boolean 
+    IsColored() 
+    { 
+      return myIsColored; 
+    }
+
+    virtual 
+    void
+    ShowColored(CORBA::Boolean theColored)
+    {
+      myIsColored = theColored; 
+    }
+
+    virtual 
+    SALOMEDS::Color GetColor() 
+    { 
+      return myColor;
+    }
+
+    virtual
+    void
+    SetColor(const SALOMEDS::Color& theColor)
+    {
+      myColor = theColor;
+    }
 
     typedef VISU::DeformedShape TInterface;
-    VISU_DeformedShapePL* GetDeformedShapePL(){ return myDeformedShapePL;}
 
+    VISU_DeformedShapePL* 
+    GetSpecificPL() const
+    { 
+      return myDeformedShapePL; 
+    }
+    
   protected:
-    virtual void DoHook();
+    //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
+    virtual 
+    void
+    CreatePipeLine();
+
+    //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
+    virtual 
+    bool 
+    CheckIsPossible();
 
     VISU_DeformedShapePL *myDeformedShapePL;
     SALOMEDS::Color myColor;
     bool myIsColored;
 
   public:
-    static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
-                         const char* theFieldName, int theIteration, int isMemoryCheck = true);
-    virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity,
-                            const char* theFieldName, int theIteration);
+    static
+    int
+    IsPossible(Result_i* theResult, 
+              const char* theMeshName, 
+              VISU::Entity theEntity,
+              const char* theFieldName, 
+              int theTimeStampNumber, 
+              int isMemoryCheck = true);
+
+    virtual 
+    Storable* 
+    Create(const char* theMeshName, 
+          VISU::Entity theEntity,
+          const char* theFieldName, 
+          int theTimeStampNumber);
 
     static const std::string myComment;
-    virtual const char* GetComment() const;
-    virtual QString GenerateName();
 
-    virtual void ToStream(std::ostringstream& theStr);
+    virtual 
+    const char* 
+    GetComment() const;
+
+    virtual
+    QString 
+    GenerateName();
 
-    virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+    virtual
+    void
+    ToStream(std::ostringstream& theStr);
 
-    virtual void SetMapScale(double theMapScale = 1.0);
+    virtual
+    Storable* 
+    Restore(const Storable::TRestoringMap& theMap);
+
+    virtual
+    void
+    SetMapScale(double theMapScale = 1.0);
 
     virtual 
     VISU_Actor* 
@@ -94,9 +166,12 @@ namespace VISU{
 
     virtual 
     VISU_Actor* 
-    CreateActor(const Handle(SALOME_InteractiveObject)& theIO, bool toSupressShrinking);
+    CreateActor(const Handle(SALOME_InteractiveObject)& theIO, 
+               bool toSupressShrinking);
 
-    virtual void UpdateActor(VISU_Actor* theActor) ;
+    virtual 
+    void
+    UpdateActor(VISU_Actor* theActor) ;
   };
 }
 
index a2e810a8711ee7edd5f21ea816b754ad72c08421..251abdd75ddc346fb86368af65f282042ae90980 100644 (file)
@@ -180,11 +180,13 @@ namespace VISU
       break;
     }
 
+    CORBA::String_var aMeshName = theServant->GetMeshName();
+    CORBA::String_var aFieldName = theServant->GetFieldName();
     theStr<<thePrefix<<theName<<" = aVisu."<<theConstructorName<<"("<<theArgumentName<<
-      ",'"<<theServant->GetMeshName()<<"'"<<
+      ",'"<<aMeshName.in()<<"'"<<
       ","<<aParam<<
-      ",'"<<theServant->GetFieldName()<<"'"<<
-      ","<<theServant->GetIteration()<<
+      ",'"<<aFieldName.in()<<"'"<<
+      ","<<theServant->GetTimeStampNumber()<<
       ")"<<endl;
 
     theStr<<thePrefix<<"if "<<theName<<":"<<endl;
@@ -617,6 +619,7 @@ namespace VISU
           if(Mesh_i* aServant = dynamic_cast<Mesh_i*>(GetServant(anObj).in())){            
            VISU::Entity anEntity = aServant->GetEntity();
            const std::string& aSubMeshName = aServant->GetSubMeshName();
+           CORBA::String_var aMeshName = aServant->GetMeshName();
            if(anEntity >= 0){
              std::string aParam;
              switch(anEntity){
@@ -636,18 +639,18 @@ namespace VISU
 
              if(aSubMeshName == "")
                theStr<<thePrefix<<aName<<" = aVisu.MeshOnEntity("<<theArgumentName<<
-                 ",'"<<aServant->GetMeshName()<<"'"<<
+                 ",'"<<aMeshName.in()<<"'"<<
                  ","<<aParam<<
                  ")"<<endl;
              else
                theStr<<thePrefix<<aName<<" = aVisu.FamilyMeshOnEntity("<<theArgumentName<<
-                 ",'"<<aServant->GetMeshName()<<"'"<<
+                 ",'"<<aMeshName.in()<<"'"<<
                  ","<<aParam<<
                  ",'"<<aSubMeshName<<"'"<<
                  ")"<<endl;
            }else
              theStr<<thePrefix<<aName<<" = aVisu.GroupMesh("<<theArgumentName<<
-               ",'"<<aServant->GetMeshName()<<"'"<<
+               ",'"<<aMeshName.in()<<"'"<<
                ",'"<<aSubMeshName<<"'"<<
                ")"<<endl;
 
index 2fde203e88d8f84600bbc39a0b1706cd9fb0896d..c42f9bbf1d0982626340351f2ce8ff2780fd764a 100644 (file)
@@ -43,9 +43,6 @@
 #include <vtkTextProperty.h>
 #include <vtkProperty.h>
 
-using namespace VISU;
-using namespace std;
-
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
 #else
@@ -510,18 +507,18 @@ VISU::GaussPoints_i
 //----------------------------------------------------------------------------
 void
 VISU::GaussPoints_i
-::DoSetInput(Result_i* theResult)
+::DoSetInput()
 {
-  VISU::Result_i::TInput* anInput = theResult->GetInput();
+  VISU::Result_i::TInput* anInput = myResult->GetInput();
   if(!anInput)
-    throw std::runtime_error("Mesh_i::Build - theResult->GetInput() == NULL !!!");
+    throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
 
-  myField = anInput->GetField(myMeshName,myEntity,myFieldName);
+  myField = anInput->GetField(GetMeshName(),GetTEntity(),GetFieldName());
   if(!myField) 
     throw std::runtime_error("There is no Field with the parameters !!!");
 
   VISU::PGaussPtsIDMapper aGaussPtsIDMapper =
-    anInput->GetTimeStampOnGaussPts(myMeshName,myEntity,myFieldName,myIteration);
+    anInput->GetTimeStampOnGaussPts(GetMeshName(),GetTEntity(),GetFieldName(),GetTimeStampNumber());
 
   if(!aGaussPtsIDMapper) 
     throw std::runtime_error("There is no TimeStamp with the parameters !!!");
@@ -530,21 +527,30 @@ VISU::GaussPoints_i
   myGaussPointsPL->Init();
   myGaussPointsPL->Build();
 
-  theResult->MinMaxConnect(this);
+  myResult->MinMaxConnect(this);
+}
+
+
+//----------------------------------------------------------------------------
+bool
+VISU::GaussPoints_i
+::CheckIsPossible() 
+{
+  return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
 }
 
 
 //----------------------------------------------------------------------------
 void
 VISU::GaussPoints_i
-::DoHook()
+::CreatePipeLine()
 {
   if(!myPipeLine) 
     myPipeLine = VISU_GaussPointsPL::New();
 
   myGaussPointsPL = dynamic_cast<VISU_GaussPointsPL*>(myPipeLine);
 
-  TSuperClass::DoHook();
+  TSuperClass::CreatePipeLine();
 }
 
 
index c80ef747ece03d9b3c8fef45cbbfa4464102fc05..3a907582ef961df6ffc8cb2a0ad722cd3bcaa146 100644 (file)
@@ -246,14 +246,27 @@ namespace VISU
     void
     UpdateMinMax();
 
+    VISU_GaussPointsPL* 
+    GetSpecificPL() const
+    { 
+      return myGaussPointsPL; 
+    }
+    
   protected:
+    //! Redefines VISU_ColoredPrs3d_i::DoSetInput
     virtual
     void
-    DoSetInput(Result_i* theResult);
+    DoSetInput();
 
+    //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
     virtual
     void
-    DoHook();
+    CreatePipeLine();
+
+    //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
+    virtual 
+    bool 
+    CheckIsPossible();
 
     virtual 
     VISU_PipeLine* 
@@ -273,9 +286,9 @@ namespace VISU
     UpdateScalarBar(vtkScalarBarActor *theScalarBar,
                    vtkLookupTable* theLookupTable);
 
-
+  protected:
     VISU_GaussPointsPL *myGaussPointsPL;
-
+    
     bool myIsColored;
     bool myIsDispGlobalScalarBar;
     bool myIsActiveLocalScalarBar;
index ebac78cbbf98ffc92123a52ec7570ae50b6feada..5d5993526320a2da1acc9c48504a1a0a9249e140 100644 (file)
@@ -219,8 +219,9 @@ namespace VISU
 
 
   //===========================================================================
-  VISU_Gen_i::VISU_Gen_i(CORBA::ORB_ptr theORB, PortableServer::POA_ptr thePOA,
-                        SALOME_NamingService* theNamingService, QMutex* theMutex) :
+  VISU_Gen_i::
+  VISU_Gen_i(CORBA::ORB_ptr theORB, PortableServer::POA_ptr thePOA,
+            SALOME_NamingService* theNamingService, QMutex* theMutex) :
     Engines_Component_i()
   {
     if(MYDEBUG) MESSAGE("VISU_Gen_i::VISU_Gen_i : "<<theMutex);
@@ -244,6 +245,51 @@ namespace VISU
       if(MYDEBUG) MESSAGE("VISU_Gen_i::VISU_Gen_i : there is no opened study in StudyManager !!!");
   }
 
+
+  template<typename TPrs3d_i> 
+  Prs3d_ptr
+  CreatePrs3d(SALOMEDS::Study_ptr theStudy)
+  {
+    if(!theStudy->GetProperties()->IsLocked()){
+      typedef typename TPrs3d_i::TInterface TPrs3d;
+      typename TPrs3d::_var_type aPrs3d;
+      if(TPrs3d_i* aPresent = new TPrs3d_i(NULL,true)){
+       return aPresent->_this();
+      }
+    }
+    return Prs3d::_nil();
+  }
+
+
+  Prs3d_ptr
+  VISU_Gen_i::
+  CreatePrs3d(VISUType theType,
+             SALOMEDS::Study_ptr theStudy)
+  {
+    switch(theType){
+    case TSCALARMAP:
+      return VISU::CreatePrs3d<ScalarMap_i>(theStudy);
+    case TGAUSSPOINTS:
+      return VISU::CreatePrs3d<GaussPoints_i>(theStudy);
+    case TDEFORMEDSHAPE:
+      return VISU::CreatePrs3d<DeformedShape_i>(theStudy);
+    case TSCALARMAPONDEFORMEDSHAPE:
+      return VISU::CreatePrs3d<ScalarMapOnDeformedShape_i>(theStudy);
+    case TISOSURFACE:
+      return VISU::CreatePrs3d<IsoSurfaces_i>(theStudy);
+    case TSTREAMLINES:
+      return VISU::CreatePrs3d<StreamLines_i>(theStudy);
+    case TPLOT3D:
+      return VISU::CreatePrs3d<Plot3D_i>(theStudy);
+    case TCUTPLANES:
+      return VISU::CreatePrs3d<CutPlanes_i>(theStudy);
+    case TCUTLINES:
+      return VISU::CreatePrs3d<CutLines_i>(theStudy);
+    }
+    return Prs3d::_nil();
+  }
+
+
   bool
   CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d,
                    const char* theMeshName, 
index 1a5f6f8282b3f9c9cfb40f77187be3f05eb0bb22..1faf9ca2395f03a8ff5a7a2d0bcdce6272472f13 100644 (file)
@@ -155,6 +155,10 @@ namespace VISU
              const char* theMeshName, 
              const char* theGroupName);
 
+    Prs3d_ptr
+    CreatePrs3d(VISUType theType,
+               SALOMEDS::Study_ptr theStudy);
+
     //Create 3D collored Presentation Of Different Types
     template<typename TPrs3d_i> TPrs3d_i*
     CreatePrs3d(Result_ptr theResult, 
index 0f0077bc244aa7e1e4a435b459082b38508940a9..b165af57d882d52b25c36144799c77d47b8990cc 100644 (file)
 
 #include "SUIT_ResourceMgr.h"
 
-using namespace VISU;
-using namespace std;
-
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
 #else
 static int MYDEBUG = 0;
 #endif
 
-int VISU::IsoSurfaces_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity, 
-                                   const char* theFieldName, int theIteration, int isMemoryCheck)
+//---------------------------------------------------------------
+int
+VISU::IsoSurfaces_i
+::IsPossible(Result_i* theResult, 
+            const char* theMeshName, 
+            VISU::Entity theEntity, 
+            const char* theFieldName, 
+            int theTimeStampNumber, 
+            int isMemoryCheck)
 {
-  return VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
+  return TSuperClass::IsPossible(theResult,
+                                theMeshName,
+                                theEntity,
+                                theFieldName,
+                                theTimeStampNumber,
+                                isMemoryCheck);
 }
 
+//---------------------------------------------------------------
 int VISU::IsoSurfaces_i::myNbPresent = 0;
-QString VISU::IsoSurfaces_i::GenerateName() { return VISU::GenerateName("IsoSurfaces",myNbPresent++);}
 
+//---------------------------------------------------------------
+QString VISU::IsoSurfaces_i::GenerateName()
+{ 
+  return VISU::GenerateName("IsoSurfaces",myNbPresent++);
+}
+
+//---------------------------------------------------------------
 const string VISU::IsoSurfaces_i::myComment = "ISOSURFACES";
-const char* VISU::IsoSurfaces_i::GetComment() const { return myComment.c_str();}
+
+//---------------------------------------------------------------
+const char* 
+VISU::IsoSurfaces_i
+::GetComment() const
+{ 
+  return myComment.c_str();
+}
 
 
-VISU::IsoSurfaces_i::
-IsoSurfaces_i(Result_i* theResult, 
-             bool theAddToStudy) :
-  PrsObject_i(theResult->GetStudyDocument()), 
+//---------------------------------------------------------------
+VISU::IsoSurfaces_i
+::IsoSurfaces_i(Result_i* theResult, 
+               bool theAddToStudy) :
+  PrsObject_i(SALOMEDS::Study::_nil()), 
   Prs3d_i(theResult,theAddToStudy),
   ColoredPrs3d_i(theResult,theAddToStudy),
   ScalarMap_i(theResult,theAddToStudy),
@@ -64,26 +88,34 @@ IsoSurfaces_i(Result_i* theResult,
 {}
 
 
-VISU::IsoSurfaces_i::
-IsoSurfaces_i(Result_i* theResult, 
-             SALOMEDS::SObject_ptr theSObject) :
-  PrsObject_i(theResult->GetStudyDocument()), 
+//---------------------------------------------------------------
+VISU::IsoSurfaces_i
+::IsoSurfaces_i(Result_i* theResult, 
+               SALOMEDS::SObject_ptr theSObject) :
+  PrsObject_i(theSObject->GetStudy()), 
   Prs3d_i(theResult,theSObject),
   ColoredPrs3d_i(theResult,theSObject),
   ScalarMap_i(theResult,theSObject),
   myIsoSurfacesPL(NULL)
-{
-}
+{}
 
 
-VISU::Storable* VISU::IsoSurfaces_i::Create(const char* theMeshName, VISU::Entity theEntity, 
-                                           const char* theFieldName, int theIteration)
+//---------------------------------------------------------------
+VISU::Storable* 
+VISU::IsoSurfaces_i
+::Create(const char* theMeshName, 
+        VISU::Entity theEntity,
+        const char* theFieldName, 
+        int theTimeStampNumber)
 {
-  return ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+  return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
 }
 
 
-VISU::Storable* VISU::IsoSurfaces_i::Restore(const Storable::TRestoringMap& theMap)
+//---------------------------------------------------------------
+VISU::Storable* 
+VISU::IsoSurfaces_i
+::Restore(const Storable::TRestoringMap& theMap)
 {
   TSuperClass::Restore(theMap);
 
@@ -95,8 +127,13 @@ VISU::Storable* VISU::IsoSurfaces_i::Restore(const Storable::TRestoringMap& theM
   return this;
 }
 
-void VISU::IsoSurfaces_i::ToStream(std::ostringstream& theStr){
-  ScalarMap_i::ToStream(theStr);
+
+//---------------------------------------------------------------
+void
+VISU::IsoSurfaces_i
+::ToStream(std::ostringstream& theStr)
+{
+  TSuperClass::ToStream(theStr);
 
   Storable::DataToStream( theStr, "myNbSurface", int(GetNbSurfaces()) );
   Storable::DataToStream( theStr, "myRange[0]", GetSubMin() );
@@ -104,46 +141,84 @@ void VISU::IsoSurfaces_i::ToStream(std::ostringstream& theStr){
 }
 
 
-VISU::IsoSurfaces_i::~IsoSurfaces_i(){
+//---------------------------------------------------------------
+VISU::IsoSurfaces_i
+::~IsoSurfaces_i()
+{
   if(MYDEBUG) MESSAGE("IsoSurfaces_i::~IsoSurfaces_i()");
 }
 
 
-void VISU::IsoSurfaces_i::SetNbSurfaces(CORBA::Long theNb){
+//---------------------------------------------------------------
+void 
+VISU::IsoSurfaces_i
+::SetNbSurfaces(CORBA::Long theNb)
+{
   myIsoSurfacesPL->SetNbParts(theNb);
 }
-CORBA::Long VISU::IsoSurfaces_i::GetNbSurfaces(){
+
+//---------------------------------------------------------------
+CORBA::Long 
+VISU::IsoSurfaces_i
+::GetNbSurfaces()
+{
   return myIsoSurfacesPL->GetNbParts();
 }
 
 
-void VISU::IsoSurfaces_i::SetSubRange(CORBA::Double theMin, CORBA::Double theMax)
+//---------------------------------------------------------------
+void
+VISU::IsoSurfaces_i
+::SetSubRange(CORBA::Double theMin, CORBA::Double theMax)
 { 
   vtkFloatingPointType aRange[2] = {theMin, theMax};
   myIsoSurfacesPL->SetRange(aRange);
 }
-CORBA::Double VISU::IsoSurfaces_i::GetSubMin(){
+
+//---------------------------------------------------------------
+CORBA::Double 
+VISU::IsoSurfaces_i
+::GetSubMin()
+{
   return myIsoSurfacesPL->GetMin();
 }
-CORBA::Double VISU::IsoSurfaces_i::GetSubMax(){
+
+//---------------------------------------------------------------
+CORBA::Double 
+VISU::IsoSurfaces_i
+::GetSubMax()
+{
   return myIsoSurfacesPL->GetMax();
 }
 
 
-void VISU::IsoSurfaces_i::DoHook(){
+//---------------------------------------------------------------
+void 
+VISU::IsoSurfaces_i
+::CreatePipeLine()
+{
   if(MYDEBUG) MESSAGE("IsoSurfaces_i::DoHook()- "<<myPipeLine);
   if(!myPipeLine) myPipeLine = VISU_IsoSurfacesPL::New();
   myIsoSurfacesPL = dynamic_cast<VISU_IsoSurfacesPL*>(myPipeLine);
 
-  ScalarMap_i::DoHook();
+  TSuperClass::CreatePipeLine();
 }
 
 
+//---------------------------------------------------------------
+bool
+VISU::IsoSurfaces_i
+::CheckIsPossible() 
+{
+  return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+}
+
+//---------------------------------------------------------------
 VISU_Actor* 
 VISU::IsoSurfaces_i
 ::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
 {
-  if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
+  if(VISU_Actor* anActor = TSuperClass::CreateActor(theIO)){
     anActor->SetVTKMapping(true);
     SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
     int  aDispMode = aResourceMgr->integerValue("VISU" , "iso_surfaces_represent", 2);
@@ -153,6 +228,11 @@ VISU::IsoSurfaces_i
   return NULL;
 }
 
-void VISU::IsoSurfaces_i::SetMapScale(double theMapScale){
+
+//---------------------------------------------------------------
+void
+VISU::IsoSurfaces_i
+::SetMapScale(double theMapScale)
+{
   myIsoSurfacesPL->SetMapScale(theMapScale);
 }
index 56db9093c1d88d23a368a36e1450bddeafb02cdb..bcbb8662fe11a4a52014f1bd96bd71dfc81c316e 100644 (file)
@@ -31,7 +31,8 @@
 
 class VISU_IsoSurfacesPL;
 
-namespace VISU{
+namespace VISU
+{
   class IsoSurfaces_i : public virtual POA_VISU::IsoSurfaces,
                        public virtual ScalarMap_i
   {
@@ -48,43 +49,99 @@ namespace VISU{
     explicit
     IsoSurfaces_i(Result_i* theResult,
                  SALOMEDS::SObject_ptr theSObject);
-    virtual ~IsoSurfaces_i();
+    virtual 
+    ~IsoSurfaces_i();
+
+    virtual
+    VISU::VISUType 
+    GetType() 
+    { 
+      return VISU::TISOSURFACE;
+    }
 
-    virtual VISU::VISUType GetType() { return VISU::TISOSURFACE;};
+    virtual
+    void
+    SetNbSurfaces(CORBA::Long theNb);
 
-    virtual void SetNbSurfaces(CORBA::Long theNb);
-    virtual CORBA::Long GetNbSurfaces();
+    virtual
+    CORBA::Long 
+    GetNbSurfaces();
+
+    virtual 
+    void
+    SetSubRange(CORBA::Double theMin, CORBA::Double theMax);
 
-    virtual void SetSubRange(CORBA::Double theMin, CORBA::Double theMax);
-    virtual CORBA::Double GetSubMin();
-    virtual CORBA::Double GetSubMax();
+    virtual
+    CORBA::Double 
+    GetSubMin();
+
+    virtual
+    CORBA::Double 
+    GetSubMax();
 
     typedef VISU::IsoSurfaces TInterface;
-    VISU_IsoSurfacesPL* GetIsoSurfacesPL(){ return myIsoSurfacesPL;}
 
+    VISU_IsoSurfacesPL* 
+    GetSpecificPL() const
+    { 
+      return myIsoSurfacesPL; 
+    }
+    
   protected:
-    virtual void DoHook();
+    //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
+    virtual 
+    void 
+    CreatePipeLine();
+
+    //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
+    virtual 
+    bool 
+    CheckIsPossible();
+
     VISU_IsoSurfacesPL* myIsoSurfacesPL;
 
   public:
-    static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
-                         const char* theFieldName, int theIteration, int isMemoryCheck = true);
-    virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity,
-                            const char* theFieldName, int theIteration);
+    static
+    int
+    IsPossible(Result_i* theResult, 
+              const char* theMeshName, 
+              VISU::Entity theEntity,
+              const char* theFieldName, 
+              int theTimeStampNumber, 
+              int isMemoryCheck = true);
+
+    virtual
+    Storable* 
+    Create(const char* theMeshName, 
+          VISU::Entity theEntity,
+          const char* theFieldName, 
+          int theTimeStampNumber);
 
     static const std::string myComment;
-    virtual const char* GetComment() const;
-    virtual QString GenerateName();
 
-    virtual void ToStream(std::ostringstream& theStr);
+    virtual 
+    const char* 
+    GetComment() const;
+
+    virtual
+    QString
+    GenerateName();
 
-    virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+    virtual
+    void
+    ToStream(std::ostringstream& theStr);
+
+    virtual
+    Storable* 
+    Restore(const Storable::TRestoringMap& theMap);
 
     virtual 
     VISU_Actor* 
     CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
-
-    virtual void SetMapScale(double theMapScale = 1.0);
+    
+    virtual 
+    void 
+    SetMapScale(double theMapScale = 1.0);
   };
 }
 
index ababd5074ccc8c94689164a913db0acd42ab994b..a848763f715665c5122dbc5a091fd190ad216a49 100644 (file)
@@ -223,7 +223,7 @@ VISU::Mesh_i::~Mesh_i(){
 
 VISU::Storable* VISU::Mesh_i::Build (int theRestoring)
 {
-  SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+  SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
   aStudyBuilder->NewCommand();  // There is a transaction
   try {
     if (myResult->GetInput() == NULL)
@@ -287,8 +287,8 @@ VISU::Storable* VISU::Mesh_i::Build (int theRestoring)
       string anEntry = myResult->GetEntry(aComment.latin1());
       if(anEntry == "") 
        throw std::runtime_error("Mesh_i::Build - anEntry was not found !!!");
-      mySObject = myStudy->FindObjectID(anEntry.c_str());
-      SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+      mySObject = GetStudyDocument()->FindObjectID(anEntry.c_str());
+      SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
       SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(mySObject,"AttributeIOR");
       SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
       CORBA::String_var aString = GetID();
index c7e43098f55ebbe1c29d7fcdca328aeaf866d201..ed769cfff6a3fa154581b09d8928503052289b13 100644 (file)
@@ -76,7 +76,6 @@ namespace VISU
 
     VISU_MeshPL* myMeshPL;
 
-    // std::string myMeshName; move it to Prs3d_i
     int myEntity;//jfa IPAL9284: TEntity myEntity;
     std::string mySubMeshName;
     VISU::VISUType myType;
@@ -92,7 +91,6 @@ namespace VISU
     static int IsPossible(Result_i* theResult, const char* theMeshName, const char* theGroupName);
     virtual Storable* Create(const char* theMeshName, const char* theGroupName);
 
-    const std::string& GetMeshName() const { return myMeshName;}
     VISU::Entity GetEntity() const { return VISU::Entity(myEntity);}
     const string& GetSubMeshName() const { return mySubMeshName;}
 
index d86ca318333de8fa0ea93bbb963ab641722cdbb5..7484a71047ec974954d1d36c44c4019e0672734a 100644 (file)
 //
 
 #include "VISU_Plot3D_i.hh"
-
 #include "VISU_Result_i.hh"
-
 #include "VISU_Plot3DPL.hxx"
-
 #include "VISU_Actor.h"
-
 #include "SUIT_ResourceMgr.h"
 
-using namespace VISU;
-using namespace std;
-
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
 #else
 static int MYDEBUG = 0;
 #endif
 
-int VISU::Plot3D_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
-                              const char* theFieldName, int theIteration, int isMemoryCheck)
+
+//---------------------------------------------------------------
+int 
+VISU::Plot3D_i
+::IsPossible(Result_i* theResult, 
+            const char* theMeshName, 
+            VISU::Entity theEntity, 
+            const char* theFieldName, 
+            int theTimeStampNumber, 
+            int isMemoryCheck)
 {
-  return VISU::ScalarMap_i::IsPossible
-    (theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
+  return TSuperClass::IsPossible(theResult,
+                                theMeshName,
+                                theEntity,
+                                theFieldName,
+                                theTimeStampNumber,
+                                isMemoryCheck);
 }
 
+//---------------------------------------------------------------
 int VISU::Plot3D_i::myNbPresent = 0;
-QString VISU::Plot3D_i::GenerateName() { return VISU::GenerateName("Plot3D",myNbPresent++); }
 
+//---------------------------------------------------------------
+QString 
+VISU::Plot3D_i
+::GenerateName() 
+{ 
+  return VISU::GenerateName("Plot3D",myNbPresent++); 
+}
+
+//---------------------------------------------------------------
 const string VISU::Plot3D_i::myComment = "PLOT3D";
-const char* VISU::Plot3D_i::GetComment() const { return myComment.c_str(); }
 
+//---------------------------------------------------------------
+const char* 
+VISU::Plot3D_i
+::GetComment() const 
+{ 
+  return myComment.c_str(); 
+}
+
+
+//---------------------------------------------------------------
 VISU::Plot3D_i
 ::Plot3D_i(Result_i* theResult, 
           bool theAddToStudy) :
-  PrsObject_i(theResult->GetStudyDocument()),
+  PrsObject_i(SALOMEDS::Study::_nil()),
   Prs3d_i(theResult,theAddToStudy),
   ColoredPrs3d_i(theResult,theAddToStudy),
   ScalarMap_i(theResult,theAddToStudy),
   myPlot3DPL(NULL)
 {}
 
+
+//---------------------------------------------------------------
 VISU::Plot3D_i
 ::Plot3D_i(Result_i* theResult, 
           SALOMEDS::SObject_ptr theSObject) :
-  PrsObject_i(theResult->GetStudyDocument()),
+  PrsObject_i(theSObject->GetStudy()),
   Prs3d_i(theResult,theSObject),
   ColoredPrs3d_i(theResult,theSObject),
   ScalarMap_i(theResult,theSObject),
   myPlot3DPL(NULL)
 {}
 
-VISU::Storable* VISU::Plot3D_i::Create (const char* theMeshName, VISU::Entity theEntity,
-                                       const char* theFieldName, int theIteration)
+
+//---------------------------------------------------------------
+VISU::Storable* 
+VISU::Plot3D_i
+::Create(const char* theMeshName, 
+        VISU::Entity theEntity,
+        const char* theFieldName, 
+        int theTimeStampNumber)
 {
-  return ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+  return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
 }
 
-VISU::Storable* VISU::Plot3D_i::Restore (const Storable::TRestoringMap& theMap)
+
+//---------------------------------------------------------------
+VISU::Storable* 
+VISU::Plot3D_i
+::Restore(const Storable::TRestoringMap& theMap)
 {
   TSuperClass::Restore(theMap);
 
@@ -92,9 +127,13 @@ VISU::Storable* VISU::Plot3D_i::Restore (const Storable::TRestoringMap& theMap)
   return this;
 }
 
-void VISU::Plot3D_i::ToStream (std::ostringstream& theStr)
+
+//---------------------------------------------------------------
+void
+VISU::Plot3D_i
+::ToStream(std::ostringstream& theStr)
 {
-  ScalarMap_i::ToStream(theStr);
+  TSuperClass::ToStream(theStr);
 
   Storable::DataToStream(theStr, "myBasePlane", int(GetOrientationType()));
   Storable::DataToStream(theStr, "aRot[0]", GetRotateX());
@@ -106,91 +145,164 @@ void VISU::Plot3D_i::ToStream (std::ostringstream& theStr)
   Storable::DataToStream(theStr, "myNbOfContours", int(GetNbOfContours()));
 }
 
-VISU::Plot3D_i::~Plot3D_i(){
+
+//---------------------------------------------------------------
+VISU::Plot3D_i
+::~Plot3D_i()
+{
   if(MYDEBUG) MESSAGE("Plot3D_i::~Plot3D_i()");
 }
 
-void VISU::Plot3D_i::SetOrientation (VISU::Plot3D::Orientation theOrient,
-                                    CORBA::Double theXAngle, CORBA::Double theYAngle)
+
+//---------------------------------------------------------------
+void
+VISU::Plot3D_i
+::SetOrientation(VISU::Plot3D::Orientation theOrient,
+                CORBA::Double theXAngle, 
+                CORBA::Double theYAngle)
 {
   myPlot3DPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(theOrient),
-                            theXAngle,theYAngle);
+                            theXAngle,
+                            theYAngle);
 }
 
-VISU::Plot3D::Orientation VISU::Plot3D_i::GetOrientationType()
+
+//---------------------------------------------------------------
+VISU::Plot3D::Orientation
+VISU::Plot3D_i
+::GetOrientationType()
 {
   return VISU::Plot3D::Orientation(myPlot3DPL->GetPlaneOrientation());
 }
 
-CORBA::Double VISU::Plot3D_i::GetRotateX()
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::Plot3D_i
+::GetRotateX()
 {
   return myPlot3DPL->GetRotateX();
 }
 
-CORBA::Double VISU::Plot3D_i::GetRotateY()
+
+//---------------------------------------------------------------
+CORBA::Double 
+VISU::Plot3D_i
+::GetRotateY()
 {
   return myPlot3DPL->GetRotateY();
 }
 
-void VISU::Plot3D_i::SetPlanePosition (CORBA::Double  thePlanePosition,
-                                      CORBA::Boolean theIsRelative)
+
+//---------------------------------------------------------------
+void
+VISU::Plot3D_i
+::SetPlanePosition(CORBA::Double  thePlanePosition,
+                  CORBA::Boolean theIsRelative)
 {
   myPlot3DPL->SetPlanePosition(thePlanePosition, theIsRelative);
 }
 
-CORBA::Double VISU::Plot3D_i::GetPlanePosition()
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::Plot3D_i
+::GetPlanePosition()
 {
   return myPlot3DPL->GetPlanePosition();
 }
 
-CORBA::Boolean VISU::Plot3D_i::IsPositionRelative()
+
+//---------------------------------------------------------------
+CORBA::Boolean
+VISU::Plot3D_i
+::IsPositionRelative()
 {
   return myPlot3DPL->IsPositionRelative();
 }
 
-void VISU::Plot3D_i::SetScaleFactor (CORBA::Double theScaleFactor)
+
+//---------------------------------------------------------------
+void
+VISU::Plot3D_i
+::SetScaleFactor(CORBA::Double theScaleFactor)
 {
   myPlot3DPL->SetScaleFactor(theScaleFactor);
 }
 
-CORBA::Double VISU::Plot3D_i::GetScaleFactor()
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::Plot3D_i
+::GetScaleFactor()
 {
   return myPlot3DPL->GetScaleFactor();
 }
 
-void VISU::Plot3D_i::SetNbOfContours (CORBA::Long theNb)
+
+//---------------------------------------------------------------
+void
+VISU::Plot3D_i
+::SetNbOfContours(CORBA::Long theNb)
 {
   myPlot3DPL->SetNumberOfContours(theNb);
 }
 
-CORBA::Long VISU::Plot3D_i::GetNbOfContours()
+
+//---------------------------------------------------------------
+CORBA::Long
+VISU::Plot3D_i
+::GetNbOfContours()
 {
   return myPlot3DPL->GetNumberOfContours();
 }
 
-void VISU::Plot3D_i::SetContourPrs (CORBA::Boolean theIsContourPrs )
+
+//---------------------------------------------------------------
+void
+VISU::Plot3D_i
+::SetContourPrs(CORBA::Boolean theIsContourPrs)
 {
   myPlot3DPL->SetContourPrs( theIsContourPrs );
 }
 
-CORBA::Boolean VISU::Plot3D_i::GetIsContourPrs()
+
+//---------------------------------------------------------------
+CORBA::Boolean
+VISU::Plot3D_i
+::GetIsContourPrs()
 {
   return myPlot3DPL->GetIsContourPrs();
 }
 
-void VISU::Plot3D_i::DoHook()
+
+//---------------------------------------------------------------
+void
+VISU::Plot3D_i
+::CreatePipeLine()
 {
-  if (!myPipeLine) myPipeLine = VISU_Plot3DPL::New();
+  if (!myPipeLine) 
+    myPipeLine = VISU_Plot3DPL::New();
   myPlot3DPL = dynamic_cast<VISU_Plot3DPL*>(myPipeLine);
 
-  ScalarMap_i::DoHook();
+  TSuperClass::CreatePipeLine();
 }
 
+
+//---------------------------------------------------------------
+bool
+VISU::Plot3D_i
+::CheckIsPossible() 
+{
+  return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+}
+
+//---------------------------------------------------------------
 VISU_Actor* 
 VISU::Plot3D_i
 ::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
 {
-  if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
+  if(VISU_Actor* anActor = TSuperClass::CreateActor(theIO)){
     anActor->SetVTKMapping(true);
     SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
     int aDispMode = aResourceMgr->integerValue("VISU", "plot3d_represent", 2);
@@ -200,7 +312,11 @@ VISU::Plot3D_i
   return NULL;
 }
 
-void VISU::Plot3D_i::SetMapScale(double theMapScale)
+
+//---------------------------------------------------------------
+void
+VISU::Plot3D_i
+::SetMapScale(double theMapScale)
 {
   myPlot3DPL->SetMapScale(theMapScale);
 }
index d509b545689fee1a0718035b7534001e206b6ab9..8a1ce19e8b142dac9bb0578d3cbf54f2078d7a8a 100644 (file)
@@ -25,7 +25,8 @@
 
 class VISU_Plot3DPL;
 
-namespace VISU {
+namespace VISU 
+{
   class Plot3D_i : public virtual POA_VISU::Plot3D,
                    public virtual ScalarMap_i
   {
@@ -37,64 +38,138 @@ namespace VISU {
     typedef ScalarMap_i TSuperClass;
 
     explicit
-    Plot3D_i (Result_i* theResult, bool theAddToStudy = true);
+    Plot3D_i(Result_i* theResult, 
+            bool theAddToStudy);
     explicit
-    Plot3D_i (Result_i* theResult, SALOMEDS::SObject_ptr theSObject);
+    Plot3D_i(Result_i* theResult, 
+            SALOMEDS::SObject_ptr theSObject);
 
-    virtual ~Plot3D_i();
+    virtual 
+    ~Plot3D_i();
+
+    virtual 
+    VISU::VISUType 
+    GetType() 
+    { 
+      return VISU::TPLOT3D; 
+    }
+
+    virtual
+    void
+    SetOrientation (VISU::Plot3D::Orientation theOrient,
+                   CORBA::Double theXAngle, 
+                   CORBA::Double theYAngle);
+
+    virtual 
+    VISU::Plot3D::Orientation 
+    GetOrientationType();
+
+    virtual 
+    CORBA::Double 
+    GetRotateX();
 
-    virtual VISU::VISUType GetType() { return VISU::TPLOT3D; };
+    virtual
+    CORBA::Double 
+    GetRotateY();
 
-    virtual void SetOrientation (VISU::Plot3D::Orientation theOrient,
-                                CORBA::Double theXAngle, CORBA::Double theYAngle);
+    virtual
+    void
+    SetPlanePosition(CORBA::Double  thePlanePosition,
+                    CORBA::Boolean theIsRelative);
 
-    virtual VISU::Plot3D::Orientation GetOrientationType();
+    virtual
+    CORBA::Double 
+    GetPlanePosition();
 
-    virtual CORBA::Double GetRotateX();
-    virtual CORBA::Double GetRotateY();
+    virtual
+    CORBA::Boolean
+    IsPositionRelative();
 
-    virtual void SetPlanePosition (CORBA::Double  thePlanePosition,
-                                  CORBA::Boolean theIsRelative);
-    virtual CORBA::Double GetPlanePosition();
-    virtual CORBA::Boolean IsPositionRelative();
+    virtual
+    void
+    SetScaleFactor(CORBA::Double theScaleFactor);
 
-    virtual void SetScaleFactor (CORBA::Double theScaleFactor);
-    virtual CORBA::Double GetScaleFactor();
+    virtual
+    CORBA::Double
+    GetScaleFactor();
 
-    virtual void SetContourPrs (CORBA::Boolean theIsContourPrs );
-    CORBA::Boolean GetIsContourPrs();
+    virtual
+    void
+    SetContourPrs(CORBA::Boolean theIsContourPrs);
 
-    virtual void SetNbOfContours (CORBA::Long theNb);
-    virtual CORBA::Long GetNbOfContours();
+    CORBA::Boolean 
+    GetIsContourPrs();
 
-    typedef VISU::Plot3D TInterface;
-    VISU_Plot3DPL* GetPlot3DPL() { return myPlot3DPL; }
+    virtual
+    void
+    SetNbOfContours(CORBA::Long theNb);
 
-    void SetMapScale(double theMapScale);
+    virtual
+    CORBA::Long
+    GetNbOfContours();
 
+    typedef VISU::Plot3D TInterface;
+
+    VISU_Plot3DPL* 
+    GetSpecificPL() const
+    { 
+      return myPlot3DPL; 
+    }
+    
   protected:
-    virtual void DoHook();
+    //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
+    virtual 
+    void 
+    CreatePipeLine();
+
+    //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
+    virtual 
+    bool 
+    CheckIsPossible();
 
     VISU_Plot3DPL *myPlot3DPL;
 
   public:
-    static int IsPossible (Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
-                          const char* theFieldName, int theIteration, int isMemoryCheck = true);
+    static
+    int
+    IsPossible(Result_i* theResult, 
+              const char* theMeshName, 
+              VISU::Entity theEntity,
+              const char* theFieldName, 
+              int theTimeStampNumber, 
+              int isMemoryCheck = true);
 
-    virtual Storable* Create (const char* theMeshName, VISU::Entity theEntity,
-                             const char* theFieldName, int theIteration);
+    virtual 
+    Storable* 
+    Create(const char* theMeshName, 
+          VISU::Entity theEntity,
+          const char* theFieldName, 
+          int theTimeStampNumber);
 
-    virtual void ToStream (std::ostringstream& theStr);
+    virtual
+    void
+    ToStream (std::ostringstream& theStr);
 
-    virtual Storable* Restore (const Storable::TRestoringMap& theMap);
+    virtual
+    Storable* 
+    Restore(const Storable::TRestoringMap& theMap);
 
     virtual 
     VISU_Actor* 
     CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
 
     static const std::string myComment;
-    virtual const char* GetComment() const;
-    virtual QString GenerateName();
+
+    virtual
+    const char* 
+    GetComment() const;
+
+    virtual
+    QString
+    GenerateName();
+    
+    void
+    SetMapScale(double theMapScale);
   };
 }
 
index 70d0e429985a68baf146ddc17c79fc7a5a38ab0e..a74b9531927a8483a055c0761c96109ecbd8110d 100644 (file)
@@ -52,23 +52,26 @@ static int MYDEBUG = 0;
 VISU::Prs3d_i
 ::Prs3d_i(Result_i* theResult,
          SALOMEDS::SObject_ptr theSObject) :
-  PrsObject_i(theResult->GetStudyDocument()),
+  PrsObject_i(theSObject->GetStudy()),
   mySObject(SALOMEDS::SObject::_duplicate(theSObject)),
   myActorCollection(vtkActorCollection::New()),
-  myResult(theResult),
   myAddToStudy(true),
+  myResult(theResult),
   myPipeLine(NULL)
 {
   if(MYDEBUG) MESSAGE("Prs3d_i::Prs3d_i - this = "<<this);
   myOffset[0] = myOffset[1] = myOffset[2] = 0;
   myActorCollection->Delete();
-  myResult->Register();
+  if(theResult){
+    SetStudyDocument(theResult->GetStudyDocument());
+    theResult->Register();
+  }
 }
 
 VISU::Prs3d_i
 ::Prs3d_i(Result_i* theResult,
          bool theAddToStudy) :
-  PrsObject_i(theResult->GetStudyDocument()),
+  PrsObject_i(SALOMEDS::Study::_nil()),
   myActorCollection(vtkActorCollection::New()),
   mySObject(SALOMEDS::SObject::_nil()),
   myAddToStudy(theAddToStudy),
@@ -78,16 +81,19 @@ VISU::Prs3d_i
   if(MYDEBUG) MESSAGE("Prs3d_i::Prs3d_i - this = "<<this);
   myOffset[0] = myOffset[1] = myOffset[2] = 0;
   myActorCollection->Delete();
-  myResult->Register();
+  if(theResult){
+    SetStudyDocument(theResult->GetStudyDocument());
+    theResult->Register();
+  }
 }
 
 void
 VISU::Prs3d_i
 ::SameAs(const Prs3d_i* theOrigin)
 {
-  if (Prs3d_i* aOrigin = const_cast<Prs3d_i*>(theOrigin)) {
-    myPipeLine->SameAs(aOrigin->GetPL());
-    aOrigin->GetOffset(myOffset);
+  if(Prs3d_i* anOrigin = const_cast<Prs3d_i*>(theOrigin)){
+    myPipeLine->SameAs(anOrigin->GetPL());
+    anOrigin->GetOffset(myOffset);
   }
 }
 
@@ -97,7 +103,63 @@ VISU::Prs3d_i
   if(MYDEBUG) MESSAGE("Prs3d_i::~Prs3d_i - this = "<<this);
   myRemoveActorsFromRendererSignal();
   myPipeLine->Delete();
-  myResult->Destroy();
+  if(myResult)
+    myResult->Destroy();
+}
+
+
+//----------------------------------------------------------------------------
+bool 
+VISU::Prs3d_i
+::SetInput()
+{
+  return true;
+}
+
+CORBA::Boolean 
+VISU::Prs3d_i
+::Apply()
+{
+  if(SetInput()){
+    UpdateActors();
+    return true;
+  }
+  return false;
+}
+
+void
+VISU::Prs3d_i
+::SetResultObject(VISU::Result_ptr theResult)
+{
+  Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in());
+  if(myResult != aResult){
+    if(myResult)
+      myResult->Destroy();
+    if(aResult)
+      aResult->Register();
+    myResult = aResult;
+  }
+}
+
+VISU::Result_ptr
+VISU::Prs3d_i
+::GetResultObject()
+{
+  return myResult->_this();
+}
+
+void 
+VISU::Prs3d_i
+::SetMeshName(const char* theMeshName)
+{
+  myMeshName = theMeshName;
+}
+
+char*
+VISU::Prs3d_i
+::GetMeshName()
+{
+  return CORBA::string_dup(myMeshName.c_str());
 }
 
 
@@ -144,14 +206,6 @@ VISU::Prs3d_i
   return myResult;
 }
 
-const std::string& 
-VISU::Prs3d_i
-::GetMeshName() const 
-{ 
-  return myMeshName; 
-}
-
-
 //----------------------------------------------------------------------------
 void
 VISU::Prs3d_i
@@ -159,7 +213,8 @@ VISU::Prs3d_i
 {
   if(MYDEBUG) MESSAGE("Prs3d_i::Update - this = "<<this);
   try{
-    myPipeLine->Update();
+    if(myPipeLine)
+      myPipeLine->Update();
   }catch(...){
     throw std::runtime_error("Prs3d_i::Update >> unexpected exception was caught!!!");
   }
@@ -183,31 +238,32 @@ VISU::Prs3d_i
     throw std::runtime_error("Diagonal of the actor is too large !!!");
 }
 
+
+struct TRemoveFromStudy: public SALOME_Event
+{
+  VISU::Prs3d_i* myRemovable;
+  typedef boost::signal0<void> TRemoveFromStudySignal;
+  const TRemoveFromStudySignal& myRemoveFromStudySignal;
+  
+  TRemoveFromStudy(VISU::Prs3d_i* theRemovable,
+                  const TRemoveFromStudySignal& theRemoveFromStudySignal):
+    myRemovable(theRemovable),
+    myRemoveFromStudySignal(theRemoveFromStudySignal)
+  {}
+  
+  virtual
+  void
+  Execute()
+  {
+    myRemoveFromStudySignal();
+    myRemovable->Destroy();
+  }
+};
+
 void
 VISU::Prs3d_i
 ::RemoveFromStudy() 
 {
-  struct TRemoveFromStudy: public SALOME_Event
-  {
-    VISU::Prs3d_i* myRemovable;
-    typedef boost::signal0<void> TRemoveFromStudySignal;
-    const TRemoveFromStudySignal& myRemoveFromStudySignal;
-
-    TRemoveFromStudy(VISU::Prs3d_i* theRemovable,
-                    const TRemoveFromStudySignal& theRemoveFromStudySignal):
-      myRemovable(theRemovable),
-      myRemoveFromStudySignal(theRemoveFromStudySignal)
-    {}
-    
-    virtual
-    void
-    Execute()
-    {
-      myRemoveFromStudySignal();
-      myRemovable->Destroy();
-    }
-  };
-
   ProcessVoidEvent(new TRemoveFromStudy(this,myRemoveActorsFromRendererSignal));
 }
 
index d7bf76280339d94ac7700b9505b319cd272762a0..a5e2405382b713616850c38c5f1145b27d4db556 100644 (file)
@@ -91,6 +91,27 @@ namespace VISU
     virtual
     ~Prs3d_i();
 
+    //----------------------------------------------------------------------------
+    virtual
+    CORBA::Boolean 
+    Apply();
+
+    virtual
+    void 
+    SetResultObject(VISU::Result_ptr theResult);
+
+    virtual
+    VISU::Result_ptr
+    GetResultObject();
+
+    virtual
+    void 
+    SetMeshName(const char* theMeshName);
+
+    virtual
+    char*
+    GetMeshName();
+
     //----------------------------------------------------------------------------
     //! To generate an unique type name for the class (used into persistent functionality)
     virtual
@@ -122,9 +143,6 @@ namespace VISU
     SALOMEDS::SObject_var 
     GetSObject();
 
-    const std::string& 
-    GetMeshName() const;
-
     //----------------------------------------------------------------------------
     //! To update is internal state
     virtual 
@@ -214,6 +232,10 @@ namespace VISU
 
     //----------------------------------------------------------------------------
   protected:
+    virtual 
+    bool 
+    SetInput();
+
     void
     CreateActor(VISU_Actor* theActor, 
                const Handle(SALOME_InteractiveObject)& theIO = NULL);
@@ -227,17 +249,18 @@ namespace VISU
     void
     CheckDataSet();
 
+  protected:
+    Result_i *myResult;
+    std::string myMeshName;
+
     bool myAddToStudy;
     CORBA::Float myOffset[3];
-    Result_i *myResult;
     VISU_PipeLine *myPipeLine;
     SALOMEDS::SObject_var mySObject;
-    std::string myMeshName;
 
     boost::signal0<void> myUpdateActorsSignal;
     boost::signal0<void> myRemoveActorsFromRendererSignal;
     vtkSmartPointer<vtkActorCollection> myActorCollection;
-
   };
 
   //----------------------------------------------------------------------------
index 3a1126cae4290edd810de19d801e5ee27ab19ae5..e47dc9eeff2cef11c861296edfb7ea673b96c71d 100644 (file)
 //  Module : VISU
 
 #include "VISU_PrsObject_i.hh"
-using namespace VISU;
-using namespace std;
 
 #ifdef _DEBUG_
-static int MYDEBUG = 1;
-static int MYDEBUGWITHFILES = 0;
+static int MYDEBUG = 0;
 #else
 static int MYDEBUG = 0;
-static int MYDEBUGWITHFILES = 0;
 #endif
 
-void VISU::PrsObject_i::SetName( const char* theName )
+//---------------------------------------------------------------
+VISU::PrsObject_i
+::PrsObject_i(SALOMEDS::Study_ptr theStudy): 
+  myStudy(SALOMEDS::Study::_duplicate(theStudy)) 
+{
+  if(MYDEBUG) MESSAGE("PrsObject_i::PrsObject_i - this = "<<this);
+}
+
+
+//---------------------------------------------------------------
+VISU::PrsObject_i
+::~PrsObject_i() 
+{
+  if(MYDEBUG) MESSAGE("PrsObject_i::~PrsObject_i - this = "<<this);
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::PrsObject_i
+::SetName(const char* theName)
 {
   myName = theName;
-  SALOMEDS::SObject_var mySO = myStudy->FindObjectID( GetEntry() );
-  if(!mySO->_is_nil()){
+  SALOMEDS::SObject_var aSObject = myStudy->FindObjectID( GetEntry() );
+  if(!aSObject->_is_nil()){
     SALOMEDS::StudyBuilder_var aBuilder = myStudy->NewBuilder();
-    SALOMEDS::GenericAttribute_var anAttr = aBuilder->FindOrCreateAttribute( mySO, "AttributeName" );
+    SALOMEDS::GenericAttribute_var anAttr = aBuilder->FindOrCreateAttribute( aSObject, "AttributeName" );
     SALOMEDS::AttributeName_var aNameAttr = SALOMEDS::AttributeName::_narrow( anAttr );
     aNameAttr->SetValue( theName );
   }
 }
-QString VISU::PrsObject_i::GetEntry() { 
+
+
+//---------------------------------------------------------------
+const char* 
+VISU::PrsObject_i
+::GetName() const 
+{ 
+  return myName.c_str();
+}
+
+
+//---------------------------------------------------------------
+const SALOMEDS::Study_var& 
+VISU::PrsObject_i
+::GetStudyDocument() const 
+{ 
+  return myStudy;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::PrsObject_i
+::SetStudyDocument(SALOMEDS::Study_ptr theStudy) 
+{ 
+  myStudy = SALOMEDS::Study::_duplicate(theStudy);
+}
+
+
+//---------------------------------------------------------------
+QString 
+VISU::PrsObject_i
+::GetEntry() 
+{ 
   CORBA::String_var anIOR = GetID();
   SALOMEDS::SObject_var aSObject = myStudy->FindObjectIOR(anIOR.in());
   CORBA::String_var anEntry;
index 31e7f71496168fc1d0a7cd949214cd512258eb48..cae0511790ff5e02fbe232fd14bedfcb961a2d17 100644 (file)
 
 #include "VISUConfig.hh"
 
-namespace VISU{
+namespace VISU
+{
   class PrsObject_i : public virtual POA_VISU::PrsObject,
                       public virtual RemovableObject_i
   {
     PrsObject_i(const PrsObject_i&);
+    SALOMEDS::Study_var myStudy;
 
   public:
-    PrsObject_i(SALOMEDS::Study_ptr theStudy) : myStudy(SALOMEDS::Study::_duplicate(theStudy)) {};
-    virtual ~PrsObject_i() {}
+    PrsObject_i(SALOMEDS::Study_ptr theStudy = SALOMEDS::Study::_nil());
+
+    virtual 
+    ~PrsObject_i();
 
   protected:
+    void
+    SetStudyDocument(SALOMEDS::Study_ptr theStudy);
+
     std::string myName;
-    SALOMEDS::Study_var myStudy;
 
   public:
-    virtual const char* GetName() const { return myName.c_str();}
-    virtual void SetName( const char* theName );
-    const SALOMEDS::Study_var& GetStudyDocument() const { return myStudy;}
+    virtual 
+    const char* 
+    GetName() const;
+
+    virtual 
+    void
+    SetName(const char* theName);
+
+    const SALOMEDS::Study_var& 
+    GetStudyDocument() const;
+
     QString GetEntry();
   };
 }
index d2c7a7d366ce123d32a4d7eab4a43b62bdfd6154..27a738660120166a056b2f5031b745b11cc92143 100644 (file)
@@ -48,18 +48,37 @@ static int MYDEBUG = 0;
 
 static int INCMEMORY = 4+12;
 
-int VISU::ScalarMapOnDeformedShape_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity, 
-                                                const char* theFieldName, int theIteration, int isMemoryCheck)
+
+//---------------------------------------------------------------
+int
+VISU::ScalarMapOnDeformedShape_i
+::IsPossible(Result_i* theResult, 
+            const char* theMeshName, 
+            VISU::Entity theEntity, 
+            const char* theFieldName, 
+            int theTimeStampNumber, 
+            int isMemoryCheck)
 {
   bool aResult = false;
   try{
-    aResult = VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,false);
+    aResult = VISU::ScalarMap_i::IsPossible(theResult,
+                                          theMeshName,
+                                          theEntity,
+                                          theFieldName,
+                                          theTimeStampNumber,
+                                          false);
     if(isMemoryCheck && aResult){
-      const VISU::PField aField = theResult->GetInput()->GetField(theMeshName,(VISU::TEntity)theEntity,theFieldName);
+      VISU::Result_i::TInput* anInput = theResult->GetInput();
+      const VISU::PField aField = anInput->GetField(theMeshName,
+                                                   (VISU::TEntity)theEntity,
+                                                   theFieldName);
       if(aField->myNbComp <= 1)
        return false;
-      float aSize = INCMEMORY*
-       theResult->GetInput()->GetTimeStampSize(theMeshName,(VISU::TEntity)theEntity,theFieldName,theIteration);
+      float aSize = anInput->GetTimeStampSize(theMeshName,
+                                             (VISU::TEntity)theEntity,
+                                             theFieldName,
+                                             theTimeStampNumber);
+      aSize *= INCMEMORY;
       aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
       MESSAGE("ScalarMapOnDeformedShape_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
     }
@@ -71,45 +90,65 @@ int VISU::ScalarMapOnDeformedShape_i::IsPossible(Result_i* theResult, const char
   return aResult;
 }
 
+//---------------------------------------------------------------
 int VISU::ScalarMapOnDeformedShape_i::myNbPresent = 0;
-QString VISU::ScalarMapOnDeformedShape_i::GenerateName() { return VISU::GenerateName("ScalarDef.Shape",myNbPresent++);}
 
+//---------------------------------------------------------------
+QString
+VISU::ScalarMapOnDeformedShape_i
+::GenerateName() 
+{
+  return VISU::GenerateName("ScalarDef.Shape",myNbPresent++);
+}
+
+//---------------------------------------------------------------
 const string VISU::ScalarMapOnDeformedShape_i::myComment = "SCALARMAPONDEFORMEDSHAPE";
-const char* VISU::ScalarMapOnDeformedShape_i::GetComment() const { return myComment.c_str();}
 
-VISU::ScalarMapOnDeformedShape_i::
-ScalarMapOnDeformedShape_i(Result_i* theResult, 
-         bool theAddToStudy) :
-  PrsObject_i(theResult->GetStudyDocument()), 
+//---------------------------------------------------------------
+const char* 
+VISU::ScalarMapOnDeformedShape_i
+::GetComment() const
+{ 
+  return myComment.c_str();
+}
+
+//---------------------------------------------------------------
+VISU::ScalarMapOnDeformedShape_i
+::ScalarMapOnDeformedShape_i(Result_i* theResult, 
+                            bool theAddToStudy) :
+  PrsObject_i(SALOMEDS::Study::_nil()), 
   Prs3d_i(theResult,theAddToStudy),
   ColoredPrs3d_i(theResult,theAddToStudy),
   ScalarMap_i(theResult,theAddToStudy),
   myScalarMapOnDeformedShapePL(NULL),
   myScalarIteration(1)
-{
-}
+{}
 
-VISU::ScalarMapOnDeformedShape_i::
-ScalarMapOnDeformedShape_i(Result_i* theResult, 
-         SALOMEDS::SObject_ptr theSObject) :
-  PrsObject_i(theResult->GetStudyDocument()), 
+//---------------------------------------------------------------
+VISU::ScalarMapOnDeformedShape_i
+::ScalarMapOnDeformedShape_i(Result_i* theResult, 
+                            SALOMEDS::SObject_ptr theSObject):
+  PrsObject_i(theSObject->GetStudy()), 
   Prs3d_i(theResult,theSObject),
   ColoredPrs3d_i(theResult,theSObject),
   ScalarMap_i(theResult,theSObject),
   myScalarMapOnDeformedShapePL(NULL),
   myScalarIteration(1)
-{
-}
+{}
 
-VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Create(const char* theMeshName, VISU::Entity theEntity, 
-                                                        const char* theFieldName, int theIteration)
+//---------------------------------------------------------------
+VISU::Storable* 
+VISU::ScalarMapOnDeformedShape_i
+::Create(const char* theMeshName, 
+        VISU::Entity theEntity,
+        const char* theFieldName, 
+        int theTimeStampNumber)
 {
-  if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::Create:"<<__LINE__<<endl;
   myIsColored = true;
   myColor.R = myColor.G = myColor.B = 0.5;
-  VISU::Storable* aRes = TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
+  VISU::Storable* aRes = TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
   SetScalarFieldName(theFieldName);
-  SetScalarIteration(theIteration);
+  SetScalarIteration(theTimeStampNumber);
   SetScalarMeshName(theMeshName);
   int anEntity = theEntity;
   SetScalarEntity(VISU::TEntity(anEntity));
@@ -117,9 +156,12 @@ VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Create(const char* theMeshName
   return aRes;
 }
 
-VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Restore(const Storable::TRestoringMap& theMap)
+
+//---------------------------------------------------------------
+VISU::Storable* 
+VISU::ScalarMapOnDeformedShape_i
+::Restore(const Storable::TRestoringMap& theMap)
 {
-  if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::Restore:"<<__LINE__<<endl;
   TSuperClass::Restore(theMap);
   
   SetScalarFieldName(VISU::Storable::FindValue(theMap,"myScalarFieldName"));
@@ -140,9 +182,12 @@ VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Restore(const Storable::TResto
   return this;
 }
 
-void VISU::ScalarMapOnDeformedShape_i::ToStream(std::ostringstream& theStr)
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::ToStream(std::ostringstream& theStr)
 {
-  if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::ToStream:"<<__LINE__<<endl;
   TSuperClass::ToStream(theStr);
   
   Storable::DataToStream( theStr, "myScalarFieldName", myScalarFieldName.c_str());
@@ -155,29 +200,31 @@ void VISU::ScalarMapOnDeformedShape_i::ToStream(std::ostringstream& theStr)
   Storable::DataToStream( theStr, "myColor.R", myColor.R );
   Storable::DataToStream( theStr, "myColor.G", myColor.G );
   Storable::DataToStream( theStr, "myColor.B", myColor.B );
-
 }
 
-VISU::ScalarMapOnDeformedShape_i::~ScalarMapOnDeformedShape_i(){
+
+//---------------------------------------------------------------
+VISU::ScalarMapOnDeformedShape_i
+::~ScalarMapOnDeformedShape_i()
+{
   if(MYDEBUG) MESSAGE("ScalarMapOnDeformedShape_i::~ScalarMapOnDeformedShape_i()");
 }
 
+
+//---------------------------------------------------------------
 void
 VISU::ScalarMapOnDeformedShape_i
 ::SameAs(const Prs3d_i* theOrigin)
 {
-  if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::SameAs:"<<__LINE__<<endl;
   int theScalarIter = this->GetScalarIteration();
   string theScalarMeshName = this->GetScalarMeshName();
   string theScalarFieldName = this->GetScalarFieldName();
-  if(MYDEBUG) cout << "SameAs:"<<endl
-                  << "\t"<<theScalarIter<<":"<<theScalarMeshName.c_str()<<":"<<theScalarFieldName.c_str()<<endl;
 
   TSuperClass::SameAs(theOrigin);
-
+  
   if(const ScalarMapOnDeformedShape_i* aPrs3d = dynamic_cast<const ScalarMapOnDeformedShape_i*>(theOrigin)){
     ScalarMapOnDeformedShape_i* anOrigin = const_cast<ScalarMapOnDeformedShape_i*>(aPrs3d);
-
+    
     this->SetScalarField(anOrigin->GetScalarMeshName().c_str(),
                         anOrigin->GetScalarFieldName().c_str(),
                         theScalarIter,
@@ -186,34 +233,63 @@ VISU::ScalarMapOnDeformedShape_i
   }
 }
 
-void VISU::ScalarMapOnDeformedShape_i::SetScale(CORBA::Double theScale) { 
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SetScale(CORBA::Double theScale) 
+{ 
   myScalarMapOnDeformedShapePL->SetScale(theScale);
 }
 
-CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetScale(){
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::ScalarMapOnDeformedShape_i
+::GetScale()
+{
   return myScalarMapOnDeformedShapePL->GetScale();
 }
 
-void VISU::ScalarMapOnDeformedShape_i::SetSourceRange(CORBA::Double theMinRange,CORBA::Double theMaxRange){
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SetSourceRange(CORBA::Double theMinRange,CORBA::Double theMaxRange)
+{
   vtkFloatingPointType aRange[2];
   aRange[0] = vtkFloatingPointType(theMinRange);
   aRange[1] = vtkFloatingPointType(theMaxRange);
   myScalarMapOnDeformedShapePL->SetScalarRange(aRange);
 }
 
-CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetSourceRangeMin(){
+
+//---------------------------------------------------------------
+CORBA::Double 
+VISU::ScalarMapOnDeformedShape_i
+::GetSourceRangeMin()
+{
   vtkFloatingPointType aRange[2];
   myScalarMapOnDeformedShapePL->GetSourceRange(aRange);
   return aRange[0];
 }
 
-CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetSourceRangeMax(){
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::ScalarMapOnDeformedShape_i
+::GetSourceRangeMax()
+{
   vtkFloatingPointType aRange[2];
   myScalarMapOnDeformedShapePL->GetSourceRange(aRange);
   return aRange[1];
 }
 
-void VISU::ScalarMapOnDeformedShape_i::DoHook()
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::CreatePipeLine()
 {
   if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::DoHook:"<<__LINE__<<endl;
   if(!myPipeLine)
@@ -222,12 +298,24 @@ void VISU::ScalarMapOnDeformedShape_i::DoHook()
   myScalarMapOnDeformedShapePL = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(myPipeLine);
   myPipeLine->GetMapper()->SetScalarVisibility(IsColored());
 
-  TSuperClass::DoHook();
+  TSuperClass::CreatePipeLine();
+}
+
+
+//---------------------------------------------------------------
+bool
+VISU::ScalarMapOnDeformedShape_i
+::CheckIsPossible() 
+{
+  return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
 }
 
-VISU_Actor* VISU::ScalarMapOnDeformedShape_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) 
+
+//---------------------------------------------------------------
+VISU_Actor* 
+VISU::ScalarMapOnDeformedShape_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) 
 {
-  if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::CreateActor:"<<__LINE__<<endl;
   VISU_Actor* anActor = TSuperClass::CreateActor(theIO, true);
   SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
   int  aDispMode = aResourceMgr->integerValue("VISU", "scalar_def_represent", 2);
@@ -240,8 +328,11 @@ VISU_Actor* VISU::ScalarMapOnDeformedShape_i::CreateActor(const Handle(SALOME_In
 }
 
 
-void VISU::ScalarMapOnDeformedShape_i::UpdateActor(VISU_Actor* theActor) {
-  if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::UpdateActor:"<<__LINE__<<endl;
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::UpdateActor(VISU_Actor* theActor) 
+{
   if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
     if(IsColored()){
       anActor->SetBarVisibility(true);
@@ -255,14 +346,15 @@ void VISU::ScalarMapOnDeformedShape_i::UpdateActor(VISU_Actor* theActor) {
   }
 }
 
-void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName,
-                                                     const char* theFieldName,
-                                                     int   theIteration,
-                                                     VISU::TEntity  theEntity)
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SetScalarField(const char* theMeshName,
+                const char* theFieldName,
+                int   theIteration,
+                VISU::TEntity  theEntity)
 {
-  if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::SetScalarField:"<<__LINE__<<endl;
-  if(MYDEBUG) cout << "\ttheFieldName="<<theFieldName<<endl;
-  if(MYDEBUG) cout << "\ttheIteration="<<theIteration<<endl;
   myScalarField = myResult->GetInput()->GetField(theMeshName,theEntity,theFieldName);
   TVTKOutput* aOut = myResult->GetInput()->GetTimeStampOnMesh(theMeshName,
                                                              theEntity,
@@ -277,53 +369,100 @@ void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName,
   this->SetScalarEntity(theEntity);
 }
 
-void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName,
-                                                     const char* theFieldName,
-                                                     CORBA::Long  theIteration,
-                                                     VISU::Entity  theEntity)
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SetScalarField(const char* theMeshName,
+                const char* theFieldName,
+                CORBA::Long  theIteration,
+                VISU::Entity  theEntity)
 {
   this->SetScalarField(theMeshName,theFieldName,(int)theIteration,VISU::TEntity(theEntity));
 }
 
-void VISU::ScalarMapOnDeformedShape_i::SetScalarMeshName(const char* theName){
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SetScalarMeshName(const char* theName)
+{
   myScalarMeshName = theName;
 }
-std::string VISU::ScalarMapOnDeformedShape_i::GetScalarMeshName(){
+
+//---------------------------------------------------------------
+std::string 
+VISU::ScalarMapOnDeformedShape_i
+::GetScalarMeshName()
+{
   return myScalarMeshName;
 }
 
-void VISU::ScalarMapOnDeformedShape_i::SetScalarFieldName(const char* theName){
+//---------------------------------------------------------------
+void 
+VISU::ScalarMapOnDeformedShape_i
+::SetScalarFieldName(const char* theName)
+{
   myScalarFieldName = theName;
 }
-std::string VISU::ScalarMapOnDeformedShape_i::GetScalarFieldName(){
+//---------------------------------------------------------------
+std::string
+VISU::ScalarMapOnDeformedShape_i
+::GetScalarFieldName()
+{
   return myScalarFieldName;
 }
 
-void VISU::ScalarMapOnDeformedShape_i::SetScalarIteration(const int theValue){
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SetScalarIteration(const int theValue)
+{
   myScalarIteration = theValue;
 }
 
 
-int VISU::ScalarMapOnDeformedShape_i::GetScalarIteration(){
+//---------------------------------------------------------------
+int
+VISU::ScalarMapOnDeformedShape_i
+::GetScalarIteration()
+{
   return myScalarIteration;
 }
 
-void VISU::ScalarMapOnDeformedShape_i::SetScalarEntity(const VISU::TEntity theValue){
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SetScalarEntity(const VISU::TEntity theValue)
+{
   myScalarEntity = theValue;
 }
 
-VISU::TEntity VISU::ScalarMapOnDeformedShape_i::GetScalarEntity(){
+//---------------------------------------------------------------
+VISU::TEntity
+VISU::ScalarMapOnDeformedShape_i
+::GetScalarEntity()
+{
   return myScalarEntity;
 }
 
-void VISU::ScalarMapOnDeformedShape_i::SetScalarEEntity(const VISU::Entity theValue){
+//---------------------------------------------------------------
+void 
+VISU::ScalarMapOnDeformedShape_i
+::SetScalarEEntity(const VISU::Entity theValue)
+{
   myScalarEntity = VISU::TEntity(theValue);
 }
 
-VISU::Entity VISU::ScalarMapOnDeformedShape_i::GetScalarEEntity(){
+//---------------------------------------------------------------
+VISU::Entity
+VISU::ScalarMapOnDeformedShape_i
+::GetScalarEEntity()
+{
   return VISU::Entity(myScalarEntity);
 }
 
+//---------------------------------------------------------------
 const VISU::PField&
 VISU::ScalarMapOnDeformedShape_i
 ::GetField() const 
index f80fce72af36fdb5029093cdfd1ba65c7cd6de1e..7e6c977685568e9e4c941b1c568a218720c91f48 100644 (file)
@@ -31,7 +31,8 @@
 
 class VISU_ScalarMapOnDeformedShapePL;
 
-namespace VISU{
+namespace VISU
+{
   
   //! Class of Scalar Map on Deformed Shape presentation.
   class ScalarMapOnDeformedShape_i : public virtual POA_VISU::ScalarMapOnDeformedShape,
@@ -57,22 +58,56 @@ namespace VISU{
     virtual VISU::VISUType GetType()
     { 
       return VISU::TSCALARMAPONDEFORMEDSHAPE;
-    };
+    }
     
-    typedef VISU::ScalarMapOnDeformedShape TInterface;
-    
-    virtual void SetScale(CORBA::Double theScale);
-    virtual CORBA::Double GetScale();
+    virtual 
+    void
+    SetScale(CORBA::Double theScale);
 
-    virtual CORBA::Boolean IsColored() { return myIsColored; }
-    virtual void ShowColored(CORBA::Boolean theColored) { myIsColored = theColored; }
+    virtual
+    CORBA::Double 
+    GetScale();
 
-    virtual SALOMEDS::Color GetColor() { return myColor;}
-    virtual void SetColor(const SALOMEDS::Color& theColor) { myColor = theColor;}
+    virtual
+    CORBA::Boolean 
+    IsColored() 
+    {
+      return myIsColored; 
+    }
 
-    virtual void SetSourceRange(CORBA::Double theMinRange,CORBA::Double theMaxRange);
-    virtual CORBA::Double GetSourceRangeMin();
-    virtual CORBA::Double GetSourceRangeMax();
+    virtual
+    void
+    ShowColored(CORBA::Boolean theColored)
+    {
+      myIsColored = theColored; 
+    }
+
+    virtual
+    SALOMEDS::Color 
+    GetColor() 
+    {
+      return myColor;
+    }
+
+    virtual
+    void
+    SetColor(const SALOMEDS::Color& theColor)
+    {
+      myColor = theColor;
+    }
+
+    virtual
+    void
+    SetSourceRange(CORBA::Double theMinRange,
+                  CORBA::Double theMaxRange);
+
+    virtual
+    CORBA::Double
+    GetSourceRangeMin();
+
+    virtual
+    CORBA::Double
+    GetSourceRangeMax();
 
     virtual 
     void
@@ -81,13 +116,24 @@ namespace VISU{
     virtual const VISU::PField&
     GetField() const;
 
-    VISU_ScalarMapOnDeformedShapePL* GetScalarMapOnDeformedShapePL(){ return myScalarMapOnDeformedShapePL;}
+    typedef VISU::ScalarMapOnDeformedShape TInterface;
+    
+    VISU_ScalarMapOnDeformedShapePL* 
+    GetScalarMapOnDeformedShapePL()
+    { 
+      return myScalarMapOnDeformedShapePL;
+    }
    
   protected:
-    
+    //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
     virtual
     void
-    DoHook();
+    CreatePipeLine();
+
+    //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
+    virtual 
+    bool 
+    CheckIsPossible();
 
     VISU_ScalarMapOnDeformedShapePL *myScalarMapOnDeformedShapePL;
     SALOMEDS::Color myColor;
@@ -99,46 +145,111 @@ namespace VISU{
     PField myScalarField;
 
   public:
-    static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
-                         const char* theFieldName, int theIteration, int isMemoryCheck = true);
-    virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity,
-                            const char* theFieldName, int theIteration);
+    //! Redefines VISU_ColoredPrs3d_i::IsPossible
+    static
+    int
+    IsPossible(Result_i* theResult, 
+                  const char* theMeshName, 
+                  VISU::Entity theEntity,
+                  const char* theFieldName, 
+                  int theTimeStampNumber, 
+                  int isMemoryCheck = true);
+
+    //! Redefines VISU_ColoredPrs3d_i::IsPossible
+    virtual
+    Storable* 
+    Create(const char* theMeshName, 
+          VISU::Entity theEntity,
+          const char* theFieldName, 
+          int theTimeStampNumber);
 
-    virtual void ToStream(std::ostringstream& theStr);
+    //! Redefines VISU_ColoredPrs3d_i::ToStream
+    virtual
+    void
+    ToStream(std::ostringstream& theStr);
 
-    virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+    //! Redefines VISU_ColoredPrs3d_i::Restore
+    virtual
+    Storable* 
+    Restore(const Storable::TRestoringMap& theMap);
     
-    static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
-                            const std::string& thePrefix, const Storable::TRestoringMap& theMap);
+    static
+    Storable* 
+    Restore(SALOMEDS::SObject_ptr theSObject,
+           const std::string& thePrefix, 
+           const Storable::TRestoringMap& theMap);
 
     static const std::string myComment;
-    virtual const char* GetComment() const;
-    virtual QString GenerateName();
 
-    virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+    virtual
+    const char* 
+    GetComment() const;
 
-    virtual void UpdateActor(VISU_Actor* theActor) ;
+    virtual
+    QString 
+    GenerateName();
 
-    virtual void SetScalarField(const char* theMeshName,
-                               const char* theFieldName,
-                               int   theIteration,
-                               VISU::TEntity  theEntity);
+    virtual
+    VISU_Actor* 
+    CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
+    virtual
+    void
+    UpdateActor(VISU_Actor* theActor) ;
+
+    virtual
+    void
+    SetScalarField(const char* theMeshName,
+                  const char* theFieldName,
+                  int   theIteration,
+                  VISU::TEntity  theEntity);
     
-    virtual void SetScalarField(const char* theMeshName,
-                               const char* theFieldName,
-                               CORBA::Long  theIteration,
-                               VISU::Entity  theEntity);
-
-    virtual void SetScalarFieldName(const char* theName);
-    virtual std::string GetScalarFieldName();
-    virtual void SetScalarIteration(const int theValue);
-    virtual int GetScalarIteration();
-    virtual void SetScalarMeshName(const char* theName);
-    virtual std::string GetScalarMeshName();
-    virtual void SetScalarEntity(const VISU::TEntity theValue);
-    virtual VISU::TEntity GetScalarEntity();
-    virtual void SetScalarEEntity(const VISU::Entity theValue);
-    virtual VISU::Entity GetScalarEEntity();
+    virtual 
+    void
+    SetScalarField(const char* theMeshName,
+                  const char* theFieldName,
+                  CORBA::Long  theIteration,
+                  VISU::Entity  theEntity);
+
+    virtual 
+    void
+    SetScalarFieldName(const char* theName);
+
+    virtual
+    std::string 
+    GetScalarFieldName();
+
+    virtual
+    void 
+    SetScalarIteration(const int theValue);
+
+    virtual
+    int
+    GetScalarIteration();
+
+    virtual
+    void
+    SetScalarMeshName(const char* theName);
+
+    virtual
+    std::string
+    GetScalarMeshName();
+
+    virtual
+    void
+    SetScalarEntity(const VISU::TEntity theValue);
+
+    virtual
+    VISU::TEntity
+    GetScalarEntity();
+
+    virtual
+    void
+    SetScalarEEntity(const VISU::Entity theValue);
+
+    virtual
+    VISU::Entity
+    GetScalarEEntity();
   };
 }
 #endif
index e56862cfe1df96bf0b5d93a146c46ac2bacc0c3d..c55e9d01edb716df96bd7f780f2436b12d65bd18 100644 (file)
@@ -38,9 +38,6 @@
 #include <vtkDataSetMapper.h>
 #include <vtkTextProperty.h>
 
-using namespace VISU;
-using namespace std;
-
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
 #else
@@ -50,21 +47,29 @@ static int MYDEBUG = 0;
 static int INCMEMORY = 4;
 
 
-//============================================================================
+//----------------------------------------------------------------------------
 int
 VISU::ScalarMap_i
 ::IsPossible(Result_i* theResult, 
             const char* theMeshName, 
-            VISU::Entity theEntity,
-            const char* theFieldName, int theIteration, int isMemoryCheck)
+            VISU::Entity theEntity, 
+            const char* theFieldName, 
+            int theTimeStampNumber, 
+            int isMemoryCheck)
 {
   try{
-    float aSize = INCMEMORY*
-      theResult->GetInput()->GetTimeStampSize(theMeshName,(VISU::TEntity)theEntity,theFieldName,theIteration);
     bool aResult = true;
-    if(isMemoryCheck){
-      aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
-      MESSAGE("ScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
+    if(theResult){
+      VISU::Result_i::TInput* anInput = theResult->GetInput();
+      float aSize = anInput->GetTimeStampSize(theMeshName,
+                                             (VISU::TEntity)theEntity,
+                                             theFieldName,
+                                             theTimeStampNumber);
+      aSize *= INCMEMORY;
+      if(isMemoryCheck){
+       aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
+       MESSAGE("ScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
+      }
     }
     return aResult;
   }catch(std::exception& exc){
@@ -76,10 +81,9 @@ VISU::ScalarMap_i
 }
 
 //----------------------------------------------------------------------------
-int
-VISU::ScalarMap_i
-::myNbPresent = 0;
+int VISU::ScalarMap_i::myNbPresent = 0;
 
+//----------------------------------------------------------------------------
 QString
 VISU::ScalarMap_i
 ::GenerateName() 
@@ -87,13 +91,14 @@ VISU::ScalarMap_i
   return VISU::GenerateName("ScalarMap",myNbPresent++);
 }
 
-const string
-VISU::ScalarMap_i
-::myComment = "SCALARMAP";
+//----------------------------------------------------------------------------
+const string VISU::ScalarMap_i::myComment = "SCALARMAP";
 
+//----------------------------------------------------------------------------
 const char* 
 VISU::ScalarMap_i
-::GetComment() const { 
+::GetComment() const 
+{ 
   return myComment.c_str();
 }
 
@@ -102,19 +107,21 @@ VISU::ScalarMap_i
 VISU::ScalarMap_i::
 ScalarMap_i(Result_i* theResult,
            bool theAddToStudy) :
-  PrsObject_i(theResult->GetStudyDocument()),
+  PrsObject_i(SALOMEDS::Study::_nil()),
   Prs3d_i(theResult,theAddToStudy),
   ColoredPrs3d_i(theResult,theAddToStudy)
 {}
 
+//----------------------------------------------------------------------------
 VISU::ScalarMap_i::
 ScalarMap_i(Result_i* theResult,
            SALOMEDS::SObject_ptr theSObject) :
-  PrsObject_i(theResult->GetStudyDocument()),
+  PrsObject_i(theSObject->GetStudy()),
   Prs3d_i(theResult,theSObject),
   ColoredPrs3d_i(theResult,theSObject)
 {}
 
+//----------------------------------------------------------------------------
 VISU::ScalarMap_i
 ::~ScalarMap_i()
 {}
@@ -175,6 +182,7 @@ VISU::ScalarMap_i
   return this;
 }
 
+//----------------------------------------------------------------------------
 VISU::Storable* 
 VISU::ScalarMap_i
 ::Restore(const Storable::TRestoringMap& theMap)
@@ -192,6 +200,7 @@ VISU::ScalarMap_i
   return this;
 }
 
+//----------------------------------------------------------------------------
 void 
 VISU::ScalarMap_i
 ::ToStream(std::ostringstream& theStr)
@@ -213,6 +222,7 @@ VISU::ScalarMap_i
   TSuperClass::SetBarOrientation(theOrientation);
 }
 
+//----------------------------------------------------------------------------
 VISU::ScalarMap::Orientation 
 VISU::ScalarMap_i
 ::GetBarOrientation() 
@@ -220,6 +230,7 @@ VISU::ScalarMap_i
   return TSuperClass::GetBarOrientation();
 }
 
+//----------------------------------------------------------------------------
 VISU::Scaling 
 VISU::ScalarMap_i
 ::GetScaling()
@@ -227,6 +238,7 @@ VISU::ScalarMap_i
   return VISU::Scaling(myScalarMapPL->GetScaling());
 }
 
+//----------------------------------------------------------------------------
 void
 VISU::ScalarMap_i
 ::SetScaling(VISU::Scaling theScaling)
@@ -234,6 +246,7 @@ VISU::ScalarMap_i
   myScalarMapPL->SetScaling(theScaling);
 }
 
+//----------------------------------------------------------------------------
 void
 VISU::ScalarMap_i
 ::SetRange(CORBA::Double theMin, CORBA::Double theMax)
@@ -249,18 +262,18 @@ VISU::ScalarMap_i
 //----------------------------------------------------------------------------
 void 
 VISU::ScalarMap_i
-::DoSetInput(Result_i* theResult)
+::DoSetInput()
 {
-  VISU::Result_i::TInput* anInput = theResult->GetInput();
+  VISU::Result_i::TInput* anInput = myResult->GetInput();
   if(!anInput)
-    throw std::runtime_error("Mesh_i::Build - theResult->GetInput() == NULL !!!");
+    throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
 
-  myField = anInput->GetField(myMeshName,myEntity,myFieldName);
+  myField = anInput->GetField(GetMeshName(),GetTEntity(),GetFieldName());
   if(!myField) 
     throw std::runtime_error("There is no Field with the parameters !!!");
 
   VISU::PIDMapper anIDMapper =
-    anInput->GetTimeStampOnMesh(myMeshName,myEntity,myFieldName,myIteration);
+    anInput->GetTimeStampOnMesh(GetMeshName(),GetTEntity(),GetFieldName(),GetTimeStampNumber());
 
   if(!anIDMapper) 
     throw std::runtime_error("There is no TimeStamp with the parameters !!!");
@@ -270,11 +283,13 @@ VISU::ScalarMap_i
   myScalarMapPL->Build();
 }
 
-void
+
+//----------------------------------------------------------------------------
+bool
 VISU::ScalarMap_i
-::Update() 
+::CheckIsPossible() 
 {
-  TSuperClass::Update();
+  return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
 }
 
 
@@ -286,6 +301,7 @@ VISU::ScalarMap_i
   myScalarMapPL->SetMapScale(theMapScale);
 }
 
+//----------------------------------------------------------------------------
 bool
 VISU::ScalarMap_i
 ::IsRangeFixed() 
@@ -293,6 +309,7 @@ VISU::ScalarMap_i
   return myIsFixedRange; 
 }
 
+//----------------------------------------------------------------------------
 void
 VISU::ScalarMap_i
 ::SetSourceRange()
@@ -325,6 +342,7 @@ VISU::ScalarMap_i
   return anActor;
 }
 
+//----------------------------------------------------------------------------
 VISU_Actor* 
 VISU::ScalarMap_i
 ::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
@@ -332,6 +350,7 @@ VISU::ScalarMap_i
   return CreateActor(theIO, false);
 }
 
+//----------------------------------------------------------------------------
 void
 VISU::ScalarMap_i
 ::UpdateActor(VISU_Actor* theActor) 
index ef29f65f428d3954725a72e810ac87ae90fbb141..8f507dcab489482c97b32f4e3f8b86c54d368e0c 100644 (file)
@@ -84,25 +84,37 @@ namespace VISU
     typedef VISU::ScalarMap TInterface;
 
   protected:
+    //! Redefines VISU_ColoredPrs3d_i::DoSetInput
     virtual 
     void
-    DoSetInput(Result_i* theResult);
+    DoSetInput();
+
+    //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
+    virtual 
+    bool 
+    CheckIsPossible();
 
   public:
+    /*!
+      Checks staticaly, whether it is possible to create presentation 
+      with the given basic parameters or not.
+    */
     static
     int
     IsPossible(Result_i* theResult, 
               const char* theMeshName, 
               VISU::Entity theEntity,
               const char* theFieldName, 
-              int theIteration
+              int theTimeStampNumber
               int isMemoryCheck = true);
+
+    //! Redefines VISU_ColoredPrs3d_i::Create
     virtual
     Storable* 
     Create(const char* theMeshName, 
           VISU::Entity theEntity,
           const char* theFieldName, 
-          int theIteration);
+          int theTimeStampNumber);
 
     virtual 
     void
@@ -128,10 +140,6 @@ namespace VISU
            const std::string& thePrefix, 
            const Storable::TRestoringMap& theMap);
 
-    virtual
-    void
-    Update() ;
-
     virtual
     void
     SetMapScale(double theMapScale = 1.0);
@@ -154,7 +162,8 @@ namespace VISU
     
     virtual 
     VISU_Actor* 
-    CreateActor(const Handle(SALOME_InteractiveObject)& theIO, bool toSupressShrinking);
+    CreateActor(const Handle(SALOME_InteractiveObject)& theIO, 
+               bool toSupressShrinking);
 
     virtual
     void
index 7aa8273bef16fc7f98260f04be310c3356a084a1..8bd4ebf1d65a44881e5f111025f4f877d5a83643 100644 (file)
 #include <vtkAppendFilter.h>
 #include <vtkUnstructuredGrid.h>
 
-using namespace VISU;
-using namespace std;
-
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
 #else
 static int MYDEBUG = 0;
 #endif
 
-int VISU::StreamLines_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity, 
-                                   const char* theFieldName, int theIteration, int isMemoryCheck)
+
+//---------------------------------------------------------------
+int
+VISU::StreamLines_i
+::IsPossible(Result_i* theResult, 
+            const char* theMeshName, 
+            VISU::Entity theEntity, 
+            const char* theFieldName, 
+            int theTimeStampNumber, 
+            int isMemoryCheck)
 {
   try{
-    if(!VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,false)) 
+    if(!VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theTimeStampNumber,false)) 
       return 0;
 
+    VISU::Result_i::TInput* anInput = theResult->GetInput();
     VISU::PIDMapper anIDMapper = 
-      theResult->GetInput()->GetTimeStampOnMesh(theMeshName,VISU::TEntity(theEntity),theFieldName,theIteration);
+      anInput->GetTimeStampOnMesh(theMeshName,VISU::TEntity(theEntity),theFieldName,theTimeStampNumber);
     VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
     bool aResult = VISU_StreamLinesPL::IsPossible(aDataSet);
     MESSAGE("StreamLines_i::IsPossible - aResult = "<<aResult);
@@ -67,44 +73,61 @@ int VISU::StreamLines_i::IsPossible(Result_i* theResult, const char* theMeshName
   return 0;
 }
 
-
+//---------------------------------------------------------------
 int VISU::StreamLines_i::myNbPresent = 0;
-QString VISU::StreamLines_i::GenerateName() { return VISU::GenerateName("StreamLines",myNbPresent++);}
 
+//---------------------------------------------------------------
+QString
+VISU::StreamLines_i
+::GenerateName() 
+{
+  return VISU::GenerateName("StreamLines",myNbPresent++);
+}
 
+//---------------------------------------------------------------
 const string VISU::StreamLines_i::myComment = "STREAMLINES";
-const char* VISU::StreamLines_i::GetComment() const { return myComment.c_str();}
+
+//---------------------------------------------------------------
+const char* 
+VISU::StreamLines_i
+::GetComment() const 
+{ 
+  return myComment.c_str();
+}
 
 
-VISU::StreamLines_i::
-StreamLines_i(Result_i* theResult, 
-             bool theAddToStudy) :
-  PrsObject_i(theResult->GetStudyDocument()), 
+//---------------------------------------------------------------
+VISU::StreamLines_i
+::StreamLines_i(Result_i* theResult, 
+               bool theAddToStudy) :
+  PrsObject_i(SALOMEDS::Study::_nil()), 
   Prs3d_i(theResult,theAddToStudy),
   ColoredPrs3d_i(theResult,theAddToStudy),
   ScalarMap_i(theResult,theAddToStudy),
   DeformedShape_i(theResult,theAddToStudy),
   myStreamLinesPL(NULL),
   myAppendFilter(vtkAppendFilter::New())
-{
-}
+{}
 
 
-VISU::StreamLines_i::
-StreamLines_i(Result_i* theResult, 
-             SALOMEDS::SObject_ptr theSObject) :
-  PrsObject_i(theResult->GetStudyDocument()), 
+//---------------------------------------------------------------
+VISU::StreamLines_i
+::StreamLines_i(Result_i* theResult, 
+               SALOMEDS::SObject_ptr theSObject) :
+  PrsObject_i(theSObject->GetStudy()), 
   Prs3d_i(theResult,theSObject),
   ColoredPrs3d_i(theResult,theSObject),
   ScalarMap_i(theResult,theSObject),
   DeformedShape_i(theResult,theSObject),
   myStreamLinesPL(NULL),
   myAppendFilter(vtkAppendFilter::New())
-{
-}
+{}
 
 
-void VISU::StreamLines_i::SameAs(const Prs3d_i* theOrigin)
+//---------------------------------------------------------------
+void
+VISU::StreamLines_i
+::SameAs(const Prs3d_i* theOrigin)
 {
   TSuperClass::SameAs(theOrigin);
 
@@ -115,14 +138,22 @@ void VISU::StreamLines_i::SameAs(const Prs3d_i* theOrigin)
 }
 
 
-VISU::Storable* VISU::StreamLines_i::Create(const char* theMeshName, VISU::Entity theEntity, 
-                                           const char* theFieldName, int theIteration)
+//---------------------------------------------------------------
+VISU::Storable* 
+VISU::StreamLines_i
+::Create(const char* theMeshName, 
+        VISU::Entity theEntity,
+        const char* theFieldName, 
+        int theTimeStampNumber)
 {
-  return DeformedShape_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+  return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
 }
 
 
-VISU::Storable* VISU::StreamLines_i::Restore(const Storable::TRestoringMap& theMap)
+//---------------------------------------------------------------
+VISU::Storable* 
+VISU::StreamLines_i
+::Restore(const Storable::TRestoringMap& theMap)
 {
   TSuperClass::Restore(theMap);
 
@@ -143,8 +174,12 @@ VISU::Storable* VISU::StreamLines_i::Restore(const Storable::TRestoringMap& theM
 }
 
 
-void VISU::StreamLines_i::ToStream(std::ostringstream& theStr){
-  DeformedShape_i::ToStream(theStr);
+//---------------------------------------------------------------
+void
+VISU::StreamLines_i
+::ToStream(std::ostringstream& theStr)
+{
+  TSuperClass::ToStream(theStr);
 
   Storable::DataToStream( theStr, "myIntegrationStep", GetIntegrationStep());
   Storable::DataToStream( theStr, "myPropagationTime", GetPropagationTime());
@@ -157,20 +192,25 @@ void VISU::StreamLines_i::ToStream(std::ostringstream& theStr){
 }
 
 
-VISU::StreamLines_i::~StreamLines_i(){
+//---------------------------------------------------------------
+VISU::StreamLines_i
+::~StreamLines_i()
+{
   if(MYDEBUG) MESSAGE("StreamLines_i::~StreamLines_i()");
   myAppendFilter->UnRegisterAllOutputs();
   myAppendFilter->Delete();
 }
 
 
+//---------------------------------------------------------------
 CORBA::Boolean 
-VISU::StreamLines_i::SetParams(CORBA::Double theIntStep,
-                              CORBA::Double thePropogationTime,
-                              CORBA::Double theStepLength,
-                              VISU::Prs3d_ptr thePrs3d, 
-                              CORBA::Double thePercents,
-                              VISU::StreamLines::Direction theDirection) 
+VISU::StreamLines_i
+::SetParams(CORBA::Double theIntStep,
+           CORBA::Double thePropogationTime,
+           CORBA::Double theStepLength,
+           VISU::Prs3d_ptr thePrs3d, 
+           CORBA::Double thePercents,
+           VISU::StreamLines::Direction theDirection) 
 { 
   VISU::Prs3d_i* aPrs3di = NULL;
   vtkPointSet* aSource = NULL;
@@ -193,13 +233,22 @@ VISU::StreamLines_i::SetParams(CORBA::Double theIntStep,
 }
 
 
-void VISU::StreamLines_i::SetSource(VISU::Prs3d_ptr thePrs3d){
+//---------------------------------------------------------------
+void
+VISU::StreamLines_i
+::SetSource(VISU::Prs3d_ptr thePrs3d)
+{
   if(!thePrs3d->_is_nil()){
     VISU::Prs3d_i* aPrs3di = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(thePrs3d).in());
     SetSource(aPrs3di);
   }
 }
-void VISU::StreamLines_i::SetSource(VISU::Prs3d_i* thePrs3d){
+
+//---------------------------------------------------------------
+void
+VISU::StreamLines_i
+::SetSource(VISU::Prs3d_i* thePrs3d)
+{
   mySourceEntry = "";
   if(thePrs3d){
     SALOMEDS::SObject_var aSObject = thePrs3d->GetSObject();
@@ -207,7 +256,12 @@ void VISU::StreamLines_i::SetSource(VISU::Prs3d_i* thePrs3d){
     mySourceEntry = aString.in();
   }
 }
-void VISU::StreamLines_i::SetSource(){
+
+//---------------------------------------------------------------
+void
+VISU::StreamLines_i
+::SetSource()
+{
   if(!myStreamLinesPL->GetSource() && mySourceEntry == "") return;
   if(myStreamLinesPL->GetSource() == myAppendFilter->GetOutput()) return;
   VISU::Prs3d_var aPrs3d = GetSource();
@@ -220,58 +274,101 @@ void VISU::StreamLines_i::SetSource(){
 }
 
 
-CORBA::Double VISU::StreamLines_i::GetIntegrationStep() { 
+//---------------------------------------------------------------
+CORBA::Double 
+VISU::StreamLines_i
+::GetIntegrationStep() 
+{ 
   return myStreamLinesPL->GetIntegrationStep();
 }
 
-CORBA::Double VISU::StreamLines_i::GetPropagationTime() { 
+//---------------------------------------------------------------
+CORBA::Double
+VISU::StreamLines_i
+::GetPropagationTime() 
+{ 
   return myStreamLinesPL->GetPropagationTime();
 }
 
-CORBA::Double VISU::StreamLines_i::GetStepLength() { 
+//---------------------------------------------------------------
+CORBA::Double
+VISU::StreamLines_i
+::GetStepLength() 
+{ 
   return myStreamLinesPL->GetStepLength();
 }
 
-VISU::StreamLines::Direction VISU::StreamLines_i::GetDirection() { 
+//---------------------------------------------------------------
+VISU::StreamLines::Direction
+VISU::StreamLines_i
+::GetDirection() 
+{ 
   return VISU::StreamLines::Direction(myStreamLinesPL->GetDirection());
 }
 
 
-VISU::Prs3d_ptr VISU::StreamLines_i::GetSource(){
+//---------------------------------------------------------------
+VISU::Prs3d_ptr
+VISU::StreamLines_i
+::GetSource()
+{
   VISU::Prs3d_var aPrs3d;
   if(MYDEBUG) MESSAGE("StreamLines_i::GetSource() mySourceEntry = '"<<mySourceEntry<<"'");
   if(mySourceEntry != ""){
-    SALOMEDS::SObject_var aSObject = myStudy->FindObjectID(mySourceEntry.c_str());
+    SALOMEDS::SObject_var aSObject = GetStudyDocument()->FindObjectID(mySourceEntry.c_str());
     CORBA::Object_var anObj = SObjectToObject(aSObject);
     if(!CORBA::is_nil(anObj)) aPrs3d = VISU::Prs3d::_narrow(anObj);
   }
   return aPrs3d._retn();
 }
 
-CORBA::Double VISU::StreamLines_i::GetUsedPoints() { 
+//---------------------------------------------------------------
+CORBA::Double 
+VISU::StreamLines_i
+::GetUsedPoints() 
+{ 
   return myStreamLinesPL->GetUsedPoints();
 }
 
 
-void VISU::StreamLines_i::DoHook(){
-  if(!myPipeLine) myPipeLine = VISU_StreamLinesPL::New();
+//---------------------------------------------------------------
+void 
+VISU::StreamLines_i
+::CreatePipeLine()
+{
+  if(!myPipeLine) 
+    myPipeLine = VISU_StreamLinesPL::New();
   myStreamLinesPL = dynamic_cast<VISU_StreamLinesPL*>(myPipeLine);
 
-  DeformedShape_i::DoHook();
+  TSuperClass::CreatePipeLine();
+}
+
+
+//----------------------------------------------------------------------------
+bool
+VISU::StreamLines_i
+::CheckIsPossible() 
+{
+  return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
 }
 
 
-void VISU::StreamLines_i::Update() {
+//---------------------------------------------------------------
+void
+VISU::StreamLines_i
+::Update() 
+{
   SetSource();
-  VISU::DeformedShape_i::Update();
+  TSuperClass::Update();
 }
 
 
+//---------------------------------------------------------------
 VISU_Actor* 
 VISU::StreamLines_i
 ::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) 
 {
-  if(VISU_Actor* anActor = VISU::DeformedShape_i::CreateActor(theIO, true)){
+  if(VISU_Actor* anActor = TSuperClass::CreateActor(theIO, true)){
     anActor->SetVTKMapping(true);
     SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
     int  aDispMode = aResourceMgr->integerValue("VISU", "stream_lines_represent", 1);
@@ -282,6 +379,10 @@ VISU::StreamLines_i
 }
 
 
-void VISU::StreamLines_i::UpdateActor(VISU_Actor* theActor) {
-  VISU::DeformedShape_i::UpdateActor(theActor);
+//---------------------------------------------------------------
+void
+VISU::StreamLines_i
+::UpdateActor(VISU_Actor* theActor) 
+{
+  TSuperClass::UpdateActor(theActor);
 }
index 9c4af6fe53abb771eaa323ae7562a9e947a19e49..db99dd996102c182e7f0c2ec2e815d5c78efdcbd 100644 (file)
@@ -32,7 +32,8 @@
 class VISU_StreamLinesPL;
 class vtkAppendFilter;
 
-namespace VISU{
+namespace VISU
+{
   class StreamLines_i : public virtual POA_VISU::StreamLines,
                        public virtual DeformedShape_i
   {
@@ -49,60 +50,148 @@ namespace VISU{
     explicit
     StreamLines_i(Result_i* theResult,
                  SALOMEDS::SObject_ptr theSObject);
-    virtual void SameAs(const Prs3d_i* theOriginal);
-    virtual ~StreamLines_i();
-
-    virtual VISU::VISUType GetType() { return VISU::TSTREAMLINES;}
-
-    virtual CORBA::Boolean SetParams(CORBA::Double theIntStep,
-                                    CORBA::Double thePropogationTime,
-                                    CORBA::Double theStepLength,
-                                    VISU::Prs3d_ptr thePrs3d,
-                                    CORBA::Double thePercents,
-                                    VISU::StreamLines::Direction theDirection);
-    virtual CORBA::Double GetIntegrationStep();
-    virtual CORBA::Double GetPropagationTime();
-    virtual CORBA::Double GetStepLength();
-    virtual CORBA::Double GetUsedPoints();
-    virtual VISU::Prs3d_ptr GetSource();
-    virtual VISU::StreamLines::Direction GetDirection();
+
+    virtual
+    void
+    SameAs(const Prs3d_i* theOriginal);
+
+    virtual
+    ~StreamLines_i();
+
+    virtual
+    VISU::VISUType GetType()
+    {
+      return VISU::TSTREAMLINES;
+    }
+
+    virtual
+    CORBA::Boolean 
+    SetParams(CORBA::Double theIntStep,
+             CORBA::Double thePropogationTime,
+             CORBA::Double theStepLength,
+             VISU::Prs3d_ptr thePrs3d,
+             CORBA::Double thePercents,
+             VISU::StreamLines::Direction theDirection);
+
+    virtual
+    CORBA::Double
+    GetIntegrationStep();
+
+    virtual
+    CORBA::Double
+    GetPropagationTime();
+
+    virtual
+    CORBA::Double
+    GetStepLength();
+
+    virtual
+    CORBA::Double
+    GetUsedPoints();
+
+    virtual
+    VISU::Prs3d_ptr
+    GetSource();
+
+    virtual
+    VISU::StreamLines::Direction 
+    GetDirection();
 
     typedef VISU::StreamLines TInterface;
-    VISU_StreamLinesPL* GetStreamLinesPL(){ return myStreamLinesPL;}
 
+    VISU_StreamLinesPL* 
+    GetSpecificPL() const
+    { 
+      return myStreamLinesPL; 
+    }
+    
   protected:
-    virtual void DoHook();
-    virtual void SetSource(VISU::Prs3d_ptr thePrs3d);
-    virtual void SetSource(VISU::Prs3d_i* thePrs3d);
-    virtual void SetSource();
+    //! Extends VISU_ColoredPrs3d_i::CreatePipeLine
+    virtual 
+    void
+    CreatePipeLine();
+
+    //! Extends VISU_ColoredPrs3d_i::CheckIsPossible
+    virtual 
+    bool 
+    CheckIsPossible();
+
+    virtual
+    void
+    SetSource(VISU::Prs3d_ptr thePrs3d);
+
+    virtual
+    void 
+    SetSource(VISU::Prs3d_i* thePrs3d);
+
+    virtual
+    void
+    SetSource();
 
     VISU_StreamLinesPL* myStreamLinesPL;
     vtkAppendFilter* myAppendFilter;
     std::string mySourceEntry;
 
   public:
-    static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
-                         const char* theFieldName, int theIteration, int isMemoryCheck = true);
-    virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity,
-                            const char* theFieldName, int theIteration);
-
-    virtual void ToStream(std::ostringstream& theStr);
+    //! Extends VISU_ColoredPrs3d_i::IsPossible
+    static 
+    int
+    IsPossible(Result_i* theResult, 
+              const char* theMeshName, 
+              VISU::Entity theEntity,
+              const char* theFieldName, 
+              int theTimeStampNumber, 
+              int isMemoryCheck = true);
+
+    //! Extends VISU_ColoredPrs3d_i::Create
+    virtual
+    Storable* 
+    Create(const char* theMeshName, 
+          VISU::Entity theEntity,
+          const char* theFieldName, 
+          int theTimeStampNumber);
+
+    //! Extends VISU_ColoredPrs3d_i::ToStream
+    virtual
+    void
+    ToStream(std::ostringstream& theStr);
 
     static const std::string myComment;
-    virtual const char* GetComment() const;
-    virtual QString GenerateName();
 
-    virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+    virtual
+    const char* 
+    GetComment() const;
 
-    virtual void Update();
+    virtual
+    QString 
+    GenerateName();
 
+    //! Extends VISU_ColoredPrs3d_i::Restore
+    virtual 
+    Storable* 
+    Restore(const Storable::TRestoringMap& theMap);
+
+    //! Extends VISU_ColoredPrs3d_i::Update
+    virtual 
+    void 
+    Update();
+
+    //! Extends VISU_ColoredPrs3d_i::CreateActor
     virtual 
     VISU_Actor* 
     CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
 
-    virtual void UpdateActor(VISU_Actor* theActor);
-
-    virtual QString GetSourceEntry() { return QString(mySourceEntry.c_str()); }
+    //! Extends VISU_ColoredPrs3d_i::UpdateActor
+    virtual
+    void
+    UpdateActor(VISU_Actor* theActor);
+
+    virtual
+    QString
+    GetSourceEntry() 
+    { 
+      return QString(mySourceEntry.c_str()); 
+    }
   };
 }
 
index cb64212609ee4b554372f319d359d7218639816f..309cfbae3ef1083383bb381b24e932ced9416d98 100644 (file)
@@ -90,7 +90,7 @@ VISU::Table_i::~Table_i()
 CORBA::Long VISU::Table_i::GetNbRows()
 {
   SALOMEDS::SObject_var SO = mySObj;
-  SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+  SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
   if ( !SO->_is_nil() ) {
     SALOMEDS::GenericAttribute_var        anAttr;
     if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) {
@@ -110,7 +110,7 @@ CORBA::Long VISU::Table_i::GetNbRows()
 CORBA::Long VISU::Table_i::GetNbColumns()
 {
   SALOMEDS::SObject_var SO = mySObj;
-  SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+  SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
   if ( !SO->_is_nil() ) {
     SALOMEDS::GenericAttribute_var        anAttr;
     if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) {
@@ -168,11 +168,11 @@ VISU::Storable* VISU::Table_i::Build( int theRestoring )
       if(!aCutLines->_is_nil())
        pCutLines = dynamic_cast<CutLines_i*>(GetServant(aCutLines).in());
     }
-    SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+    SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
     SALOMEDS::GenericAttribute_var anAttr;
     // look for component
     if ( !theRestoring ) {
-       SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( myStudy );
+       SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( GetStudyDocument() );
        // create SObject and set attributes
        QString aComment;
        if(pCutLines)
@@ -196,7 +196,7 @@ VISU::Storable* VISU::Table_i::Build( int theRestoring )
          }
        }
 
-       string anEntry = CreateAttributes( myStudy,
+       string anEntry = CreateAttributes( GetStudyDocument(),
                                          SO->GetID(),//SComponent->GetID(),
                                          "",
                                          GetID(),
@@ -205,7 +205,7 @@ VISU::Storable* VISU::Table_i::Build( int theRestoring )
                                          aComment.latin1(),
                                          pCutLines );
        // create SObject referenced to real table object
-       mySObj = SALOMEDS::SObject::_duplicate(myStudy->FindObjectID( anEntry.c_str() ));
+       mySObj = SALOMEDS::SObject::_duplicate(GetStudyDocument()->FindObjectID( anEntry.c_str() ));
        if(pCutLines) {
          pCutLines->BuildTableOfReal(mySObj);
        }
@@ -254,7 +254,7 @@ VISU::Storable* VISU::Table_i::Restore(SALOMEDS::SObject_ptr theSObject,
 const char* VISU::Table_i::GetTableTitle()
 {
   SALOMEDS::SObject_var SO = mySObj;
-  SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+  SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
   SALOMEDS::GenericAttribute_var        anAttr;
   SALOMEDS::AttributeTableOfInteger_var anInt;
   SALOMEDS::AttributeTableOfReal_var    aReal;
@@ -371,11 +371,11 @@ VISU::Storable* VISU::Curve_i::Build(int theRestoring )
     if ( myHRow > 0 && myHRow <= nbRows && myVRow > 0 && myVRow <= nbRows ) {
       if ( !theRestoring ) {
        // look for component
-       SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( myStudy );
+       SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( GetStudyDocument() );
        // create SObject and set attributes
        QString aComment;
        aComment.sprintf("myComment=%s;myType=%d",GetComment(),VISU::TCURVE);
-       string anEntry = CreateAttributes( myStudy,
+       string anEntry = CreateAttributes( GetStudyDocument(),
                                          myTable->GetObjectEntry(),
                                          "",
                                          GetID(),
@@ -384,7 +384,7 @@ VISU::Storable* VISU::Curve_i::Build(int theRestoring )
                                          aComment.latin1(),
                                          true );
        // create SObject referenced to real table object
-       mySObj = SALOMEDS::SObject::_duplicate(myStudy->FindObjectID(anEntry.c_str()));
+       mySObj = SALOMEDS::SObject::_duplicate(GetStudyDocument()->FindObjectID(anEntry.c_str()));
       }
       return this;
     }
@@ -398,8 +398,8 @@ VISU::Storable* VISU::Curve_i::Build(int theRestoring )
 CORBA::Boolean VISU::Curve_i::IsValid()
 {
   // getting table SObject by it's entry
-  SALOMEDS::SObject_var SO = myStudy->FindObjectID(myTable->GetObjectEntry());
-  SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+  SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+  SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
   SALOMEDS::GenericAttribute_var        anAttr;
   SALOMEDS::AttributeTableOfInteger_var anInt;
   SALOMEDS::AttributeTableOfReal_var    aReal;
@@ -426,8 +426,8 @@ string VISU::Curve_i::GetHorTitle()
 {
   string title;
   // getting table SObject by it's entry
-  SALOMEDS::SObject_var SO = myStudy->FindObjectID(myTable->GetObjectEntry());
-  SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+  SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+  SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
   SALOMEDS::GenericAttribute_var        anAttr;
   SALOMEDS::AttributeTableOfInteger_var anInt;
   SALOMEDS::AttributeTableOfReal_var    aReal;
@@ -456,8 +456,8 @@ string VISU::Curve_i::GetVerTitle()
 {
   string title;
   // getting table SObject by it's entry
-  SALOMEDS::SObject_var SO = myStudy->FindObjectID(myTable->GetObjectEntry());
-  SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+  SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+  SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
   SALOMEDS::GenericAttribute_var        anAttr;
   SALOMEDS::AttributeTableOfInteger_var anInt;
   SALOMEDS::AttributeTableOfReal_var    aReal;
@@ -484,8 +484,8 @@ string VISU::Curve_i::GetHorUnits()
 {
   string units;
   // getting table SObject by it's entry
-  SALOMEDS::SObject_var SO = myStudy->FindObjectID(myTable->GetObjectEntry());
-  SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+  SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+  SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
   SALOMEDS::GenericAttribute_var        anAttr;
   SALOMEDS::AttributeTableOfInteger_var anInt;
   SALOMEDS::AttributeTableOfReal_var    aReal;
@@ -512,8 +512,8 @@ string VISU::Curve_i::GetVerUnits()
 {
   string units;
   // getting table SObject by it's entry
-  SALOMEDS::SObject_var SO = myStudy->FindObjectID(myTable->GetObjectEntry());
-  SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+  SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+  SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
   SALOMEDS::GenericAttribute_var        anAttr;
   SALOMEDS::AttributeTableOfInteger_var anInt;
   SALOMEDS::AttributeTableOfReal_var    aReal;
@@ -540,8 +540,8 @@ int VISU::Curve_i::GetData( double*& theHorList, double*& theVerList, QStringLis
 {
   theHorList = 0; theVerList = 0;
   // getting table SObject by it's entry
-  SALOMEDS::SObject_var SO = myStudy->FindObjectID(myTable->GetObjectEntry());
-  SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+  SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+  SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
   SALOMEDS::GenericAttribute_var        anAttr;
   SALOMEDS::AttributeTableOfInteger_var anInt;
   SALOMEDS::AttributeTableOfReal_var    aReal;
@@ -790,19 +790,19 @@ VISU::Container_i::~Container_i()
 */
 void VISU::Container_i::AddCurve( Curve_ptr theCurve )
 {
-  if ( myStudy->_is_nil() )
+  if ( GetStudyDocument()->_is_nil() )
     return;
-  SALOMEDS::SObject_var mySO = myStudy->FindObjectID( GetEntry() );
+  SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry() );
   if ( mySO->_is_nil() )
     return;
   PortableServer::POA_ptr aPOA = GetPOA();
   Curve_i* pCurve = dynamic_cast<Curve_i*>( aPOA->reference_to_servant( theCurve ) );
   if( pCurve ) {
     QString entry = pCurve->GetEntry();
-    SALOMEDS::SObject_var SO = myStudy->FindObjectID( entry.latin1() );
+    SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID( entry.latin1() );
     if ( !SO->_is_nil() && myCurves.find( entry ) == myCurves.end() ) {
       myCurves.append( entry );
-      SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+      SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
       SALOMEDS::SObject_var newSO = Builder->NewObject( mySO );
       Builder->Addreference( newSO, SO );
     }
@@ -813,9 +813,9 @@ void VISU::Container_i::AddCurve( Curve_ptr theCurve )
 */
 void VISU::Container_i::RemoveCurve( Curve_ptr theCurve )
 {
-  if ( myStudy->_is_nil() )
+  if ( GetStudyDocument()->_is_nil() )
     return;
-  SALOMEDS::SObject_var mySO = myStudy->FindObjectID( GetEntry() );
+  SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry() );
   if ( mySO->_is_nil() )
     return;
   PortableServer::POA_ptr aPOA = GetPOA();
@@ -825,8 +825,8 @@ void VISU::Container_i::RemoveCurve( Curve_ptr theCurve )
     if ( myCurves.find( entry ) != myCurves.end() ) {
       // found !!!
       myCurves.remove( entry );
-      SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
-      SALOMEDS::ChildIterator_var CI = myStudy->NewChildIterator( mySO );
+      SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
+      SALOMEDS::ChildIterator_var CI = GetStudyDocument()->NewChildIterator( mySO );
       for ( ; CI->More(); CI->Next() ) {
        SALOMEDS::SObject_var childSO = CI->Value();
        SALOMEDS::SObject_var refSO;
@@ -850,19 +850,19 @@ CORBA::Long VISU::Container_i::GetNbCurves()
 */
 void VISU::Container_i::Clear()
 {
-  if ( myStudy->_is_nil() )
+  if ( GetStudyDocument()->_is_nil() )
     return;
-  SALOMEDS::SObject_var mySO = myStudy->FindObjectID( GetEntry() );
+  SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry() );
   if ( mySO->_is_nil() )
     return;
   QStringList toDelete;
-  SALOMEDS::ChildIterator_var CI = myStudy->NewChildIterator( mySO );
+  SALOMEDS::ChildIterator_var CI = GetStudyDocument()->NewChildIterator( mySO );
   for ( ; CI->More(); CI->Next() ) {
     toDelete.append( CI->Value()->GetID() );
   }
-  SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+  SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
   for ( int i = 0; i < toDelete.count(); i++ ) {
-    SALOMEDS::SObject_var SO = myStudy->FindObjectID( toDelete[i].latin1() );
+    SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID( toDelete[i].latin1() );
     Builder->RemoveObject( SO );
   }
   myCurves.clear();
@@ -884,11 +884,11 @@ VISU::Storable* VISU::Container_i::Build( int theRestoring )
 {
   if ( !theRestoring ) {
     // looking for component
-    SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( myStudy );
+    SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( GetStudyDocument() );
     // create SObject and set attributes
     QString aComment;
     aComment.sprintf("myComment=%s;myType=%d",GetComment(),VISU::TCONTAINER);
-    string anEntry = CreateAttributes( myStudy,
+    string anEntry = CreateAttributes( GetStudyDocument(),
                                       SComponent->GetID(),
                                       "",
                                       GetID(),
@@ -896,7 +896,7 @@ VISU::Storable* VISU::Container_i::Build( int theRestoring )
                                       "",
                                       aComment.latin1(),
                                       true );
-    mySObj = SALOMEDS::SObject::_duplicate(myStudy->FindObjectID(anEntry.c_str()));
+    mySObj = SALOMEDS::SObject::_duplicate(GetStudyDocument()->FindObjectID(anEntry.c_str()));
   }
   return this;
 }
@@ -905,19 +905,19 @@ VISU::Storable* VISU::Container_i::Build( int theRestoring )
 */
 void VISU::Container_i::Update()
 {
-  if ( myStudy->_is_nil() )
+  if ( GetStudyDocument()->_is_nil() )
     return;
-  SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
-  SALOMEDS::SObject_var mySO = myStudy->FindObjectID( GetEntry() );
+  SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
+  SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry() );
   SALOMEDS::GenericAttribute_var anAttr;
   if ( !mySO->_is_nil() ) {
     QStringList toDelete;
     int i;
     for ( i = 0; i < myCurves.count(); i++ ) {
-      SALOMEDS::SObject_var SO = myStudy->FindObjectID( myCurves[i].latin1() );
+      SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID( myCurves[i].latin1() );
       if ( !SO->_is_nil() && Builder->FindAttribute( SO, anAttr, "AttributeIOR" ) ) {
        // if real Curve Object still exists
-       SALOMEDS::ChildIterator_var CI = myStudy->NewChildIterator( mySO );
+       SALOMEDS::ChildIterator_var CI = GetStudyDocument()->NewChildIterator( mySO );
        bool bFound = false;
        for ( ; CI->More(); CI->Next() ) {
          SALOMEDS::SObject_var childSO = CI->Value();
@@ -941,7 +941,7 @@ void VISU::Container_i::Update()
       myCurves.remove( toDelete[i] );
     }
     toDelete.clear();
-    SALOMEDS::ChildIterator_var CI = myStudy->NewChildIterator( mySO );
+    SALOMEDS::ChildIterator_var CI = GetStudyDocument()->NewChildIterator( mySO );
     for ( ; CI->More(); CI->Next() ) {
       SALOMEDS::SObject_var childSO = CI->Value();
       SALOMEDS::SObject_var refSO;
@@ -951,7 +951,7 @@ void VISU::Container_i::Update()
       }
     }
     for ( i = 0; i < toDelete.count(); i++ ) {
-      SALOMEDS::ChildIterator_var CI = myStudy->NewChildIterator( mySO );
+      SALOMEDS::ChildIterator_var CI = GetStudyDocument()->NewChildIterator( mySO );
       for ( ; CI->More(); CI->Next() ) {
        SALOMEDS::SObject_var childSO = CI->Value();
        if ( toDelete[i] == CI->Value()->GetID() ) {
@@ -968,9 +968,9 @@ void VISU::Container_i::Update()
 VISU::Curve_i* VISU::Container_i::GetCurve( CORBA::Long theIndex )
 {
   if ( theIndex > 0 && theIndex <= myCurves.count()  ) {
-    SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+    SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
     SALOMEDS::GenericAttribute_var anAttr;
-    SALOMEDS::SObject_var SO = myStudy->FindObjectID( myCurves[  theIndex-1 ].latin1() );
+    SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID( myCurves[  theIndex-1 ].latin1() );
     CORBA::Object_var anObject = VISU::SObjectToObject( SO );
     if( !CORBA::is_nil( anObject ) ) {
       // if real Curve Object exists
index c8bd8a59f34e3b2f0bef0809fb6743327752d121..d7e6fedd568c09670be4d3a961f7f615a94f6e7c 100644 (file)
@@ -35,9 +35,6 @@
 
 #include <vtkProperty.h>
 
-using namespace VISU;
-using namespace std;
-
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
 #else
@@ -46,15 +43,32 @@ static int MYDEBUG = 0;
 
 static int INCMEMORY = 4+12;
 
-int VISU::Vectors_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity, 
-                               const char* theFieldName, int theIteration, int isMemoryCheck)
+
+//---------------------------------------------------------------
+int 
+VISU::Vectors_i
+::IsPossible(Result_i* theResult, 
+            const char* theMeshName, 
+            VISU::Entity theEntity, 
+            const char* theFieldName, 
+            int theTimeStampNumber, 
+            int isMemoryCheck)
 {
   bool aResult = false;
   try{
-    aResult = DeformedShape_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,false);
+    aResult = TSuperClass::IsPossible(theResult,
+                                     theMeshName,
+                                     theEntity,
+                                     theFieldName,
+                                     theTimeStampNumber,
+                                     false);
     if(isMemoryCheck && aResult){
-      float aSize = INCMEMORY*
-       theResult->GetInput()->GetTimeStampSize(theMeshName,(VISU::TEntity)theEntity,theFieldName,theIteration);
+      VISU::Result_i::TInput* anInput = theResult->GetInput();
+      float aSize = anInput->GetTimeStampSize(theMeshName,
+                                             (VISU::TEntity)theEntity,
+                                             theFieldName,
+                                             theTimeStampNumber);
+      aSize *= INCMEMORY;
       aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
       MESSAGE("Vectors_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
     }
@@ -66,42 +80,59 @@ int VISU::Vectors_i::IsPossible(Result_i* theResult, const char* theMeshName, VI
   return aResult;
 }
 
-
+//---------------------------------------------------------------
 int VISU::Vectors_i::myNbPresent = 0;
-QString VISU::Vectors_i::GenerateName() { return VISU::GenerateName("Vectors",myNbPresent++);}
 
+//---------------------------------------------------------------
+QString 
+VISU::Vectors_i
+::GenerateName() 
+{
+  return VISU::GenerateName("Vectors",myNbPresent++);
+}
 
+//---------------------------------------------------------------
 const string VISU::Vectors_i::myComment = "VECTORS";
-const char* VISU::Vectors_i::GetComment() const { return myComment.c_str();}
+
+//---------------------------------------------------------------
+const char* 
+VISU::Vectors_i
+::GetComment() const
+{
+  return myComment.c_str();
+}
 
 
-VISU::Vectors_i::
-Vectors_i(Result_i* theResult, 
-         bool theAddToStudy) :
-  PrsObject_i(theResult->GetStudyDocument()), 
+//---------------------------------------------------------------
+VISU::Vectors_i
+::Vectors_i(Result_i* theResult, 
+           bool theAddToStudy) :
+  PrsObject_i(SALOMEDS::Study::_nil()), 
   Prs3d_i(theResult,theAddToStudy),
   ColoredPrs3d_i(theResult,theAddToStudy),
   ScalarMap_i(theResult,theAddToStudy),
   DeformedShape_i(theResult,theAddToStudy),
   myVectorsPL(NULL)
-{
-}
+{}
 
 
-VISU::Vectors_i::
-Vectors_i(Result_i* theResult, 
-         SALOMEDS::SObject_ptr theSObject) :
-  PrsObject_i(theResult->GetStudyDocument()), 
+//---------------------------------------------------------------
+VISU::Vectors_i
+::Vectors_i(Result_i* theResult, 
+           SALOMEDS::SObject_ptr theSObject) :
+  PrsObject_i(theSObject->GetStudy()), 
   Prs3d_i(theResult,theSObject),
   ColoredPrs3d_i(theResult,theSObject),
   ScalarMap_i(theResult,theSObject),
   DeformedShape_i(theResult,theSObject),
   myVectorsPL(NULL)
-{
-}
+{}
 
 
-void VISU::Vectors_i::SameAs(const VISU::Prs3d_i* theOrigin)
+//---------------------------------------------------------------
+void
+VISU::Vectors_i
+::SameAs(const VISU::Prs3d_i* theOrigin)
 {
   TSuperClass::SameAs(theOrigin);
 
@@ -112,15 +143,23 @@ void VISU::Vectors_i::SameAs(const VISU::Prs3d_i* theOrigin)
 }
 
 
-VISU::Storable* VISU::Vectors_i::Create(const char* theMeshName, VISU::Entity theEntity, 
-                                       const char* theFieldName, int theIteration)
+//---------------------------------------------------------------
+VISU::Storable* 
+VISU::Vectors_i
+::Create(const char* theMeshName, 
+        VISU::Entity theEntity,
+        const char* theFieldName, 
+        int theTimeStampNumber)
 {
   myLineWidth = 1.0;
-  return DeformedShape_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+  return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
 }
 
 
-VISU::Storable* VISU::Vectors_i::Restore(const Storable::TRestoringMap& theMap)
+//---------------------------------------------------------------
+VISU::Storable* 
+VISU::Vectors_i
+::Restore(const Storable::TRestoringMap& theMap)
 {
   TSuperClass::Restore(theMap);
 
@@ -132,8 +171,12 @@ VISU::Storable* VISU::Vectors_i::Restore(const Storable::TRestoringMap& theMap)
 }
 
 
-void VISU::Vectors_i::ToStream(std::ostringstream& theStr){
-  DeformedShape_i::ToStream(theStr);
+//---------------------------------------------------------------
+void 
+VISU::Vectors_i
+::ToStream(std::ostringstream& theStr)
+{
+  TSuperClass::ToStream(theStr);
 
   Storable::DataToStream( theStr, "myTypeGlyph", int(GetGlyphType()));
   Storable::DataToStream( theStr, "myPosGlyph",  int(GetGlyphPos()));
@@ -141,44 +184,82 @@ void VISU::Vectors_i::ToStream(std::ostringstream& theStr){
 }
 
 
-VISU::Vectors_i::~Vectors_i(){
+//---------------------------------------------------------------
+VISU::Vectors_i
+::~Vectors_i()
+{
   if(MYDEBUG) MESSAGE("Vectors_i::~Vectors_i()");
 }
 
 
-void VISU::Vectors_i::SetLineWidth(CORBA::Double theWidth) { 
+//---------------------------------------------------------------
+void
+VISU::Vectors_i
+::SetLineWidth(CORBA::Double theWidth) 
+{ 
   myLineWidth = theWidth;
 }
-CORBA::Double VISU::Vectors_i::GetLineWidth() { 
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::Vectors_i
+::GetLineWidth() 
+{ 
   return myLineWidth;
 }
 
 
-void VISU::Vectors_i::SetGlyphType(VISU::Vectors::GlyphType theType) { 
+//---------------------------------------------------------------
+void 
+VISU::Vectors_i
+::SetGlyphType(VISU::Vectors::GlyphType theType) 
+{ 
   myVectorsPL->SetGlyphType(VISU_VectorsPL::GlyphType(theType));
 }
-VISU::Vectors::GlyphType VISU::Vectors_i::GetGlyphType() { 
+
+//---------------------------------------------------------------
+VISU::Vectors::GlyphType 
+VISU::Vectors_i
+::GetGlyphType() 
+{ 
   return VISU::Vectors::GlyphType(myVectorsPL->GetGlyphType());
 }
 
 
-void VISU::Vectors_i::SetGlyphPos(VISU::Vectors::GlyphPos thePos) { 
+//---------------------------------------------------------------
+void
+VISU::Vectors_i
+::SetGlyphPos(VISU::Vectors::GlyphPos thePos) 
+{ 
   myVectorsPL->SetGlyphPos(VISU_VectorsPL::GlyphPos(thePos));
 }
-VISU::Vectors::GlyphPos VISU::Vectors_i::GetGlyphPos() { 
+
+//---------------------------------------------------------------
+VISU::Vectors::GlyphPos 
+VISU::Vectors_i::GetGlyphPos() 
+{ 
   return VISU::Vectors::GlyphPos(myVectorsPL->GetGlyphPos());
 }
 
 
-void VISU::Vectors_i::DoHook(){
-  if(!myPipeLine) myPipeLine = VISU_VectorsPL::New();
+//---------------------------------------------------------------
+void
+VISU::Vectors_i
+::CreatePipeLine()
+{
+  if(!myPipeLine) 
+    myPipeLine = VISU_VectorsPL::New();
   myVectorsPL = dynamic_cast<VISU_VectorsPL*>(myPipeLine);
 
-  DeformedShape_i::DoHook();
+  TSuperClass::CreatePipeLine();
 }
 
 
-VISU_PipeLine* VISU::Vectors_i::GetPipeLine(){
+//---------------------------------------------------------------
+VISU_PipeLine* 
+VISU::Vectors_i
+::GetPipeLine()
+{
   VISU_PipeLine* aPipeLine = VISU_VectorsPL::New();
   aPipeLine->SetIDMapper(myPipeLine->GetIDMapper());
   aPipeLine->ShallowCopy(myPipeLine);
@@ -187,7 +268,18 @@ VISU_PipeLine* VISU::Vectors_i::GetPipeLine(){
 }
 
 
-VISU_Actor* VISU::Vectors_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) 
+//---------------------------------------------------------------
+bool
+VISU::Vectors_i
+::CheckIsPossible() 
+{
+  return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+}
+
+//---------------------------------------------------------------
+VISU_Actor* 
+VISU::Vectors_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
 {
   VISU_VectorsAct* anActor = VISU_VectorsAct::New();
   try{
@@ -210,9 +302,13 @@ VISU_Actor* VISU::Vectors_i::CreateActor(const Handle(SALOME_InteractiveObject)&
 }
 
 
-void VISU::Vectors_i::UpdateActor(VISU_Actor* theActor) {
+//---------------------------------------------------------------
+void 
+VISU::Vectors_i
+::UpdateActor(VISU_Actor* theActor) 
+{
   if(VISU_VectorsAct* anActor = dynamic_cast<VISU_VectorsAct*>(theActor)){
-    VISU::DeformedShape_i::UpdateActor(anActor);
+    TSuperClass::UpdateActor(anActor);
     anActor->GetProperty()->SetLineWidth(GetLineWidth());
     if(VISU_VectorsPL* aVectorsPL = dynamic_cast<VISU_VectorsPL*>(anActor->GetPipeLine())){
       aVectorsPL->ShallowCopy(myPipeLine);
index 9177228d0792272e73a7ecdef1825e39d6a3b8be..901e6032fc61480f18fed914117f682b5b96275f 100644 (file)
@@ -31,7 +31,8 @@
 
 class VISU_VectorsPL;
 
-namespace VISU{
+namespace VISU
+{
   class Vectors_i : public virtual POA_VISU::Vectors,
                    public virtual DeformedShape_i
   {
@@ -48,49 +49,120 @@ namespace VISU{
     explicit
     Vectors_i(Result_i* theResult,
              SALOMEDS::SObject_ptr theSObject);
-    virtual void SameAs(const Prs3d_i* theOrigin);
-    virtual ~Vectors_i();
 
-    virtual VISU::VISUType GetType() { return VISU::TVECTORS;};
+    virtual
+    void
+    SameAs(const Prs3d_i* theOrigin);
+
+    virtual
+    ~Vectors_i();
+
+    virtual
+    VISU::VISUType 
+    GetType() 
+    { 
+      return VISU::TVECTORS;
+    }
+
+    virtual
+    void 
+    SetLineWidth(CORBA::Double theWidth);
+
+    virtual
+    CORBA::Double
+    GetLineWidth();
 
-    virtual void SetLineWidth(CORBA::Double theWidth);
-    virtual CORBA::Double GetLineWidth();
+    virtual 
+    void 
+    SetGlyphType(VISU::Vectors::GlyphType theType);
 
-    virtual void SetGlyphType(VISU::Vectors::GlyphType theType);
-    virtual VISU::Vectors::GlyphType GetGlyphType();
+    virtual
+    VISU::Vectors::GlyphType 
+    GetGlyphType();
+
+    virtual 
+    void 
+    SetGlyphPos(VISU::Vectors::GlyphPos thePos);
 
-    virtual void SetGlyphPos(VISU::Vectors::GlyphPos thePos);
-    virtual VISU::Vectors::GlyphPos GetGlyphPos();
+    virtual 
+    VISU::Vectors::GlyphPos 
+    GetGlyphPos();
 
     typedef VISU::Vectors TInterface;
-    VISU_VectorsPL* GetVectorsPL(){ return myVectorsPL;}
 
+    VISU_VectorsPL* 
+    GetSpecificPL() const
+    { 
+      return myVectorsPL; 
+    }
+    
   protected:
-    virtual void DoHook();
-    virtual VISU_PipeLine* GetPipeLine();
+    //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
+    virtual
+    void
+    CreatePipeLine();
+
+    //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
+    virtual 
+    bool 
+    CheckIsPossible();
+
+    virtual
+    VISU_PipeLine* 
+    GetPipeLine();
 
     VISU_VectorsPL *myVectorsPL;
     float myLineWidth;
 
   public:
-    static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
-                         const char* theFieldName, int theIteration, int isMemoryCheck = true);
-    virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity,
-                            const char* theFieldName, int theIteration);
+    //! Redefines VISU_ColoredPrs3d_i::IsPossible
+    static 
+    int IsPossible(Result_i* theResult, 
+                  const char* theMeshName, 
+                  VISU::Entity theEntity,
+                  const char* theFieldName, 
+                  int theTimeStampNumber, 
+                  int isMemoryCheck = true);
+
+    //! Redefines VISU_ColoredPrs3d_i::Create
+    virtual
+    Storable* 
+    Create(const char* theMeshName, 
+          VISU::Entity theEntity,
+          const char* theFieldName, 
+          int theTimeStampNumber);
 
-    virtual void ToStream(std::ostringstream& theStr);
+    //! Redefines VISU_ColoredPrs3d_i::ToStream
+    virtual
+    void
+    ToStream(std::ostringstream& theStr);
 
-    virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+    //! Redefines VISU_ColoredPrs3d_i::Restore
+    virtual
+    Storable* 
+    Restore(const Storable::TRestoringMap& theMap);
 
     static const std::string myComment;
-    virtual const char* GetComment() const;
-    virtual QString GenerateName();
 
+    //! Redefines VISU_ColoredPrs3d_i::GetComment
+    virtual
+    const char* 
+    GetComment() const;
+
+    //! Redefines VISU_ColoredPrs3d_i::GenerateName
+    virtual
+    QString
+    GenerateName();
+
+    //! Redefines VISU_ColoredPrs3d_i::CreateActor
     virtual
     VISU_Actor* 
     CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
 
-    virtual void UpdateActor(VISU_Actor* theActor) ;
+    //! Redefines VISU_ColoredPrs3d_i::UpdateActor
+    virtual
+    void
+    UpdateActor(VISU_Actor* theActor) ;
   };
 }
 
index abb6ad9b1da7a637298e46840812e009d8867c7c..df7bbd6f7004c2fd9dadede471e111151cd1db6a 100644 (file)
@@ -1557,18 +1557,18 @@ namespace VISU {
   {
     class TEvent: public SALOME_Event
     {
-      SUIT_ViewWindow* myVW;
+      SUIT_ViewWindow* myViewWindow;
     public:
       TEvent(SUIT_ViewWindow* theViewWindow):
-       myVW(theViewWindow)
+       myViewWindow(theViewWindow)
       {}
       virtual void Execute()
       {
-       SVTK_ViewWindow* vf = dynamic_cast<SVTK_ViewWindow*>(myVW);
-       vtkRenderer* Renderer = vf->getRenderer();
-       vtkActorCollection* theActors = Renderer->GetActors();
-       theActors->InitTraversal();
-       while (vtkActor *anAct = theActors->GetNextActor()) {
+       SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(myViewWindow);
+       vtkRenderer* aRenderer = aViewWindow->getRenderer();
+       vtkActorCollection* anActors = aRenderer->GetActors();
+       anActors->InitTraversal();
+       while (vtkActor *anAct = anActors->GetNextActor()) {
          if (VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anAct)) {
            VISU::Prs3d_i* aPrs3d  = anActor->GetPrs3d();
            if (anActor->GetVisibility() && aPrs3d) {
@@ -1577,13 +1577,12 @@ namespace VISU {
            }
          }
        }
-       RepaintView(myVW);
+       RepaintView(myViewWindow);
       }
     };
 
-    SUIT_ViewWindow* aVW = GetViewWindow();
-    if (aVW)
-      ProcessVoidEvent(new TEvent(aVW));
+    if (SUIT_ViewWindow* aViewWindow = GetViewWindow())
+      ProcessVoidEvent(new TEvent(aViewWindow));
   }
 
   bool View3D_i::SaveViewParams (SUIT_ViewManager* theViewManager, const char* theName)
diff --git a/src/VISU_SWIG/visu_change_input.py b/src/VISU_SWIG/visu_change_input.py
new file mode 100644 (file)
index 0000000..3cda8dd
--- /dev/null
@@ -0,0 +1,41 @@
+import os
+import time
+import VISU
+import SALOMEDS
+from batchmode_visu import *
+
+myViewManager = myVisu.GetViewManager();
+
+myView = myViewManager.Create3DView();
+myView.SetTitle("The window will be soon destroyed!")
+
+medFile = "TimeStamps.med"
+myFieldName = "vitesse";
+
+aMeshName ="dom"
+anEntity = VISU.NODE
+aTimeStampId = 1
+
+medFile = os.getenv('DATA_DIR') + '/MedFiles/' + medFile
+myResult = myVisu.ImportFile(medFile)
+
+aPrs3d = myVisu.IsoSurfacesOnField(myResult,aMeshName,anEntity,myFieldName,aTimeStampId)
+
+aPrs3d = myVisu.CreatePrs3d(VISU.TISOSURFACE,myVisu.GetCurrentStudy())
+aPrs3d.SetResultObject(myResult)
+aPrs3d.SetMeshName(aMeshName)
+aPrs3d.SetEntity(anEntity)
+aPrs3d.SetFieldName(myFieldName)
+aPrs3d.SetTimeStampNumber(aTimeStampId)
+print aPrs3d.Apply()
+
+myView.Display(aPrs3d);
+print "myView.Display(aPrs3d)"
+myView.FitAll()
+
+aDelay = 0.0
+for aTimeStampId in xrange(1,100):
+  aPrs3d.SetTimeStampNumber(aTimeStampId)
+  print aPrs3d.Apply()
+  myView.Update();
+  time.sleep(aDelay)