1 #ifndef GENESIS_UTILS_FORMATS_SVG_OBJECT_H_ 2 #define GENESIS_UTILS_FORMATS_SVG_OBJECT_H_ 60 template<
typename T >
66 : pimpl_( other.pimpl_->clone() )
88 return pimpl_->bounding_box_();
96 pimpl_->write_( out,
indent, options );
107 virtual ~Concept() {}
109 virtual SvgBox bounding_box_()
const = 0;
117 virtual std::unique_ptr< Concept > clone()
const = 0;
120 template<
typename T >
121 struct Model : Concept
123 Model( T
const& value )
127 SvgBox bounding_box_()
const override 129 return object_.bounding_box();
137 object_.write( out,
indent, options );
140 std::unique_ptr< Concept > clone()
const override 142 return make_unique< Model<T> >( object_ );
148 std::unique_ptr< Concept > pimpl_;
155 #endif // include guard
SvgObject & operator=(SvgObject other)
void swap(SequenceSet &lhs, SequenceSet &rhs)
Container namespace for all symbols of genesis in order to keep them separate when used as a library...
SvgBox bounding_box() const
SvgObject(T const &object)
Provides some valuable additions to STD.
std::string indent(std::string const &text, std::string const &indentation)
Indent each line of text with indentation and return the result.
std::unique_ptr< T > make_unique(Args &&... args)
Returns a std::unique_ptr for a given type.
SvgObject(SvgObject const &other)
void write(std::ostream &out, size_t indent=0, SvgDrawingOptions const &options=SvgDrawingOptions()) const