Skip to content

Commit 0b0225d

Browse files
committed
Merge branch 'master' into python-code-editor
2 parents 869afcc + 2124c89 commit 0b0225d

File tree

13 files changed

+185
-79
lines changed

13 files changed

+185
-79
lines changed

src/Core/Algorithms/Visualization/RenderFieldState.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,16 @@ class SCISHARE RenderState
6060
// Node flags
6161
USE_SPHERE,
6262
USE_TRANSPARENT_NODES,
63+
USE_DEFAULT_COLOR_NODES,
64+
USE_COLORMAP_ON_NODES,
65+
USE_COLOR_CONVERT_ON_NODES,
6366

6467
// Edge flags
6568
USE_CYLINDER,
6669
USE_TRANSPARENT_EDGES,
70+
USE_DEFAULT_COLOR_EDGES,
71+
USE_COLORMAP_ON_EDGES,
72+
USE_COLOR_CONVERT_ON_EDGES,
6773

6874
// Face flags
6975
USE_NORMALS,

src/Interface/Modules/Fields/EditMeshBoundingBoxDialog.cc

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ typedef SCIRun::Modules::Fields::EditMeshBoundingBox EditMeshBoundingBoxModule;
3636

3737
EditMeshBoundingBoxDialog::EditMeshBoundingBoxDialog(const std::string& name, ModuleStateHandle state,
3838
QWidget* parent /* = 0 */)
39-
: ModuleDialogGeneric(state, parent), scale_(0.1)
39+
: ModuleDialogGeneric(state, parent), doubleUpScale_(1.5625), upScale_(1.25), downScale_(0.8), doubleDownScale_(0.64)
4040
{
4141
setupUi(this);
4242
//custom value for cylinder size
@@ -61,13 +61,6 @@ EditMeshBoundingBoxDialog::EditMeshBoundingBoxDialog(const std::string& name, Mo
6161
addDynamicLabelManager(inputSizeYLabel_, EditMeshBoundingBoxModule::InputSizeY);
6262
addDynamicLabelManager(inputSizeZLabel_, EditMeshBoundingBoxModule::InputSizeZ);
6363

64-
addDoubleSpinBoxManager(&spinner_scale_, EditMeshBoundingBoxModule::Scale);
65-
connectButtonToExecuteSignal(downScaleToolButton_);
66-
connectButtonToExecuteSignal(upScaleToolButton_);
67-
connectButtonToExecuteSignal(doubleDownScaleToolButton_);
68-
connectButtonToExecuteSignal(doubleUpScaleToolButton_);
69-
spinner_scale_.setValue(scale_);
70-
7164
connect(upScaleToolButton_, SIGNAL(clicked()), this, SLOT(ScaleUpPush()));
7265
connect(doubleUpScaleToolButton_, SIGNAL(clicked()), this, SLOT(ScaleDoubleUpPush()));
7366
connect(downScaleToolButton_, SIGNAL(clicked()), this, SLOT(ScaleDownPush()));
@@ -77,7 +70,15 @@ EditMeshBoundingBoxDialog::EditMeshBoundingBoxDialog(const std::string& name, Mo
7770
createExecuteInteractivelyToggleAction();
7871
}
7972

80-
void EditMeshBoundingBoxDialog::ScaleUpPush() { scale_ *= 1.25; spinner_scale_.setValue(scale_); }
81-
void EditMeshBoundingBoxDialog::ScaleDoubleUpPush() { scale_ *= 1.5625; spinner_scale_.setValue(scale_); }
82-
void EditMeshBoundingBoxDialog::ScaleDownPush() { scale_ *= 0.8; spinner_scale_.setValue(scale_); }
83-
void EditMeshBoundingBoxDialog::ScaleDoubleDownPush() { scale_ *= 0.64; spinner_scale_.setValue(scale_); }
73+
void EditMeshBoundingBoxDialog::AdjustScale(float scaleFactor)
74+
{
75+
auto scale = state_->getValue(EditMeshBoundingBoxModule::Scale).toDouble();
76+
scale *= scaleFactor;
77+
state_->setValue(EditMeshBoundingBoxModule::Scale, scale);
78+
executeActionTriggered();
79+
}
80+
81+
void EditMeshBoundingBoxDialog::ScaleUpPush(){ AdjustScale(upScale_); }
82+
void EditMeshBoundingBoxDialog::ScaleDoubleUpPush(){ AdjustScale(doubleUpScale_); }
83+
void EditMeshBoundingBoxDialog::ScaleDownPush(){ AdjustScale(downScale_); }
84+
void EditMeshBoundingBoxDialog::ScaleDoubleDownPush(){ AdjustScale(doubleDownScale_); }

src/Interface/Modules/Fields/EditMeshBoundingBoxDialog.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ class SCISHARE EditMeshBoundingBoxDialog : public ModuleDialogGeneric,
4646
SCIRun::Dataflow::Networks::ModuleStateHandle state,
4747
QWidget* parent = 0);
4848
private:
49-
QDoubleSpinBox spinner_scale_;
50-
double scale_;
49+
void AdjustScale(float scaleFactor);
50+
float doubleUpScale_, upScale_, downScale_, doubleDownScale_;
5151
private Q_SLOTS:
52-
void ScaleUpPush();
53-
void ScaleDoubleUpPush();
54-
void ScaleDownPush();
55-
void ScaleDoubleDownPush();
52+
void ScaleUpPush();
53+
void ScaleDoubleUpPush();
54+
void ScaleDownPush();
55+
void ScaleDoubleDownPush();
5656
};
5757

5858
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1402,7 +1402,8 @@ namespace SCIRun {
14021402

14031403
glm::vec3 viewDir = viewToWorld[2].xyz();
14041404
viewDir = -viewDir; // Cameras look down -Z.
1405-
light->lightDir[i] = mLightsOn[i] ? viewDir - mLightPosition[i] : glm::vec3(0.0, 0.0, 0.0);
1405+
//light->lightDir[i] = mLightsOn[i] ? viewDir - mLightPosition[i] : glm::vec3(0.0, 0.0, 0.0);
1406+
light->lightDir[i] = mLightsOn[i] ? viewDir : glm::vec3(0.0, 0.0, 0.0);
14061407
//light->lightDir[i] = mLightsOn[i] ? lightDir : glm::vec3(0.0, 0.0, 0.0);
14071408
}
14081409
}

src/Interface/Modules/Render/ViewScene.cc

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ void ViewSceneDialog::selectObject(const int x, const int y)
314314
auto geomDataTransient = state_->getTransientValue(Parameters::GeomData);
315315
if (geomDataTransient && !geomDataTransient->empty())
316316
{
317+
int port = 0;
317318
auto geomData = transient_value_cast<Modules::Render::ViewScene::GeomListPtr>(geomDataTransient);
318319
if (!geomData)
319320
{
@@ -329,24 +330,29 @@ void ViewSceneDialog::selectObject(const int x, const int y)
329330
//getting geom list
330331
std::list<GeometryHandle> objList;
331332

332-
for (auto it = geomData->begin(); it != geomData->end(); ++it)
333+
for (auto it = geomData->begin(); it != geomData->end(); ++it, ++port)
333334
{
334-
auto obj = *it;
335-
auto realObj = boost::dynamic_pointer_cast<GeometryObjectSpire>(obj);
336-
if (realObj)
335+
// Check if object is visible
336+
auto obj = *it; auto name = obj->uniqueID();
337+
auto displayName = QString::fromStdString(name).split('_').at(1);
338+
if (!isObjectUnselected(displayName.toStdString()))
337339
{
338-
//filter objs
339-
bool isWidget = false;
340-
for (auto& pass : realObj->mPasses)
340+
auto realObj = boost::dynamic_pointer_cast<GeometryObjectSpire>(obj);
341+
if (realObj)
341342
{
342-
if (pass.renderState.get(RenderState::IS_WIDGET))
343+
//filter objs
344+
bool isWidget = false;
345+
for (auto& pass : realObj->mPasses)
343346
{
344-
isWidget = true;
345-
break;
347+
if (pass.renderState.get(RenderState::IS_WIDGET))
348+
{
349+
isWidget = true;
350+
break;
351+
}
346352
}
353+
if (isWidget)
354+
objList.push_back(realObj);
347355
}
348-
if (isWidget)
349-
objList.push_back(realObj);
350356
}
351357
}
352358

src/Interface/Modules/Visualization/ShowField.ui

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<string notr="true"/>
6666
</property>
6767
<property name="currentIndex">
68-
<number>2</number>
68+
<number>0</number>
6969
</property>
7070
<widget class="QWidget" name="nodesTab_">
7171
<attribute name="title">
@@ -111,7 +111,7 @@
111111
<item>
112112
<widget class="QGroupBox" name="groupBox_3">
113113
<property name="enabled">
114-
<bool>false</bool>
114+
<bool>true</bool>
115115
</property>
116116
<property name="minimumSize">
117117
<size>
@@ -142,6 +142,14 @@
142142
</item>
143143
<item row="2" column="0">
144144
<widget class="QRadioButton" name="conversionRGBNodeColoringButton_">
145+
<property name="enabled">
146+
<bool>false</bool>
147+
</property>
148+
<property name="font">
149+
<font>
150+
<strikeout>true</strikeout>
151+
</font>
152+
</property>
145153
<property name="text">
146154
<string>Conversion to RGB</string>
147155
</property>
@@ -307,14 +315,14 @@
307315
</property>
308316
<layout class="QVBoxLayout" name="verticalLayout_4">
309317
<item>
310-
<widget class="QRadioButton" name="defaultNodeColoringButton_1">
318+
<widget class="QRadioButton" name="defaultEdgeColoringButton_">
311319
<property name="text">
312320
<string>Default</string>
313321
</property>
314322
</widget>
315323
</item>
316324
<item>
317-
<widget class="QRadioButton" name="colormapLookupNodeColoringButton_1">
325+
<widget class="QRadioButton" name="colormapLookupEdgeColoringButton_">
318326
<property name="text">
319327
<string>Colormap Lookup</string>
320328
</property>
@@ -324,7 +332,15 @@
324332
</widget>
325333
</item>
326334
<item>
327-
<widget class="QRadioButton" name="conversionRGBNodeColoringButton_1">
335+
<widget class="QRadioButton" name="conversionRGBEdgeColoringButton_">
336+
<property name="enabled">
337+
<bool>false</bool>
338+
</property>
339+
<property name="font">
340+
<font>
341+
<strikeout>true</strikeout>
342+
</font>
343+
</property>
328344
<property name="text">
329345
<string>Conversion to RGB</string>
330346
</property>
@@ -491,7 +507,7 @@
491507
<item row="2" column="0" colspan="2">
492508
<widget class="QGroupBox" name="groupBox_5">
493509
<property name="enabled">
494-
<bool>false</bool>
510+
<bool>true</bool>
495511
</property>
496512
<property name="sizePolicy">
497513
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
@@ -504,14 +520,19 @@
504520
</property>
505521
<layout class="QVBoxLayout" name="verticalLayout_16">
506522
<item>
507-
<widget class="QRadioButton" name="defaultNodeColoringButton_2">
523+
<widget class="QRadioButton" name="defaultFaceColoringButton_">
524+
<property name="font">
525+
<font>
526+
<strikeout>false</strikeout>
527+
</font>
528+
</property>
508529
<property name="text">
509530
<string>Default</string>
510531
</property>
511532
</widget>
512533
</item>
513534
<item>
514-
<widget class="QRadioButton" name="colormapLookupNodeColoringButton_2">
535+
<widget class="QRadioButton" name="colormapLookupFaceColoringButton_">
515536
<property name="text">
516537
<string>Colormap Lookup</string>
517538
</property>
@@ -521,7 +542,15 @@
521542
</widget>
522543
</item>
523544
<item>
524-
<widget class="QRadioButton" name="conversionRGBNodeColoringButton_2">
545+
<widget class="QRadioButton" name="conversionRGBFaceColoringButton_">
546+
<property name="enabled">
547+
<bool>false</bool>
548+
</property>
549+
<property name="font">
550+
<font>
551+
<strikeout>true</strikeout>
552+
</font>
553+
</property>
525554
<property name="text">
526555
<string>Conversion to RGB</string>
527556
</property>
@@ -552,6 +581,11 @@
552581
<property name="enabled">
553582
<bool>false</bool>
554583
</property>
584+
<property name="font">
585+
<font>
586+
<strikeout>true</strikeout>
587+
</font>
588+
</property>
555589
<property name="text">
556590
<string>Render Images as a texture (Colormap Only)</string>
557591
</property>

src/Interface/Modules/Visualization/ShowFieldDialog.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,17 @@ ShowFieldDialog::ShowFieldDialog(const std::string& name, ModuleStateHandle stat
7676
addSpinBoxManager(textPrecisionSpinBox_, ShowFieldModule::TextPrecision);
7777
addRadioButtonGroupManager({ edgesAsLinesButton_, edgesAsCylindersButton_ }, ShowFieldModule::EdgesAsCylinders);
7878
addRadioButtonGroupManager({ nodesAsPointsButton_, nodesAsSpheresButton_ }, ShowFieldModule::NodeAsSpheres);
79+
addRadioButtonGroupManager({ defaultNodeColoringButton_, colormapLookupNodeColoringButton_/*, conversionRGBNodeColoringButton_*/ }, ShowFieldModule::NodesColoring);
80+
addRadioButtonGroupManager({ defaultEdgeColoringButton_, colormapLookupEdgeColoringButton_/*, conversionRGBEdgeColoringButton_*/ }, ShowFieldModule::EdgesColoring);
81+
addRadioButtonGroupManager({ defaultFaceColoringButton_, colormapLookupFaceColoringButton_/*, conversionRGBFaceColoringButton_*/ }, ShowFieldModule::FacesColoring);
7982
addRadioButtonGroupManager({ textColoringRadioButton_, colormapLookupTextRadioButton_, conversionRGBTextRadioButton_ }, ShowFieldModule::TextColoring);
8083

8184
connectButtonsToExecuteSignal({ showNodesCheckBox_, showEdgesCheckBox_, showFacesCheckBox_, enableTransparencyNodesCheckBox_,
8285
enableTransparencyEdgesCheckBox_, enableTransparencyFacesCheckBox_, invertNormalsCheckBox, edgesAsLinesButton_,
83-
edgesAsCylindersButton_, nodesAsPointsButton_, nodesAsSpheresButton_ });
86+
edgesAsCylindersButton_, nodesAsPointsButton_, nodesAsSpheresButton_ ,
87+
defaultNodeColoringButton_, colormapLookupNodeColoringButton_, //conversionRGBNodeColoringButton_,
88+
defaultEdgeColoringButton_, colormapLookupEdgeColoringButton_, //conversionRGBEdgeColoringButton_,
89+
defaultFaceColoringButton_, colormapLookupFaceColoringButton_, /*conversionRGBFaceColoringButton_*/ });
8490

8591
connectButtonToExecuteSignal(useFaceNormalsCheckBox_);
8692

src/Interface/Modules/Visualization/ShowFieldGlyphsDialog.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ using namespace SCIRun::Core::Datatypes;
4040

4141
ShowFieldGlyphsDialog::ShowFieldGlyphsDialog(const std::string& name, ModuleStateHandle state,
4242
QWidget* parent /* = 0 */)
43-
: ModuleDialogGeneric(state, parent), vectorTabIndex_(-1), scalarTabIndex_(-1)
43+
: ModuleDialogGeneric(state, parent), vectorTabIndex_(-1), scalarTabIndex_(-1), tensorTabIndex_(-1)
4444
{
4545
setupUi(this);
4646
setWindowTitle(QString::fromStdString(name));
@@ -160,7 +160,7 @@ void ShowFieldGlyphsDialog::checkTabs()
160160
{
161161
if (tensorTabIndex_ > 0)
162162
{
163-
displayOptionsTabs_->removeTab(scalarTabIndex_);
163+
displayOptionsTabs_->removeTab(tensorTabIndex_);
164164
if (vectorTabIndex_ > tensorTabIndex_)
165165
--vectorTabIndex_;
166166
if (scalarTabIndex_ > tensorTabIndex_)

0 commit comments

Comments
 (0)