Vp::Shaper
A utility class for constructing simple shapes. More...
#include "Viewport/Shaper.h"
Public Functions
Name | |
---|---|
void | initDefaultShapes() |
void | clear()<br>Clear prepared geometry (vertices and colors). |
Core::Mesh * | createLineMesh(const std::string & alias ="")<br>Create a line mesh from current shaper state and register it with ResourceManager. |
Core::Mesh * | createMesh(const std::string & alias ="")<br>Create a triangle mesh from current shaper state and register it with ResourceManager. |
const std::vector< float > & | getColors() const |
const std::vector< float > & | getVertices() const |
void | line(const glm::vec3 a, const glm::vec3 b)<br>Prepare geometry for line from a to b using the single global color currentColor. |
void | line(const glm::vec3 a, const glm::vec3 b, const glm::vec3 color)<br>Prepare geometry for line from a to b using the single color color for the whole line (both line ends) |
void | line(const glm::vec3 a, const glm::vec3 b, const glm::vec3 color_a, const glm::vec3 color_b)<br>Prepare geometry for line from a to b using the single color color for the whole line (both line ends) |
void | lineBox(glm::vec3 from, glm::vec3 to) |
void | quad(const glm::vec3 a, const glm::vec3 b, const glm::vec3 c, const glm::vec3 d)<br>Creates a quad with two triangles. |
void | quad(const glm::vec3 a, const glm::vec3 b, const glm::vec3 c, const glm::vec3 d, const glm::vec3 color)<br>Creates a quad with two triangles. |
void | reserveBuffers(const int newCapacity) |
void | setColor(const glm::vec3 color)<br>Set the current drawing color. |
Public Attributes
Name | |
---|---|
std::string | plane |
std::string | screenQuad <br>Screen quad for post processing. |
std::string | unitCube |
std::string | unitLineCube |
std::string | xyzAxes <br>Simple three color line axes. |
Detailed Description
class Vp::Shaper;
class Vp::Shaper;
A utility class for constructing simple shapes.
Used in Viewport for drawing of world axes, axes of models and wireframe objects (such as projection frustum)
Public Functions Documentation
function initDefaultShapes
static void initDefaultShapes()
static void initDefaultShapes()
function clear
void clear()
void clear()
Clear prepared geometry (vertices and colors).
function createLineMesh
Core::Mesh * createLineMesh(
const std::string & alias =""
)
Core::Mesh * createLineMesh(
const std::string & alias =""
)
Create a line mesh from current shaper state and register it with ResourceManager.
Parameters:
- alias Unique shape identifier
Return:
function createMesh
Core::Mesh * createMesh(
const std::string & alias =""
)
Core::Mesh * createMesh(
const std::string & alias =""
)
Create a triangle mesh from current shaper state and register it with ResourceManager.
Parameters:
- alias Unique shape identifier
Return:
function getColors
const std::vector< float > & getColors() const
const std::vector< float > & getColors() const
function getVertices
const std::vector< float > & getVertices() const
const std::vector< float > & getVertices() const
function line
void line(
const glm::vec3 a,
const glm::vec3 b
)
void line(
const glm::vec3 a,
const glm::vec3 b
)
Prepare geometry for line from a to b using the single global color currentColor.
Parameters:
- a point from
- b point to
function line
void line(
const glm::vec3 a,
const glm::vec3 b,
const glm::vec3 color
)
void line(
const glm::vec3 a,
const glm::vec3 b,
const glm::vec3 color
)
Prepare geometry for line from a to b using the single color color for the whole line (both line ends)
Parameters:
- a Start point
- b End point
- color Line color
function line
void line(
const glm::vec3 a,
const glm::vec3 b,
const glm::vec3 color_a,
const glm::vec3 color_b
)
void line(
const glm::vec3 a,
const glm::vec3 b,
const glm::vec3 color_a,
const glm::vec3 color_b
)
Prepare geometry for line from a to b using the single color color for the whole line (both line ends)
Parameters:
- a Start point
- b End point
- color_a Start-point color
- color_b End-point color
function lineBox
void lineBox(
glm::vec3 from,
glm::vec3 to
)
void lineBox(
glm::vec3 from,
glm::vec3 to
)
function quad
void quad(
const glm::vec3 a,
const glm::vec3 b,
const glm::vec3 c,
const glm::vec3 d
)
void quad(
const glm::vec3 a,
const glm::vec3 b,
const glm::vec3 c,
const glm::vec3 d
)
Creates a quad with two triangles.
Parameters:
- a Top left corner
- b Top right corner
- c Bottom left corner
- d Bottom right corner
Triangles are CCW acd and adb. a — b | \ | c — d
function quad
void quad(
const glm::vec3 a,
const glm::vec3 b,
const glm::vec3 c,
const glm::vec3 d,
const glm::vec3 color
)
void quad(
const glm::vec3 a,
const glm::vec3 b,
const glm::vec3 c,
const glm::vec3 d,
const glm::vec3 color
)
Creates a quad with two triangles.
Parameters:
- a Top left corner
- b Top right corner
- c Bottom left corner
- d Bottom right corner
- color Color of the vertices
Triangles are CCW acd and adb. a — b | \ | c — d
function reserveBuffers
void reserveBuffers(
const int newCapacity
)
void reserveBuffers(
const int newCapacity
)
function setColor
void setColor(
const glm::vec3 color
)
void setColor(
const glm::vec3 color
)
Set the current drawing color.
Parameters:
- color New drawing color "currentColor"
Public Attributes Documentation
variable plane
static std::string plane;
static std::string plane;
variable screenQuad
static std::string screenQuad;
static std::string screenQuad;
Screen quad for post processing.
variable unitCube
static std::string unitCube;
static std::string unitCube;
variable unitLineCube
static std::string unitLineCube;
static std::string unitLineCube;
variable xyzAxes
static std::string xyzAxes;
static std::string xyzAxes;
Simple three color line axes.
Updated on 2024-11-06 at 20:16:53 +0000