Commit 9f3c4847 authored by Marlin Frickenschmidt's avatar Marlin Frickenschmidt
Browse files

Implemented Texture Properties histogram buttons. They are now working. ;)

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10391 383ad7c9-94d9-4d36-a494-682f7c89f535
parent e5414071
......@@ -84,7 +84,11 @@ QwtFunctionPlot::QwtFunctionPlot(QWidget* _parent) :
setupUi( this );
plot_zoomer_ = new QwtPlotZoomer( qwtPlot->canvas());
connect(zoomInButton, SIGNAL( clicked() ), this,SLOT( zoomIn() ) );
connect(zoomOutButton,SIGNAL( clicked() ), this,SLOT( zoomOut() ) );
connect(clampButton, SIGNAL( clicked() ), this,SLOT( clamp() ) );
// delete widget on close
setAttribute(Qt::WA_DeleteOnClose, true);
......@@ -191,6 +195,30 @@ void QwtFunctionPlot::initValues()
//------------------------------------------------------------------------------
void QwtFunctionPlot::zoomIn()
{
emit plot_zoomer_->zoom(1);
}
//------------------------------------------------------------------------------
void QwtFunctionPlot::zoomOut()
{
emit plot_zoomer_->zoom(-1);
}
//------------------------------------------------------------------------------
void QwtFunctionPlot::clamp()
{
QwtDoubleRect clamped = plot_zoomer_->zoomRect();
clamped.setLeft( transform(min_) );
clamped.setRight( transform(max_) );
emit plot_zoomer_->zoom(clamped);
}
//------------------------------------------------------------------------------
void QwtFunctionPlot::replot()
{
......
......@@ -108,6 +108,11 @@ public:
void setImage(QImage* _image);
public slots:
void zoomIn();
void zoomOut();
void clamp();
void replot();
private:
......
<ui version="4.0" >
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QwtFunctionPlotBase</class>
<widget class="QWidget" name="QwtFunctionPlotBase" >
<property name="windowModality" >
<widget class="QWidget" name="QwtFunctionPlotBase">
<property name="windowModality">
<enum>Qt::NonModal</enum>
</property>
<property name="geometry" >
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
......@@ -12,42 +13,42 @@
<height>474</height>
</rect>
</property>
<property name="windowTitle" >
<property name="windowTitle">
<string>Function Plot</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout" >
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QwtPlot" name="qwtPlot" />
<widget class="QwtPlot" name="qwtPlot"/>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout" >
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QPushButton" name="zommIn" >
<property name="text" >
<widget class="QPushButton" name="zoomInButton">
<property name="text">
<string>+</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="zoomOut" >
<property name="text" >
<widget class="QPushButton" name="zoomOutButton">
<property name="text">
<string>-</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="clamp" >
<property name="text" >
<widget class="QPushButton" name="clampButton">
<property name="text">
<string>C</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer" >
<property name="orientation" >
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
......@@ -59,7 +60,7 @@
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<layoutdefault spacing="6" margin="11"/>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<customwidgets>
<customwidget>
......
<ui version="4.0" >
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog" >
<property name="geometry" >
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
......@@ -9,58 +10,58 @@
<height>618</height>
</rect>
</property>
<property name="minimumSize" >
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<property name="maximumSize">
<size>
<width>90000</width>
<height>90000</height>
</size>
</property>
<property name="windowTitle" >
<string>Dialog</string>
<property name="windowTitle">
<string>Texture Properties</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5" >
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QSplitter" name="splitter" >
<property name="orientation" >
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QWidget" name="layoutWidget" >
<layout class="QVBoxLayout" name="verticalLayout_2" >
<widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="textureLabel" >
<property name="text" >
<widget class="QLabel" name="textureLabel">
<property name="text">
<string>Textures:</string>
</property>
</widget>
</item>
<item>
<widget class="QTreeWidget" name="textureList" >
<property name="minimumSize" >
<widget class="QTreeWidget" name="textureList">
<property name="minimumSize">
<size>
<width>300</width>
<height>0</height>
</size>
</property>
<property name="rootIsDecorated" >
<property name="rootIsDecorated">
<bool>true</bool>
</property>
<property name="uniformRowHeights" >
<property name="uniformRowHeights">
<bool>false</bool>
</property>
<property name="itemsExpandable" >
<property name="itemsExpandable">
<bool>true</bool>
</property>
<property name="headerHidden" >
<property name="headerHidden">
<bool>true</bool>
</property>
<column>
<property name="text" >
<property name="text">
<string>1</string>
</property>
</column>
......@@ -68,132 +69,132 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget" >
<layout class="QVBoxLayout" name="verticalLayout_3" >
<widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3" >
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Properties</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="typeLabel" >
<property name="maximumSize" >
<widget class="QLabel" name="typeLabel">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="text" >
<property name="text">
<string>Type:</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_2" >
<property name="orientation" >
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4" >
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="indexLabel" >
<property name="text" >
<widget class="QLabel" name="indexLabel">
<property name="text">
<string>Index Property:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="indexBox" />
<widget class="QComboBox" name="indexBox"/>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line" >
<property name="orientation" >
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="repeatBox" >
<property name="text" >
<widget class="QCheckBox" name="repeatBox">
<property name="text">
<string>Repeat Texture</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" >
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_3" >
<property name="text" >
<widget class="QLabel" name="label_3">
<property name="text">
<string>Maximum:</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="max_val" />
<widget class="QDoubleSpinBox" name="max_val"/>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="clampBox" >
<property name="text" >
<widget class="QCheckBox" name="clampBox">
<property name="text">
<string>Clamp Texture</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" >
<property name="spacing" >
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<widget class="QLabel" name="label">
<property name="text">
<string>Minimum:</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="clamp_min" >
<property name="decimals" >
<widget class="QDoubleSpinBox" name="clamp_min">
<property name="decimals">
<number>3</number>
</property>
<property name="minimum" >
<property name="minimum">
<double>-9999.000000000000000</double>
</property>
<property name="maximum" >
<property name="maximum">
<double>9999.000000000000000</double>
</property>
<property name="singleStep" >
<property name="singleStep">
<double>0.500000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2" >
<property name="text" >
<widget class="QLabel" name="label_2">
<property name="text">
<string>Maximum:</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="clamp_max" >
<property name="decimals" >
<widget class="QDoubleSpinBox" name="clamp_max">
<property name="decimals">
<number>3</number>
</property>
<property name="minimum" >
<property name="minimum">
<double>-9999.000000000000000</double>
</property>
<property name="maximum" >
<property name="maximum">
<double>9999.000000000000000</double>
</property>
<property name="singleStep" >
<property name="singleStep">
<double>0.500000000000000</double>
</property>
</widget>
......@@ -201,22 +202,22 @@
</layout>
</item>
<item>
<widget class="QCheckBox" name="centerBox" >
<property name="text" >
<widget class="QCheckBox" name="centerBox">
<property name="text">
<string>Center</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="absBox" >
<property name="text" >
<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" >
<widget class="QCheckBox" name="scaleBox">
<property name="text">
<string>Scale</string>
</property>
</widget>
......@@ -225,55 +226,55 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="imageBox" >
<property name="minimumSize" >
<widget class="QGroupBox" name="imageBox">
<property name="minimumSize">
<size>
<width>280</width>
<height>280</height>
</size>
</property>
<property name="title" >
<property name="title">
<string>Image</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4" >
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLabel" name="imageLabel" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
<widget class="QLabel" name="imageLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="maximumSize" >
<property name="maximumSize">
<size>
<width>250</width>
<height>250</height>
</size>
</property>
<property name="text" >
<property name="text">
<string>Image</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="fileLabel" >
<property name="text" >
<widget class="QLabel" name="fileLabel">
<property name="text">
<string>File:</string>
</property>
<property name="wordWrap" >
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="changeImageButton" >
<property name="text" >
<widget class="QPushButton" name="changeImageButton">
<property name="text">
<string>Change Image</string>
</property>
</widget>
......@@ -284,14 +285,14 @@
</layout>
</item>
<item>
<widget class="QGroupBox" name="originalData" >
<property name="minimumSize" >
<widget class="QGroupBox" name="originalData">
<property name="minimumSize">
<size>
<width>400</width>
<height>0</height>
</size>
</property>
<property name="title" >
<property name="title">
<string> Visualization of current values </string>
</property>
</widget>
......@@ -301,8 +302,8 @@
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="standardButtons" >
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
......
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