WPSGraphicShape Class Reference documentation

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

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

`#include <WPSGraphicShape.h>`

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

## Public Types
enum | Type { Arc , Circle , Line , 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
| WPSGraphicShape ()
| constructor More...
| WPSGraphicShape (WPSGraphicShape const &)=default
| WPSGraphicShape (WPSGraphicShape &&)=default
WPSGraphicShape & | operator= (WPSGraphicShape const &)=default
WPSGraphicShape & | operator= (WPSGraphicShape &&)=default
| ~WPSGraphicShape ()
| destructor More...
void | translate (Vec2f const &delta)
| translate all the coordinate by delta More...
void | scale (Vec2f const &factor)
| rescale all the coordinate More...
WPSGraphicShape | rotate (float angle, Vec2f const &center) const
| return a new shape corresponding to a rotation from center. More...
WPSGraphicShape | transform (WPSTransformation const &matrix) const
| returns a new shape corresponding to a matrix transformation More...
Type | getType () const
| returns the type corresponding to a shape More...
WPSBox2f | getBdBox () const
| returns the basic bdbox More...
Command | addTo (Vec2f const &orig, bool asSurface, librevenge::RVNGPropertyList &propList) const
| updates the propList to send to an interface More...
int | cmp (WPSGraphicShape const &a) const
| compare two shapes More...

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

## Public Attributes
Type | m_type
| the type More...
WPSBox2f | m_bdBox
| the shape bdbox More...
WPSBox2f | 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 (bool forTransformation) const
| return a path corresponding to the shape More...

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

## Detailed Description

a structure used to define a picture shape

## Member Enumeration Documentation

## ◆ Command

enum WPSGraphicShape::Command

an enum used to define the interface command

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

## ◆ Type

enum WPSGraphicShape::Type

an enum used to define the shape type

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

## Constructor & Destructor Documentation

## ◆ WPSGraphicShape() [1/3]

WPSGraphicShape::WPSGraphicShape | ( |  | ) |
| inline

constructor

## ◆ WPSGraphicShape() [2/3]

WPSGraphicShape::WPSGraphicShape | ( | WPSGraphicShape const & |  | ) |
| default

## ◆ WPSGraphicShape() [3/3]

WPSGraphicShape::WPSGraphicShape | ( | WPSGraphicShape && |  | ) |
| default

## ◆ ~WPSGraphicShape()

WPSGraphicShape::~WPSGraphicShape | ( |  | ) |
| inline

destructor

## Member Function Documentation

## ◆ addTo()

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

updates the propList to send to an interface

Referenced by WKSContentListener::insertPicture().

## ◆ arc()

static WPSGraphicShape WPSGraphicShape::arc | ( | WPSBox2f const & | box,
|  | WPSBox2f const & | circleWPSBox,
|  | Vec2f const & | angles
| ) |  |
| inlinestatic

static constructor to create a arc

Referenced by LotusGraphInternal::ZoneMac::getGraphicShape(), and LotusGraphInternal::ZonePc::getGraphicShape().

## ◆ circle()

static WPSGraphicShape WPSGraphicShape::circle | ( | WPSBox2f const & | box | ) |
| inlinestatic

static constructor to create a circle

Referenced by LotusGraphInternal::ZoneMac::getGraphicShape(), LotusGraphInternal::ZonePc::getGraphicShape(), LotusGraph::readGraphic(), QuattroGraph::readRect(), and Quattro9Graph::readShapeRec().

## ◆ cmp()

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

compare two shapes

## ◆ getBdBox()

WPSBox2f WPSGraphicShape::getBdBox | ( |  | ) | const
| inline

returns the basic bdbox

Referenced by Quattro9Graph::sendShape(), and LotusGraph::sendZone().

## ◆ getPath()

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

return a path corresponding to the shape

Referenced by rotate(), and transform().

## ◆ getType()

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

returns the type corresponding to a shape

Referenced by WKSContentListener::insertPicture().

## ◆ line()

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

static constructor to create a line

Referenced by LotusGraphInternal::ZoneMac::getGraphicShape(), LotusGraphInternal::ZonePc::getGraphicShape(), LotusGraph::readGraphic(), QuattroGraph::readLine(), and Quattro9Graph::readShapeRec().

## ◆ operator=() [1/2]

WPSGraphicShape & WPSGraphicShape::operator= | ( | WPSGraphicShape && |  | ) |
| default

## ◆ operator=() [2/2]

WPSGraphicShape & WPSGraphicShape::operator= | ( | WPSGraphicShape const & |  | ) |
| default

## ◆ path()

static WPSGraphicShape WPSGraphicShape::path | ( | WPSBox2f const & | box | ) |
| inlinestatic

static constructor to create a path

Referenced by LotusGraph::readGraphic(), Quattro9Graph::readShapeRec(), rotate(), and transform().

## ◆ pie()

static WPSGraphicShape WPSGraphicShape::pie | ( | WPSBox2f const & | box,
|  | WPSBox2f const & | circleWPSBox,
|  | Vec2f const & | angles
| ) |  |
| inlinestatic

static constructor to create a pie

## ◆ polygon()

static WPSGraphicShape WPSGraphicShape::polygon | ( | WPSBox2f const & | box | ) |
| inlinestatic

static constructor to create a polygon

Referenced by LotusGraphInternal::ZonePc::getGraphicShape(), LotusGraph::readGraphic(), QuattroGraph::readPolygon(), and Quattro9Graph::readShapeRec().

## ◆ polyline()

static WPSGraphicShape WPSGraphicShape::polyline | ( | WPSBox2f const & | box | ) |
| inlinestatic

static constructor to create a polyline

Referenced by QuattroGraph::readPolygon(), and Quattro9Graph::readShapeRec().

## ◆ rectangle()

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

static constructor to create a rectangle

Referenced by LotusGraphInternal::ZoneMac::getGraphicShape(), LotusGraphInternal::ZonePc::getGraphicShape(), LotusGraph::readGraphic(), QuattroGraph::readRect(), and Quattro9Graph::readShapeRec().

## ◆ rotate()

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

return a new shape corresponding to a rotation from center.

Note
  the final bdbox is not tight

## ◆ scale()

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

rescale all the coordinate

Referenced by transform().

## ◆ transform()

WPSGraphicShape WPSGraphicShape::transform | ( | WPSTransformation const & | matrix | ) | const

returns a new shape corresponding to a matrix transformation

Referenced by Quattro9Graph::sendShape(), and LotusGraph::sendZone().

## ◆ translate()

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

translate all the coordinate by delta

Referenced by transform().

## Friends And Related Function Documentation

## ◆ operator<<

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

a print operator

## Member Data Documentation

## ◆ m_arcAngles

Vec2f WPSGraphicShape::m_arcAngles

the start and end value which defines an arc

Referenced by addTo(), arc(), cmp(), getPath(), and pie().

## ◆ m_bdBox

WPSBox2f WPSGraphicShape::m_bdBox

the shape bdbox

Referenced by addTo(), arc(), circle(), cmp(), getBdBox(), line(), path(), pie(), polygon(), polyline(), rectangle(), rotate(), scale(), transform(), and translate().

## ◆ m_cornerWidth

Vec2f WPSGraphicShape::m_cornerWidth

the rectangle round corner

Referenced by addTo(), cmp(), getPath(), and rectangle().

## ◆ m_extra

std::string WPSGraphicShape::m_extra

extra data

## ◆ m_formBox

WPSBox2f WPSGraphicShape::m_formBox

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

Referenced by addTo(), arc(), circle(), cmp(), getPath(), pie(), rectangle(), scale(), and translate().

## ◆ m_path

std::vector<PathData> WPSGraphicShape::m_path

the list of path component

Referenced by addTo(), cmp(), getPath(), Quattro9Graph::readShapeRec(), rotate(), scale(), transform(), and translate().

## ◆ m_type

Type WPSGraphicShape::m_type

the type

Referenced by addTo(), arc(), circle(), WPSGraphicShape::PathData::cmp(), cmp(), WPSGraphicShape::PathData::get(), getPath(), getType(), line(), path(), pie(), polygon(), polyline(), rectangle(), WPSGraphicShape::PathData::rotate(), WPSGraphicShape::PathData::scale(), and WPSGraphicShape::PathData::transform().

## ◆ m_vertices

std::vector<Vec2f> WPSGraphicShape::m_vertices

the list of vertices for lines or polygons

Referenced by addTo(), cmp(), LotusGraphInternal::ZonePc::getGraphicShape(), getPath(), line(), Quattro9Graph::readShapeRec(), scale(), and translate().

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

- WPSGraphicShape.h
- WPSGraphicShape.cpp