Commit 2e6fb551 authored by David Gobbi's avatar David Gobbi

Deprecate vtkVector::X() in favor of vtkVector::GetX() etc.

The name "X" should be reserved for the name of the property,
with "GetX" as the name of the getter for that property.

Change-Id: Ib99b5ab1240b9de903396c8b9c01285acfb46b4f
parent 5766dc1d
......@@ -1221,12 +1221,12 @@ double vtkAxis::CalculateNiceMinMax(double &min, double &max)
if (this->Position == vtkAxis::LEFT || this->Position == vtkAxis::RIGHT
|| this->Position == vtkAxis::PARALLEL)
{
pixelRange = this->Position2.Y() - this->Position1.Y();
pixelRange = this->Position2.GetY() - this->Position1.GetY();
tickPixelSpacing = 30;
}
else
{
pixelRange = this->Position2.X() - this->Position1.X();
pixelRange = this->Position2.GetX() - this->Position1.GetX();
tickPixelSpacing = 45;
}
......
......@@ -229,7 +229,7 @@ bool vtkChart::CalculatePlotTransform(vtkAxis *x, vtkAxis *y,
void vtkChart::SetBottomBorder(int border)
{
this->Point1[1] = border >= 0 ? border : 0;
this->Point1[1] += static_cast<int>(this->Size.Y());
this->Point1[1] += static_cast<int>(this->Size.GetY());
}
//-----------------------------------------------------------------------------
......@@ -238,14 +238,14 @@ void vtkChart::SetTopBorder(int border)
this->Point2[1] = border >=0 ?
this->Geometry[1] - border :
this->Geometry[1];
this->Point2[1] += static_cast<int>(this->Size.Y());
this->Point2[1] += static_cast<int>(this->Size.GetY());
}
//-----------------------------------------------------------------------------
void vtkChart::SetLeftBorder(int border)
{
this->Point1[0] = border >= 0 ? border : 0;
this->Point1[0] += static_cast<int>(this->Size.X());
this->Point1[0] += static_cast<int>(this->Size.GetX());
}
//-----------------------------------------------------------------------------
......@@ -254,7 +254,7 @@ void vtkChart::SetRightBorder(int border)
this->Point2[0] = border >=0 ?
this->Geometry[0] - border :
this->Geometry[0];
this->Point2[0] += static_cast<int>(this->Size.X());
this->Point2[0] += static_cast<int>(this->Size.GetX());
}
//-----------------------------------------------------------------------------
......@@ -269,8 +269,8 @@ void vtkChart::SetBorders(int left, int bottom, int right, int top)
void vtkChart::SetSize(const vtkRectf &rect)
{
this->Size = rect;
this->Geometry[0] = static_cast<int>(rect.Width());
this->Geometry[1] = static_cast<int>(rect.Height());
this->Geometry[0] = static_cast<int>(rect.GetWidth());
this->Geometry[1] = static_cast<int>(rect.GetHeight());
}
vtkRectf vtkChart::GetSize()
......
......@@ -124,8 +124,8 @@ bool vtkChartLegend::Paint(vtkContext2D *painter)
// Now draw a box for the legend.
painter->ApplyPen(this->Pen.GetPointer());
painter->ApplyBrush(this->Brush.GetPointer());
painter->DrawRect(this->Rect.X(), this->Rect.Y(),
this->Rect.Width(), this->Rect.Height());
painter->DrawRect(this->Rect.GetX(), this->Rect.GetY(),
this->Rect.GetWidth(), this->Rect.GetHeight());
painter->ApplyTextProp(this->LabelProperties.GetPointer());
......@@ -135,9 +135,9 @@ bool vtkChartLegend::Paint(vtkContext2D *painter)
painter->ComputeStringBounds("The", stringBounds->GetData());
float baseHeight = stringBounds[1].GetY();
vtkVector2f pos(this->Rect.X() + this->Padding + this->SymbolWidth,
this->Rect.Y() + this->Rect.Height() - this->Padding - floor(height));
vtkRectf rect(this->Rect.X() + this->Padding, pos.Y(),
vtkVector2f pos(this->Rect.GetX() + this->Padding + this->SymbolWidth,
this->Rect.GetY() + this->Rect.GetHeight() - this->Padding - floor(height));
vtkRectf rect(this->Rect.GetX() + this->Padding, pos.GetY(),
this->SymbolWidth-3, ceil(height));
// Draw all of the legend labels and marks
......@@ -155,12 +155,12 @@ bool vtkChartLegend::Paint(vtkContext2D *painter)
vtkStdString testString = labels->GetValue(l);
testString += "T";
painter->ComputeStringBounds(testString, stringBounds->GetData());
painter->DrawString(pos.X(), rect.Y() + (baseHeight-stringBounds[1].Y()),
painter->DrawString(pos.GetX(), rect.GetY() + (baseHeight-stringBounds[1].GetY()),
labels->GetValue(l));
// Paint the legend mark and increment out y value.
this->Storage->ActivePlots[i]->PaintLegend(painter, rect, l);
rect.SetY(rect.Y() - height - this->Padding);
rect.SetY(rect.GetY() - height - this->Padding);
}
}
......@@ -191,9 +191,9 @@ vtkRectf vtkChartLegend::GetBoundingRect(vtkContext2D *painter)
{
painter->ComputeStringBounds(labels->GetValue(l),
stringBounds->GetData());
if (stringBounds[1].X() > maxWidth)
if (stringBounds[1].GetX() > maxWidth)
{
maxWidth = stringBounds[1].X();
maxWidth = stringBounds[1].GetX();
}
}
}
......@@ -206,8 +206,8 @@ vtkRectf vtkChartLegend::GetBoundingRect(vtkContext2D *painter)
}
// Default point placement is bottom left.
this->Rect = vtkRectf(floor(this->Storage->Point.X()),
floor(this->Storage->Point.Y()),
this->Rect = vtkRectf(floor(this->Storage->Point.GetX()),
floor(this->Storage->Point.GetY()),
ceil(maxWidth + 2 * this->Padding + this->SymbolWidth),
ceil((numLabels * (height + this->Padding)) + this->Padding));
......@@ -281,10 +281,10 @@ vtkChart* vtkChartLegend::GetChart()
//-----------------------------------------------------------------------------
bool vtkChartLegend::Hit(const vtkContextMouseEvent &mouse)
{
if (this->DragEnabled && mouse.GetScreenPos().X() > this->Rect.X() &&
mouse.GetScreenPos().X() < this->Rect.X() + this->Rect.Width() &&
mouse.GetScreenPos().Y() > this->Rect.Y() &&
mouse.GetScreenPos().Y() < this->Rect.Y() + this->Rect.Height())
if (this->DragEnabled && mouse.GetScreenPos().GetX() > this->Rect.GetX() &&
mouse.GetScreenPos().GetX() < this->Rect.GetX() + this->Rect.GetWidth() &&
mouse.GetScreenPos().GetY() > this->Rect.GetY() &&
mouse.GetScreenPos().GetY() < this->Rect.GetY() + this->Rect.GetHeight())
{
return true;
}
......
......@@ -63,53 +63,53 @@ void vtkChartMatrix::Update()
bool vtkChartMatrix::Paint(vtkContext2D *painter)
{
if (this->LayoutIsDirty ||
this->GetScene()->GetSceneWidth() != this->Private->Geometry.X() ||
this->GetScene()->GetSceneHeight() != this->Private->Geometry.Y())
this->GetScene()->GetSceneWidth() != this->Private->Geometry.GetX() ||
this->GetScene()->GetSceneHeight() != this->Private->Geometry.GetY())
{
// Update the chart element positions
this->Private->Geometry.Set(this->GetScene()->GetSceneWidth(),
this->GetScene()->GetSceneHeight());
if (this->Size.X() > 0 && this->Size.Y() > 0)
if (this->Size.GetX() > 0 && this->Size.GetY() > 0)
{
// Calculate the increments without the gutters/borders that must be left
vtkVector2f increments;
increments.SetX((this->Private->Geometry.X() - (this->Size.X() - 1) *
this->Gutter.X() - this->Borders[vtkAxis::LEFT] -
increments.SetX((this->Private->Geometry.GetX() - (this->Size.GetX() - 1) *
this->Gutter.GetX() - this->Borders[vtkAxis::LEFT] -
this->Borders[vtkAxis::RIGHT]) /
this->Size.X());
increments.SetY((this->Private->Geometry.Y() - (this->Size.Y() - 1) *
this->Gutter.Y() - this->Borders[vtkAxis::TOP] -
this->Size.GetX());
increments.SetY((this->Private->Geometry.GetY() - (this->Size.GetY() - 1) *
this->Gutter.GetY() - this->Borders[vtkAxis::TOP] -
this->Borders[vtkAxis::BOTTOM]) /
this->Size.Y());
this->Size.GetY());
float x = this->Borders[vtkAxis::LEFT];
float y = this->Borders[vtkAxis::BOTTOM];
for (int i = 0; i < this->Size.X(); ++i)
for (int i = 0; i < this->Size.GetX(); ++i)
{
if (i > 0)
{
x += increments.X() + this->Gutter.X();
x += increments.GetX() + this->Gutter.GetX();
}
for (int j = 0; j < this->Size.Y(); ++j)
for (int j = 0; j < this->Size.GetY(); ++j)
{
if (j > 0)
{
y += increments.Y() + this->Gutter.Y();
y += increments.GetY() + this->Gutter.GetY();
}
else
{
y = this->Borders[vtkAxis::BOTTOM];
}
size_t index = j * this->Size.X() + i;
size_t index = j * this->Size.GetX() + i;
if (this->Private->Charts[index])
{
vtkChart *chart = this->Private->Charts[index];
vtkVector2i &span = this->Private->Spans[index];
chart->SetSize(vtkRectf(x, y,
increments.X() * span.X() +
(span.X() - 1) * this->Gutter.X(),
increments.Y() * span.Y() +
(span.Y() - 1) * this->Gutter.Y()));
increments.GetX() * span.GetX() +
(span.GetX() - 1) * this->Gutter.GetX(),
increments.GetY() * span.GetY() +
(span.GetY() - 1) * this->Gutter.GetY()));
}
}
}
......@@ -121,19 +121,19 @@ bool vtkChartMatrix::Paint(vtkContext2D *painter)
void vtkChartMatrix::SetSize(const vtkVector2i &size)
{
if (this->Size.X() != size.X() || this->Size.Y() != size.Y())
if (this->Size.GetX() != size.GetX() || this->Size.GetY() != size.GetY())
{
this->Size = size;
if (size.X() * size.Y() < static_cast<int>(this->Private->Charts.size()))
if (size.GetX() * size.GetY() < static_cast<int>(this->Private->Charts.size()))
{
for (int i = static_cast<int>(this->Private->Charts.size() - 1);
i >= size.X() * size.Y(); --i)
i >= size.GetX() * size.GetY(); --i)
{
this->RemoveItem(this->Private->Charts[i]);
}
}
this->Private->Charts.resize(size.X() * size.Y());
this->Private->Spans.resize(size.X() * size.Y(), vtkVector2i(1, 1));
this->Private->Charts.resize(size.GetX() * size.GetY());
this->Private->Spans.resize(size.GetX() * size.GetY(), vtkVector2i(1, 1));
this->LayoutIsDirty = true;
}
}
......@@ -160,9 +160,9 @@ void vtkChartMatrix::Allocate()
bool vtkChartMatrix::SetChart(const vtkVector2i &position, vtkChart *chart)
{
if (position.X() < this->Size.X() && position.Y() < this->Size.Y())
if (position.GetX() < this->Size.GetX() && position.GetY() < this->Size.GetY())
{
size_t index = position.Y() * this->Size.X() + position.X();
size_t index = position.GetY() * this->Size.GetX() + position.GetX();
if (this->Private->Charts[index])
{
this->RemoveItem(this->Private->Charts[index]);
......@@ -180,9 +180,9 @@ bool vtkChartMatrix::SetChart(const vtkVector2i &position, vtkChart *chart)
vtkChart* vtkChartMatrix::GetChart(const vtkVector2i &position)
{
if (position.X() < this->Size.X() && position.Y() < this->Size.Y())
if (position.GetX() < this->Size.GetX() && position.GetY() < this->Size.GetY())
{
size_t index = position.Y() * this->Size.X() + position.X();
size_t index = position.GetY() * this->Size.GetX() + position.GetX();
if (this->Private->Charts[index] == NULL)
{
vtkNew<vtkChartXY> chart;
......@@ -201,14 +201,14 @@ vtkChart* vtkChartMatrix::GetChart(const vtkVector2i &position)
bool vtkChartMatrix::SetChartSpan(const vtkVector2i& position,
const vtkVector2i& span)
{
if (this->Size.X() - position.X() - span.X() < 0 ||
this->Size.Y() - position.Y() - span.Y() < 0)
if (this->Size.GetX() - position.GetX() - span.GetX() < 0 ||
this->Size.GetY() - position.GetY() - span.GetY() < 0)
{
return false;
}
else
{
this->Private->Spans[position.Y() * this->Size.X() + position.X()] = span;
this->Private->Spans[position.GetY() * this->Size.GetX() + position.GetX()] = span;
this->LayoutIsDirty = true;
return true;
}
......@@ -216,8 +216,8 @@ bool vtkChartMatrix::SetChartSpan(const vtkVector2i& position,
vtkVector2i vtkChartMatrix::GetChartSpan(const vtkVector2i& position)
{
size_t index = position.Y() * this->Size.X() + position.X();
if (position.X() < this->Size.X() && position.Y() < this->Size.Y())
size_t index = position.GetY() * this->Size.GetX() + position.GetX();
if (position.GetX() < this->Size.GetX() && position.GetY() < this->Size.GetY())
{
return this->Private->Spans[index];
}
......@@ -229,48 +229,48 @@ vtkVector2i vtkChartMatrix::GetChartSpan(const vtkVector2i& position)
vtkVector2i vtkChartMatrix::GetChartIndex(const vtkVector2f &position)
{
if (this->Size.X() > 0 && this->Size.Y() > 0)
if (this->Size.GetX() > 0 && this->Size.GetY() > 0)
{
// Calculate the increments without the gutters/borders that must be left.
vtkVector2f increments;
increments.SetX((this->Private->Geometry.X() - (this->Size.X() - 1) *
this->Gutter.X() - this->Borders[vtkAxis::LEFT] -
increments.SetX((this->Private->Geometry.GetX() - (this->Size.GetX() - 1) *
this->Gutter.GetX() - this->Borders[vtkAxis::LEFT] -
this->Borders[vtkAxis::RIGHT]) /
this->Size.X());
increments.SetY((this->Private->Geometry.Y() - (this->Size.Y() - 1) *
this->Gutter.Y() - this->Borders[vtkAxis::TOP] -
this->Size.GetX());
increments.SetY((this->Private->Geometry.GetY() - (this->Size.GetY() - 1) *
this->Gutter.GetY() - this->Borders[vtkAxis::TOP] -
this->Borders[vtkAxis::BOTTOM]) /
this->Size.Y());
this->Size.GetY());
float x = this->Borders[vtkAxis::LEFT];
float y = this->Borders[vtkAxis::BOTTOM];
for (int i = 0; i < this->Size.X(); ++i)
for (int i = 0; i < this->Size.GetX(); ++i)
{
if (i > 0)
{
x += increments.X() + this->Gutter.X();
x += increments.GetX() + this->Gutter.GetX();
}
for (int j = 0; j < this->Size.Y(); ++j)
for (int j = 0; j < this->Size.GetY(); ++j)
{
if (j > 0)
{
y += increments.Y() + this->Gutter.Y();
y += increments.GetY() + this->Gutter.GetY();
}
else
{
y = this->Borders[vtkAxis::BOTTOM];
}
size_t index = j * this->Size.X() + i;
size_t index = j * this->Size.GetX() + i;
if (this->Private->Charts[index])
{
vtkVector2i &span = this->Private->Spans[index];
// Check if the supplied location is within this charts area.
if (position.X() > x &&
position.X() < (x + increments.X() * span.X()
+ (span.X() - 1) * this->Gutter.X()) &&
position.Y() > y &&
position.Y() < (y + increments.Y() * span.Y()
+ (span.Y() - 1) * this->Gutter.Y()))
if (position.GetX() > x &&
position.GetX() < (x + increments.GetX() * span.GetX()
+ (span.GetX() - 1) * this->Gutter.GetX()) &&
position.GetY() > y &&
position.GetY() < (y + increments.GetY() * span.GetY()
+ (span.GetY() - 1) * this->Gutter.GetY()))
return vtkVector2i(i, j);
}
}
......
......@@ -348,7 +348,7 @@ void vtkChartParallelCoordinates::UpdateGeometry()
vtkVector2i geometry(this->GetScene()->GetViewWidth(),
this->GetScene()->GetViewHeight());
if (geometry.X() != this->Geometry[0] || geometry.Y() != this->Geometry[1] ||
if (geometry.GetX() != this->Geometry[0] || geometry.GetY() != this->Geometry[1] ||
!this->GeometryValid)
{
// Take up the entire window right now, this could be made configurable
......@@ -443,7 +443,7 @@ bool vtkChartParallelCoordinates::MouseMoveEvent(const vtkContextMouseEvent &mou
this->Storage->AxesSelections[this->Storage->CurrentAxis];
// Normalize the coordinates
float current = mouse.GetScenePos().Y();
float current = mouse.GetScenePos().GetY();
current -= this->Storage->Transform->GetMatrix()->GetElement(1, 2);
current /= this->Storage->Transform->GetMatrix()->GetElement(1, 1);
......@@ -468,7 +468,7 @@ bool vtkChartParallelCoordinates::MouseMoveEvent(const vtkContextMouseEvent &mou
if (this->Storage->AxisResize == 0)
{
// Move the axis in x
float deltaX = mouse.GetScenePos().X() - mouse.GetLastScenePos().X();
float deltaX = mouse.GetScenePos().GetX() - mouse.GetLastScenePos().GetX();
axis->SetPoint1(axis->GetPoint1()[0]+deltaX, axis->GetPoint1()[1]);
axis->SetPoint2(axis->GetPoint2()[0]+deltaX, axis->GetPoint2()[1]);
......@@ -495,7 +495,7 @@ bool vtkChartParallelCoordinates::MouseMoveEvent(const vtkContextMouseEvent &mou
else if (this->Storage->AxisResize == 1)
{
// Modify the bottom axis range...
float deltaY = mouse.GetScenePos().Y() - mouse.GetLastScenePos().Y();
float deltaY = mouse.GetScenePos().GetY() - mouse.GetLastScenePos().GetY();
float scale = (axis->GetPoint2()[1]-axis->GetPoint1()[1]) /
(axis->GetMaximum() - axis->GetMinimum());
axis->SetMinimum(axis->GetMinimum() - deltaY/scale);
......@@ -516,7 +516,7 @@ bool vtkChartParallelCoordinates::MouseMoveEvent(const vtkContextMouseEvent &mou
else if (this->Storage->AxisResize == 2)
{
// Modify the bottom axis range...
float deltaY = mouse.GetScenePos().Y() - mouse.GetLastScenePos().Y();
float deltaY = mouse.GetScenePos().GetY() - mouse.GetLastScenePos().GetY();
float scale = (axis->GetPoint2()[1]-axis->GetPoint1()[1]) /
(axis->GetMaximum() - axis->GetMinimum());
axis->SetMaximum(axis->GetMaximum() - deltaY/scale);
......@@ -596,14 +596,14 @@ bool vtkChartParallelCoordinates::MouseButtonPressEvent(
axis->GetPoint1()[0]+10 > mouse.GetScenePos()[0])
{
this->Storage->CurrentAxis = static_cast<int>(i);
if (mouse.GetScenePos().Y() > axis->GetPoint1()[1] &&
mouse.GetScenePos().Y() < axis->GetPoint1()[1] + 20)
if (mouse.GetScenePos().GetY() > axis->GetPoint1()[1] &&
mouse.GetScenePos().GetY() < axis->GetPoint1()[1] + 20)
{
// Resize the bottom of the axis
this->Storage->AxisResize = 1;
}
else if (mouse.GetScenePos().Y() < axis->GetPoint2()[1] &&
mouse.GetScenePos().Y() > axis->GetPoint2()[1] - 20)
else if (mouse.GetScenePos().GetY() < axis->GetPoint2()[1] &&
mouse.GetScenePos().GetY() > axis->GetPoint2()[1] - 20)
{
// Resize the top of the axis
this->Storage->AxisResize = 2;
......
......@@ -101,8 +101,8 @@ bool vtkChartPie::Paint(vtkContext2D *painter)
this->SetBorders(20, 20, 20, 20);
// Put the legend in the top corner of the chart
vtkRectf rect = this->Legend->GetBoundingRect(painter);
this->Legend->SetPoint(this->Point2[0] - rect.Width(),
this->Point2[1] - rect.Height());
this->Legend->SetPoint(this->Point2[0] - rect.GetWidth(),
this->Point2[1] - rect.GetHeight());
// Set the dimensions of the Plot
if (this->Private->Plot)
......@@ -269,7 +269,7 @@ bool vtkChartPie::LocatePointInPlots(const vtkContextMouseEvent &mouse)
{
const char *label = this->Private->Plot->GetLabel(labelIndex);
vtksys_ios::ostringstream ostr;
ostr << label << ": " << plotPos.X();
ostr << label << ": " << plotPos.GetX();
this->Tooltip->SetText(ostr.str().c_str());
this->Tooltip->SetPosition(mouse.GetScreenPos()[0] + 2,
mouse.GetScreenPos()[1] + 2);
......
......@@ -266,12 +266,12 @@ bool vtkChartXY::Paint(vtkContext2D *painter)
{
geometry = vtkVector2i(this->GetScene()->GetSceneWidth(),
this->GetScene()->GetSceneHeight());
if (geometry.X() != this->Geometry[0] || geometry.Y() != this->Geometry[1])
if (geometry.GetX() != this->Geometry[0] || geometry.GetY() != this->Geometry[1])
{
recalculateTransform = true;
this->LayoutChanged = true;
}
this->SetSize(vtkRectf(0.0, 0.0, geometry.X(), geometry.Y()));
this->SetSize(vtkRectf(0.0, 0.0, geometry.GetX(), geometry.GetY()));
}
int visiblePlots = 0;
......@@ -332,8 +332,8 @@ bool vtkChartXY::Paint(vtkContext2D *painter)
painter->GetBrush()->SetColor(255, 255, 255, 0);
painter->GetPen()->SetColor(0, 0, 0, 255);
painter->GetPen()->SetWidth(1.0);
painter->DrawRect(this->MouseBox.X(), this->MouseBox.Y(),
this->MouseBox.Width(), this->MouseBox.Height());
painter->DrawRect(this->MouseBox.GetX(), this->MouseBox.GetY(),
this->MouseBox.GetWidth(), this->MouseBox.GetHeight());
}
// Draw the selection polygon if necessary
......@@ -351,7 +351,7 @@ bool vtkChartXY::Paint(vtkContext2D *painter)
const vtkVector2f &a = polygon.GetPoint(i);
const vtkVector2f &b = polygon.GetPoint(i+1);
painter->DrawLine(a.X(), a.Y(), b.X(), b.Y());
painter->DrawLine(a.GetX(), a.GetY(), b.GetX(), b.GetY());
}
// draw a line from the end to the start
......@@ -360,7 +360,7 @@ bool vtkChartXY::Paint(vtkContext2D *painter)
const vtkVector2f &start = polygon.GetPoint(0);
const vtkVector2f &end = polygon.GetPoint(polygon.GetNumberOfPoints() - 1);
painter->DrawLine(start.X(), start.Y(), end.X(), end.Y());
painter->DrawLine(start.GetX(), start.GetY(), end.GetX(), end.GetY());
}
}
......@@ -837,35 +837,35 @@ int vtkChartXY::GetLegendBorder(vtkContext2D* painter, int axisPosition)
this->Legend->GetVerticalAlignment());
this->Legend->Update();
vtkRectf rect = this->Legend->GetBoundingRect(painter);
legendSize.Set(static_cast<int>(rect.Width()),
static_cast<int>(rect.Height()));
legendSize.Set(static_cast<int>(rect.GetWidth()),
static_cast<int>(rect.GetHeight()));
// Figure out the correct place and alignment based on the legend layout.
if (axisPosition == vtkAxis::LEFT &&
legendAlignment.X() == vtkChartLegend::LEFT)
legendAlignment.GetX() == vtkChartLegend::LEFT)
{
return legendSize.X() + padding;
return legendSize.GetX() + padding;
}
else if (axisPosition == vtkAxis::RIGHT &&
legendAlignment.X() == vtkChartLegend::RIGHT)
legendAlignment.GetX() == vtkChartLegend::RIGHT)
{
return legendSize.X() + padding;
return legendSize.GetX() + padding;
}
else if ((axisPosition == vtkAxis::TOP || axisPosition == vtkAxis::BOTTOM) &&
(legendAlignment.X() == vtkChartLegend::LEFT ||
legendAlignment.X() == vtkChartLegend::RIGHT))
(legendAlignment.GetX() == vtkChartLegend::LEFT ||
legendAlignment.GetX() == vtkChartLegend::RIGHT))
{
return 0;
}
else if (axisPosition == vtkAxis::TOP &&
legendAlignment.Y() == vtkChartLegend::TOP)
legendAlignment.GetY() == vtkChartLegend::TOP)
{
return legendSize.Y() + padding;
return legendSize.GetY() + padding;
}
else if (axisPosition == vtkAxis::BOTTOM &&
legendAlignment.Y() == vtkChartLegend::BOTTOM)
legendAlignment.GetY() == vtkChartLegend::BOTTOM)
{
return legendSize.Y() + padding;
return legendSize.GetY() + padding;
}
else
{
......@@ -897,20 +897,20 @@ void vtkChartXY::SetLegendPosition(const vtkRectf& rect)
break;
case vtkChartLegend::CENTER:
pos.SetX(((this->Point2[0] - this->Point1[0]) / 2.0)
- rect.Width() / 2.0 + this->Point1[0]);
- rect.GetWidth() / 2.0 + this->Point1[0]);
break;
case vtkChartLegend::RIGHT:
default:
pos.SetX(this->Point2[0] - rect.Width());
pos.SetX(this->Point2[0] - rect.GetWidth());
}
switch (this->Legend->GetVerticalAlignment())
{
case vtkChartLegend::TOP:
pos.SetY(this->Point2[1] - rect.Height());
pos.SetY(this->Point2[1] - rect.GetHeight());
break;
case vtkChartLegend::CENTER:
pos.SetY((this->Point2[1] - this->Point1[1]) / 2.0
- rect.Height() / 2.0 + this->Point1[1]);
- rect.GetHeight() / 2.0 + this->Point1[1]);
break;
case vtkChartLegend::BOTTOM:
default:
......@@ -920,48 +920,48 @@ void vtkChartXY::SetLegendPosition(const vtkRectf& rect)
else
{
// Non-inline legends.
if (legendAlignment.X() == vtkChartLegend::LEFT)
if (legendAlignment.GetX() == vtkChartLegend::LEFT)
{
pos.SetX(this->Point1[0] - this->ChartPrivate->Borders[vtkAxis::LEFT]
+ padding);
}
else if (legendAlignment.X() == vtkChartLegend::RIGHT)
else if (legendAlignment.GetX() == vtkChartLegend::RIGHT)
{
pos.SetX(this->Point2[0] + this->ChartPrivate->Borders[vtkAxis::RIGHT]
- rect.Width() - padding);
- rect.GetWidth() - padding);
}
else if (legendAlignment.X() == vtkChartLegend::CENTER)
else if (legendAlignment.GetX() == vtkChartLegend::CENTER)
{
pos.SetX(((this->Point2[0] - this->Point1[0]) / 2.0)