Commit de5cf0a1 authored by Jan Möbius's avatar Jan Möbius
parent a77dde4d
......@@ -46,7 +46,6 @@
#include <QtGui>
#include <QMenuBar>
#include <ACG/QtWidgets/QtExaminerViewer.hh>
#include <OpenFlipper/common/Types.hh>
/** \brief Interface class from which all plugins have to be created.
......
......@@ -12,12 +12,12 @@
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// OpenFlipper is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenFlipper. If not, see <http://www.gnu.org/licenses/>.
//
......@@ -35,70 +35,69 @@
//
// C++ Interface: BasePlugin
//
// Description:
// Description:
//
//
// Author: Jan Moebius <jan_moebius@web.de>, (C) 2007
//
#ifndef CONTEXTMENUINTERFACE_HH
#define CONTEXTMENUINTERFACE_HH
#ifndef CONTEXTMENUINTERFACE_HH
#define CONTEXTMENUINTERFACE_HH
#include <QtGui>
#include <QMenuBar>
#include <ACG/QtWidgets/QtExaminerViewer.hh>
#include <OpenFlipper/common/Types.hh>
enum ContextMenuType {
/// The Menu will be created directly inside the Menu.
CONTEXTTOPLEVELMENU,
CONTEXTTOPLEVELMENU,
/// The Menu will be added inside the Selection part of the Context Menu
CONTEXTSELECTIONMENU
};
/** \brief Interface class for creating custom context menus
*
*
* Using this interface you can create custom context menus for your plugin. You
* can choose between a persistent context menu which will be visible every time
* you rightclick in the viewerwindow or an object based context menu. This type
* of menu will only show up when the user clicked on a specific type defined by
* you rightclick in the viewerwindow or an object based context menu. This type
* of menu will only show up when the user clicked on a specific type defined by
* your plugin.\n
* You have to create a QMenu. The signals and slots of your menu have to be connected
* to your plugin. Just connect them as usual. Only visibility of the menu is handled
* by the core.
*/
class ContextMenuInterface {
public :
public :
/// Destructor
virtual ~ContextMenuInterface() {};
signals:
/** \brief Add an entry for a persistent context Menu
*
*
* Create an QMenu and register this menu as a persistent context menu to the core.
* This Menu will be always visible when you rightclick in the viewer widget.
* @param _menu Pointer to the new Menu
*/
virtual void addContextMenu(QMenu* /*_menu*/ , ContextMenuType /*_type*/) {};
/** \brief Add an entry for a context Menu
*
*
* Create an QMenu and register this menu as a context menu to the core.
* This Menu will only be visible if the picked object is of the given datatype.
* To support multiple object types with your menu, you can emit this signal multiple
* times with the same menu but different DataTypes
*
*
* @param _menu Pointer to the new Menu
* @param _objectType Type of the picked object
* @param _type Type of the context Menu ( See ContextMenuType )
*/
virtual void addContextMenu(QMenu* /*_menu*/ ,DataType /*_objectType*/ , ContextMenuType /*_type*/ ) {};
private slots:
/** When the main application requests a context menu, this slot is called before showing the window.
* If an object is picked the id will be given in this call so you can change the contents of your menu
* depending on the given object,
......@@ -109,5 +108,5 @@ private slots:
};
Q_DECLARE_INTERFACE(ContextMenuInterface,"OpenFlipper.ContextMenuInterface/0.3")
#endif // CONTEXTMENUINTERFACE_HH
......@@ -12,12 +12,12 @@
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// OpenFlipper is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenFlipper. If not, see <http://www.gnu.org/licenses/>.
//
......@@ -35,40 +35,40 @@
//
// C++ Interface: BasePlugin
//
// Description:
// Description:
//
//
// Author: Jan Moebius <jan_moebius@web.de>, (C) 2007
//
#ifndef GLOBALACCESSINTERFACE_HH
#define GLOBALACCESSINTERFACE_HH
#ifndef GLOBALACCESSINTERFACE_HH
#define GLOBALACCESSINTERFACE_HH
#include <QtGui>
#include <QMenuBar>
#include <ACG/QtWidgets/QtExaminerViewer.hh>
#include <OpenFlipper/common/Types.hh>
#include <OpenFlipper/widgets/glWidget/QtExaminerViewer.hh>
/** \brief Interface class for plugins which need access to global Data
*
*
* Do not use this Interface!!!!
*/
class GlobalAccessInterface {
public :
public :
/// Destructor
virtual ~GlobalAccessInterface() {};
/** \brief DONT USE THIS (Get a pointer to the examiner Widget from Main App)
*
*
* This function is called to set a pointer to the global examiner Widget.\n
* @param _examiner_widget Pointer to the Examiner Widget in the Main app
*/
virtual void set_examiner(ACG::QtWidgets::QtExaminerViewer* /*_examiner_widget*/) = 0;
virtual void set_examiner( QtExaminerViewer* /*_examiner_widget*/) = 0;
};
Q_DECLARE_INTERFACE(GlobalAccessInterface,"OpenFlipper.GlobalAccessInterface/0.3")
#endif // GLOBALACCESSINTERFACE_HH
......@@ -12,12 +12,12 @@
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// OpenFlipper is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenFlipper. If not, see <http://www.gnu.org/licenses/>.
//
......@@ -35,62 +35,61 @@
//
// C++ Interface: BasePlugin
//
// Description:
// Description:
//
//
// Author: Jan Moebius <jan_moebius@web.de>, (C) 2007
//
#ifndef INIINTERFACE_HH
#define INIINTERFACE_HH
#ifndef INIINTERFACE_HH
#define INIINTERFACE_HH
#include <QtGui>
#include <QMenuBar>
#include <ACG/QtWidgets/QtExaminerViewer.hh>
#include <OpenFlipper/common/Types.hh>
#include <OpenFlipper/INIFile/INIFile.hh>
/** \brief Interface class for Plugins which have to store information in ini files
*
/** \brief Interface class for Plugins which have to store information in ini files
*
* Using this interface you can store additional information to ini file on an
* per object basis. After the basic information is written to the ini file by the core
* per object basis. After the basic information is written to the ini file by the core
* ( or loaded by the core ) the corresponding functions in this Interface will be executed.
* You get the object id for the object which has to be used. For every object the functions
* will get called and you have to save your data only for the given object!\n
* the ini file in the functions is already open. You may not close it!
*/
class INIInterface {
public :
public :
/// Destructor
virtual ~INIInterface() {};
private slots:
/** Load object information from an ini file as well as plugin options.\n
* @param _ini ini file
* @param _id Id of the object to load data for
*/
virtual void loadIniFile( INIFile& /*_ini*/ ,int /*_id*/ ) {};
/** Save object information to an ini file
* @param _ini ini file
* @param _id Identifier of the object to save (-1 for all)
*/
virtual void saveIniFile( INIFile& /*_ini*/ ,int /*_id*/) {};
/** Load Plugin options (state information) to an ini file
* @param _ini ini file
*/
virtual void loadIniFileOptions( INIFile& /*_ini*/ ) {};
/** Save Plugin options (state information) to an ini file
* @param _ini ini file
*/
virtual void saveIniFileOptions( INIFile& /*_ini*/ ) {};
};
Q_DECLARE_INTERFACE(INIInterface,"OpenFlipper.INIInterface/1.2")
#endif // INIINTERFACE_HH
......@@ -12,12 +12,12 @@
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// OpenFlipper is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenFlipper. If not, see <http://www.gnu.org/licenses/>.
//
......@@ -35,49 +35,48 @@
//
// C++ Interface: BasePlugin
//
// Description:
// Description:
//
//
// Author: Jan Moebius <jan_moebius@web.de>, (C) 2007
//
#ifndef MENUBARINTERFACE_HH
#define MENUBARINTERFACE_HH
#ifndef MENUBARINTERFACE_HH
#define MENUBARINTERFACE_HH
#include <QtGui>
#include <QMenuBar>
#include <ACG/QtWidgets/QtExaminerViewer.hh>
#include <OpenFlipper/common/Types.hh>
enum MenuType {
/// The Menu will be created directly inside the Menubar.
TOPLEVELMENU,
TOPLEVELMENU,
/// The Menu will be added inside the File Menu
FILEMENU,
/// The Menu will be added inside the View Menu
VIEWMENU
};
/** \brief Interface for all plugins which provide entries to the main menubar
*
*
* To add custom menus to the menubar, you have to use this interface class. Create
* your own QMenu and emit initializeMenu to add it to the menubar. You can connect the
* your own QMenu and emit initializeMenu to add it to the menubar. You can connect the
* signals and slots for your menu inside the plugin.\n
* The placement of your menu is controlled by the MenuType. See MenuType for details.
*/
*/
class MenuInterface {
public :
public :
/// Destructor
virtual ~MenuInterface() {};
signals:
/** \brief Initialize the Menubar
*
*
* Initialize a Menu (create a new menu in the main menubar) \n
* \n
* Example : \n
......@@ -93,5 +92,5 @@ signals:
};
Q_DECLARE_INTERFACE(MenuInterface,"OpenFlipper.MenuInterface/0.3")
#endif // MENUBARINTERFACE_HH
......@@ -12,12 +12,12 @@
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// OpenFlipper is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenFlipper. If not, see <http://www.gnu.org/licenses/>.
//
......@@ -35,74 +35,73 @@
//
// C++ Interface: PickingInterface
//
// Description:
// Description:
//
//
// Author: Jan Moebius <jan_moebius@web.de>, (C) 2007
//
#ifndef PICKINGINTERFACE_HH
#define PICKINGINTERFACE_HH
#ifndef PICKINGINTERFACE_HH
#define PICKINGINTERFACE_HH
#include <QtGui>
#include <QMenuBar>
#include <ACG/QtWidgets/QtExaminerViewer.hh>
#include <OpenFlipper/common/Types.hh>
/**
* Interface Class which allows access to picking functions
*/
class PickingInterface {
signals :
/** \brief Add a new picking mode to the examiner
*
/** \brief Add a new picking mode to the examiner
*
* @param _mode Identifier of Picking mode or "Separator" to add a Separator
*/
virtual void addPickMode( const std::string /*_mode*/) {};
/** \brief Add a new picking mode to the examiner which will be invisible
*
*
* The added PickMode will not appear in the context menus Picking menu.
* You have to provide a button or menuentry yourself if you want to switch to
* the picking mode provided here.
*
*
* @param _mode Identifier of Picking mode or "Separator" to add a Separator
*/
virtual void addHiddenPickMode( const std::string /*_mode*/ ) {};
virtual void addHiddenPickMode( const std::string /*_mode*/ ) {};
/** \brief Set the cursor of the given PickMode
*
*
* Set the cursor that should be used inside the pickMode
*
*
* @param _mode Identifier of Picking mode
* @param _cursor the new cursor
*/
virtual void setPickModeCursor( const std::string /*_mode*/ , QCursor /*_cursor*/ ) {};
/** \brief Set mouse tracking for the given PickMode
*
*
* Enable mouseTracking for the given PickMode. When MouseTracking is enabled
* you receive mouseMove events also when no button is pressed (via MouseInterface)
*
*
* @param _mode Identifier of Picking mode
* @param _mouseTracking new state of mouseTracking
*/
virtual void setPickModeMouseTracking( const std::string /*_mode*/ , bool /*_mouseTracking*/ ) {};
/** \brief The pickingMode has changed
*
*
* This slot is called if the user changes the current picking mode
* @param _mode Identifier of Picking mode
*/
virtual void slotPickModeChanged( const std::string& /*_mode*/) {};
public :
public :
/// Destructor
virtual ~PickingInterface() {};
};
Q_DECLARE_INTERFACE(PickingInterface,"OpenFlipper.PickingInterface/1.1")
#endif // PICKINGINTERFACE_HH
......@@ -54,10 +54,10 @@ static BaseObject* objectRoot_;
*
* This pointer is internally used to acces the examiner widget in the main apllication
*/
static std::vector< ACG::QtWidgets::QtExaminerViewer* > examiner_widgets_;
static std::vector< QtExaminerViewer* > examiner_widgets_;
/// TODO : Remove this variable and implement multiView correctly here
static ACG::QtWidgets::QtExaminerViewer* examiner_widget_;
static QtExaminerViewer* examiner_widget_;
static unsigned int activeExaminer_ = 0;
......@@ -73,7 +73,7 @@ void setDataRoot( BaseObject* _root ) {
objectRoot_ = _root;
}
void set_examiner( std::vector< ACG::QtWidgets::QtExaminerViewer* > _examiner_widgets ) {
void set_examiner( std::vector< QtExaminerViewer* > _examiner_widgets ) {
PluginFunctions::examiner_widgets_ = _examiner_widgets;
PluginFunctions::examiner_widget_ = examiner_widgets_[0];
}
......@@ -334,7 +334,7 @@ void pickMode ( const unsigned int _examiner, std::string _mode) {
examiner_widgets_[_examiner]->pickMode(_mode);
}
void actionMode ( ACG::QtWidgets::QtBaseViewer::ActionMode _mode) {
void actionMode ( QtBaseViewer::ActionMode _mode) {
for ( uint i = 0 ; i < examiner_widgets_.size() ; ++i )
examiner_widgets_[i]->actionMode(_mode);
}
......@@ -347,7 +347,7 @@ void getCurrentViewImage(QImage& _image) {
examiner_widget_->copyToImage( _image );
}
ACG::QtWidgets::QtBaseViewer::ActionMode actionMode() {
QtBaseViewer::ActionMode actionMode() {
return examiner_widget_->actionMode();
}
......
......@@ -50,8 +50,8 @@
#include <OpenFlipper/common/Types.hh>
// #include <ACG/Math/VectorT.hh>
#include <ACG/QtWidgets/QtExaminerViewer.hh>
#include <ACG/QtWidgets/QtBaseViewer.hh>
#include <OpenFlipper/widgets/glWidget/QtExaminerViewer.hh>
#include <OpenFlipper/widgets/glWidget/QtBaseViewer.hh>
#include <ACG/GL/GLState.hh>
/** The Namespace PluginFunctions contains functions for all plugins. These functions should be used to get the
......@@ -194,7 +194,7 @@ int visible_count();
//=======================================
/// Set the internal examiner pointer ( DO NOT USE!! )
DLLEXPORT
void set_examiner( std::vector< ACG::QtWidgets::QtExaminerViewer* > _examiner_widgets );
void set_examiner( std::vector< QtExaminerViewer* > _examiner_widgets );
/// Set the active id of the examiner which got the last mouse events
DLLEXPORT
......@@ -273,11 +273,11 @@ void addGlobalNode(ACG::SceneGraph::BaseNode* _node);
/// Set the current Action Mode (PickMode,ExamineMode,...)
DLLEXPORT
void actionMode ( ACG::QtWidgets::QtBaseViewer::ActionMode _mode);
void actionMode ( QtBaseViewer::ActionMode _mode);
/// Get the current Action mode
DLLEXPORT
ACG::QtWidgets::QtBaseViewer::ActionMode actionMode();
QtBaseViewer::ActionMode actionMode();
/** Lock scene rotation via mouse
*
......
......@@ -12,12 +12,12 @@
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// OpenFlipper is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenFlipper. If not, see <http://www.gnu.org/licenses/>.
//
......@@ -35,61 +35,60 @@
//
// C++ Interface: TexturePlugin
//
// Description:
// Description:
//
//
// Author: Jan Moebius <jan_moebius@web.de>, (C) 2007
//
#ifndef TEXTUREINTERFACE_HH
#define TEXTUREINTERFACE_HH
#ifndef TEXTUREINTERFACE_HH
#define TEXTUREINTERFACE_HH
#include <QtGui>
#include <QMenuBar>
#include <ACG/QtWidgets/QtExaminerViewer.hh>
#include <OpenFlipper/common/Types.hh>
/**
* This Interface should be used by plugins which will provide a texture. The texture coordinates have
* to be written into a mesh property. You do not need to write texture information into the texture
* coordinates of the mesh. As other plugins may provide textures to, the visualization of the
* coordinates of the mesh. As other plugins may provide textures to, the visualization of the
* textures is handled by the main application (or a texture control plugin).
*/
class TextureInterface {
signals :
/** \brief Emit this Signal if a texture has been added (Property Name,filename,Dimension)
*
*
* @param _name Name of the property which contains the tex coords (double or vec2d)
* @param _filename Filename of the texture ( "./Textures/<name>")
* @param _dimension 1D texture ( currenty only supports 1 )
*/
virtual void addTexture( QString /*_name*/ , QString /*_filename*/ , uint /*_dimension*/ ) {};
/** \brief Tell Plugins to update the given texture for the given identifier
*/
virtual void updateTexture( QString /*_textureName*/ , int /*_identifier*/) {};
/** \brief Tell Plugins to update all textures
*/
virtual void updateAllTextures( ) {};
/** \brief emit this signal if you updated a texture
*
* Give the name of the texture and the id of the object or -1 if all objects were update
/** \brief emit this signal if you updated a texture
*
* Give the name of the texture and the id of the object or -1 if all objects were update
*/
virtual void updatedTextures( QString , int ) {};
/** \brief emit this signal if you want to switch the viewer to a specific texture mode
*
* Give the name of the texture and the id of the object or -1 if all objects were update
*
* Give the name of the texture and the id of the object or -1 if all objects were update
*/
virtual void switchTexture( QString ) {};
/** \brief emit this signal if you want to set a special mode for this texture (Clamping,...)
*
*
* emit this signal if you want to set a special mode for this texture
*
*
* Supported Mode Flags :\n
* Clamping : clamp=true/false \n
* Min Value for clamping : clamp_min=value \n
......@@ -101,63 +100,63 @@ class TextureInterface {
* \n
* The system works like this :\n
* First the abolute value of the property is taken if requested. Then this value is clamped against the given values. if the texture
* should be repeated, the values are translated such that the minimum is at zero and than scaled such that the maximum is at
* should be repeated, the values are translated such that the minimum is at zero and than scaled such that the maximum is at
* max_val. If its not repeated, the decision is to center the values around 0.5 or not. If not centered, the values are mapped directly
* to 0..1 .If centered, the negative values are mapped to 0..0.5 and the positive values to 0.5..1.
* @param _textureName Name of your Texture
* @param _mode colon seperated String describing your settings (e.g. clamp,abs )
*/
virtual void setTextureMode(QString /*_textureName*/ ,QString /*_mode*/) {};
private slots :
/** \brief update the texture with the given Name ( if this plugin provides this texture ) for all meshes
* @param _textureName Name of the Texture to be updated
* @param _identifier The id of the object to update
*/
virtual void slotUpdateTexture( QString /*_textureName*/ , int /*_identifier*/) {};
/** \brief update all textures provided by this plugin
*/
virtual void slotUpdateAllTextures( ) {};
/** \brief A texture has been added by a plugin.
*
* This slot is called when a texture has been added by a plugin.
/** \brief A texture has been added by a plugin.
*
* This slot is called when a texture has been added by a plugin.
* @param _textureName Name of the Added texture (has to be equal to the property name)
* @param _filename Filename of the Texture Image to be used
* @param dimension Dimension of the Texture (currently only 1D and 2D Textures are supported
*/
virtual void slotTextureAdded( QString /*_textureName*/ , QString /*_filename*/ , uint /*dimension*/ ) {};
/** \brief A texture has been updated
*
*
* A plugin has updated a Texture
* @param _textureName The name of the updated texture
* @param _identifier -1 if all objects updated, otherwise the identifier of the object
*/
virtual void slotTextureUpdated( QString /*_textureName*/ , int /*_identifier*/ ) {};
/** \brief Texturemode for texture should be changed
*
*
* A plugin has updated the Texture settings for a texture
* @param _textureName The name of the updated texture
* @param _mode New mode flags for the given texture
*/
virtual void slotSetTextureMode(QString /*_textureName*/ ,QString /*_mode*/) {};
/** \brief This slot is called when a plugin requests to switch to a different texture mode
*
*
* @param _textureName Name of the Texture
*/
virtual void slotSwitchTexture( QString /*_textureName*/ ) {};
public :
public :
/// Destructor
virtual ~TextureInterface() {};
};
Q_DECLARE_INTERFACE(TextureInterface,"OpenFlipper.TextureInterface/1.0")
#endif // TEXTUREINTERFACE_HH
......@@ -44,7 +44,6 @@
#include <QtGui>
#include <QMenuBar>
#include <QStringList>
#include <ACG/QtWidgets/QtExaminerViewer.hh>
#include <OpenFlipper/common/Types.hh>
#include <QToolBar>
......
......@@ -47,7 +47,6 @@
#include <QtGui>
#include <QMenuBar>
#include <QStringList>
#include <ACG/QtWidgets/QtExaminerViewer.hh>