Public Member Functions

hipp::HippRectangle Class Reference
[SVG Shapes]

Abstract base class for rectangles in Hipp. More...

#include <HippRectangle.h>

Inheritance diagram for hipp::HippRectangle:
hipp::HippShape

List of all members.

Public Member Functions

 HippRectangle (void)
 HippRectangle (int x, int y, int width, int height)
 ~HippRectangle (void)
void LoadObject (const xercesc::Attributes &attrs, const XMLCh *const localname=XMLString::transcode("rect"))
 Loads the shape from a set of SVG attributes and the SVG tag name, provided by Xerces-C.
ostream & SaveObject (ostream &stream)
ShapeType getShapeType ()
const wxRect & getBounds () const
bool containsPoint (wxPoint p) const
void OnDraw (Cairo::RefPtr< Cairo::Context > context, bool isHaptic=true) const
virtual HippRectangleclone () const
void move (int diffX, int diffY)
void zoom (double scaleX, double scaleY)
wxPoint getTopLeft () const
int getWidth () const
int getHeight () const

Detailed Description

Abstract base class for rectangles in Hipp.

Author:
Delphine Szymczak

Shapes are the building blocks of Hipp documents. They know how to represent themselves in the .svg xml format (HippShape::LoadObject and HippShape::SaveObject) and in the HippView (HippShape::OnDraw). Rectangles are one kind of shape.

Todo:

Create shapes for Ellipse, Path, etc.

Figure out how to properly import and convert Path objects that are really shapes


Constructor & Destructor Documentation

HippRectangle::HippRectangle ( void   ) 
HippRectangle::HippRectangle ( int  x,
int  y,
int  width,
int  height 
)
HippRectangle::~HippRectangle ( void   ) 

Member Function Documentation

HippRectangle * HippRectangle::clone (  )  const [virtual]

Implements hipp::HippShape.

bool HippRectangle::containsPoint ( wxPoint  p  )  const [virtual]

Implements hipp::HippShape.

const wxRect & HippRectangle::getBounds (  )  const [virtual]

Implements hipp::HippShape.

int HippRectangle::getHeight (  )  const
ShapeType hipp::HippRectangle::getShapeType (  )  [inline, virtual]

Implements hipp::HippShape.

wxPoint HippRectangle::getTopLeft (  )  const
int HippRectangle::getWidth (  )  const
void hipp::HippRectangle::LoadObject ( const xercesc::Attributes &  attrs,
const XMLCh *const   localname = XMLString::transcode("rect") 
) [virtual]

Loads the shape from a set of SVG attributes and the SVG tag name, provided by Xerces-C.

Hipp uses a Xerces-C SAX2 XML parser to traverse a .svg input file. When a known shape is encountered, LoadObject is called with the attributes that are found. The HippShape implementation checks for <title> and <desc> tags, which are universally available to shapes. This function should be overridden in derived classes to load the appropriate object.

Reimplemented from hipp::HippShape.

void HippRectangle::move ( int  diffX,
int  diffY 
) [virtual]

Implements hipp::HippShape.

void HippRectangle::OnDraw ( Cairo::RefPtr< Cairo::Context >  context,
bool  isHaptic = true 
) const [virtual]

Reimplemented from hipp::HippShape.

ostream & HippRectangle::SaveObject ( ostream &  stream  ) 
void HippRectangle::zoom ( double  scaleX,
double  scaleY 
) [virtual]

Implements hipp::HippShape.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines