Developer Documentation

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ViewerProperties.hh
Go to the documentation of this file.
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4 * Copyright (c) 2001-2015, RWTH-Aachen University *
5 * Department of Computer Graphics and Multimedia *
6 * All rights reserved. *
7 * www.openflipper.org *
8 * *
9 *---------------------------------------------------------------------------*
10 * This file is part of OpenFlipper. *
11 *---------------------------------------------------------------------------*
12 * *
13 * Redistribution and use in source and binary forms, with or without *
14 * modification, are permitted provided that the following conditions *
15 * are met: *
16 * *
17 * 1. Redistributions of source code must retain the above copyright notice, *
18 * this list of conditions and the following disclaimer. *
19 * *
20 * 2. Redistributions in binary form must reproduce the above copyright *
21 * notice, this list of conditions and the following disclaimer in the *
22 * documentation and/or other materials provided with the distribution. *
23 * *
24 * 3. Neither the name of the copyright holder nor the names of its *
25 * contributors may be used to endorse or promote products derived from *
26 * this software without specific prior written permission. *
27 * *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 \*===========================================================================*/
41
42 /*===========================================================================*\
43 * *
44 * $Revision$ *
45 * $LastChangedBy$ *
46 * $Date$ *
47 * *
48 \*===========================================================================*/
49
50
51
52
53 //=============================================================================
54 //
55 // Property storage Class for glWidgets
56 //
57 //=============================================================================
58
64 //
65 #ifndef VIEWERPROPERTIES_HH
66 #define VIEWERPROPERTIES_HH
67
68
69 #include <QObject>
70 #include <QColor>
71 #include <OpenFlipper/common/GlobalDefines.hh>
72 #include <ACG/Math/VectorT.hh>
73 #include <ACG/Scenegraph/SceneGraph.hh>
74 #include <ACG/Scenegraph/DrawModes.hh>
75 #include <ACG/GL/GLState.hh>
76 #include <OpenFlipper/widgets/glWidget/CursorPainter.hh>
77
78 // forward declaration
79 class ViewObjectMarker;
80
81 namespace Viewer {
82
87 enum ActionMode {
93 ExamineMode,
94
103 PickingMode,
104
110 QuestionMode,
111
116 LightMode
117 };
118
119 class DLLEXPORT ViewerProperties : public QObject {
120
121 Q_OBJECT
122
123 public:
124 ViewerProperties(int _id);
125 ~ViewerProperties();
126
127 //===========================================================================
130 //===========================================================================
131
132 public:
134 void drawMode(ACG::SceneGraph::DrawModes::DrawMode _mode);
135
137 ACG::SceneGraph::DrawModes::DrawMode drawMode();
138
139 private:
140
141 ACG::SceneGraph::DrawModes::DrawMode currentDrawMode_;
142
145 //===========================================================================
148 //===========================================================================
149
150 public slots:
159 void snapshotBaseFileName(const QString& _fname);
160
162 void snapshotFileType(const QString& _type);
163
165 void snapshotCounter(const int _counter);
166
168 QString snapshotFileType();
169
171 QString snapshotName();
172
174 int snapshotCounter();
175
176 private:
177 QString snapshotName_;
178 QString snapshotFileType_;
179 int snapshotCounter_;
180
183 //===========================================================================
184 //===========================================================================
187 //===========================================================================
188 //===========================================================================
189
190
191 public slots:
193 double wheelZoomFactor();
194
196 double wheelZoomFactorShift();
197
199 void wheelZoomFactor(double _factor);
200
202 void wheelZoomFactorShift(double _factor);
203
205 bool wheelInvert();
206
208 void wheelInvert(bool _invert);
209
210 private:
211 double wZoomFactor_;
212
213 double wZoomFactorShift_;
214
215 bool wInvert_;
216
219 //===========================================================================
220 //===========================================================================
223 //===========================================================================
224 //===========================================================================
225
228 //===========================================================================
229 //===========================================================================
232 //===========================================================================
233 //===========================================================================
234
235 public slots:
238 bool isCCWFront();
239
241 void ccwFront();
243 void cwFront();
244
245 private:
246 bool CCWFront_;
247
248
249 //===========================================================================
250
251 public slots:
252
254 ACG::Vec4f backgroundColor();
255
257 QRgb backgroundColorRgb();
258
260 QColor backgroundQColor();
261
264 void backgroundColor( ACG::Vec4f _color );
265
268 void backgroundColor( QRgb _color );
269
272 void backgroundColor( QColor _color );
273
274 private:
275 ACG::Vec4f backgroundColor_;
276
277
278 //===========================================================================
279
280 public slots:
286 void lockUpdate();
287
289 void unLockUpdate();
290
293 bool updateLocked();
294
295 private:
296 int locked_;
297
298
299 //===========================================================================
300
301 public slots:
303 bool backFaceCulling();
304
306 void backFaceCulling(bool _state );
307
308 private:
309 bool backFaceCulling_;
310
311 //===========================================================================
312
313 public slots:
315 void twoSidedLighting(bool _state );
316
318 bool twoSidedLighting();
319
320 private:
321 bool twoSidedLighting_;
322
323 //===========================================================================
324
325 public slots:
327 void multisampling(bool _state );
328
330 bool multisampling();
331
332 private:
333 bool multisampling_;
334
335 //===========================================================================
336
337 public slots:
339 void mipmapping(bool _state );
340
342 bool mipmapping();
343
344 private:
345 bool mipmapping_;
346
347 //===========================================================================
348
349 public slots:
351 void animation(bool _state );
352
354 bool animation();
355
356 private:
357 bool animation_;
358
359
360 //===========================================================================
361
362 public:
364 ACG::GLState& glState();
365 const ACG::GLState& glState() const;
366
367 void setglState(ACG::GLState* _glState);
368
369 private:
371 ACG::GLState* glState_;
372
373 //===========================================================================
374
375 public slots:
377 void objectMarker (ViewObjectMarker* _marker);
378
380 ViewObjectMarker* objectMarker();
381
382 private:
383 ViewObjectMarker *objectMarker_;
384
385 //===========================================================================
386
387 public:
388 int currentViewingDirection();
389
390 void currentViewingDirection(int _dir);
391
392 private:
393 int currentViewingDirection_;
394
395 //===========================================================================
396
397 public:
398 bool rotationLocked();
399
400 void rotationLocked(bool _lock);
401
402 private:
403 bool rotationLocked_;
404
405 //===========================================================================
406
409 //===========================================================================
410 //===========================================================================
413 //===========================================================================
414 //===========================================================================
415
416 public:
417
419 double orthoWidth();
420
422 void orthoWidth(double _width);
423
424
426 double nearPlane();
427
429 void setPlanes( double _near, double _far );
430
432 double farPlane();
433
435 ACG::Vec3d sceneCenter();
436
438 void sceneCenter(ACG::Vec3d _center);
439
440
442 double sceneRadius();
443
445 void sceneRadius(double _radius );
446
447
449 ACG::Vec3d trackballCenter();
450
452 void trackballCenter(ACG::Vec3d _center);
453
454
456 double trackballRadius();
457
459 void trackballRadius(double _radius );
460
461 private:
462
464 double orthoWidth_;
465
467 double nearPlane_;
468
470 double farPlane_;
471
473 ACG::Vec3d sceneCenter_;
474
476 double sceneRadius_;
477
479 ACG::Vec3d trackballCenter_;
480
482 double trackballRadius_;
483
486 //===========================================================================
487 //===========================================================================
490 //===========================================================================
491 //===========================================================================
492
493 public:
494
495 void stereo(bool _stereo);
496 bool stereo();
497
498 private:
500 bool stereo_;
501
502
505 //===========================================================================
506 //===========================================================================
509 //===========================================================================
510 //===========================================================================
511
512 public:
513 CursorPainter* cursorPainter();
514 void cursorPainter( CursorPainter* _painter );
515
516 ACG::Vec3d cursorPoint3D();
517 void cursorPoint3D(ACG::Vec3d _pos);
518
519 bool cursorPositionValid();
520 void cursorPositionValid(bool _valid);
521
522 private:
523
524 // Used to draw the current cursor in the scene
525 CursorPainter *cursorPainter_;
526
527 // position of the cursor picked into the scenegraph
528 ACG::Vec3d cursorPoint3D_;
529
530 // indicates that we successfully mapped the cursor into the scene
531 bool cursorPositionValid_;
532
535 signals:
536
540 void updated();
541
545 void drawModeChanged(int _viewerId );
546
547 void getPickMode(std::string& _mode );
548 void setPickMode(const std::string& _mode );
549
550 void getActionMode(Viewer::ActionMode& _am);
551 void setActionMode(const Viewer::ActionMode _am);
552
553 public:
554
556 std::string pickMode();
557
559 void pickMode(const std::string& _name);
560
562 Viewer::ActionMode actionMode();
563
565 void actionMode(const Viewer::ActionMode _am);
566
567 //===========================================================================
568 //===========================================================================
571 //===========================================================================
572 //===========================================================================
573
575 int viewerId();
576
578 void viewerId(int _id);
579
580 private:
581
583 int viewerId_;
584
586 QString settingsSection_;
587
590 };
591
592 }
593
594
595 #endif //VIEWERPROPERTIES_HH
596
Viewer::ViewerProperties::backFaceCulling_
bool backFaceCulling_
Pointer to the glState of the Viewer.
Definition: ViewerProperties.hh:309
Viewer::ViewerProperties
Definition: ViewerProperties.hh:119
Viewer::ViewerProperties::glState_
ACG::GLState * glState_
Pointer to the glState of the Viewer.
Definition: ViewerProperties.hh:371
Viewer::ViewerProperties::mipmapping_
bool mipmapping_
Pointer to the glState of the Viewer.
Definition: ViewerProperties.hh:345
Viewer::ViewerProperties::trackballCenter_
ACG::Vec3d trackballCenter_
Virtual trackball center (rotation center when using mouse)
Definition: ViewerProperties.hh:479
Viewer::ViewerProperties::settingsSection_
QString settingsSection_
String for the Settings storage.
Definition: ViewerProperties.hh:586
Viewer::ViewerProperties::twoSidedLighting_
bool twoSidedLighting_
Pointer to the glState of the Viewer.
Definition: ViewerProperties.hh:321
Viewer::ViewerProperties::wZoomFactorShift_
double wZoomFactorShift_
Zoom factor when using mouse wheel.
Definition: ViewerProperties.hh:213
Viewer::ViewerProperties::stereo_
bool stereo_
Flag if stereo should be enabled for the current viewer.
Definition: ViewerProperties.hh:500
Viewer::ViewerProperties::cursorPainter_
CursorPainter * cursorPainter_
Flag if stereo should be enabled for the current viewer.
Definition: ViewerProperties.hh:525
GlobalDefines.hh
Viewer
Definition: ViewerProperties.cc:62
Viewer::ViewerProperties::locked_
int locked_
Pointer to the glState of the Viewer.
Definition: ViewerProperties.hh:296
Viewer::ViewerProperties::snapshotCounter_
int snapshotCounter_
Definition: ViewerProperties.hh:179
ACG::GLState
Definition: GLState.hh:220
Viewer::ViewerProperties::currentViewingDirection_
int currentViewingDirection_
Pointer to the glState of the Viewer.
Definition: ViewerProperties.hh:393
ViewObjectMarker
Definition: ViewObjectMarker.hh:91
Viewer::ViewerProperties::sceneRadius_
double sceneRadius_
Radius of the current scene.
Definition: ViewerProperties.hh:476
Viewer::ViewerProperties::wInvert_
bool wInvert_
Zoom factor when using mouse wheel.
Definition: ViewerProperties.hh:215
Viewer::ViewerProperties::orthoWidth_
double orthoWidth_
Width of the gl scene in orthogonal mode ( defaults to 2.0 )
Definition: ViewerProperties.hh:464
ACG::SceneGraph::DrawModes::DrawMode
Specifies a DrawMode.
Definition: DrawModes.hh:294
Viewer::ViewerProperties::backgroundColor_
ACG::Vec4f backgroundColor_
Pointer to the glState of the Viewer.
Definition: ViewerProperties.hh:275
Viewer::ViewerProperties::wZoomFactor_
double wZoomFactor_
Zoom factor when using mouse wheel.
Definition: ViewerProperties.hh:211
OpenMesh::VectorT
Definition: Vector11T.hh:83
Viewer::ViewerProperties::animation_
bool animation_
Pointer to the glState of the Viewer.
Definition: ViewerProperties.hh:357
Viewer::ViewerProperties::currentDrawMode_
ACG::SceneGraph::DrawModes::DrawMode currentDrawMode_
set draw mode (No test if this mode is available!)
Definition: ViewerProperties.hh:141
SceneGraph.hh
Viewer::ViewerProperties::snapshotFileType_
QString snapshotFileType_
Definition: ViewerProperties.hh:178
DLLEXPORT
#define DLLEXPORT
Definition: GlobalDefines.hh:107
Viewer::ViewerProperties::CCWFront_
bool CCWFront_
Pointer to the glState of the Viewer.
Definition: ViewerProperties.hh:246
CursorPainter
Definition: CursorPainter.hh:74
Viewer::ViewerProperties::farPlane_
double farPlane_
distance to far Plane
Definition: ViewerProperties.hh:470
Viewer::ViewerProperties::multisampling_
bool multisampling_
Pointer to the glState of the Viewer.
Definition: ViewerProperties.hh:333
Viewer::ViewerProperties::trackballRadius_
double trackballRadius_
trackball radius (rotation sphere when using mouse)
Definition: ViewerProperties.hh:482
Viewer::ViewerProperties::nearPlane_
double nearPlane_
Distance to near Plane.
Definition: ViewerProperties.hh:467
Viewer::ViewerProperties::rotationLocked_
bool rotationLocked_
Pointer to the glState of the Viewer.
Definition: ViewerProperties.hh:403
Viewer::ViewerProperties::objectMarker_
ViewObjectMarker * objectMarker_
Pointer to the glState of the Viewer.
Definition: ViewerProperties.hh:383
Viewer::ViewerProperties::cursorPositionValid_
bool cursorPositionValid_
Flag if stereo should be enabled for the current viewer.
Definition: ViewerProperties.hh:531
Viewer::ViewerProperties::cursorPoint3D_
ACG::Vec3d cursorPoint3D_
Flag if stereo should be enabled for the current viewer.
Definition: ViewerProperties.hh:528
Viewer::ViewerProperties::sceneCenter_
ACG::Vec3d sceneCenter_
Current scene center (rendering center)
Definition: ViewerProperties.hh:473
Viewer::ViewerProperties::viewerId_
int viewerId_
Stores the id of the viewer this property belongs to.
Definition: ViewerProperties.hh:583
Viewer::ViewerProperties::snapshotName_
QString snapshotName_
Definition: ViewerProperties.hh:177