Papyrus::Viewbox Class Reference

#include <papyrus/viewbox.h>

Inheritance diagram for Papyrus::Viewbox:

Inheritance graph
[legend]
List of all members.

Detailed Description

The Viewbox is based conceptually on the SVG viewBox attribute.

This class also incorporates the SVG preserveAspectRatio attribute.

Combined, these attributes allow a Papyrus::Drawable to be confined to a specific bounded area. The aspect ratio setting control how the Papyrus::Drawable will be adapted to fit inside the specified area.

The meaning of the ALIGN and MEET_OR_SLICE aspects is identical to the same concepts in the SVG specification.

The MEET_OR_SLICE slice setting controls whether the shape is scaled to fit entirely inside the Viewbox (MEET), or whether the shape is scaled to precisely fit one dimension (x or y) and sliced to fit the other dimension (SLICE).

The ALIGN setting controls where inside the Viewbox the Papyrus::Drawable is placed. The XMIN* settings will align the Drawable with the left X boundary, XMID* will align the Drawable in the center of the Viewbox, and XMAX* will align the Drawable on the right X boundary. Similarly the YMIN*, YMID* and YMAX* aspects will align the Drawable in the Y dimension.

Author:
Rick L Vinyard Jr <rvinyard@cs.nmsu.edu>


Public Types

enum  ALIGN {
  ALIGN_NONE, ALIGN_XMIN_YMIN, ALIGN_XMID_YMIN, ALIGN_XMAX_YMIN,
  ALIGN_XMIN_YMID, ALIGN_XMID_YMID, ALIGN_XMAX_YMID, ALIGN_XMIN_YMAX,
  ALIGN_XMID_YMAX, ALIGN_XMAX_YMAX
}
enum  MEET_OR_SLICE { MEET, SLICE }
typedef enum Papyrus::Viewbox::ALIGN ALIGN
typedef enum Papyrus::Viewbox::MEET_OR_SLICE MEET_OR_SLICE
typedef PapyrusSmartPointer<
Viewbox
pointer

Public Member Functions

 Viewbox (double x=0.0, double y=0.0, double w=0.0, double h=0.0, ALIGN align=ALIGN_NONE, MEET_OR_SLICE meet_or_slice=MEET)
 Viewbox (const Region &region, ALIGN align=ALIGN_NONE, MEET_OR_SLICE meet_or_slice=MEET)
Viewboxoperator= (const Region &other)
Viewboxoperator= (const Viewbox &other)
bool operator== (const Region &other)
bool operator== (const Viewbox &other)
void set_preserve_aspect_ratio (ALIGN align, MEET_OR_SLICE meet_or_slice=MEET)
ALIGN alignment () const
MEET_OR_SLICE meet_or_slice () const
Cairo::Matrix transformation_matrix (const Region &box) const

Static Public Member Functions

static pointer create (double x=0.0, double y=0.0, double w=0.0, double h=0.0, ALIGN align=ALIGN_NONE, MEET_OR_SLICE meet_or_slice=MEET)
static pointer create (const Region &region, ALIGN align=ALIGN_NONE, MEET_OR_SLICE meet_or_slice=MEET)

Protected Attributes

ALIGN m_align
MEET_OR_SLICE m_meet_or_slice


The documentation for this class was generated from the following files:
Generated on Sun Mar 11 10:01:58 2007 by  doxygen 1.5.1