Variant-based runtime polymorphism function.
16 std::vector<CommonType> vec;
20 vec.push_back(
FRect() );
24 vec.push_back(
cpol );
25 vec.push_back( opol );
27 fct::DrawFunct vde(
im );
28 auto h =
Homogr().addTranslation(3,3).addScale(15);
32 <<
"\n -area=" <<
area(e)
33 <<
"\n -size=" <<
size(e);
35 std::cout <<
"\n -length=" <<
length(e);
39 std::cout <<
"\n -length=N/A (li=" << li <<
')';
Homogr_< HOMOG2D_INUMTYPE > Homogr
Default homography (3x3 matrix) type, uses double as numerical type.
Definition: homog2d.hpp:12382
OPolyline_< HOMOG2D_INUMTYPE > OPolyline
Definition: homog2d.hpp:12399
FRect_< HOMOG2D_INUMTYPE > FRect
Default rectangle type.
Definition: homog2d.hpp:12395
Segment_< HOMOG2D_INUMTYPE > Segment
Default segment type.
Definition: homog2d.hpp:12388
Circle_< HOMOG2D_INUMTYPE > Circle
Default circle type.
Definition: homog2d.hpp:12392
Line2d_< HOMOG2D_INUMTYPE > Line2d
Default line type, uses double as numerical type.
Definition: homog2d.hpp:12376
Ellipse_< HOMOG2D_INUMTYPE > Ellipse
Default ellipse type.
Definition: homog2d.hpp:12402
HOMOG2D_INUMTYPE length(const T &elem)
Returns length of element or variant (free function)
Definition: homog2d.hpp:10223
Type type(const T &elem)
Free function. Returns the type of object or variant.
Definition: homog2d.hpp:10190
VariantUnwrapper(const std::variant< Ts... > &) -> VariantUnwrapper< Ts... >
Fix for the above VariantUnwrapper for C++17.
Line2d li
Definition: homog2d_test.cpp:4035
CPolyline_< HOMOG2D_INUMTYPE > CPolyline
Default polyline type.
Definition: homog2d.hpp:12398
Point2d_< HOMOG2D_INUMTYPE > Point2d
Default point type, uses double as numerical type.
Definition: homog2d.hpp:12379
Dtype dtype(const T &elem)
Returns the underlying data type of object or variant.
Definition: homog2d.hpp:10208
HOMOG2D_INUMTYPE size(const T &elem)
Returns size of element or variant (free function)
Definition: homog2d.hpp:10253
img::Image< img::SvgImage > im(300, 400)
CPolyline cpol
Definition: homog2d_test.cpp:4030
CommonType_< FPT > transform(const Homogr_< FPT > &h, const T &elem)
Apply homography to primitive.
Definition: homog2d.hpp:10378
HOMOG2D_INUMTYPE area(const T &elem)
Returns area of element or variant (free function)
Definition: homog2d.hpp:10238
const char * getString(PtStyle t)
Definition: homog2d.hpp:496