@REM -------------------------
+@SET NewGeomResources=%ROOT_DIR%\install\resources
+
rem -------- Visual Studio --------------------
rem Detect Visual Studio (either commercial or Express edition)
if "%VS100COMNTOOLS%" == "" (
${CMAKE_SOURCE_DIR}/src/SketchPlugin
${CMAKE_SOURCE_DIR}/src/GeomAPI
${CAS_INCLUDE_DIRS}
+ ${SUIT_INCLUDE}
)
ADD_DEFINITIONS(-DPARTSET_EXPORTS ${CAS_DEFINITIONS})
XGUI_Viewer.h
XGUI_RubberBand.h
XGUI_Constants.h
- XGUI_ViewBackground.h
XGUI_DocumentDataModel.h
XGUI_PartDataModel.h
XGUI_ObjectsBrowser.h
XGUI_ViewPort.cpp
XGUI_Viewer.cpp
XGUI_RubberBand.cpp
- XGUI_ViewBackground.cpp
XGUI_DocumentDataModel.cpp
XGUI_PartDataModel.cpp
XGUI_ObjectsBrowser.cpp
XGUI_pictures.qrc
)
+SET(PREFERENCES_XML
+ NewGeom.xml
+)
+
SET(TEXT_RESOURCES
XGUI_msg_fr.ts
)
${CAS_KERNEL}
${PyConsole}
${PyInterp}
+ ${suit}
+ ${qtx}
ModelAPI
ModuleBase
)
SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC} ${PROJECT_COMPILED_RESOURCES} ${QM_RESOURCES})
#SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC} ${PROJECT_COMPILED_RESOURCES})
-SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES} ${PROJECT_RESOURCES})
+SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES} ${PROJECT_RESOURCES} ${PREFERENCES_XML})
ADD_DEFINITIONS( -DXGUI_EXPORTS ${CAS_DEFINITIONS} )
${PROJECT_COMPILED_RESOURCES}
${TEXT_RESOURCES}
${QM_RESOURCES}
+ ${PREFERENCES_XML}
)
ADD_DEPENDENCIES(XGUI ModelAPI)
INSTALL(TARGETS XGUI DESTINATION bin)
INSTALL(FILES ${QM_RESOURCES} DESTINATION bin)
+INSTALL(FILES ${PREFERENCES_XML} DESTINATION resources)
--- /dev/null
+<!--
+-->
+<document>
+ <section name="Viewer" >
+ <!-- OCC viewer preferences -->
+ <parameter name="background" value="bt=2;fn=;tm=0;ts=false;c1=#cddbff;c2=#698fff;gt=1;gr=" />
+ </section>
+</document>
/*!
Sets the background data
*/
-void XGUI_ViewPort::setBackground(const XGUI_ViewBackground& bgData)
+void XGUI_ViewPort::setBackground(const Qtx::BackgroundData& bgData)
{
if (bgData.isValid()) {
myBackground = bgData;
#define XGUI_ViewPort_H
#include "XGUI.h"
-#include "XGUI_ViewBackground.h"
+
+#include <Qtx.h>
#include <QWidget>
#include <V3d_Viewer.hxx>
return myIsAdvancedZoomingEnabled;
}
- XGUI_ViewBackground background() const
+ Qtx::BackgroundData background() const
{
return myBackground;
}
- void setBackground(const XGUI_ViewBackground& bgData);
+ void setBackground(const Qtx::BackgroundData& bgData);
void syncronizeWith( const XGUI_ViewPort* ref );
signals:
- void vpChangeBackground(const XGUI_ViewBackground&);
+ void vpChangeBackground(const Qtx::BackgroundData&);
void vpClosed();
void vpMapped();
void vpTransformed();
double myScale;
- XGUI_ViewBackground myBackground;
+ Qtx::BackgroundData myBackground;
int myBgImgHeight;
int myBgImgWidth;
};
setTransformRequested(NOTHING);
}
-XGUI_ViewBackground XGUI_ViewWindow::background() const
+Qtx::BackgroundData XGUI_ViewWindow::background() const
{
- return myViewPort ? myViewPort->background() : XGUI_ViewBackground();
+ return myViewPort ? myViewPort->background() : Qtx::BackgroundData();
}
-void XGUI_ViewWindow::setBackground(const XGUI_ViewBackground& theBackground)
+void XGUI_ViewWindow::setBackground(const Qtx::BackgroundData& theBackground)
{
if (myViewPort)
myViewPort->setBackground( theBackground );
#include "XGUI.h"
#include "XGUI_Constants.h"
-#include "XGUI_ViewBackground.h"
+
+#include <Qtx.h>
#include <QFrame>
#include <QIcon>
bool transformEnabled(const OperationType) const;
//! Returns View background object
- XGUI_ViewBackground background() const;
+ Qtx::BackgroundData background() const;
//! Sets View background object
- void setBackground(const XGUI_ViewBackground& theBackground);
+ void setBackground(const Qtx::BackgroundData& theBackground);
//! Returns true if the current view window can be closed
bool closable() const { return myClosable; }
#include "XGUI_MainWindow.h"
#include "XGUI_ViewWindow.h"
#include "XGUI_ViewPort.h"
+#include "XGUI_Workshop.h"
+
+#include <SUIT_ResourceMgr.h>
#include <QMdiArea>
#include <QMdiSubWindow>
if (myViews.size() == 0)
setTrihedronShown(true);
- view->setBackground(XGUI_ViewBackground(XGUI::VerticalGradient, Qt::white, QColor(Qt::blue).lighter()));
- //view->setBackground(XGUI_ViewBackground(Qt::black));
+ Qtx::BackgroundData aBk = XGUI_Workshop::resourceMgr()->backgroundValue("Viewer", "background");
+ view->setBackground(aBk);
view->updateEnabledDrawMode();
QMdiArea* aMDI = myMainWindow->mdiArea();
#include <Config_PointerMessage.h>
#include <Config_ModuleReader.h>
+#include <SUIT_ResourceMgr.h>
+
#include <QApplication>
#include <QFileDialog>
#include <QMessageBox>
#include <dlfcn.h>
#endif
+SUIT_ResourceMgr* XGUI_Workshop::myResourceMgr = 0;
QMap<QString, QString> XGUI_Workshop::myIcons;
myObjectBrowser(0),
myDisplayer(0)
{
+ if (!myResourceMgr) {
+ myResourceMgr = new SUIT_ResourceMgr("NewGeom");
+ myResourceMgr->setCurrentFormat("xml");
+ }
myMainWindow = mySalomeConnector? 0 : new XGUI_MainWindow();
myDisplayer = new XGUI_Displayer(this);
class ModelAPI_ObjectDeletedMessage;
class QAction;
+class SUIT_ResourceMgr;
+
/**\class XGUI_Workshop
* \ingroup GUI
* \brief Class which defines a configuration of the application (Workshop) and launches it.
//! Returns icon name according to feature Id
static QString featureIcon(const std::string& theId);
+ static SUIT_ResourceMgr* resourceMgr() { return myResourceMgr; }
+
//! Activates or deactivates a part
//! If PartPtr is Null pointer then PartSet will be activated
void activatePart(ResultPartPtr theFeature);
QString myCurrentDir;
static QMap<QString, QString> myIcons;
+ static SUIT_ResourceMgr* myResourceMgr;
+
};
#endif