From: asl Date: Fri, 3 Nov 2017 06:43:02 +0000 (+0300) Subject: refs #1341: now the tests application does not link with LightApp since this package... X-Git-Tag: v2.1~67^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FBR_DEMO;p=modules%2Fhydro.git refs #1341: now the tests application does not link with LightApp since this package is linked with CORBA --- diff --git a/src/HYDROGUI/HYDROGUI_DataObject.cxx b/src/HYDROGUI/HYDROGUI_DataObject.cxx index 890e29a9..ffaefe83 100644 --- a/src/HYDROGUI/HYDROGUI_DataObject.cxx +++ b/src/HYDROGUI/HYDROGUI_DataObject.cxx @@ -38,7 +38,9 @@ HYDROGUI_DataObject::HYDROGUI_DataObject( SUIT_DataObject* theParent, const QString& theParentEntry, const bool theIsInOperation ) : CAM_DataObject( theParent ), +#ifndef TEST_MODE LightApp_DataObject( theParent ), +#endif myData( theData ), myParentEntry( theParentEntry ), myIsValid( true ), @@ -49,7 +51,7 @@ HYDROGUI_DataObject::HYDROGUI_DataObject( SUIT_DataObject* theParent, QString HYDROGUI_DataObject::entry() const { QString anEntry = HYDROGUI_DataObject::dataObjectEntry( modelObject() ); - if( isReference() ) + if( !refEntry().isEmpty() ) anEntry.prepend( myParentEntry + "_" ); return anEntry; } @@ -70,7 +72,7 @@ QString HYDROGUI_DataObject::name() const QFont HYDROGUI_DataObject::font( const int theId ) const { - QFont aFont = LightApp_DataObject::font( theId ); + QFont aFont = PARENT::font( theId ); if( theId == NameId ) { Handle(HYDROData_Entity) aDataObject = modelObject(); @@ -129,7 +131,7 @@ QColor HYDROGUI_DataObject::color( const ColorRole theRole, const int theId ) co } if ( !aColor.isValid() ) { - aColor = LightApp_DataObject::color( theRole, theId ); + aColor = PARENT::color( theRole, theId ); } return aColor; @@ -166,7 +168,7 @@ QPixmap HYDROGUI_DataObject::icon( const int theId ) const return aResMgr->loadPixmap( "HYDRO", anIcon ); } - return LightApp_DataObject::icon( theId ); + return PARENT::icon( theId ); } QString HYDROGUI_DataObject::dataObjectEntry( const Handle(HYDROData_Entity)& theObject, @@ -211,7 +213,7 @@ bool HYDROGUI_DataObject::renameAllowed( const int theColumnId ) const } else { - aRes = LightApp_DataObject::renameAllowed( theColumnId ); + aRes = PARENT::renameAllowed( theColumnId ); } return aRes; } @@ -235,7 +237,9 @@ HYDROGUI_NamedObject::HYDROGUI_NamedObject( SUIT_DataObject* theParent, const QString& theParentEntry, const bool theIsInOperation ) : CAM_DataObject( theParent ), +#ifndef TEST_MODE LightApp_DataObject( theParent ), +#endif myName( theName ), myParentEntry( theParentEntry ), myIsInOperation( theIsInOperation ) @@ -262,12 +266,12 @@ QPixmap HYDROGUI_NamedObject::icon( const int theId ) const { return aResMgr->loadPixmap( "HYDRO", QObject::tr( "PARTITION_ICO" ) ); } - return LightApp_DataObject::icon( theId ); + return PARENT::icon( theId ); } QFont HYDROGUI_NamedObject::font( const int theId ) const { - QFont aFont = LightApp_DataObject::font( theId ); + QFont aFont = PARENT::font( theId ); if( theId == NameId ) { if ( dynamic_cast( parent() ) ) diff --git a/src/HYDROGUI/HYDROGUI_DataObject.h b/src/HYDROGUI/HYDROGUI_DataObject.h index caa5eba4..12dfa710 100644 --- a/src/HYDROGUI/HYDROGUI_DataObject.h +++ b/src/HYDROGUI/HYDROGUI_DataObject.h @@ -27,7 +27,18 @@ #pragma warning( disable: 4251 ) #endif -#include +#ifdef TEST_MODE + #include + enum { + EntryId = CAM_DataObject::VisibilityId + 1, //!< entry column + RefEntryId //!< reference entry column + }; + #define PARENT CAM_DataObject +#else + #include + #define PARENT LightApp_DataObject +#endif + #include #include #include @@ -47,7 +58,7 @@ * This class inherits CAM_DataObject virtually, so it is necessary to call in the class * constructor the CAM object constructor manually for the correct initialization */ -class HYDROGUI_DataObject : public LightApp_DataObject +class HYDROGUI_DataObject : public PARENT { public: //! Column id @@ -166,7 +177,7 @@ protected: * This class inherits CAM_DataObject virtually, so it is necessary to call in the class * constructor the CAM object constructor manually for the correct initialization */ -class HYDROGUI_NamedObject : public virtual LightApp_DataObject +class HYDROGUI_NamedObject : public virtual PARENT { public: /** diff --git a/src/HYDROGUI/HYDROGUI_ListSelector.cxx b/src/HYDROGUI/HYDROGUI_ListSelector.cxx index a973b035..7ae11a62 100644 --- a/src/HYDROGUI/HYDROGUI_ListSelector.cxx +++ b/src/HYDROGUI/HYDROGUI_ListSelector.cxx @@ -20,7 +20,26 @@ #include "HYDROGUI_OrderedListWidget.h" -#include +#ifdef TEST_MODE + #include + class TestOwner : public SUIT_DataOwner + { + public: + TestOwner( const QString& entry ) { myEntry = entry; } + virtual ~TestOwner() {} + + QString keyString() const { return myEntry; } + QString entry() const { return myEntry; } + + private: + QString myEntry; + }; + #define OWNER_CLASS TestOwner + +#else + #include + #define OWNER_CLASS LightApp_DataOwner +#endif HYDROGUI_ListSelector::HYDROGUI_ListSelector( HYDROGUI_OrderedListWidget* theListWidget, @@ -57,7 +76,7 @@ void HYDROGUI_ListSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const foreach ( const QString& anEntry, aSelectedEntries ) { if ( !anEntry.isEmpty() ) { - theList.append( SUIT_DataOwnerPtr( new LightApp_DataOwner( anEntry ) ) ); + theList.append( SUIT_DataOwnerPtr( new OWNER_CLASS( anEntry ) ) ); } } } @@ -73,7 +92,7 @@ void HYDROGUI_ListSelector::setSelection( const SUIT_DataOwnerPtrList& theList ) QStringList aSelectedEntries; SUIT_DataOwnerPtrList::const_iterator anIt = theList.begin(); for ( ; anIt != theList.end(); ++anIt ) { - const LightApp_DataOwner* anOwner = dynamic_cast( (*anIt).operator->() ); + const OWNER_CLASS* anOwner = dynamic_cast( (*anIt).operator->() ); if ( anOwner ) { aSelectedEntries << anOwner->entry(); } diff --git a/src/HYDROGUI/HYDROGUI_ViewerDlg.cxx b/src/HYDROGUI/HYDROGUI_ViewerDlg.cxx index f82ae06e..bf82bf40 100644 --- a/src/HYDROGUI/HYDROGUI_ViewerDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_ViewerDlg.cxx @@ -47,7 +47,7 @@ HYDROGUI_ViewerDlg::HYDROGUI_ViewerDlg( HYDROGUI_Module* theModule, const QStrin : HYDROGUI_InputPanel( theModule, theTitle, true, isSplitter ) { SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr(); - SUIT_Study* aStudy = theModule ? theModule->getApp()->activeStudy() : 0; + SUIT_Study* aStudy = theModule ? theModule->application()->activeStudy() : 0; myViewManager = new OCCViewer_ViewManager( aStudy, 0 ); OCCViewer_Viewer* aViewer = new OCCViewer_Viewer( true ); @@ -144,6 +144,10 @@ OCCViewer_ViewManager* HYDROGUI_ViewerDlg::viewManager() const SUIT_SelectionMgr* HYDROGUI_ViewerDlg::selectionMgr() const { +#ifdef TEST_MODE + static SUIT_SelectionMgr* mgr = new SUIT_SelectionMgr(); + return mgr; +#else SUIT_SelectionMgr* aSelMgr = 0; if ( module() ) { @@ -152,6 +156,7 @@ SUIT_SelectionMgr* HYDROGUI_ViewerDlg::selectionMgr() const aSelMgr = app->selectionMgr(); } return aSelMgr; +#endif } void HYDROGUI_ViewerDlg::onMouseMove( SUIT_ViewWindow* theViewWindow, QMouseEvent* theEvent ) diff --git a/src/HYDRO_tests/CMakeLists.txt b/src/HYDRO_tests/CMakeLists.txt index 0617a98d..e446a72c 100644 --- a/src/HYDRO_tests/CMakeLists.txt +++ b/src/HYDRO_tests/CMakeLists.txt @@ -109,7 +109,10 @@ ELSE() ENDIF() link_directories( $ENV{KERNEL_ROOT_DIR}/lib/salome $ENV{GUI_ROOT_DIR}/lib/salome $ENV{GEOM_ROOT_DIR}/lib/salome ) -SET( GUI_LIBRARIES ImageComposer qtx suit LightApp CAM OCCViewer ) + +SET( GUI_LIBRARIES ImageComposer qtx suit CAM OCCViewer GraphicsView ) +# Please do not link with LightApp since in the full SALOME it is linked with CORBA (omniORB) + SET( GEOM_LIBRARIES CurveCreator GEOMUtils GEOMUtils ) link_directories( $ENV{ECWLIB_ROOT_DIR}/lib )