Commit 46bca8c3 authored by Yumin Yuan's avatar Yumin Yuan Committed by Marcus D. Hanwell

ENH: Added API to change plot matrix settings

Change-Id: I4d2376ff57273488c28774c839cee059c334d7ec
parent 03e46679
......@@ -138,6 +138,15 @@ void vtkChartMatrix::SetSize(const vtkVector2i &size)
}
}
void vtkChartMatrix::SetBorders(int left, int bottom, int right, int top)
{
this->Borders[vtkAxis::LEFT] = left;
this->Borders[vtkAxis::BOTTOM] = bottom;
this->Borders[vtkAxis::RIGHT] = right;
this->Borders[vtkAxis::TOP] = top;
this->LayoutIsDirty = true;
}
void vtkChartMatrix::SetGutter(const vtkVector2f &gutter)
{
this->Gutter = gutter;
......
......@@ -60,6 +60,17 @@ public:
// Set the gutter that should be left between the charts in the matrix.
virtual void SetGutter(const vtkVector2f& gutter);
// Description:
// Set/get the borders of the chart matrix (space in pixels around each chart).
virtual void SetBorders(int left, int bottom, int right, int top);
virtual void GetBorders(int borders[4])
{
for(int i=0;i<4;i++)
{
borders[i]=this->Borders[i];
}
}
// Description:
// Get the gutter that should be left between the charts in the matrix.
virtual vtkVector2f GetGutter() const { return this->Gutter; }
......
This diff is collapsed.
......@@ -25,7 +25,8 @@
#include "vtkChartMatrix.h"
#include "vtkSmartPointer.h" // For ivars
#include "vtkNew.h" // For ivars
#include "vtkNew.h" // For ivars
#include "vtkColor.h" // For member function return
class vtkStringArray;
class vtkTable;
......@@ -154,6 +155,114 @@ public:
int GetPlotType(const vtkVector2i &pos);
int GetPlotType(int row, int column);
// Description:
// Set the scatter plot title's font.
void SetScatterPlotTitleFont(const char* family, int pointSize, bool bold, bool italic);
const char* GetScatterPlotTitleFontFamily();
int GetScatterPlotTitleFontSize();
int GetScatterPlotTitleFontBold();
int GetScatterPlotTitleFontItalic();
// Description:
// Set the scatter plot title's color.
void SetScatterPlotTitleColor(double red, double green, double blue);
vtkColor4f GetScatterPlotTitleColor();
// Description:
// Set the scatter plot title.
void SetScatterPlotTitle(const char* title);
const char* GetScatterPlotTitle();
// Description:
// Set the scatter plot's title alignment.
void SetScatterPlotTitleAlignment(int alignment);
int GetScatterPlotTitleAlignment();
// Description:
// Sets whether or not the grid for the given axis is visible given a plot type, which refers to
// vtkScatterPlotMatrix::{SCATTERPLOT, HISTOGRAM, ACTIVEPLOT}.
void SetGridVisibility(int plotType, bool visible);
bool GetGridVisibility(int plotType);
// Description:
// Sets the background color for the chart given a plot type, which refers to
// vtkScatterPlotMatrix::{SCATTERPLOT, HISTOGRAM, ACTIVEPLOT}.
void SetBackgroundColor(int plotType,
double red, double green, double blue, double alpha=0.0);
vtkColor4f GetBackgroundColor(int plotType);
// Description:
// Sets the color for the axes given a plot type, which refers to
// vtkScatterPlotMatrix::{SCATTERPLOT, HISTOGRAM, ACTIVEPLOT}.
void SetAxisColor(int plotType, double red, double green, double blue);
vtkColor4f GetAxisColor(int plotType);
// Description:
// Sets the color for the axes given a plot type, which refers to
// vtkScatterPlotMatrix::{SCATTERPLOT, HISTOGRAM, ACTIVEPLOT}.
void SetGridColor(int plotType, double red, double green, double blue);
vtkColor4f GetGridColor(int plotType);
// Description:
// Sets whether or not the labels for the axes are visible, given a plot type, which refers to
// vtkScatterPlotMatrix::{SCATTERPLOT, HISTOGRAM, ACTIVEPLOT}.
void SetAxisLabelVisibility(int plotType, bool visible);
bool GetAxisLabelVisibility(int plotType);
// Description:
// Set the axis label font for the axes given a plot type, which refers to
// vtkScatterPlotMatrix::{SCATTERPLOT, HISTOGRAM, ACTIVEPLOT}.
void SetAxisLabelFont(int plotType, const char* family, int pointSize, bool bold,
bool italic);
const char* GetAxisLabelFontFamily(int plotType);
int GetAxisLabelFontSize(int plotType);
int GetAxisLabelFontBold(int plotType);
int GetAxisLabelFontItalic(int plotType);
// Description:
// Sets the axis label color for the axes given a plot type, which refers to
// vtkScatterPlotMatrix::{SCATTERPLOT, HISTOGRAM, ACTIVEPLOT}.
void SetAxisLabelColor(int plotType, double red, double green, double blue);
vtkColor4f GetAxisLabelColor(int plotType);
// Description:
// Sets the axis label notation for the axes given a plot type, which refers to
// vtkScatterPlotMatrix::{SCATTERPLOT, HISTOGRAM, ACTIVEPLOT}.
void SetAxisLabelNotation(int plotType, int notation);
int GetAxisLabelNotation(int plotType);
// Description:
// Sets the axis label precision for the axes given a plot type, which refers to
// vtkScatterPlotMatrix::{SCATTERPLOT, HISTOGRAM, ACTIVEPLOT}.
void SetAxisLabelPrecision(int plotType, int precision);
int GetAxisLabelPrecision(int plotType);
// Description:
// Set chart's tooltip notation and precision, given a plot type, which refers to
// vtkScatterPlotMatrix::{SCATTERPLOT, HISTOGRAM, ACTIVEPLOT}.
void SetTooltipNotation(int plotType, int notation);
void SetTooltipPrecision(int plotType, int precision);
int GetTooltipNotation(int plotType);
int GetTooltipPrecision(int plotType);
// Description:
// Set the scatter plot selected row/column charts' background color.
void SetScatterPlotSelectedRowColumnColor(double red, double green, double blue, double alpha);
vtkColor4f GetScatterPlotSelectedRowColumnColor();
// Description:
// Set the scatter plot selected active chart background color.
void SetScatterPlotSelectedActiveColor(double red, double green, double blue, double alpha);
vtkColor4f GetScatterPlotSelectedActiveColor();
// Description:
// Convenient method to update all the chart settings
void UpdateSettings();
// Description:
// Update charts based on settings given the plot type
void UpdateChartSettings(int plotType);
protected:
vtkScatterPlotMatrix();
~vtkScatterPlotMatrix();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment