IWORKShape.h Source File documentation

IWORKShape.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3 * This file is part of the libetonyek project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10 #ifndef IWORKSHAPE_H_INCLUDED
11 #define IWORKSHAPE_H_INCLUDED
12
13 #include <memory>
14
15 #include "IWORKPath_fwd.h"
16 #include "IWORKStyle.h"
17 #include "IWORKText_fwd.h"
18
19 namespace libetonyek
20 {
21
22 struct IWORKSize;
23
26 struct IWORKShape
27 {
28 IWORKGeometryPtr_t m_geometry;
29 IWORKStylePtr_t m_style;
30 boost::optional<int> m_order;
31 IWORKPathPtr_t m_path;
32 IWORKTextPtr_t m_text;
33 bool m_locked;
34
35 IWORKShape();
36 };
37
38 typedef std::shared_ptr<IWORKShape> IWORKShapePtr_t;
39
42 IWORKPathPtr_t makePolygonPath(const IWORKSize &size, unsigned edges);
43 IWORKPathPtr_t makeRoundedRectanglePath(const IWORKSize &size, double radius);
44
45 IWORKPathPtr_t makeArrowPath(const IWORKSize &size, double headWidth, double stemThickness);
46 IWORKPathPtr_t makeDoubleArrowPath(const IWORKSize &size, double headWidth, double stemThickness);
47 IWORKPathPtr_t makeStarPath(const IWORKSize &size, unsigned points, double innerRadius);
48
49 IWORKPathPtr_t makeCalloutPath(const IWORKSize &size, double radius, double tailSize, double tailX, double tailY);
50 IWORKPathPtr_t makeQuoteBubblePath(const IWORKSize &size, double radius, double tailSize, double tailX, double tailY);
51
52 }
53
54 #endif // IWORKSHAPE_H_INCLUDED
55
56 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek::IWORKToken::point
@ point
Definition: IWORKToken.h:366
libetonyek::IWORKShapePtr_t
std::shared_ptr< IWORKShape > IWORKShapePtr_t
Definition: IWORKShape.h:38
m_style
IWORKStylePtr_t m_style
Definition: IWORKPropertyMapElement.cpp:172
libetonyek
Definition: IWORKBezierElement.cpp:20
IWORKShape.h
libetonyek::IWORKShape::m_text
IWORKTextPtr_t m_text
Definition: IWORKShape.h:32
libetonyek::transformations::rotate
glm::dmat3 rotate(const double angle)
Rotate counterclockwise around origin.
Definition: IWORKTransformation.cpp:65
libetonyek::KEY1Token::tr
@ tr
Definition: KEY1Token.h:206
libetonyek::IWORKPath
Definition: IWORKPath.h:28
IWORKText_fwd.h
libetonyek::IWORKShape
Representation of a shape.
Definition: IWORKShape.h:26
libetonyek::makeStarPath
IWORKPathPtr_t makeStarPath(const IWORKSize &size, const unsigned points, const double innerRadius)
Definition: IWORKShape.cpp:258
m_order
const boost::optional< int > m_order
Definition: IWORKRecorder.cpp:81
ETONYEK_DEBUG_MSG
#define ETONYEK_DEBUG_MSG(M)
Definition: libetonyek_utils.h:54
libetonyek::IWORKToken::n
@ n
Definition: IWORKToken.h:328
libetonyek::KEY2Token::i
@ i
Definition: KEY2Token.h:101
libetonyek::transformations::flip
glm::dmat3 flip(const bool horizontal, const bool vertical)
Flip horizontally and/or vertically.
Definition: IWORKTransformation.cpp:60
libetonyek::IWORKShape::m_order
boost::optional< int > m_order
Definition: IWORKShape.h:30
libetonyek::IWORKTextPtr_t
std::shared_ptr< IWORKText > IWORKTextPtr_t
Definition: IWORKText_fwd.h:18
IWORKTransformation.h
libetonyek::makeCalloutPath
IWORKPathPtr_t makeCalloutPath(const IWORKSize &size, const double radius, const double tailSize, const double tailX, const double tailY)
Definition: IWORKShape.cpp:288
libetonyek::etonyek_two_pi
const double etonyek_two_pi(6.28318530717958647692528676655900576839433879875021164194988918461563281257241799725606965068423413596429617303e+00)
libetonyek::IWORKToken::path
@ path
Definition: IWORKToken.h:358
libetonyek::makeArrowPath
IWORKPathPtr_t makeArrowPath(const IWORKSize &size, const double headWidth, const double stemThickness)
Definition: IWORKShape.cpp:216
libetonyek::IWORKToken::right
@ right
Definition: IWORKToken.h:597
libetonyek::IWORKToken::size
@ size
Definition: IWORKToken.h:395
libetonyek::makePolygonPath
IWORKPathPtr_t makePolygonPath(const IWORKSize &size, const unsigned edges)
Path creator functions for stock shapes.
Definition: IWORKShape.cpp:175
m_locked
const bool m_locked
Definition: IWORKRecorder.cpp:82
IWORKPath.h
libetonyek::IWORKToken::left
@ left
Definition: IWORKToken.h:568
m_tr
const glm::dmat3 & m_tr
Definition: IWORKShape.cpp:165
libetonyek::approxEqual
bool approxEqual(const IWORKPath &left, const IWORKPath &right, double eps=ETONYEK_EPSILON)
m_path
IWORKPathPtr_t m_path
Definition: IWORKPathElement.cpp:284
libetonyek::IWORKPathPtr_t
std::shared_ptr< IWORKPath > IWORKPathPtr_t
Definition: IWORKPath_fwd.h:20
m_geometry
const IWORKGeometryPtr_t m_geometry
Definition: IWORKRecorder.cpp:56
libetonyek::transformations::translate
glm::dmat3 translate(const double offsetX, const double offsetY)
Translate along x and/or y axis.
Definition: IWORKTransformation.cpp:83
libetonyek::makeDoubleArrowPath
IWORKPathPtr_t makeDoubleArrowPath(const IWORKSize &size, const double headWidth, const double stemThickness)
Definition: IWORKShape.cpp:233
IWORKDocumentInterface.h
libetonyek::IWORKShape::m_geometry
IWORKGeometryPtr_t m_geometry
Definition: IWORKShape.h:28
IWORKText.h
libetonyek::IWORKShape::m_path
IWORKPathPtr_t m_path
Definition: IWORKShape.h:31
libetonyek::IWORKToken::angle
@ angle
Definition: IWORKToken.h:505
libetonyek::makeRoundedRectanglePath
IWORKPathPtr_t makeRoundedRectanglePath(const IWORKSize &size, const double radius)
Definition: IWORKShape.cpp:189
libetonyek::IWORKToken::tail
@ tail
Definition: IWORKToken.h:463
IWORKTypes.h
y
double y
Definition: IWORKShape.cpp:46
libetonyek::IWORKSize
Definition: IWORKTypes.h:44
libetonyek::IWORKShape::IWORKShape
IWORKShape()
Definition: IWORKShape.cpp:30
x
double x
Definition: IWORKShape.cpp:45
libetonyek::IWORKToken::tailSize
@ tailSize
Definition: IWORKToken.h:617
libetonyek::IWORKShape::m_style
IWORKStylePtr_t m_style
Definition: IWORKShape.h:29
libetonyek::IWORKGeometryPtr_t
std::shared_ptr< IWORKGeometry > IWORKGeometryPtr_t
Definition: IWORKTypes_fwd.h:41
libetonyek::IWORKStylePtr_t
std::shared_ptr< IWORKStyle > IWORKStylePtr_t
Definition: IWORKStyle_fwd.h:21
libetonyek::IWORKToken::scale
@ scale
Definition: IWORKToken.h:600
IWORKPath_fwd.h
m_text
librevenge::RVNGString m_text
Definition: IWORKOutputElements.cpp:295
libetonyek::makeQuoteBubblePath
IWORKPathPtr_t makeQuoteBubblePath(const IWORKSize &size, const double radius, const double tailSize, const double tailX, const double tailY)
Definition: IWORKShape.cpp:430
libetonyek::IWORKShape::m_locked
bool m_locked
Definition: IWORKShape.h:33
ETONYEK_EPSILON
#define ETONYEK_EPSILON
Definition: libetonyek_utils.h:26
libetonyek::KEY1Token::radius
@ radius
Definition: KEY1Token.h:185
IWORKStyle.h
libetonyek::operator==
bool operator==(const IWORKPath &left, const IWORKPath &right)