Web Analytics Made Easy - Statcounter
Skip to content

Class SBGRenderSTLObject#

ClassList > SBGRenderSTLObject

The class can be used to load and display 3D objects from STL files.

  • #include <SBGRenderSTLObject.hpp>

Public Functions#

Type Name
SBGRenderSTLObject (const std::string & fileName, bool smoothed)
Builds an STL object renderer from the STL file fileName .
virtual void display (const SBSpatialTransform & transform, float * color)
Displays the STL object.
virtual void display (const SBSpatialTransform & transform, unsigned int nodeIndex)
Displays the STL object.
virtual ~SBGRenderSTLObject ()
Destructor.

Protected Attributes#

Type Name
SBGRenderSTLObjectData * dataPointer
A pointer to the private data.

Public Functions Documentation#

function SBGRenderSTLObject#

Builds an STL object renderer from the STL file fileName .

SBGRenderSTLObject::SBGRenderSTLObject (
    const std::string & fileName,
    bool smoothed
) 

Constructs an SBGRenderSTLObject and loads an STL file.

This constructor initializes the object and loads the geometry from the specified STL file. The fileName parameter specifies the path to the STL file. The smoothed flag indicates whether the loaded geometry should be smoothed during loading.

Parameters:

  • fileName Path to the STL file to load.
  • smoothed If true, the geometry is smoothed during loading; otherwise it is loaded as‑as.

function display [1/2]#

Displays the STL object.

virtual void SBGRenderSTLObject::display (
    const SBSpatialTransform & transform,
    float * color
) 

Displays the STL object using the given spatial transform and color.

This function renders the object at the position and orientation defined by transform, applying the specified color to the geometry.

Parameters:

  • transform Spatial transform that defines the object's position, rotation, and scaling.
  • color Pointer to an array of three floats representing the RGB color components.

function display [2/2]#

Displays the STL object.

virtual void SBGRenderSTLObject::display (
    const SBSpatialTransform & transform,
    unsigned int nodeIndex
) 

Displays the STL object for a specific node selection.

This overload renders the object using the given spatial transform, highlighting or otherwise indicating the node identified by nodeIndex.

Parameters:

  • transform Spatial transform that defines the object's position, rotation, and scaling.
  • nodeIndex Index of the node to be highlighted or selected during rendering.

function ~SBGRenderSTLObject#

Destructor.

virtual SBGRenderSTLObject::~SBGRenderSTLObject () 

Destroys the SBGRenderSTLObject and releases associated resources.


Protected Attributes Documentation#

variable dataPointer#

A pointer to the private data.

SBGRenderSTLObjectData* SBGRenderSTLObject::dataPointer;