A library for working with phylogenetic and population genetic data.
v0.32.0
attributes.hpp
Go to the documentation of this file.
1 #ifndef GENESIS_UTILS_FORMATS_SVG_ATTRIBUTES_H_
2 #define GENESIS_UTILS_FORMATS_SVG_ATTRIBUTES_H_
3 
4 /*
5  Genesis - A toolkit for working with phylogenetic data.
6  Copyright (C) 2014-2023 Lucas Czech
7 
8  This program is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>.
20 
21  Contact:
22  Lucas Czech <lczech@carnegiescience.edu>
23  Department of Plant Biology, Carnegie Institution For Science
24  260 Panama Street, Stanford, CA 94305, USA
25 */
26 
37 
38 #include <iosfwd>
39 #include <string>
40 #include <vector>
41 
42 namespace genesis {
43 namespace utils {
44 
45 // =================================================================================================
46 // Svg Stroke
47 // =================================================================================================
48 
49 struct SvgStroke
50 {
51 public:
52 
53  // -------------------------------------------------------------------------
54  // Typedefs and Enums
55  // -------------------------------------------------------------------------
56 
58 
59  enum class Type
60  {
61  kColor,
62  kGradient,
63  kNone,
64  kOmit
65  };
66 
67  enum class LineCap
68  {
69  kOmit,
70  kButt,
71  kSquare,
72  kRound
73  };
74 
75  enum class LineJoin
76  {
77  kOmit,
78  kMiter,
79  kRound,
80  kBevel
81  };
82 
83  // -------------------------------------------------------------------------
84  // Constructors and Rule of Five
85  // -------------------------------------------------------------------------
86 
87  explicit SvgStroke( Type type = Type::kColor );
88  explicit SvgStroke( Color color, double width = 1.0 );
89  explicit SvgStroke( std::string gradient_id );
90 
91  ~SvgStroke() = default;
92 
93  SvgStroke( SvgStroke const& ) = default;
94  SvgStroke( SvgStroke&& ) = default;
95 
96  SvgStroke& operator= ( SvgStroke const& ) = default;
97  SvgStroke& operator= ( SvgStroke&& ) = default;
98 
99  // -------------------------------------------------------------------------
100  // Drawing Function
101  // -------------------------------------------------------------------------
102 
103  void write( std::ostream& out ) const;
104 
105  // -------------------------------------------------------------------------
106  // Properties
107  // -------------------------------------------------------------------------
108 
110 
111  std::string gradient_id;
112 
114 
115  double width;
116  std::string width_unit;
117 
120  double miterlimit;
121 
122  std::vector< double > dash_array;
123  double dash_offset;
124 
125 };
126 
127 // =================================================================================================
128 // Svg Fill
129 // =================================================================================================
130 
131 struct SvgFill
132 {
133 public:
134 
135  // -------------------------------------------------------------------------
136  // Typedefs and Enums
137  // -------------------------------------------------------------------------
138 
140 
141  enum class Type
142  {
143  kColor,
144  kGradient,
145  kNone,
146  kOmit
147  };
148 
149  enum class Rule
150  {
151  kNone,
152  kNonZero,
153  kEvenOdd
154  };
155 
156  // -------------------------------------------------------------------------
157  // Constructors and Rule of Five
158  // -------------------------------------------------------------------------
159 
160  explicit SvgFill( Type type = Type::kColor );
161  explicit SvgFill( Color color );
162  explicit SvgFill( std::string gradient_id );
163 
164  ~SvgFill() = default;
165 
166  SvgFill( SvgFill const& ) = default;
167  SvgFill( SvgFill&& ) = default;
168 
169  SvgFill& operator= ( SvgFill const& ) = default;
170  SvgFill& operator= ( SvgFill&& ) = default;
171 
172  // -------------------------------------------------------------------------
173  // Drawing Function
174  // -------------------------------------------------------------------------
175 
176  void write( std::ostream& out ) const;
177 
178  // -------------------------------------------------------------------------
179  // Properties
180  // -------------------------------------------------------------------------
181 
183 
184  std::string gradient_id;
185 
188 
189 };
190 
191 // =================================================================================================
192 // Svg Font
193 // =================================================================================================
194 
195 struct SvgFont
196 {
197 public:
198 
199  // -------------------------------------------------------------------------
200  // Typedefs and Enums
201  // -------------------------------------------------------------------------
202 
204 
205  // -------------------------------------------------------------------------
206  // Constructors and Rule of Five
207  // -------------------------------------------------------------------------
208 
209  explicit SvgFont( double size = 10, std::string const& family = "Verdana" );
210 
211  ~SvgFont() = default;
212 
213  SvgFont( SvgFont const& ) = default;
214  SvgFont( SvgFont&& ) = default;
215 
216  SvgFont& operator= ( SvgFont const& ) = default;
217  SvgFont& operator= ( SvgFont&& ) = default;
218 
219  // -------------------------------------------------------------------------
220  // Drawing Function
221  // -------------------------------------------------------------------------
222 
223  void write( std::ostream& out ) const;
224 
225  // -------------------------------------------------------------------------
226  // Properties
227  // -------------------------------------------------------------------------
228 
229  double size;
230  std::string family;
231 
232 };
233 
234 // =================================================================================================
235 // Svg Transformation
236 // =================================================================================================
237 
239 {
240 public:
241 
242  // -------------------------------------------------------------------------
243  // Typedefs and Enums
244  // -------------------------------------------------------------------------
245 
247 
248  // -------------------------------------------------------------------------
249  // Subclass Translate
250  // -------------------------------------------------------------------------
251 
252  struct Translate
253  {
254  public:
255 
256  // -------------------------------------------------------------
257  // Constructors and Rule of Five
258  // -------------------------------------------------------------
259 
260  Translate() = default;
261 
262  Translate( double tx, double ty )
263  : tx(tx)
264  , ty(ty)
265  {}
266 
268  : Translate( offset.x, offset.y )
269  {}
270 
271  ~Translate() = default;
272 
273  Translate( Translate const& ) = default;
274  Translate( Translate&& ) = default;
275 
276  Translate& operator= ( Translate const& ) = default;
277  Translate& operator= ( Translate&& ) = default;
278 
279  // -------------------------------------------------------------
280  // Operators and Write
281  // -------------------------------------------------------------
282 
283  void write( std::ostream& out ) const;
284  SvgPoint apply( SvgPoint const& p ) const;
285 
286  // -------------------------------------------------------------
287  // Data Members
288  // -------------------------------------------------------------
289 
290  double tx = 0.0;
291  double ty = 0.0;
292  };
293 
294  // -------------------------------------------------------------------------
295  // Subclass Rotate
296  // -------------------------------------------------------------------------
297 
298  struct Rotate
299  {
300  public:
301 
302  // -------------------------------------------------------------
303  // Constructors and Rule of Five
304  // -------------------------------------------------------------
305 
306  Rotate() = default;
307 
311  Rotate( double angle )
312  : a(angle)
313  {}
314 
318  Rotate( double angle, double cx, double cy )
319  : a(angle)
320  , cx(cx)
321  , cy(cy)
322  {}
323 
327  Rotate( double angle, SvgPoint offset )
328  : Rotate( angle, offset.x, offset.y )
329  {}
330 
331  ~Rotate() = default;
332 
333  Rotate( Rotate const& ) = default;
334  Rotate( Rotate&& ) = default;
335 
336  Rotate& operator= ( Rotate const& ) = default;
337  Rotate& operator= ( Rotate&& ) = default;
338 
339  // -------------------------------------------------------------
340  // Operators and Write
341  // -------------------------------------------------------------
342 
343  void write( std::ostream& out ) const;
344  SvgPoint apply( SvgPoint const& p ) const;
345 
346  // -------------------------------------------------------------
347  // Data Members
348  // -------------------------------------------------------------
349 
350  double a = 0.0;
351  double cx = 0.0;
352  double cy = 0.0;
353  };
354 
355  // -------------------------------------------------------------------------
356  // Subclass Scale
357  // -------------------------------------------------------------------------
358 
359  struct Scale
360  {
361  public:
362 
363  // -------------------------------------------------------------
364  // Constructors and Rule of Five
365  // -------------------------------------------------------------
366 
367  Scale() = default;
368 
369  Scale( double sxy )
370  : sx(sxy)
371  , sy(sxy)
372  {}
373 
374  Scale( double sx, double sy )
375  : sx(sx)
376  , sy(sy)
377  {}
378 
379  ~Scale() = default;
380 
381  Scale( Scale const& ) = default;
382  Scale( Scale&& ) = default;
383 
384  Scale& operator= ( Scale const& ) = default;
385  Scale& operator= ( Scale&& ) = default;
386 
387  // -------------------------------------------------------------
388  // Operators and Write
389  // -------------------------------------------------------------
390 
391  void write( std::ostream& out ) const;
392  SvgPoint apply( SvgPoint const& p ) const;
393 
394  // -------------------------------------------------------------
395  // Data Members
396  // -------------------------------------------------------------
397 
398  double sx = 1.0;
399  double sy = 1.0;
400  };
401 
402  // -------------------------------------------------------------------------
403  // Subclass SkewX
404  // -------------------------------------------------------------------------
405 
406  struct SkewX
407  {
408  public:
409 
410  // -------------------------------------------------------------
411  // Constructors and Rule of Five
412  // -------------------------------------------------------------
413 
414  SkewX() = default;
415 
419  SkewX( double a )
420  : ax(a)
421  {}
422 
423  ~SkewX() = default;
424 
425  SkewX( SkewX const& ) = default;
426  SkewX( SkewX&& ) = default;
427 
428  SkewX& operator= ( SkewX const& ) = default;
429  SkewX& operator= ( SkewX&& ) = default;
430 
431  // -------------------------------------------------------------
432  // Operators and Write
433  // -------------------------------------------------------------
434 
435  void write( std::ostream& out ) const;
436  SvgPoint apply( SvgPoint const& p ) const;
437 
438  // -------------------------------------------------------------
439  // Data Members
440  // -------------------------------------------------------------
441 
442  double ax = 0.0;
443  };
444 
445  // -------------------------------------------------------------------------
446  // Subclass SkewY
447  // -------------------------------------------------------------------------
448 
449  struct SkewY
450  {
451  public:
452 
453  // -------------------------------------------------------------
454  // Constructors and Rule of Five
455  // -------------------------------------------------------------
456 
457  SkewY() = default;
458 
462  SkewY( double a )
463  : ay(a)
464  {}
465 
466  ~SkewY() = default;
467 
468  SkewY( SkewY const& ) = default;
469  SkewY( SkewY&& ) = default;
470 
471  SkewY& operator= ( SkewY const& ) = default;
472  SkewY& operator= ( SkewY&& ) = default;
473 
474  // -------------------------------------------------------------
475  // Operators and Write
476  // -------------------------------------------------------------
477 
478  void write( std::ostream& out ) const;
479  SvgPoint apply( SvgPoint const& p ) const;
480 
481  // -------------------------------------------------------------
482  // Data Members
483  // -------------------------------------------------------------
484 
485  double ay = 0.0;
486  };
487 
488  // -------------------------------------------------------------------------
489  // Subclass Matrix
490  // -------------------------------------------------------------------------
491 
492  struct Matrix
493  {
494  public:
495 
496  // -------------------------------------------------------------
497  // Constructors and Rule of Five
498  // -------------------------------------------------------------
499 
500  Matrix() = default;
501 
502  Matrix( double a, double b, double c, double d, double e, double f )
503  : a(a)
504  , b(b)
505  , c(c)
506  , d(d)
507  , e(e)
508  , f(f)
509  {}
510 
511  ~Matrix() = default;
512 
513  Matrix( Matrix const& ) = default;
514  Matrix( Matrix&& ) = default;
515 
516  Matrix& operator= ( Matrix const& ) = default;
517  Matrix& operator= ( Matrix&& ) = default;
518 
519  // -------------------------------------------------------------
520  // Operators and Write
521  // -------------------------------------------------------------
522 
523  void write( std::ostream& out ) const;
524  SvgPoint apply( SvgPoint const& p ) const;
525 
526  // -------------------------------------------------------------
527  // Data Members
528  // -------------------------------------------------------------
529 
530  double a = 1.0;
531  double b = 0.0;
532  double c = 0.0;
533  double d = 1.0;
534  double e = 0.0;
535  double f = 0.0;
536  };
537 
538  // -------------------------------------------------------------------------
539  // Transformation
540  // -------------------------------------------------------------------------
541 
547  {
548  public:
549 
550  // -------------------------------------------------------------
551  // Typedefs and Enums
552  // -------------------------------------------------------------
553 
555 
556  // -------------------------------------------------------------
557  // Constructors and Rule of Five
558  // -------------------------------------------------------------
559 
560  template< typename T >
561  Transformation( T const& object )
562  // Although we are in utils namespace here, we specify the namespace full,
563  // in order to avoid ambiguous overload when compiled with C++17.
564  : pimpl_( genesis::utils::make_unique< Model<T> >( object ))
565  {}
566 
568  : pimpl_( other.pimpl_->clone() )
569  {}
570 
571  Transformation( Transformation&& ) = default;
572 
574  {
575  std::swap( pimpl_, other.pimpl_ );
576  return *this;
577  }
578 
579  ~Transformation() = default;
580 
581  // -------------------------------------------------------------
582  // Members
583  // -------------------------------------------------------------
584 
585  SvgPoint apply( SvgPoint const& p ) const
586  {
587  return pimpl_->apply_( p );
588  }
589 
590  void write( std::ostream& out ) const
591  {
592  pimpl_->write_( out );
593  }
594 
595  // -------------------------------------------------------------
596  // Internal Members
597  // -------------------------------------------------------------
598 
599  private:
600 
601  struct Concept
602  {
603  virtual ~Concept() {}
604 
605  virtual SvgPoint apply_( SvgPoint const& p ) const = 0;
606  virtual void write_( std::ostream& out ) const = 0;
607 
608  virtual std::unique_ptr< Concept > clone() const = 0;
609  };
610 
611  template< typename T >
612  struct Model : Concept
613  {
614  Model( T const& value )
615  : object_( value )
616  {}
617 
618  SvgPoint apply_( SvgPoint const& p ) const override
619  {
620  return object_.apply( p );
621  }
622 
623  void write_( std::ostream& out ) const override
624  {
625  object_.write( out );
626  }
627 
628  std::unique_ptr< Concept > clone() const override
629  {
630  // Although we are in utils namespace here, we specify the namespace full,
631  // in order to avoid ambiguous overload when compiled with C++17.
632  return genesis::utils::make_unique< Model<T> >( object_ );
633  }
634 
635  T object_;
636  };
637 
638  std::unique_ptr< Concept > pimpl_;
639 
640  };
641 
642  // -------------------------------------------------------------------------
643  // Constructors and Rule of Five
644  // -------------------------------------------------------------------------
645 
646  SvgTransform() = default;
647  ~SvgTransform() = default;
648 
649  SvgTransform( SvgTransform const& ) = default;
650  SvgTransform( SvgTransform&& ) = default;
651 
652  SvgTransform& operator= ( SvgTransform const& ) = default;
653  SvgTransform& operator= ( SvgTransform&& ) = default;
654 
655  // -------------------------------------------------------------------------
656  // Drawing Function
657  // -------------------------------------------------------------------------
658 
659  void append( Transformation&& t );
660  void append( Transformation const& t );
661 
665  SvgPoint apply( SvgPoint const& p ) const;
666 
678  SvgBox apply( SvgBox const& b ) const;
679 
680  void write( std::ostream& out ) const;
681 
682  void clear()
683  {
684  transformations.clear();
685  }
686 
687  // -------------------------------------------------------------------------
688  // Properties
689  // -------------------------------------------------------------------------
690 
691  std::vector<Transformation> transformations;
692 
693 };
694 
695 } // namespace utils
696 } // namespace genesis
697 
698 #endif // include guard
genesis::placement::swap
void swap(Sample &lhs, Sample &rhs)
Definition: sample.cpp:104
genesis::utils::Color
Definition: color.hpp:47
genesis::utils::SvgTransform::Scale::sy
double sy
Definition: attributes.hpp:399
helper.hpp
genesis::utils::SvgTransform::append
void append(Transformation &&t)
Definition: attributes.cpp:353
genesis::utils::SvgStroke::LineCap::kRound
@ kRound
genesis::utils::SvgStroke::LineJoin
LineJoin
Definition: attributes.hpp:75
genesis::utils::SvgTransform::Matrix::c
double c
Definition: attributes.hpp:532
genesis::utils::SvgTransform::Matrix::e
double e
Definition: attributes.hpp:534
genesis::utils::SvgTransform::clear
void clear()
Definition: attributes.hpp:682
genesis::utils::SvgStroke::LineCap::kSquare
@ kSquare
genesis::utils::SvgTransform::SkewY::operator=
SkewY & operator=(SkewY const &)=default
genesis::utils::SvgTransform::Matrix::~Matrix
~Matrix()=default
genesis::utils::SvgTransform::Rotate
Definition: attributes.hpp:298
genesis::utils::SvgStroke::LineJoin::kMiter
@ kMiter
genesis::utils::SvgStroke::Type
Type
Definition: attributes.hpp:59
genesis::utils::SvgFont::operator=
SvgFont & operator=(SvgFont const &)=default
genesis::utils::SvgStroke::miterlimit
double miterlimit
Definition: attributes.hpp:120
genesis::utils::SvgTransform::Rotate::Rotate
Rotate(double angle, double cx, double cy)
Rotation, in degrees, around a given offset point.
Definition: attributes.hpp:318
genesis::utils::SvgTransform::apply
SvgPoint apply(SvgPoint const &p) const
Apply all transformations to a point, and return the new transformed coordinate.
Definition: attributes.cpp:363
genesis::utils::SvgTransform::Matrix::apply
SvgPoint apply(SvgPoint const &p) const
Definition: attributes.cpp:341
genesis::utils::SvgTransform::SkewY::SkewY
SkewY(double a)
SkewY an object, with an angle given in degrees.
Definition: attributes.hpp:462
genesis::utils::SvgTransform::Translate::Translate
Translate()=default
genesis::utils::SvgStroke::line_join
LineJoin line_join
Definition: attributes.hpp:119
genesis::utils::SvgTransform::Translate::ty
double ty
Definition: attributes.hpp:291
genesis::utils::SvgFill::Rule::kNone
@ kNone
genesis::utils::SvgTransform::Scale::~Scale
~Scale()=default
genesis::utils::SvgTransform::Matrix::a
double a
Definition: attributes.hpp:530
genesis::utils::SvgTransform::SkewY::ay
double ay
Definition: attributes.hpp:485
genesis::utils::SvgTransform::Scale::Scale
Scale()=default
genesis::utils::SvgTransform::Matrix::d
double d
Definition: attributes.hpp:533
genesis::utils::SvgStroke::width
double width
Definition: attributes.hpp:115
genesis::utils::SvgStroke::Type::kOmit
@ kOmit
genesis::utils::SvgTransform::Translate::apply
SvgPoint apply(SvgPoint const &p) const
Definition: attributes.cpp:234
genesis::utils::SvgStroke::Type::kGradient
@ kGradient
genesis::utils::SvgTransform::Translate::Translate
Translate(SvgPoint offset)
Definition: attributes.hpp:267
genesis::utils::SvgTransform::SkewY::~SkewY
~SkewY()=default
genesis::utils::SvgTransform::Transformation::operator=
Transformation & operator=(Transformation other)
Definition: attributes.hpp:573
genesis::utils::SvgStroke::LineCap
LineCap
Definition: attributes.hpp:67
genesis::utils::SvgFill::SvgFill
SvgFill(Type type=Type::kColor)
Definition: attributes.cpp:144
genesis::utils::SvgFill::Type::kColor
@ kColor
genesis::utils::offset
void offset(Histogram &h, double value)
Definition: operations.cpp:47
std.hpp
Provides some valuable additions to STD.
genesis::utils::SvgTransform::Rotate::cy
double cy
Definition: attributes.hpp:352
genesis::utils::SvgStroke::LineCap::kButt
@ kButt
genesis::utils::SvgTransform::operator=
SvgTransform & operator=(SvgTransform const &)=default
genesis::utils::SvgTransform::write
void write(std::ostream &out) const
Definition: attributes.cpp:394
genesis::utils::SvgFill::~SvgFill
~SvgFill()=default
genesis::utils::SvgTransform::Matrix::f
double f
Definition: attributes.hpp:535
genesis::utils::SvgStroke::dash_array
std::vector< double > dash_array
Definition: attributes.hpp:122
genesis::utils::SvgTransform::Scale::write
void write(std::ostream &out) const
Definition: attributes.cpp:277
genesis::utils::SvgTransform::Matrix::b
double b
Definition: attributes.hpp:531
genesis::utils::SvgFont::SvgFont
SvgFont(double size=10, std::string const &family="Verdana")
Definition: attributes.cpp:204
genesis::utils::SvgStroke::~SvgStroke
~SvgStroke()=default
genesis::utils::SvgFill::Rule
Rule
Definition: attributes.hpp:149
genesis::utils::SvgStroke::LineCap::kOmit
@ kOmit
genesis::utils::SvgFont::size
double size
Definition: attributes.hpp:229
genesis::utils::SvgTransform::SkewY::apply
SvgPoint apply(SvgPoint const &p) const
Definition: attributes.cpp:322
genesis::utils::SvgTransform::SkewX::ax
double ax
Definition: attributes.hpp:442
genesis::utils::SvgPoint
Definition: utils/formats/svg/helper.hpp:57
genesis::utils::SvgStroke
Definition: attributes.hpp:49
genesis::utils::SvgStroke::dash_offset
double dash_offset
Definition: attributes.hpp:123
genesis::utils::SvgFont::family
std::string family
Definition: attributes.hpp:230
genesis::utils::SvgTransform::SkewX::SkewX
SkewX(double a)
SkewX an object, with an angle given in degrees.
Definition: attributes.hpp:419
genesis::utils::SvgTransform::SvgTransform
SvgTransform()=default
genesis::utils::SvgFill::gradient_id
std::string gradient_id
Definition: attributes.hpp:184
genesis::utils::SvgTransform::Scale::operator=
Scale & operator=(Scale const &)=default
genesis::utils::SvgTransform::Transformation::write
void write(std::ostream &out) const
Definition: attributes.hpp:590
genesis::utils::SvgTransform::Translate
Definition: attributes.hpp:252
genesis::utils::SvgFill::Rule::kEvenOdd
@ kEvenOdd
genesis::utils::SvgFill::type
Type type
Definition: attributes.hpp:182
genesis::utils::SvgTransform::Scale
Definition: attributes.hpp:359
genesis::utils::SvgFont::~SvgFont
~SvgFont()=default
genesis::utils::SvgTransform::SkewX::~SkewX
~SkewX()=default
genesis::utils::SvgTransform::SkewY::SkewY
SkewY()=default
genesis::utils::SvgTransform::Translate::tx
double tx
Definition: attributes.hpp:290
genesis::utils::SvgTransform::Rotate::operator=
Rotate & operator=(Rotate const &)=default
genesis::utils::SvgTransform::Rotate::a
double a
Definition: attributes.hpp:350
genesis::utils::SvgTransform::SkewY::write
void write(std::ostream &out) const
Definition: attributes.cpp:315
genesis::utils::SvgTransform::Translate::~Translate
~Translate()=default
genesis::utils::SvgTransform::Translate::Translate
Translate(double tx, double ty)
Definition: attributes.hpp:262
genesis::utils::SvgStroke::Type::kNone
@ kNone
genesis
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
Definition: placement/formats/edge_color.cpp:42
genesis::utils::SvgTransform::Transformation
Internal helper class used as an abstraction to be able to store Transformations without need for inh...
Definition: attributes.hpp:546
genesis::utils::SvgStroke::SvgStroke
SvgStroke(Type type=Type::kColor)
Definition: attributes.cpp:53
genesis::utils::SvgTransform::Rotate::Rotate
Rotate(double angle)
Rotation, in degrees.
Definition: attributes.hpp:311
genesis::utils::SvgTransform::Rotate::~Rotate
~Rotate()=default
genesis::utils::SvgStroke::LineJoin::kOmit
@ kOmit
genesis::utils::SvgTransform::Transformation::Transformation
Transformation(T const &object)
Definition: attributes.hpp:561
genesis::utils::SvgTransform::Translate::operator=
Translate & operator=(Translate const &)=default
genesis::utils::SvgFill
Definition: attributes.hpp:131
genesis::utils::SvgTransform::SkewY
Definition: attributes.hpp:449
genesis::utils::SvgTransform::transformations
std::vector< Transformation > transformations
Definition: attributes.hpp:691
genesis::utils::SvgFill::write
void write(std::ostream &out) const
Definition: attributes.cpp:166
genesis::utils::SvgTransform::Matrix::Matrix
Matrix(double a, double b, double c, double d, double e, double f)
Definition: attributes.hpp:502
genesis::utils::SvgFont
Definition: attributes.hpp:195
genesis::utils::SvgTransform
Definition: attributes.hpp:238
genesis::utils::SvgTransform::Scale::Scale
Scale(double sxy)
Definition: attributes.hpp:369
genesis::utils::SvgTransform::Rotate::Rotate
Rotate(double angle, SvgPoint offset)
Rotation, in degrees, around a given offset point.
Definition: attributes.hpp:327
genesis::utils::SvgStroke::line_cap
LineCap line_cap
Definition: attributes.hpp:118
color.hpp
Header of Color class.
genesis::utils::SvgTransform::Matrix
Definition: attributes.hpp:492
genesis::utils::SvgTransform::Translate::write
void write(std::ostream &out) const
Definition: attributes.cpp:227
genesis::utils::SvgTransform::Rotate::apply
SvgPoint apply(SvgPoint const &p) const
Definition: attributes.cpp:254
genesis::utils::SvgTransform::SkewX::operator=
SkewX & operator=(SkewX const &)=default
genesis::utils::SvgTransform::Scale::apply
SvgPoint apply(SvgPoint const &p) const
Definition: attributes.cpp:288
genesis::utils::SvgTransform::Scale::Scale
Scale(double sx, double sy)
Definition: attributes.hpp:374
genesis::utils::SvgTransform::SkewX::SkewX
SkewX()=default
genesis::utils::make_unique
std::unique_ptr< T > make_unique(Args &&... args)
Returns a std::unique_ptr for a given type.
Definition: std.hpp:82
genesis::utils::SvgTransform::Transformation::Transformation
Transformation(Transformation const &other)
Definition: attributes.hpp:567
genesis::utils::SvgTransform::Scale::sx
double sx
Definition: attributes.hpp:398
genesis::utils::SvgFill::operator=
SvgFill & operator=(SvgFill const &)=default
genesis::utils::SvgStroke::write
void write(std::ostream &out) const
Definition: attributes.cpp:82
genesis::utils::SvgStroke::LineJoin::kRound
@ kRound
genesis::utils::SvgTransform::Matrix::operator=
Matrix & operator=(Matrix const &)=default
genesis::utils::SvgTransform::Rotate::cx
double cx
Definition: attributes.hpp:351
genesis::utils::SvgFill::Type::kGradient
@ kGradient
genesis::utils::SvgTransform::SkewX
Definition: attributes.hpp:406
genesis::utils::SvgTransform::Matrix::write
void write(std::ostream &out) const
Definition: attributes.cpp:333
genesis::utils::SvgStroke::operator=
SvgStroke & operator=(SvgStroke const &)=default
genesis::utils::SvgFill::rule
Rule rule
Definition: attributes.hpp:187
genesis::utils::SvgTransform::~SvgTransform
~SvgTransform()=default
genesis::utils::SvgStroke::Type::kColor
@ kColor
genesis::utils::SvgFill::color
Color color
Definition: attributes.hpp:186
genesis::utils::SvgTransform::Rotate::write
void write(std::ostream &out) const
Definition: attributes.cpp:243
genesis::utils::SvgStroke::width_unit
std::string width_unit
Definition: attributes.hpp:116
genesis::utils::SvgTransform::Matrix::Matrix
Matrix()=default
genesis::utils::SvgFill::Rule::kNonZero
@ kNonZero
genesis::utils::SvgStroke::type
Type type
Definition: attributes.hpp:109
genesis::utils::SvgTransform::Transformation::~Transformation
~Transformation()=default
genesis::utils::SvgStroke::LineJoin::kBevel
@ kBevel
genesis::utils::SvgFill::Type::kNone
@ kNone
genesis::utils::SvgTransform::SkewX::write
void write(std::ostream &out) const
Definition: attributes.cpp:297
genesis::utils::SvgFill::Type::kOmit
@ kOmit
genesis::utils::SvgStroke::gradient_id
std::string gradient_id
Definition: attributes.hpp:111
genesis::utils::SvgTransform::Transformation::apply
SvgPoint apply(SvgPoint const &p) const
Definition: attributes.hpp:585
genesis::utils::SvgTransform::SkewX::apply
SvgPoint apply(SvgPoint const &p) const
Definition: attributes.cpp:304
genesis::utils::SvgFill::Type
Type
Definition: attributes.hpp:141
genesis::utils::SvgTransform::Rotate::Rotate
Rotate()=default
genesis::utils::SvgStroke::color
Color color
Definition: attributes.hpp:113
genesis::utils::SvgFont::write
void write(std::ostream &out) const
Definition: attributes.cpp:213