cvrViewer2DGtk.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #ifndef _CVR_VIEWER_2D_GTK_H_
00055 #define _CVR_VIEWER_2D_GTK_H_
00056
00057 #include "cvrViewer2D.h"
00058 #include "cvrViewerBaseGtk.h"
00059 #include "cvrViewer2DPainter.h"
00060 #include "cvrTimer.h"
00061
00062 #ifdef HAVE_GTK
00063
00064 #include <gtk/gtk.h>
00065
00066 namespace cvr {
00067
00068
00069
00070
00071 class gtkCurveSelection {
00072 public:
00073
00074
00075
00076 gtkCurveSelection();
00077
00078
00079
00080
00081 virtual ~gtkCurveSelection();
00082
00083
00084
00085
00086 void show();
00087
00088
00089
00090
00091 void hide();
00092
00093
00094
00095
00096 void destroy();
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106 void use(vector<ubyte>& data);
00107
00108 protected:
00109
00110
00111
00112
00113 void build();
00114
00115 GtkWidget *curveSelector_;
00116 GtkWidget *dialogVBox_;
00117 GtkWidget *gammaCurve_;
00118 GtkWidget *dialogActionArea_;
00119 GtkWidget *cancelButton_;
00120 GtkWidget *okButton_;
00121
00122 vector<ubyte>* holder_;
00123
00124
00125
00126
00127
00128
00129 static gint cbCloseWindow(GtkWidget *widget,
00130 GdkEvent *event,
00131 gpointer data);
00132
00133
00134
00135
00136 static void cbOnCancelButtonClicked(GtkButton* button,
00137 gpointer data);
00138
00139
00140
00141
00142 static void cbOnOkButtonClicked(GtkButton* button,
00143 gpointer data);
00144
00145
00146
00147
00148 void transferFromCurve(GtkCurve* curve);
00149
00150
00151
00152
00153 void transferFromVector(GtkCurve* curve);
00154 };
00155
00156
00157
00158
00159
00160
00161 class viewer2D::configDialog::tk : public viewerBase::configDialog::tk {
00162 public:
00163
00164
00165
00166
00167
00168
00169 tk(viewer2D::configDialog& parent);
00170
00171
00172
00173
00174 virtual ~tk();
00175
00176
00177
00178
00179 virtual bool build();
00180
00181
00182
00183
00184 virtual bool show();
00185
00186
00187
00188
00189 virtual bool hide();
00190
00191
00192
00193
00194 virtual bool destroy();
00195
00196
00197
00198
00199 tk& copy(const tk& other);
00200
00201
00202
00203
00204 virtual bool updateParameters();
00205
00206
00207
00208
00209 virtual bool updateInformation(const viewer2D::information& info);
00210
00211
00212
00213
00214
00215 parameters& getParameters();
00216
00217 protected:
00218
00219
00220
00221 timer updateTime;
00222
00223
00224
00225
00226
00227 GtkWidget *vboxTop_;
00228 GtkWidget *displayCtrlFrame_;
00229 GtkWidget *displayCtrlAlignment_;
00230 GtkWidget *disCtrlVBox_;
00231 GtkWidget *zoomHBox_;
00232 GtkWidget *zoomLabel_;
00233 GtkWidget *zoomEntry_;
00234 GtkWidget *zoomHScale_;
00235 GtkAdjustment* zoomHAdjustment_;
00236 GtkWidget *linearButton_;
00237 GSList *linearButton__group;
00238 GtkWidget *offsetSlopeHBox_;
00239 GtkWidget *offsetButton_;
00240 GtkWidget *offsetEntry_;
00241 GtkWidget *offsetHScale_;
00242 GtkAdjustment* offsetHAdjustment_;
00243 GtkWidget *slopeLabel_;
00244 GtkWidget *slopeEntry_;
00245 GtkWidget *slopeHScale_;
00246 GtkAdjustment* slopeHAdjustment_;
00247 GtkWidget *mappingsTable_;
00248 GtkWidget *minButton_;
00249 GtkWidget *maxButton_;
00250 GtkWidget *optLinButton_;
00251 GtkWidget *histEqButton_;
00252 GtkWidget *logButton_;
00253 GtkWidget *optLogButton_;
00254 GtkWidget *userCurveHBox_;
00255 GtkWidget *userDefButton_;
00256 GtkWidget *editCurveButton_;
00257 GtkWidget *hexColorVBox_;
00258 GtkWidget *hexButton_;
00259 GtkWidget *underflowColorButton_;
00260 GtkWidget *overflowColorButton_;
00261 GtkWidget *displayLabel_;
00262 GtkWidget *paletteCtrlFrame_;
00263 GtkWidget *paletteCtrlAlignment_;
00264 GtkWidget *paletteCtrlVBox_;
00265 GtkWidget *paletteColorHBox_;
00266 GtkWidget *grayPaletteButton_;
00267 GSList *grayPaletteButton__group;
00268 GtkWidget *redPaletteButton_;
00269 GtkWidget *greenPaletteButton_;
00270 GtkWidget *bluePaletteButton_;
00271 GtkWidget *huePaletteButton_;
00272 GtkWidget *userPaletteButton_;
00273 GtkWidget *labelAdjacencyAnalysisButton_;
00274 GtkWidget *labelAdjacencyRadioBox_;
00275 GtkWidget *fourNeighborhoodButton_;
00276 GSList *fourNeighborhoodButton__group;
00277 GtkWidget *eightNeighborhoodButton_;
00278 GtkWidget *minColorsButton_;
00279 GtkWidget *paletteCtrlLabel_;
00280 GtkWidget *informationFrame_;
00281 GtkWidget *infoHBox_;
00282 GtkWidget *generalStatsTable_;
00283 GtkWidget *generalStatsRightTable_;
00284 GtkWidget *imgSizeLabel_;
00285 GtkWidget *minValLabel_;
00286 GtkWidget *maxValLabel_;
00287 GtkWidget *avrgValLabel_;
00288 GtkWidget *stdDevLabel_;
00289 GtkWidget *imgSizeEntry_;
00290 GtkWidget *minValEntry_;
00291 GtkWidget *maxValEntry_;
00292 GtkWidget *avrgValEntry_;
00293 GtkWidget *stdDevEntry_;
00294 GtkWidget *covLabel_;
00295 GtkWidget *covarTable_;
00296 GtkWidget *rgEntry_;
00297 GtkWidget *rbEntry_;
00298 GtkWidget *ggEntry_;
00299 GtkWidget *bgEntry_;
00300 GtkWidget *grEntry_;
00301 GtkWidget *brEntry_;
00302 GtkWidget *gbEntry_;
00303 GtkWidget *bbEntry_;
00304 GtkWidget *rrEntry_;
00305 GtkWidget *infoLabel_;
00306 GtkWidget *ioFrame_;
00307 GtkWidget *saveImgAlignment_;
00308 GtkWidget *saveHBox_;
00309 GtkWidget *filenameEntry_;
00310 GtkWidget *browseButton_;
00311 GtkWidget *saveButton_;
00312 GtkWidget *saveImageLabel_;
00313 GtkTooltips *tooltips_;
00314
00315 gtkCurveSelection* curveSelector_;
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333 static void cbOnBrowseButtonClicked(GtkButton *button,
00334 gpointer userData);
00335
00336 static void cbOnSaveButtonClicked(GtkButton *button,
00337 gpointer userData);
00338
00339
00340
00341
00342 static void cbOnZoomEntryActivate(GtkCellEditable *celleditable,
00343 gpointer userData);
00344
00345
00346
00347
00348 static void cbOnZoomHAdjustmentValueChanged(GtkAdjustment* scale,
00349 gpointer userData);
00350
00351
00352
00353
00354 static void cbOnOffsetEntryActivate(GtkCellEditable *celleditable,
00355 gpointer userData);
00356
00357
00358
00359
00360 static void cbOnOffsetHAdjustmentValueChanged(GtkAdjustment* scale,
00361 gpointer userData);
00362
00363
00364
00365
00366 static void cbOnSlopeEntryActivate(GtkCellEditable *celleditable,
00367 gpointer userData);
00368
00369
00370
00371
00372 static void cbOnSlopeHAdjustmentValueChanged(GtkAdjustment* scale,
00373 gpointer userData);
00374
00375
00376
00377
00378 static void cbOnMappingRadioToggled(GtkToggleButton* toggleButton,
00379 gpointer userData);
00380
00381
00382
00383
00384 static void cbOnCurveButtonClicked(GtkButton *button,
00385 gpointer userData);
00386
00387
00388
00389
00390 static void cbOnHexButtonToggled(GtkToggleButton* toggleButton,
00391 gpointer userData);
00392
00393
00394
00395
00396 static void cbOnUnderflowColorButtonSet(GtkColorButton *colorbutton,
00397 gpointer userData);
00398
00399
00400
00401
00402 static void cbOnOverflowColorButtonSet(GtkColorButton *colorbutton,
00403 gpointer userData);
00404
00405
00406
00407
00408
00409 static void cbOnPaletteRadioToggled(GtkToggleButton* toggleButton,
00410 gpointer userData);
00411
00412
00413
00414
00415 static void cbOnLabelAdjacencyButtonToggled(GtkToggleButton* toggleButton,
00416 gpointer userData);
00417
00418
00419
00420
00421 static void cbOnNeighborhoodRadioToggled(GtkToggleButton* toggleButton,
00422 gpointer userData);
00423
00424
00425
00426
00427 static void cbOnMinColorsButtonToggled(GtkToggleButton* toggleButton,
00428 gpointer userData);
00429
00430
00431
00432
00433 static void cbOnFilenameEntryActivate(GtkCellEditable *celleditable,
00434 gpointer userData);
00435
00436
00437
00438
00439
00440
00441
00442
00443 static std::string toString(const double val,const int decimals=5);
00444 static std::string toString(const int val);
00445 static double fromString(const char* val);
00446 static std::string toString(const ipoint& val);
00447 static std::string toString(const rgbaPixel& val);
00448 static std::string toString(const frgbPixel& val,const int decimals=2);
00449
00450
00451
00452
00453
00454
00455 void setZoom(const float zoom);
00456
00457
00458
00459
00460 float getZoom() const;
00461
00462
00463
00464
00465 void setMapping(const viewer2DPainter::eMappingType mapping);
00466
00467
00468
00469
00470 viewer2DPainter::eMappingType getMapping();
00471
00472
00473
00474
00475
00476 void setPaletteType(const viewer2DPainter::ePaletteType pal);
00477
00478
00479
00480
00481 viewer2DPainter::ePaletteType getPaletteType();
00482
00483
00484
00485
00486 void setNeighborhood(const viewer2DPainter::eNeighborhoodType n);
00487
00488
00489
00490
00491 viewer2DPainter::eNeighborhoodType getNeighborhood();
00492
00493
00494
00495
00496
00497 void setAdjacency(const bool adjOn,
00498 const eDataType type);
00499
00500
00501
00502
00503 eDataType dataType_;
00504 };
00505
00506
00507 class viewer2D::mainWindow::tk : public viewerBase::mainWindow::tk {
00508 public:
00509
00510
00511
00512
00513
00514
00515 tk(viewer2D::mainWindow& parent);
00516
00517
00518
00519
00520 virtual ~tk();
00521
00522
00523
00524
00525 virtual ipoint suggestWindowSize() const;
00526
00527
00528
00529
00530
00531 virtual bool drawingAreaExposed(const irectangle& area);
00532
00533
00534
00535
00536 virtual bool saveButtonPressed(const std::string& filename);
00537 };
00538
00539
00540 }
00541
00542 #endif
00543 #endif