Commit 0e3a666c authored by lealv's avatar lealv
Browse files

FEATURE 14: transform all popUp to actions

- Method getActionAndPopupMenu is now deprecated
- In MML, the popUp letting to display the simulator tabs is now an action
- Warning: popUPs of Pml component aren't available anymore due to deprecation of getActionAndPopupMenu and future redesign of this component.

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@1793 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 4aff799c
......@@ -8,5 +8,5 @@
# Add subdirectories in CMake project, manually => handling dependencies
camitk_add_subdirectory(physicalmodel)
camitk_add_subdirectory(mml)
camitk_add_subdirectory(mmlcomponent)
if(COMPONENT_MML)
set(MML_GENERATE_GUI ON CACHE BOOL "Forced by COMPONENT_MML" FORCE)
#FIXME Sofa support => fix sofa dependency properly
if(MML_SOFA_SUPPORT)
if(WIN32)
......@@ -13,8 +13,9 @@ if(COMPONENT_MML)
endif()
camitk_extension( COMPONENT_EXTENSION
DEFINES COMPILE_MMLCOMPONENT_API
NEEDS_LIBXML2
NEEDS_XSD
NEEDS_XSD
NEEDS_CEP_LIBRARIES pml lml mml monitoringgui monitoring
NEEDS_COMPONENT_EXTENSION vtkmesh physicalmodel
HEADERS_TO_INSTALL MMLComponentExtension.h
......@@ -26,6 +27,7 @@ camitk_extension( COMPONENT_EXTENSION
MMLMonitorDisplays/Arrows.h
MMLMonitorDisplays/Tabular.h
MMLComponentPopup.h
MMLComponentAPI.h
CEP_NAME CEP_MODELING
DESCRIPTION "Component MML allows one to handle XML file that compare biomechanical simulations with different simulators"
TEST_APPLICATION ${APPLICATION_TEST_COMPONENT}
......
......@@ -83,10 +83,10 @@ MMLComponent::MMLComponent(const QString & fileName) throw(AbortException) : Com
mmlGUI = new MonitoringGuiManager;
display = new MMLDisplay(this);
mmlDock = new QDockWidget(fi.baseName(), Application::getMainWindow());
mmlDock->setAllowedAreas(Qt::RightDockWidgetArea);
mmlDock->setWidget(mmlGUI->getDialog());
Application::getMainWindow()->addDockWidget(Qt::RightDockWidgetArea, mmlDock);
//mmlDock = new QDockWidget(fi.baseName(), Application::getMainWindow());
//mmlDock->setAllowedAreas(Qt::RightDockWidgetArea);
//mmlDock->setWidget(mmlGUI->getDialog());
//Application::getMainWindow()->addDockWidget(Qt::RightDockWidgetArea, mmlDock);
mmlGUI->loadMmlInFile(file);
// in order to give the ownership of the pml pointer to the PMManagerDC, we need to use takePml() not getPml()
pmMgr = new PMManagerDC( mmlGUI->getMonitoringManager()->takePml(), mmlGUI->getMonitoringManager()->getPmlFileName().c_str());
......@@ -102,7 +102,7 @@ MMLComponent::MMLComponent(const QString & fileName) throw(AbortException) : Com
// ---------------------- destructor ----------------------------
MMLComponent::~MMLComponent() {
/*if (exportedMml!="")
remove(exportedMml.toStdString().c_str());
*/
......@@ -112,13 +112,13 @@ MMLComponent::~MMLComponent() {
}
//mmlGUI->getMonitoringManager()->setPml(NULL);
if (display) {
delete display;
display = NULL;
}
if (mmlGUI) {
delete mmlGUI;
mmlGUI = NULL;
......@@ -182,8 +182,10 @@ bool MMLComponent::isDockVisible() {
}
// -------------------- setDockVisible --------------------
void MMLComponent::setDockVisible(bool visible) {
mmlDock->setVisible(visible);
QWidget* MMLComponent::setDockVisible(bool visible) {
//mmlDock->setVisible(visible);
//return getMonitoringGuiManager()->getDialog();
return ( new QWidget() );
}
// -------------------- getModified --------------------
......
......@@ -30,6 +30,8 @@
#include <camitkcore/Component.h> // Nico: do not remove the camitkcore/ prefix
#include <QObject>
#include "MMLComponentAPI.h"
class QDockWidget;
class MMLDisplay;
......@@ -38,17 +40,17 @@ class MonitoringGuiManager;
class PMManagerDC;
/**
* @ingroup group_cepmodeling_components_mml
*
*
* @brief
* This class manage an MML monitoring document ".mml".
*
*
*
*
**/
class MMLComponent : public camitk::Component {
Q_OBJECT
class MMLCOMPONENT_API MMLComponent : public camitk::Component {
Q_OBJECT
public:
/// Default constructor: give it the name of the file containing the data (.mml file)
MMLComponent(const QString &) throw(camitk::AbortException);
......@@ -57,14 +59,14 @@ Q_OBJECT
///@name Redefined from Extension
///@{
/** save the current mml in the current file name.
* @return false if there was a problem during the saving procedure
*/
bool save();
void initRepresentation(){};
/// get MonitoringGuiManager
MonitoringGuiManager* getMonitoringGuiManager();
/// get Physical model manager
......@@ -73,38 +75,38 @@ Q_OBJECT
MMLDisplay* getDisplay();
/// connect pml
void connectPml();
/// Overriden method so that we actually can build a popup menu with different actions
virtual QMenu * getPopupMenu(QWidget* parent);
/// return true if mmlDock is visible
bool isDockVisible();
/// show or hide mmlDock
void setDockVisible(bool visible);
QWidget * setDockVisible(bool visible);
/// save the mml in the current filename (and the pml if needed)
void saveMML();
/// check if the mml or pml were modified in the UI
virtual bool getModified() const;
private:
/// the mml GUI class is used directly
MonitoringGuiManager *mmlGUI;
/// to put the mmlGUI
QDockWidget *mmlDock;
/// physical model manager
PMManagerDC* pmMgr;
/// display manager
MMLDisplay* display;
/// when a .scn is loaded, name of the automatically exported mml file (empty string otherwise)
QString exportedMml;
/// the popup menu
MMLComponentPopup * myPopupMenu;
};
......
......@@ -28,17 +28,18 @@
#include <QObject>
#include <ComponentExtension.h>
#include "MMLComponentAPI.h"
/**
* @ingroup group_cepmodeling_components_mml
*
*
* @brief
* This MML ComponentPlugin allows you to manipulate MML document.
* see http://www-timc.imag.fr/Aurelien.Deram/ for more information on
* this type of documents.
*
*
*
*
**/
class MMLComponentExtension : public camitk::ComponentExtension {
class MMLCOMPONENT_API MMLComponentExtension : public camitk::ComponentExtension {
Q_OBJECT
Q_INTERFACES(camitk::ComponentExtension);
......
......@@ -27,16 +27,17 @@
#define MMLCOMPONENTPOPUP_H
#include <ComponentPopupMenu.h>
#include "MMLComponentAPI.h"
/**
* @ingroup group_cepmodeling_components_mml
*
*
* @brief
* A popup monu for MML component
* Acessible when rigth cliking on the component
*
*
*
*
**/
class MMLComponentPopup : public camitk::ComponentPopupMenu {
class MMLCOMPONENT_API MMLComponentPopup : public camitk::ComponentPopupMenu {
Q_OBJECT
......@@ -49,11 +50,11 @@ class MMLComponentPopup : public camitk::ComponentPopupMenu {
public slots:
/// show monitoring widget
void monitoringTabs();
private:
/// menus id
QAction* showTabs;
};
#endif
\ No newline at end of file
......@@ -34,16 +34,17 @@ class MMLMonitorDisplay;
// Monitoring includes
#include <Monitor.h>
#include "MMLComponentAPI.h"
/**
* @ingroup group_cepmodeling_components_mml
*
*
* @brief
* TODO Describe the class here
*
*
*
*
**/
class MMLDisplay: QObject {
class MMLCOMPONENT_API MMLDisplay : QObject {
Q_OBJECT
public:
......
......@@ -30,32 +30,33 @@
#include <Monitor.h>
#include <QObject>
#include "MMLComponentAPI.h"
class MMLComponent;
/**
* @ingroup group_cepmodeling_components_mml
*
*
* @brief
* TODO Describe the class here
*
*
*
*
**/
class MMLMonitorDisplay:public QObject{
class MMLCOMPONENT_API MMLMonitorDisplay :public QObject{
public:
/// constructor
MMLMonitorDisplay(Monitor* monitor,MMLComponent* manager);
/// destructor
~MMLMonitorDisplay();
/// update display
virtual void update()=0;
/// hide display
virtual void hide()=0;
protected:
/// monitor
Monitor* monitor;
......
......@@ -32,18 +32,19 @@
// Monitor includes
#include "Monitor.h"
#include "MMLComponentAPI.h"
class MMLMonitorDisplay;
class MMLComponent;
/**
* @ingroup group_cepmodeling_components_mml
*
*
* @brief
* A Factory for creating MMLMonitorDiplay
*
*
*
*
**/
class MMLMonitorDisplayFactory {
class MMLCOMPONENT_API MMLMonitorDisplayFactory {
public:
......@@ -131,4 +132,4 @@ private:
};
#endif // MMLMonitorDisplayFactory_H
#endif // MMLMonitorDisplayFactory_H
......@@ -24,11 +24,12 @@
****************************************************************************/
#include "MMLMonitorDisplay.h"
#include "MMLComponentAPI.h"
#ifndef MMLMONITORSDISLPAYS_ARROWS_H
#define MMLMONITORSDISLPAYS_ARROWS_H
class Arrows: public MMLMonitorDisplay{
class MMLCOMPONENT_API Arrows : public MMLMonitorDisplay{
public:
......
......@@ -24,11 +24,12 @@
****************************************************************************/
#include "MMLMonitorDisplay.h"
#include "MMLComponentAPI.h"
#ifndef MMLMONITORSDISLPAYS_COLORS_H
#define MMLMONITORSDISLPAYS_COLORS_H
class Colors: public MMLMonitorDisplay{
class MMLCOMPONENT_API Colors : public MMLMonitorDisplay{
public:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment