WPSGraphicShape Class Reference

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

#include <WPSGraphicShape.h>

List of all members.

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

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

Static Public Member Functions

static WPSGraphicShape line (Vec2f const &orign, Vec2f const &dest)
 static constructor to create a line
static WPSGraphicShape rectangle (Box2f const &box, Vec2f const &corners=Vec2f(0, 0))
 static constructor to create a rectangle
static WPSGraphicShape circle (Box2f const &box)
 static constructor to create a circle
static WPSGraphicShape arc (Box2f const &box, Box2f const &circleBox, Vec2f const &angles)
 static constructor to create a arc
static WPSGraphicShape pie (Box2f const &box, Box2f const &circleBox, Vec2f const &angles)
 static constructor to create a pie
static WPSGraphicShape polygon (Box2f const &box)
 static constructor to create a polygon
static WPSGraphicShape path (Box2f const &box)
 static constructor to create a path

Public Attributes

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

Protected Member Functions

std::vector< PathDatagetPath () const
 return a path corresponding to the shape

Friends

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

Detailed Description

a structure used to define a picture shape


Member Enumeration Documentation

an enum used to define the interface command

Enumerator:
C_Ellipse 
C_Polyline 
C_Rectangle 
C_Path 
C_Polygon 
C_Bad 

an enum used to define the shape type

Enumerator:
Arc 
Circle 
Line 
Rectangle 
Path 
Pie 
Polygon 
ShapeUnknown 

Constructor & Destructor Documentation

constructor

virtual WPSGraphicShape::~WPSGraphicShape ( ) [inline, virtual]

virtual destructor


Member Function Documentation

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().

static WPSGraphicShape WPSGraphicShape::arc ( Box2f const &  box,
Box2f const &  circleBox,
Vec2f const &  angles 
) [inline, static]

static constructor to create a arc

Referenced by LotusGraphInternal::Zone::getGraphicShape().

static WPSGraphicShape WPSGraphicShape::circle ( Box2f const &  box) [inline, static]

static constructor to create a circle

Referenced by LotusGraphInternal::Zone::getGraphicShape().

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

compare two shapes

Box2f WPSGraphicShape::getBdBox ( ) const [inline]

returns the basic bdbox

std::vector< WPSGraphicShape::PathData > WPSGraphicShape::getPath ( ) const [protected]

return a path corresponding to the shape

Referenced by rotate().

Type WPSGraphicShape::getType ( ) const [inline]

returns the type corresponding to a shape

Referenced by WKSContentListener::insertPicture().

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

static constructor to create a line

Referenced by LotusGraphInternal::Zone::getGraphicShape().

static WPSGraphicShape WPSGraphicShape::path ( Box2f const &  box) [inline, static]

static constructor to create a path

Referenced by rotate().

static WPSGraphicShape WPSGraphicShape::pie ( Box2f const &  box,
Box2f const &  circleBox,
Vec2f const &  angles 
) [inline, static]

static constructor to create a pie

static WPSGraphicShape WPSGraphicShape::polygon ( Box2f const &  box) [inline, static]

static constructor to create a polygon

static WPSGraphicShape WPSGraphicShape::rectangle ( Box2f const &  box,
Vec2f const &  corners = Vec2f(0,0) 
) [inline, static]

static constructor to create a rectangle

Referenced by LotusGraphInternal::Zone::getGraphicShape().

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
void WPSGraphicShape::scale ( Vec2f const &  factor)

rescale all the coordinate

void WPSGraphicShape::translate ( Vec2f const &  delta)

translate all the coordinate by delta


Friends And Related Function Documentation

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

a print operator


Member Data Documentation

the start and end value which defines an arc

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

the rectangle round corner

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

extra data

Referenced by operator<<().

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

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

the list of path component

Referenced by addTo(), cmp(), getPath(), operator<<(), rotate(), scale(), and translate().

the list of vertices for lines or polygons

Referenced by addTo(), cmp(), getPath(), line(), operator<<(), scale(), and translate().


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