../Config
${CAS_INCLUDE_DIRS}
)
+
+INSTALL(TARGETS Model DESTINATION bin)
return shared_ptr<ModelAPI_Iterator>(new Model_Iterator(aThis, groupLabel(theGroup)));
}
+shared_ptr<ModelAPI_Feature> Model_Document::feature(const string& theGroupID, const int theIndex)
+{
+ // TODO: optimize this method
+ shared_ptr<ModelAPI_Iterator> anIter = featuresIterator(theGroupID);
+ for(int a = 0; a != theIndex; anIter->next()) a++;
+ return anIter->current();
+}
+
Model_Document::Model_Document(const std::string theID)
: myID(theID), myDoc(new TDocStd_Document("BinOcaf")) // binary OCAF format
{
MODEL_EXPORT virtual const std::string& id() const {return myID;}
+ //! Returns the feature in the group by the index (started from zero)
+ MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Feature>
+ feature(const std::string& theGroupID, const int theIndex);
+
protected:
//! Returns (creates if needed) the group label
ENDIF(WIN32)
INSTALL(TARGETS _ModelAPI DESTINATION swig)
+INSTALL(TARGETS ModelAPI DESTINATION bin)
#INSTALL(TARGETS ${SWIG_SCRIPTS} DESTINATION swig)
MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Iterator> featuresIterator(
const std::string theGroup) = 0;
+ ///! Returns the id of hte document
MODELAPI_EXPORT virtual const std::string& id() const = 0;
+ //! Returns the feature in the group by the index (started from zero)
+ MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Feature>
+ feature(const std::string& theGroupID, const int theIndex) = 0;
+
protected:
/// Only for SWIG wrapping it is here
MODELAPI_EXPORT ModelAPI_Document()
class PyConsole_EnhInterp;
class QMenu;
-class PYCONSOLE_EXPORT PyConsole_Console : public QWidget//, public SUIT_PopupClient
+//PYCONSOLE_EXPORT
+class PyConsole_Console : public QWidget//, public SUIT_PopupClient
{
Q_OBJECT
* Similar to PyConsole_Console except that an enhanced interpreter and enhanced editor
* are encapsulated.
*/
-class PYCONSOLE_EXPORT PyConsole_EnhConsole: public PyConsole_Console
+//PYCONSOLE_EXPORT
+class PyConsole_EnhConsole: public PyConsole_Console
{
Q_OBJECT
class PyInterp_Request;
class QEventLoop;
-class PYCONSOLE_EXPORT PyConsole_Editor : public QTextEdit
+//PYCONSOLE_EXPORT
+class PyConsole_Editor : public QTextEdit
{
Q_OBJECT;
/**
* Enhanced Python editor handling tab completion.
*/
-class PYCONSOLE_EXPORT PyConsole_EnhEditor: public PyConsole_Editor
+//PYCONSOLE_EXPORT
+class PyConsole_EnhEditor: public PyConsole_Editor
{
Q_OBJECT;
* Enhanced Python interpreter used for auto-completion.
* This extends PyConsole_Interp with an API wrapping the Python dir() command nicely.
*/
-class PYCONSOLE_EXPORT PyConsole_EnhInterp: public PyConsole_Interp
+//PYCONSOLE_EXPORT
+class PyConsole_EnhInterp: public PyConsole_Interp
{
public:
PyConsole_EnhInterp()
#include <PyInterp_Interp.h> /// !!! WARNING !!! THIS INCLUDE MUST BE VERY FIRST !!!
-class PYCONSOLE_EXPORT PyConsole_Interp : public PyInterp_Interp
+//PYCONSOLE_EXPORT
+class PyConsole_Interp : public PyInterp_Interp
{
public:
PyConsole_Interp();
//! SALOME custom event type
#define PyEvent_EVENT QEvent::Type( QEvent::User + 10000 )
-class PYEVENT_EXPORT PyEvent_CustomEvent : public QEvent
+// PYEVENT_EXPORT
+class PyEvent_CustomEvent : public QEvent
{
public:
PyEvent_CustomEvent( int type );
class QSemaphore;
-class PYEVENT_EXPORT PyEvent_Event
+//PYEVENT_EXPORT
+class PyEvent_Event
{
public:
PyEvent_Event();
This event filter can be installed by any application that intends to use PyEvent_Event mechanism asynchronously.
This class replaced SalomeApp_EventFilter.
*/
-class PYEVENT_EXPORT PyEvent_EventFilter: public QObject
+//PYEVENT_EXPORT
+class PyEvent_EventFilter: public QObject
{
public:
static void Init();
class QObject;
class PyInterp_Watcher;
-class PYINTERP_EXPORT PyInterp_Dispatcher : protected QThread
+//PYINTERP_EXPORT
+class PyInterp_Dispatcher : protected QThread
{
PyInterp_Dispatcher(); // private constructor
* Events thrown by the interpreter having executed a command and indicating
* the return status.
*/
-class PYINTERP_EXPORT PyInterp_Event : public QEvent
+//PYINTERP_EXPORT
+class PyInterp_Event : public QEvent
{
PyInterp_Event();
PyInterp_Event( const PyInterp_Event& );
#include <list>
#include <string>
-class PYINTERP_EXPORT PyLockWrapper
+//PYINTERP_EXPORT
+class PyLockWrapper
{
PyThreadState* myThreadState;
PyThreadState* mySaveThreadState;
typedef void PyOutChanged(void* data,char * c);
-class PYINTERP_EXPORT PyInterp_Interp
+//PYINTERP_EXPORT
+class PyInterp_Interp
{
public:
static int _argc;
virtual bool initContext() = 0;
};
-class PYINTERP_EXPORT PyObjWrapper
+//PYINTERP_EXPORT
+class PyObjWrapper
{
PyObject* myObject;
public:
class PyInterp_ExecuteEvent;
class PyConsole_Editor;
-class PYINTERP_EXPORT PyInterp_Request
+// PYINTERP_EXPORT
+class PyInterp_Request
{
friend class PyInterp_Dispatcher;
friend class PyInterp_ExecuteEvent;
QObject* myListener;
};
-class PYINTERP_EXPORT PyInterp_LockRequest : public PyInterp_Request
+//PYINTERP_EXPORT
+class PyInterp_LockRequest : public PyInterp_Request
{
public:
#include <QObject>
// Private class that keeps track of destructions of request listeners
-class PYINTERP_EXPORT PyInterp_Watcher : public QObject
+//PYINTERP_EXPORT
+class PyInterp_Watcher : public QObject
{
Q_OBJECT
XGUI_Constants.h
XGUI_ViewBackground.h
XGUI_WidgetFactory.h
+ XGUI_DocumentDataModel.h
+ XGUI_DataModel.h
+ XGUI_ObjectsBrowser.h
)
SET(PROJECT_AUTOMOC
XGUI_RubberBand.cpp
XGUI_ViewBackground.cpp
XGUI_WidgetFactory.cpp
+ XGUI_DocumentDataModel.cpp
+ XGUI_DataModel.cpp
+ XGUI_ObjectsBrowser.cpp
)
SET(PROJECT_RESOURCES
XGUI_pictures.qrc
)
-SET(TEXT_RESOURCES
- XGUI_msg_en.ts
-)
+#SET(TEXT_RESOURCES
+# XGUI_msg_en.ts
+#)
SET(PROJECT_LIBRARIES
opengl32
PyConsole
PyInterp
PyEvent
+ ModelAPI
)
QT5_ADD_RESOURCES(PROJECT_COMPILED_RESOURCES ${PROJECT_RESOURCES})
-QT5_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES})
+#QT5_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES})
-SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC} ${PROJECT_COMPILED_RESOURCES} ${QM_RESOURCES})
+#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})
ADD_DEFINITIONS(${CAS_DEFINITIONS} )
${PROJECT_SOURCE_DIR}/src/Config
${PROJECT_SOURCE_DIR}/src/PyInterp
${PROJECT_SOURCE_DIR}/src/PyConsole
+ ${PROJECT_SOURCE_DIR}/src/ModelAPI
${CAS_INCLUDE_DIRS})
LINK_DIRECTORIES($ENV{PYTHON_LIB_DIR})
${PROJECT_HEADERS}
${PROJECT_COMPILED_RESOURCES}
${TEXT_RESOURCES}
- ${QM_RESOURCES}
)
+ADD_DEPENDENCIES(XGUI ModelAPI)
+
# The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore
TARGET_LINK_LIBRARIES(XGUI ${PROJECT_LIBRARIES})
INSTALL(TARGETS XGUI DESTINATION bin)
-INSTALL(FILES ${QM_RESOURCES} DESTINATION bin)
+#INSTALL(FILES ${QM_RESOURCES} DESTINATION bin)
--- /dev/null
+#include "XGUI_DataModel.h"
+
+
+XGUI_DataModel::XGUI_DataModel(QObject* theParent)
+ : QAbstractItemModel(theParent)
+{
+}
+
+
+XGUI_DataModel::~XGUI_DataModel()
+{
+}
--- /dev/null
+
+#ifndef XGUI_DataModel_H
+#define XGUI_DataModel_H
+
+#include <QAbstractItemModel>
+
+class XGUI_DataModel : public QAbstractItemModel
+{
+ Q_OBJECT
+public:
+ XGUI_DataModel(QObject* theParent);
+ virtual ~XGUI_DataModel();
+};
+
+#endif
\ No newline at end of file
--- /dev/null
+#include "XGUI_DocumentDataModel.h"
+
+#include <ModelAPI_PluginManager.h>
+#include <ModelAPI_Iterator.h>
+#include <ModelAPI_Document.h>
+
+
+
+
+XGUI_DocumentDataModel::XGUI_DocumentDataModel(QObject* theParent)
+ : QAbstractItemModel(theParent),
+ myParamsFolder(0),
+ myConstructFolder(0)
+{
+ //std::shared_ptr<ModelAPI_Feature> myRoot = aMgr->createFeature("Point");
+ std::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
+ myDocument = aMgr->currentDocument();
+}
+
+
+XGUI_DocumentDataModel::~XGUI_DocumentDataModel()
+{
+}
+
+
+QVariant XGUI_DocumentDataModel::data(const QModelIndex& theIndex, int theRole) const
+{
+ switch (theRole) {
+ case Qt::DisplayRole:
+ // return a name
+ if (theIndex.internalId() == quintptr(&myParamsFolder))
+ return "Parameters";
+ else if (theIndex.internalId() == quintptr(&myConstructFolder))
+ return "Constructions";
+ else if (theIndex.internalId() == 0) {
+ return "Part";
+ }
+ break;
+ case Qt::DecorationRole:
+ // return an Icon
+ break;
+ case Qt::ToolTipRole:
+ // return Tooltip
+ break;
+ }
+ return QVariant();
+}
+
+
+QVariant XGUI_DocumentDataModel::headerData(int section, Qt::Orientation orientation, int role) const
+{
+ return QVariant();
+}
+
+int XGUI_DocumentDataModel::rowCount(const QModelIndex &parent) const
+{
+ std::shared_ptr<ModelAPI_Iterator> aIt = myDocument->featuresIterator(PARTS_GROUP);
+ return aIt->numIterationsLeft() + 2;
+}
+
+int XGUI_DocumentDataModel::columnCount(const QModelIndex &parent) const
+{
+ return 1;
+}
+
+QModelIndex XGUI_DocumentDataModel::index(int theRow, int theColumn, const QModelIndex& theParent) const
+{
+ switch (theRow) {
+ case 0:
+ return createIndex(theRow, theColumn, (quintptr) &myParamsFolder);
+ case 1:
+ return createIndex(theRow, theColumn, (quintptr) &myConstructFolder);
+ default:
+ {
+ std::shared_ptr<ModelAPI_Iterator> aIt = myDocument->featuresIterator(PARTS_GROUP);
+ if (aIt->numIterationsLeft() <= (theRow - 1)) {
+ return createIndex(theRow, theColumn, (quintptr) 0);
+ }
+ }
+ }
+ return QModelIndex();
+}
+
+
+QModelIndex XGUI_DocumentDataModel::parent(const QModelIndex &index) const
+{
+ return QModelIndex();
+}
+
+bool XGUI_DocumentDataModel::hasChildren(const QModelIndex& theParent) const
+{
+ if (!theParent.isValid())
+ return true;
+
+ if (theParent.internalId() == quintptr(&myParamsFolder))
+ return myDocument->featuresIterator(PARAMETERS_GROUP)->more();
+ if (theParent.internalId() == quintptr(&myConstructFolder))
+ return myDocument->featuresIterator(CONSTRUCTIONS_GROUP)->more();
+ if (theParent.internalId() == 0)
+ return false;
+ return false;
+}
\ No newline at end of file
--- /dev/null
+
+#ifndef XGUI_DocumentDataModel_H
+#define XGUI_DocumentDataModel_H
+
+#include <QAbstractItemModel>
+
+class ModelAPI_Document;
+
+class XGUI_DocumentDataModel : public QAbstractItemModel
+{
+ Q_OBJECT
+public:
+ XGUI_DocumentDataModel(QObject* theParent);
+ virtual ~XGUI_DocumentDataModel();
+
+
+ virtual QVariant data(const QModelIndex& theIndex, int theRole) const;
+ virtual QVariant headerData(int section, Qt::Orientation orientation,
+ int role = Qt::DisplayRole) const;
+
+ virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
+
+ virtual QModelIndex index(int theRow, int theColumn,
+ const QModelIndex &parent = QModelIndex()) const;
+
+ virtual QModelIndex parent(const QModelIndex &index) const;
+
+ virtual bool hasChildren(const QModelIndex& theParent = QModelIndex()) const;
+
+private:
+ //std::shared_ptr<ModelAPI_Feature> myRoot;
+ short myParamsFolder;
+ short myConstructFolder;
+
+ std::shared_ptr<ModelAPI_Document> myDocument;
+};
+
+#endif
\ No newline at end of file
: QObject(parent), myDesktop(parent)
{
parent->setTabPosition(Qt::TopDockWidgetArea, QTabWidget::North);
- myGeneralPage = addWorkbench(tr("GEN_MENU_TITLE"));
+ myGeneralPage = addWorkbench(tr("General"));
}
XGUI_MainMenu::~XGUI_MainMenu(void)
#include "XGUI_MainMenu.h"
#include "XGUI_ViewWindow.h"
#include "XGUI_Viewer.h"
+#include "XGUI_ObjectsBrowser.h"
#include <PyConsole_Console.h>
#include <PyConsole_EnhInterp.h>
myObjectBrowser(0),
myPythonConsole(0)
{
- setWindowTitle(tr("WINDOW_TITLE"));
+ setWindowTitle(tr("New Geom"));
myMenuBar = new XGUI_MainMenu(this);
QMdiArea* aMdiArea = new QMdiArea(this);
{
QDockWidget* aObjDock = new QDockWidget(this);
aObjDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
- aObjDock->setWindowTitle(tr("OBJECT_BROWSER_TITLE"));
- myObjectBrowser = new QTreeWidget(aObjDock);
- myObjectBrowser->setColumnCount(1);
- myObjectBrowser->setHeaderHidden(true);
+ aObjDock->setWindowTitle(tr("Object browser"));
+ myObjectBrowser = new XGUI_ObjectsBrowser(aObjDock);
+ //myObjectBrowser->setColumnCount(1);
+ //myObjectBrowser->setHeaderHidden(true);
aObjDock->setWidget(myObjectBrowser);
// fillObjectBrowser();
return aObjDock;
}
-
-//******************************************************
-
-// TEST FUNCTIONS
-
-//******************************************************
-void XGUI_MainWindow::fillObjectBrowser()
-{
- QStringList aNames;
- aNames << "Parameters" << "Constructions";
- aNames << "Part 1" << "Part 2" << "Part 3";
- aNames << "Properties";
-
- QStringList aIcons;
- aIcons << ":pictures/params_folder.png";
- aIcons << ":pictures/constr_folder.png";
- aIcons << ":pictures/part_ico.png";
- aIcons << ":pictures/part_ico.png";
- aIcons << ":pictures/part_ico.png";
- aIcons << ":pictures/properties.png";
-
- QList<QTreeWidgetItem*> aItems;
- foreach(QString aName, aNames)
- {
- QTreeWidgetItem* aItem = new QTreeWidgetItem(myObjectBrowser);
- aItem->setText(0, aName);
- aItems.append(aItem);
- }
- for(int i = 0; i < aItems.length(); i++) {
- aItems[i]->setIcon(0, QIcon(aIcons[i]));
- }
- myObjectBrowser->addTopLevelItems(aItems);
-
- for(int i = 2; i < 5; i++) {
- QTreeWidgetItem* aItem = new QTreeWidgetItem(aItems[i]);
- aItem->setText(0, "Parameters");
- aItem->setIcon(0, QIcon(":pictures/params_folder.png"));
-
- aItem = new QTreeWidgetItem(aItems[i]);
- aItem->setText(0, "Construction");
- aItem->setIcon(0, QIcon(":pictures/constr_folder.png"));
-
- aItem = new QTreeWidgetItem(aItems[i]);
- aItem->setText(0, "Bodies");
- aItem->setIcon(0, QIcon(":pictures/part_ico.png"));
-
- aItem = new QTreeWidgetItem(aItems[i]);
- aItem->setText(0, "Features");
- aItem->setIcon(0, QIcon(":pictures/features.png"));
- }
-}
class XGUI_MainMenu;
class XGUI_Viewer;
-class QTreeWidget;
+class XGUI_ObjectsBrowser;
class QMdiArea;
class PyConsole_EnhConsole;
return myMenuBar;
}
- QTreeWidget* objectBrowser() const
+ XGUI_ObjectsBrowser* objectBrowser() const
{
return myObjectBrowser;
}
void createDockWidgets();
QDockWidget* createObjectBrowser();
QDockWidget* createPropertyPanel();
- //!! For test purposes only
- void fillObjectBrowser();
XGUI_MainMenu* myMenuBar;
- QTreeWidget* myObjectBrowser;
+ XGUI_ObjectsBrowser* myObjectBrowser;
XGUI_Viewer* myViewer;
--- /dev/null
+#include "XGUI_ObjectsBrowser.h"
+#include "XGUI_DocumentDataModel.h"
+
+
+XGUI_ObjectsBrowser::XGUI_ObjectsBrowser(QWidget* theParent)
+ : QTreeView(theParent)
+{
+ setHeaderHidden(true);
+ myDocModel = new XGUI_DocumentDataModel(this);
+ setModel(myDocModel);
+}
+
+
+XGUI_ObjectsBrowser::~XGUI_ObjectsBrowser()
+{
+}
+
--- /dev/null
+
+#ifndef XGUI_ObjectsBrowser_H
+#define XGUI_ObjectsBrowser_H
+
+#include <QTreeView>
+
+class XGUI_DocumentDataModel;
+
+class XGUI_ObjectsBrowser : public QTreeView
+{
+ Q_OBJECT
+public:
+ XGUI_ObjectsBrowser(QWidget* theParent);
+ virtual ~XGUI_ObjectsBrowser();
+
+ XGUI_DocumentDataModel* dataModel() const { return myDocModel; }
+
+private:
+
+ XGUI_DocumentDataModel* myDocModel;
+};
+
+#endif
\ No newline at end of file
QAction* aBtn;
// Dump view
- aBtn = new QAction(QIcon(":pictures/occ_view_camera_dump.png"), tr("DUMP_VIEW"), myViewBar);
+ aBtn = new QAction(QIcon(":pictures/occ_view_camera_dump.png"), tr("Dump view"), myViewBar);
connect(aBtn, SIGNAL(triggered()), SLOT(dumpView()));
myViewBar->addAction(aBtn);
// Fit all
- aBtn = new QAction(QIcon(":pictures/occ_view_fitall.png"), tr("FIT_ALL"), myViewBar);
+ aBtn = new QAction(QIcon(":pictures/occ_view_fitall.png"), tr("Fit all"), myViewBar);
connect(aBtn, SIGNAL(triggered()), SLOT(fitAll()));
myViewBar->addAction(aBtn);
// Fit area
- aBtn = new QAction(QIcon(":pictures/occ_view_fitarea.png"), tr("FIT_AREA"), myViewBar);
+ aBtn = new QAction(QIcon(":pictures/occ_view_fitarea.png"), tr("Fit area"), myViewBar);
connect(aBtn, SIGNAL(triggered()), SLOT(activateWindowFit()));
myViewBar->addAction(aBtn);
// Zoom
- aBtn = new QAction(QIcon(":pictures/occ_view_zoom.png"), tr("ZOOM_VIEW"), myViewBar);
+ aBtn = new QAction(QIcon(":pictures/occ_view_zoom.png"), tr("Zoom"), myViewBar);
connect(aBtn, SIGNAL(triggered()), SLOT(activateZoom()));
myViewBar->addAction(aBtn);
// Pan
- aBtn = new QAction(QIcon(":pictures/occ_view_pan.png"), tr("PAN_VIEW"), myViewBar);
+ aBtn = new QAction(QIcon(":pictures/occ_view_pan.png"), tr("Panning"), myViewBar);
connect(aBtn, SIGNAL(triggered()), SLOT(activatePanning()));
myViewBar->addAction(aBtn);
// Global Panning
- aBtn = new QAction(QIcon(":pictures/occ_view_glpan.png"), tr("GLOB_PAN_VIEW"), myViewBar);
+ aBtn = new QAction(QIcon(":pictures/occ_view_glpan.png"), tr("Global panning"), myViewBar);
connect(aBtn, SIGNAL(triggered()), SLOT(activateGlobalPanning()));
myViewBar->addAction(aBtn);
// Rotation
- aBtn = new QAction(QIcon(":pictures/occ_view_rotate.png"), tr("ROTATE_VIEW"), myViewBar);
+ aBtn = new QAction(QIcon(":pictures/occ_view_rotate.png"), tr("Rotate"), myViewBar);
connect(aBtn, SIGNAL(triggered()), SLOT(activateRotation()));
myViewBar->addAction(aBtn);
// Reset
- aBtn = new QAction(QIcon(":pictures/occ_view_reset.png"), tr("RESET_VIEW"), myViewBar);
+ aBtn = new QAction(QIcon(":pictures/occ_view_reset.png"), tr("Reset"), myViewBar);
connect(aBtn, SIGNAL(triggered()), SLOT(reset()));
myViewBar->addAction(aBtn);
// Front view
- aBtn = new QAction(QIcon(":pictures/occ_view_front.png"), tr("FRONT_VIEW"), myViewBar);
+ aBtn = new QAction(QIcon(":pictures/occ_view_front.png"), tr("Front"), myViewBar);
connect(aBtn, SIGNAL(triggered()), SLOT(frontView()));
myViewBar->addAction(aBtn);
// Back view
- aBtn = new QAction(QIcon(":pictures/occ_view_back.png"), tr("BACK_VIEW"), myViewBar);
+ aBtn = new QAction(QIcon(":pictures/occ_view_back.png"), tr("Back"), myViewBar);
connect(aBtn, SIGNAL(triggered()), SLOT(backView()));
myViewBar->addAction(aBtn);
// Top view
- aBtn = new QAction(QIcon(":pictures/occ_view_top.png"), tr("TOP_VIEW"), myViewBar);
+ aBtn = new QAction(QIcon(":pictures/occ_view_top.png"), tr("Top"), myViewBar);
connect(aBtn, SIGNAL(triggered()), SLOT(topView()));
myViewBar->addAction(aBtn);
// Bottom view
- aBtn = new QAction(QIcon(":pictures/occ_view_bottom.png"), tr("BOTTOM_VIEW"), myViewBar);
+ aBtn = new QAction(QIcon(":pictures/occ_view_bottom.png"), tr("Bottom"), myViewBar);
connect(aBtn, SIGNAL(triggered()), SLOT(bottomView()));
myViewBar->addAction(aBtn);
// Left view
- aBtn = new QAction(QIcon(":pictures/occ_view_left.png"), tr("LEFT_VIEW"), myViewBar);
+ aBtn = new QAction(QIcon(":pictures/occ_view_left.png"), tr("Left"), myViewBar);
connect(aBtn, SIGNAL(triggered()), SLOT(leftView()));
myViewBar->addAction(aBtn);
// Right view
- aBtn = new QAction(QIcon(":pictures/occ_view_right.png"), tr("RIGHT_VIEW"), myViewBar);
+ aBtn = new QAction(QIcon(":pictures/occ_view_right.png"), tr("Right"), myViewBar);
connect(aBtn, SIGNAL(triggered()), SLOT(rightView()));
myViewBar->addAction(aBtn);
// Clone view
- aBtn = new QAction(QIcon(":pictures/occ_view_clone.png"), tr("CLONE_VIEW"), myViewBar);
+ aBtn = new QAction(QIcon(":pictures/occ_view_clone.png"), tr("Clone"), myViewBar);
connect(aBtn, SIGNAL(triggered()), SLOT(cloneView()));
myViewBar->addAction(aBtn);
void XGUI_ViewWindow::dumpView()
{
- QString aFilter(tr("OCC_IMAGE_FILES"));
+ QString aFilter(tr("Images Files (*.bmp *.png *.jpg *.jpeg *.eps *.ps)"));
QString aSelectedFilter;
QString aFileName = QFileDialog::getSaveFileName(this, "Save picture", QString(), aFilter, &aSelectedFilter);
if (!aFileName.isNull()) {
*/
QString XGUI_Viewer::backgroundData(QStringList& gradList, QIntList& idList, QIntList& txtList)
{
- gradList << tr("GT_HORIZONTALGRADIENT") << tr("GT_VERTICALGRADIENT")
- << tr("GT_FIRSTDIAGONALGRADIENT") << tr("GT_SECONDDIAGONALGRADIENT")
- << tr("GT_FIRSTCORNERGRADIENT") << tr("GT_SECONDCORNERGRADIENT")
- << tr("GT_THIRDCORNERGRADIENT") << tr("GT_FORTHCORNERGRADIENT");
+ gradList << tr("Horizontal gradient") << tr("Vertical gradient")
+ << tr("First diagonal gradient") << tr("Second diagonal gradient")
+ << tr("First corner gradient") << tr("Second corner gradient")
+ << tr("Third corner gradient") << tr("Fourth corner gradient");
idList << XGUI::HorizontalGradient << XGUI::VerticalGradient << XGUI::Diagonal1Gradient
<< XGUI::Diagonal2Gradient << XGUI::Corner1Gradient << XGUI::Corner2Gradient
<< XGUI::Corner3Gradient << XGUI::Corner4Gradient;
#ifdef OCC_ENABLE_TEXTURED_BACKGROUND
txtList << XGUI::CenterTexture << XGUI::TileTexture << XGUI::StretchTexture;
#endif
- return tr("BG_IMAGE_FILES");
+ return tr("Image files (*.bmp *.gif *.pix *.xwd *.rgb *.rs)");
}
XGUI_Viewer::XGUI_Viewer(XGUI_MainWindow* theParent, bool DisplayTrihedron)
XGUI_Command* aCommand;
- aCommand = aGroup->addFeature("SAVE_CMD", tr("SAVE_MENU"), tr("SAVE_MENU_TIP"),
+ aCommand = aGroup->addFeature("SAVE_CMD", tr("Save..."), tr("Save the document"),
QIcon(":pictures/save.png"), QKeySequence::Save);
aCommand->connectTo(this, SLOT(onSave()));
//aCommand->disable();
- aCommand = aGroup->addFeature("UNDO_CMD", tr("UNDO_MENU"), tr("UNDO_MENU_TIP"),
+ aCommand = aGroup->addFeature("UNDO_CMD", tr("Undo"), tr("Undo last command"),
QIcon(":pictures/undo.png"), QKeySequence::Undo);
- aCommand = aGroup->addFeature("REDO_CMD", tr("REDO_MENU"), tr("REDO_MENU_TIP"),
+ aCommand = aGroup->addFeature("REDO_CMD", tr("Redo"), tr("Redo last command"),
QIcon(":pictures/redo.png"), QKeySequence::Redo);
- aCommand = aGroup->addFeature("REBUILD_CMD", tr("REBUILD_MENU"), tr("REBUILD_MENU_TIP"),
+ aCommand = aGroup->addFeature("REBUILD_CMD", tr("Rebuild"), tr("Rebuild data objects"),
QIcon(":pictures/rebuild.png"));
- aCommand = aGroup->addFeature("SAVEAS_CMD", tr("SAVEAS_MENU"), tr("SAVEAS_MENU_TIP"),
+ aCommand = aGroup->addFeature("SAVEAS_CMD", tr("Save as..."), tr("Save the document into a file"),
QIcon(":pictures/save.png"));
aCommand->connectTo(this, SLOT(onSaveAs()));
//aCommand->disable();
- aCommand = aGroup->addFeature("OPEN_CMD", tr("OPEN_MENU"), tr("OPEN_MENU_TIP"),
+ aCommand = aGroup->addFeature("OPEN_CMD", tr("Open..."), tr("Open a new document"),
QIcon(":pictures/open.png"), QKeySequence::Open);
aCommand->connectTo(this, SLOT(onOpen()));
- aCommand = aGroup->addFeature("NEW_CMD", tr("NEW_MENU"), tr("NEW_MENU_TIP"),
+ aCommand = aGroup->addFeature("NEW_CMD", tr("New"), tr("Create a new document"),
QIcon(":pictures/new.png"), QKeySequence::New);
aCommand->connectTo(this, SLOT(onNew()));
- aCommand = aGroup->addFeature("EXIT_CMD", tr("EXIT_MENU"), tr("EXIT_MENU_TIP"),
+ aCommand = aGroup->addFeature("EXIT_CMD", tr("Exit"), tr("Exit application"),
QIcon(":pictures/close.png"), QKeySequence::Close);
aCommand->connectTo(this, SLOT(onExit()));
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="en_US">
-<context>
- <name>@default</name>
-</context>
-<context>
- <name>XGUI_Workshop</name>
- <message>
- <source>NEW_MENU</source>
- <translation>New</translation>
- </message>
- <message>
- <source>NEW_MENU_TIP</source>
- <translation>Create new document</translation>
- </message>
- <message>
- <source>OPEN_MENU</source>
- <translation>Open...</translation>
- </message>
- <message>
- <source>OPEN_MENU_TIP</source>
- <translation>Open document</translation>
- </message>
- <message>
- <source>SAVE_MENU</source>
- <translation>Save</translation>
- </message>
- <message>
- <source>SAVE_MENU_TIP</source>
- <translation>Save document</translation>
- </message>
- <message>
- <source>SAVEAS_MENU</source>
- <translation>Save As...</translation>
- </message>
- <message>
- <source>SAVEAS_MENU_TIP</source>
- <translation>Save document in another file</translation>
- </message>
- <message>
- <source>EXIT_MENU</source>
- <translation>Exit</translation>
- </message>
- <message>
- <source>EXIT_MENU_TIP</source>
- <translation>Exit from application</translation>
- </message>
- <message>
- <source>UNDO_MENU</source>
- <translation>Undo</translation>
- </message>
- <message>
- <source>UNDO_MENU_TIP</source>
- <translation>Undo last command</translation>
- </message>
- <message>
- <source>REDO_MENU</source>
- <translation>Redo</translation>
- </message>
- <message>
- <source>REDO_MENU_TIP</source>
- <translation>Redo last command</translation>
- </message>
- <message>
- <source>CUT_MENU</source>
- <translation>Cut</translation>
- </message>
- <message>
- <source>CUT_MENU_TIP</source>
- <translation>Cut selected object</translation>
- </message>
- <message>
- <source>COPY_MENU</source>
- <translation>Copy</translation>
- </message>
- <message>
- <source>COPY_MENU_TIP</source>
- <translation>Copy selected object</translation>
- </message>
- <message>
- <source>PASTE_MENU</source>
- <translation>Paste</translation>
- </message>
- <message>
- <source>PASTE_MENU_TIP</source>
- <translation>Paste copied object</translation>
- </message>
- <message>
- <source>REBUILD_MENU</source>
- <translation>Rebuild</translation>
- </message>
- <message>
- <source>REBUILD_MENU_TIP</source>
- <translation>Rebuild data objects</translation>
- </message>
-</context>
-<context>
- <name>XGUI_MainWindow</name>
- <message>
- <source>WINDOW_TITLE</source>
- <translation>New GEOM</translation>
- </message>
- <message>
- <source>OBJECT_BROWSER_TITLE</source>
- <translation>Object Browser</translation>
- </message>
-</context>
-<context>
- <name>XGUI_MainMenu</name>
- <message>
- <source>MENU_TITLE</source>
- <translation>Menu</translation>
- </message>
- <message>
- <source>GEN_MENU_TITLE</source>
- <translation>General</translation>
- </message>
-</context>
-<context>
- <name>XGUI_Viewer</name>
- <message>
- <source>GT_HORIZONTALGRADIENT</source>
- <translation>Horizontal gradient</translation>
- </message>
- <message>
- <source>GT_VERTICALGRADIENT</source>
- <translation>Vertical gradient</translation>
- </message>
- <message>
- <source>GT_FIRSTDIAGONALGRADIENT</source>
- <translation>First diagonal gradient</translation>
- </message>
- <message>
- <source>GT_SECONDDIAGONALGRADIENT</source>
- <translation>Second diagonal gradient</translation>
- </message>
- <message>
- <source>GT_FIRSTCORNERGRADIENT</source>
- <translation>First corner gradient</translation>
- </message>
- <message>
- <source>GT_SECONDCORNERGRADIENT</source>
- <translation>Second corner gradient</translation>
- </message>
- <message>
- <source>GT_THIRDCORNERGRADIENT</source>
- <translation>Third corner gradient</translation>
- </message>
- <message>
- <source>GT_FORTHCORNERGRADIENT</source>
- <translation>Fourth corner gradient</translation>
- </message>
- <message>
- <source>BG_IMAGE_FILES</source>
- <translation>Image files (*.bmp *.gif *.pix *.xwd *.rgb *.rs)</translation>
- </message>
-</context>
-<context>
- <name>XGUI_ViewWindow</name>
- <message>
- <source>OCC_IMAGE_FILES</source>
- <translation>Images Files (*.bmp *.png *.jpg *.jpeg *.eps *.ps)</translation>
- </message>
- <message>
- <source>DUMP_VIEW</source>
- <translation>Dump view</translation>
- </message>
- <message>
- <source>FIT_ALL</source>
- <translation>Fit all</translation>
- </message>
- <message>
- <source>FIT_AREA</source>
- <translation>Fit area</translation>
- </message>
- <message>
- <source>CLONE_VIEW</source>
- <translation>Clone view</translation>
- </message>
- <message>
- <source>ZOOM_VIEW</source>
- <translation>Zoom</translation>
- </message>
- <message>
- <source>PAN_VIEW</source>
- <translation>Panning</translation>
- </message>
- <message>
- <source>GLOB_PAN_VIEW</source>
- <translation>Global panning</translation>
- </message>
- <message>
- <source>ROTATE_VIEW</source>
- <translation>Rotate</translation>
- </message>
- <message>
- <source>FRONT_VIEW</source>
- <translation>Front</translation>
- </message>
- <message>
- <source>BACK_VIEW</source>
- <translation>Back</translation>
- </message>
- <message>
- <source>TOP_VIEW</source>
- <translation>Top</translation>
- </message>
- <message>
- <source>BOTTOM_VIEW</source>
- <translation>Bottom</translation>
- </message>
- <message>
- <source>LEFT_VIEW</source>
- <translation>Left</translation>
- </message>
- <message>
- <source>RIGHT_VIEW</source>
- <translation>Right</translation>
- </message>
- <message>
- <source>RESET_VIEW</source>
- <translation>Reset</translation>
- </message>
-</context>
-</TS>