|
hipp
1.0
|
Abstract base class for shapes in Hipp. More...
#include <HippShape.h>
Public Member Functions | |
| HippShape () | |
| ~HippShape () | |
| virtual void | LoadObject (const xercesc::Attributes &attrs, const XMLCh *const localnam) |
| Loads the shape from a set of SVG attributes and the SVG tag name, provided by Xerces-C. | |
| virtual void | LoadObject (const XMLCh *const chars) |
| Loads information associated with the shape from character data. | |
| virtual std::ostream & | SaveObject (std::ostream &stream) |
| virtual void | cloneMeta (HippShape *hs) const |
| virtual const wxRect & | getBounds () const =0 |
| virtual wxRect | getFullBounds () const |
| virtual bool | containsPoint (wxPoint p) const =0 |
| virtual void | OnDraw (Cairo::RefPtr< Cairo::Context > context, bool isHaptic=true) const |
| virtual HippShape * | clone () const =0 |
| virtual void | move (int diffX, int diffY)=0 |
| virtual void | zoom (int scaleX, int scaleY)=0 |
| wxString | getDescription () const |
| wxString | getTitle () const |
| wxString | getTitleOrUntitled () const |
| void | setDescription (wxString desc) |
| void | setTitle (wxString title) |
| void | toggleFill () |
| bool | isFilled () const |
| int | getLineWidth () const |
| virtual void | setLineWidth (int w) |
| void | setSoundFile (wxString soundfile) |
| wxString | getSoundFile () const |
| void | setColourWhite (bool c) |
| bool | getColourWhite () const |
| bool | isDirty () |
| virtual void | setDirty () |
| virtual void | resetDirty () |
| bool | hasSound () const |
| bool | hasMetaInfo () const |
| virtual ShapeType | getShapeType ()=0 |
Protected Attributes | |
| wxString | m_title |
| wxString | m_desc |
| wxString | m_soundfile |
| bool | colourWhite |
| bool | dirty |
| wxColour | m_filling |
| int | lineWidth |
Abstract base class for shapes in Hipp.
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).
Create shapes for Ellipse, Rectangle, Path, etc.
Figure out how to properly import and convert Path objects that are really shapes
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).
Create shapes for Ellipse, Rectangle, Path, etc.
Figure out how to properly import and convert Path objects that are really shapes
| HippShape::HippShape | ( | ) |
| HippShape::~HippShape | ( | ) |
| virtual HippShape* hipp::HippShape::clone | ( | ) | const [pure virtual] |
Implemented in hipp::HippRectangle, hipp::HippBackground, hipp::HippLine, hipp::HippPolyline, and hipp::HippEllipse.
| void HippShape::cloneMeta | ( | HippShape * | hs | ) | const [virtual] |
| virtual bool hipp::HippShape::containsPoint | ( | wxPoint | p | ) | const [pure virtual] |
Implemented in hipp::HippRectangle, hipp::HippBackground, hipp::HippLine, hipp::HippPolyline, and hipp::HippEllipse.
| virtual const wxRect& hipp::HippShape::getBounds | ( | ) | const [pure virtual] |
Implemented in hipp::HippRectangle, hipp::HippBackground, hipp::HippLine, hipp::HippPolyline, and hipp::HippEllipse.
| bool hipp::HippShape::getColourWhite | ( | ) | const [inline] |
| wxString hipp::HippShape::getDescription | ( | ) | const [inline] |
| wxRect HippShape::getFullBounds | ( | ) | const [virtual] |
| int hipp::HippShape::getLineWidth | ( | ) | const [inline] |
| virtual ShapeType hipp::HippShape::getShapeType | ( | ) | [pure virtual] |
Implemented in hipp::HippRectangle, hipp::HippBackground, hipp::HippEllipse, hipp::HippLine, and hipp::HippPolyline.
| wxString hipp::HippShape::getSoundFile | ( | ) | const [inline] |
| wxString hipp::HippShape::getTitle | ( | ) | const [inline] |
| wxString hipp::HippShape::getTitleOrUntitled | ( | ) | const [inline] |
| bool HippShape::hasMetaInfo | ( | ) | const |
| bool HippShape::hasSound | ( | ) | const |
| bool hipp::HippShape::isDirty | ( | ) | [inline] |
| bool hipp::HippShape::isFilled | ( | ) | const [inline] |
| void hipp::HippShape::LoadObject | ( | const xercesc::Attributes & | attrs, |
| const XMLCh *const | localnam | ||
| ) | [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 in hipp::HippRectangle, hipp::HippBackground, hipp::HippEllipse, hipp::HippLine, and hipp::HippPolyline.
| void hipp::HippShape::LoadObject | ( | const XMLCh *const | chars | ) | [virtual] |
Loads information associated with the shape from character data.
This version of the LoadObject function is called when the shape encounters the character data inside a <title> or <desc> tag. The appropriate variable is set to the HippShape::awaiting_data pointer in the other version of HippShape::LoadObject. Then, the next character data that comes along is that
| virtual void hipp::HippShape::move | ( | int | diffX, |
| int | diffY | ||
| ) | [pure virtual] |
Implemented in hipp::HippRectangle, hipp::HippBackground, hipp::HippLine, hipp::HippPolyline, and hipp::HippEllipse.
| void HippShape::OnDraw | ( | Cairo::RefPtr< Cairo::Context > | context, |
| bool | isHaptic = true |
||
| ) | const [virtual] |
Reimplemented in hipp::HippRectangle, hipp::HippBackground, hipp::HippLine, hipp::HippPolyline, and hipp::HippEllipse.
| virtual void hipp::HippShape::resetDirty | ( | ) | [inline, virtual] |
| ostream & HippShape::SaveObject | ( | std::ostream & | stream | ) | [virtual] |
| void hipp::HippShape::setColourWhite | ( | bool | c | ) | [inline] |
| void hipp::HippShape::setDescription | ( | wxString | desc | ) | [inline] |
| virtual void hipp::HippShape::setDirty | ( | ) | [inline, virtual] |
| virtual void hipp::HippShape::setLineWidth | ( | int | w | ) | [inline, virtual] |
| void hipp::HippShape::setSoundFile | ( | wxString | soundfile | ) | [inline] |
| void hipp::HippShape::setTitle | ( | wxString | title | ) | [inline] |
| void hipp::HippShape::toggleFill | ( | ) | [inline] |
| virtual void hipp::HippShape::zoom | ( | int | scaleX, |
| int | scaleY | ||
| ) | [pure virtual] |
Implemented in hipp::HippRectangle, hipp::HippBackground, hipp::HippLine, hipp::HippPolyline, and hipp::HippEllipse.
bool hipp::HippShape::colourWhite [protected] |
bool hipp::HippShape::dirty [protected] |
int hipp::HippShape::lineWidth [protected] |
wxString hipp::HippShape::m_desc [protected] |
wxColour hipp::HippShape::m_filling [protected] |
wxString hipp::HippShape::m_soundfile [protected] |
wxString hipp::HippShape::m_title [protected] |
1.7.5.1