DGtal 1.4.2
Loading...
Searching...
No Matches
LibBoard Namespace Reference

Namespaces

namespace  Fonts
 

Data Structures

struct  Arc
 An arc. More...
 
struct  Arrow
 A line between two points with an arrow at one extremity. More...
 
class  Board
 Class for EPS, FIG or SVG drawings. More...
 
struct  Circle
 A circle. More...
 
struct  Dot
 A line between two points. More...
 
struct  Ellipse
 An ellipse. More...
 
struct  GouraudTriangle
 A triangle with shaded filling according to colors given for each vertex. More...
 
struct  Group
 A group of shapes. A group is basically a ShapeList except that when rendered in either an SVG of a FIG file, it is a true compound element. More...
 
struct  Image
 Used to draw image in figure. More...
 
struct  Line
 A line between two points. More...
 
class  MessageStream
 
struct  Path
 A path, according to Postscript and SVG definition. More...
 
struct  Point
 Struct representing a 2D point. More...
 
struct  Polyline
 A polygonal line described by a series of 2D points. More...
 
struct  QuadraticBezierCurve
 A quadratic Bezier curve having 3 control points. NB. It is also a parabola arc. More...
 
struct  Rect
 Struct representing a rectangle on the plane. More...
 
struct  Rectangle
 A rectangle. More...
 
struct  Shape
 Abstract structure for a 2D shape. More...
 
struct  ShapeList
 A group of shapes. More...
 
struct  Text
 A piece of text. More...
 
struct  Transform
 base class for transforms. More...
 
struct  TransformCairo
 Structure representing a scaling and translation suitable for an Cairo output. More...
 
struct  TransformEPS
 Structure representing a scaling and translation suitable for an EPS output. More...
 
struct  TransformFIG
 Structure representing a scaling and translation suitable for an XFig output. More...
 
struct  TransformSVG
 Structure representing a scaling and translation suitable for an SVG output. More...
 
struct  TransformTikZ
 Structure representing a scaling and translation suitable for an TikZ output. More...
 
struct  Triangle
 A triangle. Basically a Polyline with a convenient constructor. More...
 

Functions

Point operator+ (const Point &a, const Point &b)
 
Point operator- (const Point &a, const Point &b)
 
double operator* (const Point &a, const Point &b)
 
Point operator* (const Point &p, double s)
 
Point operator* (double s, const Point &p)
 
Point operator/ (const Point &p, double s)
 
bool operator== (const Point &a, const Point &b)
 
bool operator!= (const Point &a, const Point &b)
 
Rect operator|| (const Rect &rectA, const Rect &rectB)
 
Rect operator&& (const Rect &rectA, const Rect &rectB)
 
bool shapeGreaterDepth (const Shape *s1, const Shape *s2)
 
void secured_strncpy (char *dst, const char *src, size_t count)
 
void secured_ctime (char *str, const time_t *t, size_t count)
 

Variables

const char * PSFontNames []
 
const char * XFigPostscriptFontnames []
 
MessageStream error
 
MessageStream warning
 
MessageStream notice
 

Function Documentation

◆ operator!=()

bool LibBoard::operator!= ( const Point & a,
const Point & b )
inline

Definition at line 184 of file Point.h.

185{
186 return ( a.x != b.x ) || ( a.y != b.y ) ;
187}

◆ operator&&()

Rect LibBoard::operator&& ( const Rect & rectA,
const Rect & rectB )

Computes the intersection of two bounding boxes.

Parameters
rectAA first rectangle.
rectBA second rectangle.
Returns
The intersecting rectangle of two bounding boxes.

Definition at line 37 of file Rect.cpp.

38{
39 Rect rect;
40 rect.top = ( rectA.top < rectB.top ) ? rectA.top : rectB.top;
41 rect.left = (rectA.left > rectB.left) ? rectA.left : rectB.left;
42 if ( rectA.left + rectA.width < rectB.left + rectB.width )
43 rect.width = rectA.left + rectA.width - rect.left;
44 else
45 rect.width = rectB.left + rectB.width - rect.left;
46 if ( rectA.top - rectA.height > rectB.top - rectB.height )
47 rect.height = rect.top - ( rectA.top - rectA.height );
48 else
49 rect.height = rect.top - ( rectB.top - rectB.height );
50 if ( rect.height < 0 ) rect.height = 0;
51 if ( rect.width < 0 ) rect.width = 0;
52 return rect;
53}
Struct representing a rectangle on the plane.
Definition Rect.h:26
double height
Definition Rect.h:31
double width
Definition Rect.h:30
double left
Definition Rect.h:28
double top
Definition Rect.h:29

References LibBoard::Rect::height, LibBoard::Rect::left, LibBoard::Rect::top, and LibBoard::Rect::width.

◆ operator*() [1/3]

double LibBoard::operator* ( const Point & a,
const Point & b )
inline

Definition at line 122 of file Point.h.

123{
124 return a.x * b.x + a.y * b.y;
125}

◆ operator*() [2/3]

Point LibBoard::operator* ( const Point & p,
double s )
inline

Definition at line 128 of file Point.h.

129{
130 return Point( p.x * s, p.y * s );
131}
MyPointD Point

◆ operator*() [3/3]

Point LibBoard::operator* ( double s,
const Point & p )
inline

Definition at line 134 of file Point.h.

135{
136 return Point( s * p.x, s * p.y );
137}

◆ operator+()

Point LibBoard::operator+ ( const Point & a,
const Point & b )
inline

Definition at line 110 of file Point.h.

111{
112 return Point( a.x + b.x, a.y + b.y );
113}

◆ operator-()

Point LibBoard::operator- ( const Point & a,
const Point & b )
inline

Definition at line 116 of file Point.h.

117{
118 return Point( a.x - b.x, a.y - b.y );
119}

◆ operator/()

Point LibBoard::operator/ ( const Point & p,
double s )
inline

Definition at line 140 of file Point.h.

141{
142 return Point( p.x / s, p.y / s );
143}

◆ operator==()

bool LibBoard::operator== ( const Point & a,
const Point & b )
inline

Definition at line 178 of file Point.h.

179{
180 return ( a.x == b.x ) && ( a.y == b.y ) ;
181}

◆ operator||()

Rect LibBoard::operator|| ( const Rect & rectA,
const Rect & rectB )

Computes the bounding box of two bounding boxes.

Parameters
rectAA first rectangle.
rectBA second rectangle.
Returns
The smallest rectangle that contains both rectA and rectB.

Definition at line 20 of file Rect.cpp.

21{
22 Rect rect;
23 rect.top = ( rectA.top > rectB.top ) ? rectA.top : rectB.top;
24 rect.left = (rectA.left < rectB.left) ? rectA.left : rectB.left;
25 if ( rectA.left + rectA.width > rectB.left + rectB.width )
26 rect.width = rectA.left + rectA.width - rect.left;
27 else
28 rect.width = rectB.left + rectB.width - rect.left;
29 if ( rectA.top - rectA.height < rectB.top - rectB.height )
30 rect.height = rect.top - ( rectA.top - rectA.height );
31 else
32 rect.height = rect.top - ( rectB.top - rectB.height );
33 return rect;
34}

References LibBoard::Rect::height, LibBoard::Rect::left, LibBoard::Rect::top, and LibBoard::Rect::width.

◆ secured_ctime()

void LibBoard::secured_ctime ( char * str,
const time_t * t,
size_t count )
inline

◆ secured_strncpy()

void LibBoard::secured_strncpy ( char * dst,
const char * src,
size_t count )
inline

◆ shapeGreaterDepth()

bool LibBoard::shapeGreaterDepth ( const Shape * s1,
const Shape * s2 )

Variable Documentation

◆ error

LibBoard::MessageStream LibBoard::error
extern

Referenced by testSegmentationLarger().

◆ notice

LibBoard::MessageStream LibBoard::notice
extern

◆ PSFontNames

const char * LibBoard::PSFontNames

Definition at line 16 of file PSFonts.cpp.

16 {
17 "Times-Roman",
18 "Times-Italic",
19 "Times-Bold",
20 "Times-Bold-Italic",
21 "AvantGarde-Book",
22 "AvantGarde-Book-Oblique",
23 "AvantGarde-Demi",
24 "AvantGarde-Demi-Oblique",
25 "Bookman-Light",
26 "Bookman-Light-Italic",
27 "Bookman-Demi",
28 "Bookman-Demi-Italic",
29 "Courier",
30 "Courier-Oblique",
31 "Courier-Bold",
32 "Courier-Bold-Oblique",
33 "Helvetica",
34 "Helvetica-Oblique",
35 "Helvetica-Bold",
36 "Helvetica-Bold-Oblique",
37 "Helvetica-Narrow",
38 "Helvetica-Narrow-Oblique",
39 "Helvetica-Narrow-Bold",
40 "Helvetica-Narrow-Bold-Oblique",
41 "New-Century-Schoolbook-Roman",
42 "New-Century-Schoolbook-Italic",
43 "New-Century-Schoolbook-Bold",
44 "New-Century-Schoolbook-Bold-Italic",
45 "Palatino-Roman",
46 "Palatino-Italic",
47 "Palatino-Bold",
48 "Palatino-Bold-Italic",
49 "Symbol",
50 "Zapf-Chancery-Medium-Italic",
51 "Zapf-Dingbats"
52};

Referenced by LibBoard::Text::flushPostscript(), and LibBoard::Text::flushSVG().

◆ warning

◆ XFigPostscriptFontnames

const char* LibBoard::XFigPostscriptFontnames[]
extern