]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Clarify process of creation VISU pipelines
authorapo <apo@opencascade.com>
Tue, 31 Oct 2006 05:56:31 +0000 (05:56 +0000)
committerapo <apo@opencascade.com>
Tue, 31 Oct 2006 05:56:31 +0000 (05:56 +0000)
28 files changed:
src/VISUGUI/VisuGUI_ClippingDlg.cxx
src/VISUGUI/VisuGUI_CutLinesDlg.cxx
src/VISUGUI/VisuGUI_CutPlanesDlg.cxx
src/VISUGUI/VisuGUI_Plot3DDlg.cxx
src/VISUGUI/VisuGUI_Selection.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_GaussPoints_i.cc
src/VISU_I/VISU_GaussPoints_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_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_ScalarMapOnDeformedShape_i.cc
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh
src/VISU_I/VISU_StreamLines_i.cc
src/VISU_I/VISU_StreamLines_i.hh
src/VISU_I/VISU_Vectors_i.cc
src/VISU_I/VISU_Vectors_i.hh

index f0b526a0b23072c92594318f2a5f843ce3fb947e..d3cd143e96293c9c79907da782b013708bb52227 100644 (file)
@@ -518,7 +518,7 @@ void VisuGUI_ClippingDlg::ClickOnApply()
 
     // Check contents of the resulting (clipped) presentation data
     if (!isFailed) {
-      VISU_PipeLine* aPL = myPrs3d->GetPL();
+      VISU_PipeLine* aPL = myPrs3d->GetPipeLine();
       VISU_PipeLine::TMapper* aM = aPL->GetMapper();
       vtkDataSet* aPrsData = aM->GetInput();
       aPrsData->Update();
index 96d8cddf6aa984bbbb86439ff55a1e9778d7cfa2..4ff285f3361f8a49190a768624af90dc40bf66c1 100644 (file)
@@ -354,7 +354,7 @@ void VisuGUI_CutLinesDlg::createPlanes()
   if (myPreviewActor != 0) return;
 
   storeToPrsObject(myCutLines);
-  myCutLines->GetPL()->Update();
+  myCutLines->GetPipeLine()->Update();
   vtkAppendPolyData* aPolyData = myCutLines->GetSpecificPL()->GetAppendPolyData();
   vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New();
   aPlaneMapper->SetInput(aPolyData->GetOutput());
@@ -455,7 +455,7 @@ void VisuGUI_CutLinesDlg::onCutSelect (int theId, bool theUpdate)
                                   myRotXSpn2->value()*PI/180.,
                                   myRotYSpn2->value()*PI/180.);
                                  myCutLines->SetDisplacement2(myPosSpn2->value());*/
-      //myCutLines->GetPL()->Update();
+      //myCutLines->GetPipeLine()->Update();
       deletePlanes();
       createPlanes();
       //aView->Repaint();
@@ -481,7 +481,7 @@ void VisuGUI_CutLinesDlg::setBaseDefault (bool theUpdate)
     if (aView) {
       if (theUpdate && myPreviewCheck->isChecked() && (myCutLines != NULL)) {
         //myCutLines->SetBasePlanePosition(aPos);
-       //        myCutLines->GetPL()->Update();
+       //        myCutLines->GetPipeLine()->Update();
         deletePlanes();
         createPlanes();
         //aView->Repaint();
@@ -552,7 +552,7 @@ void VisuGUI_CutLinesDlg::DrawTable()
   SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
   if (aView) {
     if (myPreviewCheck->isChecked()) {
-      //      myCutLines->GetPL()->Update();
+      //      myCutLines->GetPipeLine()->Update();
       deletePlanes();
       createPlanes();
       //aView->Repaint();
@@ -722,7 +722,7 @@ void VisuGUI_CutLinesDlg::onValueChanged (int theRow, int theCol)
       if (myPreviewCheck->isChecked()) {
        //Update Preview
        //myCutLines->SetLinePosition( theRow, aTxt.toDouble());
-       //      myCutLines->GetPL()->Update();
+       //      myCutLines->GetPipeLine()->Update();
        deletePlanes();
        createPlanes();
        //aView->Repaint();
@@ -737,7 +737,7 @@ void VisuGUI_CutLinesDlg::onValueChanged (int theRow, int theCol)
       if (aView) {
        if (myPreviewCheck->isChecked()) {
          //Update Preview
-         //      myCutLines->GetPL()->Update();
+         //      myCutLines->GetPipeLine()->Update();
          deletePlanes();
          createPlanes();
          //aView->Repaint();
@@ -856,7 +856,7 @@ void VisuGUI_CutLinesDlg::onPreviewCheck (bool thePreview)
   if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
     if (thePreview) {
       //storeToPrsObject(myCutLines);
-      //      myCutLines->GetPL()->Update();
+      //      myCutLines->GetPipeLine()->Update();
       createPlanes();
       //vf->onFitAll();
     } else {
@@ -894,7 +894,7 @@ void VisuGUI_CutLinesDlg::onRotation (double theValue)
       myCutLines->SetOrientation2(getOrientaion(false),
                                   myRotXSpn2->value()*PI/180.,
                                   myRotYSpn2->value()*PI/180.);*/
-      //      myCutLines->GetPL()->Update();
+      //      myCutLines->GetPipeLine()->Update();
       deletePlanes();
       createPlanes();
       //aView->Repaint();
@@ -909,7 +909,7 @@ void VisuGUI_CutLinesDlg::onPlanePos (const QString& theValue)
   if (aView) {
     if (myPreviewCheck->isChecked()) {
       //myCutLines->SetBasePlanePosition(theValue.toDouble());
-      //      myCutLines->GetPL()->Update();
+      //      myCutLines->GetPipeLine()->Update();
       deletePlanes();
       createPlanes();
       //aView->Repaint();
index aadb2de3ec9de9a94bc4ee463b92d377f2d767b1..c7c9f1909d845ce0a7b73ddd0e2bf1cc62b850c5 100644 (file)
@@ -353,7 +353,7 @@ void VisuGUI_CutPlanesPane::DrawTable()
   // Update preview
   if (myPreviewCheck->isChecked()) {
     if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
-      myCutPlanes->GetPL()->Update();
+      myCutPlanes->GetPipeLine()->Update();
       deletePlanes();
       createPlanes();
       vf->Repaint();
@@ -391,7 +391,7 @@ void VisuGUI_CutPlanesPane::onValueChanged (int theRow, int theCol)
       //Update Preview
       if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
        myCutPlanes->SetPlanePosition( theRow, aTxt.toDouble());
-       myCutPlanes->GetPL()->Update();
+       myCutPlanes->GetPipeLine()->Update();
        deletePlanes();
        createPlanes();
        vf->Repaint();
@@ -406,7 +406,7 @@ void VisuGUI_CutPlanesPane::onValueChanged (int theRow, int theCol)
       if (myPreviewCheck->isChecked()) {
        if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
          //Update Preview
-         myCutPlanes->GetPL()->Update();
+         myCutPlanes->GetPipeLine()->Update();
          deletePlanes();
          createPlanes();
          vf->Repaint();
@@ -438,7 +438,7 @@ void VisuGUI_CutPlanesPane::onRotation (double theValue)
   if (myPreviewCheck->isChecked()) {
     if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
       myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*PI/180.,getRotation2()*PI/180.);
-      myCutPlanes->GetPL()->Update();
+      myCutPlanes->GetPipeLine()->Update();
       deletePlanes();
       createPlanes();
       vf->Repaint();
@@ -451,7 +451,7 @@ void VisuGUI_CutPlanesPane::onPreviewCheck (bool thePreview)
   if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
     if (thePreview) {
       storeToPrsObject(myCutPlanes);
-      myCutPlanes->GetPL()->Update();
+      myCutPlanes->GetPipeLine()->Update();
       createPlanes();
       vf->onFitAll();
     } else {
index b49e8a54cbd9a4bd9c522b15df830d0ab3e34635..a46e9730a81352ed8daea36e62fb07616bf9736c 100644 (file)
@@ -260,8 +260,8 @@ void VisuGUI_Plot3DPane::storePrsParams()
   if (!myPipeCopy)
     myPipeCopy = VISU_Plot3DPL::New();
   if (myPrs) {
-    myPipeCopy->SetIDMapper(myPrs->GetPL()->GetIDMapper());
-    myPipeCopy->ShallowCopy(myPrs->GetPL());
+    myPipeCopy->SetIDMapper(myPrs->GetPipeLine()->GetIDMapper());
+    myPipeCopy->ShallowCopy(myPrs->GetPipeLine());
     storeToPrsObject(myPrs);
   }
 }
@@ -275,7 +275,7 @@ void VisuGUI_Plot3DPane::restorePrsParams()
   if (!myPipeCopy)
     myPipeCopy = VISU_Plot3DPL::New();
   if (myPrs)
-    myPrs->GetPL()->ShallowCopy(myPipeCopy);
+    myPrs->GetPipeLine()->ShallowCopy(myPipeCopy);
 }
 
 //=======================================================================
@@ -439,7 +439,7 @@ void VisuGUI_Plot3DPane::initFromPrsObject(VISU::Plot3D_i* thePrs)
 
   // disable cutting plane controls if the mesh is planar
 
-  if (thePrs->GetPL()->IsPlanarInput())
+  if (thePrs->GetPipeLine()->IsPlanarInput())
   {
     GBOrientation->setEnabled(false);
     Rot1         ->setEnabled(false);
index 6ddd429f89265398c21e28e0acaa80bfddba71f6..140e0edd650ba6eef56b561d11abcc5b605b8489 100644 (file)
@@ -575,7 +575,7 @@ bool onIdEdit (const QString& theText,
 
   if (aPrs3d) {
     int anId = theText.toInt();
-    vtkDataSet* aDataSet = aPrs3d->GetPL()->GetMapper()->GetInput();
+    vtkDataSet* aDataSet = aPrs3d->GetPipeLine()->GetMapper()->GetInput();
     int aMaxId = (aDataSet->*theMethod)();
     if (anId < 0) anId = 0;
     if (anId >= aMaxId) anId = aMaxId - 1;
index f496f886af4557bcf9f03abb2aff0b21d7da6d8f..e233854f92664f153b5d2b1907e18c2cf9910b9f 100644 (file)
@@ -119,9 +119,9 @@ bool
 VISU::ColoredPrs3d_i
 ::OnSetInput()
 {
-  bool anIsNotCreated = GetPL() == NULL;
+  bool anIsNotCreated = !IsPipeLineExists();
   if(anIsNotCreated)
-    CreatePipeLine(); // to create proper pipeline
+    CreatePipeLine(NULL); // to create proper pipeline
 
   DoSetInput();
 
@@ -771,14 +771,16 @@ VISU::ColoredPrs3d_i
 //----------------------------------------------------------------------------
 void
 VISU::ColoredPrs3d_i
-::CreatePipeLine()
+::CreatePipeLine(VISU_PipeLine* thePipeLine)
 {
-  if(MYDEBUG) MESSAGE("ColoredPrs3d_i::CreatePipeLine() - "<<myPipeLine);
-  if(!myPipeLine){
-    myPipeLine = VISU_ScalarMapPL::New();
-    myPipeLine->GetMapper()->SetScalarVisibility(1);
-  }
-  myScalarMapPL = dynamic_cast<VISU_ScalarMapPL*>(myPipeLine);
+  if(MYDEBUG) MESSAGE("ColoredPrs3d_i::CreatePipeLine() - "<<thePipeLine);
+  if(!thePipeLine){
+    myScalarMapPL = VISU_ScalarMapPL::New();
+    myScalarMapPL->GetMapper()->SetScalarVisibility(1);
+  }else
+    myScalarMapPL = dynamic_cast<VISU_ScalarMapPL*>(thePipeLine);
+
+  SetPipeLine(myScalarMapPL);
 }
 
 //----------------------------------------------------------------------------
index de90837077fe85f031c83f224726c2a58dc7a5ad..6f03e81ed7aeb3ed117e4ffa5662747e8b1e8012 100644 (file)
@@ -325,7 +325,7 @@ namespace VISU
     */
     virtual
     void 
-    CreatePipeLine();
+    CreatePipeLine(VISU_PipeLine* thePipeLine);
 
     /*!
       First checks whether corresponding VTK pipeline exists and create it if not. 
index 8af03cfbe419ad85eb47e86afc3f62de6d1b6f3b..2b8bbd22a45c335382bb4e71d420f1a2ccd7749b 100644 (file)
@@ -462,13 +462,14 @@ VISU::CutLines_i
 //---------------------------------------------------------------
 void
 VISU::CutLines_i
-::CreatePipeLine()
+::CreatePipeLine(VISU_PipeLine* thePipeLine)
 {
-  if(!myPipeLine) 
-    myPipeLine = VISU_CutLinesPL::New();
-  myCutLinesPL = dynamic_cast<VISU_CutLinesPL*>(myPipeLine);
+  if(!thePipeLine){
+    myCutLinesPL = VISU_CutLinesPL::New();
+  }else
+    myCutLinesPL = dynamic_cast<VISU_CutLinesPL*>(thePipeLine);
 
-  TSuperClass::CreatePipeLine();
+  TSuperClass::CreatePipeLine(myCutLinesPL);
 }
 
 
index 9ccf70820df45312b0ee6186b00525451c06fc12..7bf3291ae0ad3b8c3f31d0c1efbb78743e9a701a 100644 (file)
@@ -191,7 +191,7 @@ namespace VISU
     //! Extends VISU_ColoredPrs3d_i::CreatePipeLine
     virtual 
     void
-    CreatePipeLine();
+    CreatePipeLine(VISU_PipeLine* thePipeLine);
 
     //! Extends VISU_ColoredPrs3d_i::CheckIsPossible
     virtual 
index cfcc4ce42740754adb3fd42bbb1dd96b1bea6a0a..70d0fc179848e05d173c1624ad8b1c386051296a 100644 (file)
@@ -270,13 +270,14 @@ VISU::CutPlanes_i
 //----------------------------------------------------------------------------
 void 
 VISU::CutPlanes_i
-::CreatePipeLine()
+::CreatePipeLine(VISU_PipeLine* thePipeLine)
 {
-  if(!myPipeLine) 
-    myPipeLine = VISU_CutPlanesPL::New();
-  myCutPlanesPL = dynamic_cast<VISU_CutPlanesPL*>(myPipeLine);
+  if(!thePipeLine){ 
+    myCutPlanesPL = VISU_CutPlanesPL::New();
+  }else
+    myCutPlanesPL = dynamic_cast<VISU_CutPlanesPL*>(thePipeLine);
 
-  TSuperClass::CreatePipeLine();
+  TSuperClass::CreatePipeLine(myCutPlanesPL);
 }
 
 
index 006c8c7ee66722c6305982a19680dabbdb92e0a9..6ce30b042ec5ccde7bfbe32003aa735d38e39882 100644 (file)
@@ -121,7 +121,7 @@ namespace VISU
     //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
     virtual
     void
-    CreatePipeLine();
+    CreatePipeLine(VISU_PipeLine* thePipeLine);
 
     //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
     virtual 
index 63ccef520124be48e56f831de544b81c0cc49c51..0776e8d77c1c71f17b029dac9dbbe947fb4f5725 100644 (file)
@@ -254,14 +254,16 @@ VISU::DeformedShape_i
 //---------------------------------------------------------------
 void
 VISU::DeformedShape_i
-::CreatePipeLine()
+::CreatePipeLine(VISU_PipeLine* thePipeLine)
 {
-  if(!myPipeLine) 
-    myPipeLine = VISU_DeformedShapePL::New();
-  myDeformedShapePL = dynamic_cast<VISU_DeformedShapePL*>(myPipeLine);
-  myPipeLine->GetMapper()->SetScalarVisibility(IsColored());
+  if(!thePipeLine){
+    myDeformedShapePL = VISU_DeformedShapePL::New();
+  }else
+    myDeformedShapePL = dynamic_cast<VISU_DeformedShapePL*>(thePipeLine);
 
-  TSuperClass::CreatePipeLine();
+  myDeformedShapePL->GetMapper()->SetScalarVisibility(IsColored());
+
+  TSuperClass::CreatePipeLine(myDeformedShapePL);
 }
 
 
@@ -318,10 +320,10 @@ VISU::DeformedShape_i
   if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
     if(IsColored()){
       anActor->SetBarVisibility(true);
-      myPipeLine->GetMapper()->SetScalarVisibility(1);
+      GetPipeLine()->GetMapper()->SetScalarVisibility(1);
     }else{
       anActor->SetBarVisibility(false);
-      myPipeLine->GetMapper()->SetScalarVisibility(0);
+      GetPipeLine()->GetMapper()->SetScalarVisibility(0);
       anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
     }
     TSuperClass::UpdateActor(theActor);
index 902e5cbf8093cb288668eff088909b83cb567b14..3e768bcd12cf4bd9d0b752bc8c3123bfd2b0458e 100644 (file)
@@ -99,7 +99,7 @@ namespace VISU
     //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
     virtual 
     void
-    CreatePipeLine();
+    CreatePipeLine(VISU_PipeLine* thePipeLine);
 
     //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
     virtual 
index 5f66133fbde2fbebb97bd676c6c64c195ae810c9..8765c43a52c960f61c5103ef1bb0f01c46accdbc 100644 (file)
@@ -540,27 +540,27 @@ VISU::GaussPoints_i
 //----------------------------------------------------------------------------
 void
 VISU::GaussPoints_i
-::CreatePipeLine()
+::CreatePipeLine(VISU_PipeLine* thePipeLine)
 {
-  if(!myPipeLine) 
-    myPipeLine = VISU_GaussPointsPL::New();
+  if(!thePipeLine){
+    myGaussPointsPL = VISU_GaussPointsPL::New();
+  }else
+    myGaussPointsPL = dynamic_cast<VISU_GaussPointsPL*>(thePipeLine);
 
-  myGaussPointsPL = dynamic_cast<VISU_GaussPointsPL*>(myPipeLine);
-
-  TSuperClass::CreatePipeLine();
+  TSuperClass::CreatePipeLine(myGaussPointsPL);
 }
 
 
 //----------------------------------------------------------------------------
 VISU_PipeLine* 
 VISU::GaussPoints_i
-::GetPipeLine()
+::GetPL()
 {
   // We create a new PipeLine instance in order to provide
   //   different representations for different actors (basic and segmented)
   VISU_GaussPointsPL* aPipeLine = VISU_GaussPointsPL::New();
   aPipeLine->SetGaussPtsIDMapper(myGaussPointsPL->GetGaussPtsIDMapper());
-  aPipeLine->ShallowCopy(myPipeLine);
+  aPipeLine->ShallowCopy(GetPipeLine());
   aPipeLine->Update();
   return aPipeLine;
 }
@@ -635,7 +635,7 @@ VISU::GaussPoints_i
   theScalarBar->SetOrientation(myOrientation);
   theScalarBar->SetNumberOfLabels(myNumberOfLabels);
 
-  vtkLookupTable* aLookupTable = myScalarMapPL->GetBarTable();
+  vtkLookupTable* aLookupTable = GetSpecificPL()->GetBarTable();
   
   theLookupTable->SetNumberOfColors(aLookupTable->GetNumberOfColors());
   theScalarBar->SetMaximumNumberOfColors(aLookupTable->GetNumberOfColors());
@@ -667,10 +667,10 @@ VISU::GaussPoints_i
     VISU_ScalarBarCtrl *aScalarBarCtrl = anActor->GetScalarBarCtrl();
     if(GetIsColored()){
       anActor->SetBarVisibility(true);
-      myPipeLine->GetMapper()->SetScalarVisibility(1);
+      GetPipeLine()->GetMapper()->SetScalarVisibility(1);
 
       vtkFloatingPointType aRange[2];
-      myScalarMapPL->GetSourceRange(aRange);
+      GetSpecificPL()->GetSourceRange(aRange);
       aScalarBarCtrl->SetRangeLocal(aRange);
       
       TMinMax aTMinMax(-VTK_LARGE_FLOAT,VTK_LARGE_FLOAT);
@@ -721,7 +721,7 @@ VISU::GaussPoints_i
     }else{
       anActor->SetBarVisibility(false);
 
-      myPipeLine->GetMapper()->SetScalarVisibility(0);
+      GetPipeLine()->GetMapper()->SetScalarVisibility(0);
 
       anActor->GetProperty()->SetColor(myColor.red() / 255.0,
                                       myColor.green() / 255.0,
index 06da42273043355dbb2efe7337c71bdeba984376..8e8a9bcf748f2b79120b076f1a11bf2c53af7d6e 100644 (file)
@@ -257,7 +257,7 @@ namespace VISU
     //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
     virtual
     void
-    CreatePipeLine();
+    CreatePipeLine(VISU_PipeLine* thePipeLine);
 
     //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
     virtual 
@@ -266,7 +266,7 @@ namespace VISU
 
     virtual 
     VISU_PipeLine* 
-    GetPipeLine();
+    GetPL();
     
     bool
     OnCreateActor(VISU_GaussPtsAct* theActor,
index b165af57d882d52b25c36144799c77d47b8990cc..18994dfc5189eb9e47234763696eb3cb8f83e5d7 100644 (file)
@@ -195,13 +195,14 @@ VISU::IsoSurfaces_i
 //---------------------------------------------------------------
 void 
 VISU::IsoSurfaces_i
-::CreatePipeLine()
+::CreatePipeLine(VISU_PipeLine* thePipeLine)
 {
-  if(MYDEBUG) MESSAGE("IsoSurfaces_i::DoHook()- "<<myPipeLine);
-  if(!myPipeLine) myPipeLine = VISU_IsoSurfacesPL::New();
-  myIsoSurfacesPL = dynamic_cast<VISU_IsoSurfacesPL*>(myPipeLine);
+  if(!thePipeLine){
+    myIsoSurfacesPL = VISU_IsoSurfacesPL::New();
+  }else
+    myIsoSurfacesPL = dynamic_cast<VISU_IsoSurfacesPL*>(thePipeLine);
 
-  TSuperClass::CreatePipeLine();
+  TSuperClass::CreatePipeLine(myIsoSurfacesPL);
 }
 
 
index bcbb8662fe11a4a52014f1bd96bd71dfc81c316e..961953650bbe7f0c2f66d1537b382ec4fdfb32e7 100644 (file)
@@ -91,7 +91,7 @@ namespace VISU
     //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
     virtual 
     void 
-    CreatePipeLine();
+    CreatePipeLine(VISU_PipeLine* thePipeLine);
 
     //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
     virtual 
index a848763f715665c5122dbc5a091fd190ad216a49..dfc8499cc070c5bdd407fab53d6b3dba50ff1b30 100644 (file)
@@ -62,7 +62,7 @@ Mesh_i(Result_i* theResult) :
   Prs3d_i(theResult,false),
   myMeshPL(VISU_MeshPL::New())
 {
-  myPipeLine = myMeshPL;
+  SetPipeLine(myMeshPL);
 }
 
 
@@ -73,7 +73,7 @@ Mesh_i(Result_i* theResult,
   Prs3d_i(theResult,theSObject),
   myMeshPL(VISU_MeshPL::New())
 {
-  myPipeLine = myMeshPL;
+  SetPipeLine(myMeshPL);
 }
 
 
index 7484a71047ec974954d1d36c44c4019e0672734a..238d47d5f340c4deb0b6cb7236b3a0d532d87d06 100644 (file)
@@ -279,13 +279,14 @@ VISU::Plot3D_i
 //---------------------------------------------------------------
 void
 VISU::Plot3D_i
-::CreatePipeLine()
+::CreatePipeLine(VISU_PipeLine* thePipeLine)
 {
-  if (!myPipeLine) 
-    myPipeLine = VISU_Plot3DPL::New();
-  myPlot3DPL = dynamic_cast<VISU_Plot3DPL*>(myPipeLine);
+  if(!thePipeLine){
+    myPlot3DPL = VISU_Plot3DPL::New();
+  }else
+    myPlot3DPL = dynamic_cast<VISU_Plot3DPL*>(thePipeLine);
 
-  TSuperClass::CreatePipeLine();
+  TSuperClass::CreatePipeLine(myPlot3DPL);
 }
 
 
index 8a1ce19e8b142dac9bb0578d3cbf54f2078d7a8a..cf64efe8da1cec5ab315b42443e6de38a4a97884 100644 (file)
@@ -120,7 +120,7 @@ namespace VISU
     //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
     virtual 
     void 
-    CreatePipeLine();
+    CreatePipeLine(VISU_PipeLine* thePipeLine);
 
     //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
     virtual 
index 244f289cc5b32b55e441517eba730143b339b083..cc4cc6b05f18d32f57f0ab5e5e95c1566508a393 100644 (file)
@@ -96,7 +96,7 @@ VISU::Prs3d_i
 ::SameAs(const Prs3d_i* theOrigin)
 {
   if(Prs3d_i* anOrigin = const_cast<Prs3d_i*>(theOrigin)){
-    myPipeLine->SameAs(anOrigin->GetPL());
+    GetPipeLine()->SameAs(anOrigin->GetPipeLine());
     anOrigin->GetOffset(myOffset);
   }
 }
@@ -108,7 +108,8 @@ VISU::Prs3d_i
 {
   if(MYDEBUG) MESSAGE("Prs3d_i::~Prs3d_i - this = "<<this);
   myRemoveActorsFromRendererSignal();
-  myPipeLine->Delete();
+  if(IsPipeLineExists())
+    GetPipeLine()->Delete();
   if(myResult)
     myResult->Destroy();
 }
@@ -190,8 +191,8 @@ VISU::Prs3d_i
 ::GetMTime()
 {
   unsigned long int aTime = myParamsTime.GetMTime();
-  if(myPipeLine)
-    aTime = std::max(aTime,myPipeLine->GetMTime());
+  if(IsPipeLineExists())
+    aTime = std::max(aTime,GetPipeLine()->GetMTime());
   return aTime;
 }
 
@@ -250,10 +251,8 @@ VISU::Prs3d_i
   if(MYDEBUG) MESSAGE("Prs3d_i::Update - this = "<<this);
 
   try{
-    if(myPipeLine){
-      myPipeLine->Update();
-      myUpdateTime.Modified();
-    }
+    GetPipeLine()->Update();
+    myUpdateTime.Modified();
   } catch(std::exception&){
     throw;
   }catch(...){
@@ -270,7 +269,7 @@ VISU::Prs3d_i
   if(GetMTime() < myUpdateTime.GetMTime())
     return;
 
-  vtkMapper *aMapper = myPipeLine->GetMapper();
+  vtkMapper *aMapper = GetPipeLine()->GetMapper();
   vtkDataSet *aDataSet = aMapper->GetInput();
   if (!aDataSet)
     throw std::runtime_error("There is no input data !!!");
@@ -317,23 +316,39 @@ VISU::Prs3d_i
 //----------------------------------------------------------------------------
 VISU_PipeLine* 
 VISU::Prs3d_i
-::GetPipeLine()
+::GetPipeLine() const
 {
-  return GetPL();
+  if(!myPipeLine)
+    throw std::runtime_error("VISU::Prs3d_i::myPipeLine == NULL !!!");
+
+  return myPipeLine;
 }
 
+void
+VISU::Prs3d_i
+::SetPipeLine(VISU_PipeLine* thePipeLine)
+{
+  myPipeLine = thePipeLine;
+}
+
+bool 
+VISU::Prs3d_i
+::IsPipeLineExists()
+{
+  return myPipeLine != NULL;
+}
 VISU_PipeLine* 
 VISU::Prs3d_i
 ::GetPL()
 {
-  return myPipeLine;
+  return GetPipeLine();
 }
 
 vtkUnstructuredGrid* 
 VISU::Prs3d_i::
 GetInput()
 {
-  return myPipeLine->GetInput();
+  return GetPipeLine()->GetInput();
 }
 
 
@@ -399,7 +414,7 @@ VISU::Prs3d_i
 
   if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActor - this = "<<this<<"; theActor = "<<theActor);
 
-  theActor->ShallowCopyPL(myPipeLine);
+  theActor->ShallowCopyPL(GetPipeLine());
   theActor->SetPosition(myOffset[0],myOffset[1],myOffset[2]);
   theActor->Modified();
 }
@@ -421,28 +436,28 @@ void
 VISU::Prs3d_i
 ::RemoveAllClippingPlanes()
 {
-  myPipeLine->RemoveAllClippingPlanes();
+  GetPipeLine()->RemoveAllClippingPlanes();
 }
 
 bool
 VISU::Prs3d_i
 ::AddClippingPlane(vtkPlane* thePlane)
 {
-  return myPipeLine->AddClippingPlane(thePlane);
+  return GetPipeLine()->AddClippingPlane(thePlane);
 }
 
 vtkIdType
 VISU::Prs3d_i
 ::GetNumberOfClippingPlanes() const
 {
-  return myPipeLine->GetNumberOfClippingPlanes();
+  return GetPipeLine()->GetNumberOfClippingPlanes();
 }
 
 vtkPlane* 
 VISU::Prs3d_i::
 GetClippingPlane(vtkIdType theID) const
 {
-  return myPipeLine->GetClippingPlane(theID);
+  return GetPipeLine()->GetClippingPlane(theID);
 }
 
 void
@@ -451,7 +466,7 @@ VISU::Prs3d_i
                vtkFloatingPointType theDist, 
                vtkPlane* thePlane) 
 {
-  myPipeLine->SetPlaneParam(theDir, theDist, thePlane);
+  GetPipeLine()->SetPlaneParam(theDir, theDist, thePlane);
 }
 
 
@@ -460,7 +475,7 @@ void
 VISU::Prs3d_i
 ::GetBounds(vtkFloatingPointType aBounds[6])
 {
-  myPipeLine->GetMapper()->GetBounds(aBounds);
+  GetPipeLine()->GetMapper()->GetBounds(aBounds);
 }
 
 void 
index 90ccc0ee92e39184e55b6564e073fd36617637a2..c9c29049601b777afe7e728ce65ff462b4894f64 100644 (file)
@@ -158,7 +158,10 @@ namespace VISU
     //----------------------------------------------------------------------------
     //! Get corresponding VISU_PipeLine
     VISU_PipeLine* 
-    GetPL();
+    GetPipeLine() const;
+
+    bool
+    IsPipeLineExists();
 
     //! Get input of the VISU_PipeLine
     vtkUnstructuredGrid* 
@@ -242,13 +245,16 @@ namespace VISU
     bool 
     SetInput();
 
+    void
+    SetPipeLine(VISU_PipeLine* thePipeLine);
+
     void
     CreateActor(VISU_Actor* theActor, 
                const Handle(SALOME_InteractiveObject)& theIO = NULL);
 
     virtual 
     VISU_PipeLine* 
-    GetPipeLine();
+    GetPL();
 
     //! To check dataset validity, throws std::exception if not valid
     virtual
@@ -264,14 +270,15 @@ namespace VISU
     CORBA::Float myOffset[3];
     vtkTimeStamp myParamsTime;
 
-    VISU_PipeLine *myPipeLine;
-
     SALOMEDS::SObject_var mySObject;
     bool myAddToStudy;
 
     boost::signal0<void> myUpdateActorsSignal;
     boost::signal0<void> myRemoveActorsFromRendererSignal;
     vtkSmartPointer<vtkActorCollection> myActorCollection;
+
+  private:
+    VISU_PipeLine *myPipeLine;
   };
 
   //----------------------------------------------------------------------------
index 577045277beab0cc8eab563080e2a4ea4a8c8ea3..c5da5978422362080da8f280dc784fcef103a3fb 100644 (file)
@@ -326,16 +326,16 @@ VISU::ScalarMapOnDeformedShape_i
 //---------------------------------------------------------------
 void
 VISU::ScalarMapOnDeformedShape_i
-::CreatePipeLine()
+::CreatePipeLine(VISU_PipeLine* thePipeLine)
 {
-  if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::DoHook:"<<__LINE__<<endl;
-  if(!myPipeLine)
-    myPipeLine = VISU_ScalarMapOnDeformedShapePL::New();
-  
-  myScalarMapOnDeformedShapePL = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(myPipeLine);
-  myPipeLine->GetMapper()->SetScalarVisibility(IsColored());
+  if(!thePipeLine){
+    myScalarMapOnDeformedShapePL = VISU_ScalarMapOnDeformedShapePL::New();
+  }else
+    myScalarMapOnDeformedShapePL = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(thePipeLine);
+
+  myScalarMapOnDeformedShapePL->GetMapper()->SetScalarVisibility(IsColored());
 
-  TSuperClass::CreatePipeLine();
+  TSuperClass::CreatePipeLine(myScalarMapOnDeformedShapePL);
 }
 
 
@@ -373,10 +373,10 @@ VISU::ScalarMapOnDeformedShape_i
   if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
     if(IsColored()){
       anActor->SetBarVisibility(true);
-      myPipeLine->GetMapper()->SetScalarVisibility(1);
+      GetPipeLine()->GetMapper()->SetScalarVisibility(1);
     }else{
       anActor->SetBarVisibility(false);
-      myPipeLine->GetMapper()->SetScalarVisibility(0);
+      GetPipeLine()->GetMapper()->SetScalarVisibility(0);
       anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
     }
     TSuperClass::UpdateActor(theActor);
index 9409a49faa4b3e299c1443c01209e83f4d950c13..d3fa40c1055360c30a2c71bee5db141fb922a7b8 100644 (file)
@@ -116,7 +116,7 @@ namespace VISU
     //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
     virtual
     void
-    CreatePipeLine();
+    CreatePipeLine(VISU_PipeLine* thePipeLine);
 
     //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
     virtual 
index 90a2a527d337a50a51fbc4bcc054435140cab1fd..9ca45dafcc3a14207d3aa139537d090b4c940ad6 100644 (file)
@@ -212,13 +212,13 @@ VISU::StreamLines_i
            CORBA::Double thePercents,
            VISU::StreamLines::Direction theDirection) 
 { 
-  VISU::Prs3d_i* aPrs3di = NULL;
+  VISU::Prs3d_i* aPrs3d = NULL;
   vtkPointSet* aSource = NULL;
   if(!thePrs3d->_is_nil())
-    if((aPrs3di = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(thePrs3d).in()))){
+    if((aPrs3d = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(thePrs3d).in()))){
       for(int i = myAppendFilter->GetNumberOfInputs()-1; i >= 0; i--)
        myAppendFilter->RemoveInput(myAppendFilter->GetInput(i));
-      myAppendFilter->AddInput(aPrs3di->GetPL()->GetMapper()->GetInput());
+      myAppendFilter->AddInput(aPrs3d->GetPipeLine()->GetMapper()->GetInput());
       aSource = myAppendFilter->GetOutput();
     }
   int anIsAccepted = myStreamLinesPL->SetParams(theIntStep,
@@ -229,7 +229,7 @@ VISU::StreamLines_i
                                                theDirection,
                                                1);
   if(anIsAccepted == 1) 
-    SetSource(aPrs3di);
+    SetSource(aPrs3d);
   return anIsAccepted == 1;
 }
 
@@ -338,13 +338,14 @@ VISU::StreamLines_i
 //---------------------------------------------------------------
 void 
 VISU::StreamLines_i
-::CreatePipeLine()
+::CreatePipeLine(VISU_PipeLine* thePipeLine)
 {
-  if(!myPipeLine) 
-    myPipeLine = VISU_StreamLinesPL::New();
-  myStreamLinesPL = dynamic_cast<VISU_StreamLinesPL*>(myPipeLine);
+  if(!thePipeLine){
+    myStreamLinesPL = VISU_StreamLinesPL::New();
+  }else
+    myStreamLinesPL = dynamic_cast<VISU_StreamLinesPL*>(thePipeLine);
 
-  TSuperClass::CreatePipeLine();
+  TSuperClass::CreatePipeLine(myStreamLinesPL);
 }
 
 
index db99dd996102c182e7f0c2ec2e815d5c78efdcbd..0329f3a43ae7da3e131da2d211364dfa79acab33 100644 (file)
@@ -109,7 +109,7 @@ namespace VISU
     //! Extends VISU_ColoredPrs3d_i::CreatePipeLine
     virtual 
     void
-    CreatePipeLine();
+    CreatePipeLine(VISU_PipeLine* thePipeLine);
 
     //! Extends VISU_ColoredPrs3d_i::CheckIsPossible
     virtual 
index 156fac2c09786e2d755bc119b72ee326fa1d091e..fa7f6c9960cbe2bf82c7ed8feef9c8e92255597c 100644 (file)
@@ -247,24 +247,25 @@ VISU::Vectors_i::GetGlyphPos()
 //---------------------------------------------------------------
 void
 VISU::Vectors_i
-::CreatePipeLine()
+::CreatePipeLine(VISU_PipeLine* thePipeLine)
 {
-  if(!myPipeLine) 
-    myPipeLine = VISU_VectorsPL::New();
-  myVectorsPL = dynamic_cast<VISU_VectorsPL*>(myPipeLine);
+  if(!thePipeLine){
+    myVectorsPL = VISU_VectorsPL::New();
+  }else
+    myVectorsPL = dynamic_cast<VISU_VectorsPL*>(thePipeLine);
 
-  TSuperClass::CreatePipeLine();
+  TSuperClass::CreatePipeLine(myVectorsPL);
 }
 
 
 //---------------------------------------------------------------
 VISU_PipeLine* 
 VISU::Vectors_i
-::GetPipeLine()
+::GetPL()
 {
   VISU_PipeLine* aPipeLine = VISU_VectorsPL::New();
-  aPipeLine->SetIDMapper(myPipeLine->GetIDMapper());
-  aPipeLine->ShallowCopy(myPipeLine);
+  aPipeLine->SetIDMapper(GetPipeLine()->GetIDMapper());
+  aPipeLine->ShallowCopy(GetPipeLine());
   aPipeLine->Update();
   return aPipeLine;
 }
@@ -313,7 +314,7 @@ VISU::Vectors_i
     TSuperClass::UpdateActor(anActor);
     anActor->GetProperty()->SetLineWidth(GetLineWidth());
     if(VISU_VectorsPL* aVectorsPL = dynamic_cast<VISU_VectorsPL*>(anActor->GetPipeLine())){
-      aVectorsPL->ShallowCopy(myPipeLine);
+      aVectorsPL->ShallowCopy(GetPipeLine());
       aVectorsPL->Update();
       aVectorsPL->SetMapScale(myVectorsPL->GetMapScale());
     }
index 901e6032fc61480f18fed914117f682b5b96275f..09432446fe7b783ed3856ff290ee3be67db83764 100644 (file)
@@ -100,7 +100,7 @@ namespace VISU
     //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
     virtual
     void
-    CreatePipeLine();
+    CreatePipeLine(VISU_PipeLine* thePipeLine);
 
     //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
     virtual 
@@ -109,7 +109,7 @@ namespace VISU
 
     virtual
     VISU_PipeLine* 
-    GetPipeLine();
+    GetPL();
 
     VISU_VectorsPL *myVectorsPL;
     float myLineWidth;