Commit a73eea84 authored by Brian Helba's avatar Brian Helba Committed by Marcus D. Hanwell
Browse files

STYLE: Changes to vtkPlotBar and TestBarGraph

vtkPlotBar:
Added documentation to Offset accessor/mutator functions.
Converted Width accessor/mutators to VTK macro.

TestBarGraph:
Correct header comments to use correct file name.
Cleanup variable names and comments.

Change-Id: Ifa99f578da78955465c66d29a7e547fb5c88b61b

Conflicts:

	Charts/Testing/Cxx/TestBarGraph.cxx
parent 546d6c7a
/*=========================================================================
Program: Visualization Toolkit
Module: TestLinePlot.cxx
Module: TestBarGraph.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
......@@ -30,9 +30,12 @@
// Monthly circulation data
static int data_2008[] = {10822, 10941, 9979, 10370, 9460, 11228, 15093, 12231, 10160, 9816, 9384, 7892};
static int data_2009[] = {9058, 9474, 9979, 9408, 8900, 11569, 14688, 12231, 10294, 9585, 8957, 8590};
static int data_2010[] = {9058, 10941, 9979, 10270, 8900, 11228, 14688, 12231, 10160, 9585, 9384, 8590};
static int data_2008[] = {10822, 10941, 9979, 10370, 9460, 11228,
15093, 12231, 10160, 9816, 9384, 7892};
static int data_2009[] = {9058, 9474, 9979, 9408, 8900, 11569,
14688, 12231, 10294, 9585, 8957, 8590};
static int data_2010[] = {9058, 10941, 9979, 10270, 8900, 11228,
14688, 12231, 10160, 9585, 9384, 8590};
//----------------------------------------------------------------------------
int TestBarGraph(int , char * [])
......@@ -72,20 +75,20 @@ int TestBarGraph(int , char * [])
table->SetValue(i,3,data_2010[i]);
}
// Add multiple line plots, setting the colors etc
vtkPlot *line = 0;
// Add multiple bar plots, setting the colors etc
vtkPlot *plot = 0;
line = chart->AddPlot(vtkChart::BAR);
line->SetInput(table, 0, 1);
line->SetColor(0, 255, 0, 255);
plot = chart->AddPlot(vtkChart::BAR);
plot->SetInput(table.GetPointer(), 0, 1);
plot->SetColor(0, 255, 0, 255);
line = chart->AddPlot(vtkChart::BAR);
line->SetInput(table, 0, 2);
line->SetColor(255, 0, 0, 255);
plot = chart->AddPlot(vtkChart::BAR);
plot->SetInput(table.GetPointer(), 0, 2);
plot->SetColor(255, 0, 0, 255);
line = chart->AddPlot(vtkChart::BAR);
line->SetInput(table, 0, 3);
line->SetColor(0, 0, 255, 255);
plot = chart->AddPlot(vtkChart::BAR);
plot->SetInput(table.GetPointer(), 0, 3);
plot->SetColor(0, 0, 255, 255);
//Finally render the scene and compare the image to a reference image
view->GetRenderWindow()->SetMultiSamples(0);
......
......@@ -487,18 +487,6 @@ void vtkPlotBar::SetOrientation(int orientation)
this->Orientation = orientation;
}
//-----------------------------------------------------------------------------
void vtkPlotBar::SetWidth(float width)
{
this->Width = width;
}
//-----------------------------------------------------------------------------
float vtkPlotBar::GetWidth()
{
return this->Width;
}
//-----------------------------------------------------------------------------
void vtkPlotBar::SetColor(unsigned char r, unsigned char g, unsigned char b,
unsigned char a)
......
......@@ -71,12 +71,17 @@ public:
// Description:
// Set the width of the line.
virtual void SetWidth(float width);
vtkSetMacro(Width, float);
// Description:
// Get the width of the line.
virtual float GetWidth();
vtkGetMacro(Width, float);
// Description:
// Set/get the horizontal offset of the bars.
// Positive values move the bars leftward.
// For HORIZONTAL orientation, offsets bars vertically,
// with a positive value moving bars downward.
vtkSetMacro(Offset, float);
vtkGetMacro(Offset, float);
......
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