CVB++ 14.0
Area2D Class Referencefinal

Structure that represents an area of interest in the image. More...

`#include <cvb/area_2d.hpp>`

## Public Member Functions

Area2D () noexcept=default
Default constructor for an empty area. More...

Area2D (Point2D< double > p0, Point2D< double > p1, Point2D< double > p2) noexcept
Constructor for an area. More...

Area2D (Rect< double > rect, AffineMatrix2D affineMatrix) noexcept
Creates an area from the given rectangle using a transformation. More...

Area2D (double x0, double y0, double x1, double y1, double x2, double y2) noexcept
Constructor for Area2D. More...

Area2D (Rect< double > rect) noexcept
Create an area from the given rectangle. More...

Constructor for Area2D. More...

Point2D< double > P0 () const noexcept
Gets P0 of the area (top left corner). More...

void SetP0 (Point2D< double > p0) noexcept
Sets P0 of the area (top left corner). More...

Point2D< double > P1 () const noexcept
Gets P1 of the area (lower left corner). More...

void SetP1 (Point2D< double > p1) noexcept
Sets P1 of the area (lower left corner). More...

Point2D< double > P2 () const noexcept
Gets P2 of the area (top right corner). More...

void SetP2 (Point2D< double > p2) noexcept
Sets P2 of the area (top right corner). More...

Point2D< double > P3 () const noexcept
Gets the calculated P3 of the area (lower right corner). More...

Rect< double > BoundingRectangle () const noexcept
Gets the bounding box of this area. More...

Size2D< double > Size () const noexcept
Size (width and height) of the area of interest. More...

double Area () const noexcept
Size (in pixels) of the area of interest. More...

void Transform (Matrix2D matrix) noexcept
Transform this Area2D using a matrix. More...

void Transform (AffineMatrix2D affineMatrix) noexcept
Transform this Area2D using a AffineMatrix2D. More...

void SwapOrientation () noexcept
Let the vertices P1 and P2 swap their place. More...

CoordinateSystemType CoordinateSystem () const noexcept
Indicates the coordinate system, in which this object is being measured (when used as an area of interest). More...

bool operator== (const Area2D &area) const noexcept
Compares to an other area. More...

bool operator!= (const Area2D &area) const noexcept
Compares to an other area. More...

## Detailed Description

Structure that represents an area of interest in the image.

The pixels of this type are always specified in image coordinates.

Examples
Minos/QmlMinos, and ShapeFinder2/QtShapeFinder2.

## ◆ Area2D() [1/6]

 Area2D ( )
defaultnoexcept

Default constructor for an empty area.

Exceptions
 Does not throw any exception.

## ◆ Area2D() [2/6]

 Area2D ( Point2D< double > p0, Point2D< double > p1, Point2D< double > p2 )
inlinenoexcept

Constructor for an area.

Parameters
 [in] p0 P0 (top left corner of the area). [in] p1 P1 (top right corner of the area). [in] p2 P2 (bottom left corner of the area).
Exceptions
 Does not throw any exception.

## ◆ Area2D() [3/6]

 Area2D ( Rect< double > rect, AffineMatrix2D affineMatrix )
inlinenoexcept

Creates an area from the given rectangle using a transformation.

Parameters
 [in] rect Rectangle to convert to image coordinates via the matrix. [in] affineMatrix Affine matrix to transform pixel coordinates to image.
Exceptions
 Does not throw any exception.

## ◆ Area2D() [4/6]

 Area2D ( double x0, double y0, double x1, double y1, double x2, double y2 )
inlinenoexcept

Constructor for Area2D.

Parameters
 [in] x0 X component of P0. [in] y0 Y component of P0. [in] x1 X component of P1. [in] y1 Y component of P1. [in] x2 X component of P2. [in] y2 Y component of P2.
Exceptions
 Does not throw any exception.

## ◆ Area2D() [5/6]

 Area2D ( Rect< double > rect )
inlinenoexcept

Create an area from the given rectangle.

Parameters
 [in] rect Rectangle to create the Area2D from.
Exceptions
 Does not throw any exception.

## ◆ Area2D() [6/6]

inlinenoexcept

Constructor for Area2D.

Parameters
Exceptions
 Does not throw any exception.

## ◆ Area()

 double Area ( ) const
inlinenoexcept

Size (in pixels) of the area of interest.

Returns
The size in pixels.
Exceptions
 Does not throw any exception.

As the area is a parallelogram the area (in pixels) is not simply "width * height".

## ◆ BoundingRectangle()

 Rect< double > BoundingRectangle ( ) const
inlinenoexcept

Gets the bounding box of this area.

Returns
The bounding rectangle of this area.
Exceptions
 Does not throw any exception.

## ◆ CoordinateSystem()

 CoordinateSystemType CoordinateSystem ( ) const
inlinenoexcept

Indicates the coordinate system, in which this object is being measured (when used as an area of interest).

Returns
The coordinate system type.
Exceptions
 Does not throw any exception.

## ◆ operator!=()

 bool operator!= ( const Area2D & area ) const
inlinenoexcept

Compares to an other area.

Parameters
 [in] area Other area.
Returns
True if not equal, otherwise false.
Exceptions
 Does not throw any exception.

## ◆ operator==()

 bool operator== ( const Area2D & area ) const
inlinenoexcept

Compares to an other area.

Parameters
 [in] area Other area.
Returns
True if equal, otherwise false.
Exceptions
 Does not throw any exception.

## ◆ P0()

 Point2D< double > P0 ( ) const
inlinenoexcept

Gets P0 of the area (top left corner).

Returns
The point.
Exceptions
 Does not throw any exception.

## ◆ P1()

 Point2D< double > P1 ( ) const
inlinenoexcept

Gets P1 of the area (lower left corner).

Returns
The point.
Exceptions
 Does not throw any exception.

## ◆ P2()

 Point2D< double > P2 ( ) const
inlinenoexcept

Gets P2 of the area (top right corner).

Returns
The point.
Exceptions
 Does not throw any exception.

## ◆ P3()

 Point2D< double > P3 ( ) const
inlinenoexcept

Gets the calculated P3 of the area (lower right corner).

Returns
The point.
Exceptions
 Does not throw any exception.

## ◆ SetP0()

 void SetP0 ( Point2D< double > p0 )
inlinenoexcept

Sets P0 of the area (top left corner).

Parameters
 [in] p0 The point.
Exceptions
 Does not throw any exception.

## ◆ SetP1()

 void SetP1 ( Point2D< double > p1 )
inlinenoexcept

Sets P1 of the area (lower left corner).

Parameters
 [in] p1 The point.
Exceptions
 Does not throw any exception.

## ◆ SetP2()

 void SetP2 ( Point2D< double > p2 )
inlinenoexcept

Sets P2 of the area (top right corner).

Parameters
 [in] p2 The point.
Exceptions
 Does not throw any exception.

## ◆ Size()

 Size2D< double > Size ( ) const
inlinenoexcept

Size (width and height) of the area of interest.

Returns
The size.
Exceptions
 Does not throw any exception.

## ◆ SwapOrientation()

 void SwapOrientation ( )
inlinenoexcept

Let the vertices P1 and P2 swap their place.

Exceptions
 Does not throw any exception.

Effectively altering the scan direction of the AOI without changing the area covered by the AOI.

## ◆ Transform() [1/2]

 void Transform ( AffineMatrix2D affineMatrix )
inlinenoexcept

Transform this Area2D using a AffineMatrix2D.

Parameters
 [in] affineMatrix Matrix to transform this area with.
Exceptions
 Does not throw any exception.

## ◆ Transform() [2/2]

 void Transform ( Matrix2D matrix )
inlinenoexcept

Transform this Area2D using a matrix.

Parameters
 [in] matrix Matrix to transform this area with.
Exceptions
 Does not throw any exception.