Skip to content

Commit d338020

Browse files
committed
Added GUI control to switch between Render types
1 parent 1198953 commit d338020

File tree

6 files changed

+103
-4
lines changed

6 files changed

+103
-4
lines changed

src/Interface/Modules/Render/ES/SRInterface.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,12 @@ namespace SCIRun {
246246
mCore.setBackgroundColor(color.redF(), color.greenF(), color.blueF(), color.alphaF());
247247
}
248248

249+
//------------------------------------------------------------------------------
250+
void SRInterface::setTransparencyRendertype(RenderState::TransparencySortType rType)
251+
{
252+
mRenderSortType = rType;
253+
}
254+
249255
//------------------------------------------------------------------------------
250256
void SRInterface::inputMouseUp(const glm::ivec2& /*pos*/, MouseButton /*btn*/)
251257
{

src/Interface/Modules/Render/ES/SRInterface.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,12 @@ namespace SCIRun {
133133

134134
/// Toggle Orientation Axes
135135
void showOrientation(bool value);
136+
137+
/// Set the Background Color
138+
void setBackgroundColor(QColor color);
136139

137-
138-
/// Set the Background Color
139-
void setBackgroundColor(QColor color);
140+
/// Set Transparency Rener Type
141+
void setTransparencyRendertype(RenderState::TransparencySortType rType);
140142

141143
private:
142144

src/Interface/Modules/Render/ViewScene.cc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,30 @@ void ViewSceneDialog::assignBackgroundColor()
424424
}
425425
}
426426

427+
//------------------------------------------------------------------------------
428+
void ViewSceneDialog::setTransparencySortTypeContinuous(bool index)
429+
{
430+
std::shared_ptr<Render::SRInterface> spire = mSpire.lock();
431+
spire->setTransparencyRendertype(RenderState::TransparencySortType::CONTINUOUS_SORT);
432+
newGeometryValue();
433+
}
434+
435+
//------------------------------------------------------------------------------
436+
void ViewSceneDialog::setTransparencySortTypeUpdate(bool index)
437+
{
438+
std::shared_ptr<Render::SRInterface> spire = mSpire.lock();
439+
spire->setTransparencyRendertype(RenderState::TransparencySortType::UPDATE_SORT);
440+
newGeometryValue();
441+
}
442+
443+
//------------------------------------------------------------------------------
444+
void ViewSceneDialog::setTransparencySortTypeLists(bool index)
445+
{
446+
std::shared_ptr<Render::SRInterface> spire = mSpire.lock();
447+
spire->setTransparencyRendertype(RenderState::TransparencySortType::LISTS_SORT);
448+
newGeometryValue();
449+
}
450+
427451
//------------------------------------------------------------------------------
428452
void ViewSceneDialog::handleUnselectedItem(const QString& name)
429453
{

src/Interface/Modules/Render/ViewScene.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ namespace SCIRun {
8383
void viewVectorSelected(int index);
8484
void configurationButtonClicked();
8585
void assignBackgroundColor();
86+
void setTransparencySortTypeContinuous(bool index);
87+
void setTransparencySortTypeUpdate(bool index);
88+
void setTransparencySortTypeLists(bool index);
8689
void handleUnselectedItem(const QString& name);
8790
void handleSelectedItem(const QString& name);
8891

src/Interface/Modules/Render/ViewSceneControls.ui

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<bool>true</bool>
3434
</property>
3535
<property name="currentIndex">
36-
<number>2</number>
36+
<number>0</number>
3737
</property>
3838
<widget class="QWidget" name="RenderTab">
3939
<attribute name="title">
@@ -71,6 +71,67 @@
7171
<string/>
7272
</property>
7373
</widget>
74+
<widget class="QGroupBox" name="groupBox_6">
75+
<property name="geometry">
76+
<rect>
77+
<x>8</x>
78+
<y>90</y>
79+
<width>260</width>
80+
<height>91</height>
81+
</rect>
82+
</property>
83+
<property name="font">
84+
<font>
85+
<weight>75</weight>
86+
<bold>true</bold>
87+
</font>
88+
</property>
89+
<property name="title">
90+
<string>Transparency Rendering</string>
91+
</property>
92+
<widget class="QRadioButton" name="contSortRadioButton_">
93+
<property name="geometry">
94+
<rect>
95+
<x>10</x>
96+
<y>20</y>
97+
<width>141</width>
98+
<height>17</height>
99+
</rect>
100+
</property>
101+
<property name="text">
102+
<string>Continuous Sort</string>
103+
</property>
104+
<property name="checked">
105+
<bool>true</bool>
106+
</property>
107+
</widget>
108+
<widget class="QRadioButton" name="updateSortRadioButton_">
109+
<property name="geometry">
110+
<rect>
111+
<x>10</x>
112+
<y>40</y>
113+
<width>141</width>
114+
<height>17</height>
115+
</rect>
116+
</property>
117+
<property name="text">
118+
<string>Intermittent Sort</string>
119+
</property>
120+
</widget>
121+
<widget class="QRadioButton" name="listSortRadioButton_">
122+
<property name="geometry">
123+
<rect>
124+
<x>10</x>
125+
<y>60</y>
126+
<width>141</width>
127+
<height>17</height>
128+
</rect>
129+
</property>
130+
<property name="text">
131+
<string>List Sort</string>
132+
</property>
133+
</widget>
134+
</widget>
74135
</widget>
75136
<widget class="QWidget" name="ClippingTab">
76137
<property name="enabled">

src/Interface/Modules/Render/ViewSceneControlsDock.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ ViewSceneControlsDock::ViewSceneControlsDock(const QString& name, ViewSceneDialo
4949
connect(orientationCheckBox_, SIGNAL(clicked(bool)), parent, SLOT(showOrientationChecked(bool)));
5050
connect(mouseControlComboBox_, SIGNAL(currentIndexChanged(int)), parent, SLOT(menuMouseControlChanged(int)));
5151
connect(setBackgroundColorPushButton_, SIGNAL(clicked()), parent, SLOT(assignBackgroundColor()));
52+
connect(contSortRadioButton_, SIGNAL(clicked(bool)), parent, SLOT(setTransparencySortTypeContinuous(bool)));
53+
connect(updateSortRadioButton_, SIGNAL(clicked(bool)), parent, SLOT(setTransparencySortTypeUpdate(bool)));
54+
connect(listSortRadioButton_, SIGNAL(clicked(bool)), parent, SLOT(setTransparencySortTypeLists(bool)));
5255

5356
setSampleColor(Qt::black);
5457

0 commit comments

Comments
 (0)