Skip to content

Commit b45d6f7

Browse files
utkarshayachitkwrobot
authored andcommitted
Merge topic 'plot-matrix-settings'
1e3d3dc COMP: Fixed header test failure. 77b2d63 Merge branch 'master' into plot-matrix-settings df246f4 Bring in updated vtkScatterPlotMatrix API 8cfad58 Plot to use SetPlotColor (changed in VTK) a5f1397 Ported to use the modifed scatter plot API in VTK 41fba29 ENH: the plot matrix view settings should mostly works now aff155f ENH: Added Getting api in paraview to retrieve plot matrix settings--WIP 77caca5 ENH: Adding settings dialog for plot matrix view
2 parents 20b3c9e + 1e3d3dc commit b45d6f7

16 files changed

+3170
-42
lines changed

ParaViewCore/ClientServerCore/vtkPVPlotMatrixRepresentation.cxx

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ vtkPVPlotMatrixRepresentation::vtkPVPlotMatrixRepresentation()
5252
this->ActivePlotColor[i] = 0;
5353
this->HistogramColor[i] = 0;
5454
}
55+
this->ScatterPlotColor[3] = 255;
56+
this->ActivePlotColor[3] = 255;
57+
this->HistogramColor[3] = 255;
5558

5659
this->ScatterPlotMarkerStyle = vtkPlotPoints::CIRCLE;
5760
this->ActivePlotMarkerStyle = vtkPlotPoints::CIRCLE;
@@ -78,19 +81,20 @@ bool vtkPVPlotMatrixRepresentation::AddToView(vtkView *view)
7881
plotMatrix->SetVisible(true);
7982

8083
// set chart properties
81-
plotMatrix->SetColor(this->ScatterPlotColor[0],
82-
this->ScatterPlotColor[1],
83-
this->ScatterPlotColor[2]);
84-
plotMatrix->SetHistogramColor(this->HistogramColor[0],
85-
this->HistogramColor[1],
86-
this->HistogramColor[2]);
87-
plotMatrix->SetActivePlotColor(this->ActivePlotColor[0],
88-
this->ActivePlotColor[1],
89-
this->ActivePlotColor[2]);
90-
plotMatrix->SetMarkerStyle(this->ScatterPlotMarkerStyle);
91-
plotMatrix->SetActivePlotMarkerStyle(this->ActivePlotMarkerStyle);
92-
plotMatrix->SetMarkerSize(this->ScatterPlotMarkerSize);
93-
plotMatrix->SetActivePlotMarkerSize(this->ActivePlotMarkerSize);
84+
plotMatrix->SetPlotColor(vtkScatterPlotMatrix::SCATTERPLOT,
85+
this->ScatterPlotColor);
86+
plotMatrix->SetPlotColor(vtkScatterPlotMatrix::HISTOGRAM,
87+
this->HistogramColor);
88+
plotMatrix->SetPlotColor(vtkScatterPlotMatrix::ACTIVEPLOT,
89+
this->ActivePlotColor);
90+
plotMatrix->SetPlotMarkerStyle(vtkScatterPlotMatrix::SCATTERPLOT,
91+
this->ScatterPlotMarkerStyle);
92+
plotMatrix->SetPlotMarkerStyle(vtkScatterPlotMatrix::ACTIVEPLOT,
93+
this->ActivePlotMarkerStyle);
94+
plotMatrix->SetPlotMarkerSize(vtkScatterPlotMatrix::SCATTERPLOT,
95+
this->ScatterPlotMarkerSize);
96+
plotMatrix->SetPlotMarkerSize(vtkScatterPlotMatrix::ACTIVEPLOT,
97+
this->ActivePlotMarkerSize);
9498
}
9599

96100
return true;
@@ -161,48 +165,48 @@ void vtkPVPlotMatrixRepresentation::SetSeriesLabel(const char *name, const char
161165
//----------------------------------------------------------------------------
162166
void vtkPVPlotMatrixRepresentation::SetColor(double r, double g, double b)
163167
{
168+
this->ScatterPlotColor = vtkColor4ub(static_cast<unsigned char>(r * 255),
169+
static_cast<unsigned char>(g * 255),
170+
static_cast<unsigned char>(b * 255));
164171
if(vtkScatterPlotMatrix *plotMatrix = this->GetPlotMatrix())
165172
{
166-
plotMatrix->SetColor(r, g, b);
173+
plotMatrix->SetPlotColor(vtkScatterPlotMatrix::SCATTERPLOT,
174+
this->ScatterPlotColor);
167175
}
168-
169-
this->ScatterPlotColor[0] = r;
170-
this->ScatterPlotColor[1] = g;
171-
this->ScatterPlotColor[2] = b;
172176
}
173177

174178
//----------------------------------------------------------------------------
175179
void vtkPVPlotMatrixRepresentation::SetActivePlotColor(double r, double g, double b)
176180
{
181+
this->ActivePlotColor = vtkColor4ub(static_cast<unsigned char>(r * 255),
182+
static_cast<unsigned char>(g * 255),
183+
static_cast<unsigned char>(b * 255));
177184
if(vtkScatterPlotMatrix *plotMatrix = this->GetPlotMatrix())
178185
{
179-
plotMatrix->SetActivePlotColor(r, g, b);
186+
plotMatrix->SetPlotColor(vtkScatterPlotMatrix::ACTIVEPLOT,
187+
this->ActivePlotColor);
180188
}
181-
182-
this->ActivePlotColor[0] = r;
183-
this->ActivePlotColor[1] = g;
184-
this->ActivePlotColor[2] = b;
185189
}
186190

187191
//----------------------------------------------------------------------------
188192
void vtkPVPlotMatrixRepresentation::SetHistogramColor(double r, double g, double b)
189193
{
194+
this->HistogramColor = vtkColor4ub(static_cast<unsigned char>(r * 255),
195+
static_cast<unsigned char>(g * 255),
196+
static_cast<unsigned char>(b * 255));
190197
if(vtkScatterPlotMatrix *plotMatrix = this->GetPlotMatrix())
191198
{
192-
plotMatrix->SetHistogramColor(r, g, b);
199+
plotMatrix->SetPlotColor(vtkScatterPlotMatrix::HISTOGRAM,
200+
this->HistogramColor);
193201
}
194-
195-
this->HistogramColor[0] = r;
196-
this->HistogramColor[1] = g;
197-
this->HistogramColor[2] = b;
198202
}
199203

200204
//----------------------------------------------------------------------------
201205
void vtkPVPlotMatrixRepresentation::SetMarkerStyle(int style)
202206
{
203207
if(vtkScatterPlotMatrix *plotMatrix = this->GetPlotMatrix())
204208
{
205-
plotMatrix->SetMarkerStyle(style);
209+
plotMatrix->SetPlotMarkerStyle(vtkScatterPlotMatrix::SCATTERPLOT, style);
206210
}
207211

208212
this->ScatterPlotMarkerStyle = style;
@@ -213,7 +217,7 @@ void vtkPVPlotMatrixRepresentation::SetActivePlotMarkerStyle(int style)
213217
{
214218
if(vtkScatterPlotMatrix *plotMatrix = this->GetPlotMatrix())
215219
{
216-
plotMatrix->SetActivePlotMarkerStyle(style);
220+
plotMatrix->SetPlotMarkerStyle(vtkScatterPlotMatrix::ACTIVEPLOT, style);
217221
}
218222

219223
this->ActivePlotMarkerStyle = style;
@@ -224,7 +228,7 @@ void vtkPVPlotMatrixRepresentation::SetMarkerSize(double size)
224228
{
225229
if(vtkScatterPlotMatrix *plotMatrix = this->GetPlotMatrix())
226230
{
227-
plotMatrix->SetMarkerSize(size);
231+
plotMatrix->SetPlotMarkerSize(vtkScatterPlotMatrix::SCATTERPLOT, size);
228232
}
229233

230234
this->ScatterPlotMarkerSize = size;
@@ -235,7 +239,7 @@ void vtkPVPlotMatrixRepresentation::SetActivePlotMarkerSize(double size)
235239
{
236240
if(vtkScatterPlotMatrix *plotMatrix = this->GetPlotMatrix())
237241
{
238-
plotMatrix->SetActivePlotMarkerSize(size);
242+
plotMatrix->SetPlotMarkerSize(vtkScatterPlotMatrix::ACTIVEPLOT, size);
239243
}
240244

241245
this->ActivePlotMarkerSize = size;

ParaViewCore/ClientServerCore/vtkPVPlotMatrixRepresentation.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3333
#define _vtkPVPlotMatrixRepresentation_h
3434

3535
#include "vtkChartRepresentation.h"
36+
#include "vtkColor.h" // for ivars
3637

3738
class vtkScatterPlotMatrix;
3839

@@ -107,10 +108,9 @@ class VTK_EXPORT vtkPVPlotMatrixRepresentation : public vtkChartRepresentation
107108
vtkPVPlotMatrixRepresentation(const vtkPVPlotMatrixRepresentation&); // Not implemented
108109
void operator=(const vtkPVPlotMatrixRepresentation&); // Not implemented
109110

110-
private:
111-
double ActivePlotColor[3];
112-
double ScatterPlotColor[3];
113-
double HistogramColor[3];
111+
vtkColor4ub ActivePlotColor;
112+
vtkColor4ub ScatterPlotColor;
113+
vtkColor4ub HistogramColor;
114114
int ScatterPlotMarkerStyle;
115115
int ActivePlotMarkerStyle;
116116
double ScatterPlotMarkerSize;

0 commit comments

Comments
 (0)