Commit e5605543 authored by Jan Möbius's avatar Jan Möbius
Browse files

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@4913 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 2694cadd
#== 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 cxxplugin
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Rules
#==============================================================================
################################################################################
#
################################################################################
include( $$TOPDIR/qmake/all.include )
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-ViewControl"
ProjectGUID="{5F9A2981-2B25-43C5-882F-62B672E76E5C}"
RootNamespace="ViewControlPlugin"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)Plugins\$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
>
<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"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="QtNetworkd4.lib QtCored4.lib QtGuid4.lib QtOpenGLd4.lib qtmaind.lib glut32.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(SolutionDir)/lib&quot;;C:\glut\lib;&quot;$(SolutionDir)\Debug&quot;;C:\glew\lib;&quot;$(QTDIR)/lib&quot;"
GenerateManifest="false"
IgnoreDefaultLibraryNames=""
GenerateDebugInformation="true"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary=""
/>
<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="1"
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;_LIB;_USE_MATH_DEFINES;INCLUDE_TEMPLATES;NOMINMAX;QT_NO_DEBUG"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
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"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(SolutionDir)/lib&quot;;C:\glut\lib;C:\glew\lib;&quot;$(QTDIR)/lib&quot;"
GenerateManifest="false"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary=""
/>
<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-ViewControl\ViewControlPlugin.cc"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\Plugin-ViewControl\ViewControlPlugin.hh"
FileType="2"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing ViewControlPlugin.hh..."
CommandLine="$(QTDIR)\bin\moc.exe ..\..\Plugin-ViewControl\ViewControlPlugin.hh -I ..\..\ -o tmp\moc\moc_ViewControlPlugin.cpp&#x0D;&#x0A;"
AdditionalDependencies="$(QTDIR)\bin\moc.exe"
Outputs="tmp\moc\moc_ViewControlPlugin.cpp"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing ViewControlPlugin.hh..."
CommandLine="$(QTDIR)\bin\moc.exe ..\..\Plugin-ViewControl\ViewControlPlugin.hh -I ..\..\ -o tmp\moc\moc_ViewControlPlugin.cpp&#x0D;&#x0A;"
AdditionalDependencies="$(QTDIR)\bin\moc.exe"
Outputs="tmp\moc\moc_ViewControlPlugin.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}"
>
</Filter>
<Filter
Name="Generated MOC Files"
>
<File
RelativePath=".\tmp\moc\moc_ViewControlPlugin.cpp"
>
</File>
</Filter>
<File
RelativePath=".\ReadMe.txt"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
This diff is collapsed.
#ifndef ViewControlPlugin_HH
#define ViewControlPlugin_HH
#include <QObject>
#include <QMenuBar>
#include <QGroupBox>
#include <OpenFlipper/BasePlugin/BaseInterface.hh>
#include <OpenFlipper/BasePlugin/LoggingInterface.hh>
#include <OpenFlipper/BasePlugin/PickingInterface.hh>
#include <OpenFlipper/BasePlugin/ContextMenuInterface.hh>
#include <OpenFlipper/common/Types.hh>
#include <ObjectTypes/PolyMesh/PolyMesh.hh>
#include <ObjectTypes/TriangleMesh/TriangleMesh.hh>
#include "shaderWidget.hh"
struct ShaderInfo {
QString name;
QString description;
QString details;
QString version;
QString example;
QString directory;
QString vertexShader;
QString fragmentShader;
bool hasUniforms;
QStringList uniforms;
QStringList uniformTypes;
QStringList uniformsDefault;
QStringList uniformsMax;
QStringList uniformsMin;
};
class ViewControlPlugin : public QObject, BaseInterface , PickingInterface, LoggingInterface, ContextMenuInterface
{
Q_OBJECT
Q_INTERFACES(BaseInterface)
Q_INTERFACES(PickingInterface)
Q_INTERFACES(LoggingInterface)
Q_INTERFACES(ContextMenuInterface)
signals:
void updateView();
void updatedObject(int);
void addHiddenPickMode( const std::string _mode );
void log(Logtype _type, QString _message);
void log(QString _message);
void addContextMenu(QMenu* _menu ,DataType _objectType , ContextMenuType _type );
private slots:
void pluginsInitialized();
void contextMenuTriggered(QAction* _action);
void slotUpdateContextMenu( int _objectId );
public :
~ViewControlPlugin() {};
QString name() { return (QString("ViewControl")); };
QString description( ) { return (QString("Control the current or global visualization settings")); };
private:
QMenu* viewControlMenu_;
/** Last object id for context menu. Is -1 if no object was selected
*/
int lastObjectId_;
/** Actions in the draw Context Menu
*/
std::vector< QAction * > drawMenuActions_;
/** Active draw Modes for the last clicked object and its children
*/
unsigned int activeDrawModes_;
/** Available draw Modes for the last clicked object and its children
*/
unsigned int availDrawModes_;
ShaderWidget* shaderWidget_;
/** List of available shaders
*/
std::vector <ShaderInfo> shaderList_;
private slots:
QString version() { return QString("1.0"); };
// This slot is called when a custom draw mode is selected from the context menu
void slotDrawModeSelected( QAction * _action );
// This slot is called when the user clicks on an item in the shaderWidget
void slotShaderClicked( QListWidgetItem * _item );
// This slot is called when the user doubleclicks on an item in the shaderWidget
void slotShaderDoubleClicked( QListWidgetItem * _item );
// slot for setting a shader from the widget
void slotSetShader();
// slot is called when the data of the uniforms-table changes
void itemChanged(QTableWidgetItem* item);
private:
// Update the list of available shaders
void updateShaderList();
// initialize the shader Widget
void initShaderWidget();
};
#endif //ViewControlPlugin_HH
#include "shaderWidget.hh"
#include <QtGui>
ShaderWidget::ShaderWidget(QWidget *parent)
: QWidget(parent)
{
setupUi(this);
}
#include "ui_shaderWidget.hh"
#include <QtGui>
class ShaderWidget : public QWidget, public Ui::ShaderSettings
{
Q_OBJECT
public:
ShaderWidget(QWidget *parent = 0);
};
<ui version="4.0" >
<class>ShaderSettings</class>
<widget class="QWidget" name="ShaderSettings" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>784</width>
<height>629</height>
</rect>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_2" >
<item row="0" column="0" >
<widget class="QGroupBox" name="groupBox_4" >
<property name="title" >
<string>Available Shaders</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3" >
<item>
<widget class="QListWidget" name="availableShaders" />
</item>
</layout>
</widget>
</item>
<item row="0" column="1" >
<widget class="QGroupBox" name="groupBox_3" >
<property name="title" >
<string>DrawModes using shader</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2" >
<item>
<widget class="QListWidget" name="drawModes" />
</item>
</layout>
</widget>
</item>
<item row="0" column="2" >
<widget class="QGroupBox" name="uniformBox" >
<property name="title" >
<string>Uniforms</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<widget class="QTableWidget" name="uniforms" />
</item>
</layout>
</widget>
</item>
<item rowspan="2" row="1" column="0" colspan="2" >
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>Info</string>
</property>
<layout class="QGridLayout" name="gridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>Name</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<layout class="QHBoxLayout" name="horizontalLayout_2" >
<property name="spacing" >
<number>4</number>
</property>
<item>
<widget class="QLineEdit" name="name" />
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" >
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>Version</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="version" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>Description</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="description" />
</item>
<item row="2" column="0" >
<widget class="QLabel" name="label_4" >
<property name="text" >
<string>Details</string>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QTextEdit" name="details" />
</item>
<item row="3" column="0" >
<widget class="QLabel" name="label_7" >
<property name="text" >
<string>VertexShader</string>
</property>
</widget>
</item>
<item row="3" column="1" >
<widget class="QLineEdit" name="vertexShader" />
</item>
<item row="4" column="0" >
<widget class="QLabel" name="label_8" >
<property name="text" >
<string>fragmentShader</string>
</property>
</widget>
</item>
<item row="4" column="1" >
<widget class="QLineEdit" name="fragmentShader" />
</item>
</layout>
<zorder>label_2</zorder>
<zorder>label</zorder>
<zorder>description</zorder>
<zorder>label_4</zorder>
<zorder>details</zorder>
<zorder>label_7</zorder>
<zorder>vertexShader</zorder>
<zorder>label_8</zorder>
<zorder>fragmentShader</zorder>
<zorder>groupBox2</zorder>
</widget>
</item>
<item row="1" column="2" >
<widget class="QGroupBox" name="groupBox2" >
<property name="minimumSize" >
<size>
<width>250</width>
<height>250</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>250</width>
<height>250</height>
</size>
</property>
<property name="title" >
<string>Example</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4" >
<item>
<widget class="QLabel" name="example" >
<property name="text" >
<string/>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="2" >
<spacer name="verticalSpacer" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0" colspan="3" >
<layout class="QHBoxLayout" name="horizontalLayout_6" >
<item>
<spacer name="horizontalSpacer_3" >
<property name="orientation" >