]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Remove dependency from KERNEL
authornds <nds@opencascade.com>
Wed, 14 Sep 2005 06:39:30 +0000 (06:39 +0000)
committernds <nds@opencascade.com>
Wed, 14 Sep 2005 06:39:30 +0000 (06:39 +0000)
14 files changed:
src/Prs/Makefile.in
src/PyInterp/Makefile.in
src/PyInterp/PyInterp_base.cxx
src/PyInterp/PyInterp_base.h
src/SOCC/Makefile.in
src/SOCC/SOCC_ViewModel.cxx
src/SVTK/Makefile.in
src/SVTK/SVTK_Actor.cxx
src/SVTK/SVTK_InteractorStyle.cxx
src/SVTK/SVTK_RenderWindowInteractor.cxx
src/SVTK/SVTK_Selector.cxx
src/SVTK/SVTK_ViewModel.cxx
src/VTKViewer/VTKViewer_InteractorStyle.cxx
src/VTKViewer/VTKViewer_ShrinkFilter.cxx

index 2ca3c38c5fa318eb950589900dca05d547a129ac..73133a3e61d6122bc7ed1238d9c27851b5ca0c80 100755 (executable)
@@ -20,7 +20,7 @@ LIB_CLIENT_IDL =
 BIN = 
 BIN_SRC        =
 
-CPPFLAGS+= -I${KERNEL_ROOT_DIR}/include/salome
+CPPFLAGS+=
 LDFLAGS+=
 
 
index 15e6ba0052dc0fa424125c8285a0cd59b2bb7375..1672f5ada526414ae46fc9ef525d9857aaef5074 100755 (executable)
@@ -44,7 +44,7 @@ LIB_SRC= PyInterp_base.cxx \
 
 LIB_MOC = PyInterp_Watcher.h
 
-CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_INCLUDES) -I$(KERNEL_ROOT_DIR)/include/salome
+CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_INCLUDES)
 
 LDFLAGS+= $(PYTHON_LIBS) $(QT_MT_LIBS)
 
index 4c427d7ef8b8e9562b8e83913395a74d4d6435b3..e9fdcb2593f5955ad89734ad5aa7f3b7c3777290 100644 (file)
 #include <vector>
 
 #include "PyInterp_base.h" // this include must be first (see PyInterp_base.h)!
-#include <Container_init_python.hxx>
 #include <cStringIO.h>
 
-#include <utilities.h>
-
-
 using namespace std;
 
-
-//#ifdef _DEBUG_
-//static int MYDEBUG = 1;
-//static int MYPYDEBUG = 1;
-//#else
-//static int MYDEBUG = 0;
-//static int MYPYDEBUG = 0;
-//#endif
-
-
 PyLockWrapper::PyLockWrapper(PyThreadState* theThreadState): 
   myThreadState(theThreadState),
-  mySaveThreadState(KERNEL_PYTHON::_gtstate)
+  mySaveThreadState(0)
 {
   PyEval_AcquireLock();
   mySaveThreadState = PyThreadState_Swap(myThreadState); // store previous current in save,
                                                          // set local in current
-//  if(MYDEBUG) MESSAGE(" PyLockWrapper "<<this<<" aqcuired: new thread state "<<myThreadState<<" ; old thread state "<<mySaveThreadState);
 }
 
 
 PyLockWrapper::~PyLockWrapper(){
   PyThreadState_Swap(mySaveThreadState); // restore previous current (no need to get local,
   PyEval_ReleaseLock();                  // local thread state* already in _tstate
-//  if(MYDEBUG) MESSAGE(" PyLockWrapper "<<this<<" released: new thread state "<<mySaveThreadState);
 }
 
 
 class PyReleaseLock{
 public:
   ~PyReleaseLock(){
-//    if(MYPYDEBUG) MESSAGE("~PyReleaseLock()");
     PyEval_ReleaseLock();
   }
 };
@@ -79,12 +62,10 @@ PyObject *PyInterp_base::builtinmodule = NULL;
  */
 PyInterp_base::PyInterp_base(): _tstate(0), _vout(0), _verr(0), _g(0), _atFirst(true)
 {
-//  if(MYPYDEBUG) MESSAGE("PyInterp_base::PyInterp_base() - this = "<<this);
 }
 
 PyInterp_base::~PyInterp_base()
 {
-//  if(MYPYDEBUG) MESSAGE("PyInterp_base::~PyInterp_base() - this = "<<this);
   PyLockWrapper aLock(_tstate);
   //Py_EndInterpreter(_tstate);
 }
@@ -103,7 +84,6 @@ void PyInterp_base::initialize()
 
   init_python();
   // Here the global lock is released
-//  if(MYPYDEBUG) MESSAGE("PyInterp_base::initialize() - this = "<<this<<"; _gtstate = "<<_gtstate);
 
   // The lock will be acquired in initState. Make provision to release it on exit
   PyReleaseLock aReleaseLock;
@@ -114,9 +94,7 @@ void PyInterp_base::initialize()
   // used to interpret & compile commands
   PyObjWrapper m(PyImport_ImportModule("codeop"));
   if(!m){
-//    INFOS("PyInterp_base::initialize() - PyImport_ImportModule('codeop') failed");
     PyErr_Print();
-    ASSERT(0);
     return;
   }   
   
@@ -132,14 +110,17 @@ void PyInterp_base::initialize()
 
 void PyInterp_base::init_python()
 {
-  /*
-   * Initialize the main state (_gtstate) if not already done
-   * The lock is released on init_python output
-   * It is the caller responsability to acquire it if needed
-   */
-  MESSAGE("PyInterp_base::init_python");
-  ASSERT(KERNEL_PYTHON::_gtstate); // initialisation in main
-  SCRUTE(KERNEL_PYTHON::_gtstate);
+  static PyThreadState *_gtstate = 0;
+
+  _atFirst = false;
+  if (Py_IsInitialized())
+    return;
+
+  Py_SetProgramName(_argv[0]);
+  Py_Initialize(); // Initialize the interpreter
+  PySys_SetArgv(_argc, _argv);
+  PyEval_InitThreads(); // Create (and acquire) the interpreter lock
+  _gtstate = PyEval_SaveThread(); // Release global thread state
 //  if(!_gtstate){
 //    PyReleaseLock aReleaseLock;
 //    Py_Initialize(); // Initialize the interpreter
@@ -171,7 +152,6 @@ int PyInterp_base::initRun()
   PySys_SetObject("stdout",PySys_GetObject("__stdout__"));
   PySys_SetObject("stderr",PySys_GetObject("__stderr__"));
 
-//  if(MYPYDEBUG) MESSAGE("PyInterp_base::initRun() - this = "<<this<<"; _verr = "<<_verr<<"; _vout = "<<_vout);
   return 0;
 }
 
index 63a11f82f8c3cbede3a64adc702eb1c19cf86717..469c0f40934a60345442b9259778aa3993776c02 100644 (file)
@@ -51,7 +51,10 @@ class PYINTERP_EXPORT PyInterp_base{
   ~PyInterp_base();
   
   virtual void initialize();
-  static void init_python();
+  virtual void init_python();
+  // init_python() made virtual to:
+  // 1. Remove dependency on KERNEL in light SALOME configuration
+  // 2. Allow redefinition of this method in SalomeApp_PyInterp class (it should be empty there and rely on KERNEL_PYTHON)
 
   virtual int run(const char *command); 
 
index 9ae919a0afefcd594a746ebe315f27eff0e443fe..36b2aa6970594e3e1bd3ec105e38e7e3d4da78df 100755 (executable)
@@ -27,14 +27,9 @@ LIB_SRC= SOCC_ViewModel.cxx \
 LIB_MOC = SOCC_ViewModel.h \
          SOCC_ViewWindow.h
 
-LIB_CLIENT_IDL = SALOMEDS.idl \
-                SALOME_Exception.idl \
-                SALOME_ModuleCatalog.idl \
-                SALOME_GenericObj.idl
+CPPFLAGS+=$(QT_INCLUDES) $(OCC_INCLUDES) $(BOOST_CPPFLAGS) 
 
-CPPFLAGS+=$(QT_INCLUDES) $(OCC_INCLUDES) $(BOOST_CPPFLAGS) -I$(KERNEL_ROOT_DIR)/include/salome
-
-LDFLAGS+=$(QT_MT_LIBS) -L$(KERNEL_ROOT_DIR)/lib/salome
-LIBS+= -lsuit -lSalomeObject -lSalomePrs -lOCCViewer -lOpUtil
+LDFLAGS+=$(QT_MT_LIBS)
+LIBS+= -lsuit -lSalomeObject -lSalomePrs -lOCCViewer
 
 @CONCLUDE@
index b78328d7f40c2ea687c5966f5bbe4aab3376f84c..dd9ebd70f70048e9738e6b80e13174a8b9c38d79 100755 (executable)
@@ -8,8 +8,11 @@
 
 #include "ToolsGUI.h"
 
-#include <SALOMEconfig.h>
-#include CORBA_CLIENT_HEADER(SALOMEDS)
+// Temporarily commented to avoid awful dependecy on SALOMEDS
+// TODO: better mechanism of storing display/erse status in a study
+// should be provided...
+//#include <SALOMEconfig.h>
+//#include CORBA_CLIENT_HEADER(SALOMEDS)
 
 #include <AIS_ListIteratorOfListOfInteractive.hxx>
 #include <Visual3d_View.hxx>
 #include <SALOME_AISShape.hxx>
 #include <SALOME_AISObject.hxx>
 
-#include <Utils_ORB_INIT.hxx>
-#include <Utils_SINGLETON.hxx>
-#include <SALOME_ModuleCatalog_impl.hxx>
-#include <SALOME_NamingService.hxx>
+// Temporarily commented to avoid awful dependecy on SALOMEDS
+// TODO: better mechanism of storing display/erse status in a study
+// should be provided...
+//#include <Utils_ORB_INIT.hxx>
+//#include <Utils_SINGLETON.hxx>
+//#include <SALOME_ModuleCatalog_impl.hxx>
+//#include <SALOME_NamingService.hxx>
 
-#include "SALOMEDSClient.hxx"
-#include "SALOMEDS_StudyManager.hxx"
+//#include "SALOMEDSClient.hxx"
+//#include "SALOMEDS_StudyManager.hxx"
 
 #include <AIS_TypeOfIso.hxx>
 
 // SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from 
 // SALOMEDS::StudyManager - no linkage with SalomeApp. 
 
-static _PTR(Study) getStudyDS() 
-{
-  SALOMEDSClient_Study* aStudy = NULL;
-  _PTR(StudyManager) aMgr( new SALOMEDS_StudyManager() );
+// Temporarily commented to avoid awful dependecy on SALOMEDS
+// TODO: better mechanism of storing display/erse status in a study
+// should be provided...
+//static _PTR(Study) getStudyDS() 
+//{
+//  SALOMEDSClient_Study* aStudy = NULL;
+//  _PTR(StudyManager) aMgr( new SALOMEDS_StudyManager() );
 
   // get id of SUIT_Study, if it's a SalomeApp_Study, it will return
   //    id of its underlying SALOMEDS::Study
-  SUIT_Application* app = SUIT_Session::session()->activeApplication();
-  if ( !app )  return _PTR(Study)(aStudy); 
-  SUIT_Study* stud = app->activeStudy();
-  if ( !stud ) return _PTR(Study)(aStudy);  
-  const int id = stud->id(); // virtual method, must return SALOMEDS_Study id
+//  SUIT_Application* app = SUIT_Session::session()->activeApplication();
+//  if ( !app )  return _PTR(Study)(aStudy); 
+//  SUIT_Study* stud = app->activeStudy();
+//  if ( !stud ) return _PTR(Study)(aStudy);  
+//  const int id = stud->id(); // virtual method, must return SALOMEDS_Study id
   // get SALOMEDS_Study with this id from StudyMgr
-  return aMgr->GetStudyByID( id );
-}
+//  return aMgr->GetStudyByID( id );
+//}
 
 SOCC_Viewer::SOCC_Viewer( bool DisplayTrihedron )
 : OCCViewer_Viewer( DisplayTrihedron )
@@ -244,7 +253,10 @@ void SOCC_Viewer::Display( const SALOME_OCCPrs* prs )
     return;
 
   // get SALOMEDS Study
-  _PTR(Study) study(getStudyDS());
+  // Temporarily commented to avoid awful dependecy on SALOMEDS
+  // TODO: better mechanism of storing display/erse status in a study
+  // should be provided...
+  //  _PTR(Study) study(getStudyDS());
 
   // get context
   Handle (AIS_InteractiveContext) ic = getAISContext();
@@ -303,14 +315,16 @@ void SOCC_Viewer::Display( const SALOME_OCCPrs* prs )
           bDisplayed = true;
 
           // Set visibility flag
-          Handle(SALOME_InteractiveObject) anObj =
-            Handle(SALOME_InteractiveObject)::DownCast( anAIS->GetOwner() );
-          if ( !anObj.IsNull() && anObj->hasEntry() )
-          {
-           if ( study )
-             ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this );
-          }
-
+         // Temporarily commented to avoid awful dependecy on SALOMEDS
+         // TODO: better mechanism of storing display/erse status in a study
+         // should be provided...
+         //Handle(SALOME_InteractiveObject) anObj =
+          //  Handle(SALOME_InteractiveObject)::DownCast( anAIS->GetOwner() );
+          //if ( !anObj.IsNull() && anObj->hasEntry() )
+          //{
+         //  if ( study )
+         //    ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this );
+         //}
           break;
         }
       }
@@ -329,13 +343,16 @@ void SOCC_Viewer::Display( const SALOME_OCCPrs* prs )
       ic->Display( anAIS, false );
 
       // Set visibility flag
-      Handle(SALOME_InteractiveObject) anObj =
-        Handle(SALOME_InteractiveObject)::DownCast( anAIS->GetOwner() );
-      if ( !anObj.IsNull() && anObj->hasEntry() )
-      {
-       if ( study  )
-         ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this );
-      }
+      // Temporarily commented to avoid awful dependecy on SALOMEDS
+      // TODO: better mechanism of storing display/erse status in a study
+      // should be provided...
+      //Handle(SALOME_InteractiveObject) anObj =
+      //  Handle(SALOME_InteractiveObject)::DownCast( anAIS->GetOwner() );
+      //if ( !anObj.IsNull() && anObj->hasEntry() )
+      //{
+      //  if ( study  )
+      //    ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this );
+      //}
 
       // Deactivate object if necessary
       if ( !anOCCPrs->ToActivate() )
@@ -356,7 +373,10 @@ void SOCC_Viewer::Erase( const SALOME_OCCPrs* prs, const bool forced )
     return;
 
   // get SALOMEDS Study
-  _PTR(Study) study(getStudyDS());
+  // Temporarily commented to avoid awful dependecy on SALOMEDS
+  // TODO: better mechanism of storing display/erse status in a study
+  // should be provided...
+  //  _PTR(Study) study(getStudyDS());
 
   // get context
   Handle(AIS_InteractiveContext) ic = getAISContext();
@@ -373,16 +393,19 @@ void SOCC_Viewer::Erase( const SALOME_OCCPrs* prs, const bool forced )
       ic->Erase( anAIS, false, forced ? false : true );
 
       // Set visibility flag if necessary
-      if ( !forced )
-      {
-        Handle(SALOME_InteractiveObject) anObj =
-          Handle(SALOME_InteractiveObject)::DownCast( anAIS->GetOwner() );
-        if ( !anObj.IsNull() && anObj->hasEntry() )
-        {
-         if ( study )
-           ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this );
-        }
-      }
+      // Temporarily commented to avoid awful dependecy on SALOMEDS
+      // TODO: better mechanism of storing display/erse status in a study
+      // should be provided...
+      //if ( !forced )
+      //{
+      //  Handle(SALOME_InteractiveObject) anObj =
+      //    Handle(SALOME_InteractiveObject)::DownCast( anAIS->GetOwner() );
+      //  if ( !anObj.IsNull() && anObj->hasEntry() )
+      //  {
+      //  if ( study )
+      //    ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this );
+      //  }
+      //}
     }
   }
 }
@@ -394,7 +417,10 @@ void SOCC_Viewer::Erase( const SALOME_OCCPrs* prs, const bool forced )
 void SOCC_Viewer::EraseAll( const bool forced )
 {
   // get SALOMEDS Study
-  _PTR(Study) study(getStudyDS());
+  // Temporarily commented to avoid awful dependecy on SALOMEDS
+  // TODO: better mechanism of storing display/erse status in a study
+  // should be provided...
+  //  _PTR(Study) study(getStudyDS());
 
   // get context
   Handle(AIS_InteractiveContext) ic = getAISContext();
@@ -415,15 +441,18 @@ void SOCC_Viewer::EraseAll( const bool forced )
     ic->Erase( anIO, false, forced ? false : true );
     
     // Set visibility flag if necessary
-    if ( !forced ) {
-      Handle(SALOME_InteractiveObject) anObj =
-       Handle(SALOME_InteractiveObject)::DownCast( anIO->GetOwner() );
-
-      if ( !anObj.IsNull() && anObj->hasEntry() ) {
-       if ( study )
-         ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this );
-      }
-    }
+    // Temporarily commented to avoid awful dependecy on SALOMEDS
+    // TODO: better mechanism of storing display/erse status in a study
+    // should be provided...
+    //if ( !forced ) {
+    //  Handle(SALOME_InteractiveObject) anObj =
+    // Handle(SALOME_InteractiveObject)::DownCast( anIO->GetOwner() );
+
+    //  if ( !anObj.IsNull() && anObj->hasEntry() ) {
+    // if ( study )
+    //   ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this );
+    //  }
+    //}
   }
 
   // display trihedron if necessary
index e41cfb610c370449e5c687ba14a8b6c5e53934d1..928dfd5eb64d3aad30f0f8227c6445a6887b9a58 100755 (executable)
@@ -48,14 +48,9 @@ LIB_MOC =    SVTK_RenderWindowInteractor.h \
                SVTK_ViewModel.h \
                SVTK_ViewManager.h
 
-LIB_CLIENT_IDL = SALOMEDS.idl \
-                SALOME_Exception.idl \
-                SALOME_ModuleCatalog.idl \
-                SALOME_GenericObj.idl
+CPPFLAGS+=$(QT_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(BOOST_CPPFLAGS)
 
-CPPFLAGS+=$(QT_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(BOOST_CPPFLAGS) -I$(KERNEL_ROOT_DIR)/include/salome
-
-LDFLAGS+=$(QT_MT_LIBS) $(OCC_LIBS) $(VTK_LIBS) -L$(KERNEL_ROOT_DIR)/lib/salome
-LIBS+= -lsuit -lCAM -lSalomeObject -lSalomePrs -lVTKViewer -lOpUtil
+LDFLAGS+=$(QT_MT_LIBS) $(OCC_LIBS) $(VTK_LIBS)
+LIBS+= -lsuit -lCAM -lSalomeObject -lSalomePrs -lVTKViewer
 
 @CONCLUDE@
index 1ec5fa4b11d9e97e2e9819df5e0e293e35a61985..c958f2852bb760a1448229a2493ec67d333d5b5f 100644 (file)
@@ -31,8 +31,6 @@
 #include <vtkPolyData.h>
 #include <vtkShrinkFilter.h>
 
-//#include "utilities.h"
-
 using namespace std;
 
 #ifdef _DEBUG_
index 0a5e19f496456ea91de7bc4f0f43a4daef7da3f4..6564c0007d5200ebc078dff7062671ccae9f6991 100644 (file)
@@ -29,8 +29,6 @@
 
 #include "SVTK_InteractorStyle.h"
 
-#include "utilities.h"
-
 #include "VTKViewer_CellRectPicker.h"
 #include "VTKViewer_Utilities.h"
 #include "VTKViewer_RectPicker.h"
 using namespace std;
 
 
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
-
 namespace
 {
   int
@@ -147,7 +139,6 @@ SVTK_InteractorStyle
 SVTK_InteractorStyle
 ::~SVTK_InteractorStyle() 
 {
-  if(MYDEBUG) INFOS("SVTK_InteractorStyle::~SVTK_InteractorStyle()");
   myViewWindow->RemoveActor(myPreSelectionActor);
 }
 
@@ -911,7 +902,6 @@ SVTK_InteractorStyle
                Handle(SALOME_InteractiveObject) anIO = aSActor->getIO();
                if(aSelectionMode != EdgeOfCellSelection) {
                  if(CheckDimensionId(aSelectionMode,aSActor,anObjId)){
-                   if(MYDEBUG) INFOS(" CellId : "<<anObjId);
                    if (GetSelector()->IsSelected(anIO)) {
                      // This IO is already in the selection
                      GetSelector()->AddOrRemoveIndex(anIO,anObjId,myShiftState);
@@ -931,7 +921,6 @@ SVTK_InteractorStyle
                  }
                  int anEdgeId = GetEdgeId(picker,aSActor,anObjId);
                  if (anEdgeId >= 0) {
-                   if(MYDEBUG) INFOS(" CellId : "<<anObjId<<"; EdgeId : "<<anEdgeId);
                    GetSelector()->AddOrRemoveIndex(anIO,anObjId,false);
                    GetSelector()->AddOrRemoveIndex(anIO,-anEdgeId-1,true);
                    GetSelector()->AddIObject(aSActor);
@@ -957,7 +946,6 @@ SVTK_InteractorStyle
                      this->HighlightProp( NULL );
                      GetSelector()->ClearIObjects();
                    }
-                   if(MYDEBUG) INFOS(" PointId : "<<anObjId);
                    GetSelector()->AddOrRemoveIndex(anIO,anObjId,myShiftState);
                    GetSelector()->AddIObject(aSActor);
                  }
@@ -1087,7 +1075,6 @@ SVTK_InteractorStyle
                      continue;
                    VTKViewer_CellDataSet cellList = picker->GetCellData(aActor);
                    if ( !cellList.empty() ) {
-                     if(MYDEBUG) INFOS ( " NAME Actor : " << aSActor->getName() );
                      TColStd_MapOfInteger anIndexes;
                      VTKViewer_CellDataSet::iterator it;
                      for ( it = cellList.begin(); it != cellList.end(); ++it ) {
@@ -1273,7 +1260,6 @@ SVTK_InteractorStyle
            if(aResult){
              mySelectedActor = aSActor;
              myElemId = anObjId;
-             if(MYDEBUG) INFOS(" CellId : "<<anObjId);
              myInteractor->setCellData(anObjId,aSActor,myPreSelectionActor);
            }
          }
@@ -1288,7 +1274,6 @@ SVTK_InteractorStyle
              mySelectedActor = aSActor;
              myEdgeId = anEdgeId;
              myElemId = anObjId;
-             if(MYDEBUG) INFOS(" CellId : "<<anObjId<<"; EdgeId : "<<anEdgeId);
              myInteractor->setEdgeData(anObjId,aSActor,-anEdgeId-1,myPreSelectionActor);
            } 
          }
@@ -1309,7 +1294,6 @@ SVTK_InteractorStyle
        if(!anIsSameObjId) {
          mySelectedActor = aSActor;
          myNodeId = anObjId;
-         if(MYDEBUG) INFOS(" PointId : "<<anObjId);
          myInteractor->setPointData(anObjId,aSActor,myPreSelectionActor);
        }
        myPreSelectionActor->GetProperty()->SetRepresentationToSurface();
index a80733492639df46b8de5244c69ff91eb1a4bfe7..55dd794e7f4c20a6a7fa06daf95f9df5cf4af139 100644 (file)
 
 #include <TColStd_IndexedMapOfInteger.hxx>
 
-#include "utilities.h"
-
 using namespace std;
 
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
-
-
 SVTK_RenderWindowInteractor* 
 SVTK_RenderWindowInteractor
 ::New() 
@@ -113,8 +104,6 @@ SVTK_RenderWindowInteractor
 SVTK_RenderWindowInteractor
 ::~SVTK_RenderWindowInteractor() 
 {
-  if(MYDEBUG) INFOS("SVTK_RenderWindowInteractor::~SVTK_RenderWindowInteractor()");
-
   delete mTimer ;
 
   myViewWindow->RemoveActor(myCellActor);
index 96690603ea100e6a8a34cfb2c37dca85171d9967..7a18425d58d7af151154e68f6f7a24a6c06cab1b 100644 (file)
@@ -36,7 +36,6 @@
 #include "SVTK_ViewWindow.h"
 
 #include "SVTK_SelectorDef.h"
-#include "utilities.h"
 
 SVTK_SelectorDef
 ::SVTK_SelectorDef()
index 17f0ac85c997da479c1b5afc43f3a4cbffeafcd8..02bdb6d647ad8cf3a1fd1583e28d4c7e6ae9ae1c 100644 (file)
 #include "SALOME_Actor.h"
 #include "SALOME_InteractiveObject.hxx"
 
-#include "Utils_ORB_INIT.hxx"
-#include "Utils_SINGLETON.hxx"
-#include "SALOME_ModuleCatalog_impl.hxx"
-#include "SALOME_NamingService.hxx"
+// Temporarily commented to avoid awful dependecy on SALOMEDS
+// TODO: better mechanism of storing display/erse status in a study
+// should be provided...
+//#include "Utils_ORB_INIT.hxx"
+//#include "Utils_SINGLETON.hxx"
+//#include "SALOME_ModuleCatalog_impl.hxx"
+//#include "SALOME_NamingService.hxx"
 
-#include "SALOMEDSClient.hxx"
-#include "SALOMEDS_StudyManager.hxx"
+//#include "SALOMEDSClient.hxx"
+//#include "SALOMEDS_StudyManager.hxx"
 
 // in order NOT TO link with SalomeApp, here the code returns SALOMEDS_Study.
 // SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from 
 // SALOMEDS::StudyManager - no linkage with SalomeApp. 
 
-static _PTR(Study) getStudyDS() 
-{
-  SALOMEDSClient_Study* aStudy = NULL;
-  _PTR(StudyManager) aMgr( new SALOMEDS_StudyManager() );
-
+// Temporarily commented to avoid awful dependecy on SALOMEDS
+// TODO: better mechanism of storing display/erse status in a study
+// should be provided...
+//static _PTR(Study) getStudyDS() 
+//{
+//  SALOMEDSClient_Study* aStudy = NULL;
+//  _PTR(StudyManager) aMgr( new SALOMEDS_StudyManager() );
   // get id of SUIT_Study, if it's a SalomeApp_Study, it will return
   //    id of its underlying SALOMEDS::Study
-  SUIT_Application* app = SUIT_Session::session()->activeApplication();
-  if ( !app )  return _PTR(Study)(aStudy); 
-  SUIT_Study* stud = app->activeStudy();
-  if ( !stud ) return _PTR(Study)(aStudy);  
-  const int id = stud->id(); // virtual method, must return SALOMEDS_Study id
+//  SUIT_Application* app = SUIT_Session::session()->activeApplication();
+//  if ( !app )  return _PTR(Study)(aStudy); 
+//  SUIT_Study* stud = app->activeStudy();
+//  if ( !stud ) return _PTR(Study)(aStudy);  
+//  const int id = stud->id(); // virtual method, must return SALOMEDS_Study id
   // get SALOMEDS_Study with this id from StudyMgr
-  return aMgr->GetStudyByID( id );
-}
+//  return aMgr->GetStudyByID( id );
+//}
 
 //==========================================================
 SVTK_Viewer::SVTK_Viewer()
@@ -254,15 +259,21 @@ SVTK_Viewer
       return;
     if(vtkActorCollection* anActorCollection = aPrs->GetObjects()){
       // get SALOMEDS Study
-      _PTR(Study) aStudy(getStudyDS());
+      // Temporarily commented to avoid awful dependecy on SALOMEDS
+      // TODO: better mechanism of storing display/erse status in a study
+      // should be provided...
+      // _PTR(Study) aStudy(getStudyDS());
       anActorCollection->InitTraversal();
       while(vtkActor* anActor = anActorCollection->GetNextActor()){
        if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
          // Set visibility flag
-         Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
-         if(!anObj.IsNull() && anObj->hasEntry() && aStudy){
-           ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),true,this);
-         }
+          // Temporarily commented to avoid awful dependecy on SALOMEDS
+          // TODO: better mechanism of storing display/erse status in a study
+          // should be provided...
+         //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
+         //if(!anObj.IsNull() && anObj->hasEntry() && aStudy){
+         //  ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),true,this);
+         //}
          // just display the object
          QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
          for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
@@ -295,15 +306,21 @@ SVTK_Viewer
       return;
     if(vtkActorCollection* anActorCollection = aPrs->GetObjects()){
       // get SALOMEDS Study
-      _PTR(Study) aStudy(getStudyDS());
+      // Temporarily commented to avoid awful dependecy on SALOMEDS
+      // TODO: better mechanism of storing display/erse status in a study
+      // should be provided...
+      //_PTR(Study) aStudy(getStudyDS());
       anActorCollection->InitTraversal();
       while(vtkActor* anActor = anActorCollection->GetNextActor())
        if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
          // Set visibility flag
-         Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
-         if(!anObj.IsNull() && anObj->hasEntry() && aStudy){
-           ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this);
-         }
+          // Temporarily commented to avoid awful dependecy on SALOMEDS
+          // TODO: better mechanism of storing display/erse status in a study
+          // should be provided...
+         //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
+         //if(!anObj.IsNull() && anObj->hasEntry() && aStudy){
+         //  ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this);
+         //}
          // just display the object
          QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
          for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
@@ -325,7 +342,10 @@ void
 SVTK_Viewer
 ::EraseAll( const bool forced )
 {
-  _PTR(Study) aStudy(getStudyDS());
+  // Temporarily commented to avoid awful dependecy on SALOMEDS
+  // TODO: better mechanism of storing display/erse status in a study
+  // should be provided...
+  //_PTR(Study) aStudy(getStudyDS());
   QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
   for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
     if(SUIT_ViewWindow* aViewWindow = aViews.at(i)){
@@ -336,9 +356,12 @@ SVTK_Viewer
        while(vtkActor* anActor = anActorCollection->GetNextActor()){
          if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
            // Set visibility flag
-           Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
-           if(!anObj.IsNull() && anObj->hasEntry() && aStudy)
-             ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this);
+            // Temporarily commented to avoid awful dependecy on SALOMEDS
+            // TODO: better mechanism of storing display/erse status in a study
+            // should be provided...
+           //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
+           //if(!anObj.IsNull() && anObj->hasEntry() && aStudy)
+           //  ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this);
            if(forced)
              aRenderer->RemoveActor(anAct);
            else{
index 18a4960897251efb21e19ebd8c0206a37b9eec74..fa407641d1726076d12a6e96ad61b0b5f8ad7b97 100644 (file)
 using namespace std;
 
 
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
-
 /*
 static int GetEdgeId(vtkPicker *thePicker, SALOME_Actor *theActor, int theObjId){
   int anEdgeId = -1;
@@ -117,7 +111,6 @@ VTKViewer_InteractorStyle::VTKViewer_InteractorStyle()
 /*!Destructor.*/
 VTKViewer_InteractorStyle::~VTKViewer_InteractorStyle() 
 {
-//  if(MYDEBUG) INFOS("VTKViewer_InteractorStyle::~VTKViewer_InteractorStyle()");
   m_ViewWnd->RemoveActor(myPreSelectionActor);
 }
 
@@ -899,7 +892,6 @@ void VTKViewer_InteractorStyle::onFinishOperation()
                Handle(SALOME_InteractiveObject) IO = SActor->getIO();
                if(aSelectionMode != EdgeOfCellSelection) {
                  if(CheckDimensionId(aSelectionMode,SActor,anObjId)){
-                   if(MYDEBUG) INFOS(" CellId : "<<anObjId);
                    if (IsSelected(IO,aSel)) {
                      // This IO is already in the selection
                      aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
@@ -919,7 +911,6 @@ void VTKViewer_InteractorStyle::onFinishOperation()
                  }
                  int anEdgeId = GetEdgeId(picker,SActor,anObjId);
                  if (anEdgeId >= 0) {
-                   if(MYDEBUG) INFOS(" CellId : "<<anObjId<<"; EdgeId : "<<anEdgeId);
                    aSel->AddOrRemoveIndex( IO, anObjId, true, false);
                    aSel->AddOrRemoveIndex( IO, -anEdgeId-1, true, true );
                    aSel->AddIObject( IO, false );
@@ -945,7 +936,6 @@ void VTKViewer_InteractorStyle::onFinishOperation()
                      this->HighlightProp( NULL );
                      aSel->ClearIObjects();
                    }
-                   if(MYDEBUG) INFOS(" PointId : "<<anObjId);
                    aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
                    aSel->AddIObject( IO, false );
                  }
@@ -1076,7 +1066,6 @@ void VTKViewer_InteractorStyle::onFinishOperation()
                      continue;
                    VTKViewer_CellDataSet cellList = picker->GetCellData(aActor);
                    if ( !cellList.empty() ) {
-                     if(MYDEBUG) INFOS ( " NAME Actor : " << aSActor->getName() );
                      SALOME_Selection::TContainerOfId anIndexes;
                      VTKViewer_CellDataSet::iterator it;
                      for ( it = cellList.begin(); it != cellList.end(); ++it ) {
@@ -1260,7 +1249,6 @@ void VTKViewer_InteractorStyle::onCursorMove(QPoint mousePos) {
            if(aResult){
              mySelectedActor = SActor;
              myElemId = anObjId;
-             if(MYDEBUG) INFOS(" CellId : "<<anObjId);
              m_Interactor->setCellData(anObjId,SActor,myPreSelectionActor);
            }
          }
@@ -1275,7 +1263,6 @@ void VTKViewer_InteractorStyle::onCursorMove(QPoint mousePos) {
              mySelectedActor = SActor;
              myEdgeId = anEdgeId;
              myElemId = anObjId;
-             if(MYDEBUG) INFOS(" CellId : "<<anObjId<<"; EdgeId : "<<anEdgeId);
              m_Interactor->setEdgeData(anObjId,SActor,-anEdgeId-1,myPreSelectionActor);
            } 
          }
@@ -1296,7 +1283,6 @@ void VTKViewer_InteractorStyle::onCursorMove(QPoint mousePos) {
        if(!anIsSameObjId) {
          mySelectedActor = SActor;
          myNodeId = anObjId;
-         if(MYDEBUG) INFOS(" PointId : "<<anObjId);
          m_Interactor->setPointData(anObjId,SActor,myPreSelectionActor);
        }
        myPreSelectionActor->GetProperty()->SetRepresentationToSurface();
@@ -1328,7 +1314,6 @@ void VTKViewer_InteractorStyle::onCursorMove(QPoint mousePos) {
                }
              }
            }
-           //if(MYDEBUG) INFOS ( " NAME PREVIEW " << SActor->getName() );
          }
        }
       }
index f980b5c0ded779aff247cb081e525628135acb74..c65699a9a790d6a2d1bcd925c57cb97f19aeff2a 100755 (executable)
 #include <vtkPointData.h>
 #include <vtkUnstructuredGrid.h>
 
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-static int MYDEBUGWITHFILES = 0;
-#else
-static int MYDEBUG = 0;
-static int MYDEBUGWITHFILES = 0;
-#endif
-
 vtkCxxRevisionMacro(VTKViewer_ShrinkFilter, "$Revision$");
 vtkStandardNewMacro(VTKViewer_ShrinkFilter);