Commit fd6f500c authored by Marcus D. Hanwell's avatar Marcus D. Hanwell Committed by Code Review
Browse files

Merge topic 'fix-polygon-header-test' into master

3e2a6210 Add copy constructor and assignment operator to vtkContextPolygon
c510312d Fix header test for vtkContextPolygon
parents ad2aa6f0 3e2a6210
......@@ -28,7 +28,7 @@
#include "vtkChart.h"
#include "vtkSmartPointer.h" // For SP ivars
#include "vtkVector.h" // For vtkVector2f in struct
#include "vtkContextPolygon.h"
#include "vtkContextPolygon.h" // For vtkContextPolygon
class vtkPlot;
class vtkAxis;
......
......@@ -32,6 +32,13 @@ vtkContextPolygon::vtkContextPolygon()
{
}
//-----------------------------------------------------------------------------
vtkContextPolygon::vtkContextPolygon(const vtkContextPolygon &polygon)
: d(new vtkContextPolygonPrivate)
{
d->points = polygon.d->points;
}
//-----------------------------------------------------------------------------
vtkContextPolygon::~vtkContextPolygon()
{
......@@ -78,3 +85,14 @@ vtkContextPolygon vtkContextPolygon::Transformed(vtkTransform2D *transform) cons
d->points.size());
return transformed;
}
//-----------------------------------------------------------------------------
vtkContextPolygon& vtkContextPolygon::operator=(const vtkContextPolygon &other)
{
if(this != &other)
{
d->points = other.d->points;
}
return *this;
}
......@@ -17,8 +17,8 @@
#define _vtkContextPolygon_h
#include "vtkChartsCoreModule.h"
#include "vtkVector.h"
#include "vtkType.h"
#include "vtkVector.h" // For vtkVector2f
#include "vtkType.h" // For vtkIdType
class vtkTransform2D;
class vtkContextPolygonPrivate;
......@@ -30,6 +30,10 @@ public:
// Creates a new, empty polygon.
vtkContextPolygon();
// Description:
// Creates a new copy of \p polygon.
vtkContextPolygon(const vtkContextPolygon &polygon);
// Description:
// Destroys the polygon.
~vtkContextPolygon();
......@@ -58,8 +62,13 @@ public:
// Returns a new polygon with each point transformed by \p transform.
vtkContextPolygon Transformed(vtkTransform2D *transform) const;
// Description:
// Copies the values from \p other to this polygon.
vtkContextPolygon& operator=(const vtkContextPolygon &other);
private:
vtkContextPolygonPrivate* const d;
};
#endif // _vtkContextPolygon_h
// VTK-HeaderTest-Exclude: vtkContextPolygon.h
......@@ -28,7 +28,7 @@
#include "vtkContextItem.h"
#include "vtkStdString.h" // Needed to hold TooltipLabelFormat ivar
#include "vtkSmartPointer.h" // Needed to hold SP ivars
#include "vtkContextPolygon.h"
#include "vtkContextPolygon.h" // For vtkContextPolygon
class vtkVariant;
class vtkTable;
......
......@@ -31,7 +31,6 @@
#include "vtkPlot.h"
#include "vtkScalarsToColors.h" // For VTK_COLOR_MODE_DEFAULT and _MAP_SCALARS
#include "vtkStdString.h" // For color array name
#include "vtkContextPolygon.h"
class vtkContext2D;
class vtkTable;
......
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