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 , Measure , Rectangle , Path , Pie , Polygon , Polyline , 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
| MWAWGraphicShape (MWAWGraphicShape const &)=default
MWAWGraphicShape & | operator= (MWAWGraphicShape const &)=default
MWAWGraphicShape & | operator= (MWAWGraphicShape &&)=default
| ~MWAWGraphicShape ()
| destructor
void | translate (MWAWVec2f const &delta)
| translate all the coordinate by delta
void | scale (MWAWVec2f const &factor)
| rescale all the coordinate
MWAWGraphicShape | rotate (float angle, MWAWVec2f const &center) const
| return a new shape corresponding to a rotation from center.
MWAWGraphicShape | transform (MWAWTransformation const &matrix) const
| returns a new shape corresponding to a matrix transformation
Type | getType () const
| returns the type corresponding to a shape
MWAWBox2f | getBdBox () const
| returns the basic bdbox
MWAWBox2f | getBdBox (MWAWGraphicStyle const &style, bool moveToO=false) const
| returns the bdbox corresponding to a style
Command | addTo (MWAWVec2f const &orig, bool asSurface, librevenge::RVNGPropertyList &propList) const
| updates the propList to send to an interface
bool | addPathTo (MWAWVec2f const &orig, librevenge::RVNGPropertyListVector &propList) const
| adds the shape path to a propListVector
int | cmp (MWAWGraphicShape const &a) const
| compare two shapes
std::vector< PathData > | getPath (bool forTransformation) const
| return a path corresponding to the shape

## Static Public Member Functions

static MWAWGraphicShape | line (MWAWVec2f const &orign, MWAWVec2f const &dest)
| static constructor to create a line
static MWAWGraphicShape | measure (MWAWVec2f const &orign, MWAWVec2f const &dest)
| static constructor to create a measure
static MWAWGraphicShape | rectangle (MWAWBox2f const &box, MWAWVec2f const &corners=MWAWVec2f(0, 0))
| static constructor to create a rectangle
static MWAWGraphicShape | circle (MWAWBox2f const &box)
| static constructor to create a circle
static MWAWGraphicShape | arc (MWAWBox2f const &box, MWAWBox2f const &circleBox, MWAWVec2f const &angles)
| static constructor to create a arc
static MWAWGraphicShape | pie (MWAWBox2f const &box, MWAWBox2f const &circleBox, MWAWVec2f const &angles)
| static constructor to create a pie
static MWAWGraphicShape | polyline (MWAWBox2f const &box)
| static constructor to create a polyline
static MWAWGraphicShape | polygon (MWAWBox2f const &box)
| static constructor to create a polygon
static MWAWGraphicShape | path (MWAWBox2f const &box)
| static constructor to create a path
static std::vector< PathData > | offsetVertices (std::vector< PathData > const &path, float offset, MWAWBox2f &finalBox)
| try to decal each path point by an offset (using their normal)

## Public Attributes

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

## Friends

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

## Detailed Description

a structure used to define a picture shape

## Member Enumeration Documentation

## Command

enum MWAWGraphicShape::Command

an enum used to define the interface command

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

## Type

enum MWAWGraphicShape::Type

an enum used to define the shape type

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

## Constructor & Destructor Documentation

## MWAWGraphicShape() [1/2]

MWAWGraphicShape::MWAWGraphicShape | ( |  | ) |

inline

constructor

Referenced by arc(), circle(), cmp(), line(), measure(), MWAWGraphicShape(), operator<<, operator=(), operator=(), path(), pie(), polygon(), polyline(), rectangle(), rotate(), and transform().

## MWAWGraphicShape() [2/2]

MWAWGraphicShape::MWAWGraphicShape | ( | MWAWGraphicShape const & |  | ) |

default

## ~MWAWGraphicShape()

MWAWGraphicShape::~MWAWGraphicShape | ( |  | ) |

destructor

## Member Function Documentation

## addPathTo()

bool MWAWGraphicShape::addPathTo | ( | MWAWVec2f const & | orig,
|  | librevenge::RVNGPropertyListVector & | propList ) const

adds the shape path to a propListVector

## addTo()

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

updates the propList to send to an interface

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

## arc()

MWAWGraphicShape MWAWGraphicShape::arc | ( | MWAWBox2f const & | box,
|  | MWAWBox2f const & | circleBox,
|  | MWAWVec2f const & | angles )

inline static

static constructor to create a arc

Referenced by ApplePictParser::drawPie(), MsWksGraph::getEntryPicture(), GreatWksGraph::readFrameHeader(), MacDrawProParser::readGeometryShapeData(), RagTime5Graph::readGraphicShape(), MacDraft5Parser::readObject(), MacDraftParser::readObject(), MacDrawParser::readObject(), CricketDrawParser::readShape(), ScoopParser::send(), Canvas5Graph::sendDimension(), CanvasGraph::sendDimension(), DrawTableParser::sendShape(), and WingzGraph::sendShape().

## circle()

MWAWGraphicShape MWAWGraphicShape::circle | ( | MWAWBox2f const & | box | ) |

inline static

static constructor to create a circle

Referenced by ApplePictParser::drawCircle(), RagTime5Graph::readGraphicShape(), MacDraft5Parser::readObject(), MacDraftParser::readObject(), MacDrawParser::readObject(), CricketDrawParser::readShape(), SuperPaintParser::readShape(), BeagleWksDRParser::readShapeDefinitions(), Canvas5Graph::send(), Canvas5Image::send(), CanvasGraph::send(), CricketDrawParser::send(), ReadySetGoGraph::send(), ScoopParser::send(), PowerPoint1Parser::sendFrame(), PowerPoint3Parser::sendFrame(), PowerPoint7Graph::sendFrame(), DrawTableParser::sendShape(), WingzGraph::sendShape(), Canvas5Graph::sendSpecial(), CanvasGraph::sendSpecial(), MacDrawProParser::updateGeometryShape(), and FreeHandParserInternal::Shape::updateShape().

## cmp()

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

compare two shapes

## getBdBox() [1/2]

MWAWBox2f MWAWGraphicShape::getBdBox | ( |  | ) | const

inline

returns the basic bdbox

Referenced by ApplePictParser::drawPolygon(), MWAWTextListener::insertShape(), Canvas5Graph::send(), Canvas5Graph::send(), Canvas5Image::send(), CricketDrawParser::send(), MacDrawProParser::send(), ReadySetGoGraph::send(), ScoopParser::send(), CanvasGraph::sendDimension(), PowerPoint1Parser::sendFrame(), PowerPoint3Parser::sendFrame(), PowerPoint7Graph::sendFrame(), CanvasGraph::sendMultiLines(), DrawTableParser::sendShape(), and CanvasGraph::sendSpecial().

## getBdBox() [2/2]

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

returns the bdbox corresponding to a style

## getPath()

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

return a path corresponding to the shape

Referenced by addPathTo(), rotate(), Canvas5Graph::send(), and transform().

## getType()

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

inline

returns the type corresponding to a shape

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

## line()

MWAWGraphicShape MWAWGraphicShape::line | ( | MWAWVec2f const & | orign,
|  | MWAWVec2f const & | dest )

static

static constructor to create a line

Referenced by ApplePictParser::drawLine(), MsWksGraph::getEntryPicture(), measure(), GreatWksGraph::readFrameHeader(), RagTime5Graph::readGraphicShape(), MacDraft5Parser::readObject(), MacDraftParser::readObject(), MacDrawParser::readObject(), ClarisDrawGraph::readShape(), ClarisWksGraph::readShape(), CricketDrawParser::readShape(), SuperPaintParser::readShape(), BeagleWksDRParser::readShapeDefinitions(), Canvas5Graph::send(), Canvas5Image::send(), CanvasGraph::send(), CricketDrawParser::send(), ReadySetGoGraph::send(), ScoopParser::send(), RagTimeParser::sendBasicPicture(), Canvas5Graph::sendDimension(), CanvasGraph::sendDimension(), Canvas5Graph::sendDimension9(), HanMacWrdJGraph::sendEmptyPicture(), HanMacWrdKGraph::sendEmptyPicture(), MWAWTable::sendExtraLines(), PowerPoint1Parser::sendFrame(), PowerPoint3Parser::sendFrame(), PowerPoint7Graph::sendFrame(), MarinerWrtGraph::sendRule(), DrawTableParser::sendShape(), WingzGraph::sendShape(), Canvas5Graph::sendSpecial(), CanvasGraph::sendSpecial(), MacDrawProParser::updateGeometryShape(), and FreeHandParserInternal::Shape::updateShape().

## measure()

MWAWGraphicShape MWAWGraphicShape::measure | ( | MWAWVec2f const & | orign,
|  | MWAWVec2f const & | dest )

static

static constructor to create a measure

Referenced by MacDraft5Parser::readObject().

## offsetVertices()

std::vector< MWAWGraphicShape::PathData > MWAWGraphicShape::offsetVertices | ( | std::vector< PathData > const & | path,
|  | float | offset,
|  | MWAWBox2f & | finalBox )

static

try to decal each path point by an offset (using their normal)

Referenced by Canvas5Graph::send().

## operator=() [1/2]

MWAWGraphicShape & MWAWGraphicShape::operator= | ( | MWAWGraphicShape && |  | ) |

default

## operator=() [2/2]

MWAWGraphicShape & MWAWGraphicShape::operator= | ( | MWAWGraphicShape const & |  | ) |

default

## path()

MWAWGraphicShape MWAWGraphicShape::path | ( | MWAWBox2f const & | box | ) |

inline static

static constructor to create a path

Referenced by MsWksGraph::getEntryPicture(), offsetVertices(), MWAWGraphicShape::PathData::operator<<, GreatWksGraph::readFrameHeader(), CorelPainterParser::readPolygon(), rotate(), Canvas5Graph::send(), Canvas5Image::send(), CanvasGraph::send(), ScoopParser::send(), CanvasGraph::sendMultiLines(), DrawTableParser::sendShape(), Canvas5Graph::sendSpecial(), Canvas5Graph::sendTechnical(), and transform().

## pie()

MWAWGraphicShape MWAWGraphicShape::pie | ( | MWAWBox2f const & | box,
|  | MWAWBox2f const & | circleBox,
|  | MWAWVec2f const & | angles )

inline static

static constructor to create a pie

Referenced by ApplePictParser::drawPie(), GreatWksGraph::readFrameHeader(), MacDrawProParser::readGeometryShapeData(), RagTime5Graph::readGraphicShape(), MacDraft5Parser::readObject(), MacDraftParser::readObject(), MacDrawParser::readObject(), ClarisDrawGraph::readShape(), ClarisWksGraph::readShape(), SuperPaintParser::readShape(), BeagleWksDRParser::readStyle(), Canvas5Graph::send(), Canvas5Image::send(), CanvasGraph::send(), ScoopParser::send(), Canvas5Graph::sendDimension9(), PowerPoint3Parser::sendFrame(), DrawTableParser::sendShape(), WingzGraph::sendShape(), and PowerPoint7GraphInternal::FrameArc::updateShape().

## polygon()

MWAWGraphicShape MWAWGraphicShape::polygon | ( | MWAWBox2f const & | box | ) |

inline static

static constructor to create a polygon

Referenced by MsWksGraph::getEntryPicture(), GreatWksGraph::readFrameHeader(), BeagleWksDRParser::readShapeDefinitions(), Canvas5Graph::send(), Canvas5Image::send(), CanvasGraph::send(), ReadySetGoGraph::send(), ScoopParser::send(), Canvas5Graph::sendExtrude(), CanvasGraph::sendMultiLines(), DrawTableParser::sendShape(), WingzGraph::sendShape(), and Canvas5Graph::sendSpecial().

## polyline()

MWAWGraphicShape MWAWGraphicShape::polyline | ( | MWAWBox2f const & | box | ) |

inline static

static constructor to create a polyline

Referenced by Canvas5Graph::send(), CanvasGraph::send(), ReadySetGoGraph::send(), ScoopParser::send(), CanvasGraph::sendMultiLines(), DrawTableParser::sendShape(), WingzGraph::sendShape(), and CanvasGraph::sendSpecial().

## rectangle()

MWAWGraphicShape MWAWGraphicShape::rectangle | ( | MWAWBox2f const & | box,
|  | MWAWVec2f const & | corners = MWAWVec2f(0,0) )

inline static

static constructor to create a rectangle

Referenced by ApplePictParser::drawRectangle(), ApplePictParser::drawRoundRectangle(), GreatWksGraph::readFrameHeader(), RagTime5Graph::readGraphicShape(), MacDraft5Parser::readObject(), MacDraftParser::readObject(), MacDrawParser::readObject(), CricketDrawParser::readShape(), SuperPaintParser::readShape(), BeagleWksDRParser::readShapeDefinitions(), Canvas5Graph::send(), Canvas5Image::send(), CanvasGraph::send(), ReadySetGoGraph::send(), ScoopParser::send(), Canvas5Graph::sendDimension9(), HanMacWrdJGraph::sendEmptyPicture(), HanMacWrdKGraph::sendEmptyPicture(), PowerPoint1Parser::sendFrame(), PowerPoint3Parser::sendFrame(), PowerPoint7Graph::sendFrame(), SpringBoardParser::sendFrame(), MarinerWrtGraph::sendRule(), DrawTableParser::sendShape(), WingzGraph::sendShape(), Canvas5Graph::sendSpecial(), CanvasGraph::sendSpecial(), MacDrawProParser::updateGeometryShape(), and FreeHandParserInternal::Shape::updateShape().

## rotate()

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

return a new shape corresponding to a rotation from center.

Note
  the final bdbox is not tight

Referenced by MacDrawProParser::readGeometryShapeData(), ClarisWksGraph::readShape(), ReadySetGoGraph::send(), PowerPoint3Parser::sendFrame(), and PowerPoint7Graph::sendFrame().

## scale()

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

rescale all the coordinate

Referenced by ReadySetGoGraph::send(), PowerPoint3Parser::sendFrame(), PowerPoint7Graph::sendFrame(), CorelPainterParser::sendZone(), and transform().

## transform()

MWAWGraphicShape MWAWGraphicShape::transform | ( | MWAWTransformation const & | matrix | ) | const

returns a new shape corresponding to a matrix transformation

Referenced by Canvas5Graph::send(), Canvas5Graph::send(), Canvas5Image::send(), CricketDrawParser::send(), and FreeHandParser::sendShape().

## translate()

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

translate all the coordinate by delta

Referenced by ClarisWksGraph::readShape(), PowerPoint3Parser::sendFrame(), PowerPoint7Graph::sendFrame(), and transform().

## Friends And Related Symbol Documentation

## operator<<

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

friend

a print operator

## Member Data Documentation

## m_arcAngles

MWAWVec2f MWAWGraphicShape::m_arcAngles

the start and end value which defines an arc

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

## m_bdBox

MWAWBox2f MWAWGraphicShape::m_bdBox

the shape bdbox

Referenced by addPathTo(), addTo(), arc(), circle(), cmp(), ApplePictParser::drawPolygon(), getBdBox(), getBdBox(), line(), MWAWGraphicShape(), operator<<, path(), pie(), polygon(), polyline(), GreatWksGraph::readFrameHeader(), MacDrawProParser::readGeometryShapeData(), MacDraft5Parser::readObject(), MacDraftParser::readObject(), MacDrawProParser::readRotationInObjectData(), ClarisDrawGraph::readShape(), ClarisWksGraph::readShape(), CricketDrawParser::readShape(), HanMacWrdJGraph::readShapeGraph(), HanMacWrdKGraph::readShapeGraph(), rectangle(), rotate(), scale(), MarinerWrtGraph::sendRule(), FreeHandParser::sendShape(), WingzGraph::sendShape(), Canvas5Graph::sendSpecial(), CanvasGraph::sendSpecial(), transform(), translate(), MacDrawProParser::updateGeometryShape(), and FreeHandParserInternal::Shape::updateShape().

## m_cornerWidth

MWAWVec2f MWAWGraphicShape::m_cornerWidth

the rectangle round corner

Referenced by addTo(), cmp(), getPath(), MWAWGraphicShape(), operator<<, MacDraftParser::readObject(), ClarisWksGraph::readShape(), HanMacWrdJGraph::readShapeGraph(), HanMacWrdKGraph::readShapeGraph(), BeagleWksDRParser::readStyle(), and rectangle().

## m_extra

std::string MWAWGraphicShape::m_extra

extra data

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

## m_formBox

MWAWBox2f MWAWGraphicShape::m_formBox

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

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

## m_path

std::vector<PathData> MWAWGraphicShape::m_path

the list of path component

Referenced by addTo(), cmp(), getPath(), MWAWGraphicShape(), operator<<, MacDrawProParser::readGeometryShapeData(), CorelPainterParser::readPolygon(), ClarisDrawGraph::readPolygonData(), ClarisWksGraph::readPolygonData(), CricketDrawParser::readShape(), rotate(), scale(), Canvas5Graph::send(), Canvas5Image::send(), CanvasGraph::send(), ScoopParser::send(), CanvasGraph::sendMultiLines(), DrawTableParser::sendShape(), WingzGraph::sendShape(), Canvas5Graph::sendSpecial(), transform(), translate(), and FreeHandParserInternal::Shape::updateShape().

## m_type

Type MWAWGraphicShape::m_type

the type

Referenced by addPathTo(), addTo(), arc(), circle(), cmp(), ApplePictParser::drawPolygon(), getBdBox(), PowerPoint3ParserInternal::State::getCustomShape(), PowerPoint7GraphInternal::State::getCustomShape(), getPath(), getType(), line(), measure(), MWAWGraphicShape(), MacDrawProParserInternal::Shape::operator<<, operator<<, path(), pie(), polygon(), polyline(), GreatWksGraph::readFrameHeader(), MacDrawProParser::readGeometryShapeData(), MacDraft5Parser::readObject(), MacDraftParser::readObject(), ClarisDrawGraph::readPolygonData(), ClarisWksGraph::readPolygonData(), ClarisWksGraph::readShape(), CricketDrawParser::readShape(), HanMacWrdJGraph::readShapeGraph(), HanMacWrdKGraph::readShapeGraph(), rectangle(), MacDrawProParser::send(), ClarisDrawGraph::sendShape(), ClarisWksGraph::sendShape(), WingzGraph::sendShape(), HanMacWrdJGraph::sendShapeGraph(), Canvas5Graph::sendSpecial(), CanvasGraph::sendSpecial(), FreeHandParserInternal::Shape::updateShape(), PowerPoint3ParserInternal::Polygon::updateShape(), and PowerPoint7GraphInternal::FramePolygon::updateShape().

## m_vertices

std::vector<MWAWVec2f> MWAWGraphicShape::m_vertices

the list of vertices for lines or polygons

Referenced by addTo(), cmp(), ApplePictParser::drawPolygon(), PowerPoint3ParserInternal::State::getCustomShape(), PowerPoint7GraphInternal::State::getCustomShape(), getPath(), line(), MWAWGraphicShape(), operator<<, GreatWksGraph::readFrameExtraData(), MacDrawProParser::readGeometryShapeData(), MacDraft5Parser::readObject(), MacDraftParser::readObject(), ClarisDrawGraph::readPolygonData(), ClarisWksGraph::readPolygonData(), CricketDrawParser::readShape(), HanMacWrdJGraph::readShapeGraph(), HanMacWrdKGraph::readShapeGraph(), scale(), Canvas5Graph::send(), Canvas5Image::send(), CanvasGraph::send(), ReadySetGoGraph::send(), ScoopParser::send(), CanvasGraph::sendMultiLines(), DrawTableParser::sendShape(), WingzGraph::sendShape(), Canvas5Graph::sendSpecial(), CanvasGraph::sendSpecial(), translate(), FreeHandParserInternal::Shape::updateShape(), PowerPoint3ParserInternal::Polygon::updateShape(), and PowerPoint7GraphInternal::FramePolygon::updateShape().

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

- MWAWGraphicShape.hxx
- MWAWGraphicShape.cxx