Skip to content

Commit e75d7c6

Browse files
committed
Respect cluster re-coloring on startup
1 parent f59ab58 commit e75d7c6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/ScatterplotWidget.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ ScatterplotWidget::ScatterplotWidget(mv::plugin::ViewPlugin* parentPlugin) :
4141
_pointRenderer(this),
4242
_isInitialized(false),
4343
_renderMode(SCATTERPLOT),
44+
_scalarEffect(PointEffect::Color),
4445
_backgroundColor(255, 255, 255, 255),
4546
_coloringMode(ColoringMode::Constant),
4647
_dataRectangleAction(this, "Data rectangle"),
@@ -334,7 +335,7 @@ void ScatterplotWidget::setScalars(const std::vector<float>& scalars)
334335
void ScatterplotWidget::setColors(const std::vector<Vector3f>& colors)
335336
{
336337
_pointRenderer.setColors(colors);
337-
_pointRenderer.setScalarEffect(None);
338+
setScalarEffect(PointEffect::None);
338339

339340
update();
340341
}
@@ -367,6 +368,7 @@ void ScatterplotWidget::setPointScaling(mv::gui::PointScaling scalingMode)
367368
void ScatterplotWidget::setScalarEffect(PointEffect effect)
368369
{
369370
_pointRenderer.setScalarEffect(effect);
371+
_scalarEffect = effect;
370372

371373
update();
372374
}
@@ -621,7 +623,7 @@ void ScatterplotWidget::initializeGL()
621623
_densityRenderer.init();
622624

623625
// Set a default color map for both renderers
624-
_pointRenderer.setScalarEffect(PointEffect::Color);
626+
_pointRenderer.setScalarEffect(_scalarEffect);
625627

626628
_pointRenderer.setPointScaling(Absolute);
627629
_pointRenderer.setSelectionOutlineColor(Vector3f(1, 0, 0));

src/ScatterplotWidget.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ private slots:
296296
private:
297297
bool _isInitialized; /** Boolean determining whether the widget it properly initialized or not */
298298
RenderMode _renderMode; /** Current render mode */
299+
PointEffect _scalarEffect; /** Current scalar effect */
299300
QColor _backgroundColor; /** Background color */
300301
ColoringMode _coloringMode; /** Type of point/density coloring */
301302
DecimalRectangleAction _dataRectangleAction; /** Rectangle action for the bounds of the loaded data */

0 commit comments

Comments
 (0)