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...
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
virtual ~MWAWGraphicShape ()
 virtual 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.
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
int cmp (MWAWGraphicShape const &a) const
 compare two shapes

Static Public Member Functions

static MWAWGraphicShape line (MWAWVec2f const &orign, MWAWVec2f const &dest)
 static constructor to create a line
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 polygon (MWAWBox2f const &box)
 static constructor to create a polygon
static MWAWGraphicShape path (MWAWBox2f const &box)
 static constructor to create a path

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< MWAWVec2fm_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 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 MWAWGraphicShape::~MWAWGraphicShape ( ) [inline, virtual]

virtual destructor


Member Function Documentation

MWAWGraphicShape::Command MWAWGraphicShape::addTo ( MWAWVec2f const &  orig,
bool  asSurface,
librevenge::RVNGPropertyList &  propList 
) const
static MWAWGraphicShape MWAWGraphicShape::arc ( MWAWBox2f const &  box,
MWAWBox2f const &  circleBox,
MWAWVec2f const &  angles 
) [inline, static]
int MWAWGraphicShape::cmp ( MWAWGraphicShape const &  a) const

compare two shapes

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

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

static constructor to create a path

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

static MWAWGraphicShape MWAWGraphicShape::polygon ( MWAWBox2f const &  box) [inline, static]
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 ClarisDrawGraph::readShape(), ClarisWksGraph::readShape(), and MacDraftParserInternal::Shape::transform().

void MWAWGraphicShape::scale ( MWAWVec2f const &  factor)

rescale all the coordinate

Referenced by MacDraftParserInternal::Shape::transform().


Friends And Related Function Documentation

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

a print operator


Member Data Documentation


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