Skip to content

Commit 50cff40

Browse files
author
Xuan Huang
committed
hexvol support
1 parent 699dd42 commit 50cff40

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/Core/Algorithms/Visualization/OsprayDataAlgorithm.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ OsprayGeometryObjectHandle OsprayDataAlgorithm::addUnstructVol(FieldHandle field
433433
FieldInformation info(field);
434434

435435
if(info.is_tetvol()) numVPerCell =4;
436-
else numVPerCell =8;
437-
//else THROW_ALGORITHM_INPUT_ERROR("hex or tet only for unstructured volume!");
436+
else if(info.is_hexvol()) numVPerCell =8;
437+
else THROW_ALGORITHM_INPUT_ERROR("hex or tet only for unstructured volume!");
438438

439439
for (vmesh->begin(meshCellIter); meshCellIter != meshCellEnd; ++meshCellIter)
440440
{
@@ -443,7 +443,7 @@ OsprayGeometryObjectHandle OsprayDataAlgorithm::addUnstructVol(FieldHandle field
443443
vmesh->get_nodes(nodesFromCell, elemID);
444444
for(int i=numVPerCell;i<8;i++)
445445
nodesFromCell[i] = -4/(8-numVPerCell);
446-
for(int i=numVPerCell;i<16-numVPerCell;i++){
446+
for(int i=numVPerCell;i<8+numVPerCell;i++){
447447
index_new.push_back(nodesFromCell[i%8]);
448448
}
449449
}
@@ -645,8 +645,8 @@ AlgorithmOutput OsprayDataAlgorithm::run(const AlgorithmInput& input) const
645645
else if (info.is_volume())
646646
{
647647
if(info.is_hexvol()){
648-
//renderable = addUnstructVol(field, colorMap);
649-
THROW_ALGORITHM_INPUT_ERROR("Hex vol not supported. LatVol only at this point");
648+
renderable = addUnstructVol(field, colorMap);
649+
//THROW_ALGORITHM_INPUT_ERROR("Hex vol not supported. LatVol only at this point");
650650
}else if(info.is_latvol()){
651651
renderable = addStructVol(field, colorMap);
652652
//renderable = addStructVol(field, colorMap);

src/Interface/Modules/Render/OsprayViewerDialog.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ namespace
287287
std::for_each(obj->data.color.begin(), obj->data.color.end(), [&](float &v) {
288288
if (!std::isnan(v))
289289
voxelRange.extend(v);
290+
//SCIRun::LOG_DEBUG(std::to_string(v));
290291
});
291292
for(int i=0;i<vertex.size();i+=3){
292293
ospcommon::vec3f v = ospcommon::vec3f(vertex[i], vertex[i+1], vertex[i+2]);

0 commit comments

Comments
 (0)