NDEVR
API Documentation
ShapeConstructors

Logic for writing various basic shapes to a Geometry object. More...

Static Public Member Functions

static void Circle (Geometry &mesh, const Matrix< fltp08 > &trans=Matrix< fltp08 >(1), uint04 width_segments=128, fltp08 radius=1.0f, Angle< fltp08 > phi_start=Angle< fltp08 >(DEGREES, 0.0f), Angle< fltp08 > phi_length=Angle< fltp08 >(DEGREES, 360.0f), bool join=true)
 Appends a circle (filled disc or arc) to the mesh.
static void Cone (Geometry &mesh, const Matrix< fltp08 > &trans=Matrix< fltp08 >(1), uint04 width_segments=44, fltp08 bottom_radius=1.0, fltp08 height=1.0, Angle< fltp08 > phi_start=Angle< fltp08 >(DEGREES, 0.0f), Angle< fltp08 > phi_length=Angle< fltp08 >(DEGREES, 360.0f), bool draw_bottom_circle=true)
 Appends a cone to the mesh.
static void Cylinder (Geometry &mesh, const Matrix< fltp08 > &trans=Matrix< fltp08 >(1), uint04 width_segments=44, fltp08 top_radius=1.0f, fltp08 bottom_radius=1.0, fltp08 height=1.0, Angle< fltp08 > phi_start=Angle< fltp08 >(DEGREES, 0.0f), Angle< fltp08 > phi_length=Angle< fltp08 >(DEGREES, 360.0f), bool draw_top_circle=true, bool draw_bottom_circle=true)
 Appends a cylinder to the mesh with configurable radii and caps.
static void Quad (Geometry &mesh, const Matrix< fltp08 > &trans, Vertex< 3, fltp08 > p1, Vertex< 3, fltp08 > p2, Vertex< 3, fltp08 > p3, Vertex< 3, fltp08 > p4)
 Appends a quad (two-triangle face) defined by four vertices to the mesh.
static void Rectangle (Geometry &mesh, const Matrix< fltp08 > &trans=Matrix< fltp08 >(1), fltp08 top_length=2.0, fltp08 bottom_length=2.0, fltp08 left_length=2.0, fltp08 right_length=2.0, fltp08 vertical_skew=0.0, fltp08 horizontal_skew=0.0)
 Appends a rectangle to the mesh with configurable edge lengths and skew.
static void RectangularPrism (Geometry &mesh, const Matrix< fltp08 > &trans=Matrix< fltp08 >(1))
 Appends a rectangular prism (box) to the mesh.
static void Sphere (Geometry &mesh, uint04 width_segments=44, uint04 height_segments=32, Angle< fltp08 > phi_start=Angle< fltp08 >(DEGREES, 0.0f), Angle< fltp08 > phi_length=Angle< fltp08 >(DEGREES, 360.0f), Angle< fltp08 > theta_start=Angle< fltp08 >(DEGREES, 0.0f), Angle< fltp08 > theta_length=Angle< fltp08 >(DEGREES, 180.0f))
 Appends a sphere to the mesh using longitude/latitude segmentation.
static Geometry StaticCircleOutline (Scene &parent)
 Creates a reusable static circle outline Geometry within the given Scene.
static Geometry StaticLine (Scene &parent)
 Creates a reusable static line Geometry within the given Scene.
static Geometry StaticRectangleFilled (Scene &parent)
 Creates a reusable static filled rectangle Geometry within the given Scene.
static Geometry StaticRectangularPrismFilled (Scene &parent)
 Creates a reusable static filled rectangular prism Geometry within the given Scene.
static Geometry StaticRectangularPrismOutline (Scene &parent)
 Creates a reusable static rectangular prism outline Geometry within the given Scene.
static void ZippedRadialMesh (Geometry &mesh, const ZippedRadialMeshOptions &options)
 Appends a radial mesh to the Geometry using the "zipped" construction pattern, where adjacent latitude rings share edges for efficient indexing.
static void ZippedTorus (Geometry &mesh, uint04 width_segments=44, uint04 height_segments=32)
 Appends a torus to the mesh using the zipped radial mesh construction pattern.

Static Protected Member Functions

static void SetupStaticGeometry (Geometry &geo)
 Configures a Geometry object with default settings for static (reusable) shapes.

Detailed Description

Logic for writing various basic shapes to a Geometry object.


Shapes will be appended to the end of the geometry.

See also
Geometry, Model

Definition at line 98 of file ShapeConstructors.h.

Member Function Documentation

◆ Circle()

void ShapeConstructors::Circle ( Geometry & mesh,
const Matrix< fltp08 > & trans = Matrixfltp08 >(1),
uint04 width_segments = 128,
fltp08 radius = 1.0f,
Angle< fltp08 > phi_start = Anglefltp08 >(DEGREES, 0.0f),
Angle< fltp08 > phi_length = Anglefltp08 >(DEGREES, 360.0f),
bool join = true )
static

Appends a circle (filled disc or arc) to the mesh.

Parameters
[in]meshThe Geometry to append the circle to.
[in]transThe transformation matrix applied to the circle.
[in]width_segmentsThe number of segments around the circumference.
[in]radiusThe radius of the circle.
[in]phi_startThe starting angle of the arc.
[in]phi_lengthThe angular length of the arc.
[in]joinWhether to connect the last segment back to the first.

References DEGREES.

◆ Cone()

void ShapeConstructors::Cone ( Geometry & mesh,
const Matrix< fltp08 > & trans = Matrixfltp08 >(1),
uint04 width_segments = 44,
fltp08 bottom_radius = 1.0,
fltp08 height = 1.0,
Angle< fltp08 > phi_start = Anglefltp08 >(DEGREES, 0.0f),
Angle< fltp08 > phi_length = Anglefltp08 >(DEGREES, 360.0f),
bool draw_bottom_circle = true )
static

Appends a cone to the mesh.

Equivalent to a cylinder with a zero top radius.

Parameters
[in]meshThe Geometry to append the cone to.
[in]transThe transformation matrix applied to the cone.
[in]width_segmentsThe number of segments around the circumference.
[in]bottom_radiusThe radius of the base.
[in]heightThe height of the cone along its axis.
[in]phi_startThe starting angle of the arc sweep.
[in]phi_lengthThe angular length of the arc sweep.
[in]draw_bottom_circleWhether to draw the base disc.

References DEGREES.

◆ Cylinder()

void ShapeConstructors::Cylinder ( Geometry & mesh,
const Matrix< fltp08 > & trans = Matrixfltp08 >(1),
uint04 width_segments = 44,
fltp08 top_radius = 1.0f,
fltp08 bottom_radius = 1.0,
fltp08 height = 1.0,
Angle< fltp08 > phi_start = Anglefltp08 >(DEGREES, 0.0f),
Angle< fltp08 > phi_length = Anglefltp08 >(DEGREES, 360.0f),
bool draw_top_circle = true,
bool draw_bottom_circle = true )
static

Appends a cylinder to the mesh with configurable radii and caps.

Parameters
[in]meshThe Geometry to append the cylinder to.
[in]transThe transformation matrix applied to the cylinder.
[in]width_segmentsThe number of segments around the circumference.
[in]top_radiusThe radius of the top cap.
[in]bottom_radiusThe radius of the bottom cap.
[in]heightThe height of the cylinder along its axis.
[in]phi_startThe starting angle of the arc sweep.
[in]phi_lengthThe angular length of the arc sweep.
[in]draw_top_circleWhether to draw the top cap disc.
[in]draw_bottom_circleWhether to draw the bottom cap disc.

References DEGREES.

◆ Quad()

void ShapeConstructors::Quad ( Geometry & mesh,
const Matrix< fltp08 > & trans,
Vertex< 3, fltp08 > p1,
Vertex< 3, fltp08 > p2,
Vertex< 3, fltp08 > p3,
Vertex< 3, fltp08 > p4 )
static

Appends a quad (two-triangle face) defined by four vertices to the mesh.

Parameters
[in]meshThe Geometry to append the quad to.
[in]transThe transformation matrix applied to the quad vertices.
[in]p1The first vertex of the quad.
[in]p2The second vertex of the quad.
[in]p3The third vertex of the quad.
[in]p4The fourth vertex of the quad.

◆ Rectangle()

void ShapeConstructors::Rectangle ( Geometry & mesh,
const Matrix< fltp08 > & trans = Matrixfltp08 >(1),
fltp08 top_length = 2.0,
fltp08 bottom_length = 2.0,
fltp08 left_length = 2.0,
fltp08 right_length = 2.0,
fltp08 vertical_skew = 0.0,
fltp08 horizontal_skew = 0.0 )
static

Appends a rectangle to the mesh with configurable edge lengths and skew.

Parameters
[in]meshThe Geometry to append the rectangle to.
[in]transThe transformation matrix applied to the rectangle.
[in]top_lengthThe length of the top edge.
[in]bottom_lengthThe length of the bottom edge.
[in]left_lengthThe length of the left edge.
[in]right_lengthThe length of the right edge.
[in]vertical_skewThe vertical skew offset applied to the rectangle.
[in]horizontal_skewThe horizontal skew offset applied to the rectangle.
Note
The parameter names "vertical_skew" and "horizontal_skew" appear to be misspellings of "skew" but are preserved to match existing code.

Referenced by ScenePaintEngine::resetExtraDepth().

◆ RectangularPrism()

void ShapeConstructors::RectangularPrism ( Geometry & mesh,
const Matrix< fltp08 > & trans = Matrixfltp08 >(1) )
static

Appends a rectangular prism (box) to the mesh.

Parameters
[in]meshThe Geometry to append the rectangular prism to.
[in]transThe transformation matrix applied to the prism.

◆ SetupStaticGeometry()

void ShapeConstructors::SetupStaticGeometry ( Geometry & geo)
staticprotected

Configures a Geometry object with default settings for static (reusable) shapes.

Parameters
[in]geoThe Geometry to configure.

◆ Sphere()

void ShapeConstructors::Sphere ( Geometry & mesh,
uint04 width_segments = 44,
uint04 height_segments = 32,
Angle< fltp08 > phi_start = Anglefltp08 >(DEGREES, 0.0f),
Angle< fltp08 > phi_length = Anglefltp08 >(DEGREES, 360.0f),
Angle< fltp08 > theta_start = Anglefltp08 >(DEGREES, 0.0f),
Angle< fltp08 > theta_length = Anglefltp08 >(DEGREES, 180.0f) )
static

Appends a sphere to the mesh using longitude/latitude segmentation.

Parameters
[in]meshThe Geometry to append the sphere to.
[in]width_segmentsThe number of longitudinal (phi) segments.
[in]height_segmentsThe number of latitudinal (theta) segments.
[in]phi_startThe starting longitude angle.
[in]phi_lengthThe angular sweep of longitude.
[in]theta_startThe starting latitude angle.
[in]theta_lengthThe angular sweep of latitude.

References DEGREES.

◆ StaticCircleOutline()

Geometry ShapeConstructors::StaticCircleOutline ( Scene & parent)
static

Creates a reusable static circle outline Geometry within the given Scene.

Parameters
[in]parentThe Scene that will own the Geometry.
Returns
A Geometry object configured as a static circle outline.

◆ StaticLine()

Geometry ShapeConstructors::StaticLine ( Scene & parent)
static

Creates a reusable static line Geometry within the given Scene.

Parameters
[in]parentThe Scene that will own the Geometry.
Returns
A Geometry object configured as a static line.

◆ StaticRectangleFilled()

Geometry ShapeConstructors::StaticRectangleFilled ( Scene & parent)
static

Creates a reusable static filled rectangle Geometry within the given Scene.

Parameters
[in]parentThe Scene that will own the Geometry.
Returns
A Geometry object configured as a static filled rectangle.

◆ StaticRectangularPrismFilled()

Geometry ShapeConstructors::StaticRectangularPrismFilled ( Scene & parent)
static

Creates a reusable static filled rectangular prism Geometry within the given Scene.

Parameters
[in]parentThe Scene that will own the Geometry.
Returns
A Geometry object configured as a static filled rectangular prism.

◆ StaticRectangularPrismOutline()

Geometry ShapeConstructors::StaticRectangularPrismOutline ( Scene & parent)
static

Creates a reusable static rectangular prism outline Geometry within the given Scene.

Parameters
[in]parentThe Scene that will own the Geometry.
Returns
A Geometry object configured as a static rectangular prism outline.

◆ ZippedRadialMesh()

void ShapeConstructors::ZippedRadialMesh ( Geometry & mesh,
const ZippedRadialMeshOptions & options )
static

Appends a radial mesh to the Geometry using the "zipped" construction pattern, where adjacent latitude rings share edges for efficient indexing.

Parameters
[in]meshThe Geometry to append the radial mesh to.
[in]optionsThe configuration options controlling the mesh layout.

◆ ZippedTorus()

void ShapeConstructors::ZippedTorus ( Geometry & mesh,
uint04 width_segments = 44,
uint04 height_segments = 32 )
static

Appends a torus to the mesh using the zipped radial mesh construction pattern.

Parameters
[in]meshThe Geometry to append the torus to.
[in]width_segmentsThe number of segments around the tube cross-section.
[in]height_segmentsThe number of segments around the torus ring.

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