# LibBoard::Triangle Struct Reference

A triangle. Basically a Polyline with a convenient constructor. More...

`#include <Shapes.h>`

Inheritance diagram for LibBoard::Triangle:

List of all members.

## Public Member Functions

| Triangle (const Point &p1, const Point &p2, const Point &p3, Color penColor, Color fillColor, double lineWidth, const LineStyle style=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1)
| Triangle (const double x1, const double y1, const double x2, const double y2, const double x3, const double y3, Color penColor, Color fillColor, double lineWidth, const LineStyle style=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1)
const std::string & | name () const
Triangle | rotated (double angle) const
Triangle | translated (double dx, double dy) const
Triangle | scaled (double sx, double sy) const
Triangle | scaled (double s) const
Triangle * | clone () const

## Detailed Description

A triangle. Basically a Polyline with a convenient constructor.

The Triangle structure.

Examples:

  examples/koch.cpp.

## Member Function Documentation

Triangle * LibBoard::Triangle::clone | ( |  | ) | const`[virtual]`

Return a copy of the shape.

Returns:

Reimplemented from LibBoard::Polyline.

const std::string & LibBoard::Triangle::name | ( |  | ) | const`[virtual]`

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

Returns:

Reimplemented from LibBoard::Polyline.

Triangle LibBoard::Triangle::rotated | ( | double | angle | ) | const

Parameters:

  | angle |

Returns:

Reimplemented from LibBoard::Polyline.

Triangle LibBoard::Triangle::scaled | ( | double | sx,
|  | double | sy |
| ) |  |  | const

Returns a scaled copy of the triangle.

Parameters:

  | sx | Scale factor along the x axis.
  | sy | Scale factor along the y axis.

Returns:
  A scaled copy of the arrow.

Reimplemented from LibBoard::Polyline.

Triangle LibBoard::Triangle::translated | ( | double | dx,
|  | double | dy |
| ) |  |  | const

Returns a translated copy of the triangle.

Parameters:

  | dx | The shift along the x axis.
  | dy | The shift along the y axis.

Returns:
  A translated copy of the line.

Reimplemented from LibBoard::Polyline.

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

- include/board/Shapes.h
- src/Shapes.cpp