Board
0.9.5
|
A triangle with shaded filling according to colors given for each vertex. More...
#include <Polyline.h>
Public Member Functions | |
GouraudTriangle (const Point &p0, const Color &color0, const Point &p1, const Color &color1, const Point &p2, const Color &color2, int subdivisions) | |
GouraudTriangle (const Point &p0, float brightness0, const Point &p1, float brightness1, const Point &p2, float brightness2, const Color &fillColor, int subdivisions) | |
const std::string & | name () const override |
GouraudTriangle & | rotate (double angle, const Point ¢er) override |
GouraudTriangle | rotated (double angle, const Point ¢er) const |
GouraudTriangle & | rotate (double angle) override |
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) override |
GouraudTriangle | resized (double w, double h, LineWidthFlag lineWidthFlag) const |
void | flushPostscript (std::ostream &stream, const TransformEPS &transform) const override |
void | flushFIG (std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const override |
void | flushSVG (std::ostream &stream, const TransformSVG &transform) const override |
void | flushTikZ (std::ostream &stream, const TransformTikZ &transform) const override |
GouraudTriangle * | clone () const override |
![]() | |
Polyline (const std::vector< Point > &points, Path::OpenClosed openClosed, Color penColor=Style::defaultPenColor(), Color fillColor=Style::defaultFillColor(), double lineWidth=Style::defaultLineWidth(), const LineStyle lineStyle=Style::defaultLineStyle(), const LineCap cap=Style::defaultLineCap(), const LineJoin join=Style::defaultLineJoin()) | |
Polyline (const std::vector< Point > &points, Path::OpenClosed openClosed, const Style &style) | |
Polyline (const Path &path, Color penColor=Style::defaultPenColor(), Color fillColor=Style::defaultFillColor(), double lineWidth=Style::defaultLineWidth(), const LineStyle lineStyle=Style::defaultLineStyle(), const LineCap cap=Style::defaultLineCap(), const LineJoin join=Style::defaultLineJoin()) | |
Polyline (const Path &path, const Style &style) | |
Polyline (Path::OpenClosed openClosed, Color penColor=Style::defaultPenColor(), Color fillColor=Style::defaultFillColor(), double lineWidth=Style::defaultLineWidth(), const LineStyle lineStyle=Style::defaultLineStyle(), const LineCap cap=Style::defaultLineCap(), const LineJoin join=Style::defaultLineJoin()) | |
Polyline (Path::OpenClosed openClosed, const Style &style) | |
Polyline & | operator<< (const Point &p) |
Point & | operator[] (const std::size_t n) |
const Point & | operator[] (const std::size_t n) const |
Polyline | rotated (double angle, const Point ¢er) const |
Polyline | rotated (double angle) const |
Polyline & | translate (double dx, double dy) override |
Polyline | translated (double dx, double dy) const |
Polyline & | scale (double sx, double sy) override |
Polyline & | scale (double s) override |
Polyline | scaled (double sx, double sy) const |
Polyline | scaled (double s) const |
Polyline | resized (double w, double h, LineWidthFlag lineWidthFlag) const |
void | addHole (const Path &path) |
Add a hole to the path. Warning: Hole share the polyline line style. More... | |
virtual void | accept (ShapeVisitor &visitor) override |
Accepts a visitor object. More... | |
virtual void | accept (const ShapeVisitor &visitor) override |
Accepts a visitor object. More... | |
virtual void | accept (ConstShapeVisitor &visitor) const override |
Accepts a const-shape visitor object. More... | |
virtual void | accept (const ConstShapeVisitor &visitor) const override |
Accepts a const-shape visitor object. More... | |
virtual Shape * | accept (CompositeShapeTransform &transform) const override |
Accept a composite shape transform. More... | |
virtual Shape * | accept (const CompositeShapeTransform &transform) const override |
Accept a constant composite shape transform. More... | |
Rect | boundingBox (LineWidthFlag) const override |
std::size_t | vertexCount () const |
const Path & | path () const |
void | setRectangleFlag () |
Polyline (const Polyline &)=default | |
Polyline (Polyline &&)=default | |
Polyline & | operator= (Polyline &&)=default |
Polyline & | operator= (const Polyline &)=default |
![]() | |
ShapeWithStyle (Color penColor, Color fillColor, double lineWidth, LineStyle style, const LineCap cap, const LineJoin join) | |
ShapeWithStyle (const Style &style) | |
ShapeWithStyle (const ShapeWithStyle &other) | |
ShapeWithStyle & | operator= (const ShapeWithStyle &other) |
~ShapeWithStyle () | |
const std::string & | name () const |
const Color & | penColor () const |
ShapeWithStyle & | setPenColor (const Color &) |
const Color & | fillColor () const |
ShapeWithStyle & | setFillColor (const Color &) |
double | lineWidth () const |
ShapeWithStyle & | setLineWidth (double) |
LineStyle | lineStyle () const |
ShapeWithStyle & | setLineStyle (LineStyle) |
LineCap | lineCap () const |
ShapeWithStyle & | setLineCap (LineCap) |
LineJoin | lineJoin () const |
ShapeWithStyle & | setLineJoin (LineJoin) |
Style | style () const |
ShapeWithStyle & | setStyle (const Style &) |
bool | filled () const |
![]() | |
Shape () | |
virtual | ~Shape () |
virtual Point | center (LineWidthFlag lineWidthFlag=IgnoreLineWidth) const |
Shape & | rotateDeg (double angle, const Point ¢er) |
Shape & | rotateDeg (double angle) |
Shape & | moveCenter (double x, double y, LineWidthFlag lineWidthFlag=IgnoreLineWidth) |
Shape & | moveCenter (Point p, LineWidthFlag lineWidthFlag=IgnoreLineWidth) |
Shape & | resize (double width, double height, LineWidthFlag lineWidthFlag) |
Shape & | scaleToWidth (double w, LineWidthFlag lineWidthFlag) |
Shape & | scaleToHeight (double h, LineWidthFlag lineWidthFlag) |
Rect | bbox (LineWidthFlag) const |
Shape (const Shape &other) | |
Protected Attributes | |
Color | _color0 |
Color | _color1 |
Color | _color2 |
int | _subdivisions |
![]() | |
Path | _path |
std::vector< Path > | _holes |
![]() | |
Style | _style |
Additional Inherited Members | |
![]() | |
static void | setLineWidthScaling (bool) |
![]() | |
void | updateLineWidth (double s) |
A triangle with shaded filling according to colors given for each vertex.
The GouraudTriangle structure.
|
overridevirtual |
|
overridevirtual |
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.
stream | |
transform | |
colormap |
Reimplemented from LibBoard::Polyline.
References LibBoard::Polyline::flushFIG().
|
overridevirtual |
Sends the triangle to a Postscript document.
stream | |
transform |
Reimplemented from LibBoard::Polyline.
References LibBoard::Polyline::flushPostscript(), flushPostscript(), LibBoard::Point::x, and LibBoard::Point::y.
Referenced by flushPostscript().
|
overridevirtual |
Write the SVG code of the shape in a stream according to a transform.
stream | The output stream. |
transform | A 2D transform to be applied. |
Reimplemented from LibBoard::Polyline.
References LibBoard::Polyline::flushSVG(), flushSVG(), LibBoard::Point::x, and LibBoard::Point::y.
Referenced by flushSVG().
|
overridevirtual |
Write the TikZ code of the shape in a stream according to a transform.
stream | The output stream. |
transform | A 2D transform to be applied. |
Reimplemented from LibBoard::Polyline.
|
overridevirtual |
Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)
Reimplemented from LibBoard::Polyline.
GouraudTriangle LibBoard::GouraudTriangle::resized | ( | double | w, |
double | h, | ||
LineWidthFlag | lineWidthFlag | ||
) | const |
Returns a resized copy of the triangle.
w | Width of the new triangle. |
h | Height of the new triangle. |
lineWidthFlag | Should the line width be considered when computing bounding boxes. |
References LibBoard::Shape::resize().
|
overridevirtual |
Rotate the shape around its center.
angle | The rotation angle in radian. |
Reimplemented from LibBoard::Polyline.
References LibBoard::Shape::center(), and rotate().
|
overridevirtual |
Rotate the shape around a given center of rotation.
angle | The rotation angle in radian. |
center | The center of rotation. |
Reimplemented from LibBoard::Polyline.
References LibBoard::Shape::center(), and rotate().
Referenced by rotate().
|
overridevirtual |
Scales all the values (positions, dimensions, etc.) associated with the shape.
s | The scaling factor. |
Reimplemented from LibBoard::Polyline.
GouraudTriangle LibBoard::GouraudTriangle::scaled | ( | double | s | ) | const |
Returns a scaled copy of the triangle.
s | The scaling factor. |
References LibBoard::Polyline::scale().
GouraudTriangle LibBoard::GouraudTriangle::scaled | ( | double | sx, |
double | sy | ||
) | const |
Returns a scaled copy of the triangle.
sx | Scaling factor along the x axis. |
sy | scaling factor along the y axis. |
References LibBoard::Polyline::scale().
GouraudTriangle LibBoard::GouraudTriangle::translated | ( | double | dx, |
double | dy | ||
) | const |
Returns a translated copy of the triangle.
dx | The shift along the x axis. |
dy | The shift along the y axis. |
References LibBoard::Polyline::translate().