Commit 26f202bf authored by Jan Möbius's avatar Jan Möbius

Fixed QWT Define ifdefs

Basic info about texture index type

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5838 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 9d77fd54
...@@ -29,11 +29,15 @@ ...@@ -29,11 +29,15 @@
namespace ACG { namespace ACG {
//== IMPLEMENTATION ========================================================== //== IMPLEMENTATION ==========================================================
/// Default constructor /// Default constructor
QwtFunctionPlot::QwtFunctionPlot(QWidget* _parent) : QDialog( _parent ), Ui::QwtFunctionPlotBase() QwtFunctionPlot::QwtFunctionPlot(QWidget* _parent) :
QDialog( _parent ),
Ui::QwtFunctionPlotBase(),
min_(FLT_MAX),
max_(FLT_MIN)
{ {
setupUi( this ); setupUi( this );
......
...@@ -1061,7 +1061,6 @@ void TextureControlPlugin::switchDrawMode( TextureType _type ) { ...@@ -1061,7 +1061,6 @@ void TextureControlPlugin::switchDrawMode( TextureType _type ) {
case MULTITEXTURE: case MULTITEXTURE:
case HALFEDGEBASED: case HALFEDGEBASED:
PluginFunctions::setDrawMode( ACG::SceneGraph::DrawModes::SOLID_2DTEXTURED_FACE_SHADED, PluginFunctions::ALL_VIEWERS ); PluginFunctions::setDrawMode( ACG::SceneGraph::DrawModes::SOLID_2DTEXTURED_FACE_SHADED, PluginFunctions::ALL_VIEWERS );
std::cerr << "A" << std::endl;
break; break;
case VERTEXBASED: case VERTEXBASED:
PluginFunctions::setDrawMode( ACG::SceneGraph::DrawModes::SOLID_TEXTURED_SHADED , PluginFunctions::ALL_VIEWERS); PluginFunctions::setDrawMode( ACG::SceneGraph::DrawModes::SOLID_TEXTURED_SHADED , PluginFunctions::ALL_VIEWERS);
......
...@@ -38,6 +38,12 @@ ...@@ -38,6 +38,12 @@
#include <QtGui> #include <QtGui>
#include <OpenFlipper/common/GlobalOptions.hh> #include <OpenFlipper/common/GlobalOptions.hh>
#include <OpenFlipper/common/Types.hh>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <ObjectTypes/PolyMesh/PolyMesh.hh>
#include <ObjectTypes/TriangleMesh/TriangleMesh.hh>
texturePropertiesWidget::texturePropertiesWidget(QWidget *parent) texturePropertiesWidget::texturePropertiesWidget(QWidget *parent)
: QDialog(parent) : QDialog(parent)
...@@ -144,18 +150,61 @@ void texturePropertiesWidget::textureAboutToChange(QTreeWidgetItem* _item, int _ ...@@ -144,18 +150,61 @@ void texturePropertiesWidget::textureAboutToChange(QTreeWidgetItem* _item, int _
void texturePropertiesWidget::textureChanged(QTreeWidgetItem* _item, int _column){ void texturePropertiesWidget::textureChanged(QTreeWidgetItem* _item, int _column){
//open changes for the last texture so switch back // ================================================================================
// opened changes for the last texture so switch back
// ================================================================================
if ( propChanged_ ){ if ( propChanged_ ){
textureList->setCurrentItem( curItem_ ); textureList->setCurrentItem( curItem_ );
return; return;
} }
// ================================================================================
// Unable to find the right texture
// ================================================================================
if ( !texData_->textureExists( _item->text(_column) ) ) if ( !texData_->textureExists( _item->text(_column) ) )
return; //should not happen return;
// ================================================================================
// Set name of the texture
// ================================================================================
textureName_ = _item->text(_column); textureName_ = _item->text(_column);
//update the dialog // ================================================================================
// Get Object to parse Properties
// ================================================================================
// BaseObjectData* obj;
// if ( PluginFunctions::getObject( id_ , obj ) ) {
// if( obj->dataType( DATA_TRIANGLE_MESH ) ){
// TriMesh* mesh = PluginFunctions::triMeshObject(obj)->mesh();
// std::string fprops;
// mesh->fprop_stats(fprops);
// QString facePropertyString(fprops.c_str());
// QStringList faceProperties = facePropertyString.split(QRegExp("\n"));
//
// std::cerr << "Got : \n" ;
// for ( int i = 0 ; i < faceProperties.size(); ++i ) {
// faceProperties[i] = faceProperties[i].trimmed();
// if ( ( ! faceProperties[i].size() == 0 ) && faceProperties[i] != "<fprop>" )
// std::cerr << faceProperties[i].toStdString() << std::endl;
// else
// continue;
//
// OpenMesh::FPropHandleT< int > indexPropertyTest;
// if ( mesh->get_property_handle(indexPropertyTest,faceProperties[i].toStdString()) ) {
// std::cerr << "Got handle : " << faceProperties[i].toStdString() << std::endl;
// } else {
// std::cerr << "Unable to get Handle : " << faceProperties[i].toStdString() << std::endl;
// }
// }
//
// } else if( obj->dataType( DATA_POLY_MESH ) ){
// PolyMesh* mesh = PluginFunctions::polyMeshObject(obj)->mesh();
// }
// }
// ================================================================================
// Update the dialog
// ================================================================================
Texture& texture = texData_->texture(textureName_); Texture& texture = texData_->texture(textureName_);
repeatBox->setChecked(texture.parameters.repeat); repeatBox->setChecked(texture.parameters.repeat);
...@@ -167,6 +216,36 @@ void texturePropertiesWidget::textureChanged(QTreeWidgetItem* _item, int _column ...@@ -167,6 +216,36 @@ void texturePropertiesWidget::textureChanged(QTreeWidgetItem* _item, int _column
clamp_min->setValue( texture.parameters.clamp_min ); clamp_min->setValue( texture.parameters.clamp_min );
clamp_max->setValue( texture.parameters.clamp_max ); clamp_max->setValue( texture.parameters.clamp_max );
switch (texture.type()) {
case MULTITEXTURE:
typeLabel->setText("Type: MultiTexture");
indexLabel->setEnabled(true);
indexBox->setEnabled(true);
indexBox->clear();
std::cerr << "Property status: " << std::endl;
indexBox->addItem("TODO");
break;
case HALFEDGEBASED:
typeLabel->setText("Type: HalfedgeBased");
indexLabel->setEnabled(false);
indexBox->setEnabled(false);
indexBox->clear();
break;
case VERTEXBASED:
typeLabel->setText("Type: VertexBased");
indexLabel->setEnabled(false);
indexBox->setEnabled(false);
indexBox->clear();
break;
case UNSET:
typeLabel->setText("Type: Unset");
indexLabel->setEnabled(false);
indexBox->setEnabled(false);
indexBox->clear();
break;
}
// Show the texture Image // Show the texture Image
imageLabel->setPixmap(QPixmap::fromImage(texture.textureImage)); imageLabel->setPixmap(QPixmap::fromImage(texture.textureImage));
imageLabel->setScaledContents(true); imageLabel->setScaledContents(true);
...@@ -209,6 +288,7 @@ void texturePropertiesWidget::textureChanged(QTreeWidgetItem* _item, int _column ...@@ -209,6 +288,7 @@ void texturePropertiesWidget::textureChanged(QTreeWidgetItem* _item, int _column
propChanged_ = false; propChanged_ = false;
curItem_ = textureList->currentItem(); curItem_ = textureList->currentItem();
} }
void texturePropertiesWidget::slotChangeImage() { void texturePropertiesWidget::slotChangeImage() {
...@@ -230,7 +310,7 @@ void texturePropertiesWidget::slotChangeImage() { ...@@ -230,7 +310,7 @@ void texturePropertiesWidget::slotChangeImage() {
image_ = imageLabel->pixmap()->toImage(); image_ = imageLabel->pixmap()->toImage();
#ifdef USE_QWT #ifdef WITH_QWT
functionPlot_->setImage( &image_ ); functionPlot_->setImage( &image_ );
functionPlot_->replot(); functionPlot_->replot();
#endif #endif
...@@ -309,7 +389,7 @@ void texturePropertiesWidget::slotButtonBoxClicked(QAbstractButton* _button){ ...@@ -309,7 +389,7 @@ void texturePropertiesWidget::slotButtonBoxClicked(QAbstractButton* _button){
void texturePropertiesWidget::slotPropertiesChanged(double /*_value*/){ void texturePropertiesWidget::slotPropertiesChanged(double /*_value*/){
propChanged_ = true; propChanged_ = true;
#ifdef USE_QWT #ifdef WITH_QWT
functionPlot_->setParameters(repeatBox->isChecked(), max_val->value(), functionPlot_->setParameters(repeatBox->isChecked(), max_val->value(),
clampBox->isChecked(), clamp_min->value(), clamp_max->value(), clampBox->isChecked(), clamp_min->value(), clamp_max->value(),
centerBox->isChecked(), centerBox->isChecked(),
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>877</width> <width>968</width>
<height>618</height> <height>618</height>
</rect> </rect>
</property> </property>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<widget class="QWidget" name="" > <widget class="QWidget" name="layoutWidget" >
<layout class="QVBoxLayout" name="verticalLayout_2" > <layout class="QVBoxLayout" name="verticalLayout_2" >
<item> <item>
<widget class="QLabel" name="textureLabel" > <widget class="QLabel" name="textureLabel" >
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="" > <widget class="QWidget" name="layoutWidget" >
<layout class="QVBoxLayout" name="verticalLayout_3" > <layout class="QVBoxLayout" name="verticalLayout_3" >
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_3" > <layout class="QHBoxLayout" name="horizontalLayout_3" >
...@@ -78,6 +78,47 @@ ...@@ -78,6 +78,47 @@
<string>Properties</string> <string>Properties</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout" > <layout class="QVBoxLayout" name="verticalLayout" >
<item>
<widget class="QLabel" name="typeLabel" >
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="text" >
<string>Type:</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_2" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4" >
<item>
<widget class="QLabel" name="indexLabel" >
<property name="text" >
<string>Index Property:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="indexBox" />
</item>
</layout>
</item>
<item>
<widget class="Line" name="line" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item> <item>
<widget class="QCheckBox" name="repeatBox" > <widget class="QCheckBox" name="repeatBox" >
<property name="text" > <property name="text" >
...@@ -253,7 +294,6 @@ ...@@ -253,7 +294,6 @@
<property name="title" > <property name="title" >
<string> Visualization of current values </string> <string> Visualization of current values </string>
</property> </property>
<zorder>groupBox</zorder>
</widget> </widget>
</item> </item>
</layout> </layout>
......
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