Developer Documentation
Loading...
Searching...
No Matches
GlobalOptions.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//
45// Options used throughout the System
46//
47//=============================================================================
48
55#pragma once
56
58#include <ACG/Scenegraph/DrawModes.hh>
59#include <QDir>
60#include <QStringList>
61#include <QColor>
62#include <QIcon>
63#include "OpenFlipperQSettings.hh"
64
65//===========================================================================
68//===========================================================================
69
156#define STRINGIFY(x) #x
157#define TOSTRING(x) STRINGIFY(x)
158
161
164namespace OpenFlipper {
165namespace Options {
166
169QDir applicationDir();
170
173QDir pluginDir();
174
177QDir textureDir();
178
181QDir licenseDir();
182
185QDir scriptDir();
186
189QDir shaderDir();
190
193QDir iconDir();
194
197QDir translationsDir();
198
201QDir fontsDir();
202
205QDir dataDir();
206
209QString applicationDirStr();
210
213QString pluginDirStr();
214
217QString shaderDirStr();
218
221QString textureDirStr();
222
225QString licenseDirStr();
226
229QString scriptDirStr();
230
233QString iconDirStr();
234
237QString dataDirStr();
238
241QIcon& OpenFlipperIcon();
242
245QString translationsDirStr();
246
249QString fontsDirStr();
250
253QString helpDirStr();
254
255//===========================================================================
258//===========================================================================
259
262 QString getGlobalIniFullPath();
263
266 QString getLocalIniFullPath();
267
272 QStringList optionFiles();
273
276 void configDir(QDir _dir);
277
280 bool configDir(QString _dir);
281
284 QString configDirStr();
285
288 QDir configDir();
289
292 bool deleteIniFile();
293
296 void deleteIniFile(bool _delete);
297
300//===========================================================================
303//===========================================================================
304
307 bool startup();
308
311 void finishedStartup();
312
315 QString currentScriptDirStr();
316
319 QDir currentScriptDir();
320
323 void currentScriptDir(QDir _dir);
324
327 bool currentScriptDir(QString _dir);
328
329
330
333 QString currentTextureDirStr();
334
337 QDir currentTextureDir();
338
341 void currentTextureDir(QDir _dir);
342
345 bool currentTextureDir(QString _dir);
346
347
348
351 QString lastDataType();
352
355 void lastDataType(QString _type);
356
359//===========================================================================
362//===========================================================================
363
365 bool is64bit();
366
368 bool is32bit();
369
371 bool isLinux();
372
374 bool isWindows();
375
377 bool isDarwin();
378
381 QString dirSeparator();
382
385//===========================================================================
388//===========================================================================
389
392 QString lang();
393
396//===========================================================================
399//===========================================================================
400
403 void nogui( bool _nogui );
404
407 bool nogui( );
408
411 bool gui( );
412
415 void coreProfile(bool _enableCoreProfile, bool _temporary = false);
416
419 bool coreProfile( );
420
423 QPair<int,int> glVersion();
424
427 void glVersion(const QPair<int, int>& _version, bool _teporary = false);
428
431 void samples(int _samples, bool _temporary = false);
432
435 int samples();
436
439 void stereo( bool _stereo );
440
443 bool stereo( );
444
447 OpenGL,
448 AnaglyphRedCyan,
449 AnaglyphCustom
450 };
451
454 void glStereo( bool _stereo, bool _temporary = false );
455
458 bool glStereo( );
459
462 bool glStereoRequested( );
463
466 void stereoMode( StereoMode _mode );
467
470 StereoMode stereoMode( );
471
474 void anaglyphLeftEyeColorMatrix( std::vector<float> _mat );
475
478 std::vector<float> anaglyphLeftEyeColorMatrix( );
479
482 void anaglyphRightEyeColorMatrix( std::vector<float> _mat );
483
486 std::vector<float> anaglyphRightEyeColorMatrix( );
487
490 void synchronization( bool _synchronization );
491
494 bool synchronization( );
495
498 void defaultDrawMode( ACG::SceneGraph::DrawModes::DrawMode _mode, int _viewer );
499
502 ACG::SceneGraph::DrawModes::DrawMode defaultDrawMode( int _viewer );
503
510 void defaultPerspectiveProjectionMode( bool _mode, int _viewer );
511
514 bool defaultPerspectiveProjectionMode( int _viewer );
515
518 void defaultViewingDirection( int _mode, int _viewer );
519
522 int defaultViewingDirection( int _viewer );
523
526 void defaultLockRotation( bool _mode, int _viewer );
527
530 bool defaultLockRotation( int _viewer );
531
534 void defaultViewerLayout( int _layout );
535
538 int defaultViewerLayout();
539
542 void redrawDisabled( bool disable );
543
546 bool redrawDisabled( );
547
550 bool drawModesInContextMenu();
551
554 void drawModesInContextMenu(bool _show);
555
558//===========================================================================
561//===========================================================================
562
565 unsigned int examinerWidgets();
566
569 InScene,
570 Normal,
571 Hidden
572 };
573
576 void loggerState( LoggerState _state);
577
580 LoggerState loggerState( );
581
584 QString currentViewMode( );
585
588 void currentViewMode( QString _mode );
589
592 QString windowTitle( );
593
596 void windowTitle( QString _titel );
597
600 void defaultColor( QColor _color );
601
604 QColor defaultColor();
605
608 void randomDefaultColor(bool _random);
609
612 bool randomDefaultColor();
613
616//===========================================================================
619//===========================================================================
620
628 bool scripting( );
629
633 void scripting(bool _status );
634
637//===========================================================================
640//===========================================================================
641
644 bool logToConsole( );
645
648 void logToConsole(bool _logToConsole );
649
652 bool debug();
653
656 void debug(bool _debug );
657
660//===========================================================================
663//===========================================================================
664
667 bool backupEnabled( );
668
671 void enableBackup(bool _enableBackup );
672
673
676 //===========================================================================
682 //===========================================================================
683
686 void blockSceneGraphUpdates( );
687
690 void unblockSceneGraphUpdates();
691
694 bool sceneGraphUpdatesBlocked( );
695
698//===========================================================================
701//===========================================================================
702
705 bool savingSettings( );
706
709 void savingSettings(bool _savingSettings );
710
713 bool loadingRecentFile( );
714
717 void loadingRecentFile(bool _loadingRecentFile );
718
721//===========================================================================
724//===========================================================================
725
728int* argc();
729
732char *** argv();
733
736void argc( int* _argc );
737
740void argv( char*** _argv);
741
744bool remoteControl();
745
748void remoteControl( bool _remote );
749
752int remoteControlPort();
753
756void remoteControlPort(int _remotePort);
757
758//===========================================================================
761//===========================================================================
762
769void doSlotDebugging( bool _debugging );
770
772bool doSlotDebugging( );
773
776//===========================================================================
779//===========================================================================
780
783QString coreVersion();
784
787QString compilerInfo();
788
794bool initializeSettings();
795
798void closeSettings();
799
800}
801}
802
#define DLLEXPORT
DLLEXPORT OpenFlipperQSettings & OpenFlipperSettings()
QSettings object containing all program settings of OpenFlipper.
LoggerState
State of the logging widget.