Logo Search packages:      
Sourcecode: djvulibre version File versions

GMapPoly Class Reference

#include <GMapAreas.h>

Inheritance diagram for GMapPoly:

GMapArea GPEnabled

List of all members.

Detailed Description

Implements polygonal map areas. The only supported types of border are NO_BORDER#, XOR_BORDER# and SOLID_BORDER#. Its contents can not be highlighted either. It's worth mentioning here that despite its name the polygon may be open, which basically makes it a broken line. This very specific mode is used by the hyperlink editor when creating the polygonal hyperlink.

Definition at line 348 of file GMapAreas.h.

Public Types

enum  BorderType {
enum  MapAreaType { UNKNOWN, RECT, OVAL, POLY }
enum  Special_Hilite_Color { NO_HILITE = 0xFFFFFFFF, XOR_HILITE = 0xFF000000 }

Public Member Functions

int add_vertex (int x, int y)
 Adds a new vertex and returns number of vertices in the polygon.
char const *const check_data (void)
 Checks validity of the polygon.
char const *const check_object (void)
void close_poly ()
 Closes the polygon if it is not closed.
bool does_side_cross_rect (const GRect &grect, int side)
 Returns 1 if side side# crosses the specified rectangle rect#.
GRect get_bound_rect (void) const
 Returns the hyperlink bounding rectangle.
void get_coords (GList< int > &CoordList) const
 Virtual function generating a list of defining coordinates.
virtual GP< GMapAreaget_copy (void) const
 Returns a copy of the polygon.
int get_count (void) const
virtual MapAreaType const get_shape_type (void) const
 Returns MapPoly.
int get_xmax (void) const
int get_xmin (void) const
 Returns xmin of the bounding rectangle.
virtual GUTF8String get_xmltag (const int height) const
int get_ymax (void) const
int get_ymin (void) const
 Returns ymin of the bounding rectangle.
bool is_point_inside (int x, int y) const
 Returns 1 if the given point is inside the hyperlink area.
virtual void map (GRectMapper &mapper)
 Virtual function maps polygon from one area to another using mapper.
void move (int dx, int dy)
void move_vertex (int i, int x, int y)
 Moves vertex i# to position (x#, y#).
void optimize_data (void)
 Optimizes the polygon.
GUTF8String print (void)
void resize (int new_width, int new_height)
void transform (const GRect &grect)
virtual void unmap (GRectMapper &mapper)
 Virtual function unmaps polygon from one area to another using mapper.
virtual ~GMapPoly ()
 Virtual destructor.
Files #"GMapAreas.h"# and #"GMapAreas.cpp"# implement base objects used by the plugin to display and manage hyperlinks and highlighted areas inside a {DjVuImage} page.

The currently supported areas can be rectangular ({GMapRect}), elliptical ({GMapOval}) and polygonal ({GMapPoly}). Every map area besides the definition of its shape contains information about display style and optional { URL}, which it may refer to. If this { URL} is not empty then the map area will work like a hyperlink.

The classes also implement some useful functions to ease geometry manipulations

Definition of base map area classes

Andrei Erofeev <eaf@geocities.com>
GMapAreas.h,v 1.8 2003/11/07 22:08:21 leonb Exp

int get_points_num (void) const
 Returns the number of vertices in the polygon.
virtual char const *const get_shape_name (void) const
 Returns #"poly"# all the time.
int get_sides_num (void) const
 Returns the number sides in the polygon.
int get_x (int i) const
 Returns x coordinate of vertex number i#.
int get_y (int i) const
 Returns y coordinate of vertex number i#.

Static Public Member Functions

static GP< GMapPolycreate (const int xx[], const int yy[], const int points, const bool open=false)
 Create from specified coordinates.
static GP< GMapPolycreate (void)
 Default creator.

Public Attributes

bool border_always_visible
unsigned long int border_color
 Border color (when relevant) in #0x00RRGGBB# format.
BorderType border_type
int border_width
 Border width in pixels.
GUTF8String comment
unsigned long int hilite_color
GUTF8String target
GUTF8String url

Static Public Attributes

static const char BORDER_AVIS_TAG [] = "border_avis"
static const char HILITE_TAG [] = "hilite"
static const char MAPAREA_TAG [] = "maparea"
static const char NO_BORDER_TAG [] = "none"
static const char OVAL_TAG [] = "oval"
static const char POLY_TAG [] = "poly"
static const char RECT_TAG [] = "rect"
static const char SHADOW_EIN_BORDER_TAG [] = "shadow_ein"
static const char SHADOW_EOUT_BORDER_TAG [] = "shadow_eout"
static const char SHADOW_IN_BORDER_TAG [] = "shadow_in"
static const char SHADOW_OUT_BORDER_TAG [] = "shadow_out"
static const char SOLID_BORDER_TAG [] = "border"
static const char TARGET_SELF [] = "_self"
static const char URL_TAG [] = "url"
static const char XOR_BORDER_TAG [] = "xor"

Protected Member Functions

void clear_bounds (void)
virtual char const *const gma_check_object (void) const
virtual int gma_get_xmax (void) const
virtual int gma_get_xmin (void) const
virtual int gma_get_ymax (void) const
virtual int gma_get_ymin (void) const
virtual bool gma_is_point_inside (const int x, const int y) const
virtual void gma_move (int dx, int dy)
virtual GUTF8String gma_print (void)
virtual void gma_resize (int new_width, int new_height)
virtual void gma_transform (const GRect &grect)
 GMapPoly (const int *xx, const int *yy, int points, bool open=false)

Protected Attributes

volatile int count
 The reference counter.

Static Private Member Functions

static bool are_segments_parallel (int x11, int y11, int x12, int y12, int x21, int y21, int x22, int y22)
static bool do_segments_intersect (int x11, int y11, int x12, int y12, int x21, int y21, int x22, int y22)
static bool is_projection_on_segment (int x, int y, int x1, int y1, int x2, int y2)
static int sign (int x)

Private Attributes

bool open
int points
int sides
GTArray< int > xx
GTArray< int > yy

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

Generated by  Doxygen 1.6.0   Back to index