STIRA  0.1
Public Member Functions | Static Public Member Functions | List of all members
stira::common::DrawFigures Class Reference

A class to draw some simple parametric figure contours. More...

#include <DrawFigures.h>

Public Member Functions

 DrawFigures ()
 Constructor.
 
 ~DrawFigures ()
 Destructor.
 

Static Public Member Functions

static std::vector< Point< int > > BresenhamDrawLine (int startX, int startY, int endX, int endY)
 Generates vector with points on line to be drawn Algoritm used is Bresenham, see http://en.wikipedia.org/wiki/Bresenham's_line_algorithm More...
 
static std::vector< Point< int > > BresenhamDrawLine (Point< int > startPoint, Point< int > endPoint)
 Generates vector with points on line to be drawn Overloaded method with points as inputs instead of all coordinates separately. More...
 
static std::vector< Point< int > > DrawRectangle (int topLeftX, int topLeftY, int bottomRightX, int bottomRightY)
 Generates vector with points on rectangle to be drawn, edges parallel with the axes. More...
 
static bool IsInsideEllipse (double xTest, double yTest, double xCenter, double yCenter, double majorAxis, double minorAxis, double angleRadians)
 Tests if a point is inside an ellipse. More...
 
static std::vector< Point< int > > DrawRectangle (Point< int > topLeftCorner, Point< int > bottomRightCorner)
 Generates vector with points on rectangle to be drawn, edges parallel with the axes Overloaded method with points as inputs instead of all coordinates separately. More...
 
static std::vector< Point< int > > DrawRectangle (RectangularROI< int > rroi)
 Generates vector with points on rectangle to be drawn, edges parallel with the axes. More...
 
static std::vector< Point< int > > DrawCircle (Point< int > center, int radius)
 Generates vector with points on circle to be drawn Implementation from http://en.wikipedia.org/wiki/Midpoint_circle_algorithm More...
 

Detailed Description

A class to draw some simple parametric figure contours.

In fact, this class generates a vector with the pixels that belong to the contour of the figure.

The corresponding tests are located in subproject image/testDrawing

Member Function Documentation

std::vector< Point< int > > stira::common::DrawFigures::BresenhamDrawLine ( int  startX,
int  startY,
int  endX,
int  endY 
)
static

Generates vector with points on line to be drawn Algoritm used is Bresenham, see http://en.wikipedia.org/wiki/Bresenham's_line_algorithm

Parameters
startXx coordinate of start point
startYy coordinate of start point
endXx coordinate of end point
endYy coordinate of end point

Referenced by stira::common::Curve::ConnectToCurve(), stira::imagetools::DrawImageTools::DrawLine(), and stira::imagetools::GridGenerator::GenerateBars().

std::vector< Point< int > > stira::common::DrawFigures::BresenhamDrawLine ( Point< int >  startPoint,
Point< int >  endPoint 
)
static

Generates vector with points on line to be drawn Overloaded method with points as inputs instead of all coordinates separately.

Parameters
startPointstart point of the line
endPointend point of the line

References stira::common::Point< T >::x, and stira::common::Point< T >::y.

std::vector< Point< int > > stira::common::DrawFigures::DrawCircle ( Point< int >  center,
int  radius 
)
static

Generates vector with points on circle to be drawn Implementation from http://en.wikipedia.org/wiki/Midpoint_circle_algorithm

Parameters
centercenter of circle to be drawn
radiusradius of circle to be drawn

References stira::common::Point< T >::x, and stira::common::Point< T >::y.

std::vector< Point< int > > stira::common::DrawFigures::DrawRectangle ( int  topLeftX,
int  topLeftY,
int  bottomRightX,
int  bottomRightY 
)
static

Generates vector with points on rectangle to be drawn, edges parallel with the axes.

Parameters
topLeftXx coordinate of top left corner
topLeftYy coordinate of top left corner
bottomRightXx coordinate of bottom right corner
bottomRightYy coordinate of bottom right corner
std::vector< Point< int > > stira::common::DrawFigures::DrawRectangle ( Point< int >  topLeftCorner,
Point< int >  bottomRightCorner 
)
static

Generates vector with points on rectangle to be drawn, edges parallel with the axes Overloaded method with points as inputs instead of all coordinates separately.

Parameters
topLeftCornertop left corner of the rectangle
bottomRightCornerbottom right corner of the rectangle

References stira::common::Point< T >::x, and stira::common::Point< T >::y.

std::vector< Point< int > > stira::common::DrawFigures::DrawRectangle ( RectangularROI< int >  rroi)
static

Generates vector with points on rectangle to be drawn, edges parallel with the axes.

Parameters
rroirectangle to be drawn

References stira::common::RectangularROI< T >::GetBottomRightCorner(), stira::common::RectangularROI< T >::GetTopLeftCorner(), stira::common::Point< T >::x, and stira::common::Point< T >::y.

bool stira::common::DrawFigures::IsInsideEllipse ( double  xTest,
double  yTest,
double  xCenter,
double  yCenter,
double  majorAxis,
double  minorAxis,
double  angleRadians 
)
static

Tests if a point is inside an ellipse.

Parameters
xTestx coordinate of point to test
yTesty coordinate of point to test
xCenterx coordinate of ellipse center
yCentery coordinate of ellipse center
majorAxisellipse major axis
minorAxisellipse minor axis
angleRadiansrotation angle of the ellipse

The documentation for this class was generated from the following files: