BIN =
BIN_SRC =
-CPPFLAGS+= -I${KERNEL_ROOT_DIR}/include/salome
+CPPFLAGS+=
LDFLAGS+=
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)
#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();
}
};
*/
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);
}
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;
// 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;
}
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
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;
}
~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);
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@
#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 )
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();
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;
}
}
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() )
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();
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 );
+ // }
+ //}
}
}
}
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();
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
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@
#include <vtkPolyData.h>
#include <vtkShrinkFilter.h>
-//#include "utilities.h"
-
using namespace std;
#ifdef _DEBUG_
#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
SVTK_InteractorStyle
::~SVTK_InteractorStyle()
{
- if(MYDEBUG) INFOS("SVTK_InteractorStyle::~SVTK_InteractorStyle()");
myViewWindow->RemoveActor(myPreSelectionActor);
}
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);
}
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);
this->HighlightProp( NULL );
GetSelector()->ClearIObjects();
}
- if(MYDEBUG) INFOS(" PointId : "<<anObjId);
GetSelector()->AddOrRemoveIndex(anIO,anObjId,myShiftState);
GetSelector()->AddIObject(aSActor);
}
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 ) {
if(aResult){
mySelectedActor = aSActor;
myElemId = anObjId;
- if(MYDEBUG) INFOS(" CellId : "<<anObjId);
myInteractor->setCellData(anObjId,aSActor,myPreSelectionActor);
}
}
mySelectedActor = aSActor;
myEdgeId = anEdgeId;
myElemId = anObjId;
- if(MYDEBUG) INFOS(" CellId : "<<anObjId<<"; EdgeId : "<<anEdgeId);
myInteractor->setEdgeData(anObjId,aSActor,-anEdgeId-1,myPreSelectionActor);
}
}
if(!anIsSameObjId) {
mySelectedActor = aSActor;
myNodeId = anObjId;
- if(MYDEBUG) INFOS(" PointId : "<<anObjId);
myInteractor->setPointData(anObjId,aSActor,myPreSelectionActor);
}
myPreSelectionActor->GetProperty()->SetRepresentationToSurface();
#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()
SVTK_RenderWindowInteractor
::~SVTK_RenderWindowInteractor()
{
- if(MYDEBUG) INFOS("SVTK_RenderWindowInteractor::~SVTK_RenderWindowInteractor()");
-
delete mTimer ;
myViewWindow->RemoveActor(myCellActor);
#include "SVTK_ViewWindow.h"
#include "SVTK_SelectorDef.h"
-#include "utilities.h"
SVTK_SelectorDef
::SVTK_SelectorDef()
#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()
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++){
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++){
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)){
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{
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;
/*!Destructor.*/
VTKViewer_InteractorStyle::~VTKViewer_InteractorStyle()
{
-// if(MYDEBUG) INFOS("VTKViewer_InteractorStyle::~VTKViewer_InteractorStyle()");
m_ViewWnd->RemoveActor(myPreSelectionActor);
}
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 );
}
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 );
this->HighlightProp( NULL );
aSel->ClearIObjects();
}
- if(MYDEBUG) INFOS(" PointId : "<<anObjId);
aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
aSel->AddIObject( IO, false );
}
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 ) {
if(aResult){
mySelectedActor = SActor;
myElemId = anObjId;
- if(MYDEBUG) INFOS(" CellId : "<<anObjId);
m_Interactor->setCellData(anObjId,SActor,myPreSelectionActor);
}
}
mySelectedActor = SActor;
myEdgeId = anEdgeId;
myElemId = anObjId;
- if(MYDEBUG) INFOS(" CellId : "<<anObjId<<"; EdgeId : "<<anEdgeId);
m_Interactor->setEdgeData(anObjId,SActor,-anEdgeId-1,myPreSelectionActor);
}
}
if(!anIsSameObjId) {
mySelectedActor = SActor;
myNodeId = anObjId;
- if(MYDEBUG) INFOS(" PointId : "<<anObjId);
m_Interactor->setPointData(anObjId,SActor,myPreSelectionActor);
}
myPreSelectionActor->GetProperty()->SetRepresentationToSurface();
}
}
}
- //if(MYDEBUG) INFOS ( " NAME PREVIEW " << SActor->getName() );
}
}
}
#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);