Public Member Functions | List of all members
RightRectangle Class Reference

A rectangle aligned with the primary axis (x and y) More...

#include <right_rectangle.hpp>

Inheritance diagram for RightRectangle:
Inheritance graph
[legend]
Collaboration diagram for RightRectangle:
Collaboration graph
[legend]

Public Member Functions

 RightRectangle (const Vector2D &lower_left, const Vector2D &upper_right)
 Class constructor. More...
 
 RightRectangle (const pair< Vector2D, Vector2D > &ll_ur)
 Class constructor. More...
 
bool operator() (const Vector2D &point) const
 Returns true is a point is inside the shape, false otherwise. More...
 
- Public Member Functions inherited from Shape2D
virtual ~Shape2D (void)
 virtual destructor
 

Detailed Description

A rectangle aligned with the primary axis (x and y)

Definition at line 14 of file right_rectangle.hpp.

Constructor & Destructor Documentation

◆ RightRectangle() [1/2]

RightRectangle::RightRectangle ( const Vector2D lower_left,
const Vector2D upper_right 
)

Class constructor.

Parameters
lower_leftVertex with lowest values of x and y
upper_rightVertex with highest values of x and y

Definition at line 3 of file right_rectangle.cpp.

◆ RightRectangle() [2/2]

RightRectangle::RightRectangle ( const pair< Vector2D, Vector2D > &  ll_ur)
explicit

Class constructor.

Parameters
ll_urPair of points (first: lower left, second: upper right)

Definition at line 12 of file right_rectangle.cpp.

Member Function Documentation

◆ operator()()

bool RightRectangle::operator() ( const Vector2D r) const
virtual

Returns true is a point is inside the shape, false otherwise.

Parameters
rPoint in 2d space
Returns
True if r is inside the shape

Implements Shape2D.

Definition at line 30 of file right_rectangle.cpp.


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