// 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",
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() );
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() );
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() ) );
}
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()
{
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() ) );
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() )
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
}
QFont f;
+#ifndef DISABLE_PYCONSOLE
if( wid->inherits( "PythonConsole" ) )
{
if( resourceMgr()->hasValue( "PyConsole", "font" ) )
}
}
else
+#endif
f = wid->font();
myWindows[flag]->insert( sId, wid );
return lw;
}
+#ifndef DISABLE_PYCONSOLE
/*!Get "PythonConsole"*/
PythonConsole* LightApp_Application::pythonConsole()
{
console = (PythonConsole*)wid;
return console;
}
+#endif
/*!Update obect browser*/
void LightApp_Application::updateObjectBrowser( const bool updateModels )
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 )
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();
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 );
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 )
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;
ob->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
}
+#ifndef DISABLE_PYCONSOLE
else if ( flag == WT_PyConsole )
{
PythonConsole* pyCons = new PythonConsole( desktop() );
wid = pyCons;
// pyCons->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
}
+#endif
else if ( flag == WT_LogWindow )
{
LogWindow* logWin = new LogWindow( desktop() );
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 );
}
if ( !resMgr )
return;
+#ifndef DISABLE_OCCVIEWER
if ( sec == QString( "OCCViewer" ) && param == QString( "trihedron_size" ) )
{
int sz = resMgr->integerValue( sec, param, -1 );
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 )
{
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;
mgr->getOCCViewer()->setIsos( u, v );
}
}
+#endif
if( sec=="ObjectBrowser" )
{
updateWindows();
}
+#ifndef DISABLE_PYCONSOLE
if( sec=="PyConsole" )
{
if( param=="font" )
if( pythonConsole() )
pythonConsole()->setFont( resMgr->fontValue( "PyConsole", "font" ) );
}
+#endif
}
/*!Update desktop title.*/
class LogWindow;
class OB_Browser;
-class PythonConsole;
+#ifndef DISABLE_PYCONSOLE
+ class PythonConsole;
+#endif
class STD_Application;
class LightApp_WidgetContainer;
class LightApp_Preferences;
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();
LogWindow* logWindow();
OB_Browser* objectBrowser();
+#ifndef DISABLE_PYCONSOLE
PythonConsole* pythonConsole();
+#endif
virtual void updateObjectBrowser( const bool = true );
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;
{
}
+#ifndef DISABLE_SALOMEOBJECT
/*!Constructor. Initialize by \a SALOME_InteractiveObject.*/
LightApp_DataOwner
::LightApp_DataOwner( const Handle(SALOME_InteractiveObject)& theIO ):
myIO(theIO)
{
}
+#endif
/*!Destructor. Do nothing.*/
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
return myEntry;
}
+#ifndef DISABLE_SALOMEOBJECT
/*!Gets SALOME_InteractiveObject.*/
const Handle(SALOME_InteractiveObject)&
LightApp_DataOwner
{
return myIO;
}
+#endif
#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;
#include <CAM_Study.h>
-#include <SALOME_InteractiveObject.hxx>
-
#include <SUIT_Session.h>
#include <SUIT_Desktop.h>
#include <SUIT_ViewManager.h>
#include <SUIT_ViewWindow.h>
#include <qstring.h>
+#ifndef DISABLE_SALOMEOBJECT
+ #include "SALOME_InteractiveObject.hxx"
+#endif
LightApp_Displayer::LightApp_Displayer()
{
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
#include "LightApp_DataOwner.h"
-#include <SALOME_GLOwner.h>
-
#include <GLViewer_Context.h>
/*!Constructor. Initialize by GLViewer_Viewer2d and SUIT_SelectionMgr.*/
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() ) ) );
}
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 );
}
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;
+}
#include <GLViewer_Viewer2d.h>
+#include <string>
+#include <GLViewer_Object.h>
+
class LIGHTAPP_EXPORT LightApp_GLSelector : public SUIT_Selector
{
Q_OBJECT
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
#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>
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
}
}
}
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;
}
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 ) );
}
}
#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>
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
}
}
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;
}
#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.
return myApp;
}
+#ifndef DISABLE_SALOMEOBJECT
/*!
Get all selected objects from selection manager
*/
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.
*/
emit currentSelectionChanged();
}
+#ifndef DISABLE_SALOMEOBJECT
+
/*!
get map of indexes for the given SALOME_InteractiveObject
*/
}
}
}
+
+#endif
#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
{
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 );
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();
#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(),
}
}
+ 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++ )
{
#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.
*/
{
myIds = theIds; // workaround - there is no constructor copy for the container
}
+#endif
/*!
Destuctor.
return myActor.GetPointer();
}
+#endif
+
+
+#ifndef DISABLE_VTKVIEWER
/*!
Constructor.
*/
return myViewer->getType();
}
+#endif
/*!
On selection changed.
*/
selectionChanged();
}
+#ifndef DISABLE_VTKVIEWER
+
/*!
Gets list of selected data owners.(output \a aList).
*/
}
}
}
+
+#endif
#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.
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.*/
TColStd_IndexedMapOfInteger myIds;
Selection_Mode mySelectionMode;
vtkSmartPointer<SALOME_Actor> myActor;
+#else
+ LightApp_SVTKDataOwner( const QString& );
+#endif
};
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
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 \
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
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 \
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 \
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 \
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@