]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
NPAL 13444 Correct bug with show/hide, Correct DumpPython case, Improve PopupMenu...
authordmv <dmv@opencascade.com>
Mon, 14 Apr 2008 16:17:20 +0000 (16:17 +0000)
committerdmv <dmv@opencascade.com>
Mon, 14 Apr 2008 16:17:20 +0000 (16:17 +0000)
16 files changed:
src/OBJECT/VISU_Actor.cxx
src/OBJECT/VISU_ActorBase.cxx
src/OBJECT/VISU_ActorBase.h
src/OBJECT/VISU_PointMap3dActor.cxx
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_ActionsDef.h
src/VISUGUI/VisuGUI_Displayer.cxx
src/VISUGUI/VisuGUI_OffsetDlg.cxx
src/VISUGUI/VisuGUI_OffsetDlg.h
src/VISUGUI/VisuGUI_PopupTools.cxx
src/VISUGUI/VisuGUI_Tools.cxx
src/VISUGUI/VisuGUI_Tools.h
src/VISUGUI/VisuGUI_TransparencyDlg.cxx
src/VISU_I/VISU_PointMap3d_i.cc
src/VISU_I/VISU_PointMap3d_i.hh
src/VISU_I/VISU_Table_i.cc

index e7200e45cd2d96474f5a9d7194c732e42be51e96..a8f45023e0a6b0ff79fb899493c58862d9c5c54c 100644 (file)
@@ -166,43 +166,6 @@ VISU_Actor
   return myPrs3d;
 }
 
-//----------------------------------------------------------------------------
-/*VISU::TActorFactory* 
-VISU_Actor
-::GetFactory()
-{ 
-  return myActorFactory;
-}*/
-
-/*void
-VISU_Actor
-::SetFactory(VISU::TActorFactory* theActorFactory)
-{ 
-  using namespace VISU;
-
-  if(myActorFactory == theActorFactory)
-    return;
-  
-  if(theActorFactory)
-    myDestroySignal.connect(boost::bind(&TActorFactory::RemoveActor,
-                                       theActorFactory,
-                                       _1));
-
-  myActorFactory = theActorFactory;
-}*/
-
-//----------------------------------------------------------------------------
-/*void
-VISU_Actor
-::UpdateFromFactory()
-{
-  if(myUpdateFromFactoryTime.GetMTime() < myActorFactory->GetMTime()){
-    myUpdateFromFactoryTime.Modified();
-    myActorFactory->UpdateActor(this);
-    Update();
-  }
-}*/
-
 void
 VISU_Actor
 ::RemoveFromRender()
index 812f790d5f383b2794b75f9b6d25bc9e96d21217..846f80600f6f2af130fc49efd0ea51a9a2d7f731 100644 (file)
 #include "VISU_ActorFactory.h"
 
 #include <vtkObjectFactory.h>
+#include <vtkProperty.h>
+#include <vtkPassThroughFilter.h>
+#include <vtkShrinkFilter.h>
+#include <vtkDataSet.h>
+#include <vtkShrinkPolyData.h>
+#include <vtkUnstructuredGrid.h>
+
+#include "utilities.h"
+
+#include "VTKViewer_ShrinkFilter.h"
+
+
 #include <boost/bind.hpp>
 
 VISU_ActorBase
-::VISU_ActorBase()
+::VISU_ActorBase() :
+  myIsShrinkable(true),
+  myIsShrunk(false),
+  myShrinkFilter(VTKViewer_ShrinkFilter::New())
 {
+  myShrinkFilter->Delete();
+  
+  myStoreMapping = true;
+  
+  myShrinkFilter->SetStoreMapping(true);
 
 }
 
@@ -80,3 +100,67 @@ VISU_ActorBase
   }
 }
 
+//--------------------------------------------------------------------------
+
+void
+VISU_ActorBase
+::SetLineWidth(vtkFloatingPointType theLineWidth)
+{
+  GetProperty()->SetLineWidth(theLineWidth);
+}
+
+vtkFloatingPointType
+VISU_ActorBase
+::GetLineWidth()
+{
+  return GetProperty()->GetLineWidth();
+}
+
+//--------------------------------------------------------------------------
+void
+VISU_ActorBase
+::SetRepresentation(int theMode) 
+{ 
+  Superclass::SetRepresentation(theMode);
+  if(myRepresentation == VTK_POINTS)
+    UnShrink();
+}
+
+//----------------------------------------------------------------------------
+void VISU_ActorBase::SetShrink()
+{
+  if(!myIsShrinkable) 
+    return;
+  if(vtkDataSet* aDataSet = myPassFilter[0]->GetOutput()){
+    myShrinkFilter->SetInput(aDataSet);
+    myPassFilter[1]->SetInput(myShrinkFilter->GetOutput());
+    myIsShrunk = true;
+  }
+}
+
+void VISU_ActorBase::UnShrink()
+{
+  if(!myIsShrunk) 
+    return;
+  if(vtkDataSet* aDataSet = myPassFilter[0]->GetOutput()){
+    myPassFilter[1]->SetInput(aDataSet);
+    myPassFilter[1]->Modified();
+    myIsShrunk = false;
+    Modified();
+  }
+}
+
+bool VISU_ActorBase::IsShrunk()
+{
+  return myIsShrunk;
+}
+
+void VISU_ActorBase::SetShrinkable(bool theIsShrinkable)
+{
+  myIsShrinkable = theIsShrinkable;
+}
+
+bool VISU_ActorBase::IsShrunkable() 
+{ 
+  return myIsShrinkable;
+}
index 84909cbe07a6913b7dba48b4b360f5c0a9104d95..6904b15f6528eec2c2c3aa4d35357607268d6bf5 100644 (file)
@@ -32,6 +32,8 @@
 #include "SALOME_Actor.h"
 #include "VISU_BoostSignals.h"
 
+class VTKViewer_ShrinkFilter;
+
 #ifdef _WIN32
 #define VTKOCC_EXPORT __declspec (dllexport)
 #else
@@ -54,18 +56,26 @@ class VTKOCC_EXPORT VISU_ActorBase: public SALOME_Actor,
   vtkTypeMacro(VISU_ActorBase, SALOME_Actor);
 
   //----------------------------------------------------------------------------
-  VISU::TActorFactory* 
-  GetFactory();
-
-  virtual
-  void
-  SetFactory(VISU::TActorFactory* theActorFactory);
+  VISU::TActorFactory* GetFactory();
+  virtual void SetFactory(VISU::TActorFactory* theActorFactory);
   
   //----------------------------------------------------------------------------
-  virtual
-  void
-  UpdateFromFactory();
+  virtual void UpdateFromFactory();
+
+  //----------------------------------------------------------------------------
+
+  virtual void SetLineWidth(vtkFloatingPointType theLineWidth);
+  virtual vtkFloatingPointType GetLineWidth();
+
+  virtual void SetShrink();
+  virtual void UnShrink(); 
+  virtual bool IsShrunkable();
+  virtual bool IsShrunk();
+  virtual void SetShrinkable(bool theIsShrinkable);
   
+
+  virtual void SetRepresentation(int theMode);
+
  protected:
   VISU_ActorBase();
   virtual  ~VISU_ActorBase();
@@ -73,6 +83,11 @@ class VTKOCC_EXPORT VISU_ActorBase: public SALOME_Actor,
   VISU::TActorFactory*                 myActorFactory;
   vtkTimeStamp                         myUpdateFromFactoryTime;
   boost::signal1<void,VISU_ActorBase*> myDestroySignal;
+
+  vtkSmartPointer<VTKViewer_ShrinkFilter> myShrinkFilter;
+
+  bool myIsShrinkable;
+  bool myIsShrunk;
 };
 
 #endif //VISU_ACTOR_BASE_H
index 5fc9a53bea37d47d166dc111b083ddc85c8a2da6..ec57b21d559d27a175f46d692cd2899dbccaa446 100644 (file)
 #include "VISU_ScalarBarActor.hxx"
 #include "VISU_DeformedGridPL.hxx"
 
+#include "utilities.h"
 #include <vtkRenderer.h>
 #include <vtkObjectFactory.h>
 
-//using namespace std;
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
 vtkStandardNewMacro(VISU_PointMap3dActor);
 
 //==================================================================
@@ -45,6 +51,7 @@ vtkStandardNewMacro(VISU_PointMap3dActor);
 VISU_PointMap3dActor
 ::VISU_PointMap3dActor()
 {
+  if(MYDEBUG) MESSAGE("VISU_PointMap3dActor::VISU_PointMap3dActor - this = "<<this);
   myScalarBar = VISU_ScalarBarActor::New();
 }
 
@@ -56,6 +63,7 @@ VISU_PointMap3dActor
 VISU_PointMap3dActor
 ::~VISU_PointMap3dActor()
 {
+  if(MYDEBUG) MESSAGE("VISU_PointMap3dActor::~VISU_PointMap3dActor - this = "<<this);
   myScalarBar->Delete();
 }
 
index 64bab8309403f364af7fa4f710b7c1366746b723..ee1ce730a39cf1a8755845b1da582d7cc511f884 100644 (file)
@@ -744,7 +744,7 @@ VisuGUI
     VISU::Base_i* aBase = anObjectInfo.myBase;
     if(!aBase) 
       continue;
-
+    
     VISU::VISUType aType = aBase->GetType();
     switch (aType) {
     case VISU::TCURVE: 
@@ -752,7 +752,7 @@ VisuGUI
     case VISU::TTABLE: 
       displayer()->Display(anIO->getEntry());
       break;
-    case VISU::TPOINTMAP3D:
+    case VISU::TPOINTMAP3D: 
       if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this)){
        displayer()->Display(anIO->getEntry());
        aViewWindow->highlight(anIO, 1);
@@ -769,7 +769,8 @@ VisuGUI
          aViewWindow->getRenderer()->ResetCameraClippingRange();
          aViewWindow->Repaint();
        }
-      }}
+      }
+    }
     }
   }
 
@@ -1135,12 +1136,6 @@ void
 VisuGUI
 ::OnChangeOpacity()
 {
-  VISU_Actor* anActor = NULL;
-  VISU::Prs3d_i* aPrs3d = NULL;
-  SVTK_ViewWindow* aViewWindow = NULL;
-  if(!GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor))
-    return;
-  
   VisuGUI_TransparencyDlg* aDialog = new VisuGUI_TransparencyDlg( this );
   aDialog->show();
 }
@@ -1151,29 +1146,44 @@ VisuGUI
 ::OnChangeLines()
 {
   VISU_Actor* anActor = NULL;
+  VISU_ActorBase* anActorBase = NULL;
   VISU::Prs3d_i* aPrs3d = NULL;
   SVTK_ViewWindow* aViewWindow = NULL;
-  if(!GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor))
-    return;
-  
+  float oldlwid;
+  bool isPrs3d = false;
+
+  if (GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor)) {
+    isPrs3d = true;
+  }
+  else {
+    aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this);
+    VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
+    VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
+    VISU::PointMap3d_i* aTable = dynamic_cast<VISU::PointMap3d_i*>(aSelectionItem.myObjectInfo.myBase);
+    anActorBase = VISU::FindActorBase(aViewWindow, aTable);
+    oldlwid = anActorBase->GetLineWidth();
+  }
+
   VisuGUI_CursorDlg* CursorDlg =
     new VisuGUI_CursorDlg (GetDesktop(this), tr("DLG_LINEWIDTH_TITLE"), TRUE);
-
+  
   CursorDlg->helpFileName = "viewing_3d_presentations_intro_page.html#width_opacity_anchor";
   CursorDlg->Comment1->setText(tr("DLG_LINEWIDTH_CMT1"));
   CursorDlg->Comment2->setText(tr("DLG_LINEWIDTH_CMT2"));
   CursorDlg->SpinBox1->setMinValue(1);
   CursorDlg->SpinBox1->setMaxValue(10);
 
-  float oldlwid = anActor->GetLineWidth();
   int intlwid = int(oldlwid);
   CursorDlg->SpinBox1->setValue(intlwid);
-
+  
   int ret = CursorDlg->exec();
   if (ret == 1) {
     intlwid  = CursorDlg->SpinBox1->value();
     float newlwid = intlwid;
-    anActor->SetLineWidth(newlwid);
+    if (isPrs3d)
+      anActor->SetLineWidth(newlwid);
+    else
+      anActorBase->SetLineWidth(newlwid);
   }
   delete CursorDlg;
 }
@@ -1644,6 +1654,13 @@ VisuGUI
            aTable->SetName(Name.latin1(), true);
          break;
        }
+       case VISU::TPOINTMAP3D: { // Table object
+         if(VISU::PointMap3d_i* aTable3d = dynamic_cast<VISU::PointMap3d_i*>(aBase)) {
+           aTable3d->SetTitle(Name);
+           aTable3d->UpdateActors(); 
+         }
+         break;
+       }
        case VISU::TCONTAINER: { // Container object
          if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBase))
            aContainer->SetName(Name.latin1(), true);
@@ -2021,6 +2038,9 @@ VisuGUI
       VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, anEntry);
       if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase))
        aDlg->addPresentation(aPrsObject);
+      else if (VISU::PointMap3d_i* aPrs = dynamic_cast<VISU::PointMap3d_i*>(anObjectInfo.myBase)) {
+       aDlg->addPointMapPresentation(aPrs);
+      }
     }
   }
   if (aDlg->getPrsCount() > 0)
@@ -2133,7 +2153,7 @@ VisuGUI
                 tr("MEN_SHOW_TABLE"), "", 0, aParent, false,
                 this, SLOT(OnShowTable()));
 
-  createAction( VISU_SHOW_TABLE_PLOT, tr("MEN_EDIT_PRS"), QIconSet(),
+  createAction( VISU_EDIT_POINTMAP3D, tr("MEN_EDIT_PRS"), QIconSet(),
                 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
                 this, SLOT(OnShowTablePlot()));
 
@@ -2511,6 +2531,7 @@ VisuGUI
   mgr->insert( action( VISU_EDIT_PLOT3D ), -1, -1, -1 );
   mgr->insert( action( VISU_EDIT_SCALARMAPONDEFORMEDSHAPE ), -1, -1, -1 );
   mgr->insert( action( VISU_EDIT_CONTAINER ), -1, -1, -1 );
+  mgr->insert( action( VISU_EDIT_POINTMAP3D ), -1, -1, -1 );
 
   // rename
   mgr->insert( action( VISU_RENAME ), -1, -1, -1 );
@@ -2522,9 +2543,9 @@ VisuGUI
   mgr->insert( action( VISU_CLEAR_CONTAINER ), -1, -1, -1 );
 
   // table commands
-  //mgr->insert( action( VISU_SHOW_TABLE ), -1, -1, -1 ); // show table
-  //mgr->insert( action( VISU_CREATE_CURVES ), -1, -1, -1 ); // create curves
-  //mgr->insert( action( VISU_EXPORT_TABLE ), -1, -1, -1 ); // export table
+  mgr->insert( action( VISU_SHOW_TABLE ), -1, -1, -1 ); // show table
+  mgr->insert( action( VISU_CREATE_CURVES ), -1, -1, -1 ); // create curves
+  mgr->insert( action( VISU_EXPORT_TABLE ), -1, -1, -1 ); // export table
 
   mgr->insert( separator(), -1, -1, -1 );
 
@@ -2615,17 +2636,17 @@ VisuGUI
   QString aTableOrCont = "(type='VISU::TTABLE' and nbChildren>0) or type='VISU::TCONTAINER'";
   QString orCurveVisible   = "or (type='VISU::TCURVE' and isVisible)";
   QString orCurveInvisible = "or (type='VISU::TCURVE'" + andInvisible + ")";
-  QString aPrsVisible   = "(($type in {'VISU::TMESH' " + aPrsAll + "}) and isVisible)";
-  QString aPrsInvisible = "(($type in {'VISU::TMESH' " + aPrsAll + "})" + andInvisible + ")";
+  QString aPrsVisible   = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "}) and isVisible)";
+  QString aPrsInvisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "})" + andInvisible + ")";
   QString aComponent = "( selcount=1 and canBeDisplayed and isVisuComponent )";
 
   QString anEraseRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsVisible +
     " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveVisible + "))) ) or " + aComponent;
 
   QString aDisplayRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsInvisible +
-    " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveInvisible + "))) ) or" + aComponent;
+    " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveInvisible + "))) ) or " + aComponent;
 
-  QString aDOnlyRule = "( selcount>0 and ({true} in $canBeDisplayed) and (($type in {'VISU::TMESH' " + aPrsAll + "})"
+  QString aDOnlyRule = "( selcount>0 and ({true} in $canBeDisplayed) and (($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "})"
     " or (client='ObjectBrowser' and ((type='VISU::TTABLE' and nbChildren>0) or"
     " ($type in {'VISU::TCURVE' 'VISU::TCONTAINER'})))) ) or" + aComponent;
 
@@ -2633,7 +2654,7 @@ VisuGUI
   mgr->setRule( action( VISU_DISPLAY ), aDisplayRule, true );
   mgr->setRule( action( VISU_DISPLAY_ONLY ), aDOnlyRule, true );
 
-  aRule = "selcount>0 and $type in {'VISU::TMESH' " + aPrsAll + "}";
+  aRule = "selcount>0 and $type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "}";
   mgr->setRule( action( VISU_TRANSLATE_PRS ), aRule, true );
 
   aRule = "selcount>1 and $type in {'VISU::TMESH' " + aPrsAll + "}";
@@ -2650,14 +2671,15 @@ VisuGUI
   mgr->setRule( action( VISU_ARRANGE_ACTORS ), "$client in {'VTKViewer' 'VVTK'} and selcount=0", true );
 
   // 3D presentations commands
-  QString aPrsType    = " and $type in {'VISU::TMESH' " + aPrsAll + "}";
+  QString aPrsType    = " and $type in {'VISU::TMESH'" + aPrsAll + "}";
+  QString aPrsType2    = " and $type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "}";
   QString anInsideType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
   QString aSurfFrameType   = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
   QString aSurfType   = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
-                        " 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
-  QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
+                        " 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TPOINTMAP3D'}";
+  QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TPOINTMAP3D'}";
   QString aLineType   = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' "
-                        "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' }";
+                        "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TPOINTMAP3D'}";
 
   aRule = "selcount=1";
   mgr->setRule( action( VISU_CLIPPING ), aRule + aPrsType, true );
@@ -2670,7 +2692,7 @@ VisuGUI
   QString aNotSurffr = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}";
 
   mgr->setRule( action( VISU_POINTS )      , aRule + aPrsType + aNotPoints, true );
-  mgr->setRule( action( VISU_WIREFRAME )   , aRule + aPrsType + aNotWirefr, true );
+  mgr->setRule( action( VISU_WIREFRAME )   , aRule + aPrsType2 + aNotWirefr, true );
   mgr->setRule( action( VISU_SURFACE )     , aRule + aSurfType + aNotSurfac, true );
   mgr->setRule( action( VISU_INSIDEFRAME ) , aRule + anInsideType + aNotInside, true );
   mgr->setRule( action( VISU_SURFACEFRAME ), aRule + aSurfFrameType + aNotSurffr, true );
@@ -2688,23 +2710,28 @@ VisuGUI
                " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}) "
                "or (type='VISU::TDEFORMEDSHAPE' and hasActor=1))", true );
   mgr->setRule( action( VISU_OPACITY ), aRule + " and hasActor=1", true );
-
   mgr->setRule( action( VISU_LINE_WIDTH ), aRule + aLineType + " and hasActor=1", true );
 
   // rename command
-  QString aCurveAll = "'VISU::TTABLE' 'VISU::TCURVE' 'VISU::TCONTAINER'";
+  QString aCurveAll = "'VISU::TTABLE' 'VISU::TCURVE' 'VISU::TCONTAINER' 'VISU::POINTMAP3D'";
 
-  aRule = "selcount=1 and ($type in {'VISU::TVIEW3D' 'VISU::TMESH' " + aCurveAll + " " + aPrsAll + "})";
+  aRule = "selcount=1 and ($type in {'VISU::TVIEW3D' 'VISU::TMESH' 'VISU::TPOINTMAP3D' " + aCurveAll + " " + aPrsAll + "})";
   mgr->setRule( action( VISU_RENAME ), aRule, true );
 
   // copy presentation command
   aRule = "selcount=1 and ($type in {" + aPrsAll + "})";
   mgr->setRule( action( VISU_COPY_PRS ), aRule, true );
 
-  // curve commands
+  // Curve commands
   aRule = "selcount=1 and type='VISU::TCURVE'";
   mgr->setRule( action( VISU_CURVE_PROPS ), aRule, true );
 
+  // Table Commands
+  aRule = "selcount=1 and ( type='VISU::TPOINTMAP3D' or type='VISU::TTABLE')";
+  mgr->setRule( action( VISU_SHOW_TABLE ), aRule, true );
+  mgr->setRule( action( VISU_CREATE_CURVES ), aRule, true );
+  mgr->setRule( action( VISU_EXPORT_TABLE ), aRule, true );
+
   // curve container commands
   aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TCONTAINER'";
   mgr->setRule( action( VISU_EDIT_CONTAINER ), aRule, true );
@@ -2728,6 +2755,8 @@ VisuGUI
                "selcount=1 and type='VISU::TSTREAMLINES'", true );
   mgr->setRule( action( VISU_EDIT_PLOT3D ),
                "selcount=1 and type='VISU::TPLOT3D'", true );
+  mgr->setRule( action( VISU_EDIT_POINTMAP3D ),
+               "selcount=1 and type='VISU::TPOINTMAP3D'", true );
 
   aRule = "selcount=1 and type='VISU::TCUTLINES' and nbNamedChildren=0";
   mgr->setRule( action( VISU_CREATE_TABLE ), aRule, true );
@@ -2901,21 +2930,11 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, Q
     action( VISU_SHOW_ANIMATION )->addTo(theMenu);
   } else if (isOBClient) {
     if (IsSObjectTable(aSObject)) {
-    action( VISU_DELETE_OBJS )->removeFrom(theMenu);
-      if (aType == VISU::TPOINTMAP3D) {
-       action( VISU_SHOW_TABLE_PLOT )->addTo(theMenu);
-       theMenu->insertSeparator();
-       action( VISU_ERASE )->addTo(theMenu);
-       action( myEraseAll )->addTo(theMenu);
-       action( VISU_DISPLAY )->addTo(theMenu);
-       action( VISU_DISPLAY_ONLY )->addTo(theMenu);
-       theMenu->insertSeparator();
-      }
-      action( VISU_SHOW_TABLE )->addTo(theMenu);
+      /*      action( VISU_SHOW_TABLE )->addTo(theMenu);
       action( VISU_CREATE_CURVES )->addTo(theMenu);
       action( VISU_EXPORT_TABLE )->addTo(theMenu);
       theMenu->insertSeparator();
-      action( VISU_DELETE_OBJS )->addTo(theMenu);
+      action( VISU_DELETE_OBJS )->addTo(theMenu);*/// dmv - code was moved up
     } else {
       if (!CORBA::is_nil(anObject)) {
         SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(anObject);
@@ -2937,17 +2956,6 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, Q
         }
       }
     }
-  } else {
-    if (aType == VISU::TPOINTMAP3D) {
-      action( myEraseAll )->removeFrom(theMenu);
-      action( VISU_SHOW_TABLE_PLOT )->addTo(theMenu);
-      theMenu->insertSeparator();
-      action( VISU_ERASE )->addTo(theMenu);
-      action( myEraseAll )->addTo(theMenu);
-      action( VISU_DISPLAY )->addTo(theMenu);
-      action( VISU_DISPLAY_ONLY )->addTo(theMenu);
-      theMenu->insertSeparator();
-    }
   }
 }
 
index d69d1c46ad10ea26d151d2c91211713f6ed34814..f1115b74ab1ad9a949e2115759ddfebc203454bb 100644 (file)
@@ -45,7 +45,7 @@
 #define VISU_DELETE_OBJS            4022
 
 #define VISU_SHOW_TABLE             4023
-#define VISU_SHOW_TABLE_PLOT        4029
+#define VISU_EDIT_POINTMAP3D        4029
 #define VISU_CREATE_CURVES          4024
 #define VISU_EXPORT_TABLE           4025
 
index e60a7e94499f501761fa6cccee6c97f5e48bffd3..7953334854a2b5cd3ec293f01e7b20a063e69744 100644 (file)
@@ -92,11 +92,19 @@ SALOME_Prs* VisuGUI_Displayer::buildPresentation( const QString& theEntry, SALOM
            aPrs3d = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aColoredPrs3d).in());
          }else if (aType == VISU::TPOINTMAP3D) {
            VISU::PointMap3d_i* aTable3d = dynamic_cast<VISU::PointMap3d_i*>(aBaseServant);
-           VISU_PointMap3dActor* aPointMap3dActor = aTable3d->CreateActor();
-           if (aPointMap3dActor) {
-             aViewWindow->AddActor(aPointMap3dActor);
+           VISU_ActorBase* anActorBase = VISU::FindActorBase(aViewWindow, aTable3d);
+           if (anActorBase) {
+             anActorBase->SetVisibility(true);
              aViewWindow->Repaint();
            }
+           else {
+             VISU_PointMap3dActor* aPointMap3dActor = aTable3d->CreateActor();
+             if (aPointMap3dActor) {
+               aViewWindow->AddActor(aPointMap3dActor);
+               aPointMap3dActor->SetVisibility(true);
+               aViewWindow->Repaint();
+             }
+           }
          }
          else
            aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aBaseServant);
@@ -281,6 +289,9 @@ bool VisuGUI_Displayer::canBeDisplayed( const QString& entry, const QString& vie
     if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER)
       return true;
 
+    if(aBase->GetType() == VISU::TPOINTMAP3D)
+      return dynamic_cast<VISU::PointMap3d_i*>(aBase);
+
     return dynamic_cast<VISU::Prs3d_i*>(aBase);
   }
   else if( viewer_type==SPlot2d_Viewer::Type() )
index 5ef2cbfbe334d8ad8ff876df70b76ceedddc4e0a..4ae427dece0da07f78c4c449120531b108a125b6 100644 (file)
@@ -58,6 +58,7 @@ VisuGUI_OffsetDlg::VisuGUI_OffsetDlg (VisuGUI* theModule)
 myModule(theModule)
 {
   myPrsList.setAutoDelete(false);
+  myPointMapList.setAutoDelete(false);
 
   setName("VisuGUI_OffsetDlg");
   setCaption(tr("TIT_OFFSETDLG"));
@@ -148,6 +149,22 @@ void VisuGUI_OffsetDlg::addPresentation (VISU::Prs3d_i* thePrs)
   }
 }
 
+void VisuGUI_OffsetDlg::addPointMapPresentation (VISU::PointMap3d_i* thePrs)
+{
+  myPointMapList.append(thePrs);
+
+  CORBA::Float anOffset[3];
+  thePrs->GetOffset(anOffset[0],anOffset[1],anOffset[2]);
+  OffsetStruct anOffs(anOffset[0],anOffset[1],anOffset[2]);
+  myOldPointMapOffsets.append(anOffs);
+  if (myPointMapList.count() == 1) {
+    setOffset(anOffs.myOffset);
+  } else if (myPointMapList.count() == 2) {
+    OffsetStruct anOffs;
+    setOffset(anOffs.myOffset);
+  }
+}
+
 void VisuGUI_OffsetDlg::setOffset (const vtkFloatingPointType* theOffset)
 {
   myDxEdt->setValue(theOffset[0]);
@@ -182,7 +199,7 @@ void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, vtkFloatingPointTyp
   if (myPrsList.count() == 0) 
     return;
 
-  if (isToSave()) 
+  if (isToSave())
     thePrs->SetOffset(theOffset[0],theOffset[1],theOffset[2]);
 
   ViewManagerList aViewManagerList;
@@ -209,6 +226,38 @@ void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, vtkFloatingPointTyp
   }
 }
 
+void VisuGUI_OffsetDlg::updatePointMapOffset (VISU::PointMap3d_i* thePrs, vtkFloatingPointType* theOffset)
+{
+  if (myPointMapList.count() == 0) 
+    return;
+
+  if (isToSave())
+    thePrs->SetOffset(theOffset[0],theOffset[1],theOffset[2]);
+
+  ViewManagerList aViewManagerList;
+  SalomeApp_Application* anApp = myModule->getApp();
+  anApp->viewManagers(aViewManagerList);
+  QPtrListIterator<SUIT_ViewManager> anVMIter (aViewManagerList);
+  for (; anVMIter.current(); ++anVMIter) {
+    SUIT_ViewManager* aViewManager = anVMIter.current();
+    QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
+    for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
+      if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
+        if (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)) {
+         vw->onAdjustTrihedron();
+
+          if (VISU_ActorBase* anActor = VISU::FindActorBase(vw, thePrs)) {
+            anActor->SetPosition(theOffset);
+           vw->highlight(thePrs->GetIO(), 1);
+            vw->getRenderer()->ResetCameraClippingRange();
+            vw->Repaint();
+          }
+        }
+      }
+    }
+  }
+}
+
 void VisuGUI_OffsetDlg::accept()
 {
   vtkFloatingPointType anOffset[3];
@@ -216,6 +265,9 @@ void VisuGUI_OffsetDlg::accept()
   for (int i = 0; i < myPrsList.count(); i++) {
     updateOffset(myPrsList.at(i), anOffset);
   }
+  for (int i = 0; i < myPointMapList.count(); i++) {
+    updatePointMapOffset(myPointMapList.at(i), anOffset);
+  }
   QDialog::accept();
 }
 
@@ -224,6 +276,9 @@ void VisuGUI_OffsetDlg::reject()
   for (int i = 0; i < myPrsList.count(); i++) {
     updateOffset(myPrsList.at(i), myOldOffsets[i].myOffset);
   }
+  for (int i = 0; i < myPointMapList.count(); i++) {
+    updatePointMapOffset(myPointMapList.at(i), myOldOffsets[i].myOffset);
+  }
   QDialog::reject();
 }
 
@@ -234,6 +289,9 @@ void VisuGUI_OffsetDlg::onApply()
   for (int i = 0; i < myPrsList.count(); i++) {
     updateOffset(myPrsList.at(i), anOffset);
   }
+  for (int i = 0; i < myPointMapList.count(); i++) {
+    updatePointMapOffset(myPointMapList.at(i), anOffset);
+  }
 }
 
 void VisuGUI_OffsetDlg::onHelp()
index a1d67a511616a9d8a01aa9f15141434c4fabdc3a..901365ca6bacea64ade7dd61560f038986ee4883 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "VTKViewer.h"
 #include "VISU_Prs3d_i.hh"
+#include "VISU_PointMap3d_i.hh"
 
 // QT Includes
 #include <qdialog.h>
@@ -59,7 +60,8 @@ class VisuGUI_OffsetDlg: public QDialog
   ~VisuGUI_OffsetDlg() {};
 
   void addPresentation (VISU::Prs3d_i* thePrs);
-  int getPrsCount() const { return myPrsList.count(); }
+  void addPointMapPresentation (VISU::PointMap3d_i* thePrs);
+  int getPrsCount() const { return myPrsList.count() + myPointMapList.count(); }
 
   void setOffset (const vtkFloatingPointType* theOffset);
   void getOffset (vtkFloatingPointType* theOffset) const;
@@ -79,6 +81,7 @@ class VisuGUI_OffsetDlg: public QDialog
 
  private:
   void updateOffset (VISU::Prs3d_i* thePrs, vtkFloatingPointType* theOffset);
+  void updatePointMapOffset (VISU::PointMap3d_i* thePrs, vtkFloatingPointType* theOffset);
 
   VisuGUI * myModule;
 
@@ -89,6 +92,9 @@ class VisuGUI_OffsetDlg: public QDialog
 
   QPtrList<VISU::Prs3d_i>  myPrsList;
   QValueList<OffsetStruct> myOldOffsets;
+
+  QPtrList<VISU::PointMap3d_i>  myPointMapList;
+  QValueList<OffsetStruct>      myOldPointMapOffsets;
 };
 
 #endif // DIALOGBOX_OFFSET_H
index 84a6326730fdc5d3ec31a92153b6c1e2f109cc17..e20cf7c60e692e141d6c221b80657b6da44a5bcc 100644 (file)
@@ -118,6 +118,7 @@ QString VisuGUI_Selection::type( const int ind ) const
       ENUM2STRING( aResStr, VISU::TSTREAMLINES );
       ENUM2STRING( aResStr, VISU::TPLOT3D );
       ENUM2STRING( aResStr, VISU::TANIMATION );
+      ENUM2STRING( aResStr, VISU::TPOINTMAP3D );
     }
   }
 
@@ -382,11 +383,19 @@ struct TViewFunctor
   {
     VISU_Actor* anActor = NULL;
     VISU::Prs3d_i* aPrs3d = NULL;
+    VISU_ActorBase* anActorBase = NULL;
+    VISU::PointMap3d_i* aPointMap3d = NULL;
     SVTK_ViewWindow* aViewWindow = NULL;
-    if(!GetPrs3dSelectionInfo<TViewer>(theModule, theEntry, aPrs3d, aViewWindow, anActor))
-      return QString();
-    
-    return get(aPrs3d, aViewWindow, anActor);
+    if(GetPrs3dSelectionInfo<TViewer>(theModule, theEntry, aPrs3d, aViewWindow, anActor)) {
+      return get(aPrs3d, aViewWindow, anActor);      
+    } else {
+      aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
+      VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule);
+      VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
+      aPointMap3d = dynamic_cast<VISU::PointMap3d_i*>(aSelectionItem.myObjectInfo.myBase);
+      anActorBase = VISU::FindActorBase(aViewWindow, aPointMap3d);
+      return getPointMap(aPointMap3d, aViewWindow, anActorBase);
+    }
   }
   
   QString
@@ -397,6 +406,15 @@ struct TViewFunctor
   {
     return QString();
   }
+
+  QString
+  virtual
+  getPointMap(VISU::PointMap3d_i* thePrs3d,
+             SVTK_ViewWindow* theViewWindow,
+             VISU_ActorBase* theActor)
+  {
+    return QString();
+  }
 };
 
 
@@ -419,6 +437,22 @@ struct TGetRepesentationFunctor: TViewFunctor
     }      
     return aResStr;
   }
+
+  QString
+  virtual
+  getPointMap(VISU::PointMap3d_i* thePrs3d,
+             SVTK_ViewWindow* theViewWindow,
+             VISU_ActorBase* theActorBase)
+  {
+    QString aResStr = "";
+    if (theActorBase) {
+      switch (theActorBase->GetRepresentation()) {
+       ENUM2STRING( aResStr, VISU::WIREFRAME ); // = 1
+       ENUM2STRING( aResStr, VISU::SHADED ); // = 2
+      }
+    }
+    return aResStr;
+  }
 };
 
 QString VisuGUI_Selection::representation( const int ind ) const
@@ -502,6 +536,17 @@ struct TIsShrunkFunctor: TViewFunctor
   {
     return theActor->IsShrunk() ? "1" : "0";
   }
+
+  QString
+  virtual
+  getPointMap(VISU::PointMap3d_i* thePointMap,
+             SVTK_ViewWindow* theViewWindow,
+             VISU_ActorBase* theActorBase)
+  {
+    if (theActorBase)
+      return theActorBase->IsShrunk() ? "1" : "0";
+    else return "0";
+  }
 };
 
 QString VisuGUI_Selection::isShrunk( const int ind ) const
index 2156d7ddb1c9705d8b03800cc42e956813ae83a8..ad54eec133987b18f13ea7bfe94757901324e8c3 100644 (file)
@@ -534,32 +534,58 @@ namespace VISU
     if(aSelectionInfo.empty())
       return;
 
+    VISU::Prs3d_i* aPrs3d;
+    VISU::PointMap3d_i* aTable;
+    VISU_Actor* anActor;
+    VISU_ActorBase* anActorBase;
+
     TSelectionItem aSelectionItem = aSelectionInfo.front();
-    VISU::Prs3d_i* aPrs3d = GetPrs3dFromBase(aSelectionItem.myObjectInfo.myBase);
-    if(!aPrs3d)
-      return;
+    aPrs3d = GetPrs3dFromBase(aSelectionItem.myObjectInfo.myBase);
+    if(!aPrs3d) {
+      aTable = dynamic_cast<VISU::PointMap3d_i*>(aSelectionItem.myObjectInfo.myBase);      
+      if(!aTable)
+       return;
+    }
 
     SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
     if(!aViewWindow)
       return;
 
-    VISU_Actor* anActor = FindActor(aViewWindow, aPrs3d);
-    if(!anActor)
-      return;
+    if (aPrs3d) {
+      anActor = FindActor(aViewWindow, aPrs3d);
+      if(!anActor)
+       return;
+    } else {
+      anActorBase = VISU::FindActorBase(aViewWindow, aTable);
+      if(!anActorBase)
+       return;
+    }
 
     switch (theType) {
     case VISU::SHRINK:
+      if (aPrs3d) {
       if (anActor->IsShrunk())
        anActor->UnShrink();
       else
        anActor->SetShrink();
+      } else if (aTable) {
+       if (anActorBase->IsShrunk())
+         anActorBase->UnShrink();
+       else
+         anActorBase->SetShrink();
+      }
       break;
     default:
-      if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
-       aMesh->SetPresentationType(theType);
-       RecreateActor(theModule, aMesh);
-      } else {
-       anActor->SetRepresentation(theType);
+      if (aPrs3d) {
+       if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
+         aMesh->SetPresentationType(theType);
+         RecreateActor(theModule, aMesh);
+       } else {
+         anActor->SetRepresentation(theType);
+       }
+      }
+      else if (aTable) {
+       anActorBase->SetRepresentation(theType);
       }
     }
     aViewWindow->Repaint();
@@ -725,6 +751,17 @@ namespace VISU
     return FindActor(theViewWindow, aPrs3d);
   }
 
+  //------------------------------------------------------------
+  VISU_ActorBase*
+  FindActorBase(const SalomeApp_Study* theStudy,
+               SVTK_ViewWindow* theViewWindow,
+               const QString& theEntry)
+  {
+    TObjectInfo anObjectInfo = GetObjectByEntry(theStudy, theEntry);
+    VISU::PointMap3d_i* aTable = dynamic_cast<VISU::PointMap3d_i*>(anObjectInfo.myBase);
+    return FindActorBase(theViewWindow, aTable);
+  }
+
   //------------------------------------------------------------
   void
   RecreateActor (const SalomeApp_Module* theModule,
index aa795d80da03730fbf46aff5464b70b7e9d1f8ca..c3f7c242bb6126ffbabd6fcee794edc9a247ffb2 100644 (file)
@@ -166,6 +166,9 @@ namespace VISU
   VISU_Actor*                          FindActor(const SalomeApp_Study* theStudy,
                                                 SVTK_ViewWindow* theViewWindow,
                                                 const QString& theEntry);
+  VISU_ActorBase*                      FindActorBase(const SalomeApp_Study* theStudy,
+                                                    SVTK_ViewWindow* theViewWindow,
+                                                    const QString& theEntry);
   void                                 RecreateActor(const SalomeApp_Module* theModule,
                                                     VISU::Prs3d_i* thePrs);
 
index ca3d9f275c5e36d9907805d6b1d86f1f1836be6a..e8925f5e22908de4db36c9290f9cd12ddeba04c1 100644 (file)
@@ -220,6 +220,11 @@ void VisuGUI_TransparencyDlg::SetTransparency()
       VISU_Actor* anActor = VISU::FindActor(VISU::GetAppStudy(myModule), myViewWindow, anIO->getEntry());
       if (anActor)
         anActor->SetOpacity(opacity);
+      else {
+       VISU_ActorBase* anActor = VISU::FindActorBase(VISU::GetAppStudy(myModule), myViewWindow, anIO->getEntry());
+      if (anActor)
+        anActor->SetOpacity(opacity);
+      }
     }
     myViewWindow->Repaint();
   }
index 08a63604a9d2261b6b3a98748f824015d92b5ef0..77895bd660c80d9a67569fb8e777f6ab78b92dca 100644 (file)
@@ -21,7 +21,7 @@
 //
 //
 //  File   : VISU_PointMap3d_i.cc
-//  Author : Vadim SANDLER
+//  Author : Dmitry Matveitchev
 //  Module : VISU
 
 #include "VISU_PointMap3d_i.hh"
@@ -50,9 +50,9 @@
 #include <boost/bind.hpp>
 
 #ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
 #else
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
 #endif
 
 //----------------------------------------------------------------
@@ -150,6 +150,17 @@ VISU::PointMap3d_i
   return anEntry.in(); 
 }
 
+//----------------------------------------------------------------------------
+Handle(SALOME_InteractiveObject)
+VISU::PointMap3d_i
+::GetIO()
+{
+  if( myIO.IsNull() )
+    myIO = new SALOME_InteractiveObject(GetEntry().c_str(), "VISU", GetName().c_str());
+
+  return myIO;
+}
+
 //----------------------------------------------------------------------------
 /*!
   Creates table3d object
@@ -339,6 +350,10 @@ VISU_PointMap3dActor* VISU::PointMap3d_i::CreateActor()
   anActor->SetPipeLine(myTablePL);
   anActor->SetFactory(this);
 
+  SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+  int  aDispMode = aResourceMgr->integerValue("VISU", "point_map_represent", 2);
+  anActor->SetRepresentation(aDispMode);
+
   Handle (SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(GetEntry().c_str(), "VISU", GetName().c_str());
   anActor->setIO(anIO);
 
index 99f55d2b2ed42344f7aec48b029843447ef3af9a..fdfcda32d05f50d30c46c732056af6d77cda5674 100644 (file)
@@ -69,6 +69,8 @@ namespace VISU
 
     virtual void Update();
 
+    virtual Handle(SALOME_InteractiveObject) GetIO();
+
     //----------- override Prs3d methods -----------------------------
 
     //! Move the 3D presentation according to the given offset parameters
@@ -218,6 +220,8 @@ namespace VISU
     vtkTimeStamp             myParamsTime;
     vtkTimeStamp             myUpdateTime;
 
+    Handle(SALOME_InteractiveObject) myIO;
+
 
     //Font management
     bool myIsBoldTitle;
index 74bdb5aff6ae8ac7a81ef2e3560a29814b8dc4a2..064b7a0afe1074f484876bc0abf1eefc0e453ad4 100644 (file)
@@ -37,9 +37,9 @@
 #include "VISU_ConvertorUtils.hxx"
 
 #ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
 #else
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
 #endif
 //----------------------------------------------------------------
 //                      Table Object