Skip to content

Commit 73cc907

Browse files
committed
Setup Tensors to work. #988
1 parent 9e95d61 commit 73cc907

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

src/Interface/Modules/Visualization/ShowFieldGlyphsDialog.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ void ShowFieldGlyphsDialog::checkTabs()
168168
tensorTabIndex_ = -1;
169169
}
170170
}
171+
172+
displayOptionsTabs_->setCurrentIndex(displayOptionsTabs_->count() - 1);
171173
}
172174

173175
void ShowFieldGlyphsDialog::setupScalarsTab()

src/Modules/Visualization/ShowFieldGlyphs.cc

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ void ShowFieldGlyphs::renderVectors(
250250
GeometryObject::ColorScheme colorScheme = GeometryObject::COLOR_UNIFORM;
251251
ColorRGB node_color;
252252

253-
if (fld->basis_order() < 0 || (fld->basis_order() == 0 && mesh->dimensionality() != 0) || state.get(RenderState::USE_DEFAULT_COLOR))
253+
if (fld->basis_order() < 0 || state.get(RenderState::USE_DEFAULT_COLOR))
254254
{
255255
colorScheme = GeometryObject::COLOR_UNIFORM;
256256
}
@@ -280,12 +280,17 @@ void ShowFieldGlyphs::renderVectors(
280280
double secondaryScalar = 0.25; // to be replaced with data from secondary field.
281281
if (scale < 0) scale = 1.0;
282282
if (resolution < 3) resolution = 5;
283-
283+
284284
GlyphGeom glyphs;
285285
auto facade(field->mesh()->getFacade());
286286
// Render linear data
287287
if (finfo.is_linear())
288288
{
289+
if ((fld->basis_order() == 0 && mesh->dimensionality() != 0))
290+
{
291+
colorScheme = GeometryObject::COLOR_UNIFORM;
292+
}
293+
289294
for (const auto& node : facade->nodes())
290295
{
291296
checkForInterruption();
@@ -359,7 +364,7 @@ void ShowFieldGlyphs::renderVectors(
359364
v = inputVector * scale;
360365
double radius = v.length() * secondaryScalar;
361366
Point p1 = cell.center();
362-
Point p2 = p1 + (v * scale);
367+
Point p2 = p1 + v;
363368
if (colorScheme != GeometryObject::COLOR_UNIFORM)
364369
{
365370
if (colorScheme == GeometryObject::COLOR_MAP)
@@ -434,7 +439,7 @@ void ShowFieldGlyphs::renderScalars(
434439
GeometryObject::ColorScheme colorScheme = GeometryObject::COLOR_UNIFORM;
435440
ColorRGB node_color;
436441

437-
if (fld->basis_order() < 0 || (fld->basis_order() == 0 && mesh->dimensionality() != 0) || state.get(RenderState::USE_DEFAULT_COLOR))
442+
if (fld->basis_order() < 0 || state.get(RenderState::USE_DEFAULT_COLOR))
438443
{
439444
colorScheme = GeometryObject::COLOR_UNIFORM;
440445
}
@@ -474,6 +479,11 @@ void ShowFieldGlyphs::renderScalars(
474479
// Render linear data
475480
if (finfo.is_linear())
476481
{
482+
if ((fld->basis_order() == 0 && mesh->dimensionality() != 0))
483+
{
484+
colorScheme = GeometryObject::COLOR_UNIFORM;
485+
}
486+
477487
for (const auto& node : facade->nodes())
478488
{
479489
checkForInterruption();
@@ -495,7 +505,6 @@ void ShowFieldGlyphs::renderScalars(
495505
node_color = ColorRGB(colorVector.x(), colorVector.y(), colorVector.z());
496506
}
497507
}
498-
//std::cout << node_color << std::endl;
499508
switch (state.mGlyphType)
500509
{
501510
case RenderState::GlyphType::POINT_GLYPH:

0 commit comments

Comments
 (0)