Commit 3d33a898 authored by Jan Möbius's avatar Jan Möbius

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@4915 383ad7c9-94d9-4d36-a494-682f7c89f535
parents
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Config
#==============================================================================
SUBDIRS = $(call find-subdirs)
PACKAGES := qt4 glut glew opengl x11 math ACG2 openmesh2
PROJ_LIBS =
MODULES := uic4compat moc4 cxx
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Rules
#==============================================================================
This diff is collapsed.
This diff is collapsed.
#ifndef MOVEPLUGIN_HH
#define MOVEPLUGIN_HH
#include <QObject>
#include <QMenuBar>
#include <OpenFlipper/BasePlugin/BaseInterface.hh>
#include <OpenFlipper/BasePlugin/MouseInterface.hh>
#include <OpenFlipper/BasePlugin/KeyInterface.hh>
#include <OpenFlipper/BasePlugin/PickingInterface.hh>
#include <OpenFlipper/BasePlugin/ToolboxInterface.hh>
#include <OpenFlipper/BasePlugin/BackupInterface.hh>
#include <OpenFlipper/BasePlugin/LoggingInterface.hh>
#include <OpenFlipper/BasePlugin/ScriptInterface.hh>
#include <OpenFlipper/BasePlugin/ToolbarInterface.hh>
#include <OpenFlipper/common/Types.hh>
#include <ObjectTypes/PolyMesh/PolyMesh.hh>
#include <ObjectTypes/TriangleMesh/TriangleMesh.hh>
#include "MoveToolbar.hh"
enum SelectionType {VERTEX, EDGE, FACE };
/** Plugin for moving objects and selections
*/
class MovePlugin : public QObject, BaseInterface, MouseInterface, PickingInterface, ToolboxInterface, BackupInterface, LoggingInterface, ScriptInterface,ToolbarInterface
{
Q_OBJECT
Q_INTERFACES(BaseInterface)
Q_INTERFACES(MouseInterface)
Q_INTERFACES(PickingInterface)
Q_INTERFACES(ToolboxInterface)
Q_INTERFACES(BackupInterface)
Q_INTERFACES(LoggingInterface)
Q_INTERFACES(ScriptInterface)
Q_INTERFACES(ToolbarInterface)
signals:
// BaseInterface
void updateView();
void updatedObject(int);
void activeObjectChanged();
// PickingInterface
void addPickMode( const std::string _mode );
void addHiddenPickMode( const std::string _mode );
void setPickModeMouseTracking (const std::string _mode, bool _mouseTracking);
// BackupInterface
void createBackup( int _id , QString _name );
// LoggingInterface
void log(Logtype _type, QString _message);
void log(QString _message);
// ScriptInterface
void scriptInfo( QString _functionName );
void setSlotDescription(QString _slotName, QString _slotDescription,
QStringList _parameters, QStringList _descriptions);
// ToolbarInterface
void addToolbar(QToolBar* _toolbar);
void getToolBar( QString _name, QToolBar*& _toolbar);
private slots :
// BaseInterface
void slotActiveObjectChanged() {};
void pluginsInitialized();
// MouseInterface
void slotMouseWheelEvent(QWheelEvent * _event, const std::string & _mode);
void slotMouseEvent( QMouseEvent* _event );
// PickingInterface
void slotPickModeChanged( const std::string& _mode);
// BackupInterface
void slotBackupRequested( int /*_id*/ , QString /*_name*/ , int /*_backup_id*/){};
void slotRestoreRequested( int /*_id*/ , QString /*_name*/ , int /*_backup_id*/){};
public :
/// Default Constructor
MovePlugin();
/// Destructor
~MovePlugin() {};
/// Initialize the toolbar (create a widget in the right side toolbox)
bool initializeToolbox(QWidget*& _widget);
/// Name of the Plugin
QString name(){ return (QString("Move")); };
/// Description of the Plugin
QString description() { return (QString("Moves Meshes with Manipulators")); };
/// User selected plugins Toolbox
void toolboxActivated( bool _activated );
//===========================================================================
/** @name ToolBox
* @{ */
//===========================================================================
private:
/// stores the current axes in the tool
int axisA_;
int axisB_;
private slots:
/// Position of manipulator in tab changed
void slotSetPosition();
/// Toggle the first axis for changing direction in tab
void slotToggleAxisA();
/// Toggle the second axis for changing direction in tab
void slotToggleAxisB();
/// Set Direction of manipulator in tab changed
void slotSetDirection();
/// perform a translation for Manipulator in tab
void slotTranslation();
/// Project the current manipulator onto the tangent plane of the object
void slotProjectToTangentPlane();
/// Move the current manipulator to the cog of the object
void slotMoveManipToCOG();
/// Rotate Manipulator (with values from Tab)
void slotRotate();
/// Scale (with values from Tab)
void slotScale();
/// Move currently active or first Mesh with its COG to the origin
void slotMoveToOrigin();
/// Scale Boundingbox Diagonal to unit size
void slotUnifyBoundingBoxDiagonal();
private:
/// Update the Dialog with the last clicked manipulator
void updateManipulatorDialog();
/// True if the toolbox widget is active
bool toolboxActive_;
/// Widget for Toolbox
moveToolbarWidget* tool_;
/** @} */
//===========================================================================
/** @name ToolBar
* @{ */
//===========================================================================
private :
QAction* moveAction_;
QAction* moveSelectionAction_;
QActionGroup* toolBarActions_;
private slots:
/// Called by Toolbar to enable move mode
void slotSetMoveMode(QAction* _action);
/** @} */
//===========================================================================
/** @name Manipulator Handling
* @{ */
//===========================================================================
private slots:
/// move the object when its manipulator moves
void manipulatorMoved( QtTranslationManipulatorNode* _node , QMouseEvent* _event);
/// update object when its manipulator changes position
void ManipulatorPositionChanged(QtTranslationManipulatorNode* _node );
private:
///Transform a mesh with the given transformation matrix
template< typename MeshT >
void transformMesh(ACG::Matrix4x4d _mat , MeshT& _mesh );
#ifdef ENABLE_POLYLINE_SUPPORT
///Transform a polyline with the given transformation matrix
template< class PolyLineT >
void transformPolyLine( ACG::Matrix4x4d _mat , PolyLineT& _polyLine );
#endif
/** Get the Matrix of the last active Manipulator ( Identity if not found or hidden Manipulator )
*
* @param _reset reset the transformation matrix of the manipulator to identity)
* @return current transformation matrix of the manipulator
*/
ACG::Matrix4x4d getLastManipulatorMatrix(bool _reset = true);
/// Checks if the manipulators should be visible or not
void showManipulators( );
/// Place and show the Manipulator
void placeManip(QMouseEvent * _event);
/// scale mesh to have a boundingboxdiagonal of one
template< typename MeshT >
void unifyBBDiag(MeshT& _mesh );
/// Size for the manipulators
double manip_size_;
/// Modifier for the Size (changed by Mousewheel Events)
double manip_size_modifier_;
/// Stores the last manipulator which has been clicked ( used for the toolbox dialog)
int lastActiveManipulator_;
/// Set Descriptions for scriptable functions
void setDescriptions();
/// Move an object with given id
void moveObject(ACG::Matrix4x4d mat, int _id);
/// Move selection on an object with given id
void moveSelection(ACG::Matrix4x4d mat, int _id);
/** @} */
//===========================================================================
/** @name Selection Plugin Communication
* @{ */
//===========================================================================
/// have we already tried to connect to Selection Plugin?
bool selectionConnected_;
/// Current SelectionType of SelectionPlugin
SelectionType selectionType_;
/// Connect to SelectionPlugin
void connectSelectionActions();
private slots:
/// The SelectionMode changed in SelectionPlugin
void slotSelectionModeChanged(QAction* _action);
/** @} */
//===========================================================================
/** @name Scriptable Functions
* @{ */
//===========================================================================
public slots :
/// translate an Object by a given vector
void translate( int _objectId , Vector _vector );
/// translate given vertices by a vector
void translate( int _objectId , idList _vHandles, Vector _vector );
/// translate current selection of an Object by a given vector
void translateSelection( int _objectId , Vector _vector );
/// transform an Object by a given matrix
void transform( int _objectId , Matrix4x4 _matrix );
/// transform given vertices by a matrix
void transform( int _objectId , idList _vHandles, Matrix4x4 _matrix );
/// transform current selection of an Object by a given matrix
void transformVertexSelection( int _objectId , Matrix4x4 _matrix );
/// transform current selection of an Object by a given matrix
void transformFaceSelection( int _objectId , Matrix4x4 _matrix );
/// transform current selection of an Object by a given matrix
void transformEdgeSelection( int _objectId , Matrix4x4 _matrix );
/// Set the position of the manipulator
void setManipulatorPosition( int _objectId , Vector _position );
/// Get the position of the manipulator
Vector manipulatorPosition( int _objectId );
/// Set the direction of the manipulator
void setManipulatorDirection( int _objectId , Vector _directionX, Vector _directionY );
/// Get the x-direction of the manipulator
Vector manipulatorDirectionX( int _objectId );
/// Get the y-direction of the manipulator
Vector manipulatorDirectionY( int _objectId );
/// Get the z-direction of the manipulator
Vector manipulatorDirectionZ( int _objectId );
/** @} */
public slots:
QString version() { return QString("1.1"); };
private:
QToolBar* toolbar_;
};
#endif //MOVEPLUGIN_HH
This diff is collapsed.
#include "MoveToolbar.hh"
#include <QtGui>
moveToolbarWidget::moveToolbarWidget(QWidget *parent)
: QWidget(parent)
{
setupUi(this);
}
#include "ui_moveControls.hh"
#include <QtGui>
class moveToolbarWidget : public QWidget, public Ui::moveControls
{
Q_OBJECT
public:
moveToolbarWidget(QWidget *parent = 0);
};
################################################################################
#
################################################################################
include( $$TOPDIR/qmake/all.include )
openmp()
Plugin()
DIRECTORIES = .
# Input
HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
################################################################################
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="Plugin-Move"
ProjectGUID="{E17C35C5-9B90-4980-8A87-09E59D5CE040}"
RootNamespace="PluginMove"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)Plugins\$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="c:\glut\include;C:\glew\include;&quot;$(SolutionDir)\..&quot;;&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)\Windows\include&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtOpenGL&quot;;&quot;$(QTDIR)\mkspecs\win32-msvc.net&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;QT_GUI_LIB;QT_CORE_LIB;_USE_MATH_DEFINES;INCLUDE_TEMPLATES;NOMINMAX"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="glew32.lib QtNetworkd4.lib QtCored4.lib QtGuid4.lib QtOpenGLd4.lib qtmaind.lib glut32.lib"
AdditionalLibraryDirectories="&quot;$(SolutionDir)/lib&quot;;C:\glut\lib;&quot;$(SolutionDir)\Debug&quot;;C:\glew\lib;&quot;$(QTDIR)/lib&quot;"
GenerateManifest="false"
GenerateDebugInformation="true"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
EmbedManifest="false"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)Plugins\$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="c:\glut\include;c:\glew\include;&quot;$(SolutionDir)\..&quot;;&quot;$(SolutionDir)&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtOpenGL&quot;;&quot;$(QTDIR)\mkspecs\win32-msvc.net&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGINDATACONTROL_EXPORTS;_USE_MATH_DEFINES;INCLUDE_TEMPLATES;NOMINMAX;QT_NO_DEBUG"
RuntimeLibrary="2"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="glew32.lib QtNetwork4.lib QtCore4.lib QtGui4.lib QtOpenGL4.lib qtmain.lib glut32.lib"
AdditionalLibraryDirectories="&quot;$(SolutionDir)/lib&quot;;C:\glut\lib;&quot;$(SolutionDir)\Debug&quot;;C:\glew\lib;&quot;$(QTDIR)/lib&quot;"
GenerateManifest="false"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
EmbedManifest="false"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\Plugin-Move\MovePlugin.cc"
>
</File>
<File
RelativePath="..\..\Plugin-Move\MovePluginScript.cc"
>
</File>
<File
RelativePath="..\..\Plugin-Move\MoveToolbar.cc"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\Plugin-Move\MovePlugin.hh"
FileType="2"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing MovePlugin.hh"
CommandLine="$(QTDIR)\bin\moc.exe ..\..\Plugin-Move\MovePlugin.hh -I ..\..\ -o tmp\moc\moc_MovePlugin.cpp&#x0D;&#x0A;"
AdditionalDependencies="$(QTDIR)\bin\moc.exe"
Outputs="tmp\moc\moc_MovePlugin.cpp"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing MovePlugin.hh"
CommandLine="$(QTDIR)\bin\moc.exe ..\..\Plugin-Move\MovePlugin.hh -I ..\..\ -o tmp\moc\moc_MovePlugin.cpp&#x0D;&#x0A;"
AdditionalDependencies="$(QTDIR)\bin\moc.exe"
Outputs="tmp\moc\moc_MovePlugin.cpp"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\Plugin-Move\MoveToolbar.hh"
FileType="2"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing MoveToolbar.hh"
CommandLine="$(QTDIR)\bin\moc.exe ..\..\Plugin-Move\MoveToolbar.hh -I ..\..\ -o tmp\moc\moc_MoveToolbar.cpp&#x0D;&#x0A;"
AdditionalDependencies="$(QTDIR)\bin\moc.exe"
Outputs=" tmp\moc\moc_MoveToolbar.cpp"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing MoveToolbar.hh"
CommandLine="$(QTDIR)\bin\moc.exe ..\..\Plugin-Move\MoveToolbar.hh -I ..\..\ -o tmp\moc\moc_MoveToolbar.cpp&#x0D;&#x0A;"
AdditionalDependencies="$(QTDIR)\bin\moc.exe"
Outputs=" tmp\moc\moc_MoveToolbar.cpp"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath="..\..\Plugin-Move\ui_moveControls.ui"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="UIC&apos;ing ui_moveControls.hh"
CommandLine="$(QTDIR)\bin\uic.exe ..\..\Plugin-Move\ui_moveControls.ui -o ..\..\Plugin-Move\ui_moveControls.hh&#x0D;&#x0A;"
AdditionalDependencies="$(QTDIR)\bin\uic.exe"
Outputs="..\..\Plugin-Move\ui_moveControls.hh"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="UIC&apos;ing ui_moveControls.hh"
CommandLine="$(QTDIR)\bin\uic.exe ..\..\Plugin-Move\ui_moveControls.ui -o ..\..\Plugin-Move\ui_moveControls.hh&#x0D;&#x0A;"
AdditionalDependencies="$(QTDIR)\bin\uic.exe"
Outputs="..\..\Plugin-Move\ui_moveControls.hh"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Generated MOC Files"
>
<File
RelativePath=".\tmp\moc\moc_MovePlugin.cpp"
>
</File>
<File
RelativePath=".\tmp\moc\moc_MoveToolbar.cpp"
>
</File>
</Filter>
<Filter
Name="Generated UI Files"
>
<File
RelativePath=".\tmp\ui\ui_moveControls.hh"
FileType="2"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
This diff is collapsed.
Markdown is supported
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