3#ifndef TestAxisActor2DInternal_h
4#define TestAxisActor2DInternal_h
6#include "vtkTestUtilities.h"
21VTK_ABI_NAMESPACE_BEGIN
39 if (nbOfLabels !=
static_cast<int>(strings.size()))
42 "Wrong number of labels strings: has " << nbOfLabels <<
" instead of " << strings.size());
45 for (
int index = 0; index < nbOfLabels; index++)
48 std::string label = mapper->
GetInput();
49 if (label != strings[index])
51 vtkErrorMacro(
"Wrong label: <" << label <<
"> instead of <" << strings[index] <<
">");
69 ticks->SetPoints(points);
77 expectedTicks->SetPoints(expectedPoints);
78 return vtkTestUtilities::ComparePoints(ticks, expectedTicks);
90 sphereMapper->SetInputConnection(sphereSource->GetOutputPort());
92 sphereActor->SetMapper(sphereMapper);
95 renderer->AddActor(axis);
96 renderer->AddActor(sphereActor);
97 renderer->GetActiveCamera()->ParallelProjectionOn();
static constexpr int END_POINT
bool CompareTicksPosition(vtkAxisActor2D *axis, vtkRenderWindow *window, vtkPoints *expectedPoints)
Compare the provided vtkPoints with TickPositions from axis.
static constexpr int START_POINT
void SetupPipeline(vtkAxisActor2D *axis, vtkRenderWindow *window)
Mock vtkAxisActor2D to access inner member for comparison.
bool CompareLabelMapperString(const std::vector< std::string > &strings)
static vtkAxisActor2DMock * New()
Create an axis with tick marks and labels.
virtual void SetPoint1(double x[2])
Specify the position of the first point defining the axis.
vtkPoints * GetTickPositions()
Return the positions of ticks along the axis.
vtkTextMapper ** LabelMappers
virtual void SetPoint2(double x[2])
Specify the position of the second point defining the axis.
Allocate and hold a VTK object.
represent and manipulate 3D points
vtkIdType GetNumberOfPoints() const
Return number of points in array.
create a window for renderers to draw into
virtual void AddRenderer(vtkRenderer *)
Add a renderer to the list of renderers.
void Render() override
Ask each renderer owned by this RenderWindow to render its image and synchronize this process.
virtual char * GetInput()
The input text string to the mapper.
virtual void SetSize(int width, int height)
Set the size (width and height) of the rendering window in screen coordinates (in pixels).
#define VTK_STANDARD_NEW_BODY(thisClass)