geometry.h Source File documentation

geometry.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 libpagemaker 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 __LIBPAGEMAKER_GEOMETRY_H__
11 #define __LIBPAGEMAKER_GEOMETRY_H__
12
13 #include <vector>
14
15 #include <librevenge/librevenge.h>
16
17 #include "PMDTypes.h"
18 #include "Units.h"
19 #include "constants.h"
20 #include "libpagemaker_utils.h"
21
22 namespace libpagemaker
23 {
24 template <typename Unit> struct Point
25 {
26 Unit m_x;
27 Unit m_y;
28
29 Point(Unit x, Unit y) : m_x(x), m_y(y)
30 { }
31 };
32
33 typedef Point<PMDShapeUnit> PMDShapePoint;
34 typedef Point<double> InchPoint;
35
36 struct PMDXForm
37 {
38 uint32_t m_rotationDegree;
39 uint32_t m_skewDegree;
40 PMDShapePoint m_xformTopLeft;
41 PMDShapePoint m_xformBotRight;
42 PMDShapePoint m_rotatingPoint;
43 uint32_t m_xformId;
44
45 PMDXForm(const uint32_t rotationDegree, const uint32_t skewDegree, const PMDShapePoint xformTopLeft, const PMDShapePoint xformBotRight, const PMDShapePoint rotatingPoint, const uint32_t xformId)
46 : m_rotationDegree(rotationDegree), m_skewDegree(skewDegree), m_xformTopLeft(xformTopLeft), m_xformBotRight(xformBotRight), m_rotatingPoint(rotatingPoint), m_xformId(xformId)
47 { }
48 };
49
50 class PMDLineSet
51 {
52 public:
53 virtual std::vector<PMDShapePoint> getPoints() const = 0;
54 virtual bool getIsClosed() const = 0;
55 virtual double getRotation() const = 0;
56 virtual double getSkew() const = 0;
57 virtual PMDShapePoint getRotatingPoint() const = 0;
58 virtual PMDShapePoint getXformTopLeft() const = 0;
59 virtual PMDShapePoint getXformBotRight() const = 0;
60 virtual uint8_t shapeType() const = 0;
61 virtual PMDShapePoint getBboxTopLeft() const = 0;
62 virtual PMDShapePoint getBboxBotRight() const = 0;
63 virtual PMDFillProperties getFillProperties() const = 0;
64 virtual PMDStrokeProperties getStrokeProperties() const = 0;
65 virtual std::string getText() const = 0;
66 virtual std::vector<PMDCharProperties> getCharProperties() const = 0;
67 virtual std::vector<PMDParaProperties> getParaProperties() const = 0;
68 virtual librevenge::RVNGBinaryData getBitmap() const = 0;
69
70
71 virtual ~PMDLineSet()
72 {
73 }
74 };
75
76 class PMDLine : public PMDLineSet
77 {
78 PMDShapePoint m_bboxTopLeft;
79 PMDShapePoint m_bboxBotRight;
80 bool m_mirrored;
81 PMDStrokeProperties m_strokeProps;
82
83 public:
84 PMDLine(const PMDShapePoint &bboxTopLeft, const PMDShapePoint &bboxBotRight, const bool mirrored, const PMDStrokeProperties strokeProps)
85 : m_bboxTopLeft(bboxTopLeft), m_bboxBotRight(bboxBotRight), m_mirrored(mirrored), m_strokeProps(strokeProps)
86 { }
87
88 double getRotation() const override
89 {
90 return 0;
91 }
92
93 double getSkew() const override
94 {
95 return 0;
96 }
97
98 PMDShapePoint getXformTopLeft() const override
99 {
100 return PMDShapePoint(0,0);
101 }
102
103 PMDShapePoint getXformBotRight() const override
104 {
105 return PMDShapePoint(0,0);
106 }
107
108 PMDShapePoint getRotatingPoint() const override
109 {
110 return PMDShapePoint(0,0);
111 }
112
113 bool getIsClosed() const override
114 {
115 return false;
116 }
117
118 PMDShapePoint getBboxTopLeft() const override
119 {
120 return m_bboxTopLeft;
121 }
122
123 PMDShapePoint getBboxBotRight() const override
124 {
125 return m_bboxBotRight;
126 }
127
128 std::vector<PMDShapePoint> getPoints() const override
129 {
130 std::vector<PMDShapePoint> points;
131
132 if (m_mirrored)
133 {
134 points.push_back(PMDShapePoint(m_bboxBotRight.m_x,m_bboxTopLeft.m_y));
135 points.push_back(PMDShapePoint(m_bboxTopLeft.m_x,m_bboxBotRight.m_y));
136 }
137 else
138 {
139 points.push_back(m_bboxTopLeft);
140 points.push_back(m_bboxBotRight);
141 }
142 return points;
143 }
144
145 uint8_t shapeType() const override
146 {
147 return SHAPE_TYPE_LINE;
148 }
149
150 PMDFillProperties getFillProperties() const override
151 {
152 PMDFillProperties props;
153 props.m_fillType = FILL_SOLID;
154 return props;
155 }
156
157 PMDStrokeProperties getStrokeProperties() const override
158 {
159 return m_strokeProps;
160 }
161
162 std::string getText() const override
163 {
164 return "";
165 }
166
167 std::vector<PMDCharProperties> getCharProperties() const override
168 {
169 return std::vector<PMDCharProperties>(1);
170 }
171
172 std::vector<PMDParaProperties> getParaProperties() const override
173 {
174 return std::vector<PMDParaProperties>(1);
175 }
176
177 librevenge::RVNGBinaryData getBitmap() const override
178 {
179 librevenge::RVNGBinaryData temp;
180 return temp;
181 }
182
183 ~PMDLine() override
184 {
185 }
186 };
187
188
189 class PMDPolygon : public PMDLineSet
190 {
191 std::vector<PMDShapePoint> m_points;
192 bool m_isClosed;
193 PMDShapePoint m_bboxTopLeft;
194 PMDShapePoint m_bboxBotRight;
195 PMDXForm m_xFormContainer;
196 PMDFillProperties m_fillProps;
197 PMDStrokeProperties m_strokeProps;
198
199 public:
200 PMDPolygon(std::vector<PMDShapePoint> points, bool isClosed, const PMDShapePoint &bboxTopLeft, const PMDShapePoint &bboxBotRight, const PMDXForm &xFormContainer, const PMDFillProperties fillProps, const PMDStrokeProperties strokeProps)
201 : m_points(points), m_isClosed(isClosed), m_bboxTopLeft(bboxTopLeft), m_bboxBotRight(bboxBotRight), m_xFormContainer(xFormContainer), m_fillProps(fillProps), m_strokeProps(strokeProps)
202 { }
203
204 double getRotation() const override
205 {
206 auto temp = (int32_t)m_xFormContainer.m_rotationDegree;
207 return (-1 * (double)temp/1000 * (M_PI/180));
208 }
209
210 double getSkew() const override
211 {
212 auto temp = (int32_t)m_xFormContainer.m_skewDegree;
213 return (-1 * (double)temp/1000 * (M_PI/180));
214 }
215
216 PMDShapePoint getXformTopLeft() const override
217 {
218 return m_xFormContainer.m_xformTopLeft;
219 }
220
221 PMDShapePoint getXformBotRight() const override
222 {
223 return m_xFormContainer.m_xformBotRight;
224 }
225
226 PMDShapePoint getRotatingPoint() const override
227 {
228 return m_xFormContainer.m_rotatingPoint;
229 }
230
231 PMDShapePoint getBboxTopLeft() const override
232 {
233 return m_bboxTopLeft;
234 }
235
236 PMDShapePoint getBboxBotRight() const override
237 {
238 return m_bboxBotRight;
239 }
240
241 bool getIsClosed() const override
242 {
243 return m_isClosed;
244 }
245
246 std::vector<PMDShapePoint> getPoints() const override
247 {
248 return m_points;
249 }
250
251 uint8_t shapeType() const override
252 {
253 return SHAPE_TYPE_POLY;
254 }
255
256 PMDFillProperties getFillProperties() const override
257 {
258 return m_fillProps;
259 }
260
261 PMDStrokeProperties getStrokeProperties() const override
262 {
263 return m_strokeProps;
264 }
265
266 std::string getText() const override
267 {
268 return "";
269 }
270
271 std::vector<PMDCharProperties> getCharProperties() const override
272 {
273 return std::vector<PMDCharProperties>(1);
274 }
275
276 std::vector<PMDParaProperties> getParaProperties() const override
277 {
278 return std::vector<PMDParaProperties>(1);
279 }
280
281 librevenge::RVNGBinaryData getBitmap() const override
282 {
283 librevenge::RVNGBinaryData temp;
284 return temp;
285 }
286
287 ~PMDPolygon() override
288 {
289 }
290 };
291
292 class PMDTextBox : public PMDLineSet
293 {
294 PMDShapePoint m_bboxTopLeft;
295 PMDShapePoint m_bboxBotRight;
296 PMDXForm m_xFormContainer;
297 std::string m_text;
298 std::vector<PMDCharProperties> m_charProps;
299 std::vector<PMDParaProperties> m_paraProps;
300
301 public:
302 PMDTextBox(const PMDShapePoint &bboxTopLeft, const PMDShapePoint &bboxBotRight, const PMDXForm &xFormContainer, const std::string text, const std::vector<PMDCharProperties> charProps, const std::vector<PMDParaProperties> paraProps)
303 : m_bboxTopLeft(bboxTopLeft), m_bboxBotRight(bboxBotRight),m_xFormContainer(xFormContainer), m_text(text), m_charProps(charProps), m_paraProps(paraProps)
304 { }
305
306 double getRotation() const override
307 {
308 auto temp = (int32_t)m_xFormContainer.m_rotationDegree;
309 return (-1 * (double)temp/1000 * (M_PI/180));
310 }
311
312 double getSkew() const override
313 {
314 auto temp = (int32_t)m_xFormContainer.m_skewDegree;
315 return (-1 * (double)temp/1000 * (M_PI/180));
316 }
317
318 PMDShapePoint getXformTopLeft() const override
319 {
320 return m_xFormContainer.m_xformTopLeft;
321 }
322
323 PMDShapePoint getXformBotRight() const override
324 {
325 return m_xFormContainer.m_xformBotRight;
326 }
327
328 PMDShapePoint getRotatingPoint() const override
329 {
330 return m_xFormContainer.m_rotatingPoint;
331 }
332
333 PMDShapePoint getBboxTopLeft() const override
334 {
335 return m_bboxTopLeft;
336 }
337
338 PMDShapePoint getBboxBotRight() const override
339 {
340 return m_bboxBotRight;
341 }
342
343 bool getIsClosed() const override
344 {
345 return true;
346 }
347
348 std::vector<PMDShapePoint> getPoints() const override
349 {
350 std::vector<PMDShapePoint> points;
351
352 points.push_back(m_bboxTopLeft);
353
354 return points;
355 }
356
357 uint8_t shapeType() const override
358 {
359 return SHAPE_TYPE_TEXTBOX;
360 }
361
362 PMDFillProperties getFillProperties() const override
363 {
364 return PMDFillProperties();
365 }
366
367 PMDStrokeProperties getStrokeProperties() const override
368 {
369 return PMDStrokeProperties();
370 }
371
372 std::string getText() const override
373 {
374 return m_text;
375 }
376
377 std::vector<PMDCharProperties> getCharProperties() const override
378 {
379 return m_charProps;
380 }
381
382 std::vector<PMDParaProperties> getParaProperties() const override
383 {
384 return m_paraProps;
385 }
386
387 librevenge::RVNGBinaryData getBitmap() const override
388 {
389 librevenge::RVNGBinaryData temp;
390 return temp;
391 }
392
393 ~PMDTextBox() override
394 {
395 }
396 };
397
398 class PMDRectangle : public PMDLineSet
399 {
400 PMDShapePoint m_bboxTopLeft;
401 PMDShapePoint m_bboxBotRight;
402 PMDXForm m_xFormContainer;
403 PMDFillProperties m_fillProps;
404 PMDStrokeProperties m_strokeProps;
405
406 public:
407 PMDRectangle(const PMDShapePoint &bboxTopLeft, const PMDShapePoint &bboxBotRight, const PMDXForm &xFormContainer, const PMDFillProperties fillProps, const PMDStrokeProperties strokeProps)
408 : m_bboxTopLeft(bboxTopLeft), m_bboxBotRight(bboxBotRight),m_xFormContainer(xFormContainer), m_fillProps(fillProps), m_strokeProps(strokeProps)
409 { }
410
411 double getRotation() const override
412 {
413 auto temp = (int32_t)m_xFormContainer.m_rotationDegree;
414 return (-1 * (double)temp/1000 * (M_PI/180));
415 }
416
417 double getSkew() const override
418 {
419 auto temp = (int32_t)m_xFormContainer.m_skewDegree;
420 return (-1 * (double)temp/1000 * (M_PI/180));
421 }
422
423 PMDShapePoint getXformTopLeft() const override
424 {
425 return m_xFormContainer.m_xformTopLeft;
426 }
427
428 PMDShapePoint getXformBotRight() const override
429 {
430 return m_xFormContainer.m_xformBotRight;
431 }
432
433 PMDShapePoint getRotatingPoint() const override
434 {
435 return m_xFormContainer.m_rotatingPoint;
436 }
437
438 PMDShapePoint getBboxTopLeft() const override
439 {
440 return m_bboxTopLeft;
441 }
442
443 PMDShapePoint getBboxBotRight() const override
444 {
445 return m_bboxBotRight;
446 }
447
448 bool getIsClosed() const override
449 {
450 return true;
451 }
452
453 std::vector<PMDShapePoint> getPoints() const override
454 {
455 std::vector<PMDShapePoint> points;
456
457 points.push_back(m_bboxTopLeft);
458 points.push_back(PMDShapePoint(m_bboxBotRight.m_x, m_bboxTopLeft.m_y));
459 points.push_back(m_bboxBotRight);
460 points.push_back(PMDShapePoint(m_bboxTopLeft.m_x, m_bboxBotRight.m_y));
461
462 return points;
463 }
464
465 uint8_t shapeType() const override
466 {
467 return SHAPE_TYPE_RECT;
468 }
469
470 PMDFillProperties getFillProperties() const override
471 {
472 return m_fillProps;
473 }
474
475 PMDStrokeProperties getStrokeProperties() const override
476 {
477 return m_strokeProps;
478 }
479
480 std::string getText() const override
481 {
482 return "";
483 }
484
485 std::vector<PMDCharProperties> getCharProperties() const override
486 {
487 return std::vector<PMDCharProperties>(1);
488 }
489
490 std::vector<PMDParaProperties> getParaProperties() const override
491 {
492 return std::vector<PMDParaProperties>(1);
493 }
494
495 librevenge::RVNGBinaryData getBitmap() const override
496 {
497 librevenge::RVNGBinaryData temp;
498 return temp;
499 }
500
501 ~PMDRectangle() override
502 {
503 }
504 };
505
506 class PMDEllipse : public PMDLineSet
507 {
508 PMDShapePoint m_bboxTopLeft;
509 PMDShapePoint m_bboxBotRight;
510 PMDXForm m_xFormContainer;
511 PMDFillProperties m_fillProps;
512 PMDStrokeProperties m_strokeProps;
513
514 public:
515 PMDEllipse(const PMDShapePoint &bboxTopLeft, const PMDShapePoint &bboxBotRight, const PMDXForm &xFormContainer, const PMDFillProperties fillProps, const PMDStrokeProperties strokeProps)
516 : m_bboxTopLeft(bboxTopLeft), m_bboxBotRight(bboxBotRight), m_xFormContainer(xFormContainer), m_fillProps(fillProps), m_strokeProps(strokeProps)
517 { }
518
519 double getRotation() const override
520 {
521 auto temp = (int32_t)m_xFormContainer.m_rotationDegree;
522 return (-1 * (double)temp/1000 * (M_PI/180));
523 }
524
525 double getSkew() const override
526 {
527 auto temp = (int32_t)m_xFormContainer.m_skewDegree;
528 return (-1 * (double)temp/1000 * (M_PI/180));
529 }
530
531 PMDShapePoint getXformTopLeft() const override
532 {
533 return m_xFormContainer.m_xformTopLeft;
534 }
535
536 PMDShapePoint getXformBotRight() const override
537 {
538 return m_xFormContainer.m_xformBotRight;
539 }
540
541 PMDShapePoint getRotatingPoint() const override
542 {
543 return m_xFormContainer.m_rotatingPoint;
544 }
545
546 bool getIsClosed() const override
547 {
548 return true;
549 }
550
551 std::vector<PMDShapePoint> getPoints() const override
552 {
553 std::vector<PMDShapePoint> points;
554
555 points.push_back(m_bboxTopLeft);
556 points.push_back(m_bboxBotRight);
557
558 return points;
559 }
560
561 PMDShapePoint getBboxTopLeft() const override
562 {
563 return m_bboxTopLeft;
564 }
565
566 PMDShapePoint getBboxBotRight() const override
567 {
568 return m_bboxBotRight;
569 }
570
571 uint8_t shapeType() const override
572 {
573 return SHAPE_TYPE_ELLIPSE;
574 }
575
576 PMDFillProperties getFillProperties() const override
577 {
578 return m_fillProps;
579 }
580
581 PMDStrokeProperties getStrokeProperties() const override
582 {
583 return m_strokeProps;
584 }
585
586 std::string getText() const override
587 {
588 return "";
589 }
590
591 std::vector<PMDCharProperties> getCharProperties() const override
592 {
593 return std::vector<PMDCharProperties>(1);
594 }
595
596 std::vector<PMDParaProperties> getParaProperties() const override
597 {
598 return std::vector<PMDParaProperties>(1);
599 }
600
601 librevenge::RVNGBinaryData getBitmap() const override
602 {
603 librevenge::RVNGBinaryData temp;
604 return temp;
605 }
606
607 ~PMDEllipse() override
608 {
609 }
610 };
611
612 class PMDBitmap : public PMDLineSet
613 {
614 PMDShapePoint m_bboxTopLeft;
615 PMDShapePoint m_bboxBotRight;
616 PMDXForm m_xFormContainer;
617 librevenge::RVNGBinaryData m_bitmap;
618
619 public:
620 PMDBitmap(const PMDShapePoint &bboxTopLeft, const PMDShapePoint &bboxBotRight, const PMDXForm &xFormContainer, const librevenge::RVNGBinaryData &bitmap)
621 : m_bboxTopLeft(bboxTopLeft), m_bboxBotRight(bboxBotRight), m_xFormContainer(xFormContainer),m_bitmap(bitmap)
622 { }
623
624 double getRotation() const override
625 {
626 auto temp = (int32_t)m_xFormContainer.m_rotationDegree;
627 return (-1 * (double)temp/1000 * (M_PI/180));
628 }
629
630 double getSkew() const override
631 {
632 auto temp = (int32_t)m_xFormContainer.m_skewDegree;
633 return (-1 * (double)temp/1000 * (M_PI/180));
634 }
635
636 PMDShapePoint getXformTopLeft() const override
637 {
638 return m_xFormContainer.m_xformTopLeft;
639 }
640
641 PMDShapePoint getXformBotRight() const override
642 {
643 return m_xFormContainer.m_xformBotRight;
644 }
645
646 PMDShapePoint getRotatingPoint() const override
647 {
648 return m_xFormContainer.m_rotatingPoint;
649 }
650
651 PMDShapePoint getBboxTopLeft() const override
652 {
653 return m_bboxTopLeft;
654 }
655
656 PMDShapePoint getBboxBotRight() const override
657 {
658 return m_bboxBotRight;
659 }
660
661 bool getIsClosed() const override
662 {
663 return true;
664 }
665
666 std::vector<PMDShapePoint> getPoints() const override
667 {
668 std::vector<PMDShapePoint> points;
669
670 points.push_back(m_bboxTopLeft);
671 points.push_back(PMDShapePoint(m_bboxBotRight.m_x, m_bboxTopLeft.m_y));
672 points.push_back(m_bboxBotRight);
673 points.push_back(PMDShapePoint(m_bboxTopLeft.m_x, m_bboxBotRight.m_y));
674
675 return points;
676 }
677
678 uint8_t shapeType() const override
679 {
680 return SHAPE_TYPE_BITMAP;
681 }
682
683 PMDFillProperties getFillProperties() const override
684 {
685 return PMDFillProperties();
686 }
687
688 PMDStrokeProperties getStrokeProperties() const override
689 {
690 return PMDStrokeProperties();
691 }
692
693 std::string getText() const override
694 {
695 return "";
696 }
697
698 std::vector<PMDCharProperties> getCharProperties() const override
699 {
700 return std::vector<PMDCharProperties>(1);
701 }
702
703 std::vector<PMDParaProperties> getParaProperties() const override
704 {
705 return std::vector<PMDParaProperties>(1);
706 }
707
708 librevenge::RVNGBinaryData getBitmap() const override
709 {
710 return m_bitmap;
711 }
712
713 ~PMDBitmap() override
714 {
715 }
716 };
717
718 class TransformationMatrix
719 {
720 double m_tl, m_tr, m_bl, m_br;
721
722 public:
723 TransformationMatrix(double bboxTopLeft, double topRight, double bottomLeft, double bottomRight)
724 : m_tl(bboxTopLeft), m_tr(topRight), m_bl(bottomLeft), m_br(bottomRight)
725 { }
726
727 template <typename Unit> InchPoint transform(const Point<Unit> &point) const
728 {
729 double xInches = point.m_x.toInches(),
730 yInches = point.m_y.toInches();
731 double newX = m_tl * xInches + m_tr * yInches,
732 newY = m_bl * xInches + m_br * yInches;
733 return InchPoint(newX, newY);
734 }
735 };
736 std::pair<InchPoint, InchPoint>
737 getBoundingBox(const PMDLineSet &lineSet, const TransformationMatrix &matrix);
738 }
739
740 #endif /* __LIBPAGEMAKER_GEOMETRY_H__ */
741
742 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
SHAPE_TYPE_BITMAP
const uint8_t SHAPE_TYPE_BITMAP
Definition: constants.h:57
libpagemaker::PMDXForm::m_rotatingPoint
PMDShapePoint m_rotatingPoint
Definition: geometry.h:42
libpagemaker::PMDEllipse::m_xFormContainer
PMDXForm m_xFormContainer
Definition: geometry.h:510
libpagemaker::PMDBitmap::m_bboxBotRight
PMDShapePoint m_bboxBotRight
Definition: geometry.h:615
libpagemaker::PMDLine::getStrokeProperties
PMDStrokeProperties getStrokeProperties() const override
Definition: geometry.h:157
libpagemaker::PMDTextBox::getCharProperties
std::vector< PMDCharProperties > getCharProperties() const override
Definition: geometry.h:377
libpagemaker::PMDRectangle::getStrokeProperties
PMDStrokeProperties getStrokeProperties() const override
Definition: geometry.h:475
libpagemaker::PMDBitmap::getXformBotRight
PMDShapePoint getXformBotRight() const override
Definition: geometry.h:641
libpagemaker::PMDTextBox::getXformBotRight
PMDShapePoint getXformBotRight() const override
Definition: geometry.h:323
libpagemaker::PMDLineSet::getRotation
virtual double getRotation() const =0
libpagemaker::PMDLine::shapeType
uint8_t shapeType() const override
Definition: geometry.h:145
libpagemaker::Point::m_y
Unit m_y
Definition: geometry.h:27
libpagemaker::PMDLine::m_bboxTopLeft
PMDShapePoint m_bboxTopLeft
Definition: geometry.h:78
libpagemaker::PMDLine::m_strokeProps
PMDStrokeProperties m_strokeProps
Definition: geometry.h:81
libpagemaker::PMDTextBox::getFillProperties
PMDFillProperties getFillProperties() const override
Definition: geometry.h:362
libpagemaker::PMDRectangle::~PMDRectangle
~PMDRectangle() override
Definition: geometry.h:501
geometry.h
libpagemaker::PMDPolygon::getPoints
std::vector< PMDShapePoint > getPoints() const override
Definition: geometry.h:246
libpagemaker::PMDLineSet::shapeType
virtual uint8_t shapeType() const =0
libpagemaker::PMDEllipse::m_bboxBotRight
PMDShapePoint m_bboxBotRight
Definition: geometry.h:509
libpagemaker::PMDBitmap::getSkew
double getSkew() const override
Definition: geometry.h:630
libpagemaker::PMDPolygon::m_bboxBotRight
PMDShapePoint m_bboxBotRight
Definition: geometry.h:194
libpagemaker::PMDEllipse::getSkew
double getSkew() const override
Definition: geometry.h:525
libpagemaker::PMDTextBox::shapeType
uint8_t shapeType() const override
Definition: geometry.h:357
libpagemaker::PMDRectangle::getBitmap
librevenge::RVNGBinaryData getBitmap() const override
Definition: geometry.h:495
libpagemaker::PMDRectangle::shapeType
uint8_t shapeType() const override
Definition: geometry.h:465
libpagemaker::PMDPolygon::getIsClosed
bool getIsClosed() const override
Definition: geometry.h:241
libpagemaker::PMDTextBox::m_bboxBotRight
PMDShapePoint m_bboxBotRight
Definition: geometry.h:295
libpagemaker::PMDXForm::m_xformTopLeft
PMDShapePoint m_xformTopLeft
Definition: geometry.h:40
libpagemaker::PMDPolygon::getStrokeProperties
PMDStrokeProperties getStrokeProperties() const override
Definition: geometry.h:261
libpagemaker::PMDRectangle::getBboxBotRight
PMDShapePoint getBboxBotRight() const override
Definition: geometry.h:443
libpagemaker::PMDLineSet::getText
virtual std::string getText() const =0
libpagemaker::PMDPolygon::getRotatingPoint
PMDShapePoint getRotatingPoint() const override
Definition: geometry.h:226
libpagemaker::PMDPolygon::getCharProperties
std::vector< PMDCharProperties > getCharProperties() const override
Definition: geometry.h:271
libpagemaker::PMDLineSet::getStrokeProperties
virtual PMDStrokeProperties getStrokeProperties() const =0
libpagemaker::PMDPolygon::m_bboxTopLeft
PMDShapePoint m_bboxTopLeft
Definition: geometry.h:193
libpagemaker::TransformationMatrix::m_bl
double m_bl
Definition: geometry.h:720
libpagemaker::PMDXForm
Definition: geometry.h:36
libpagemaker::PMDRectangle::getPoints
std::vector< PMDShapePoint > getPoints() const override
Definition: geometry.h:453
libpagemaker::PMDLineSet::getBboxTopLeft
virtual PMDShapePoint getBboxTopLeft() const =0
libpagemaker::PMDTextBox::~PMDTextBox
~PMDTextBox() override
Definition: geometry.h:393
libpagemaker::PMDTextBox::getIsClosed
bool getIsClosed() const override
Definition: geometry.h:343
libpagemaker::PMDPolygon::PMDPolygon
PMDPolygon(std::vector< PMDShapePoint > points, bool isClosed, const PMDShapePoint &bboxTopLeft, const PMDShapePoint &bboxBotRight, const PMDXForm &xFormContainer, const PMDFillProperties fillProps, const PMDStrokeProperties strokeProps)
Definition: geometry.h:200
libpagemaker::PMDLineSet::getFillProperties
virtual PMDFillProperties getFillProperties() const =0
libpagemaker::PMDRectangle::m_fillProps
PMDFillProperties m_fillProps
Definition: geometry.h:403
libpagemaker::PMDLineSet
Definition: geometry.h:50
libpagemaker::PMDTextBox::m_xFormContainer
PMDXForm m_xFormContainer
Definition: geometry.h:296
libpagemaker::InchPoint
Point< double > InchPoint
Definition: geometry.h:34
libpagemaker::PMDPolygon
Definition: geometry.h:189
libpagemaker::PMDEllipse::getPoints
std::vector< PMDShapePoint > getPoints() const override
Definition: geometry.h:551
libpagemaker::PMDLineSet::getSkew
virtual double getSkew() const =0
libpagemaker::PMDBitmap::getPoints
std::vector< PMDShapePoint > getPoints() const override
Definition: geometry.h:666
libpagemaker::PMDRectangle::getFillProperties
PMDFillProperties getFillProperties() const override
Definition: geometry.h:470
libpagemaker::PMDEllipse::getParaProperties
std::vector< PMDParaProperties > getParaProperties() const override
Definition: geometry.h:596
libpagemaker::PMDBitmap::getIsClosed
bool getIsClosed() const override
Definition: geometry.h:661
libpagemaker::PMDLine::getText
std::string getText() const override
Definition: geometry.h:162
libpagemaker::PMDFillProperties::m_fillType
uint8_t m_fillType
Definition: PMDTypes.h:45
libpagemaker::PMDLine::getXformBotRight
PMDShapePoint getXformBotRight() const override
Definition: geometry.h:103
libpagemaker::PMDRectangle
Definition: geometry.h:398
libpagemaker::PMDBitmap::getStrokeProperties
PMDStrokeProperties getStrokeProperties() const override
Definition: geometry.h:688
FILL_SOLID
const uint8_t FILL_SOLID
Definition: constants.h:62
libpagemaker::PMDEllipse::m_fillProps
PMDFillProperties m_fillProps
Definition: geometry.h:511
libpagemaker::PMDBitmap::getText
std::string getText() const override
Definition: geometry.h:693
libpagemaker::PMDTextBox::getRotatingPoint
PMDShapePoint getRotatingPoint() const override
Definition: geometry.h:328
libpagemaker::PMDRectangle::getRotatingPoint
PMDShapePoint getRotatingPoint() const override
Definition: geometry.h:433
libpagemaker::PMDEllipse::getRotation
double getRotation() const override
Definition: geometry.h:519
libpagemaker::PMDRectangle::m_bboxBotRight
PMDShapePoint m_bboxBotRight
Definition: geometry.h:401
libpagemaker::PMDEllipse::getStrokeProperties
PMDStrokeProperties getStrokeProperties() const override
Definition: geometry.h:581
libpagemaker::PMDPolygon::getText
std::string getText() const override
Definition: geometry.h:266
libpagemaker::PMDPolygon::getParaProperties
std::vector< PMDParaProperties > getParaProperties() const override
Definition: geometry.h:276
libpagemaker::PMDLineSet::getXformBotRight
virtual PMDShapePoint getXformBotRight() const =0
libpagemaker::PMDRectangle::getCharProperties
std::vector< PMDCharProperties > getCharProperties() const override
Definition: geometry.h:485
libpagemaker::PMDStrokeProperties
Definition: PMDTypes.h:53
libpagemaker::PMDLineSet::~PMDLineSet
virtual ~PMDLineSet()
Definition: geometry.h:71
libpagemaker::PMDLine::~PMDLine
~PMDLine() override
Definition: geometry.h:183
libpagemaker_utils.h
libpagemaker::Point::Point
Point(Unit x, Unit y)
Definition: geometry.h:29
libpagemaker::PMDRectangle::getXformBotRight
PMDShapePoint getXformBotRight() const override
Definition: geometry.h:428
libpagemaker::PMDEllipse::PMDEllipse
PMDEllipse(const PMDShapePoint &bboxTopLeft, const PMDShapePoint &bboxBotRight, const PMDXForm &xFormContainer, const PMDFillProperties fillProps, const PMDStrokeProperties strokeProps)
Definition: geometry.h:515
libpagemaker::PMDXForm::m_skewDegree
uint32_t m_skewDegree
Definition: geometry.h:39
libpagemaker::PMDLine::m_bboxBotRight
PMDShapePoint m_bboxBotRight
Definition: geometry.h:79
libpagemaker::getBoundingBox
std::pair< InchPoint, InchPoint > getBoundingBox(const PMDLineSet &lineSet, const TransformationMatrix &matrix)
Definition: geometry.cpp:16
libpagemaker::PMDLine::getBboxBotRight
PMDShapePoint getBboxBotRight() const override
Definition: geometry.h:123
libpagemaker::PMDEllipse::getText
std::string getText() const override
Definition: geometry.h:586
libpagemaker::PMDBitmap::getBitmap
librevenge::RVNGBinaryData getBitmap() const override
Definition: geometry.h:708
libpagemaker::PMDTextBox::m_bboxTopLeft
PMDShapePoint m_bboxTopLeft
Definition: geometry.h:294
libpagemaker::PMDBitmap::m_bitmap
librevenge::RVNGBinaryData m_bitmap
Definition: geometry.h:617
libpagemaker::PMDTextBox::m_charProps
std::vector< PMDCharProperties > m_charProps
Definition: geometry.h:298
libpagemaker::PMDLine::getIsClosed
bool getIsClosed() const override
Definition: geometry.h:113
libpagemaker::PMDTextBox::getStrokeProperties
PMDStrokeProperties getStrokeProperties() const override
Definition: geometry.h:367
libpagemaker::PMDBitmap
Definition: geometry.h:612
libpagemaker::TransformationMatrix::m_br
double m_br
Definition: geometry.h:720
libpagemaker::PMDPolygon::m_strokeProps
PMDStrokeProperties m_strokeProps
Definition: geometry.h:197
libpagemaker::PMDPolygon::getSkew
double getSkew() const override
Definition: geometry.h:210
libpagemaker::PMDLineSet::getPoints
virtual std::vector< PMDShapePoint > getPoints() const =0
libpagemaker::PMDXForm::PMDXForm
PMDXForm(const uint32_t rotationDegree, const uint32_t skewDegree, const PMDShapePoint xformTopLeft, const PMDShapePoint xformBotRight, const PMDShapePoint rotatingPoint, const uint32_t xformId)
Definition: geometry.h:45
libpagemaker::PMDEllipse::getIsClosed
bool getIsClosed() const override
Definition: geometry.h:546
libpagemaker::PMDPolygon::getXformTopLeft
PMDShapePoint getXformTopLeft() const override
Definition: geometry.h:216
M_PI
#define M_PI
Definition: libpagemaker_utils.h:28
libpagemaker::PMDTextBox::m_text
std::string m_text
Definition: geometry.h:297
libpagemaker::PMDPolygon::m_isClosed
bool m_isClosed
Definition: geometry.h:192
libpagemaker::TransformationMatrix::m_tr
double m_tr
Definition: geometry.h:720
libpagemaker::PMDLineSet::getRotatingPoint
virtual PMDShapePoint getRotatingPoint() const =0
libpagemaker::PMDLine::PMDLine
PMDLine(const PMDShapePoint &bboxTopLeft, const PMDShapePoint &bboxBotRight, const bool mirrored, const PMDStrokeProperties strokeProps)
Definition: geometry.h:84
libpagemaker::PMDTextBox::getRotation
double getRotation() const override
Definition: geometry.h:306
libpagemaker::PMDBitmap::PMDBitmap
PMDBitmap(const PMDShapePoint &bboxTopLeft, const PMDShapePoint &bboxBotRight, const PMDXForm &xFormContainer, const librevenge::RVNGBinaryData &bitmap)
Definition: geometry.h:620
libpagemaker::PMDLine::getFillProperties
PMDFillProperties getFillProperties() const override
Definition: geometry.h:150
libpagemaker::PMDTextBox::getParaProperties
std::vector< PMDParaProperties > getParaProperties() const override
Definition: geometry.h:382
libpagemaker::PMDRectangle::m_bboxTopLeft
PMDShapePoint m_bboxTopLeft
Definition: geometry.h:400
libpagemaker::PMDBitmap::getXformTopLeft
PMDShapePoint getXformTopLeft() const override
Definition: geometry.h:636
libpagemaker::TransformationMatrix::m_tl
double m_tl
Definition: geometry.h:720
libpagemaker::PMDLineSet::getXformTopLeft
virtual PMDShapePoint getXformTopLeft() const =0
libpagemaker::PMDPolygon::getBitmap
librevenge::RVNGBinaryData getBitmap() const override
Definition: geometry.h:281
libpagemaker::PMDRectangle::m_strokeProps
PMDStrokeProperties m_strokeProps
Definition: geometry.h:404
libpagemaker::PMDBitmap::getRotation
double getRotation() const override
Definition: geometry.h:624
libpagemaker::PMDBitmap::getRotatingPoint
PMDShapePoint getRotatingPoint() const override
Definition: geometry.h:646
libpagemaker::PMDBitmap::getBboxTopLeft
PMDShapePoint getBboxTopLeft() const override
Definition: geometry.h:651
SHAPE_TYPE_RECT
const uint8_t SHAPE_TYPE_RECT
Definition: constants.h:54
libpagemaker::PMDPolygon::getXformBotRight
PMDShapePoint getXformBotRight() const override
Definition: geometry.h:221
libpagemaker::PMDBitmap::shapeType
uint8_t shapeType() const override
Definition: geometry.h:678
libpagemaker::PMDTextBox::getSkew
double getSkew() const override
Definition: geometry.h:312
libpagemaker::EmptyLineSetException
Definition: PMDExceptions.h:56
libpagemaker::PMDPolygon::getRotation
double getRotation() const override
Definition: geometry.h:204
libpagemaker::PMDBitmap::m_xFormContainer
PMDXForm m_xFormContainer
Definition: geometry.h:616
libpagemaker::PMDXForm::m_xformId
uint32_t m_xformId
Definition: geometry.h:43
libpagemaker::PMDRectangle::PMDRectangle
PMDRectangle(const PMDShapePoint &bboxTopLeft, const PMDShapePoint &bboxBotRight, const PMDXForm &xFormContainer, const PMDFillProperties fillProps, const PMDStrokeProperties strokeProps)
Definition: geometry.h:407
libpagemaker::PMDLine::getRotatingPoint
PMDShapePoint getRotatingPoint() const override
Definition: geometry.h:108
libpagemaker::PMDLine::getXformTopLeft
PMDShapePoint getXformTopLeft() const override
Definition: geometry.h:98
libpagemaker::PMDEllipse::getBboxTopLeft
PMDShapePoint getBboxTopLeft() const override
Definition: geometry.h:561
libpagemaker::PMDLineSet::getBboxBotRight
virtual PMDShapePoint getBboxBotRight() const =0
libpagemaker::PMDBitmap::m_bboxTopLeft
PMDShapePoint m_bboxTopLeft
Definition: geometry.h:614
libpagemaker::PMDTextBox::PMDTextBox
PMDTextBox(const PMDShapePoint &bboxTopLeft, const PMDShapePoint &bboxBotRight, const PMDXForm &xFormContainer, const std::string text, const std::vector< PMDCharProperties > charProps, const std::vector< PMDParaProperties > paraProps)
Definition: geometry.h:302
libpagemaker::PMDTextBox::getBboxTopLeft
PMDShapePoint getBboxTopLeft() const override
Definition: geometry.h:333
libpagemaker::PMDRectangle::getParaProperties
std::vector< PMDParaProperties > getParaProperties() const override
Definition: geometry.h:490
libpagemaker::Point
Definition: geometry.h:24
Units.h
libpagemaker::PMDEllipse::getBitmap
librevenge::RVNGBinaryData getBitmap() const override
Definition: geometry.h:601
libpagemaker::PMDLine::m_mirrored
bool m_mirrored
Definition: geometry.h:80
libpagemaker::PMDPolygon::getBboxBotRight
PMDShapePoint getBboxBotRight() const override
Definition: geometry.h:236
SHAPE_TYPE_POLY
const uint8_t SHAPE_TYPE_POLY
Definition: constants.h:53
libpagemaker::PMDXForm::m_xformBotRight
PMDShapePoint m_xformBotRight
Definition: geometry.h:41
libpagemaker
Definition: geometry.h:22
libpagemaker::PMDLine::getBboxTopLeft
PMDShapePoint getBboxTopLeft() const override
Definition: geometry.h:118
libpagemaker::PMDTextBox::getText
std::string getText() const override
Definition: geometry.h:372
libpagemaker::PMDEllipse::shapeType
uint8_t shapeType() const override
Definition: geometry.h:571
libpagemaker::PMDPolygon::m_fillProps
PMDFillProperties m_fillProps
Definition: geometry.h:196
libpagemaker::Point::m_x
Unit m_x
Definition: geometry.h:26
libpagemaker::PMDLineSet::getBitmap
virtual librevenge::RVNGBinaryData getBitmap() const =0
constants.h
PMDExceptions.h
PMDTypes.h
libpagemaker::PMDLine::getParaProperties
std::vector< PMDParaProperties > getParaProperties() const override
Definition: geometry.h:172
libpagemaker::PMDLine::getBitmap
librevenge::RVNGBinaryData getBitmap() const override
Definition: geometry.h:177
libpagemaker::PMDLine::getCharProperties
std::vector< PMDCharProperties > getCharProperties() const override
Definition: geometry.h:167
libpagemaker::PMDTextBox
Definition: geometry.h:292
libpagemaker::PMDRectangle::getText
std::string getText() const override
Definition: geometry.h:480
libpagemaker::PMDPolygon::getBboxTopLeft
PMDShapePoint getBboxTopLeft() const override
Definition: geometry.h:231
libpagemaker::PMDEllipse::~PMDEllipse
~PMDEllipse() override
Definition: geometry.h:607
libpagemaker::PMDXForm::m_rotationDegree
uint32_t m_rotationDegree
Definition: geometry.h:38
libpagemaker::PMDEllipse::m_strokeProps
PMDStrokeProperties m_strokeProps
Definition: geometry.h:512
libpagemaker::PMDLineSet::getCharProperties
virtual std::vector< PMDCharProperties > getCharProperties() const =0
libpagemaker::PMDEllipse::getBboxBotRight
PMDShapePoint getBboxBotRight() const override
Definition: geometry.h:566
libpagemaker::PMDRectangle::getXformTopLeft
PMDShapePoint getXformTopLeft() const override
Definition: geometry.h:423
libpagemaker::PMDTextBox::getPoints
std::vector< PMDShapePoint > getPoints() const override
Definition: geometry.h:348
libpagemaker::PMDTextBox::getXformTopLeft
PMDShapePoint getXformTopLeft() const override
Definition: geometry.h:318
SHAPE_TYPE_ELLIPSE
const uint8_t SHAPE_TYPE_ELLIPSE
Definition: constants.h:55
libpagemaker::PMDFillProperties
Definition: PMDTypes.h:43
libpagemaker::TransformationMatrix
Definition: geometry.h:718
libpagemaker::PMDShapePoint
Point< PMDShapeUnit > PMDShapePoint
Definition: geometry.h:33
SHAPE_TYPE_TEXTBOX
const uint8_t SHAPE_TYPE_TEXTBOX
Definition: constants.h:56
libpagemaker::PMDEllipse
Definition: geometry.h:506
libpagemaker::PMDLine
Definition: geometry.h:76
libpagemaker::PMDTextBox::getBitmap
librevenge::RVNGBinaryData getBitmap() const override
Definition: geometry.h:387
libpagemaker::PMDRectangle::getBboxTopLeft
PMDShapePoint getBboxTopLeft() const override
Definition: geometry.h:438
libpagemaker::PMDRectangle::getRotation
double getRotation() const override
Definition: geometry.h:411
libpagemaker::PMDEllipse::getCharProperties
std::vector< PMDCharProperties > getCharProperties() const override
Definition: geometry.h:591
libpagemaker::PMDBitmap::getParaProperties
std::vector< PMDParaProperties > getParaProperties() const override
Definition: geometry.h:703
libpagemaker::TransformationMatrix::TransformationMatrix
TransformationMatrix(double bboxTopLeft, double topRight, double bottomLeft, double bottomRight)
Definition: geometry.h:723
libpagemaker::TransformationMatrix::transform
InchPoint transform(const Point< Unit > &point) const
Definition: geometry.h:727
libpagemaker::PMDBitmap::getCharProperties
std::vector< PMDCharProperties > getCharProperties() const override
Definition: geometry.h:698
libpagemaker::PMDPolygon::m_xFormContainer
PMDXForm m_xFormContainer
Definition: geometry.h:195
libpagemaker::PMDPolygon::~PMDPolygon
~PMDPolygon() override
Definition: geometry.h:287
libpagemaker::PMDLineSet::getIsClosed
virtual bool getIsClosed() const =0
SHAPE_TYPE_LINE
const uint8_t SHAPE_TYPE_LINE
Definition: constants.h:52
libpagemaker::PMDLine::getSkew
double getSkew() const override
Definition: geometry.h:93
libpagemaker::PMDPolygon::shapeType
uint8_t shapeType() const override
Definition: geometry.h:251
libpagemaker::PMDTextBox::getBboxBotRight
PMDShapePoint getBboxBotRight() const override
Definition: geometry.h:338
libpagemaker::PMDTextBox::m_paraProps
std::vector< PMDParaProperties > m_paraProps
Definition: geometry.h:299
libpagemaker::PMDEllipse::getRotatingPoint
PMDShapePoint getRotatingPoint() const override
Definition: geometry.h:541
libpagemaker::PMDLine::getRotation
double getRotation() const override
Definition: geometry.h:88
libpagemaker::PMDEllipse::getXformBotRight
PMDShapePoint getXformBotRight() const override
Definition: geometry.h:536
libpagemaker::PMDEllipse::m_bboxTopLeft
PMDShapePoint m_bboxTopLeft
Definition: geometry.h:508
libpagemaker::PMDLine::getPoints
std::vector< PMDShapePoint > getPoints() const override
Definition: geometry.h:128
libpagemaker::PMDRectangle::m_xFormContainer
PMDXForm m_xFormContainer
Definition: geometry.h:402
libpagemaker::PMDEllipse::getXformTopLeft
PMDShapePoint getXformTopLeft() const override
Definition: geometry.h:531
libpagemaker::PMDRectangle::getIsClosed
bool getIsClosed() const override
Definition: geometry.h:448
libpagemaker::PMDBitmap::getFillProperties
PMDFillProperties getFillProperties() const override
Definition: geometry.h:683
libpagemaker::PMDLineSet::getParaProperties
virtual std::vector< PMDParaProperties > getParaProperties() const =0
libpagemaker::PMDEllipse::getFillProperties
PMDFillProperties getFillProperties() const override
Definition: geometry.h:576
libpagemaker::PMDPolygon::m_points
std::vector< PMDShapePoint > m_points
Definition: geometry.h:191
libpagemaker::PMDPolygon::getFillProperties
PMDFillProperties getFillProperties() const override
Definition: geometry.h:256
libpagemaker::PMDBitmap::getBboxBotRight
PMDShapePoint getBboxBotRight() const override
Definition: geometry.h:656
libpagemaker::PMDBitmap::~PMDBitmap
~PMDBitmap() override
Definition: geometry.h:713
libpagemaker::PMDRectangle::getSkew
double getSkew() const override
Definition: geometry.h:417