Gnash  0.8.11dev
Public Member Functions | Static Public Attributes | Friends | List of all members
gnash::SWFRect Class Reference

Rectangle class, see swf defined rectangle record. More...

#include <SWFRect.h>

Public Member Functions

constexpr SWFRect ()
 Construct a NULL rectangle. More...
 
constexpr SWFRect (int xmin, int ymin, int xmax, int ymax)
 Construct a rectangle with given coordinates. More...
 
bool is_null () const
 returns true if this is a NULL rectangle More...
 
void set_null ()
 set the rectangle to the NULL value More...
 
bool is_world () const
 TODO: deprecate this 'world' concept. More...
 
void set_world ()
 set the rectangle to the WORLD value More...
 
std::int32_t width () const
 Return width of this rectangle in TWIPS. More...
 
std::int32_t height () const
 Return height of this rectangle in TWIPS. More...
 
std::int32_t get_x_min () const
 Get the x coordinate of the left-up corner. More...
 
std::int32_t get_x_max () const
 Get the x coordinate of the right-down corner. More...
 
std::int32_t get_y_min () const
 Get the y coordinate of the left-up corner. More...
 
std::int32_t get_y_max () const
 Get the y coordinate of the right-down corner. More...
 
bool point_test (std::int32_t x, std::int32_t y) const
 Return true if the given point is inside this SWFRect. More...
 
void set_to_point (std::int32_t x, std::int32_t y)
 Set ourself to bound the given point. More...
 
void set_to_rect (std::int32_t x1, std::int32_t y1, std::int32_t x2, std::int32_t y2)
 
void expand_to_point (std::int32_t x, std::int32_t y)
 Expand this rectangle to enclose the given point. More...
 
void enclose_transformed_rect (const SWFMatrix &m, const SWFRect &r)
 
void expand_to_circle (std::int32_t x, std::int32_t y, std::int32_t radius)
 Expand this rectangle to enclose the given circle. More...
 
DSOEXPORT void expand_to_transformed_rect (const SWFMatrix &m, const SWFRect &r)
 
DSOEXPORT void expand_to_rect (const SWFRect &r)
 Makes union of the given and the current SWFRect. More...
 
void set_lerp (const SWFRect &a, const SWFRect &b, float t)
 
void clamp (geometry::Point2d &p) const
 Make sure that the given point falls in this rectangle, modifying it's coordinates if needed. More...
 
geometry::Range2d< std::int32_t > getRange () const
 Construct and return a Range2d object. More...
 
std::string toString () const
 Return a string representation for this rectangle. More...
 

Static Public Attributes

static constexpr std::int32_t rectNull = 0x80000000
 
static constexpr std::int32_t rectMax = 0x7fffffff
 

Friends

std::ostream & operator<< (std::ostream &os, const SWFRect &SWFRect)
 Ouput operator. More...
 

Detailed Description

Rectangle class, see swf defined rectangle record.

Constructor & Destructor Documentation

§ SWFRect() [1/2]

constexpr gnash::SWFRect::SWFRect ( )
inline

Construct a NULL rectangle.

§ SWFRect() [2/2]

constexpr gnash::SWFRect::SWFRect ( int  xmin,
int  ymin,
int  xmax,
int  ymax 
)
inline

Construct a rectangle with given coordinates.

Member Function Documentation

§ clamp()

void gnash::SWFRect::clamp ( geometry::Point2d p) const

Make sure that the given point falls in this rectangle, modifying it's coordinates if needed.

References is_null(), gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.

Referenced by gnash::movie_root::setDragState().

§ enclose_transformed_rect()

void gnash::SWFRect::enclose_transformed_rect ( const SWFMatrix m,
const SWFRect r 
)

Set ourself to bound a rectangle that has been transformed by m. This is an axial bound of an oriented (and/or sheared, scaled, etc) box.

References get_x_max(), get_x_min(), get_y_max(), get_y_min(), set_to_point(), gnash::SWFMatrix::transform(), gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.

Referenced by gnash::movie_root::setDragState().

§ expand_to_circle()

void gnash::SWFRect::expand_to_circle ( std::int32_t  x,
std::int32_t  y,
std::int32_t  radius 
)
inline

§ expand_to_point()

void gnash::SWFRect::expand_to_point ( std::int32_t  x,
std::int32_t  y 
)
inline

Expand this rectangle to enclose the given point.

References gnash::key::m, and gnash::key::r.

Referenced by gnash::Path::expandBounds(), gnash::TextField::setFont(), and gnash::SWFMatrix::transform().

§ expand_to_rect()

void gnash::SWFRect::expand_to_rect ( const SWFRect r)

§ expand_to_transformed_rect()

void gnash::SWFRect::expand_to_transformed_rect ( const SWFMatrix m,
const SWFRect r 
)

§ get_x_max()

std::int32_t gnash::SWFRect::get_x_max ( ) const
inline

§ get_x_min()

std::int32_t gnash::SWFRect::get_x_min ( ) const
inline

§ get_y_max()

std::int32_t gnash::SWFRect::get_y_max ( ) const
inline

§ get_y_min()

std::int32_t gnash::SWFRect::get_y_min ( ) const
inline

§ getRange()

geometry::Range2d<std::int32_t> gnash::SWFRect::getRange ( ) const
inline

§ height()

std::int32_t gnash::SWFRect::height ( ) const
inline

§ is_null()

bool gnash::SWFRect::is_null ( ) const
inline

§ is_world()

bool gnash::SWFRect::is_world ( ) const
inline

§ point_test()

bool gnash::SWFRect::point_test ( std::int32_t  x,
std::int32_t  y 
) const
inline

§ set_lerp()

void gnash::SWFRect::set_lerp ( const SWFRect a,
const SWFRect b,
float  t 
)

§ set_null()

void gnash::SWFRect::set_null ( )
inline

set the rectangle to the NULL value

§ set_to_point()

void gnash::SWFRect::set_to_point ( std::int32_t  x,
std::int32_t  y 
)
inline

Set ourself to bound the given point.

References x, and y.

Referenced by enclose_transformed_rect(), expand_to_transformed_rect(), and gnash::SWFMatrix::transform().

§ set_to_rect()

void gnash::SWFRect::set_to_rect ( std::int32_t  x1,
std::int32_t  y1,
std::int32_t  x2,
std::int32_t  y2 
)
inline

§ set_world()

void gnash::SWFRect::set_world ( )
inline

set the rectangle to the WORLD value

Referenced by gnash::Gui::setInvalidatedRegions().

§ toString()

std::string gnash::SWFRect::toString ( ) const

Return a string representation for this rectangle.

§ width()

std::int32_t gnash::SWFRect::width ( ) const
inline

Friends And Related Function Documentation

§ operator<<

std::ostream& operator<< ( std::ostream &  os,
const SWFRect SWFRect 
)
friend

Ouput operator.

Member Data Documentation

§ rectMax

constexpr std::int32_t gnash::SWFRect::rectMax = 0x7fffffff
static

§ rectNull

constexpr std::int32_t gnash::SWFRect::rectNull = 0x80000000
static

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