Commit 01040970 authored by Jan Möbius's avatar Jan Möbius

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@2457 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 := uic4 moc4 cxx
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Rules
#==============================================================================
This diff is collapsed.
//=============================================================================
//
// 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 TEXTURECONTROLPLUGIN_HH
#define TEXTURECONTROLPLUGIN_HH
#define OM_FORCE_STATIC_CAST
#include <QObject>
#include <QMenuBar>
#include <OpenFlipper/BasePlugin/BaseInterface.hh>
#include <OpenFlipper/BasePlugin/TextureInterface.hh>
#include <OpenFlipper/BasePlugin/LoggingInterface.hh>
#include <OpenFlipper/BasePlugin/MenuInterface.hh>
#include <ACG/QtWidgets/QtExaminerViewer.hh>
#include <OpenFlipper/common/Types.hh>
#include "textureProperties.hh"
struct Texture {
QString name;
QString filename;
uint dimension;
double clamp_min;
double clamp_max;
bool clamp;
bool repeat;
double max_val;
bool center;
bool abs;
bool scale;
uint type;
};
class TextureControlPlugin : public QObject, BaseInterface, TextureInterface, MenuInterface, LoggingInterface
{
Q_OBJECT
Q_INTERFACES(BaseInterface)
Q_INTERFACES(TextureInterface)
Q_INTERFACES(MenuInterface)
Q_INTERFACES(LoggingInterface)
public:
enum TextureType { VERTEXBASED = 1 << 0, HALFEDGEBASED = 1 << 1};
signals:
void update_view();
void updateTexture( QString , int);
void log(Logtype _type, QString _message);
void log(QString _message);
void addMenu(QMenu* _menu, MenuType _type);
private slots:
void slotObjectUpdated(int _identifier);
void slotUpdateAllTextures( );
void slotTextureAdded( QString _textureName , QString _filename , uint _dimension );
void slotTextureUpdated( QString _textureName , int _identifier );
void slotSetTextureMode(QString _textureName ,QString _mode);
void slotSwitchTexture( QString _textureName );
private slots:
void slotSetTextureProperties();
void slotTextureMenu(QAction* _action);
void slotTexturePropertiesOk();
void slotTexturePropertiesCancel();
void slotTexturePropertiesApply();
void pluginsInitialized();
public :
~TextureControlPlugin() {delete(settingsDialog_);};
QString name() { return (QString("TextureControl")); };
QString description( ) { return (QString("Handles Textures which are written to mesh properties")); };
private :
QMenu *textureMenu_;
QActionGroup* actionGroup_;
QAction* AC_Texture_Settings;
QString activeTexture_;
std::vector< Texture > textures_;
std::vector<QAction*> textureActions_;
texturePropertiesWidget* settingsDialog_;
/// Set the active texture values to the values in the dialog box.
void applyDialogSettings();
/// Update the values in the Dialog box to the current ones
void updateDialog();
/// For a given mesh compute the minimum and maximum values depending on texture settings (vertex based)
template< typename MeshT >
inline
void computeMinMaxScalar(int _textureid, MeshT& _mesh,OpenMesh::VPropHandleT< double > _texture,double& _min , double& _max);
/// For a given mesh compute the minimum and maximum values depending on texture settings (halfedge based)
template< typename MeshT >
inline
void computeMinMaxScalar(int _textureid, MeshT& _mesh,OpenMesh::HPropHandleT< double > _texture,double& _min , double& _max);
/// Take a scalar value and return a clamped,... depending on texture settings
inline
void computeValue(int _textureid, double _min, double _max, double& _value);
/// Calls the correct \a copyTexture() function to copy the texture property into the displayed OM property
template< typename MeshT >
void doUpdateTexture ( int _textureid, MeshT& _mesh);
/// Copy the supplied 1D vertex property to both coordinates of the 2D vertex OM texture property
template< typename MeshT >
void copyTexture(int _textureid, MeshT& _mesh, OpenMesh::VPropHandleT< double > _texProp );
/// Copy the supplied 1D halfedge property to both coordinates of the 2D halfedge OM texture property
template< typename MeshT >
void copyTexture(int _textureid, MeshT& _mesh, OpenMesh::HPropHandleT< double > _texProp );
/// Copy the supplied 2D vertex property to the 2D vertex OM property
template< typename MeshT >
void copyTexture(int _textureid, MeshT& _mesh, OpenMesh::VPropHandleT< ACG::Vec2d > _texProp );
/// Copy the supplied 2D halfedge property to the 2D halfedge OM property
template< typename MeshT >
void copyTexture(int _textureid, MeshT& _mesh, OpenMesh::HPropHandleT< ACG::Vec2d > _texProp );
};
#endif //TEXTURECONTROLPLUGIN_HH
<ui version="4.0" >
<class>Dialog</class>
<widget class="QDialog" name="Dialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>257</width>
<height>272</height>
</rect>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>90000</width>
<height>90000</height>
</size>
</property>
<property name="windowTitle" >
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" >
<item>
<widget class="QCheckBox" name="repeatBox" >
<property name="text" >
<string>Repeat Texture</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>Max Value</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="max_val" />
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="clampBox" >
<property name="text" >
<string>Clamp Texture</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<string>Clamp Min</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>Clamp Max</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="QLineEdit" name="clamp_min" />
</item>
<item>
<widget class="QLineEdit" name="clamp_max" />
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="centerBox" >
<property name="text" >
<string>center</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="absBox" >
<property name="text" >
<string>Use Absolute values</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="scaleBox" >
<property name="text" >
<string>Scale</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="okButton" >
<property name="text" >
<string>Ok</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="applyButton" >
<property name="text" >
<string>Apply</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancelButton" >
<property name="text" >
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
//=============================================================================
//
// 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$
//
//=============================================================================
#include "textureProperties.hh"
#include <QtGui>
texturePropertiesWidget::texturePropertiesWidget(QWidget *parent)
: QDialog(parent)
{
setupUi(this);
// connect(distanceCheckBox,SIGNAL(stateChanged ( int ) ) , this , SLOT (slotDistanceCheckbox(int)) );
// connect(normalCheckBox,SIGNAL(stateChanged ( int ) ) , this , SLOT (slotNormalCheckbox(int)) );
}
//=============================================================================
//
// 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$
//
//=============================================================================
#include "Ui_TextureProperties.hh"
#include <QtGui>
class texturePropertiesWidget : public QDialog, public Ui::Dialog
{
Q_OBJECT
public:
texturePropertiesWidget(QWidget *parent = 0);
};
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