OGS
VisPrefsDialog Class Reference

Detailed Description

A dialog window for settung up a visualisation preferences.

Definition at line 17 of file VisPrefsDialog.h.

#include <VisPrefsDialog.h>

Inheritance diagram for VisPrefsDialog:
[legend]
Collaboration diagram for VisPrefsDialog:
[legend]

Public Member Functions

 VisPrefsDialog (VtkVisPipeline &pipeline, VisualizationWidget &widget, QDialog *parent=nullptr)
 Constructor.

Protected Slots

void on_bgColorButton_colorPicked (QColor color)
 Sets the background colour.
void on_lightAboveBox_clicked ()
 Adds a light above the scene.
void on_lightBelowBox_clicked ()
 Adds a light below the scene.
void on_superelevationPushButton_pressed ()
 Sets the given superelevation on all vis pipeline source objects.
void on_loadShowAllCheckBox_stateChanged (int state)
void on_cullBackfacesCheckBox_stateChanged (int state)
 Culls backfacing rendering primitives on all actors.

Private Attributes

VtkVisPipeline_vtkVisPipeline
VisualizationWidget_visWidget
GeoLib::Point _above
GeoLib::Point _below

Constructor & Destructor Documentation

◆ VisPrefsDialog()

VisPrefsDialog::VisPrefsDialog ( VtkVisPipeline & pipeline,
VisualizationWidget & widget,
QDialog * parent = nullptr )

Constructor.

Definition at line 15 of file VisPrefsDialog.cpp.

18 : QDialog(parent),
19 _vtkVisPipeline(pipeline),
20 _visWidget(widget),
21 _above(0, 0, 2000000),
22 _below(0, 0, -2000000)
23{
24 setupUi(this);
25 if (_vtkVisPipeline.getLight(_above))
26 {
27 lightAboveBox->toggle();
28 }
29 if (_vtkVisPipeline.getLight(_below))
30 {
31 lightBelowBox->toggle();
32 }
33
34 bgColorButton->setColor(_vtkVisPipeline.getBGColor());
35
36 QValidator* validator = new QDoubleValidator(0, 100000, 2, this);
37 superelevationLineEdit->setValidator(validator);
38 QSettings settings;
39 superelevationLineEdit->setText(
40 settings.value("globalSuperelevation", 1.0).toString());
41 cullBackfacesCheckBox->setCheckState(
42 Qt::CheckState(settings.value("globalCullBackfaces", 0).toInt()));
43 loadShowAllCheckBox->setCheckState(
44 Qt::CheckState(settings.value("resetViewOnLoad", 2).toInt()));
45}
VtkVisPipeline & _vtkVisPipeline
GeoLib::Point _above
GeoLib::Point _below
VisualizationWidget & _visWidget

References _above, _below, _visWidget, and _vtkVisPipeline.

Member Function Documentation

◆ on_bgColorButton_colorPicked

void VisPrefsDialog::on_bgColorButton_colorPicked ( QColor color)
protectedslot

Sets the background colour.

Definition at line 47 of file VisPrefsDialog.cpp.

48{
49 QColor bgColor(color.red(), color.green(), color.blue());
50 _vtkVisPipeline.setBGColor(bgColor);
51}

References _vtkVisPipeline.

◆ on_cullBackfacesCheckBox_stateChanged

void VisPrefsDialog::on_cullBackfacesCheckBox_stateChanged ( int state)
protectedslot

Culls backfacing rendering primitives on all actors.

Definition at line 95 of file VisPrefsDialog.cpp.

96{
97 _vtkVisPipeline.setGlobalBackfaceCulling(static_cast<bool>(state));
98
99 QSettings settings;
100 settings.setValue("globalCullBackfaces", state);
101}

References _vtkVisPipeline.

◆ on_lightAboveBox_clicked

void VisPrefsDialog::on_lightAboveBox_clicked ( )
protectedslot

Adds a light above the scene.

Definition at line 53 of file VisPrefsDialog.cpp.

54{
55 if (lightAboveBox->isChecked())
56 {
57 _vtkVisPipeline.addLight(_above);
58 }
59 else
60 {
61 _vtkVisPipeline.removeLight(_above);
62 }
63}

References _above, and _vtkVisPipeline.

◆ on_lightBelowBox_clicked

void VisPrefsDialog::on_lightBelowBox_clicked ( )
protectedslot

Adds a light below the scene.

Definition at line 65 of file VisPrefsDialog.cpp.

66{
67 if (lightBelowBox->isChecked())
68 {
69 _vtkVisPipeline.addLight(_below);
70 }
71 else
72 {
73 _vtkVisPipeline.removeLight(_below);
74 }
75}

References _below, and _vtkVisPipeline.

◆ on_loadShowAllCheckBox_stateChanged

void VisPrefsDialog::on_loadShowAllCheckBox_stateChanged ( int state)
protectedslot

Definition at line 86 of file VisPrefsDialog.cpp.

87{
88 _visWidget.setShowAllOnLoad(static_cast<bool>(state));
89 _vtkVisPipeline.resetCameraOnAddOrRemove(static_cast<bool>(state));
90
91 QSettings settings;
92 settings.setValue("resetViewOnLoad", state);
93}

References _visWidget, and _vtkVisPipeline.

◆ on_superelevationPushButton_pressed

void VisPrefsDialog::on_superelevationPushButton_pressed ( )
protectedslot

Sets the given superelevation on all vis pipeline source objects.

Definition at line 77 of file VisPrefsDialog.cpp.

78{
79 double factor = superelevationLineEdit->text().toDouble();
80 _vtkVisPipeline.setGlobalSuperelevation(factor);
81
82 QSettings settings;
83 settings.setValue("globalSuperelevation", factor);
84}

References _vtkVisPipeline.

Member Data Documentation

◆ _above

GeoLib::Point VisPrefsDialog::_above
private

Definition at line 48 of file VisPrefsDialog.h.

Referenced by VisPrefsDialog(), and on_lightAboveBox_clicked().

◆ _below

GeoLib::Point VisPrefsDialog::_below
private

Definition at line 49 of file VisPrefsDialog.h.

Referenced by VisPrefsDialog(), and on_lightBelowBox_clicked().

◆ _visWidget

VisualizationWidget& VisPrefsDialog::_visWidget
private

Definition at line 47 of file VisPrefsDialog.h.

Referenced by VisPrefsDialog(), and on_loadShowAllCheckBox_stateChanged().

◆ _vtkVisPipeline


The documentation for this class was generated from the following files: