Commit 23c63fbb authored by Jan Möbius's avatar Jan Möbius

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@2527 383ad7c9-94d9-4d36-a494-682f7c89f535
parents
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Config
#==============================================================================
#CXX_LDFLAGS += BasePlugin/Debian64_gcc4.0_max/libGUI_BasePlugin.so
SUBDIRS = $(call find-subdirs)
PACKAGES := glew qt4 ACG2 openmesh2
PROJ_LIBS =
MODULES := moc4 cxx
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Rules
#==============================================================================
//=============================================================================
//
// OpenFlipper
// Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen
// www.openflipper.org
//
//-----------------------------------------------------------------------------
//
// License
//
// OpenFlipper is free software: you can redistribute it and/or modify
// 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/>.
//
//-----------------------------------------------------------------------------
//
// $Revision$
// $Author$
// $Date$
//
//=============================================================================
//=============================================================================
//
//
//=============================================================================
//== INCLUDES =================================================================
#include "DrawModeConverter.hh"
//== TYPEDEFS =================================================================
//== CLASS DEFINITION =========================================================
/// Convert a drawmode to a vector of QStrings
std::vector< QString > drawModeToList(unsigned int _drawMode) {
std::vector< QString > draw_modes;
if ( _drawMode & ACG::SceneGraph::DrawModes::DEFAULT )
draw_modes.push_back("DEFAULT");
if ( _drawMode & ACG::SceneGraph::DrawModes::SOLID_SMOOTH_SHADED)
draw_modes.push_back("SOLID_SMOOTH_SHADED");
if ( _drawMode & ACG::SceneGraph::DrawModes::SOLID_FACES_COLORED)
draw_modes.push_back("SOLID_FACES_COLORED");
if ( _drawMode & ACG::SceneGraph::DrawModes::HIDDENLINE)
draw_modes.push_back("HIDDENLINE");
if ( _drawMode & ACG::SceneGraph::DrawModes::WIREFRAME)
draw_modes.push_back("WIREFRAME");
if ( _drawMode & ACG::SceneGraph::DrawModes::POINTS)
draw_modes.push_back("POINTS");
if ( _drawMode & ACG::SceneGraph::DrawModes::POINTS_COLORED)
draw_modes.push_back("POINTS_COLORED");
if ( _drawMode & ACG::SceneGraph::DrawModes::POINTS_SHADED)
draw_modes.push_back("POINTS_SHADED");
if ( _drawMode & ACG::SceneGraph::DrawModes::SOLID_FLAT_SHADED)
draw_modes.push_back("SOLID_FLAT_SHADED");
if ( _drawMode & ACG::SceneGraph::DrawModes::SOLID_PHONG_SHADED)
draw_modes.push_back("SOLID_PHONG_SHADED");
if ( _drawMode & ACG::SceneGraph::DrawModes::SOLID_POINTS_COLORED)
draw_modes.push_back("SOLID_POINTS_COLORED");
if ( _drawMode & ACG::SceneGraph::DrawModes::POINTS_COLORED)
draw_modes.push_back("SOLID_ENV_MAPPED");
if ( _drawMode & ACG::SceneGraph::DrawModes::SOLID_ENV_MAPPED)
draw_modes.push_back("SOLID_ENV_MAPPED");
if ( _drawMode & ACG::SceneGraph::DrawModes::SOLID_TEXTURED)
draw_modes.push_back("SOLID_TEXTURED");
if ( _drawMode & ACG::SceneGraph::DrawModes::SOLID_TEXTURED_SHADED)
draw_modes.push_back("SOLID_TEXTURED_SHADED");
if ( _drawMode & ACG::SceneGraph::DrawModes::SOLID_1DTEXTURED)
draw_modes.push_back("SOLID_1DTEXTURED");
if ( _drawMode & ACG::SceneGraph::DrawModes::SOLID_1DTEXTURED_SHADED)
draw_modes.push_back("SOLID_1DTEXTURED_SHADED");
if ( _drawMode & ACG::SceneGraph::DrawModes::SOLID_3DTEXTURED)
draw_modes.push_back("SOLID_3DTEXTURED");
if ( _drawMode & ACG::SceneGraph::DrawModes::SOLID_3DTEXTURED_SHADED)
draw_modes.push_back("SOLID_3DTEXTURED_SHADED");
return draw_modes;
}
/// Convert a vector of QStrings to a draw mode
unsigned int ListToDrawMode ( std::vector< QString > _draw_modes ) {
unsigned int drawMode = 0 ;
for ( uint i = 0 ; i < _draw_modes.size() ; ++i ) {
if( _draw_modes[i] == "DEFAULT" ) {
drawMode = drawMode | ACG::SceneGraph::DrawModes::DEFAULT;
} else if( _draw_modes[i] == "SOLID_SMOOTH_SHADED" ) {
drawMode = drawMode | ACG::SceneGraph::DrawModes::SOLID_SMOOTH_SHADED;
} else if( _draw_modes[i] == "SOLID_FACES_COLORED" ) {
drawMode = drawMode | ACG::SceneGraph::DrawModes::SOLID_FACES_COLORED;
} else if( _draw_modes[i] == "HIDDENLINE" ) {
drawMode = drawMode | ACG::SceneGraph::DrawModes::HIDDENLINE;
} else if( _draw_modes[i] == "WIREFRAME" ) {
drawMode = drawMode | ACG::SceneGraph::DrawModes::WIREFRAME;
} else if( _draw_modes[i] == "POINTS" ) {
drawMode = drawMode | ACG::SceneGraph::DrawModes::POINTS;
} else if( _draw_modes[i] == "POINTS_COLORED" ) {
drawMode = drawMode | ACG::SceneGraph::DrawModes::POINTS_COLORED;
} else if( _draw_modes[i] == "POINTS_SHADED" ) {
drawMode = drawMode | ACG::SceneGraph::DrawModes::POINTS_SHADED;
} else if( _draw_modes[i] == "SOLID_FLAT_SHADED" ) {
drawMode = drawMode | ACG::SceneGraph::DrawModes::SOLID_FLAT_SHADED;
} else if( _draw_modes[i] == "SOLID_PHONG_SHADED" ) {
drawMode = drawMode | ACG::SceneGraph::DrawModes::SOLID_PHONG_SHADED;
} else if( _draw_modes[i] == "SOLID_POINTS_COLORED" ) {
drawMode = drawMode | ACG::SceneGraph::DrawModes::SOLID_POINTS_COLORED;
} else if( _draw_modes[i] == "SOLID_ENV_MAPPED" ) {
drawMode = drawMode | ACG::SceneGraph::DrawModes::SOLID_ENV_MAPPED;
} else if( _draw_modes[i] == "SOLID_TEXTURED" ) {
drawMode = drawMode | ACG::SceneGraph::DrawModes::SOLID_TEXTURED;
} else if( _draw_modes[i] == "SOLID_TEXTURED_SHADED" ) {
drawMode = drawMode | ACG::SceneGraph::DrawModes::SOLID_TEXTURED_SHADED;
} else if( _draw_modes[i] == "SOLID_1DTEXTURED" ) {
drawMode = drawMode | ACG::SceneGraph::DrawModes::SOLID_1DTEXTURED;
} else if( _draw_modes[i] == "SOLID_1DTEXTURED_SHADED" ) {
drawMode = drawMode | ACG::SceneGraph::DrawModes::SOLID_1DTEXTURED_SHADED;
} else if( _draw_modes[i] == "SOLID_3DTEXTURED" ) {
drawMode = drawMode | ACG::SceneGraph::DrawModes::SOLID_3DTEXTURED;
} else if( _draw_modes[i] == "SOLID_3DTEXTURED_SHADED" ) {
drawMode = drawMode | ACG::SceneGraph::DrawModes::SOLID_3DTEXTURED_SHADED;
}
}
return drawMode;
}
//=============================================================================
//=============================================================================
//
// OpenFlipper
// Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen
// www.openflipper.org
//
//-----------------------------------------------------------------------------
//
// License
//
// OpenFlipper is free software: you can redistribute it and/or modify
// 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/>.
//
//-----------------------------------------------------------------------------
//
// $Revision$
// $Author$
// $Date$
//
//=============================================================================
//=============================================================================
//
//
//=============================================================================
#ifndef DRAWMODECONVERTER_HH
#define DRAWMODECONVERTER_HH
//== INCLUDES =================================================================
#include <ACG/Scenegraph/DrawModes.hh>
#include <QString>
//== DEFINES =================================================================
#ifdef WIN32
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT
#endif
//== TYPEDEFS =================================================================
//== CLASS DEFINITION =========================================================
DLLEXPORT
std::vector< QString > drawModeToList(unsigned int _drawMode);
DLLEXPORT
unsigned int ListToDrawMode ( std::vector< QString > _draw_modes );
//=============================================================================
#endif // DRAWMODECONVERTER_HH defined
//=============================================================================
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Config
#==============================================================================
#CXX_LDFLAGS += BasePlugin/Debian64_gcc4.0_max/libOpenFlipper_BasePlugin.so
$(info )
$(info ===================================================================== )
ObjectTypes: PolyLineSupport BSplineCurveSupport BSplineSurfaceSupport SkeletonSupport build
PolyLineSupport:
poly-exists := $(shell test -d $(top-dir)/ObjectTypes/PolyLine && echo poly-found)
ifeq ($(poly-exists), poly-found)
$(info Found PolyLine Object Type -> Enabled PolyLine Support )
PROJ_LIBS += ObjectTypes/PolyLine
else
$(warning No PolyLine Object Found! -> Disabled PolyLine Support )
endif
BSplineCurveSupport:
bsplinecurve-exists := $(shell test -d $(top-dir)/ObjectTypes/BSplineCurve && echo bsplinecurve-found)
ifeq ($(bsplinecurve-exists), bsplinecurve-found)
$(info Found BSplineCurve Object Type -> Enabled BSplineCurve Support )
PROJ_LIBS += ObjectTypes/BSplineCurve
else
$(warning No BSplineCurve Object Found! -> Disabled BSplineCurve Support )
endif
BSplineSurfaceSupport:
bsplinesurface-exists := $(shell test -d $(top-dir)/ObjectTypes/BSplineSurface && echo bsplinesurface-found)
ifeq ($(bsplinesurface-exists), bsplinesurface-found)
$(info Found BSplineSurface Object Type -> Enabled BSplineSurface Support )
PROJ_LIBS += ObjectTypes/BSplineSurface
else
$(warning No BSplineSurface Object Found! -> Disabled BSplineSurface Support )
endif
SkeletonSupport:
skeleton-exists := $(shell test -d $(top-dir)/ObjectTypes/Skeleton && echo skeleton-found)
ifeq ($(skeleton-exists), skeleton-found)
$(info Found Skeleton Object Type -> Enabled Skeleton Support )
PROJ_LIBS += ObjectTypes/Skeleton
else
$(warning No Skeleton Object Found! -> Disabled Skeleton Support )
endif
$(info ===================================================================== )
$(info )
SUBDIRS = common widgets Scripting ACGHelper Logging INIFile BasePlugin Core SimpleOpt
PACKAGES := qt4 glut glew opengl x11 math ACG2 openmesh2
PROJ_LIBS += OpenFlipper/BasePlugin \
OpenFlipper/Core \
OpenFlipper/ACGHelper \
OpenFlipper/common \
OpenFlipper/INIFile \
OpenFlipper/Logging \
OpenFlipper/Scripting \
OpenFlipper/Scripting/scriptPrototypes \
OpenFlipper/Scripting/scriptWrappers \
OpenFlipper/widgets/coreWidget \
OpenFlipper/widgets/helpBrowser \
OpenFlipper/widgets/loadWidget \
OpenFlipper/widgets/unloadPluginsWidget \
OpenFlipper/widgets/viewModeWidget \
OpenFlipper/widgets/addEmptyWidget \
OpenFlipper/widgets/viewModeWidget
MODULES := moc4 cxx
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Rules
#==============================================================================
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Config
#==============================================================================
SUBDIRS = $(call find-subdirs)
PACKAGES := qt4 glut glew opengl x11 math ACG2 openmesh2
PROJ_LIBS =
MODULES := moc4 cxx
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Rules
#==============================================================================
//=============================================================================
//
// OpenFlipper
// Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen
// www.openflipper.org
//
//-----------------------------------------------------------------------------
//
// License
//
// OpenFlipper is free software: you can redistribute it and/or modify
// 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/>.
//
//-----------------------------------------------------------------------------
//
// $Revision$
// $Author$
// $Date$
//
//=============================================================================
//
// C++ Interface: Backup Interface
//
// Description:
//
//
// Author: Jan Moebius <jan_moebius@web.de>, (C) 2007
//
#ifndef BACKUPPLUGININTERFACE_HH
#define BACKUPPLUGININTERFACE_HH
#include <QtGui>
#include <QMenuBar>
#include <OpenFlipper/common/Types.hh>
/** \brief Create or restore backups
*
* Interface Class for Backup Plugins. The Backup Interface can be used to communicate with or write a backup plugin.
*
*/
class BackupInterface {
signals:
/** Plugins which support backups should call this function if they want to create backups.\n
* A Backup control Plugin will do the rest.
* @param _id Identifier of the object to create the backup
* @param _name Name of the Backup, to show the user what can be recovered
*/
virtual void createBackup( int _id , QString _name ) {};
private slots:
/** This function will be called if a plugin requests a backup. You can
* also react on this event.
* @param _id Identifier of the object to create the backup
* @param _name Name of the Backup, to show the user what can be recovered
* @param _backup_id Unique Number of the backup.
*/
virtual void slotBackupRequested( int _id , QString _name , int _backup_id) {} ;
/** This function will be called if a plugin requests a backup. You can
* also react on this event.
* @param _id Identifier of the object to create the backup
* @param _name Name of the Backup, to show the user what can be recovered
* @param _backup_id Unique Number of the backup.
*/
virtual void slotRestoreRequested( int _id , QString _name , int _backup_id) {};
public :
/// Destructor
virtual ~BackupInterface() {};
};
Q_DECLARE_INTERFACE(BackupInterface,"GUI.BackupInterface/0.3")
#endif // BACKUPPLUGININTERFACE_HH
//=============================================================================
//
// OpenFlipper
// Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen
// www.openflipper.org
//
//-----------------------------------------------------------------------------
//
// License
//
// OpenFlipper is free software: you can redistribute it and/or modify
// 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/>.
//
//-----------------------------------------------------------------------------
//
// $Revision$
// $Author$
// $Date$
//
//=============================================================================
//
// C++ Interface: BasePlugin
//
// Description:
//
//
// Author: Jan Moebius <jan_moebius@web.de>, (C) 2007
//
#ifndef BASEINTERFACE_HH
#define BASEINTERFACE_HH
#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.
*
* You have to implement at least name and description for your plugin.
* All other functions and signals are optional. If you want to implement or use
* them just add them to your plugin header.
*/
class BaseInterface {
signals :
/** \brief Update current view in Main Application
*
* Emit this Signal if the examiner widget in the Main Application should update the current view.
* This should be done for example if you changed a scenegraph node or a mesh and have
* to redraw it.
*/
virtual void update_view() {};
/** \brief The object list has been changed by this plugin
*
* Emit this Signal, if the object list has changed (e.g. Source or Target changed).\n
* If you changed the element itself (geometry, topology,..) You should also emit this signal.\n
* Dont emit this Signal in BaseInterface::slotObjectUpdated() as this causes an endless Loop!!
* Give the id of the new object as parameter or -1 if you deleted an object.
*/
virtual void updated_objects(int) {};
/** \brief The active object has been switched by this plugin
*
* This Signal is used to tell the other plugins that the active object has been changed.\n
* You should only do this if you are writing a plugin that manages the objects(e.g. DatacontrolPlugin).\n
*/
virtual void activeObjectChanged() {};
private slots :
/** \brief An object has been updated by an other plugin
*
* This slot is called by the Main aplication if the number or status of existing objects changed or if
* an existing object has been changed. This could mean, that objects are added or deleted
* or that for an existing object with the given id has been modified.
* If you store local information about one of these Objects, you should check if its still valid!\n
* Dont emit BaseInterface::updated_objects(int) in this slot as this causes an endless Loop!!
* @param _identifier Identifier of the updated/new object or -1 if one is deleted
*/
virtual void slotObjectUpdated( int _identifier ) {};
/** \brief The active object has changed
*
* This slot is called by the Main aplication if the currently active object has changed.\n
* This means that the selection of target objects has changed.
*/
virtual void slotActiveObjectChanged() {};
/** \brief Initialize Plugin
*
* This slot is called if the plugin is loaded and has to be initialized. All initialization stuff
* in this slot has to stay inside the plugin, no external singals are allowed here.
* Dont create any objects via pluginfunctions here. Use the pluginsInitialized() slot for external
* Initialization. After execution of this slot your plugin should be fully functional.
* Only gui elements may be uninitialized and should be created in pluginsInitialized().
*/
virtual void initializePlugin() {};
/** \brief Initialize Plugin step 2
*
* This slot is called if all plugins are loaded and the core is ready. Here you can create objects,
* set Textures and everything which will involve signals to the core.
*/
virtual void pluginsInitialized() {};
/** This function is called when the application exits or when your plugin is about to be unloaded.
* Here you can clean up your plugin, delete local variables...
*/
virtual void exit(){};
/** Using this function you can inform the core that your plugin can run without creating a widget.
* If your plugin does not implement this function, it will not be loaded in scripting mode.
* You dont have to do anything in this function.
*/
virtual void noguiSupported( ) {} ;
public :
/// Destructor
virtual ~BaseInterface() {};
/** \brief Return a Name for the plugin
*
* This Function has to return the name of the plugin.
*/
virtual QString name() = 0;
/** \brief Return a description of what the plugin is doing
*
* This function has to return a basic description of the plugin
*/
virtual QString description() = 0;
};
Q_DECLARE_INTERFACE(BaseInterface,"OpenFlipper.BaseInterface/0.3")
#endif // BASEINTERFACE_HH
//=============================================================================
//
// OpenFlipper
// Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen
// www.openflipper.org
//
//-----------------------------------------------------------------------------
//
// License
//
// OpenFlipper is free software: you can redistribute it and/or modify
// 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/>.
//
//-----------------------------------------------------------------------------
//
// $Revision$
// $Author$
// $Date$
//
//=============================================================================
//
// C++ Interface: BasePlugin
//
// Description:
//
//
// Author: Jan Moebius <jan_moebius@web.de>, (C) 2007
//
#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,
/// 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 ty