17 #ifndef MappingFrame_H
18 #define MappingFrame_H
22 #include <OpenGL/gl.h>
23 #include <OpenGL/glu.h>
31 #include <QContextMenuEvent>
32 #include <QPaintEvent>
33 #include <QMouseEvent>
64 using namespace VAPoR;
80 Q_PROPERTY(
bool colorMapping READ colorMapping WRITE setColorMapping)
81 Q_PROPERTY(
bool opacityMapping READ opacityMapping WRITE setOpacityMapping)
120 void hookup(
EventRouter* evrouter, QPushButton* editButton, QPushButton* ZoomPan, QPushButton* fitToView, QPushButton* histoButton,
121 QPushButton* fitData, QPushButton* bindColorToOpac, QPushButton* bindOpacToColor, QSlider* opacityScaleSlider);
126 void setColorMapping(
bool flag);
131 void setOpacityMapping(
bool flag);
146 void setIsolineSliders(
const vector<double>& slidervals);
156 void setMapperFunction(MapperFunction *mapper);
162 void setVariableName(std::string name);
190 void startChange(QString description);
200 void mappingChanged();
202 #ifndef DOXYGEN_SKIP_THIS
208 bool colorMapping()
const {
return _colorMappingEnabled; }
209 bool opacityMapping()
const {
return _opacityMappingEnabled; }
210 bool isoSliderEnabled()
const {
return _isoSliderEnabled; }
211 bool isolineSlidersEnabled()
const {
return _isolineSlidersEnabled; }
212 void setIsoValue(
float val){_isoVal = val;}
213 QString tipText(
const QPoint &pos,
bool isIso=
false);
214 int histoValue(
const QPoint &pos);
215 float xVariable(
const QPoint &pos);
216 float yVariable(
const QPoint &pos);
220 void setEditMode(
bool);
221 void setNavigateMode(
bool mode);
222 void setHistogramScale(QAction*);
223 void setCompositionType(QAction*);
224 void setWidgetEnabled(QAction*);
226 void newHsv(
int h,
int s,
int v);
227 void bindColorToOpacity();
228 void bindOpacityToColor();
236 void sendRgb(QRgb color);
242 void canBindControlPoints(
bool);
247 void initConnections();
249 OpacityWidget* createOpacityWidget(OpacityMapBase *map);
250 void deleteOpacityWidgets();
254 void resizeGL(
int w,
int h );
256 void paintEvent(QPaintEvent* event);
258 void drawOpacityCurve();
259 void drawOpacityWidgets();
260 void drawDomainSlider();
261 void drawIsoSlider();
262 void drawIsolineSliders();
265 void updateTexture();
267 void updateAxisLabels();
268 void addAxisLabel(
int x,
int y,
const QString &text);
270 void select(
int x,
int y, Qt::KeyboardModifiers);
271 void select(
int hits, GLuint *selectionBuffer, Qt::KeyboardModifiers);
273 void deselectWidgets();
275 int totalFixedHeight();
278 virtual void mousePressEvent(QMouseEvent *event);
279 virtual void mouseMoveEvent(QMouseEvent *event);
280 virtual void mouseReleaseEvent(QMouseEvent *event);
281 virtual void mouseDoubleClickEvent(QMouseEvent *event);
282 virtual void contextMenuEvent(QContextMenuEvent *e);
284 float xDataToWorld(
float x);
285 float xWorldToData(
float x);
286 float xViewToWorld(
float x);
287 float xWorldToView(
float x);
289 float yDataToWorld(
float y);
290 float yWorldToData(
float y);
291 float yViewToWorld(
float y);
292 float yWorldToView(
float y);
294 virtual float getMinEditBound();
295 virtual float getMaxEditBound();
296 virtual void setMinEditBound(
float v);
297 virtual void setMaxEditBound(
float v);
299 virtual float getMinDomainBound();
300 virtual float getMaxDomainBound();
302 virtual float getOpacity(
float val);
304 virtual Histo* getHistogram();
310 void addOpacityWidget(QAction*);
311 void deleteOpacityWidget();
313 void addColorControlPoint();
315 void addOpacityControlPoint();
316 void editControlPoint();
317 void deleteControlPoint();
321 void setIsolineSlider(
int sliderIndex);
327 MapperFunction *_mapper;
330 bool _opacityMappingEnabled;
331 bool _colorMappingEnabled;
332 bool _isoSliderEnabled;
333 bool _isolineSlidersEnabled;
334 vector<IsoSlider*> _isolineSliders;
335 int _lastSelectedIndex;
336 QPushButton* navigateButton;
337 QPushButton* _editButton;
341 std::string _variableName;
343 std::map<int, OpacityWidget*> _opacityWidgets;
344 DomainWidget *_domainSlider;
345 IsoSlider *_isoSlider;
346 ColorbarWidget *_colorbarWidget;
347 GLWidget *_lastSelected;
348 std::set<GLWidget*> _selectedWidgets;
351 unsigned char *_texture;
356 QPoint _contextPoint;
358 QMenu *_addOpacityWidgetSubMenu;
359 QMenu *_histogramScalingSubMenu;
360 QMenu *_compTypeSubMenu;
361 QMenu *_widgetEnabledSubMenu;
362 QAction *_editOpacityWidgetAction;
363 QAction *_deleteOpacityWidgetAction;
364 QAction *_addColorControlPointAction;
365 QAction *_addOpacityControlPointAction;
366 QAction *_editControlPointAction;
367 QAction *_deleteControlPointAction;
375 float _minValueStart;
376 float _maxValueStart;
379 Qt::MouseButtons _button;
389 const int _colorbarHeight;
390 const int _domainBarHeight;
391 const int _domainLabelHeight;
392 const int _domainHeight;
393 int _axisRegionHeight;
394 const int _opacityGap;
395 const int _bottomGap;
397 QStringList _axisTexts;
398 QList<QPoint*> _axisTextPos;
399 #endif //DOXYGEN_SKIP_THIS
403 #endif // MappingFrame_H
A Params subclass for managing parameters used by Renderers.
MapperFunction * mapperFunction()
A pure virtual class specifying the common properties of all the parameter tabs in the VAPOR GUI...
A QGLWidget that displays a Transfer Function Editor, or an Iso Selection Window. ...
void setIsoSlider(bool flag)
void setIsolineSliders(bool flag)
void update()
Update the display of the MappingFrame. Invoked in EventRouter::setEditorDirty()