The Triangle class represents a triangle.
More...
#include <triangle.h>
The Triangle class represents a triangle.
- Author
- Sam Twidale (https://samcodes.co.uk/)
◆ Triangle() [1/2]
geometrize::Triangle::Triangle |
( |
| ) |
|
|
default |
◆ Triangle() [2/2]
geometrize::Triangle::Triangle |
( |
float |
x1, |
|
|
float |
y1, |
|
|
float |
x2, |
|
|
float |
y2, |
|
|
float |
x3, |
|
|
float |
y3 |
|
) |
| |
12{
19}
float m_x3
Third x-coordinate.
Definition: triangle.h:28
float m_y3
Third y-coordinate.
Definition: triangle.h:29
float m_y1
First y-coordinate.
Definition: triangle.h:25
float m_x2
Second x-coordinate.
Definition: triangle.h:26
float m_x1
First x-coordinate.
Definition: triangle.h:24
float m_y2
Second y-coordinate.
Definition: triangle.h:27
◆ clone()
clone Clones the shape, a virtual copy constructor.
- Returns
- A clone of the shape.
Reimplemented from geometrize::Shape.
22{
23 std::shared_ptr<geometrize::Triangle> triangle{std::make_shared<geometrize::Triangle>()};
24 triangle->m_x1 =
m_x1;
25 triangle->m_y1 =
m_y1;
26 triangle->m_x2 =
m_x2;
27 triangle->m_y2 =
m_y2;
28 triangle->m_x3 =
m_x3;
29 triangle->m_y3 =
m_y3;
30 triangle->setup =
setup;
33 return triangle;
34}
std::function< std::vector< geometrize::Scanline >(const geometrize::Shape &)> rasterize
Definition: shape.h:27
std::function< void(geometrize::Shape &)> setup
Definition: shape.h:25
std::function< void(geometrize::Shape &)> mutate
Definition: shape.h:26
◆ getType()
getType Gets the ShapeType of the shape.
- Returns
- The ShapeType of the shape.
Reimplemented from geometrize::Shape.
37{
39}
@ TRIANGLE
Definition: shapetypes.h:20
◆ m_x1
float geometrize::Triangle::m_x1 |
◆ m_x2
float geometrize::Triangle::m_x2 |
◆ m_x3
float geometrize::Triangle::m_x3 |
◆ m_y1
float geometrize::Triangle::m_y1 |
◆ m_y2
float geometrize::Triangle::m_y2 |
◆ m_y3
float geometrize::Triangle::m_y3 |
The documentation for this class was generated from the following files:
- /home/appveyor/projects/geometrize-lib-docs/geometrize-lib/geometrize/geometrize/shape/triangle.h
- /home/appveyor/projects/geometrize-lib-docs/geometrize-lib/geometrize/geometrize/shape/triangle.cpp