Public Types | Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
AlignSVG Struct Reference

User-friendly programming interface for alignment considering two elements. More...

#include <AlignSVG.h>

Inheritance diagram for AlignSVG:
Inheritance graph
[legend]
Collaboration diagram for AlignSVG:
Collaboration graph
[legend]

Public Types

enum  Owner { OBJECT = 0 , ANCHOR = 1 }
 
enum  Topol { INSIDE = 0 , OUTSIDE = 1 , UNDEFINED_TOPOL = 2 }
 
typedef Alignment< const AlignBase::Axis, AlignBase::Axis::HORZ > HorzAlign
 
typedef Alignment< const AlignBase::Axis, AlignBase::Axis::VERT > VertAlign
 

Public Member Functions

template<typename OBJ , typename A , typename V >
void setAlign (const OBJ &owner, const A &axis, const V &value)
 Low-level, "atomic" setter of alignment for OBJECT itself or its ANCHOR object.
 
void setAlign (const AlignBase::Axis &axis, const AlignBase::Pos &pos, Topol topol=Topol::INSIDE)
 Set a single alignment setting. "Intermediate-level": axis and pos are given separately. More...
 
template<typename ... T, typename AX , AlignBase::Axis A>
void setAlign (const Alignment< AX, A > &align, const T... args)
 NEW High-level, user friendlier interface for setting INSIDE the alignments for both OBJECT itself and its ANCHOR object.
 
template<typename AX1 , AlignBase::Axis A1, typename AX2 , AlignBase::Axis A2>
void setAlign (const Alignment< AX1, A1 > &align1, const Alignment< AX2, A2 > &align2)
 
template<typename AX , AlignBase::Axis A>
void setAlign (const Alignment< AX, A > &align1, const Alignment< AX, A > &align2)
 Compiler trap: unimplemented for two of same kind: either HorzAlign or VertAlign twice.
 
template<typename T >
void setAlign (const std::string &align, const T &topol)
 High-level, user friendlier interface for setting the alignments for both OBJECT itself and its ANCHOR object.
 
void setAlign (const std::string &align)
 High-level, user friendly interface for setting the alignments for both OBJECT itself and its ANCHOR object. More...
 
bool isAligned () const
 Returns true, if any setting is set...
 
void resetAlign ()
 
template<typename P , typename A >
AlignBase::PosgetAlign (const P &pos, const A &axis)
 Return alignment setting of an object along horizontal or vertical axis .
 
template<typename P , typename A >
const AlignBase::PosgetAlign (const P &pos, const A &axis) const
 Return alignment setting of an object along horizontal or vertical axis .
 
void confToStream (std::ostream &ostr) const
 
template<typename OBJ , typename A >
AlignBase::PosgetAlign (const OBJ &owner, const A &axis)
 
template<typename OBJ , typename A >
const AlignBase::PosgetAlign (const OBJ &owner, const A &axis) const
 

Static Public Attributes

static const HorzAlign LEFT
 Alias for {HORZ:MIN}.
 
static const HorzAlign CENTER
 Alias for {HORZ:MID}.
 
static const HorzAlign RIGHT
 Alias for {HORZ:MAX}.
 
static const HorzAlign HORZ_FILL
 Alias for {HORZ:FILL}.
 
static const HorzAlign UNDEFINED_HORZ
 
static const VertAlign TOP
 Alias for {VERT:MIN}.
 
static const VertAlign MIDDLE
 Alias for {VERT:MID}.
 
static const VertAlign BOTTOM
 Alias for {VERT:MAX}.
 
static const VertAlign VERT_FILL
 Alias for {VERT:FILL}.
 
static const VertAlign UNDEFINED_VERT
 

Protected Types

typedef int bitvect_t
 
typedef std::vector< AlignBase::Posalign_vect_t
 
typedef std::vector< align_vect_t > align_conf_t
 

Protected Member Functions

template<typename P , typename A , typename V >
void modifyAlign (const P &owner, const A &axis, const V &value)
 Change alignment configuration without updating the alignStr.
 
virtual void updateAlign ()
 

Protected Attributes

bitvect_t alignment = 0
 
align_conf_t alignments = align_conf_t(2, align_vect_t(2, AlignBase::Pos::UNDEFINED_POS))
 

Detailed Description

User-friendly programming interface for alignment considering two elements.

Designed to be contained by SVG elements. Considers two elements, or more specifically, the bounding boxes of two elements.

Member Function Documentation

◆ confToStream()

void confToStream ( std::ostream &  ostr) const

For some reason, toStream() conflicts with: drain::NodeXML<T>::toStream(std::ostream&, const T&, const string&, int)

◆ setAlign() [1/2]

void setAlign ( const AlignBase::Axis &  axis,
const AlignBase::Pos pos,
Topol  topol = Topol::INSIDE 
)
inline

Set a single alignment setting. "Intermediate-level": axis and pos are given separately.

Parameters
topol- INSIDE or OUTSIDE
axis- HORZ or VERT
pos- MIN , MID , or MAX

Used by file-svg.cpp

◆ setAlign() [2/2]

void setAlign ( const std::string &  align)

High-level, user friendly interface for setting the alignments for both OBJECT itself and its ANCHOR object.

Handler for command line or configuration file arguments.

Handler for command line or configuration file arguments


The documentation for this struct was generated from the following files: