DGtal  0.9.4beta
Public Member Functions | Protected Attributes | Static Private Attributes
LibBoard::GouraudTriangle Struct Reference

#include <Board/Shapes.h>

Inheritance diagram for LibBoard::GouraudTriangle:
[legend]
Collaboration diagram for LibBoard::GouraudTriangle:
[legend]

Public Member Functions

 GouraudTriangle (const Point &p0, const DGtal::Color &color0, const Point &p1, const DGtal::Color &color1, const Point &p2, const DGtal::Color &color2, int subdivisions, int depth=-1)
 
 GouraudTriangle (const Point &p0, float brightness0, const Point &p1, float brightness1, const Point &p2, float brightness2, const DGtal::Color &fillColor, int subdivisions, int depth=-1)
 
const std::string & name () const
 
Point center () const
 
GouraudTrianglerotate (double angle, const Point &center)
 
GouraudTriangle rotated (double angle, const Point &center) const
 
GouraudTrianglerotate (double angle)
 
GouraudTriangle rotated (double angle) const
 
GouraudTriangle translated (double dx, double dy) const
 
GouraudTriangle scaled (double sx, double sy) const
 
GouraudTriangle scaled (double s) const
 
void scaleAll (double s)
 
void flushPostscript (std::ostream &stream, const TransformEPS &transform) const
 
void flushFIG (std::ostream &stream, const TransformFIG &transform, std::map< DGtal::Color, int > &colormap) const
 
void flushSVG (std::ostream &stream, const TransformSVG &transform) const
 
void flushCairo (cairo_t *cr, const TransformCairo &transform) const
 
void flushTikZ (std::ostream &stream, const TransformTikZ &transform) const
 
GouraudTriangleclone () const
 
- Public Member Functions inherited from LibBoard::Polyline
 Polyline (const std::vector< Point > &points, bool closed, DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, const LineStyle lineStyle=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1)
 
 Polyline (const Path &path, DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, const LineStyle lineStyle=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1)
 
 Polyline (bool closed, DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, const LineStyle lineStyle=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1)
 
Polylineoperator<< (const Point &p)
 
Pointoperator[] (const unsigned int n)
 
Polyline rotated (double angle, const Point &center) const
 
Polyline rotated (double angle) const
 
Polylinetranslate (double dx, double dy)
 
Polyline translated (double dx, double dy) const
 
Shapescale (double sx, double sy)
 
Shapescale (double s)
 
Polyline scaled (double sx, double sy) const
 
Polyline scaled (double s) const
 
Rect boundingBox () const
 
- Public Member Functions inherited from LibBoard::Shape
 Shape (DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, LineStyle style, const LineCap cap, const LineJoin join, int depth)
 
virtual ~Shape ()
 
bool filled () const
 
ShaperotateDeg (double angle, const Point &center)
 
ShaperotateDeg (double angle)
 
Rect bbox ()
 
Shapeoperator-- ()
 
Shapeoperator++ ()
 
int depth () const
 
virtual void depth (int)
 
virtual void shiftDepth (int shift)
 
const DGtal::ColorpenColor () const
 
const DGtal::ColorfillColor () const
 

Protected Attributes

DGtal::Color _color0
 
DGtal::Color _color1
 
DGtal::Color _color2
 
int _subdivisions
 
- Protected Attributes inherited from LibBoard::Polyline
Path _path
 
- Protected Attributes inherited from LibBoard::Shape
int _depth
 
DGtal::Color _penColor
 
DGtal::Color _fillColor
 
double _lineWidth
 
LineStyle _lineStyle
 
LineCap _lineCap
 
LineJoin _lineJoin
 

Static Private Attributes

static const std::string _name
 

Additional Inherited Members

- Public Types inherited from LibBoard::Shape
enum  LineCap { ButtCap = 0, RoundCap, SquareCap }
 
enum  LineJoin { MiterJoin = 0, RoundJoin, BevelJoin }
 
enum  LineStyle {
  SolidStyle = 0, DashStyle, DotStyle, DashDotStyle,
  DashDotDotStyle, DashDotDotDotStyle
}
 
- Protected Member Functions inherited from LibBoard::Shape
std::string svgProperties (const TransformSVG &transform) const
 
std::string postscriptProperties () const
 
void setCairoDashStyle (cairo_t *cr, LineStyle type) const
 
std::string tikzProperties (const TransformTikZ &transform) const
 

Detailed Description

A triangle with shaded filling according to colors given for each vertex.

The GouraudTriangle structure.

Definition at line 1223 of file Board/Shapes.h.

Constructor & Destructor Documentation

LibBoard::GouraudTriangle::GouraudTriangle ( const Point p0,
const DGtal::Color color0,
const Point p1,
const DGtal::Color color1,
const Point p2,
const DGtal::Color color2,
int  subdivisions,
int  depth = -1 
)

Definition at line 2119 of file Shapes.cpp.

References LibBoard::Shape::_fillColor, LibBoard::Polyline::_path, DGtal::Color::blue(), DGtal::Color::green(), and DGtal::Color::red().

Referenced by clone(), flushPostscript(), flushSVG(), rotated(), scaled(), and translated().

2124  : Polyline( std::vector<Point>(), true, DGtal::Color::None, DGtal::Color::None,
2125  0.0f, SolidStyle, ButtCap, MiterJoin, depthValue ),
2126  _color0( color0 ), _color1( color1 ), _color2( color2 ), _subdivisions( subdivisions ) {
2127  _path << p0;
2128  _path << p1;
2129  _path << p2;
2130 
2131  Shape::_fillColor.red( ( color0.red() + color1.red() + color2.red() ) / 3 );
2132  Shape::_fillColor.green( ( color0.green() + color1.green() + color2.green() ) / 3 );
2133  Shape::_fillColor.blue( ( color0.blue() + color1.blue() + color2.blue() ) / 3 );
2134 }
Polyline(const std::vector< Point > &points, bool closed, DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, const LineStyle lineStyle=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1)
static const Color None
Definition: Color.h:387
void green(const unsigned char aGreenValue)
void red(const unsigned char aRedValue)
DGtal::Color _fillColor
Definition: Board/Shapes.h:297
void blue(const unsigned char aBlueValue)
LibBoard::GouraudTriangle::GouraudTriangle ( const Point p0,
float  brightness0,
const Point p1,
float  brightness1,
const Point p2,
float  brightness2,
const DGtal::Color fillColor,
int  subdivisions,
int  depth = -1 
)

Definition at line 2136 of file Shapes.cpp.

References _color0, _color1, _color2, LibBoard::Shape::_fillColor, LibBoard::Polyline::_path, DGtal::Color::blue(), DGtal::Color::green(), and DGtal::Color::red().

2142  : Polyline( std::vector<Point>(), true, DGtal::Color::None, DGtal::Color::None,
2143  0.0f, SolidStyle, ButtCap, MiterJoin, depthValue ),
2144  _color0( fill ), _color1( fill ), _color2( fill ), _subdivisions( subdivisions )
2145 {
2146  _path << p0;
2147  _path << p1;
2148  _path << p2;
2149  _color0.red( static_cast<unsigned char>( std::min( 255.0f, _color0.red() * brightness0 ) ) );
2150  _color0.green( static_cast<unsigned char>( std::min( 255.0f, _color0.green() * brightness0 ) ) );
2151  _color0.blue( static_cast<unsigned char>( std::min( 255.0f, _color0.blue() * brightness0 ) ) );
2152  _color1.red( static_cast<unsigned char>( std::min( 255.0f, _color1.red() * brightness1 ) ) );
2153  _color1.green( static_cast<unsigned char>( std::min( 255.0f, _color1.green() * brightness1 ) ) );
2154  _color1.blue( static_cast<unsigned char>( std::min( 255.0f, _color1.blue() * brightness1 ) ) );
2155  _color2.red( static_cast<unsigned char>( std::min( 255.0f, _color2.red() * brightness2 ) ) );
2156  _color2.green( static_cast<unsigned char>( std::min( 255.0f, _color2.green() * brightness2 ) ) );
2157  _color2.blue( static_cast<unsigned char>( std::min( 255.0f, _color2.blue() * brightness2 ) ) );
2158 
2159  Shape::_fillColor.red( ( _color0.red() + _color1.red() + _color2.red() ) / 3 );
2161  Shape::_fillColor.blue( ( _color0.blue() + _color1.blue() + _color2.blue() ) / 3 );
2162 }
Polyline(const std::vector< Point > &points, bool closed, DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, const LineStyle lineStyle=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1)
static const Color None
Definition: Color.h:387
void green(const unsigned char aGreenValue)
void red(const unsigned char aRedValue)
DGtal::Color _fillColor
Definition: Board/Shapes.h:297
void blue(const unsigned char aBlueValue)

Member Function Documentation

Point LibBoard::GouraudTriangle::center ( ) const
virtual

Returns the gravity center of the shape.

Returns
The center of the shape.

Reimplemented from LibBoard::Polyline.

Definition at line 2165 of file Shapes.cpp.

References LibBoard::Polyline::_path.

Referenced by rotate(), and rotated().

2165  {
2166  return ( _path[0] + _path[1] + _path[2] ) / 3.0;
2167 }
GouraudTriangle * LibBoard::GouraudTriangle::clone ( ) const
virtual

Return a copy of the shape.

Returns
copye of the shape.

Reimplemented from LibBoard::Polyline.

Definition at line 2219 of file Shapes.cpp.

References GouraudTriangle().

2219  {
2220  return new GouraudTriangle(*this);
2221 }
GouraudTriangle(const Point &p0, const DGtal::Color &color0, const Point &p1, const DGtal::Color &color1, const Point &p2, const DGtal::Color &color2, int subdivisions, int depth=-1)
Definition: Shapes.cpp:2119
void LibBoard::GouraudTriangle::flushCairo ( cairo_t *  cr,
const TransformCairo transform 
) const
virtual

Writes the cairo code of the shape in a cairo drawing context according to a transform.

Parameters
crThe cairo drawing context.
transformA 2D transform to be applied.

Reimplemented from LibBoard::Polyline.

Definition at line 2324 of file Shapes.cpp.

2326 {
2327 }
void LibBoard::GouraudTriangle::flushFIG ( std::ostream &  stream,
const TransformFIG transform,
std::map< DGtal::Color, int > &  colormap 
) const
virtual

Sends the Triangle to a FIG file format stream.

Warning! Because shading would generally require more colors in the colormap than allowed by the FIG file format, rendering a Gouraud triangle in an XFig file is the same as rendering a simple triangle whose filling color is the average of the vertex colors.

Parameters
streamoutput stream
transformtransform
colormapcolormap

Reimplemented from LibBoard::Polyline.

Definition at line 2253 of file Shapes.cpp.

References _color0, _color1, _color2, LibBoard::Polyline::_path, DGtal::Color::blue(), DGtal::Color::green(), DGtal::Color::None, LibBoard::Polyline::Polyline(), and DGtal::Color::red().

2256 {
2257 
2258  DGtal::Color c( static_cast<unsigned char>((_color0.red() + _color1.red() + _color2.red() )/3.0),
2259  static_cast<unsigned char>((_color0.green() + _color1.green() + _color2.green())/3.0),
2260  static_cast<unsigned char>((_color0.blue() + _color1.blue() + _color2.blue())/3.0 ));
2261  Polyline( _path, DGtal::Color::None, c, 0.0f ).flushFIG( stream, transform, colormap );
2262 
2263  // if ( ! _subdivisions ) {
2264  // Polyline::flushFIG( stream, transform, colormap );
2265  // return;
2266  // }
2267 // TODO : Handle extended colormap through clustering...
2268 // const Point & p0 = _points[0];
2269 // const Point & p1 = _points[1];
2270 // const Point & p2 = _points[2];
2271 // Point p01( 0.5*(p0.x+p1.x), 0.5*(p0.y+p1.y) );
2272 // DGtal::Color c01( (_color0.red() + _color1.red())/2,
2273 // (_color0.green() + _color1.green())/2,
2274 // (_color0.blue() + _color1.blue())/2 );
2275 // Point p12( 0.5*(p1.x+p2.x), 0.5*(p1.y+p2.y) );
2276 // DGtal::Color c12( (_color1.red() + _color2.red())/2,
2277 // (_color1.green() + _color2.green())/2,
2278 // (_color1.blue() + _color2.blue())/2 );
2279 // Point p20( 0.5*(p2.x+p0.x), 0.5*(p2.y+p0.y) );
2280 // DGtal::Color c20( (_color2.red() + _color0.red())/2,
2281 // (_color2.green() + _color0.green())/2,
2282 // (_color2.blue() + _color0.blue())/2 );
2283 // GouraudTriangle( p0, _color0, p20, c20, p01, c01, _subdivisions - 1, _depth ).flushFIG( stream, transform, colormap );
2284 // GouraudTriangle( p1, _color1, p01, c01, p12, c12, _subdivisions - 1, _depth ).flushFIG( stream, transform, colormap );
2285 // GouraudTriangle( p2, _color2, p20, c20, p12, c12, _subdivisions - 1, _depth ).flushFIG( stream, transform, colormap );
2286 // GouraudTriangle( p01, c01, p12, c12, p20, c20, _subdivisions - 1, _depth ).flushFIG( stream, transform, colormap );
2287 }
Polyline(const std::vector< Point > &points, bool closed, DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, const LineStyle lineStyle=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1)
static const Color None
Definition: Color.h:387
Structure representing an RGB triple with alpha component.
Definition: Color.h:66
void green(const unsigned char aGreenValue)
void red(const unsigned char aRedValue)
void blue(const unsigned char aBlueValue)
void LibBoard::GouraudTriangle::flushPostscript ( std::ostream &  stream,
const TransformEPS transform 
) const
virtual

Sends the triangle to a Postscript document.

Parameters
streamoutput stream
transformtransform

Reimplemented from LibBoard::Polyline.

Definition at line 2224 of file Shapes.cpp.

References _color0, _color1, _color2, LibBoard::Shape::_depth, LibBoard::Polyline::_path, _subdivisions, DGtal::Color::blue(), LibBoard::Polyline::flushPostscript(), GouraudTriangle(), DGtal::Color::green(), DGtal::Color::red(), LibBoard::Point::x, and LibBoard::Point::y.

2226 {
2227  if ( ! _subdivisions ) {
2228  Polyline::flushPostscript( stream, transform );
2229  return;
2230  }
2231  const Point & p0 = _path[0];
2232  const Point & p1 = _path[1];
2233  const Point & p2 = _path[2];
2234  Point p01( 0.5*(p0.x+p1.x), 0.5*(p0.y+p1.y) );
2235  DGtal::Color c01( (_color0.red() + _color1.red())/2,
2236  (_color0.green() + _color1.green())/2,
2237  (_color0.blue() + _color1.blue())/2 );
2238  Point p12( 0.5*(p1.x+p2.x), 0.5*(p1.y+p2.y) );
2239  DGtal::Color c12( (_color1.red() + _color2.red())/2,
2240  (_color1.green() + _color2.green())/2,
2241  (_color1.blue() + _color2.blue())/2 );
2242  Point p20( 0.5*(p2.x+p0.x), 0.5*(p2.y+p0.y) );
2243  DGtal::Color c20( (_color2.red() + _color0.red())/2,
2244  (_color2.green() + _color0.green())/2,
2245  (_color2.blue() + _color0.blue())/2 );
2246  GouraudTriangle( p0, _color0, p20, c20, p01, c01, _subdivisions - 1, _depth ).flushPostscript( stream, transform );
2247  GouraudTriangle( p1, _color1, p01, c01, p12, c12, _subdivisions - 1, _depth ).flushPostscript( stream, transform );
2248  GouraudTriangle( p2, _color2, p20, c20, p12, c12, _subdivisions - 1, _depth ).flushPostscript( stream, transform );
2249  GouraudTriangle( p01, c01, p12, c12, p20, c20, _subdivisions - 1, _depth ).flushPostscript( stream, transform );
2250 }
void flushPostscript(std::ostream &stream, const TransformEPS &transform) const
Definition: Shapes.cpp:1737
Structure representing an RGB triple with alpha component.
Definition: Color.h:66
void green(const unsigned char aGreenValue)
void red(const unsigned char aRedValue)
GouraudTriangle(const Point &p0, const DGtal::Color &color0, const Point &p1, const DGtal::Color &color1, const Point &p2, const DGtal::Color &color2, int subdivisions, int depth=-1)
Definition: Shapes.cpp:2119
void blue(const unsigned char aBlueValue)
void LibBoard::GouraudTriangle::flushSVG ( std::ostream &  stream,
const TransformSVG transform 
) const
virtual

Writes the SVG code of the shape in a stream according to a transform.

Parameters
streamThe output stream.
transformA 2D transform to be applied.

Reimplemented from LibBoard::Polyline.

Definition at line 2290 of file Shapes.cpp.

References _color0, _color1, _color2, LibBoard::Shape::_depth, LibBoard::Polyline::_path, _subdivisions, DGtal::Color::blue(), LibBoard::Polyline::flushSVG(), GouraudTriangle(), DGtal::Color::green(), DGtal::Color::red(), LibBoard::Point::x, and LibBoard::Point::y.

2292 {
2293  if ( ! _subdivisions ) {
2294  Polyline::flushSVG( stream, transform );
2295  return;
2296  }
2297  const Point & p0 = _path[0];
2298  const Point & p1 = _path[1];
2299  const Point & p2 = _path[2];
2300  Point p01( 0.5*(p0.x+p1.x), 0.5*(p0.y+p1.y) );
2301  DGtal::Color c01( (_color0.red() + _color1.red())/2,
2302  (_color0.green() + _color1.green())/2,
2303  (_color0.blue() + _color1.blue())/2 );
2304  Point p12( 0.5*(p1.x+p2.x), 0.5*(p1.y+p2.y) );
2305  DGtal::Color c12( (_color1.red() + _color2.red())/2,
2306  (_color1.green() + _color2.green())/2,
2307  (_color1.blue() + _color2.blue())/2 );
2308  Point p20( 0.5*(p2.x+p0.x), 0.5*(p2.y+p0.y) );
2309  DGtal::Color c20( (_color2.red() + _color0.red())/2,
2310  (_color2.green() + _color0.green())/2,
2311  (_color2.blue() + _color0.blue())/2 );
2312  GouraudTriangle( p0, _color0, p20, c20, p01, c01,
2313  _subdivisions - 1, _depth ).flushSVG( stream, transform );
2314  GouraudTriangle( p1, _color1, p01, c01, p12, c12,
2315  _subdivisions - 1, _depth ).flushSVG( stream, transform );
2316  GouraudTriangle( p2, _color2, p20, c20, p12, c12,
2317  _subdivisions - 1, _depth ).flushSVG( stream, transform );
2318  GouraudTriangle( p01, c01, p12, c12, p20, c20,
2319  _subdivisions - 1, _depth ).flushSVG( stream, transform );
2320 }
void flushSVG(std::ostream &stream, const TransformSVG &transform) const
Definition: Shapes.cpp:1793
Structure representing an RGB triple with alpha component.
Definition: Color.h:66
void green(const unsigned char aGreenValue)
void red(const unsigned char aRedValue)
GouraudTriangle(const Point &p0, const DGtal::Color &color0, const Point &p1, const DGtal::Color &color1, const Point &p2, const DGtal::Color &color2, int subdivisions, int depth=-1)
Definition: Shapes.cpp:2119
void blue(const unsigned char aBlueValue)
void LibBoard::GouraudTriangle::flushTikZ ( std::ostream &  stream,
const TransformTikZ transform 
) const
virtual

Writes the TikZ code of the shape in a stream according to a transform.

Parameters
streamThe output stream.
transformA 2D transform to be applied.

Reimplemented from LibBoard::Polyline.

Definition at line 2331 of file Shapes.cpp.

2333 {
2334  // FIXME: unimplemented
2335  stream << "% FIXME: GouraudTriangle::flushTikZ unimplemented" << std::endl;
2336 }
const std::string & LibBoard::GouraudTriangle::name ( ) const
virtual

Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)

Returns
object name

Reimplemented from LibBoard::Polyline.

Definition at line 2114 of file Shapes.cpp.

References _name.

2115 {
2116  return _name;
2117 }
static const std::string _name
GouraudTriangle & LibBoard::GouraudTriangle::rotate ( double  angle,
const Point center 
)
virtual

Rotate the shape around a given center of rotation.

Parameters
angleThe rotation angle in radian.
centerThe center of rotation.
Returns
A reference to the shape itself.

Reimplemented from LibBoard::Polyline.

Definition at line 2170 of file Shapes.cpp.

References LibBoard::Polyline::_path, and LibBoard::Path::rotate().

Referenced by rotate().

2171 {
2172  _path.rotate( angle, rotCenter );
2173  return *this;
2174 }
Path & rotate(double angle, const Point &center)
Definition: Path.cpp:43
GouraudTriangle & LibBoard::GouraudTriangle::rotate ( double  angle)
virtual

Rotate the shape around its center.

Parameters
angleThe rotation angle in radian.
Returns
A reference to the shape itself.

Reimplemented from LibBoard::Polyline.

Definition at line 2183 of file Shapes.cpp.

References center(), and rotate().

2184 {
2185  return GouraudTriangle::rotate( angle, center() );
2186 }
Point center() const
Definition: Shapes.cpp:2165
GouraudTriangle & rotate(double angle, const Point &center)
Definition: Shapes.cpp:2170
GouraudTriangle LibBoard::GouraudTriangle::rotated ( double  angle,
const Point center 
) const

Definition at line 2177 of file Shapes.cpp.

References GouraudTriangle().

2178 {
2179  return GouraudTriangle(*this).rotate( angle, rotCenter );
2180 }
GouraudTriangle(const Point &p0, const DGtal::Color &color0, const Point &p1, const DGtal::Color &color1, const Point &p2, const DGtal::Color &color2, int subdivisions, int depth=-1)
Definition: Shapes.cpp:2119
GouraudTriangle LibBoard::GouraudTriangle::rotated ( double  angle) const

Definition at line 2189 of file Shapes.cpp.

References center(), and GouraudTriangle().

2190 {
2191  return GouraudTriangle(*this).rotate( angle, center() );
2192 }
Point center() const
Definition: Shapes.cpp:2165
GouraudTriangle(const Point &p0, const DGtal::Color &color0, const Point &p1, const DGtal::Color &color1, const Point &p2, const DGtal::Color &color2, int subdivisions, int depth=-1)
Definition: Shapes.cpp:2119
void LibBoard::GouraudTriangle::scaleAll ( double  s)
virtual

Scales all the values (positions, dimensions, etc.) associated with the shape.

Parameters
sThe scaling factor.

Reimplemented from LibBoard::Polyline.

Definition at line 2213 of file Shapes.cpp.

References LibBoard::Polyline::_path, and LibBoard::Path::scaleAll().

2214 {
2215  _path.scaleAll( s );
2216 }
void scaleAll(double s)
Definition: Path.cpp:143
GouraudTriangle LibBoard::GouraudTriangle::scaled ( double  sx,
double  sy 
) const

Returns a scaled copy of the triangle.

Parameters
sxScale factor along the x axis.
syScale factor along the y axis.
Returns
A scaled copy of the arrow.

Definition at line 2201 of file Shapes.cpp.

References GouraudTriangle().

2202 {
2203  return static_cast<GouraudTriangle &>( GouraudTriangle(*this).scale( sx, sy ) );
2204 }
GouraudTriangle(const Point &p0, const DGtal::Color &color0, const Point &p1, const DGtal::Color &color1, const Point &p2, const DGtal::Color &color2, int subdivisions, int depth=-1)
Definition: Shapes.cpp:2119
GouraudTriangle LibBoard::GouraudTriangle::scaled ( double  s) const

Definition at line 2207 of file Shapes.cpp.

References GouraudTriangle().

2208 {
2209  return static_cast<GouraudTriangle &>( GouraudTriangle(*this).scale( s, s ) );
2210 }
GouraudTriangle(const Point &p0, const DGtal::Color &color0, const Point &p1, const DGtal::Color &color1, const Point &p2, const DGtal::Color &color2, int subdivisions, int depth=-1)
Definition: Shapes.cpp:2119
GouraudTriangle LibBoard::GouraudTriangle::translated ( double  dx,
double  dy 
) const

Returns a translated copy of the triangle.

Parameters
dxThe shift along the x axis.
dyThe shift along the y axis.
Returns
A translated copy of the line.

Definition at line 2195 of file Shapes.cpp.

References GouraudTriangle().

2196 {
2197  return static_cast<GouraudTriangle &>( GouraudTriangle(*this).translate( dx, dy ) );
2198 }
GouraudTriangle(const Point &p0, const DGtal::Color &color0, const Point &p1, const DGtal::Color &color1, const Point &p2, const DGtal::Color &color2, int subdivisions, int depth=-1)
Definition: Shapes.cpp:2119

Field Documentation

DGtal::Color LibBoard::GouraudTriangle::_color0
protected

Definition at line 1328 of file Board/Shapes.h.

Referenced by flushFIG(), flushPostscript(), flushSVG(), and GouraudTriangle().

DGtal::Color LibBoard::GouraudTriangle::_color1
protected

Definition at line 1329 of file Board/Shapes.h.

Referenced by flushFIG(), flushPostscript(), flushSVG(), and GouraudTriangle().

DGtal::Color LibBoard::GouraudTriangle::_color2
protected

Definition at line 1330 of file Board/Shapes.h.

Referenced by flushFIG(), flushPostscript(), flushSVG(), and GouraudTriangle().

const std::string LibBoard::GouraudTriangle::_name
staticprivate

The generic name of the shape.

Definition at line 1325 of file Board/Shapes.h.

Referenced by name().

int LibBoard::GouraudTriangle::_subdivisions
protected

Definition at line 1331 of file Board/Shapes.h.

Referenced by flushPostscript(), and flushSVG().


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