]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Change configuration OCC_Config
authornds <nds@opencascade.com>
Mon, 6 Mar 2006 08:31:58 +0000 (08:31 +0000)
committernds <nds@opencascade.com>
Mon, 6 Mar 2006 08:31:58 +0000 (08:31 +0000)
16 files changed:
src/LightApp/LightApp_Application.cxx
src/LightApp/LightApp_Application.h
src/LightApp/LightApp_DataOwner.cxx
src/LightApp/LightApp_DataOwner.h
src/LightApp/LightApp_Displayer.cxx
src/LightApp/LightApp_GLSelector.cxx
src/LightApp/LightApp_GLSelector.h
src/LightApp/LightApp_Module.cxx
src/LightApp/LightApp_OBSelector.cxx
src/LightApp/LightApp_OCCSelector.cxx
src/LightApp/LightApp_SelectionMgr.cxx
src/LightApp/LightApp_SelectionMgr.h
src/LightApp/LightApp_ShowHideOp.cxx
src/LightApp/LightApp_VTKSelector.cxx
src/LightApp/LightApp_VTKSelector.h
src/LightApp/Makefile.in

index ca93892ffb85bea1649da40e1bfda431a2d97cb9..0309476383bc0930584d2d10e69e3f89041896e6 100644 (file)
@@ -3,7 +3,10 @@
 // Author:    Natalia Donis
 // Copyright (C) CEA 2005
 
-#include "PythonConsole_PyInterp.h" // WARNING! This include must be the first!
+#ifndef DISABLE_PYCONSOLE
+  #include "PythonConsole_PyInterp.h" // WARNING! This include must be the first!
+  #include <PythonConsole_PyConsole.h>
+#endif
 
 #include "LightApp_Application.h"
 #include "LightApp_WidgetContainer.h"
 
 #include "LightApp_OBFilter.h"
 
-#include "LightApp_GLSelector.h"
 #include "LightApp_OBSelector.h"
-#include "LightApp_OCCSelector.h"
-#include "LightApp_VTKSelector.h"
 #include "LightApp_SelectionMgr.h"
 
 #include <CAM_Module.h>
 #include <LogWindow.h>
 #include <OB_Browser.h>
 #include <OB_ListView.h>
-#include <PythonConsole_PyConsole.h>
 
-#include <GLViewer_Viewer.h>
-#include <GLViewer_ViewManager.h>
+#ifndef DISABLE_GLVIEWER
+  #include <GLViewer_Viewer.h>
+  #include <GLViewer_ViewManager.h>
+  #include "LightApp_GLSelector.h"
+#endif
 
-#include <Plot2d_ViewManager.h>
-#include <Plot2d_ViewModel.h>
-#include <SPlot2d_ViewModel.h>
+#ifndef DISABLE_PLOT2DVIEWER
+  #include <Plot2d_ViewManager.h>
+  #include <Plot2d_ViewModel.h>
+#ifndef DISABLE_SALOMEOBJECT
+  #include <SPlot2d_ViewModel.h>
+#else
+  #include <Plot2d_ViewModel.h>
+#endif
+#endif
 
-#include <OCCViewer_ViewManager.h>
-#include <SOCC_ViewModel.h>
+#ifndef DISABLE_OCCVIEWER
+  #include <OCCViewer_ViewManager.h>
+#ifndef DISABLE_SALOMEOBJECT
+  #include <SOCC_ViewModel.h>
+#else
+  #include <OCCViewer_ViewModel.h>
+#endif
+  #include "LightApp_OCCSelector.h"
+#endif
 
-#include <SVTK_ViewModel.h>
-#include <SVTK_ViewManager.h>
-#include <VTKViewer_ViewModel.h>
+#ifndef DISABLE_VTKVIEWER
+#ifndef DISABLE_SALOMEOBJECT
+  #include <SVTK_ViewModel.h>
+  #include <SVTK_ViewManager.h>
+  #include "LightApp_VTKSelector.h"
+#else
+  #include <VTKViewer_ViewModel.h>
+  #include <VTKViewer_ViewManager.h>
+#endif
+  #include <VTKViewer_ViewModel.h>
+#endif
 
-#include <SUPERVGraph_ViewModel.h>
-#include <SUPERVGraph_ViewFrame.h>
-#include <SUPERVGraph_ViewManager.h>
+#ifndef DISABLE_SUPERVGRAPHVIEWER
+  #include <SUPERVGraph_ViewModel.h>
+  #include <SUPERVGraph_ViewFrame.h>
+  #include <SUPERVGraph_ViewManager.h>
+#endif
 
 #include <QtxWorkstack.h>
 
 
 #define FIRST_HELP_ID 1000000
 
-#include "SALOME_InteractiveObject.hxx"
-#include "SALOME_ListIO.hxx"
+#ifndef DISABLE_SALOMEOBJECT
+  #include "SALOME_InteractiveObject.hxx"
+  #include "SALOME_ListIO.hxx"
+#endif
 
 static const char* imageEmptyIcon[] = {
 "20 20 1 1",
@@ -147,6 +174,7 @@ myPrefs( 0 )
   mySelMgr = new LightApp_SelectionMgr( this );
 
   myAccel = new SUIT_Accel( desktop() );
+#ifndef DISABLE_OCCVIEWER
   myAccel->setActionKey( SUIT_Accel::PanLeft,     CTRL+Key_Left,     OCCViewer_Viewer::Type() );
   myAccel->setActionKey( SUIT_Accel::PanRight,    CTRL+Key_Right,    OCCViewer_Viewer::Type() );
   myAccel->setActionKey( SUIT_Accel::PanUp,       CTRL+Key_Up,       OCCViewer_Viewer::Type() );
@@ -158,6 +186,8 @@ myPrefs( 0 )
   myAccel->setActionKey( SUIT_Accel::RotateRight, ALT+Key_Right,     OCCViewer_Viewer::Type() );
   myAccel->setActionKey( SUIT_Accel::RotateUp,    ALT+Key_Up,        OCCViewer_Viewer::Type() );
   myAccel->setActionKey( SUIT_Accel::RotateDown,  ALT+Key_Down,      OCCViewer_Viewer::Type() );
+#endif
+#ifndef DISABLE_VTKVIEWER
   myAccel->setActionKey( SUIT_Accel::PanLeft,     CTRL+Key_Left,     VTKViewer_Viewer::Type() );
   myAccel->setActionKey( SUIT_Accel::PanRight,    CTRL+Key_Right,    VTKViewer_Viewer::Type() );
   myAccel->setActionKey( SUIT_Accel::PanUp,       CTRL+Key_Up,       VTKViewer_Viewer::Type() );
@@ -169,6 +199,7 @@ myPrefs( 0 )
   myAccel->setActionKey( SUIT_Accel::RotateRight, ALT+Key_Right,     VTKViewer_Viewer::Type() );
   myAccel->setActionKey( SUIT_Accel::RotateUp,    ALT+Key_Up,        VTKViewer_Viewer::Type() );
   myAccel->setActionKey( SUIT_Accel::RotateDown,  ALT+Key_Down,      VTKViewer_Viewer::Type() );
+#endif
 
   connect( mySelMgr, SIGNAL( selectionChanged() ), this, SLOT( onSelection() ) );
 }
@@ -320,6 +351,19 @@ LightApp_SelectionMgr* LightApp_Application::selectionMgr() const
   return mySelMgr;
 }
 
+/*!Creat action "New window" for certain type of viewer:*/
+void LightApp_Application::createActionForViewer( const int id,
+                                                  const int parentId,
+                                                  const QString& suffix,
+                                                  const int accel )
+{
+  QAction* a = createAction( id, tr( QString( "NEW_WINDOW_%1" ).arg( suffix ) ), QIconSet(),
+                              tr( QString( "NEW_WINDOW_%1" ).arg( suffix ) ),
+                              tr( QString( "NEW_WINDOW_%1" ).arg( suffix ) ),
+                              accel, desktop(), false, this, SLOT( onNewWindow() ) );
+  createMenu( a, parentId, -1 );
+}
+
 /*!Create actions:*/
 void LightApp_Application::createActions()
 {
@@ -463,20 +507,20 @@ void LightApp_Application::createActions()
   int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 );
   createMenu( separator(), windowMenu, -1, 1 );
 
-  QMap<int, int> accelMap;
-  accelMap[NewGLViewId]  = ALT+Key_G;
-  accelMap[NewPlot2dId]  = ALT+Key_P;
-  accelMap[NewOCCViewId] = ALT+Key_O;
-  accelMap[NewVTKViewId] = ALT+Key_K;
 
-  for ( id = NewGLViewId; id <= NewVTKViewId; id++ )
-  {
-    QAction* a = createAction( id, tr( QString( "NEW_WINDOW_%1" ).arg( id - NewGLViewId ) ), QIconSet(),
-                              tr( QString( "NEW_WINDOW_%1" ).arg( id - NewGLViewId ) ),
-                              tr( QString( "NEW_WINDOW_%1" ).arg( id - NewGLViewId ) ),
-                              accelMap.contains( id ) ? accelMap[id] : 0, desk, false, this, SLOT( onNewWindow() ) );
-    createMenu( a, newWinMenu, -1 );
-  }
+#ifndef DISABLE_GLVIEWER
+  createActionForViewer( NewGLViewId, newWinMenu, QString::number( 0 ), ALT+Key_G );
+#endif
+#ifndef DISABLE_PLOT2DVIEWER
+  createActionForViewer( NewPlot2dId, newWinMenu, QString::number( 1 ), ALT+Key_P );
+#endif
+#ifndef DISABLE_OCCVIEWER
+  createActionForViewer( NewOCCViewId, newWinMenu, QString::number( 2 ), ALT+Key_O );
+#endif
+#ifndef DISABLE_VTKVIEWER
+  createActionForViewer( NewVTKViewId, newWinMenu, QString::number( 3 ), ALT+Key_K );
+#endif
+
 
   createAction( RenameId, tr( "TOT_RENAME" ), QIconSet(), tr( "MEN_DESK_RENAME" ), tr( "PRP_RENAME" ),
                SHIFT+Key_R, desk, false, this, SLOT( onRenameWindow() ) );
@@ -560,18 +604,26 @@ void LightApp_Application::onNewWindow()
   int id = actionId( (QAction*)obj );
   switch ( id )
   {
+#ifndef DISABLE_GLVIEWER
   case NewGLViewId:
     type = GLViewer_Viewer::Type();
     break;
+#endif
+#ifndef DISABLE_PLOT2DVIEWER
   case NewPlot2dId:
     type = Plot2d_Viewer::Type();
     break;
+#endif
+#ifndef DISABLE_OCCVIEWER
   case NewOCCViewId:
     type = OCCViewer_Viewer::Type();
     break;
+#endif
+#ifndef DISABLE_VTKVIEWER
   case NewVTKViewId:
     type = VTKViewer_Viewer::Type();
     break;
+#endif
   }
 
   if ( !type.isEmpty() )
@@ -737,13 +789,31 @@ void LightApp_Application::setActiveStudy( SUIT_Study* study )
 void LightApp_Application::updateCommandsStatus()
 {
   CAM_Application::updateCommandsStatus();
+  QAction* a = 0;
 
-  for ( int id = NewGLViewId; id <= NewVTKViewId; id++ )
-  {
-    QAction* a = action( id );
-    if ( a )
-      a->setEnabled( activeStudy() );
-  }
+#ifndef DISABLE_GLVIEWER
+  a = action( NewGLViewId );
+  if( a )
+    a->setEnabled( activeStudy() );
+#endif
+
+#ifndef DISABLE_PLOT2DVIEWER
+  a = action( NewPlot2dId );
+  if( a )
+    a->setEnabled( activeStudy() );
+#endif
+
+#ifndef DISABLE_OCCVIEWER
+  a = action( NewOCCViewId );
+  if( a )
+    a->setEnabled( activeStudy() );
+#endif
+
+#ifndef DISABLE_VTKVIEWER
+  a = action( NewVTKViewId );
+  if( a )
+    a->setEnabled( activeStudy() );
+#endif
 }
 
 // Helps to execute command
@@ -889,6 +959,7 @@ void LightApp_Application::addWindow( QWidget* wid, const int flag, const int st
   }
 
   QFont f;
+#ifndef DISABLE_PYCONSOLE
   if( wid->inherits( "PythonConsole" ) )
   {
     if( resourceMgr()->hasValue( "PyConsole", "font" ) )
@@ -900,6 +971,7 @@ void LightApp_Application::addWindow( QWidget* wid, const int flag, const int st
     }
   }
   else
+#endif
     f = wid->font();
 
   myWindows[flag]->insert( sId, wid );
@@ -994,6 +1066,7 @@ LogWindow* LightApp_Application::logWindow()
   return lw;
 }
 
+#ifndef DISABLE_PYCONSOLE
 /*!Get "PythonConsole"*/
 PythonConsole* LightApp_Application::pythonConsole()
 {
@@ -1003,6 +1076,7 @@ PythonConsole* LightApp_Application::pythonConsole()
     console = (PythonConsole*)wid;
   return console;
 }
+#endif
 
 /*!Update obect browser*/
 void LightApp_Application::updateObjectBrowser( const bool updateModels )
@@ -1062,15 +1136,23 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
   SUIT_ResourceMgr* resMgr = resourceMgr();
 
   SUIT_ViewManager* viewMgr = 0;
+#ifndef DISABLE_GLVIEWER
   if( vmType == GLViewer_Viewer::Type() )
   {
     viewMgr = new GLViewer_ViewManager( activeStudy(), desktop() );
     new LightApp_GLSelector( (GLViewer_Viewer2d*)viewMgr->getViewModel(), mySelMgr );
   }
-  else if( vmType == Plot2d_Viewer::Type() )
+#endif
+#ifndef DISABLE_PLOT2DVIEWER
+  if( vmType == Plot2d_Viewer::Type() )
   {
     viewMgr = new Plot2d_ViewManager( activeStudy(), desktop() );
-    SPlot2d_Viewer* vm = new SPlot2d_Viewer();
+    Plot2d_Viewer* vm;
+#ifndef DISABLE_SALOMEOBJECT
+    vm = new SPlot2d_Viewer();
+#else
+    vm = new Plot2d_Viewer();
+#endif
     viewMgr->setViewModel( vm  );// custom view model, which extends SALOME_View interface 
     Plot2d_ViewWindow* wnd = dynamic_cast<Plot2d_ViewWindow*>( viewMgr->getActiveView() );
     if( wnd )
@@ -1079,7 +1161,9 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
       frame->setBackgroundColor( resMgr->colorValue( "Plot2d", "Background", frame->backgroundColor() ) );
     }
   }
-  else if( vmType == SUPERVGraph_Viewer::Type() )
+#endif
+#ifndef DISABLE_SUPERVGRAPHVIEWER
+  if( vmType == SUPERVGraph_Viewer::Type() )
   {
     viewMgr = new SUPERVGraph_ViewManager( activeStudy(), desktop() );
     SUPERVGraph_Viewer* vm = new SUPERVGraph_Viewer();
@@ -1087,10 +1171,17 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
     if( view )
       view->setBackgroundColor( resMgr->colorValue( "SUPERVGraph", "Background", view->backgroundColor() ) );
   }
-  else if( vmType == OCCViewer_Viewer::Type() )
+#endif
+#ifndef DISABLE_OCCVIEWER
+  if( vmType == OCCViewer_Viewer::Type() )
   {
     viewMgr = new OCCViewer_ViewManager( activeStudy(), desktop() );
-    SOCC_Viewer* vm = new SOCC_Viewer();
+    OCCViewer_Viewer* vm;
+#ifndef DISABLE_SALOMEOBJECT
+    vm = new SOCC_Viewer();
+#else
+    vm = new OCCViewer_Viewer();
+#endif
     vm->setBackgroundColor( resMgr->colorValue( "OCCViewer", "background", vm->backgroundColor() ) );
     vm->setTrihedronSize( resMgr->integerValue( "OCCViewer", "trihedron_size", vm->trihedronSize() ) );
     int u( 1 ), v( 1 );
@@ -1101,8 +1192,11 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
     viewMgr->setViewModel( vm );// custom view model, which extends SALOME_View interface
     new LightApp_OCCSelector( (OCCViewer_Viewer*)viewMgr->getViewModel(), mySelMgr );
   }
-  else if ( vmType == SVTK_Viewer::Type() )
+#endif
+#ifndef DISABLE_VTKVIEWER
+  if ( vmType == VTKViewer_Viewer::Type() )
   {
+#ifndef DISABLE_SALOMEOBJECT
     viewMgr = new SVTK_ViewManager( activeStudy(), desktop() );
     SVTK_Viewer* vm = dynamic_cast<SVTK_Viewer*>( viewMgr->getViewModel() );
     if( vm )
@@ -1111,7 +1205,14 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
       vm->setTrihedronSize( resMgr->integerValue( "VTKViewer", "trihedron_size", vm->trihedronSize() ) );
       new LightApp_VTKSelector( vm, mySelMgr );
     }
+#else
+    viewMgr = new VTKViewer_ViewManager( activeStudy(), desktop() );
+    VTKViewer_Viewer* vm = dynamic_cast<VTKViewer_Viewer*>( viewMgr->getViewModel() );
+    if ( vm )
+      vm->setBackgroundColor( resMgr->colorValue( "VTKViewer", "background", vm->backgroundColor() ) );
+#endif
   }
+#endif
 
   if ( !viewMgr )
     return 0;
@@ -1346,6 +1447,7 @@ QWidget* LightApp_Application::createWindow( const int flag )
 
     ob->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
   }
+#ifndef DISABLE_PYCONSOLE
   else  if ( flag == WT_PyConsole )
   {
     PythonConsole* pyCons = new PythonConsole( desktop() );
@@ -1353,6 +1455,7 @@ QWidget* LightApp_Application::createWindow( const int flag )
     wid = pyCons;
     //    pyCons->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
   }
+#endif
   else if ( flag == WT_LogWindow )
   {
     LogWindow* logWin = new LogWindow( desktop() );
@@ -1369,7 +1472,9 @@ QWidget* LightApp_Application::createWindow( const int flag )
 void LightApp_Application::defaultWindows( QMap<int, int>& aMap ) const
 {  
   aMap.insert( WT_ObjectBrowser, Qt::DockLeft );
+#ifndef DISABLE_PYCONSOLE
   aMap.insert( WT_PyConsole, Qt::DockBottom );
+#endif
   //  aMap.insert( WT_LogWindow, Qt::DockBottom );
 }
 
@@ -1621,6 +1726,7 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
   if ( !resMgr )
     return;
 
+#ifndef DISABLE_OCCVIEWER
   if ( sec == QString( "OCCViewer" ) && param == QString( "trihedron_size" ) )
   {
     int sz = resMgr->integerValue( sec, param, -1 );
@@ -1637,18 +1743,20 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
       occVM->getAISContext()->UpdateCurrentViewer();
     }
   }
+#endif
 
+#ifndef DISABLE_VTKVIEWER
   if ( sec == QString( "VTKViewer" ) && (param == QString( "trihedron_size" ) || param == QString( "relative_size" )) )
   {
     int sz = resMgr->integerValue( "VTKViewer", "trihedron_size", -1 );
     QPtrList<SUIT_ViewManager> lst;
-    viewManagers( SVTK_Viewer::Type(), lst );
+    viewManagers( VTKViewer_Viewer::Type(), lst );
+#ifndef DISABLE_SALOMEOBJECT
     for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current() && sz >= 0; ++it )
     {
       SUIT_ViewModel* vm = it.current()->getViewModel();
       if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
        continue;
-
       SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
       if( vtkVM )
       {
@@ -1656,8 +1764,11 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
        vtkVM->Repaint();
       }
     }
+#endif
   }
+#endif
 
+#ifndef DISABLE_OCCVIEWER
   if ( sec == QString( "OCCViewer" ) && ( param == QString( "iso_number_u" ) || param == QString( "iso_number_v" ) ) )
   {
     QPtrList<SUIT_ViewManager> lst;
@@ -1671,6 +1782,7 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
        mgr->getOCCViewer()->setIsos( u, v );
     }
   }
+#endif
 
   if( sec=="ObjectBrowser" )
   {
@@ -1694,12 +1806,14 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
       updateWindows();
   }
 
+#ifndef DISABLE_PYCONSOLE
   if( sec=="PyConsole" )
   {
     if( param=="font" )
       if( pythonConsole() )
        pythonConsole()->setFont( resMgr->fontValue( "PyConsole", "font" ) );
   }
+#endif
 }
 
 /*!Update desktop title.*/
index 14d2e4c23cc6cd00ad045c63543588e52377e9a1..2ff2f968f31e8f922e99142dc2dab6ba734407de 100644 (file)
@@ -15,7 +15,9 @@
 
 class LogWindow;
 class OB_Browser;
-class PythonConsole;
+#ifndef DISABLE_PYCONSOLE
+  class PythonConsole;
+#endif
 class STD_Application;
 class LightApp_WidgetContainer;
 class LightApp_Preferences;
@@ -42,10 +44,33 @@ class LIGHTAPP_EXPORT LightApp_Application : public CAM_Application
   Q_OBJECT
 
 public:
-  typedef enum { WT_ObjectBrowser, WT_PyConsole, WT_LogWindow, WT_User } WindowTypes;
+  typedef enum { WT_ObjectBrowser, 
+#ifndef DISABLE_PYCONSOLE
+                 WT_PyConsole,
+#endif
+                 WT_LogWindow,
+                 WT_User }
+  WindowTypes;
+
+  enum { RenameId = CAM_Application::UserID,
+
+#ifndef DISABLE_GLVIEWER
+         NewGLViewId ,
+#endif
+
+#ifndef DISABLE_PLOT2DVIEWER
+         NewPlot2dId,
+#endif
+
+#ifndef DISABLE_OCCVIEWER
+         NewOCCViewId,
+#endif
 
-  enum { NewGLViewId = CAM_Application::UserID, NewPlot2dId, NewOCCViewId, NewVTKViewId,
-         PreferencesId, MRUId, RenameId, UserID };
+#ifndef DISABLE_VTKVIEWER
+         NewVTKViewId,
+#endif
+
+         PreferencesId, MRUId, UserID };
 public:
   LightApp_Application();
   virtual ~LightApp_Application();
@@ -62,7 +87,9 @@ public:
   
   LogWindow*                          logWindow();
   OB_Browser*                         objectBrowser();
+#ifndef DISABLE_PYCONSOLE
   PythonConsole*                      pythonConsole(); 
+#endif
 
   virtual void                        updateObjectBrowser( const bool = true );
 
@@ -111,6 +138,10 @@ public slots:
 
 protected:
   virtual void                        createActions();
+  virtual void                        createActionForViewer( const int id,
+                                                             const int parentId,
+                                                             const QString& suffix,
+                                                             const int accel );
   virtual SUIT_Study*                 createNewStudy();
   virtual QWidget*                    createWindow( const int );
   virtual void                        defaultWindows( QMap<int, int>& ) const;
index add34d91ff680a183bce3dae891f606e234d17f2..62d0977d15bbf1cca0d22328470297f3f9db8eb3 100644 (file)
@@ -37,6 +37,7 @@ LightApp_DataOwner
 {
 }
 
+#ifndef DISABLE_SALOMEOBJECT
 /*!Constructor. Initialize by \a SALOME_InteractiveObject.*/
 LightApp_DataOwner
 ::LightApp_DataOwner( const Handle(SALOME_InteractiveObject)& theIO ):
@@ -44,6 +45,7 @@ LightApp_DataOwner
   myIO(theIO)
 {
 }
+#endif
 
 /*!Destructor. Do nothing.*/
 LightApp_DataOwner
@@ -61,6 +63,12 @@ LightApp_DataOwner
   return other && entry() == other->entry();
 }
 
+bool LightApp_DataOwner::operator<( const SUIT_DataOwner& obj ) const
+{
+  const LightApp_DataOwner* other = dynamic_cast<const LightApp_DataOwner*>( &obj );
+  return entry() < other->entry();
+}
+
 /*!Gets entry.*/
 QString
 LightApp_DataOwner
@@ -69,6 +77,7 @@ LightApp_DataOwner
   return myEntry;
 }
 
+#ifndef DISABLE_SALOMEOBJECT
 /*!Gets SALOME_InteractiveObject.*/
 const Handle(SALOME_InteractiveObject)&
 LightApp_DataOwner
@@ -76,3 +85,4 @@ LightApp_DataOwner
 {
   return myIO;
 }
+#endif
index d76e6d411c98cd530c4ffbac39240d44b2e6b67c..849840babff364744aca190e24fe2ad577eef1d2 100644 (file)
 
 #include "LightApp.h"
 #include "SUIT_DataOwner.h"
-#include "SALOME_InteractiveObject.hxx"
+
+#ifndef DISABLE_SALOMEOBJECT
+  #include "SALOME_InteractiveObject.hxx"
+#endif
 
 /*!
   This class provide data owner objects.
 class LIGHTAPP_EXPORT LightApp_DataOwner : public SUIT_DataOwner
 {
 public:
+#ifndef DISABLE_SALOMEOBJECT
     LightApp_DataOwner( const Handle(SALOME_InteractiveObject)& theIO );
+#endif
     LightApp_DataOwner( const QString& );
     virtual ~LightApp_DataOwner();
 
     virtual bool isEqual( const SUIT_DataOwner& ) const;
+    virtual bool operator<( const SUIT_DataOwner& ) const;
+
+#ifndef DISABLE_SALOMEOBJECT
     const Handle(SALOME_InteractiveObject)& IO() const;
+#endif
     QString entry() const;
 
 private:
     QString  myEntry;
+#ifndef DISABLE_SALOMEOBJECT
     Handle(SALOME_InteractiveObject) myIO;
+#endif
 };
 
 typedef SMART(LightApp_DataOwner) LightApp_DataOwnerPtr;
index 65ce0fa3c49453b3f4bf5a35d6b5ed3cdcee0ccb..f06c8c10b16fa0b1df29c11da46c25d7ce82f545 100644 (file)
@@ -23,8 +23,6 @@
 
 #include <CAM_Study.h>
 
-#include <SALOME_InteractiveObject.hxx>
-
 #include <SUIT_Session.h>
 #include <SUIT_Desktop.h>
 #include <SUIT_ViewManager.h>
@@ -32,6 +30,9 @@
 #include <SUIT_ViewWindow.h>
 
 #include <qstring.h>
+#ifndef DISABLE_SALOMEOBJECT
+  #include "SALOME_InteractiveObject.hxx"
+#endif
 
 LightApp_Displayer::LightApp_Displayer()
 {
@@ -122,14 +123,16 @@ void LightApp_Displayer::EraseAll( const bool forced, const bool updateViewer, S
 bool LightApp_Displayer::IsDisplayed( const QString& entry, SALOME_View* theViewFrame ) const
 {
   SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView();
+  bool res = false;
   if( vf )
   {
+#ifndef DISABLE_SALOMEOBJECT
     Handle( SALOME_InteractiveObject ) temp = new SALOME_InteractiveObject();
     temp->setEntry( entry.latin1() );
-    return vf->isVisible( temp );
+    res = vf->isVisible( temp );
+#endif
   }
-  else
-    return false;
+  return res;
 }
 
 void LightApp_Displayer::UpdateViewer() const
index 7913b4edf34bf62f3bb12e05704b9faa605d4b05..c9415eb4185ab612bc03e0bb21c868b026083f29 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "LightApp_DataOwner.h"
 
-#include <SALOME_GLOwner.h>
-
 #include <GLViewer_Context.h>
 
 /*!Constructor. Initialize by GLViewer_Viewer2d and SUIT_SelectionMgr.*/
@@ -66,7 +64,7 @@ void LightApp_GLSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const
     GLViewer_Object* obj = cont->SelectedObject();
     if ( obj )
     {
-      SALOME_GLOwner* owner = dynamic_cast< SALOME_GLOwner* >( obj->owner() );
+      LightApp_GLOwner* owner = dynamic_cast< LightApp_GLOwner* >( obj->owner() );
       if( owner )
         aList.append( SUIT_DataOwnerPtr( new LightApp_DataOwner( owner->entry() ) ) );
     }
@@ -90,7 +88,7 @@ void LightApp_GLSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
     GLViewer_Object* obj = *it;
     if ( obj && obj->getVisible() )
     {
-      SALOME_GLOwner* owner = dynamic_cast< SALOME_GLOwner* >( obj->owner() );
+      LightApp_GLOwner* owner = dynamic_cast< LightApp_GLOwner* >( obj->owner() );
       if ( owner )
        aDisplayed.insert( owner->entry(), obj );
     }
@@ -115,3 +113,24 @@ void LightApp_GLSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
   if ( Nb > 0 )
     myViewer->updateAll();
 }
+
+
+LightApp_GLOwner::LightApp_GLOwner( const char* entry )
+: GLViewer_Owner()
+{
+  setEntry( entry );
+}
+
+LightApp_GLOwner::~LightApp_GLOwner()
+{
+}
+
+const char* LightApp_GLOwner::entry() const
+{
+  return myEntry.c_str();
+}
+
+void LightApp_GLOwner::setEntry( const char* entry )
+{
+  myEntry = entry;
+}
index 069669a872dbc119aff31c88813e099eded56431..f58bb761a85e402e1f56d09030efc3e2d78e6d28 100644 (file)
@@ -25,6 +25,9 @@
 
 #include <GLViewer_Viewer2d.h>
 
+#include <string>
+#include <GLViewer_Object.h>
+
 class LIGHTAPP_EXPORT LightApp_GLSelector : public SUIT_Selector
 {
   Q_OBJECT
@@ -48,4 +51,21 @@ private:
   GLViewer_Viewer2d*  myViewer;
 };
 
+
+/*!
+  This class provide data owner objects for GLViewer.
+*/
+class LIGHTAPP_EXPORT LightApp_GLOwner : public GLViewer_Owner
+{
+public:
+  LightApp_GLOwner( const char* );
+  ~LightApp_GLOwner();
+
+  const char*       entry() const;
+  void              setEntry( const char* );
+
+private:
+  std::string       myEntry;
+};
+
 #endif
index 6b4de40b649e25cdae499bd90b535b894043cde6..f80754ec42743d0f7932bb40cb02329c3af129bb 100644 (file)
 #include <SUIT_DataObject.h>
 #include <SUIT_ResourceMgr.h>
 
-#include <SVTK_ViewWindow.h>
-#include <SVTK_ViewModel.h>
-#include <OCCViewer_ViewWindow.h>
-#include <OCCViewer_ViewPort3d.h>
-#include <SOCC_ViewModel.h>
-#include <GLViewer_ViewFrame.h>
-#include <GLViewer_ViewPort.h>
-#include <Plot2d_ViewWindow.h>
-#include <Plot2d_ViewFrame.h>
-#include <SPlot2d_ViewModel.h>
+#ifndef DISABLE_VTKVIEWER
+#ifndef DISABLE_SALOMEOBJECT
+  #include <SVTK_ViewWindow.h>
+  #include <SVTK_ViewModel.h>
+#else
+  #include <VTKViewer_ViewWindow.h>
+#endif
+  #include <VTKViewer_ViewModel.h>
+#endif
+#ifndef DISABLE_OCCVIEWER
+  #include <OCCViewer_ViewWindow.h>
+  #include <OCCViewer_ViewPort3d.h>
+  #include <OCCViewer_ViewModel.h>
+#endif
+#ifndef DISABLE_GLVIEWER
+  #include <GLViewer_ViewFrame.h>
+  #include <GLViewer_ViewPort.h>
+#endif
+#ifndef DISABLE_PLOT2DVIEWER
+  #include <Plot2d_ViewWindow.h>
+  #include <Plot2d_ViewFrame.h>
+  #include <Plot2d_ViewModel.h>
+#endif
 
 #include <OB_Browser.h>
 
@@ -196,14 +209,27 @@ void LightApp_Module::update( const int theFlags )
     if ( SUIT_ViewManager* viewMgr = getApp()->activeViewManager() )
       if ( SUIT_ViewWindow* viewWnd = viewMgr->getActiveView() )
       {
+#ifndef DISABLE_VTKVIEWER
+#ifndef DISABLE_SALOMEOBJECT
         if ( viewWnd->inherits( "SVTK_ViewWindow" ) )
           ( (SVTK_ViewWindow*)viewWnd )->Repaint();
-        else if ( viewWnd->inherits( "OCCViewer_ViewWindow" ) )
+#else
+        if ( viewWnd->inherits( "VTKViewer_ViewWindow" ) )
+          ( (VTKViewer_ViewWindow*)viewWnd )->Repaint();
+#endif
+#endif
+#ifndef DISABLE_OCCVIEWER
+        if ( viewWnd->inherits( "OCCViewer_ViewWindow" ) )
           ( (OCCViewer_ViewWindow*)viewWnd )->getViewPort()->onUpdate();
-        else if ( viewWnd->inherits( "Plot2d_ViewWindow" ) )
+#endif
+#ifndef DISABLE_PLOT2DVIEWER
+        if ( viewWnd->inherits( "Plot2d_ViewWindow" ) )
           ( (Plot2d_ViewWindow*)viewWnd )->getViewFrame()->Repaint();
-        else if ( viewWnd->inherits( "GLViewer_ViewFrame" ) )
+#endif
+#ifndef DISABLE_GLVIEWER
+        if ( viewWnd->inherits( "GLViewer_ViewFrame" ) )
           ( (GLViewer_ViewFrame*)viewWnd )->getViewPort()->onUpdate();
+#endif
       }
   }
 }
@@ -280,9 +306,27 @@ QtxPopupMgr* LightApp_Module::popupMgr()
     myPopupMgr->setRule( disp, /*QString( "( not isVisible ) and " ) + */ uniform, true );
     myPopupMgr->setRule( erase, /*QString( "( isVisible ) and " ) + */ uniform, true );
     myPopupMgr->setRule( dispOnly, uniform, true );
-    QString viewers = "{ '%1' '%2' '%3' }";
-    viewers = viewers.arg( SOCC_Viewer::Type() ).arg( SVTK_Viewer::Type() ).arg( SPlot2d_Viewer::Type() );
-    myPopupMgr->setRule( eraseAll, QString( "client in %1" ).arg( viewers ), true );
+
+    QStringList viewers;
+#ifndef DISABLE_OCCVIEWER
+    viewers.append( OCCViewer_Viewer::Type() );
+#endif
+#ifndef DISABLE_VTKVIEWER
+    viewers.append( VTKViewer_Viewer::Type() );
+#endif
+#ifndef DISABLE_PLOT2DVIEWER
+    viewers.append( Plot2d_Viewer::Type() );
+#endif
+
+    if( !viewers.isEmpty() )
+    {
+      QString strViewers = "{ ", temp = "'%1' ";
+      QStringList::const_iterator anIt = viewers.begin(), aLast = viewers.end();
+      for( ; anIt!=aLast; anIt++ )
+        strViewers+=temp.arg( *anIt );
+      strViewers+="}";
+      myPopupMgr->setRule( eraseAll, QString( "client in %1" ).arg( strViewers ), true );
+    }
   }
   return myPopupMgr;
 }
index ebe8571b41214946abd565cd506913f65f89371b..22867b5f6da17dadbec74316009fd0853f27a7ca 100644 (file)
@@ -71,9 +71,13 @@ void LightApp_OBSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const
       LightApp_DataObject* obj = dynamic_cast<LightApp_DataObject*>( it.current() );
       if ( obj )
       {
+#ifndef DISABLE_SALOMEOBJECT
         Handle(SALOME_InteractiveObject) aSObj = new SALOME_InteractiveObject
           ( obj->entry(), obj->componentDataType(), obj->name() );
         LightApp_DataOwner* owner = new LightApp_DataOwner( aSObj  );
+#else
+        LightApp_DataOwner* owner = new LightApp_DataOwner( obj->entry() );
+#endif
         that->mySelectedList.append( SUIT_DataOwnerPtr( owner ) );
       }
     }
index d0b07bb7b55fa30c9272dd2a86fbb0d8f290cba9..abd30415acab295f9012e5d8e233dfb26c8eeb08 100644 (file)
@@ -20,8 +20,9 @@
 #include "LightApp_DataOwner.h"
 #include "LightApp_OCCSelector.h"
 
-#include <SALOME_InteractiveObject.hxx>
-
+#ifndef DISABLE_SALOMEOBJECT
+  #include <SALOME_InteractiveObject.hxx>
+#endif
 #include <AIS_ListOfInteractive.hxx>
 #include <AIS_ListIteratorOfListOfInteractive.hxx>
 
@@ -68,9 +69,13 @@ void LightApp_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const
   for ( AIS_ListIteratorOfListOfInteractive anIt( aSelList ); anIt.More(); anIt.Next() )
     if ( !anIt.Value().IsNull() )
     {
+#ifndef DISABLE_SALOMEOBJECT
       Handle(SALOME_InteractiveObject) anObj = Handle(SALOME_InteractiveObject)::DownCast(anIt.Value()->GetOwner());
       if( !anObj.IsNull() )
         aList.append( SUIT_DataOwnerPtr( new LightApp_DataOwner( anObj ) ) );
+#else
+      aList.append( SUIT_DataOwnerPtr( new LightApp_DataOwner( entry( anIt.Value() ) ) ) );
+#endif
     }
 }
 
@@ -112,10 +117,13 @@ QString LightApp_OCCSelector::entry( const Handle(AIS_InteractiveObject)& anAIS
   if ( anAIS.IsNull() || !anAIS->HasOwner() )
     return QString::null;
 
-  Handle(SALOME_InteractiveObject) anObj = Handle(SALOME_InteractiveObject)::DownCast(anAIS->GetOwner());
-
   QString res;
+
+#ifndef DISABLE_SALOMEOBJECT
+  Handle(SALOME_InteractiveObject) anObj = Handle(SALOME_InteractiveObject)::DownCast(anAIS->GetOwner());
   if ( !anObj.IsNull() )
     res = QString( anObj->getEntry() );
+#endif
+
   return res;
 }
index ab7a4f8b1616e2b4abf555e56a9549291cc55c91..a46e906c0736a25ca8c83f7ca47839fef6a692a1 100644 (file)
 
 #include <SUIT_Session.h>
 
-#include <SALOME_ListIO.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#ifndef DISABLE_SALOMEOBJECT
+  #include <SALOME_ListIO.hxx>
+  #include <SALOME_ListIteratorOfListIO.hxx>
 
-// Open CASCADE Include
-#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_MapIteratorOfMapOfInteger.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
+  // Open CASCADE Include
+  #include <TColStd_MapOfInteger.hxx>
+  #include <TColStd_MapIteratorOfMapOfInteger.hxx>
+  #include <TColStd_IndexedMapOfInteger.hxx>
+#endif
 
 /*!
   Constructor.
@@ -57,6 +59,7 @@ LightApp_Application* LightApp_SelectionMgr::application() const
   return myApp;
 }
 
+#ifndef DISABLE_SALOMEOBJECT
 /*!
   Get all selected objects from selection manager
 */
@@ -117,6 +120,37 @@ void LightApp_SelectionMgr::setSelectedObjects( const SALOME_ListIO& lst, const
   setSelected( owners, append );
 }
 
+#else
+/*!
+  Get all selected objects from selection manager
+*/
+void LightApp_SelectionMgr::selectedObjects( QStringList& theList, const QString& theType,
+                                             const bool convertReferences ) const
+{
+  theList.clear();
+
+  SUIT_DataOwnerPtrList aList;
+  selected( aList, theType );
+
+  QString entry;
+  for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr )
+  {
+    const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
+    if( !owner )
+      continue;
+
+    LightApp_Study* study = dynamic_cast<LightApp_Study*>( application()->activeStudy() );
+    if ( !study )
+      return;
+
+    entry = owner->entry();
+    if( !theList.contains( entry ) )
+      theList.append( entry );
+  }
+}
+
+#endif
+
 /*!
   Emit current selection changed.
 */
@@ -127,6 +161,8 @@ void LightApp_SelectionMgr::selectionChanged( SUIT_Selector* theSel )
   emit currentSelectionChanged();
 }
 
+#ifndef DISABLE_SALOMEOBJECT
+
 /*!
   get map of indexes for the given SALOME_InteractiveObject
 */
@@ -287,3 +323,5 @@ void LightApp_SelectionMgr::selectedSubOwners( MapEntryOfMapOfInteger& theMap )
     }
   }
 }
+
+#endif
index c063b82be6467fd0f2dc1b32478a91e3e2760a8b..8546dadfe738a66882384653709c74f447251328 100644 (file)
 #include "LightApp.h"
 
 #include <SUIT_SelectionMgr.h>
-#include <SALOME_InteractiveObject.hxx>
 
-#include <qmap.h>
+#ifndef DISABLE_SALOMEOBJECT
+  #include <SALOME_InteractiveObject.hxx>
+  #include <qmap.h>
+
+  class SALOME_ListIO;
+  class TColStd_IndexedMapOfInteger;
+  class TColStd_MapOfInteger;
+#else
+#include <qstringlist.h>
+#endif
 
-class SALOME_ListIO;
 class LightApp_Application;
-class TColStd_IndexedMapOfInteger;
-class TColStd_MapOfInteger;
 
 class LIGHTAPP_EXPORT LightApp_SelectionMgr : public SUIT_SelectionMgr
 {
@@ -39,11 +44,12 @@ public:
   LightApp_SelectionMgr( LightApp_Application*, const bool = true );
   virtual ~LightApp_SelectionMgr();
 
+  LightApp_Application* application() const;
+
+#ifndef DISABLE_SALOMEOBJECT
   typedef QMap< Handle(SALOME_InteractiveObject), TColStd_IndexedMapOfInteger > MapIOOfMapOfInteger;
   typedef QMap< QString, TColStd_IndexedMapOfInteger > MapEntryOfMapOfInteger;
 
-  LightApp_Application* application() const;
-
   void                   selectedObjects( SALOME_ListIO&, const QString& = QString::null, const bool = true ) const;
   void                   setSelectedObjects( const SALOME_ListIO&, const bool = false );
 
@@ -61,6 +67,9 @@ public:
   void                   selectObjects( MapIOOfMapOfInteger theMapIO, bool append );
 
   void                   selectedSubOwners( MapEntryOfMapOfInteger& theMap );
+#else
+  void                   selectedObjects( QStringList&, const QString& = QString::null, const bool = true ) const;
+#endif
 
 signals:
   void                   currentSelectionChanged();
index 52f16266f424acb5d53427b47487bb864353bd69..76827c053703d3337941be9fb967e6f32a54ae49 100644 (file)
 #include "LightApp_SelectionMgr.h"
 #include "LightApp_Selection.h"
 
-#include <SALOME_ListIO.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#ifndef DISABLE_SALOMEOBJECT
+  #include <SALOME_ListIO.hxx>
+  #include <SALOME_ListIteratorOfListIO.hxx>
+#endif
 
 LightApp_ShowHideOp::LightApp_ShowHideOp( ActionType type )
 : LightApp_Operation(),
@@ -95,21 +97,33 @@ void LightApp_ShowHideOp::startOperation()
     }
   }
 
+  QStringList entries;
+
+#ifndef DISABLE_SALOMEOBJECT
   SALOME_ListIO selObjs;
   mgr->selectedObjects( selObjs );
-
-  QStringList entries;
   SALOME_ListIteratorOfListIO anIt( selObjs );
   for( ; anIt.More(); anIt.Next() )
-  {
-    if( anIt.Value().IsNull() )
-      continue;
+    if( !anIt.Value().IsNull() )
+#else
+  QStringList selObjs;
+  mgr->selectedObjects( selObjs );
+  QStringList::const_iterator anIt = selObjs.begin(), aLast = selObjs.end();
+  for( ; ; anIt!=aLast )
+#endif
+    {
+      QString entry = 
+#ifndef DISABLE_SALOMEOBJECT
+        anIt.Value()->getEntry();
+#else
+        *anIt;
+#endif
 
-    if( study->isComponent( anIt.Value()->getEntry() ) )
-      study->children( anIt.Value()->getEntry(), entries );
-    else
-      entries.append( anIt.Value()->getEntry() );
-  }
+      if( study->isComponent( entry ) )
+        study->children( entry, entries );
+      else
+        entries.append( entry );
+    }
 
   for( QStringList::const_iterator it = entries.begin(), last = entries.end(); it!=last; it++ )
   {
index b393b3043b94976f76f106ea8193452fdcd79f9e..a81891b590abcd06cd2638900800ce50d8200808 100644 (file)
 #include "LightApp_VTKSelector.h"
 #include "LightApp_DataOwner.h"
 
-#include "SVTK_ViewModelBase.h"
-#include "SVTK_Selector.h"
-#include "SVTK_ViewWindow.h"
-#include "SVTK_Functor.h"
+#ifndef DISABLE_VTKVIEWER
+  #include "SVTK_ViewModelBase.h"
+  #include "SVTK_Selector.h"
+  #include "SVTK_ViewWindow.h"
+  #include "SVTK_Functor.h"
+  #include "VTKViewer_Algorithm.h"
+  #include <vtkRenderer.h>
+#endif
 
-#include "SALOME_Actor.h"
-#include "SALOME_ListIteratorOfListIO.hxx"
+#ifndef DISABLE_SALOMEOBJECT
+  #include "SALOME_Actor.h"
+  #include "SALOME_ListIteratorOfListIO.hxx"
+#endif
 
-#include "VTKViewer_Algorithm.h"
 
-#include <vtkRenderer.h>
 
+#ifndef DISABLE_VTKVIEWER
+#ifndef DISABLE_SALOMEOBJECT
 /*!
   Constructor.
 */
@@ -45,6 +51,7 @@ LightApp_SVTKDataOwner
 {
   myIds = theIds; // workaround - there is no constructor copy for the container
 }
+#endif
 
 /*!
   Destuctor.
@@ -64,6 +71,10 @@ LightApp_SVTKDataOwner
   return myActor.GetPointer();
 }
 
+#endif
+
+
+#ifndef DISABLE_VTKVIEWER
 /*!
   Constructor.
 */
@@ -105,6 +116,7 @@ LightApp_VTKSelector
   return myViewer->getType(); 
 }
 
+#endif
 /*!
   On selection changed.
 */
@@ -115,6 +127,8 @@ LightApp_VTKSelector
   selectionChanged();
 }
 
+#ifndef DISABLE_VTKVIEWER
+
 /*!
   Gets list of selected data owners.(output \a aList).
 */
@@ -204,3 +218,5 @@ LightApp_VTKSelector
     }
   }
 }
+
+#endif
index 14c6523ce1a2aaf4eade1e030324c71a1749d67e..7c5dca73f6fb63700994c38434bc661ce3c91ca6 100644 (file)
 #ifndef LIGHTAPP_VTKSELECTOR_H
 #define LIGHTAPP_VTKSELECTOR_H
 
-#include <vtkSmartPointer.h>
-
-#include <TColStd_IndexedMapOfInteger.hxx>
-
 #include "SUIT_Selector.h"
-
 #include "LightApp.h"
 #include "LightApp_DataOwner.h"
 
-#include "SVTK_Selection.h"
-#include "SALOME_InteractiveObject.hxx"
-
-class SALOME_Actor;
-class SVTK_ViewModelBase;
+#ifndef DISABLE_VTKVIEWER
+  #include <vtkSmartPointer.h>
+  #include <TColStd_IndexedMapOfInteger.hxx>
+  #include "SVTK_Selection.h"
+#ifndef DISABLE_SALOMEOBJECT
+  #include "SALOME_InteractiveObject.hxx"
+#endif
+  class SALOME_Actor;
+  class SVTK_ViewModelBase;
+#endif
 
 /*!
   Provide salome vtk data owner list.
@@ -40,10 +40,13 @@ class SVTK_ViewModelBase;
 class LIGHTAPP_EXPORT LightApp_SVTKDataOwner : public LightApp_DataOwner
 {
  public:
+#ifndef DISABLE_VTKVIEWER
+   #ifndef DISABLE_SALOMEOBJECT
     LightApp_SVTKDataOwner( const Handle(SALOME_InteractiveObject)& theIO,
                             const TColStd_IndexedMapOfInteger& theIds,
                             Selection_Mode theMode = ActorSelection,
                             SALOME_Actor* theActor = NULL);
+   #endif
     virtual ~LightApp_SVTKDataOwner();
 
     /*!Gets dataowners ids list.*/
@@ -64,6 +67,9 @@ class LIGHTAPP_EXPORT LightApp_SVTKDataOwner : public LightApp_DataOwner
     TColStd_IndexedMapOfInteger myIds;
     Selection_Mode mySelectionMode;
     vtkSmartPointer<SALOME_Actor> myActor;
+#else
+  LightApp_SVTKDataOwner( const QString& );
+#endif
 };
 
 
@@ -75,22 +81,29 @@ class LIGHTAPP_EXPORT LightApp_VTKSelector : public SUIT_Selector
   Q_OBJECT;
 
 public:
+#ifndef DISABLE_VTKVIEWER
   LightApp_VTKSelector( SVTK_ViewModelBase*, SUIT_SelectionMgr* );
   virtual ~LightApp_VTKSelector();
 
   SVTK_ViewModelBase* viewer() const;
 
   virtual QString type() const;
+#else
+  LightApp_VTKSelector( SUIT_SelectionMgr* );
+#endif
 
 private slots:
   void              onSelectionChanged();
 
+#ifndef DISABLE_VTKVIEWER
 protected:
   virtual void      getSelection( SUIT_DataOwnerPtrList& ) const;
   virtual void      setSelection( const SUIT_DataOwnerPtrList& );
 
 private:
   SVTK_ViewModelBase* myViewer;
+
+#endif
 };
 
 #endif
index 3ffef04491b2f2e3def1bc0517acf859bc3e06c7..fc43d9593b99c8cfd1c79c4784cb751207161ecc 100755 (executable)
@@ -22,13 +22,11 @@ EXPORT_HEADERS= LightApp.h \
                LightApp_Dialog.h \
                LightApp_Displayer.h \
                LightApp_Driver.h \
-               LightApp_GLSelector.h \
                LightApp_Module.h \
                LightApp_ModuleDlg.h \
                LightApp_NameDlg.h \
                LightApp_OBFilter.h \
                LightApp_OBSelector.h \
-               LightApp_OCCSelector.h \
                LightApp_Operation.h \
                LightApp_Selection.h \
                LightApp_SelectionMgr.h \
@@ -39,10 +37,21 @@ EXPORT_HEADERS= LightApp.h \
                LightApp_PreferencesDlg.h \
                LightApp_RootObject.h \
                LightApp_UpdateFlags.h \
-               LightApp_VTKSelector.h \
                LightApp_WidgetContainer.h
 #               LightApp_HDFDriver.h \
 
+ifneq ($(DISABLE_VTKVIEWER),yes)
+ifneq ($(DISABLE_SALOMEOBJECT),yes)
+  EXPORT_HEADERS+= LightApp_VTKSelector.h
+endif
+endif
+ifneq ($(DISABLE_OCCVIEWER),yes)
+  EXPORT_HEADERS+= LightApp_OCCSelector.h
+endif
+ifneq ($(DISABLE_GLVIEWER),yes)
+  EXPORT_HEADERS+= LightApp_GLSelector.h
+endif
+
 # .po files to transform in .qm
 PO_FILES = LightApp_images.po \
           LightApp_msg_en.po
@@ -59,13 +68,11 @@ LIB_SRC= LightApp_AboutDlg.cxx \
         LightApp_Dialog.cxx \
         LightApp_Displayer.cxx \
         LightApp_Driver.cxx \
-        LightApp_GLSelector.cxx \
         LightApp_Module.cxx \
         LightApp_ModuleDlg.cxx \
         LightApp_NameDlg.cxx \
         LightApp_OBFilter.cxx \
         LightApp_OBSelector.cxx \
-        LightApp_OCCSelector.cxx \
         LightApp_Operation.cxx \
         LightApp_Selection.cxx \
         LightApp_SelectionMgr.cxx \
@@ -74,17 +81,26 @@ LIB_SRC= LightApp_AboutDlg.cxx \
         LightApp_SwitchOp.cxx \
         LightApp_Preferences.cxx \
         LightApp_PreferencesDlg.cxx \
-        LightApp_VTKSelector.cxx \
         LightApp_WidgetContainer.cxx
 #        LightApp_HDFDriver.cxx \
 
+ifneq ($(DISABLE_VTKVIEWER),yes)
+ifneq ($(DISABLE_SALOMEOBJECT),yes)
+  LIB_SRC+= LightApp_VTKSelector.cxx
+endif
+endif
+ifneq ($(DISABLE_OCCVIEWER),yes)
+  LIB_SRC+= LightApp_OCCSelector.cxx
+endif
+ifneq ($(DISABLE_GLVIEWER),yes)
+  LIB_SRC+= LightApp_GLSelector.cxx
+endif
+
 LIB_MOC = LightApp_AboutDlg.h \
          LightApp_Application.h \
          LightApp_DataModel.h \
          LightApp_Dialog.h \
-         LightApp_GLSelector.h \
          LightApp_OBSelector.h \
-         LightApp_OCCSelector.h \
          LightApp_Operation.h \
          LightApp_Module.h \
          LightApp_ModuleDlg.h \
@@ -95,9 +111,20 @@ LIB_MOC = LightApp_AboutDlg.h \
          LightApp_SwitchOp.h \
          LightApp_Preferences.h \
          LightApp_PreferencesDlg.h \
-         LightApp_VTKSelector.h \
          LightApp_WidgetContainer.h
 
+ifneq ($(DISABLE_VTKVIEWER),yes)
+ifneq ($(DISABLE_SALOMEOBJECT),yes)
+  LIB_MOC+= LightApp_VTKSelector.h
+endif
+endif
+ifneq ($(DISABLE_OCCVIEWER),yes)
+  LIB_MOC+= LightApp_OCCSelector.h
+endif
+ifneq ($(DISABLE_GLVIEWER),yes)
+  LIB_MOC+= LightApp_GLSelector.h
+endif
+
 RESOURCES_FILES = icon_about.png \
                  icon_applogo.png \
                  icon_default.png \
@@ -107,11 +134,73 @@ RESOURCES_FILES = icon_about.png \
                  LightApp.ini \
                  LightApp.xml
 
-CPPFLAGS+=$(PYTHON_INCLUDES) $(QT_INCLUDES) $(QWT_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) 
+CPPFLAGS+=$(PYTHON_INCLUDES) $(QT_INCLUDES) $(OCC_INCLUDES)
        #$(HDF5_INCLUDES)
 
-LDFLAGS+=$(PYTHON_LIBS) $(QT_MT_LIBS)
-LIBS+= -lsuit -lstd -lCAM -lObjBrowser -lLogWindow $(CAS_KERNEL) -lGLViewer -lOCCViewer -lVTKViewer -lSalomeObject -lSOCC -lSVTK -lSPlot2d -lSUPERVGraph -lPyInterp -lPythonConsole 
+ifneq ($(DISABLE_VTKVIEWER),yes)
+  CPPFLAGS+= $(VTK_INCLUDES)
+else
+  CPPFLAGS+= -DDISABLE_VTKVIEWER
+endif
+ifneq ($(DISABLE_PLOT2DVIEWER),yes)
+  CPPFLAGS+= $(QWT_INCLUDES)
+else
+  CPPFLAGS+= -DDISABLE_PLOT2DVIEWER
+endif
+ifeq ($(DISABLE_OCCVIEWER),yes)
+  CPPFLAGS+= -DDISABLE_OCCVIEWER
+endif
+ifneq ($(DISABLE_PYCONSOLE),yes)
+  CPPFLAGS+= $(PYTHON_INCLUDES)
+else
+  CPPFLAGS+= -DDISABLE_PYCONSOLE
+endif
+ifeq ($(DISABLE_GLVIEWER),yes)
+  CPPFLAGS+= -DDISABLE_GLVIEWER
+endif
+ifeq ($(DISABLE_SUPERVGRAPHVIEWER),yes)
+  CPPFLAGS+= -DDISABLE_SUPERVGRAPHVIEWER
+endif
+ifeq ($(DISABLE_SALOMEOBJECT),yes)
+  CPPFLAGS+= -DDISABLE_SALOMEOBJECT
+endif
+
+LDFLAGS+=$(QT_MT_LIBS)
+ifneq ($(DISABLE_PYCONSOLE),yes)
+  LDFLAGS+= $(PYTHON_LIBS)
+endif
+
+LIBS+= -lsuit -lstd -lCAM -lObjBrowser -lLogWindow $(CAS_KERNEL) -lSalomePrs
        #$(HDF5_LIBS) -lSalomeHDFPersistCopy
+ifneq ($(DISABLE_SALOMEOBJECT),yes)
+  LIBS+= -lSalomeObject
+endif
+ifneq ($(DISABLE_VTKVIEWER),yes)
+  LIBS+= -lVTKViewer
+ifneq ($(DISABLE_SALOMEOBJECT),yes)
+  LIBS+= -lSVTK
+endif
+endif
+ifneq ($(DISABLE_OCCVIEWER),yes)
+  LIBS+= -lOCCViewer
+ifneq ($(DISABLE_SALOMEOBJECT),yes)
+  LIBS+= -lSOCC
+endif
+endif
+ifneq ($(DISABLE_GLVIEWER),yes)
+  LIBS+= -lGLViewer
+endif
+ifneq ($(DISABLE_PLOT2DVIEWER),yes)
+  LIBS+= -lPlot2d
+ifneq ($(DISABLE_SALOMEOBJECT),yes)
+  LIBS+= -lSPlot2d
+endif
+endif
+ifneq ($(DISABLE_PYCONSOLE),yes)
+  LIBS+= -lPyInterp -lPythonConsole
+endif
+ifneq ($(DISABLE_SUPERVGRAPHVIEWER),yes)
+  LIBS+= -lSUPERVGraph
+endif
 
 @CONCLUDE@