Guillaume 1.0.0
Guillaume.
Loading...
Searching...
No Matches
Triangle Class Reference

Represents a triangle primitive for 3D rendering. More...

#include <triangle.hpp>

Inheritance diagram for Triangle:
Collaboration diagram for Triangle:

Public Member Functions

 Triangle (void)
 Default constructor - initializes an empty triangle.
 
 Triangle (const Point &p1, const Point &p2, const Point &p3)
 Constructor from three 3D points.
 
 ~Triangle (void) override=default
 Destructor.
 
- Public Member Functions inherited from Polygon
 Polygon (void)
 Default constructor - initializes an empty polygon.
 
 Polygon (const std::vector< Vertex > &vertices, const Vector< float, 3 > &rotation=Vector< float, 3 >())
 Constructor from a list of vertices.
 
 ~Polygon (void) override=default
 Destroy the Polygon object.
 
PolygonaddVertex (const Vertex &vertex)
 Adds a vertex to the polygon.
 
const std::vector< Vertex > & getVertices (void) const
 Gets the vertices defining the polygon.
 
const Vector< float, 3 > & getRotation (void) const
 Gets the rotation of the polygon in Euler angles (radians)
 
const Vector< float, 3 > & getTranslation (void) const
 Gets the translation of the polygon in 3D space.
 
PolygonsetRotation (const Vector< float, 3 > &rotation)
 Sets the rotation of the polygon in Euler angles (radians)
 
PolygonsetTranslation (const Vector< float, 3 > &translation)
 Sets the translation of the polygon in 3D space.
 
- Public Member Functions inherited from Primitive
 Primitive (void)
 Constructs a Primitive object.
 
virtual ~Primitive (void)=default
 Destroy the Primitive object.
 

Detailed Description

Represents a triangle primitive for 3D rendering.

The Triangle class is a derived class of Polygon that represents a triangle shape defined by three 3D points (vertices). It inherits all 3D capabilities from Polygon including normal calculation and centroid computation.

Constructor & Destructor Documentation

◆ Triangle()

Triangle::Triangle ( const Point p1,
const Point p2,
const Point p3 
)
inline

Constructor from three 3D points.

Initializes the triangle with the specified 3D vertices.

Parameters
p1The first vertex of the triangle in 3D space
p2The second vertex of the triangle in 3D space
p3The third vertex of the triangle in 3D space

◆ ~Triangle()

Triangle::~Triangle ( void  )
overridedefault

Destructor.

Cleans up the triangle resources.


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