Commit 6212292e authored by Dirk Wilden's avatar Dirk Wilden

qwt only if available

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@4857 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 7286f2ec
......@@ -84,17 +84,21 @@ class TextureControlPlugin : public QObject, BaseInterface, TextureInterface, Me
enum TextureType { VERTEXBASED = 1 << 0, HALFEDGEBASED = 1 << 1};
signals:
// BaseInterface
void updateView();
// TextureInterface
void updateTexture( QString , int);
// LoggingInterface
void log(Logtype _type, QString _message);
void log(QString _message);
// MenuInterface
void addMenu(QMenu* _menu, MenuType _type);
private slots:
// BaseInterface
void pluginsInitialized();
void slotObjectUpdated(int _identifier);
// TextureInterface
void slotUpdateAllTextures( );
void slotTextureAdded( QString _textureName , QString _filename , uint _dimension );
void slotTextureUpdated( QString _textureName , int _identifier );
......@@ -102,17 +106,22 @@ class TextureControlPlugin : public QObject, BaseInterface, TextureInterface, Me
void slotSwitchTexture( QString _textureName );
private slots:
void slotSetTextureProperties();
/// Called when an action in the TextureMenu is triggered
void slotTextureMenu(QAction* _action);
/// Slot for showing the TextureProperties Dialog
void slotSetTextureProperties();
/// Called when Ok was clicked in the dialog
void slotTexturePropertiesOk();
/// Called when Cancel was clicked in the dialog
void slotTexturePropertiesCancel();
/// Called when Apply was clicked in the dialog
void slotTexturePropertiesApply();
void pluginsInitialized();
public :
/// Constructor
TextureControlPlugin() {};
/// Destructor
~TextureControlPlugin() {delete(settingsDialog_);};
QString name() { return (QString("TextureControl")); };
......
......@@ -34,9 +34,12 @@
#include "textureProperties.hh"
#include <qwt_plot_grid.h>
#include <qwt_text.h>
#include <qwt_plot.h>
#ifdef QWT
#include <qwt_plot_grid.h>
#include <qwt_text.h>
#include <qwt_plot.h>
#endif
#include <float.h>
#include <QtGui>
......@@ -46,57 +49,54 @@ texturePropertiesWidget::texturePropertiesWidget(QWidget *parent)
{
setupUi(this);
QGridLayout* layout = new QGridLayout( originalData);
originalDataHistogram_ = new QwtPlot(0);
layout->addWidget( originalDataHistogram_ , 0,0 );
QwtText axis_title_x("value");
// axis_title_x.setFont(arial);
QwtText axis_title_y("count");
// axis_title_y.setFont(arial);
originalDataHistogram_->setAxisTitle(QwtPlot::xBottom, axis_title_x);
originalDataHistogram_->setAxisTitle(QwtPlot::yLeft, axis_title_y);
originalDataHistogram_->setCanvasBackground(Qt::white);
QwtPlotGrid *grid2 = new QwtPlotGrid;
grid2->enableYMin(true);
grid2->enableXMin(true);
grid2->setMajPen(QPen(Qt::black, 0, Qt::DotLine));
grid2->setMinPen(QPen(Qt::gray, 0 , Qt::DotLine));
grid2->attach(originalDataHistogram_);
QwtText curve_title("Delay Spread Histogram");
// curve_title.setFont(arial);
histogramCurve_.setTitle(curve_title);
histogramCurve_.attach(originalDataHistogram_);
// connect(distanceCheckBox,SIGNAL(stateChanged ( int ) ) , this , SLOT (slotDistanceCheckbox(int)) );
// connect(normalCheckBox,SIGNAL(stateChanged ( int ) ) , this , SLOT (slotNormalCheckbox(int)) );
#ifdef QWT
QGridLayout* layout = new QGridLayout( originalData);
originalDataHistogram_ = new QwtPlot(0);
layout->addWidget( originalDataHistogram_ , 0,0 );
QwtText axis_title_x("value");
// axis_title_x.setFont(arial);
QwtText axis_title_y("count");
// axis_title_y.setFont(arial);
originalDataHistogram_->setAxisTitle(QwtPlot::xBottom, axis_title_x);
originalDataHistogram_->setAxisTitle(QwtPlot::yLeft, axis_title_y);
originalDataHistogram_->setCanvasBackground(Qt::white);
QwtPlotGrid *grid2 = new QwtPlotGrid;
grid2->enableYMin(true);
grid2->enableXMin(true);
grid2->setMajPen(QPen(Qt::black, 0, Qt::DotLine));
grid2->setMinPen(QPen(Qt::gray, 0 , Qt::DotLine));
grid2->attach(originalDataHistogram_);
QwtText curve_title("Delay Spread Histogram");
// curve_title.setFont(arial);
histogramCurve_.setTitle(curve_title);
histogramCurve_.attach(originalDataHistogram_);
// connect(distanceCheckBox,SIGNAL(stateChanged ( int ) ) , this , SLOT (slotDistanceCheckbox(int)) );
// connect(normalCheckBox,SIGNAL(stateChanged ( int ) ) , this , SLOT (slotNormalCheckbox(int)) );
#endif
}
void texturePropertiesWidget::setOriginalData(std::vector< double > _x, std::vector< double > _y ) {
double minx = FLT_MIN;
double maxx = FLT_MIN;
double miny = FLT_MAX;
double maxy = FLT_MIN;
for ( uint i = 0 ; i < _x.size(); ++ i ) {
minx = std::min(minx,_x[0]);
maxx = std::max(maxx,_x[0]);
miny = std::min(miny,_y[0]);
maxy = std::max(maxy,_y[0]);
}
histogramCurve_.setData(&_x[0], &_y[0], _x.size());
originalDataHistogram_->replot();
#ifdef QWT
double minx = FLT_MIN;
double maxx = FLT_MIN;
double miny = FLT_MAX;
double maxy = FLT_MIN;
for ( uint i = 0 ; i < _x.size(); ++ i ) {
minx = std::min(minx,_x[0]);
maxx = std::max(maxx,_x[0]);
miny = std::min(miny,_y[0]);
maxy = std::max(maxy,_y[0]);
}
histogramCurve_.setData(&_x[0], &_y[0], _x.size());
originalDataHistogram_->replot();
#endif
}
......@@ -34,7 +34,10 @@
#include "ui_textureProperties.hh"
#include <QtGui>
#include <qwt_plot_curve.h>
#ifdef QWT
#include <qwt_plot_curve.h>
#endif
class texturePropertiesWidget : public QDialog, public Ui::Dialog
{
......@@ -46,8 +49,10 @@ class texturePropertiesWidget : public QDialog, public Ui::Dialog
void setOriginalData(std::vector< double > _x, std::vector< double > _y );
private:
#ifdef QWT
QwtPlot* originalDataHistogram_;
QwtPlotCurve histogramCurve_;
#endif
};
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