feisty meow concerns codebase  2.140
geometric::rectangle_warper< numeric_type > Class Template Reference

#include <warper.h>

Public Types

enum  origin_vertex { BOTTOM_LEFT , TOP_LEFT , TOP_RIGHT , BOTTOM_RIGHT }
 describes where a rectangle's origin is located on the rectangle. More...
 
enum  vertical_component { RW_BOTTOM , RW_TOP }
 
enum  horizontal_component { RW_LEFT , RW_RIGHT }
 

Public Member Functions

 rectangle_warper (const rectangle< numeric_type > &system_1, const rectangle< numeric_type > &system_2, origin_vertex system_1_origin=BOTTOM_LEFT, origin_vertex system_2_origin=BOTTOM_LEFT)
 constructs a warper given the two reference systems. More...
 
 ~rectangle_warper ()
 
point< numeric_type > to_system_1 (const point< numeric_type > &in_system_2) const
 Converts from the second system into the first. More...
 
point< numeric_type > to_system_2 (const point< numeric_type > &in_system_1) const
 Converts from the first system into the second. More...
 
rectangle< numeric_type > to_system_1 (const rectangle< numeric_type > &in_system_2) const
 flips a rectangle from the second system into the first. More...
 
rectangle< numeric_type > to_system_2 (const rectangle< numeric_type > &in_system_1) const
 flips a rectangle from the first system into the second. More...
 
rectangle< numeric_type > system_1 () const
 
rectangle< numeric_type > system_2 () const
 
origin_vertex origin_1 () const
 
origin_vertex origin_2 () const
 
void system_1 (const rectangle< numeric_type > &to_set, origin_vertex origin_corner=BOTTOM_LEFT)
 
void system_2 (const rectangle< numeric_type > &to_set, origin_vertex origin_corner=BOTTOM_LEFT)
 
basis::astring text_form () const
 Prints out the two systems held in the rectangle_warper. More...
 
basis::astring vertex_name (origin_vertex v) const
 Prints out the name of the vertex location. More...
 
void separate_vertical (origin_vertex v, vertical_component &to_set) const
 
void separate_horizontal (origin_vertex v, horizontal_component &to_set) const
 separates out a component of the placement of the vertex. More...
 

Detailed Description

template<class numeric_type>
class geometric::rectangle_warper< numeric_type >

Definition at line 35 of file warper.h.

Member Enumeration Documentation

◆ horizontal_component

template<class numeric_type >
enum geometric::rectangle_warper::horizontal_component
Enumerator
RW_LEFT 
RW_RIGHT 

Definition at line 94 of file warper.h.

◆ origin_vertex

template<class numeric_type >
enum geometric::rectangle_warper::origin_vertex

describes where a rectangle's origin is located on the rectangle.

our model is to consider the first vertex point of the rectangle as its origin and the second vertex point (diagonally opposite the first point) as its extent. since it may make sense for that first vertex point to be located at any one of the vertices of the rectangle (as in windowing coordinate system conversions), the enumeration below allows any one of the rectangle's vertices to be chosen as its origin.

Enumerator
BOTTOM_LEFT 
TOP_LEFT 
TOP_RIGHT 
BOTTOM_RIGHT 

Definition at line 45 of file warper.h.

◆ vertical_component

template<class numeric_type >
enum geometric::rectangle_warper::vertical_component
Enumerator
RW_BOTTOM 
RW_TOP 

Definition at line 93 of file warper.h.

Constructor & Destructor Documentation

◆ rectangle_warper()

template<class numeric_type >
geometric::rectangle_warper< numeric_type >::rectangle_warper ( const rectangle< numeric_type > &  system_1,
const rectangle< numeric_type > &  system_2,
origin_vertex  system_1_origin = BOTTOM_LEFT,
origin_vertex  system_2_origin = BOTTOM_LEFT 
)

constructs a warper given the two reference systems.

constructs a warper where the first rectangular system is in "system_1", the second system is in "system_2" and the respective origins for these systems are in "system_1_origin" and "system_2_origin".

Definition at line 128 of file warper.h.

◆ ~rectangle_warper()

template<class numeric_type >
geometric::rectangle_warper< numeric_type >::~rectangle_warper

Definition at line 136 of file warper.h.

Member Function Documentation

◆ origin_1()

template<class numeric_type >
origin_vertex geometric::rectangle_warper< numeric_type >::origin_1 ( ) const
inline

Definition at line 79 of file warper.h.

◆ origin_2()

template<class numeric_type >
origin_vertex geometric::rectangle_warper< numeric_type >::origin_2 ( ) const
inline

Definition at line 80 of file warper.h.

◆ separate_horizontal()

template<class numeric_type >
void geometric::rectangle_warper< numeric_type >::separate_horizontal ( origin_vertex  v,
horizontal_component to_set 
) const

separates out a component of the placement of the vertex.

Definition at line 183 of file warper.h.

◆ separate_vertical()

template<class numeric_type >
void geometric::rectangle_warper< numeric_type >::separate_vertical ( origin_vertex  v,
vertical_component to_set 
) const

Definition at line 175 of file warper.h.

◆ system_1() [1/2]

template<class numeric_type >
rectangle<numeric_type> geometric::rectangle_warper< numeric_type >::system_1 ( ) const
inline

Definition at line 77 of file warper.h.

◆ system_1() [2/2]

template<class numeric_type >
void geometric::rectangle_warper< numeric_type >::system_1 ( const rectangle< numeric_type > &  to_set,
origin_vertex  origin_corner = BOTTOM_LEFT 
)

Definition at line 139 of file warper.h.

◆ system_2() [1/2]

template<class numeric_type >
rectangle<numeric_type> geometric::rectangle_warper< numeric_type >::system_2 ( ) const
inline

Definition at line 78 of file warper.h.

◆ system_2() [2/2]

template<class numeric_type >
void geometric::rectangle_warper< numeric_type >::system_2 ( const rectangle< numeric_type > &  to_set,
origin_vertex  origin_corner = BOTTOM_LEFT 
)

Definition at line 144 of file warper.h.

◆ text_form()

template<class numeric_type >
basis::astring geometric::rectangle_warper< numeric_type >::text_form

Prints out the two systems held in the rectangle_warper.

Definition at line 279 of file warper.h.

References basis::astring::text_form().

◆ to_system_1() [1/2]

template<class numeric_type >
point< numeric_type > geometric::rectangle_warper< numeric_type >::to_system_1 ( const point< numeric_type > &  in_system_2) const

Converts from the second system into the first.

This returns a point that is measured in the first frame of reference when given a point "in_system_2" that is measured in the second frame of reference.

Definition at line 149 of file warper.h.

◆ to_system_1() [2/2]

template<class numeric_type >
rectangle< numeric_type > geometric::rectangle_warper< numeric_type >::to_system_1 ( const rectangle< numeric_type > &  in_system_2) const

flips a rectangle from the second system into the first.

Definition at line 159 of file warper.h.

◆ to_system_2() [1/2]

template<class numeric_type >
point< numeric_type > geometric::rectangle_warper< numeric_type >::to_system_2 ( const point< numeric_type > &  in_system_1) const

Converts from the first system into the second.

This returns a point that is measured in the second frame of reference when given a point "in_system_1" that is measured in the first frame of reference.

Definition at line 154 of file warper.h.

◆ to_system_2() [2/2]

template<class numeric_type >
rectangle< numeric_type > geometric::rectangle_warper< numeric_type >::to_system_2 ( const rectangle< numeric_type > &  in_system_1) const

flips a rectangle from the first system into the second.

Definition at line 167 of file warper.h.

◆ vertex_name()

template<class numeric_type >
basis::astring geometric::rectangle_warper< numeric_type >::vertex_name ( origin_vertex  v) const

Prints out the name of the vertex location.

Definition at line 266 of file warper.h.


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