KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
kjb::Rectangle_2d Class Reference

Class that represents an axis-aligned 2D rectangle. It is defined in terms of its (2D) center, its width and its height. More...

#include <gr_rectangle_2d.h>

Public Member Functions

 Rectangle_2d (const Vector &center=Vector().set(0.0, 0.0), double orientation=0.0, double width=1.0, double height=1.0)
 Constructs a Rectangle_2d. More...
 
const Vectorget_center () const
 returns the center of this rectangle. More...
 
double get_orientation () const
 Returns the orientation of this rectangle. More...
 
double get_width () const
 returns the width of this rectangle. More...
 
double get_height () const
 returns the height of this rectangle. More...
 
std::vector< Vectorget_corners () const
 Returns the corners of this rectangle. More...
 
std::vector< Vectorget_side_midpoints () const
 Returns the midpoints of the sides of this rectangle. More...
 
void set_center (const Vector &center)
 sets the center of this rectangle. More...
 
void set_orientation (double orientation)
 Sets the orientation of this rectangle. More...
 
void set_width (double width)
 sets the width of this rectangle. More...
 
void set_height (double height)
 sets the height of this rectangle. More...
 
void translate (const Vector &t)
 
void rotate (double angle)
 
void wire_render () const
 

Detailed Description

Class that represents an axis-aligned 2D rectangle. It is defined in terms of its (2D) center, its width and its height.

Constructor & Destructor Documentation

kjb::Rectangle_2d::Rectangle_2d ( const Vector center = Vector().set(0.0, 0.0),
double  orientation = 0.0,
double  width = 1.0,
double  height = 1.0 
)
inline

Constructs a Rectangle_2d.

Member Function Documentation

const Vector& kjb::Rectangle_2d::get_center ( ) const
inline

returns the center of this rectangle.

std::vector< Vector > kjb::Rectangle_2d::get_corners ( ) const

Returns the corners of this rectangle.

double kjb::Rectangle_2d::get_height ( ) const
inline

returns the height of this rectangle.

double kjb::Rectangle_2d::get_orientation ( ) const
inline

Returns the orientation of this rectangle.

std::vector< Vector > kjb::Rectangle_2d::get_side_midpoints ( ) const

Returns the midpoints of the sides of this rectangle.

double kjb::Rectangle_2d::get_width ( ) const
inline

returns the width of this rectangle.

void kjb::Rectangle_2d::rotate ( double  angle)
inline
void kjb::Rectangle_2d::set_center ( const Vector center)
inline

sets the center of this rectangle.

void kjb::Rectangle_2d::set_height ( double  height)
inline

sets the height of this rectangle.

void kjb::Rectangle_2d::set_orientation ( double  orientation)
inline

Sets the orientation of this rectangle.

void kjb::Rectangle_2d::set_width ( double  width)
inline

sets the width of this rectangle.

void kjb::Rectangle_2d::translate ( const Vector t)
inline
void kjb::Rectangle_2d::wire_render ( ) const

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