Skip to content

Commit daeee7f

Browse files
committed
ShowField critical fixes. Closes #859
1 parent 48a6f47 commit daeee7f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/Modules/Visualization/ShowField.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void ShowFieldModule::execute()
9999
if (needToExecute())
100100
{
101101
std::ostringstream ostr;
102-
ostr << get_id() << "_" << this;
102+
ostr << get_id() << "_" << field.get();
103103
GeometryHandle geom = buildGeometryObject(field, colorMap, get_state(), ostr.str());
104104
sendOutput(SceneGraph, geom);
105105
}
@@ -1664,6 +1664,12 @@ void ShowFieldModule::renderEdges(
16641664
for (auto a : indices)
16651665
iboBuffer->write(a);
16661666

1667+
if (colorScheme == GeometryObject::COLOR_UNIFORM && !state.get(RenderState::USE_CYLINDER))
1668+
{
1669+
ColorRGB dft = state.defaultColor;
1670+
uniforms.emplace_back("uColor", glm::vec4(dft.r(), dft.g(), dft.b(), 1.0f));
1671+
}
1672+
16671673
for (size_t i = 0; i < points.size(); i++) {
16681674
// Write first point on line
16691675
vboBuffer->write(static_cast<float>(points.at(i).x()));
@@ -1677,12 +1683,7 @@ void ShowFieldModule::renderEdges(
16771683
}
16781684
if (colorScheme == GeometryObject::COLOR_MAP)
16791685
vboBuffer->write(static_cast<float>(colors.at(i).r()));
1680-
else if (colorScheme == GeometryObject::COLOR_UNIFORM &&
1681-
!state.get(RenderState::USE_CYLINDER) ){
1682-
ColorRGB dft = state.defaultColor;
1683-
uniforms.push_back(GeometryObject::SpireSubPass::Uniform("uColor",
1684-
glm::vec4(dft.r(), dft.g(), dft.b(), 1.0f)));
1685-
} else {
1686+
else {
16861687
// Writes uint8_t out to the VBO. A total of 4 bytes.
16871688
vboBuffer->write(COLOR_FTOB(colors.at(i).r()));
16881689
vboBuffer->write(COLOR_FTOB(colors.at(i).g()));

0 commit comments

Comments
 (0)