Gnash  0.8.10
Public Member Functions | Static Public Attributes | Friends
gnash::SWFRect Class Reference

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

#include <SWFRect.h>

List of all members.

Public Member Functions

 SWFRect ()
 Construct a NULL rectangle.
 SWFRect (int xmin, int ymin, int xmax, int ymax)
 Construct a rectangle with given coordinates.
bool is_null () const
 returns true if this is a NULL rectangle
void set_null ()
 set the rectangle to the NULL value
bool is_world () const
 TODO: deprecate this 'world' concept.
void set_world ()
 set the rectangle to the WORLD value
boost::int32_t width () const
 Return width of this rectangle in TWIPS.
boost::int32_t height () const
 Return height of this rectangle in TWIPS.
boost::int32_t get_x_min () const
 Get the x coordinate of the left-up corner.
boost::int32_t get_x_max () const
 Get the x coordinate of the right-down corner.
boost::int32_t get_y_min () const
 Get the y coordinate of the left-up corner.
boost::int32_t get_y_max () const
 Get the y coordinate of the right-down corner.
bool point_test (boost::int32_t x, boost::int32_t y) const
 Return true if the given point is inside this SWFRect.
void set_to_point (boost::int32_t x, boost::int32_t y)
 Set ourself to bound the given point.
void set_to_rect (boost::int32_t x1, boost::int32_t y1, boost::int32_t x2, boost::int32_t y2)
void expand_to_point (boost::int32_t x, boost::int32_t y)
 Expand this rectangle to enclose the given point.
void enclose_transformed_rect (const SWFMatrix &m, const SWFRect &r)
void expand_to_circle (boost::int32_t x, boost::int32_t y, boost::int32_t radius)
 Expand this rectangle to enclose the given circle.
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.
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.
geometry::Range2d< boost::int32_t > getRange () const
 Construct and return a Range2d object.
std::string toString () const
 Return a string representation for this rectangle.

Static Public Attributes

static const boost::int32_t rectNull = 0x80000000
static const boost::int32_t rectMax = 0x7fffffff

Friends

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

Detailed Description

Rectangle class, see swf defined rectangle record.


Constructor & Destructor Documentation

gnash::SWFRect::SWFRect ( ) [inline]

Construct a NULL rectangle.

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

Construct a rectangle with given coordinates.


Member Function Documentation

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 assert, is_null(), gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.

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_min(), get_y_min(), get_x_max(), get_y_max(), gnash::SWFMatrix::transform(), set_to_point(), gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.

void gnash::SWFRect::expand_to_circle ( boost::int32_t  x,
boost::int32_t  y,
boost::int32_t  radius 
) [inline]

Expand this rectangle to enclose the given circle.

References assert, and is_null().

Referenced by gnash::DynamicShape::lineTo(), gnash::DynamicShape::curveTo(), and gnash::Path::expandBounds().

void gnash::SWFRect::expand_to_point ( boost::int32_t  x,
boost::int32_t  y 
) [inline]

Expand this rectangle to enclose the given point.

References is_null(), and set_to_point().

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

void gnash::SWFRect::expand_to_rect ( const SWFRect r)
void gnash::SWFRect::expand_to_transformed_rect ( const SWFMatrix m,
const SWFRect r 
)
boost::int32_t gnash::SWFRect::get_x_max ( ) const [inline]
boost::int32_t gnash::SWFRect::get_x_min ( ) const [inline]
boost::int32_t gnash::SWFRect::get_y_max ( ) const [inline]
boost::int32_t gnash::SWFRect::get_y_min ( ) const [inline]
geometry::Range2d<boost::int32_t> gnash::SWFRect::getRange ( ) const [inline]
boost::int32_t gnash::SWFRect::height ( ) const [inline]
bool gnash::SWFRect::is_null ( ) const [inline]
bool gnash::SWFRect::is_world ( ) const [inline]
bool gnash::SWFRect::point_test ( boost::int32_t  x,
boost::int32_t  y 
) const [inline]
void gnash::SWFRect::set_lerp ( const SWFRect a,
const SWFRect b,
float  t 
)
void gnash::SWFRect::set_null ( ) [inline]

set the rectangle to the NULL value

References rectNull.

Referenced by gnash::SWF::ShapeRecord::clear(), and gnash::SWF::ShapeRecord::read().

void gnash::SWFRect::set_to_point ( boost::int32_t  x,
boost::int32_t  y 
) [inline]

Set ourself to bound the given point.

References x, and y.

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

void gnash::SWFRect::set_to_rect ( boost::int32_t  x1,
boost::int32_t  y1,
boost::int32_t  x2,
boost::int32_t  y2 
) [inline]
void gnash::SWFRect::set_world ( ) [inline]

set the rectangle to the WORLD value

References rectMax.

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

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

Return a string representation for this rectangle.

Referenced by gnash::SWF::ShapeRecord::read().

boost::int32_t gnash::SWFRect::width ( ) const [inline]

Friends And Related Function Documentation

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

Ouput operator.


Member Data Documentation

const boost::int32_t gnash::SWFRect::rectMax = 0x7fffffff [static]

Referenced by is_world(), and set_world().

const boost::int32_t gnash::SWFRect::rectNull = 0x80000000 [static]

Referenced by is_null(), and set_null().


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