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

Static Public Member Functions

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

Public Attributes

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

Friends

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

Detailed Description

a structure used to define a picture shape

Member Enumeration Documentation

◆ Command

an enum used to define the interface command

Enumerator
C_Ellipse 
C_Polyline 
C_Rectangle 
C_Path 
C_Polygon 
C_Bad 

◆ 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

◆ 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

◆ arc()

◆ circle()

◆ cmp()

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

compare two shapes

◆ getBdBox() [1/2]

◆ 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

◆ line()

◆ 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 const &  )
default

◆ operator=() [2/2]

MWAWGraphicShape& MWAWGraphicShape::operator= ( MWAWGraphicShape &&  )
default

◆ path()

◆ pie()

◆ polygon()

◆ polyline()

static MWAWGraphicShape MWAWGraphicShape::polyline ( MWAWBox2f const &  box)
inlinestatic

◆ rectangle()

◆ 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 ClarisWksGraph::readShape(), PowerPoint7Graph::sendFrame(), PowerPoint3Parser::sendFrame(), MacDraft5ParserInternal::Shape::transform(), and MacDraftParserInternal::Shape::transform().

◆ scale()

◆ transform()

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

returns a new shape corresponding to a matrix transformation

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

◆ translate()

Friends And Related Function 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(), operator<<(), pie(), HanMacWrdJGraph::readShapeGraph(), and HanMacWrdKGraph::readShapeGraph().

◆ m_bdBox

◆ m_cornerWidth

◆ m_extra

std::string MWAWGraphicShape::m_extra

extra data

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

◆ m_formBox

◆ m_path

◆ m_type

◆ m_vertices


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

Generated for libmwaw by doxygen 1.8.14