DGtal  0.9.4.1
Namespaces | Data Structures | Functions | Variables
LibBoard Namespace Reference

Namespaces

 Fonts
 

Data Structures

struct  Arc
 
struct  Arrow
 
class  Board
 
struct  Circle
 
struct  Dot
 
struct  Ellipse
 
struct  GouraudTriangle
 
struct  Group
 
struct  Image
 
struct  Line
 
class  MessageStream
 
struct  Path
 
struct  Point
 
struct  Polyline
 
struct  QuadraticBezierCurve
 
struct  Rect
 
struct  Rectangle
 
struct  Shape
 
struct  ShapeList
 
struct  Text
 
struct  Transform
 
struct  TransformCairo
 
struct  TransformEPS
 
struct  TransformFIG
 
struct  TransformSVG
 
struct  TransformTikZ
 
struct  Triangle
 

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)
 
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 &&() [1/2]

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.

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

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 }

◆ operator &&() [2/2]

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.

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

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 }

◆ operator!=()

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

Definition at line 177 of file Point.h.

178 {
179  return ( a.x != b.x ) || ( a.y != b.y ) ;
180 }

◆ operator*() [1/3]

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

Definition at line 115 of file Point.h.

116 {
117  return a.x * b.x + a.y * b.y;
118 }

◆ operator*() [2/3]

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

Definition at line 121 of file Point.h.

122 {
123  return Point( p.x * s, p.y * s );
124 }
MyPointD Point
Definition: testClone2.cpp:383

◆ operator*() [3/3]

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

Definition at line 127 of file Point.h.

128 {
129  return Point( s * p.x, s * p.y );
130 }
MyPointD Point
Definition: testClone2.cpp:383

◆ operator+()

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

Definition at line 103 of file Point.h.

104 {
105  return Point( a.x + b.x, a.y + b.y );
106 }
MyPointD Point
Definition: testClone2.cpp:383

◆ operator-()

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

Definition at line 109 of file Point.h.

110 {
111  return Point( a.x - b.x, a.y - b.y );
112 }
MyPointD Point
Definition: testClone2.cpp:383

◆ operator/()

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

Definition at line 133 of file Point.h.

134 {
135  return Point( p.x / s, p.y / s );
136 }
MyPointD Point
Definition: testClone2.cpp:383

◆ operator==()

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

Definition at line 171 of file Point.h.

172 {
173  return ( a.x == b.x ) && ( a.y == b.y ) ;
174 }

◆ 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.

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

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 }

◆ 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 
)

Compares two shapes according to their depths.

Parameters
s1A pointer to a first shape.
s2A pointer to a second shape.
Returns
TODO

Definition at line 95 of file Shapes.cpp.

References LibBoard::Shape::depth().

Referenced by LibBoard::ShapeList::addShape(), LibBoard::ShapeList::flushCairo(), LibBoard::ShapeList::flushFIG(), LibBoard::ShapeList::flushPostscript(), LibBoard::ShapeList::flushSVG(), LibBoard::ShapeList::flushTikZ(), LibBoard::ShapeList::operator<<(), LibBoard::Board::saveCairo(), LibBoard::Board::saveEPS(), LibBoard::Board::saveFIG(), LibBoard::Board::saveSVG(), and LibBoard::Board::saveTikZ().

96 {
97  return s1->depth() > s2->depth();
98 }

Variable Documentation

◆ error

LibBoard::MessageStream LibBoard::error

◆ notice

LibBoard::MessageStream LibBoard::notice

◆ PSFontNames

const char * LibBoard::PSFontNames

Definition at line 16 of file PSFonts.cpp.

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

◆ warning

LibBoard::MessageStream LibBoard::warning

◆ XFigPostscriptFontnames

const char* LibBoard::XFigPostscriptFontnames[]