Skip to content

Commit 6328139

Browse files
author
Brig Bagley
committed
added default cylinder values. pr requests by @dwhite
1 parent ebe3244 commit 6328139

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

src/Interface/Modules/Visualization/CreateBasicColorMapDialog.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
using namespace SCIRun::Gui;
3333
using namespace SCIRun::Dataflow::Networks;
3434
using namespace SCIRun::Core::Algorithms;
35+
using namespace SCIRun::Core::Datatypes;
3536

3637
CreateBasicColorMapDialog::CreateBasicColorMapDialog(const std::string& name, ModuleStateHandle state,
3738
QWidget* parent /* = 0 */)

src/Interface/Modules/Visualization/CreateBasicColorMapDialog.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@
3131

3232
#include "Interface/Modules/Visualization/ui_CreateBasicColorMap.h"
3333
#include <Interface/Modules/Base/ModuleDialogGeneric.h>
34-
#include <Interface/Modules/Visualization/share.h>
3534
#include <Core/Datatypes/ColorMap.h>
36-
using namespace SCIRun::Core::Datatypes;
35+
#include <Interface/Modules/Visualization/share.h>
3736

3837
namespace SCIRun {
3938
namespace Gui {
@@ -50,7 +49,7 @@ class SCISHARE CreateBasicColorMapDialog : public ModuleDialogGeneric,
5049
virtual void pull();
5150
private Q_SLOTS:
5251
void updateColorMapPreview(QString s);
53-
const QString buildGradientString(ColorMap cm);
52+
const QString buildGradientString(SCIRun::Core::Datatypes::ColorMap cm);
5453
void setShiftSlider(QString s);
5554
void setResolutionSlider(QString s);
5655
void setShiftText(int i);

src/Interface/Modules/Visualization/ShowFieldDialog.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ ShowFieldDialog::ShowFieldDialog(const std::string& name, ModuleStateHandle stat
7373
connectButtonToExecuteSignal(edgesAsCylindersButton_);
7474
connectButtonToExecuteSignal(nodesAsPointsButton_);
7575
connectButtonToExecuteSignal(nodesAsSpheresButton_);
76+
77+
//default values
78+
cylinder_rad_spin->setValue(1.0);
79+
cylinder_res_spin->setValue(5);
7680

7781
connect(defaultMeshColorButton_, SIGNAL(clicked()), this, SLOT(assignDefaultMeshColor()));
7882

src/Modules/Visualization/ShowField.cc

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ void ShowFieldModule::setStateDefaults()
8181
state->setValue(FaceTransparencyValue, 0.65f);
8282
state->setValue(EdgeTransparencyValue, 0.65f);
8383
state->setValue(SphereScaleValue, 1.0);
84-
state->setValue(CylinderRadius, 0.05);
85-
state->setValue(CylinderResolution, 8);
84+
state->setValue(CylinderRadius, 1.0);
85+
state->setValue(CylinderResolution, 5);
8686
faceTransparencyValue_ = 0.65f;
8787
edgeTransparencyValue_ = 0.65f;
8888
sphereScalar_ = 1.0;
@@ -200,11 +200,6 @@ GeometryHandle ShowFieldModule::buildGeometryObject(
200200
bool showNodes = state->getValue(ShowFieldModule::ShowNodes).toBool();
201201
bool showEdges = state->getValue(ShowFieldModule::ShowEdges).toBool();
202202
bool showFaces = state->getValue(ShowFieldModule::ShowFaces).toBool();
203-
const ColorRGB meshColor(state->getValue(ShowFieldModule::DefaultMeshColor).toString());
204-
float meshRed = static_cast<float>(meshColor.r() / 255.0f);
205-
float meshGreen = static_cast<float>(meshColor.g() / 255.0f);
206-
float meshBlue = static_cast<float>(meshColor.b() / 255.0f);
207-
208203
// Resultant geometry type (representing a spire object and a number of passes).
209204
GeometryHandle geom(new GeometryObject(field));
210205
geom->objectName = id;
@@ -1471,11 +1466,9 @@ void ShowFieldModule::renderEdges(
14711466
}
14721467
GeometryObject::SpireIBO::PRIMITIVE primIn = GeometryObject::SpireIBO::LINES;
14731468
// Use cylinders...
1474-
if (state.get(RenderState::USE_CYLINDER)) {
1475-
renderType = GeometryObject::RENDER_VBO_IBO;
1469+
if (state.get(RenderState::USE_CYLINDER))
14761470
primIn = GeometryObject::SpireIBO::TRIANGLES;
14771471
vboOnGPU = true;
1478-
}
14791472
auto my_state = this->get_state();
14801473
double num_strips = double(my_state->getValue(CylinderResolution).toInt());
14811474
double radius = my_state->getValue(CylinderRadius).toDouble();

0 commit comments

Comments
 (0)