MWAWGraphicShape Class Reference

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

#include <MWAWGraphicShape.hxx>

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

Public Member Functions

 MWAWGraphicShape ()
 constructor
virtual ~MWAWGraphicShape ()
 virtual destructor
void translate (Vec2f const &delta)
 translate all the coordinate by delta
MWAWGraphicShape rotate (float angle, Vec2f const &center) const
 return a new shape corresponding to a rotation from center.
Box2f getBdBox (MWAWGraphicStyle const &style, bool moveToO=false) const
 returns the bdbox corresponding to a style
bool send (MWAWGraphicInterface &interface, MWAWGraphicStyle const &style, Vec2f const &orig) const
 add shape to a graphic listener
int cmp (MWAWGraphicShape const &a) const
 compare two shapes

Static Public Member Functions

static MWAWGraphicShape line (Vec2f const &orign, Vec2f const &dest)
 static constructor to create a line
static MWAWGraphicShape rectangle (Box2f const &box, Vec2f const &corners=Vec2f(0, 0))
 static constructor to create a rectangle
static MWAWGraphicShape circle (Box2f const &box)
 static constructor to create a circle
static MWAWGraphicShape arc (Box2f const &box, Box2f const &circleBox, Vec2f const &angles)
 static constructor to create a arc
static MWAWGraphicShape pie (Box2f const &box, Box2f const &circleBox, Vec2f const &angles)
 static constructor to create a pie
static MWAWGraphicShape polygon (Box2f const &box)
 static constructor to create a polygon
static MWAWGraphicShape 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, MWAWGraphicShape const &sh)
 a print operator

Detailed Description

a structure used to define a picture shape


Member Enumeration Documentation

an enum used to define the shape type

Enumerator:
Arc 
Circle 
Line 
Rectangle 
Path 
Pie 
Polygon 
ShapeUnknown 

Constructor & Destructor Documentation

constructor

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

virtual destructor


Member Function Documentation

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

static constructor to create a arc

Referenced by MSKGraph::getEntryPicture(), and GWGraph::readFrameHeader().

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

static constructor to create a circle

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

compare two shapes

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

returns the bdbox corresponding to a style

Referenced by MWAWContentListener::insertPicture().

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

return a path corresponding to the shape

Referenced by rotate().

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

static constructor to create a path

Referenced by MSKGraph::getEntryPicture(), GWGraph::readFrameHeader(), and rotate().

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

static constructor to create a pie

Referenced by CWGraph::readShape().

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

static constructor to create a polygon

Referenced by MSKGraph::getEntryPicture(), and GWGraph::readFrameHeader().

static MWAWGraphicShape MWAWGraphicShape::rectangle ( Box2f const &  box,
Vec2f const &  corners = Vec2f(0,0) 
) [inline, static]
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 CWGraph::readShape().

bool MWAWGraphicShape::send ( MWAWGraphicInterface interface,
MWAWGraphicStyle const &  style,
Vec2f const &  orig 
) const

add shape to a graphic listener

Referenced by MWAWGraphicListener::insertPicture().

void MWAWGraphicShape::translate ( Vec2f const &  delta)

translate all the coordinate by delta

Referenced by CWGraph::readShape().


Friends And Related Function Documentation

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

a print operator


Member Data Documentation

extra data

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


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