geometry.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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