MWAWGraphicShape Class Reference documentation

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Friends | List of all members
MWAWGraphicShape Class Reference

a structure used to define a picture shape More...

`#include <MWAWGraphicShape.hxx>`

## Classes
struct | PathData
| a simple path component More...

## Public Types
enum | Type { Arc, Circle, Line, Rectangle, Path, Pie, Polygon, ShapeUnknown }
| an enum used to define the shape type More...
enum | Command { C_Ellipse, C_Polyline, C_Rectangle, C_Path, C_Polygon, C_Bad }
| an enum used to define the interface command More...

## Public Member Functions
| MWAWGraphicShape ()
| constructor More...
virtual | ~MWAWGraphicShape ()
| virtual destructor More...
void | translate (Vec2f const &delta)
| translate all the coordinate by delta More...
void | scale (Vec2f const &factor)
| rescale all the coordinate More...
MWAWGraphicShape | rotate (float angle, Vec2f const &center) const
| return a new shape corresponding to a rotation from center. More...
Type | getType () const
| returns the type corresponding to a shape More...
Box2f | getBdBox () const
| returns the basic bdbox More...
Box2f | getBdBox (MWAWGraphicStyle const &style, bool moveToO=false) const
| returns the bdbox corresponding to a style More...
Command | addTo (Vec2f const &orig, bool asSurface, librevenge::RVNGPropertyList &propList) const
| updates the propList to send to an interface More...
int | cmp (MWAWGraphicShape const &a) const
| compare two shapes More...

## Static Public Member Functions
static MWAWGraphicShape | line (Vec2f const &orign, Vec2f const &dest)
| static constructor to create a line More...
static MWAWGraphicShape | rectangle (Box2f const &box, Vec2f const &corners=Vec2f(0, 0))
| static constructor to create a rectangle More...
static MWAWGraphicShape | circle (Box2f const &box)
| static constructor to create a circle More...
static MWAWGraphicShape | arc (Box2f const &box, Box2f const &circleBox, Vec2f const &angles)
| static constructor to create a arc More...
static MWAWGraphicShape | pie (Box2f const &box, Box2f const &circleBox, Vec2f const &angles)
| static constructor to create a pie More...
static MWAWGraphicShape | polygon (Box2f const &box)
| static constructor to create a polygon More...
static MWAWGraphicShape | path (Box2f const &box)
| static constructor to create a path More...

## Public Attributes
Type | m_type
| the type More...
Box2f | m_bdBox
| the shape bdbox More...
Box2f | m_formBox
| the internal shape bdbox ( used for arc, circle to store the circle bdbox ) More...
Vec2f | m_cornerWidth
| the rectangle round corner More...
Vec2f | m_arcAngles
| the start and end value which defines an arc More...
std::vector< Vec2f > | m_vertices
| the list of vertices for lines or polygons More...
std::vector< PathData > | m_path
| the list of path component More...
std::string | m_extra
| extra data More...

## Protected Member Functions
std::vector< PathData > | getPath () const
| return a path corresponding to the shape More...

## Friends
std::ostream & | operator<< (std::ostream &o, MWAWGraphicShape const &sh)
| a print operator More...

## Detailed Description

a structure used to define a picture shape

## Member Enumeration Documentation

enum MWAWGraphicShape::Command

an enum used to define the interface command

Enumerator
C_Ellipse |
C_Polyline |
C_Rectangle |
C_Path |
C_Polygon |
C_Bad |

enum MWAWGraphicShape::Type

an enum used to define the shape type

Enumerator
Arc |
Circle |
Line |
Rectangle |
Path |
Pie |
Polygon |
ShapeUnknown |

## Constructor & Destructor Documentation

MWAWGraphicShape::MWAWGraphicShape | ( |  | ) |
| inline

constructor

virtual MWAWGraphicShape::~MWAWGraphicShape | ( |  | ) |
| inlinevirtual

virtual destructor

## Member Function Documentation

MWAWGraphicShape::Command MWAWGraphicShape::addTo | ( | Vec2f const & | orig,
|  | bool | asSurface,
|  | librevenge::RVNGPropertyList & | propList
| ) |  | const

updates the propList to send to an interface

Referenced by MWAWTextListener::insertPicture(), MWAWPresentationListener::insertPicture(), MWAWGraphicListener::insertPicture(), and MWAWSpreadsheetListener::insertPicture().

static MWAWGraphicShape MWAWGraphicShape::arc | ( | Box2f const & | box,
|  | Box2f const & | circleBox,
|  | Vec2f const & | angles
| ) |  |
| inlinestatic

static constructor to create a arc

Referenced by MsWksGraph::getEntryPicture(), GreatWksGraph::readFrameHeader(), MacDrawProParser::readGeometryShapeData(), and MacDrawParser::readObject().

static MWAWGraphicShape MWAWGraphicShape::circle | ( | Box2f const & | box | ) |
| inlinestatic

static constructor to create a circle

Referenced by MacDrawParser::readObject(), SuperPaintParser::readShape(), BeagleWksDRParser::readShapeDefinitions(), and MacDrawProParser::updateGeometryShape().

int MWAWGraphicShape::cmp | ( | MWAWGraphicShape const & | a | ) | const

compare two shapes

Box2f MWAWGraphicShape::getBdBox | ( |  | ) | const
| inline

returns the basic bdbox

Referenced by MacDrawParserInternal::Shape::getBdBox(), MacDrawProParserInternal::Shape::getBdBox(), MWAWTextListener::insertPicture(), and MacDrawProParser::send().

Box2f MWAWGraphicShape::getBdBox | ( | MWAWGraphicStyle const & | style,
|  | bool | moveToO = `false`
| ) |  | const

returns the bdbox corresponding to a style

std::vector< MWAWGraphicShape::PathData > MWAWGraphicShape::getPath | ( |  | ) | const
| protected

return a path corresponding to the shape

Referenced by rotate().

Type MWAWGraphicShape::getType | ( |  | ) | const
| inline

returns the type corresponding to a shape

Referenced by MWAWTextListener::insertPicture(), MWAWPresentationListener::insertPicture(), MWAWGraphicListener::insertPicture(), and MWAWSpreadsheetListener::insertPicture().

MWAWGraphicShape MWAWGraphicShape::line | ( | Vec2f const & | orign,
|  | Vec2f const & | dest
| ) |  |
| static

static constructor to create a line

Referenced by MsWksGraph::getEntryPicture(), GreatWksGraph::readFrameHeader(), MacDrawParser::readObject(), SuperPaintParser::readShape(), ClarisWksGraph::readShape(), BeagleWksDRParser::readShapeDefinitions(), RagTimeParser::sendBasicPicture(), HanMacWrdKGraph::sendEmptyPicture(), HanMacWrdJGraph::sendEmptyPicture(), MWAWTable::sendExtraLines(), MarinerWrtGraph::sendRule(), and MacDrawProParser::updateGeometryShape().

static MWAWGraphicShape MWAWGraphicShape::path | ( | Box2f const & | box | ) |
| inlinestatic

static constructor to create a path

Referenced by MsWksGraph::getEntryPicture(), GreatWksGraph::readFrameHeader(), and rotate().

static MWAWGraphicShape MWAWGraphicShape::pie | ( | Box2f const & | box,
|  | Box2f const & | circleBox,
|  | Vec2f const & | angles
| ) |  |
| inlinestatic

static constructor to create a pie

Referenced by GreatWksGraph::readFrameHeader(), MacDrawProParser::readGeometryShapeData(), MacDrawParser::readObject(), SuperPaintParser::readShape(), ClarisWksGraph::readShape(), and BeagleWksDRParser::readStyle().

static MWAWGraphicShape MWAWGraphicShape::polygon | ( | Box2f const & | box | ) |
| inlinestatic

static constructor to create a polygon

Referenced by MsWksGraph::getEntryPicture(), GreatWksGraph::readFrameHeader(), and BeagleWksDRParser::readShapeDefinitions().

static MWAWGraphicShape MWAWGraphicShape::rectangle | ( | Box2f const & | box,
|  | Vec2f const & | corners = `Vec2f(0,0)`
| ) |  |
| inlinestatic

static constructor to create a rectangle

Referenced by GreatWksGraph::readFrameHeader(), MacDrawParser::readObject(), SuperPaintParser::readShape(), BeagleWksDRParser::readShapeDefinitions(), HanMacWrdKGraph::sendEmptyPicture(), HanMacWrdJGraph::sendEmptyPicture(), MarinerWrtGraph::sendRule(), and MacDrawProParser::updateGeometryShape().

MWAWGraphicShape MWAWGraphicShape::rotate | ( | float | angle,
|  | Vec2f const & | center
| ) |  | const

return a new shape corresponding to a rotation from center.

Note
  the final bdbox is not tight

Referenced by ClarisWksGraph::readShape().

void MWAWGraphicShape::scale | ( | Vec2f const & | factor | ) |

rescale all the coordinate

void MWAWGraphicShape::translate | ( | Vec2f const & | delta | ) |

translate all the coordinate by delta

Referenced by ClarisWksGraph::readShape().

## Friends And Related Function Documentation

std::ostream& operator<< | ( | std::ostream & | o,
|  | MWAWGraphicShape const & | sh
| ) |  |
| friend

a print operator

## Member Data Documentation

Vec2f MWAWGraphicShape::m_arcAngles

the start and end value which defines an arc

Referenced by addTo(), arc(), cmp(), getPath(), operator<<(), pie(), HanMacWrdJGraph::readShapeGraph(), and HanMacWrdKGraph::readShapeGraph().

Box2f MWAWGraphicShape::m_bdBox

the shape bdbox

Referenced by addTo(), arc(), circle(), cmp(), getBdBox(), MsWksGraph::getEntryPicture(), line(), operator<<(), path(), pie(), polygon(), GreatWksGraph::readFrameHeader(), MacDrawParser::readObject(), MacDrawProParser::readRotationInObjectData(), ClarisWksGraph::readShape(), HanMacWrdJGraph::readShapeGraph(), HanMacWrdKGraph::readShapeGraph(), rectangle(), rotate(), scale(), MarinerWrtGraph::sendRule(), translate(), and MacDrawProParser::updateGeometryShape().

Vec2f MWAWGraphicShape::m_cornerWidth

the rectangle round corner

Referenced by addTo(), cmp(), MsWksGraph::getEntryPicture(), getPath(), operator<<(), GreatWksGraph::readFrameHeader(), ClarisWksGraph::readShape(), HanMacWrdJGraph::readShapeGraph(), HanMacWrdKGraph::readShapeGraph(), BeagleWksDRParser::readStyle(), and rectangle().

std::string MWAWGraphicShape::m_extra

extra data

Referenced by operator<<(), and ClarisWksGraph::readShape().

Box2f MWAWGraphicShape::m_formBox

the internal shape bdbox ( used for arc, circle to store the circle bdbox )

Referenced by addTo(), arc(), circle(), cmp(), MsWksGraph::getEntryPicture(), getPath(), operator<<(), pie(), GreatWksGraph::readFrameHeader(), MacDrawProParser::readRotationInObjectData(), ClarisWksGraph::readShape(), HanMacWrdJGraph::readShapeGraph(), HanMacWrdKGraph::readShapeGraph(), rectangle(), scale(), and translate().

std::vector<PathData> MWAWGraphicShape::m_path

the list of path component

Referenced by addTo(), cmp(), MsWksGraph::getEntryPicture(), getPath(), operator<<(), GreatWksGraph::readFrameExtraData(), ClarisWksGraph::readPolygonData(), rotate(), scale(), and translate().

Type MWAWGraphicShape::m_type

the type

Referenced by addTo(), arc(), circle(), MWAWGraphicShape::PathData::cmp(), cmp(), MWAWGraphicShape::PathData::get(), getBdBox(), MsWksGraph::getEntryPicture(), ClarisWksGraphInternal::ZoneShape::getNumData(), getPath(), HanMacWrdKGraphInternal::ShapeGraph::getStyle(), getType(), MacDrawProParserInternal::Shape::isLine(), line(), MsWksGraphInternal::BasicShape::needExtraBorderWidth(), MacDrawProParserInternal::operator<<(), operator<<(), path(), pie(), polygon(), GreatWksGraph::readFrameExtraData(), GreatWksGraph::readFrameHeader(), HanMacWrdJGraph::readGraphData(), MacDrawParser::readObject(), MacDrawProParser::readObject(), ClarisWksGraph::readPolygonData(), SuperPaintParser::readShape(), ClarisWksGraph::readShape(), HanMacWrdJGraph::readShapeGraph(), HanMacWrdKGraph::readShapeGraph(), rectangle(), MWAWGraphicShape::PathData::rotate(), MWAWGraphicShape::PathData::scale(), MacDrawProParser::send(), HanMacWrdJGraph::sendGroup(), ClarisWksGraph::sendGroupChild(), HanMacWrdJGraph::sendGroupChild(), ClarisWksGraph::sendShape(), HanMacWrdJGraph::sendShapeGraph(), and GreatWksGraphInternal::FrameShape::updateStyle().

std::vector<Vec2f> MWAWGraphicShape::m_vertices

the list of vertices for lines or polygons

Referenced by addTo(), cmp(), MsWksGraph::getEntryPicture(), getPath(), line(), operator<<(), GreatWksGraph::readFrameExtraData(), HanMacWrdJGraph::readGraphData(), MacDrawParser::readObject(), ClarisWksGraph::readPolygonData(), SuperPaintParser::readShape(), BeagleWksDRParser::readShapeDatas(), HanMacWrdJGraph::readShapeGraph(), HanMacWrdKGraph::readShapeGraph(), scale(), and translate().

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

- MWAWGraphicShape.hxx
- MWAWGraphicShape.cxx