Sparkle 0.0.1
Loading...
Searching...
No Matches
spk::ColorMesh::Builder Class Reference

Helper used to build ColorMesh instances from primitives. More...

#include <spk_color_painter.hpp>

Collaboration diagram for spk::ColorMesh::Builder:
Collaboration graph

Public Member Functions

 Builder ()=default
 Builds an empty builder.
Builderclear ()
 Clears all stored polygons.
BuilderinsertTriangle (const Vector2Int &p_a, const Vector2Int &p_b, const Vector2Int &p_c, const Color &p_color)
 Inserts a colored triangle.
BuilderinsertQuad (const Vector2Int &p_a, const Vector2Int &p_b, const Vector2Int &p_c, const Vector2Int &p_d, const Color &p_color, PolygonOrder p_order=PolygonOrder::TriangleFanFromFirst)
 Inserts a colored quad.
BuilderinsertRectangle (const Vector2Int &p_anchor, const Vector2UInt &p_size, const Color &p_color)
 Inserts an axis-aligned rectangle.
ColorMesh construct ()
 Builds a ColorMesh from stored polygons.

Detailed Description

Helper used to build ColorMesh instances from primitives.

builder.insertTriangle(a, b, c, spk::Color::White);
auto mesh = builder.construct();
Helper used to build ColorMesh instances from primitives.
Definition spk_color_painter.hpp:63
ColorMesh construct()
Builds a ColorMesh from stored polygons.
Definition spk_color_painter.hpp:134
Builder & insertTriangle(const Vector2Int &p_a, const Vector2Int &p_b, const Vector2Int &p_c, const Color &p_color)
Inserts a colored triangle.
Definition spk_color_painter.hpp:91

Member Function Documentation

◆ clear()

Builder & spk::ColorMesh::Builder::clear ( )
inline

Clears all stored polygons.

Returns
Reference to this builder.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ construct()

ColorMesh spk::ColorMesh::Builder::construct ( )
inline

Builds a ColorMesh from stored polygons.

Returns
Constructed ColorMesh.
Here is the call graph for this function:

◆ insertQuad()

Builder & spk::ColorMesh::Builder::insertQuad ( const Vector2Int & p_a,
const Vector2Int & p_b,
const Vector2Int & p_c,
const Vector2Int & p_d,
const Color & p_color,
PolygonOrder p_order = PolygonOrder::TriangleFanFromFirst )
inline

Inserts a colored quad.

Parameters
p_aFirst vertex position.
p_bSecond vertex position.
p_cThird vertex position.
p_dFourth vertex position.
p_colorVertex color.
p_orderTriangulation order.
Returns
Reference to this builder.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ insertRectangle()

Builder & spk::ColorMesh::Builder::insertRectangle ( const Vector2Int & p_anchor,
const Vector2UInt & p_size,
const Color & p_color )
inline

Inserts an axis-aligned rectangle.

Parameters
p_anchorTop-left anchor position.
p_sizeRectangle size.
p_colorVertex color.
Returns
Reference to this builder.
Here is the call graph for this function:

◆ insertTriangle()

Builder & spk::ColorMesh::Builder::insertTriangle ( const Vector2Int & p_a,
const Vector2Int & p_b,
const Vector2Int & p_c,
const Color & p_color )
inline

Inserts a colored triangle.

Parameters
p_aFirst vertex position.
p_bSecond vertex position.
p_cThird vertex position.
p_colorVertex color.
Returns
Reference to this builder.
Here is the call graph for this function:

The documentation for this class was generated from the following file: