Go to the documentation of this file.
23 #ifndef WPS_GRAPHIC_SHAPE
24 # define WPS_GRAPHIC_SHAPE
29 # include "librevenge/librevenge.h"
65 bool get(librevenge::RVNGPropertyList &pList,
Vec2f const &orig)
const;
191 Command addTo(
Vec2f const &orig,
bool asSurface, librevenge::RVNGPropertyList &propList)
const;
198 std::vector<PathData>
getPath(
bool forTransformation)
const;
std::vector< Vec2f > m_vertices
the list of vertices for lines or polygons
Definition: WPSGraphicShape.h:211
WPSBox2f m_bdBox
the shape bdbox
Definition: WPSGraphicShape.h:203
Vec2< T > center() const
the box center
Definition: libwps_internal.h:759
@ Polygon
Definition: WPSGraphicShape.h:38
static WPSGraphicShape rectangle(WPSBox2f const &box, Vec2f const &corners=Vec2f(0, 0))
static constructor to create a rectangle
Definition: WPSGraphicShape.h:109
Type getType() const
returns the type corresponding to a shape
Definition: WPSGraphicShape.h:181
WPSBox2< float > WPSBox2f
WPSBox2 of float.
Definition: libwps_internal.h:890
Vec2f m_r
the radius ( A command)
Definition: WPSGraphicShape.h:79
PathData(char type, Vec2f const &x=Vec2f(), Vec2f const &x1=Vec2f(), Vec2f const &x2=Vec2f())
constructor
Definition: WPSGraphicShape.h:45
Type
an enum used to define the shape type
Definition: WPSGraphicShape.h:38
a simple path component
Definition: WPSGraphicShape.h:43
WPSGraphicShape & operator=(WPSGraphicShape const &)=default
#define M_PI
Definition: libwps_internal.h:43
@ Line
Definition: WPSGraphicShape.h:38
void scale(Vec2f const &factor)
scale all the coordinate by a factor
Definition: WPSGraphicShape.cpp:91
int cmp(Vec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libwps_internal.h:647
static WPSGraphicShape circle(WPSBox2f const &box)
static constructor to create a circle
Definition: WPSGraphicShape.h:118
@ C_Path
Definition: WPSGraphicShape.h:40
std::string m_extra
extra data
Definition: WPSGraphicShape.h:215
void transform(WPSTransformation const &matrix, float rotation)
multiply all the coordinate by a matrix
Definition: WPSGraphicShape.cpp:126
WPSGraphicShape(WPSGraphicShape &&)=default
Vec2f m_x1
x1 value
Definition: WPSGraphicShape.h:75
Command addTo(Vec2f const &orig, bool asSurface, librevenge::RVNGPropertyList &propList) const
updates the propList to send to an interface
Definition: WPSGraphicShape.cpp:396
@ C_Polygon
Definition: WPSGraphicShape.h:40
a structure used to define a picture shape
Definition: WPSGraphicShape.h:35
WPSGraphicShape()
constructor
Definition: WPSGraphicShape.h:89
Command
an enum used to define the interface command
Definition: WPSGraphicShape.h:40
Vec2< float > Vec2f
Vec2 of float.
Definition: libwps_internal.h:704
int cmp(PathData const &a) const
comparison function
Definition: WPSGraphicShape.cpp:188
std::ostream & operator<<(std::ostream &o, WPSGraphicShape::PathData const &path)
Definition: WPSGraphicShape.cpp:41
WPSGraphicShape & operator=(WPSGraphicShape &&)=default
#define WPS_DEBUG_MSG(M)
Definition: libwps_internal.h:134
bool m_sweep
sweep value ( A command)
Definition: WPSGraphicShape.h:85
Vec2f m_x2
x2 value
Definition: WPSGraphicShape.h:77
#define WPS_FALLTHROUGH
fall through attributes
Definition: libwps_internal.h:82
@ Path
Definition: WPSGraphicShape.h:38
T x() const
first element
Definition: libwps_internal.h:542
@ C_Polyline
Definition: WPSGraphicShape.h:40
@ Rectangle
Definition: WPSGraphicShape.h:38
@ C_Rectangle
Definition: WPSGraphicShape.h:40
static WPSGraphicShape polyline(WPSBox2f const &box)
static constructor to create a polyline
Definition: WPSGraphicShape.h:154
@ C_Ellipse
Definition: WPSGraphicShape.h:40
WPSBox2f m_formBox
the internal shape bdbox ( used for arc, circle to store the circle bdbox )
Definition: WPSGraphicShape.h:205
void translate(Vec2f const &delta)
translate all the coordinate by delta
Definition: WPSGraphicShape.cpp:78
Vec2f m_cornerWidth
the rectangle round corner
Definition: WPSGraphicShape.h:207
@ ShapeUnknown
Definition: WPSGraphicShape.h:38
int cmp(WPSGraphicShape const &a) const
compare two shapes
Definition: WPSGraphicShape.cpp:286
void rotate(float angle, Vec2f const &delta)
rotate all the coordinate by angle (origin rotation) then translate coordinate
Definition: WPSGraphicShape.cpp:104
static WPSGraphicShape pie(WPSBox2f const &box, WPSBox2f const &circleWPSBox, Vec2f const &angles)
static constructor to create a pie
Definition: WPSGraphicShape.h:136
bool m_largeAngle
large angle ( A command)
Definition: WPSGraphicShape.h:83
@ Arc
Definition: WPSGraphicShape.h:38
Vec2< T > const & min() const
the minimum 2D point (in x and in y)
Definition: libwps_internal.h:725
WPSGraphicShape(WPSGraphicShape const &)=default
@ C_Bad
Definition: WPSGraphicShape.h:40
WPSGraphicShape rotate(float angle, Vec2f const ¢er) const
return a new shape corresponding to a rotation from center.
Definition: WPSGraphicShape.cpp:340
Vec2f m_x
the main x value
Definition: WPSGraphicShape.h:73
static WPSGraphicShape line(Vec2f const &orign, Vec2f const &dest)
static constructor to create a line
Definition: WPSGraphicShape.cpp:212
WPSBox2f getBdBox() const
returns the basic bdbox
Definition: WPSGraphicShape.h:186
std::vector< PathData > m_path
the list of path component
Definition: WPSGraphicShape.h:213
void translate(Vec2f const &delta)
translate all the coordinate by delta
Definition: WPSGraphicShape.cpp:315
static WPSGraphicShape arc(WPSBox2f const &box, WPSBox2f const &circleWPSBox, Vec2f const &angles)
static constructor to create a arc
Definition: WPSGraphicShape.h:126
Vec2< T > const & max() const
the maximum 2D point (in x and in y)
Definition: libwps_internal.h:730
void scale(Vec2f const &factor)
rescale all the coordinate
Definition: WPSGraphicShape.cpp:327
Type m_type
the type
Definition: WPSGraphicShape.h:201
@ Pie
Definition: WPSGraphicShape.h:38
WPSGraphicShape transform(WPSTransformation const &matrix) const
returns a new shape corresponding to a matrix transformation
Definition: WPSGraphicShape.cpp:364
bool get(librevenge::RVNGPropertyList &pList, Vec2f const &orig) const
update the property list to correspond to a command
Definition: WPSGraphicShape.cpp:144
Vec2< T > size() const
the box size
Definition: libwps_internal.h:754
Vec2f m_arcAngles
the start and end value which defines an arc
Definition: WPSGraphicShape.h:209
int cmp(WPSBox2< T > const &p) const
comparison function : fist sorts min by Y,X values then max extremity
Definition: libwps_internal.h:850
WPSBox2< T > getUnion(WPSBox2< T > const &box) const
returns the union between this and box
Definition: libwps_internal.h:813
@ Polyline
Definition: WPSGraphicShape.h:38
std::vector< PathData > getPath(bool forTransformation) const
return a path corresponding to the shape
Definition: WPSGraphicShape.cpp:542
float m_rotate
the rotate ( A command)
Definition: WPSGraphicShape.h:81
char m_type
the type: M, L, ...
Definition: WPSGraphicShape.h:71
static WPSGraphicShape path(WPSBox2f const &box)
static constructor to create a path
Definition: WPSGraphicShape.h:162
friend std::ostream & operator<<(std::ostream &o, PathData const &path)
a print operator
Definition: WPSGraphicShape.cpp:41
T y() const
second element
Definition: libwps_internal.h:547
static WPSGraphicShape polygon(WPSBox2f const &box)
static constructor to create a polygon
Definition: WPSGraphicShape.h:146
~WPSGraphicShape()
destructor
Definition: WPSGraphicShape.h:105
@ Circle
Definition: WPSGraphicShape.h:38
friend std::ostream & operator<<(std::ostream &o, WPSGraphicShape const &sh)
a print operator
Definition: WPSGraphicShape.cpp:231
Generated on Mon Sep 7 2020 20:00:03 for libwps by
doxygen 1.8.20