@@ -251,11 +251,17 @@ void ShowFieldGlyphs::renderVectors(
251251 ColorRGB node_color;
252252
253253 if (fld->basis_order () < 0 || (fld->basis_order () == 0 && mesh->dimensionality () != 0 ) || state.get (RenderState::USE_DEFAULT_COLOR))
254+ {
254255 colorScheme = GeometryObject::COLOR_UNIFORM;
256+ }
255257 else if (state.get (RenderState::USE_COLORMAP))
258+ {
256259 colorScheme = GeometryObject::COLOR_MAP;
260+ }
257261 else
262+ {
258263 colorScheme = GeometryObject::COLOR_IN_SITU;
264+ }
259265
260266 mesh->synchronize (Mesh::EDGES_E);
261267
@@ -363,7 +369,7 @@ void ShowFieldGlyphs::renderVectors(
363369 }
364370 if (colorScheme == GeometryObject::COLOR_IN_SITU)
365371 {
366- Vector colorVector = Vector ( 1 , 0 , 0 );
372+ Vector colorVector = inputVector. normal ( );
367373 node_color = ColorRGB (colorVector.x (), colorVector.y (), colorVector.z ());
368374 }
369375 }
@@ -429,11 +435,17 @@ void ShowFieldGlyphs::renderScalars(
429435 ColorRGB node_color;
430436
431437 if (fld->basis_order () < 0 || (fld->basis_order () == 0 && mesh->dimensionality () != 0 ) || state.get (RenderState::USE_DEFAULT_COLOR))
438+ {
432439 colorScheme = GeometryObject::COLOR_UNIFORM;
440+ }
433441 else if (state.get (RenderState::USE_COLORMAP))
442+ {
434443 colorScheme = GeometryObject::COLOR_MAP;
444+ }
435445 else
446+ {
436447 colorScheme = GeometryObject::COLOR_IN_SITU;
448+ }
437449
438450 mesh->synchronize (Mesh::NODES_E);
439451
@@ -483,6 +495,7 @@ void ShowFieldGlyphs::renderScalars(
483495 node_color = ColorRGB (colorVector.x (), colorVector.y (), colorVector.z ());
484496 }
485497 }
498+ // std::cout << node_color << std::endl;
486499 switch (state.mGlyphType )
487500 {
488501 case RenderState::GlyphType::POINT_GLYPH:
@@ -575,11 +588,17 @@ void ShowFieldGlyphs::renderTensors(
575588 ColorRGB node_color;
576589
577590 if (fld->basis_order () < 0 || (fld->basis_order () == 0 && mesh->dimensionality () != 0 ) || state.get (RenderState::USE_DEFAULT_COLOR))
591+ {
578592 colorScheme = GeometryObject::COLOR_UNIFORM;
593+ }
579594 else if (state.get (RenderState::USE_COLORMAP))
595+ {
580596 colorScheme = GeometryObject::COLOR_MAP;
597+ }
581598 else
599+ {
582600 colorScheme = GeometryObject::COLOR_IN_SITU;
601+ }
583602
584603 mesh->synchronize (Mesh::NODES_E);
585604
@@ -738,7 +757,7 @@ RenderState ShowFieldGlyphs::getScalarsRenderState(
738757 RenderState renState;
739758
740759 bool useColorMap = state->getValue (ShowFieldGlyphs::ScalarsColoring).toInt () == 1 ;
741- bool rgbConversion = state->getValue (ShowFieldGlyphs::VectorsColoring ).toInt () == 2 ;
760+ bool rgbConversion = state->getValue (ShowFieldGlyphs::ScalarsColoring ).toInt () == 2 ;
742761 renState.set (RenderState::USE_NORMALS, true );
743762
744763 renState.set (RenderState::IS_ON, state->getValue (ShowFieldGlyphs::ShowScalars).toBool ());
0 commit comments