Skip to content

Commit 43a1f3d

Browse files
committed
Merge branch 'master' into issues_SV
2 parents 5ac3edb + bafd30d commit 43a1f3d

File tree

10 files changed

+301
-101
lines changed

10 files changed

+301
-101
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ For documentation, please see: http://sciinstitute.github.io/SCIRun/
5555
#### CMake Build Generators
5656
* Windows
5757
- Visual Studio 2013
58-
* OS X (tested on 10.7 and 10.8)
59-
- Unix Makefiles (Xcode not currently supported)
58+
* OS X (tested on 10.7 and 10.8 and 10.10)
59+
- Unix Makefiles
60+
- Xcode
6061
* Linux (tested on Ubuntu 12.10)
6162
- Unix Makefiles
6263

src/Interface/Modules/Fields/EditMeshBoundingBox.ui

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@
334334
<item>
335335
<widget class="QGroupBox" name="groupBox_3">
336336
<property name="enabled">
337-
<bool>false</bool>
337+
<bool>true</bool>
338338
</property>
339339
<property name="font">
340340
<font>
@@ -357,6 +357,9 @@
357357
</item>
358358
<item>
359359
<widget class="QToolButton" name="doubleUpScaleToolButton_">
360+
<property name="enabled">
361+
<bool>true</bool>
362+
</property>
360363
<property name="text">
361364
<string>++</string>
362365
</property>
@@ -458,4 +461,10 @@
458461
</widget>
459462
<resources/>
460463
<connections/>
464+
<slots>
465+
<slot>ScaleUpPush()</slot>
466+
<slot>ScaleDoubleUpPush()</slot>
467+
<slot>ScaleDownPush()</slot>
468+
<slot>ScaleDoubleDownPush()</slot>
469+
</slots>
461470
</ui>

src/Interface/Modules/Fields/EditMeshBoundingBoxDialog.cc

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ using namespace SCIRun::Dataflow::Networks;
3434

3535
EditMeshBoundingBoxDialog::EditMeshBoundingBoxDialog(const std::string& name, ModuleStateHandle state,
3636
QWidget* parent /* = 0 */)
37-
: ModuleDialogGeneric(state, parent)
37+
: ModuleDialogGeneric(state, parent), scale_(1.0)
3838
{
3939
setupUi(this);
40+
//custom value for cylinder size
4041
setWindowTitle(QString::fromStdString(name));
4142
fixSize();
4243

@@ -58,8 +59,30 @@ EditMeshBoundingBoxDialog::EditMeshBoundingBoxDialog(const std::string& name, Mo
5859
addDynamicLabelManager(inputSizeXLabel_, EditMeshBoundingBoxModule::InputSizeX);
5960
addDynamicLabelManager(inputSizeYLabel_, EditMeshBoundingBoxModule::InputSizeY);
6061
addDynamicLabelManager(inputSizeZLabel_, EditMeshBoundingBoxModule::InputSizeZ);
62+
63+
addDoubleSpinBoxManager(&spinner_scale_, EditMeshBoundingBoxModule::Scale);
64+
connectButtonToExecuteSignal(downScaleToolButton_);
65+
connectButtonToExecuteSignal(upScaleToolButton_);
66+
connectButtonToExecuteSignal(doubleDownScaleToolButton_);
67+
connectButtonToExecuteSignal(doubleUpScaleToolButton_);
68+
69+
70+
71+
72+
connect(upScaleToolButton_, SIGNAL(clicked()), this, SLOT(ScaleUpPush()));
73+
connect(doubleUpScaleToolButton_, SIGNAL(clicked()), this, SLOT(ScaleDoubleUpPush()));
74+
connect(downScaleToolButton_, SIGNAL(clicked()), this, SLOT(ScaleDownPush()));
75+
connect(doubleDownScaleToolButton_, SIGNAL(clicked()), this, SLOT(ScaleDoubleDownPush()));
76+
77+
78+
6179
}
6280

81+
void EditMeshBoundingBoxDialog::ScaleUpPush() { scale_*=1.25; spinner_scale_.setValue(scale_); }
82+
void EditMeshBoundingBoxDialog::ScaleDoubleUpPush() { scale_*=1.5625; spinner_scale_.setValue(scale_); }
83+
void EditMeshBoundingBoxDialog::ScaleDownPush() { scale_*=0.8; spinner_scale_.setValue(scale_); }
84+
void EditMeshBoundingBoxDialog::ScaleDoubleDownPush() { scale_*=0.64; spinner_scale_.setValue(scale_); }
85+
6386
void EditMeshBoundingBoxDialog::pull()
6487
{
6588
pull_newVersionToReplaceOld();

src/Interface/Modules/Fields/EditMeshBoundingBoxDialog.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ class SCISHARE EditMeshBoundingBoxDialog : public ModuleDialogGeneric,
4646
SCIRun::Dataflow::Networks::ModuleStateHandle state,
4747
QWidget* parent = 0);
4848
virtual void pull();
49+
50+
QDoubleSpinBox spinner_scale_;
51+
double scale_;
52+
private Q_SLOTS:
53+
void ScaleUpPush();
54+
void ScaleDoubleUpPush();
55+
void ScaleDownPush();
56+
void ScaleDoubleDownPush();
4957
};
5058

5159
}

src/Interface/Modules/Render/ES/systems/RenderTransBasicSys.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,8 @@ class RenderBasicSysTrans :
307307
bool depthMask = glIsEnabled(GL_DEPTH_WRITEMASK);
308308
bool cullFace = glIsEnabled(GL_CULL_FACE);
309309
bool blend = glIsEnabled(GL_BLEND);
310-
310+
311+
GL(glEnable(GL_DEPTH_TEST));
311312
GL(glDepthMask(GL_FALSE));
312313
GL(glDisable(GL_CULL_FACE));
313314
GL(glEnable(GL_BLEND));

src/Interface/Modules/Render/ES/systems/RenderTransColorMapSys.cc

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,24 +129,29 @@ class RenderColorMapSysTrans :
129129
return;
130130
}
131131

132-
camera.front().data.projection;
133-
134132
char* vbo_buffer = reinterpret_cast<char*>(pass.front().vbo.data->getBuffer());
133+
uint32_t* ibo_buffer = reinterpret_cast<uint32_t*>(pass.front().ibo.data->getBuffer());
135134
size_t num_triangles = pass.front().ibo.data->getBufferSize() / (sizeof(uint32_t) * 3);
136-
size_t stride_vbo = pass.front().vbo.data->getBufferSize() / (num_triangles * 3);
135+
136+
size_t stride_vbo = 0;
137+
for (auto a : pass.front().vbo.attributes)
138+
stride_vbo += a.sizeInBytes;
137139

138140
std::vector<DepthIndex> rel_depth(num_triangles);
139-
Core::Geometry::Vector dir(camera.front().data.worldToView[0][2], camera.front().data.worldToView[1][2], camera.front().data.worldToView[2][2]);
141+
Core::Geometry::Vector dir(
142+
camera.front().data.worldToView[0][2],
143+
camera.front().data.worldToView[1][2],
144+
camera.front().data.worldToView[2][2]);
140145

141146
for (size_t j = 0; j < num_triangles; j++)
142147
{
143-
float* vertex1 = reinterpret_cast<float*>(vbo_buffer + stride_vbo * (j * 3));
148+
float* vertex1 = reinterpret_cast<float*>(vbo_buffer + stride_vbo * (ibo_buffer[j*3]));
144149
Core::Geometry::Point node1(vertex1[0], vertex1[1], vertex1[2]);
145150

146-
float* vertex2 = reinterpret_cast<float*>(vbo_buffer + stride_vbo * (j * 3 + 1));
151+
float* vertex2 = reinterpret_cast<float*>(vbo_buffer + stride_vbo * (ibo_buffer[j*3+1]));
147152
Core::Geometry::Point node2(vertex2[0], vertex2[1], vertex2[2]);
148153

149-
float* vertex3 = reinterpret_cast<float*>(vbo_buffer + stride_vbo * (j * 3 + 2));
154+
float* vertex3 = reinterpret_cast<float*>(vbo_buffer + stride_vbo * (ibo_buffer[j*3+2]));
150155
Core::Geometry::Point node3(vertex3[0], vertex3[1], vertex3[2]);
151156

152157
rel_depth[j].mDepth = Core::Geometry::Dot(dir, node1) + Core::Geometry::Dot(dir, node2) + Core::Geometry::Dot(dir, node3);
@@ -305,7 +310,8 @@ class RenderColorMapSysTrans :
305310
bool depthMask = glIsEnabled(GL_DEPTH_WRITEMASK);
306311
bool cullFace = glIsEnabled(GL_CULL_FACE);
307312
bool blend = glIsEnabled(GL_BLEND);
308-
313+
314+
GL(glEnable(GL_DEPTH_TEST));
309315
GL(glDepthMask(GL_FALSE));
310316
GL(glDisable(GL_CULL_FACE));
311317
GL(glEnable(GL_BLEND));

src/Modules/Fields/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ TARGET_LINK_LIBRARIES(Modules_Fields
5353
Core_Datatypes_Mesh
5454
Algorithms_Field
5555
Core_Datatypes_Legacy_Field
56+
${OPENGL_LIBRARIES}
57+
${CPM_LIBRARIES}
5658
)
5759

5860
IF(BUILD_SHARED_LIBS)

0 commit comments

Comments
 (0)