Skip to content

Commit f7fec69

Browse files
committed
Closes #868
1 parent adf9dad commit f7fec69

File tree

7 files changed

+143
-143
lines changed

7 files changed

+143
-143
lines changed

src/Core/Algorithms/Visualization/RenderFieldState.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ class RenderState
5656

5757
// Node flags
5858
USE_SPHERE,
59+
USE_TRANSPARENT_NODES,
5960

6061
// Edge flags
6162
USE_CYLINDER,
63+
USE_TRANSPARENT_EDGES,
6264

6365
// Face flags
6466
USE_NORMALS,

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

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -393,38 +393,42 @@ namespace SCIRun {
393393
for (int i = 0; i <= 6; ++i)
394394
{
395395
std::string name = ibo.name;
396-
397396
if (i == 0)
397+
{
398+
int numPrimitives = ibo.data->getBufferSize() / ibo.indexSize;
399+
iboMan.addInMemoryIBO(ibo.data->getBuffer(), ibo.data->getBufferSize(), primitive, primType, numPrimitives, ibo.name);
400+
}
401+
if (i == 1)
398402
{
399403
dir = Core::Geometry::Vector(1.0, 0.0, 0.0);
400404
name += "X";
401405
}
402-
if (i == 1)
406+
if (i == 2)
403407
{
404408
dir = Core::Geometry::Vector(0.0, 1.0, 0.0);
405409
name += "Y";
406410
}
407-
if (i == 2)
411+
if (i == 3)
408412
{
409413
dir = Core::Geometry::Vector(0.0, 0.0, 1.0);
410414
name += "Z";
411415
}
412-
if (i == 3)
416+
if (i == 4)
413417
{
414418
dir = Core::Geometry::Vector(-1.0, 0.0, 0.0);
415419
name += "NegX";
416420
}
417-
if (i == 4)
421+
if (i == 5)
418422
{
419423
dir = Core::Geometry::Vector(0.0, -1.0, 0.0);
420424
name += "NegY";
421425
}
422-
if (i == 5)
426+
if (i == 6)
423427
{
424428
dir = Core::Geometry::Vector(0.0, 0.0, -1.0);
425429
name += "NegZ";
426430
}
427-
if (i < 6)
431+
if (i > 0)
428432
{
429433
for (size_t j = 0; j < num_triangles; j++)
430434
{
@@ -457,11 +461,6 @@ namespace SCIRun {
457461

458462
iboMan.addInMemoryIBO(sbuffer, ibo.data->getBufferSize(), primitive, primType, numPrimitives, name);
459463
}
460-
else
461-
{
462-
int numPrimitives = ibo.data->getBufferSize() / ibo.indexSize;
463-
iboMan.addInMemoryIBO(ibo.data->getBuffer(), ibo.data->getBufferSize(), primitive, primType, numPrimitives, ibo.name);
464-
}
465464
}
466465
}
467466

@@ -485,17 +484,17 @@ namespace SCIRun {
485484
for (int i = 0; i <= 6; ++i)
486485
{
487486
std::string name = pass.iboName;
488-
if (i == 0)
489-
name += "X";
490487
if (i == 1)
491-
name += "Y";
488+
name += "X";
492489
if (i == 2)
493-
name += "Z";
490+
name += "Y";
494491
if (i == 3)
495-
name += "NegX";
492+
name += "Z";
496493
if (i == 4)
497-
name += "NegY";
494+
name += "NegX";
498495
if (i == 5)
496+
name += "NegY";
497+
if (i == 6)
499498
name += "NegZ";
500499

501500
addIBOToEntity(entityID, name);

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,15 @@ class RenderBasicSys :
9898
return;
9999
}
100100

101-
if (srstate.front().state.get(RenderState::USE_TRANSPARENCY))
101+
if (srstate.front().state.get(RenderState::USE_TRANSPARENCY) ||
102+
srstate.front().state.get(RenderState::USE_TRANSPARENT_EDGES) ||
103+
srstate.front().state.get(RenderState::USE_TRANSPARENT_NODES))
102104
{
103105
return;
104106
}
105107

106108
GLuint iboID = ibo.front().glid;
107109

108-
int index = 0;
109-
for (auto it = ibo.begin(); it != ibo.end(); ++it, ++index)
110-
{
111-
if (index == 6)
112-
iboID = it->glid;
113-
}
114-
115110
// Setup *everything*. We don't want to enter multiple conditional
116111
// statements if we can avoid it. So we assume everything has not been
117112
// setup (including uniforms) if the simple geom hasn't been setup.

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,15 @@ class RenderColorMapSys :
9898
return;
9999
}
100100

101-
if (srstate.front().state.get(RenderState::USE_TRANSPARENCY))
101+
if (srstate.front().state.get(RenderState::USE_TRANSPARENCY) ||
102+
srstate.front().state.get(RenderState::USE_TRANSPARENT_EDGES) ||
103+
srstate.front().state.get(RenderState::USE_TRANSPARENT_NODES))
102104
{
103105
return;
104106
}
105107

106108
GLuint iboID = ibo.front().glid;
107-
108-
int index = 0;
109-
for (auto it = ibo.begin(); it != ibo.end(); ++it, ++index)
110-
{
111-
if (index == 6)
112-
iboID = it->glid;
113-
}
114-
109+
115110
// Setup *everything*. We don't want to enter multiple conditional
116111
// statements if we can avoid it. So we assume everything has not been
117112
// setup (including uniforms) if the simple geom hasn't been setup.

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

Lines changed: 35 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -182,60 +182,26 @@ class RenderBasicSysTrans :
182182
return;
183183
}
184184

185-
if (!srstate.front().state.get(RenderState::USE_TRANSPARENCY))
185+
if (!srstate.front().state.get(RenderState::USE_TRANSPARENCY) &&
186+
!srstate.front().state.get(RenderState::USE_TRANSPARENT_EDGES) &&
187+
!srstate.front().state.get(RenderState::USE_TRANSPARENT_NODES))
186188
{
187189
return;
188190
}
189191

190-
191192
bool drawLines = (ibo.front().primMode == Core::Datatypes::GeometryObject::SpireIBO::LINES);
192193
GLuint iboID = ibo.front().glid;
193-
GLuint iboXID = ibo.front().glid;
194-
GLuint iboYID = ibo.front().glid;
195-
GLuint iboZID = ibo.front().glid;
196-
GLuint iboNegXID = ibo.front().glid;
197-
GLuint iboNegYID = ibo.front().glid;
198-
GLuint iboNegZID = ibo.front().glid;
199-
GLuint iboLinesID = ibo.front().glid;
200-
201-
202-
int index = 0;
203-
for (auto it = ibo.begin(); it != ibo.end(); ++it, ++index)
204-
{
205-
206-
if (index == 0)
207-
iboXID = it->glid;
208-
if (index == 1)
209-
iboYID = it->glid;
210-
if (index == 2)
211-
iboZID = it->glid;
212-
if (index == 3)
213-
iboNegXID = it->glid;
214-
if (index == 4)
215-
iboNegYID = it->glid;
216-
if (index == 5)
217-
iboNegZID = it->glid;
218-
if (index == 6)
219-
iboLinesID = it->glid;
220-
}
221-
222194

223195
Core::Geometry::Vector dir(camera.front().data.worldToView[0][2],
224-
camera.front().data.worldToView[1][2],
225-
camera.front().data.worldToView[2][2]);
226-
196+
camera.front().data.worldToView[1][2],
197+
camera.front().data.worldToView[2][2]);
227198

228199
if (sortedID == NULL)
229200
{
230201
prevDir = dir;
231202
}
232203

233-
if (drawLines)
234-
{
235-
iboID = iboLinesID;
236-
}
237-
238-
else
204+
if (!drawLines)
239205
{
240206
switch (pass.front().renderState.mSortType)
241207
{
@@ -259,25 +225,47 @@ class RenderBasicSysTrans :
259225
sortedID = sortObjects(dir, ibo, pass, iboMan);
260226
}
261227
iboID = sortedID;
262-
//std::cout << "update" << std::endl;
228+
//::cout << "update" << std::endl;
263229
break;
264230
}
265231
case RenderState::TransparencySortType::LISTS_SORT:
266232
{
233+
GLuint iboXID = ibo.front().glid;
234+
GLuint iboYID = ibo.front().glid;
235+
GLuint iboZID = ibo.front().glid;
236+
GLuint iboNegXID = ibo.front().glid;
237+
GLuint iboNegYID = ibo.front().glid;
238+
GLuint iboNegZID = ibo.front().glid;
239+
240+
int index = 0;
241+
for (auto it = ibo.begin(); it != ibo.end(); ++it, ++index)
242+
{
243+
if (index == 1)
244+
iboXID = it->glid;
245+
if (index == 2)
246+
iboYID = it->glid;
247+
if (index == 3)
248+
iboZID = it->glid;
249+
if (index == 4)
250+
iboNegXID = it->glid;
251+
if (index == 5)
252+
iboNegYID = it->glid;
253+
if (index == 6)
254+
iboNegZID = it->glid;
255+
}
256+
267257
Core::Geometry::Vector currentDir(camera.front().data.worldToView[0][2],
268-
camera.front().data.worldToView[1][2],
269-
camera.front().data.worldToView[2][2]);
258+
camera.front().data.worldToView[1][2],
259+
camera.front().data.worldToView[2][2]);
270260

271261

272262
Core::Geometry::Vector absDir(abs(camera.front().data.worldToView[0][2]),
273-
abs(camera.front().data.worldToView[1][2]),
274-
abs(camera.front().data.worldToView[2][2]));
275-
263+
abs(camera.front().data.worldToView[1][2]),
264+
abs(camera.front().data.worldToView[2][2]));
276265

277266
double xORy = absDir.x() > absDir.y() ? absDir.x() : absDir.y();
278267
double orZ = absDir.z() > xORy ? absDir.z() : xORy;
279268

280-
281269
if (orZ == absDir.x())
282270
{
283271
iboID = currentDir.x() < orZ ? iboNegXID : iboXID;
@@ -296,7 +284,6 @@ class RenderBasicSysTrans :
296284
}
297285
}
298286

299-
300287
// Setup *everything*. We don't want to enter multiple conditional
301288
// statements if we can avoid it. So we assume everything has not been
302289
// setup (including uniforms) if the simple geom hasn't been setup.

0 commit comments

Comments
 (0)