Logo Search packages:      
Sourcecode: djvulibre version File versions

GRect Class Reference

#include <GRect.h>

Inherited by MapPiece.

List of all members.


Detailed Description

Rectangle class. Each instance of this class represents a rectangle whose sides are parallel to the axis. Such a rectangle represents all the points whose coordinates lies between well defined minimal and maximal values. Member functions can combine several rectangles by computing the intersection of rectangles ({intersect}) or the smallest rectangle enclosing two rectangles ({recthull}).

Definition at line 132 of file GRect.h.


Public Types

enum  OrientationBits { BOTTOM_UP = 0x1, MIRROR = 0x2, ROTATE90_CW = 0x4 }
enum  Orientations {
  TDLRNR = 0, BULRNR = BOTTOM_UP, TDRLNR = MIRROR, BURLNR = MIRROR|BOTTOM_UP,
  TDLRCW = ROTATE90_CW, BULRCW = ROTATE90_CW|BOTTOM_UP, TDRLCW = ROTATE90_CW|MIRROR, BURLCW = ROTATE90_CW|MIRROR|BOTTOM_UP
}

Public Member Functions

int area () const
void clear ()
int contains (const GRect &rect) const
int contains (int x, int y) const
 GRect (int xmin, int ymin, unsigned int width=0, unsigned int height=0)
 GRect ()
int height () const
int inflate (int dx, int dy)
int intersect (const GRect &rect1, const GRect &rect2)
int isempty () const
int recthull (const GRect &rect1, const GRect &rect2)
void scale (float xfactor, float yfactor)
void scale (float factor)
int translate (int dx, int dy)
int width () const

Static Public Member Functions

static int findangle (const Orientations orientation)
static Orientations rotate (const int angle, Orientations orientation)

Public Attributes

int xmax
int xmin
int ymax
int ymin

Friends

int operator!= (const GRect &r1, const GRect &r2)
int operator== (const GRect &r1, const GRect &r2)

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

Generated by  Doxygen 1.6.0   Back to index