1.3.64
 
Loading...
Searching...
No Matches
Visualizer Class Reference

Class for visualization of simulation results. More...

#include <Visualizer.h>

Public Types

enum  CoordinateSystem { COORDINATES_WINDOW_NORMALIZED = 0 , COORDINATES_CARTESIAN = 1 }
 Coordinate system to be used when specifying spatial coordinates. More...
 
enum  Ctable {
  COLORMAP_HOT = 0 , COLORMAP_COOL = 1 , COLORMAP_RAINBOW = 2 , COLORMAP_LAVA = 3 ,
  COLORMAP_PARULA = 4 , COLORMAP_GRAY = 5 , COLORMAP_CUSTOM = 6 , COLORMAP_LINES = 7
}
 Pseudocolor map tables. More...
 
enum  LightingModel { LIGHTING_NONE = 0 , LIGHTING_PHONG = 1 , LIGHTING_PHONG_SHADOWED = 2 }
 Lighting model to use for shading primitives. More...
 

Public Member Functions

 Visualizer ()=delete
 forbid the default constructor
 
 Visualizer (uint Wdisplay)
 Visualizer constructor.
 
 Visualizer (uint Wdisplay, uint Hdisplay)
 Visualizer constructor.
 
 Visualizer (uint Wdisplay, uint Hdisplay, int aliasing_samples)
 Constructs a Visualizer object with the specified display dimensions and anti-aliasing settings.
 
 Visualizer (uint Wdisplay, uint Hdisplay, int aliasing_samples, bool window_decorations, bool headless)
 
 ~Visualizer ()
 Visualizer destructor.
 
void enableMessages ()
 Enable standard output from this plug-in (default)
 
void disableMessages ()
 Disable standard output from this plug-in.
 
void setCameraPosition (const helios::vec3 &cameraPosition, const helios::vec3 &lookAt)
 Set camera position.
 
void setCameraPosition (const helios::SphericalCoord &cameraAngle, const helios::vec3 &lookAt)
 Set camera position.
 
void setCameraFieldOfView (float angle_FOV)
 Set the camera field of view (angle width) in degrees. Default value is 45 degrees.
 
void setLightDirection (const helios::vec3 &direction)
 Set the direction of the light source.
 
void setLightingModel (LightingModel lightingmodel)
 Set the lighting model for shading of all primitives.
 
void setLightIntensityFactor (float lightintensityfactor)
 Set the light intensity scaling factor.
 
void setupOffscreenFramebuffer ()
 Setup offscreen framebuffer for headless rendering.
 
void cleanupOffscreenFramebuffer ()
 Clean up offscreen framebuffer resources.
 
void renderToOffscreenBuffer ()
 Switch rendering target to offscreen buffer.
 
void setBackgroundColor (const helios::RGBcolor &color)
 Set the background color for the visualizer window.
 
void setBackgroundTransparent ()
 Set the background to be transparent.
 
void setBackgroundImage (const char *texture_file)
 Set a custom background image.
 
void setBackgroundSkyTexture (const char *texture_file=nullptr, uint Ndivisions=50)
 Set a sky sphere texture as background.
 
size_t addRectangleByCenter (const helios::vec3 &center, const helios::vec2 &size, const helios::SphericalCoord &rotation, const helios::RGBcolor &color, CoordinateSystem coordFlag)
 Add a rectangle by giving the coordinates of its center.
 
size_t addRectangleByCenter (const helios::vec3 &center, const helios::vec2 &size, const helios::SphericalCoord &rotation, const helios::RGBAcolor &color, CoordinateSystem coordFlag)
 Add a rectangle by giving the coordinates of its center.
 
size_t addRectangleByCenter (const helios::vec3 &center, const helios::vec2 &size, const helios::SphericalCoord &rotation, const char *texture_file, CoordinateSystem coordFlag)
 Add a texture mapped rectangle by giving the coordinates of its center.
 
size_t addRectangleByCenter (const helios::vec3 &center, const helios::vec2 &size, const helios::SphericalCoord &rotation, const helios::RGBcolor &color, const char *texture_file, CoordinateSystem coordFlag)
 Add a rectangle by giving the coordinates of its center - rectangle is colored by and RGB color value but is masked by the alpha channel of a PNG image file.
 
size_t addRectangleByCenter (const helios::vec3 &center, const helios::vec2 &size, const helios::SphericalCoord &rotation, const helios::RGBcolor &color, const Glyph *glyph, CoordinateSystem coordFlag)
 Add a texture masked rectangle by giving the coordinates of its center.
 
size_t addRectangleByVertices (const std::vector< helios::vec3 > &vertices, const helios::RGBcolor &color, CoordinateSystem coordFlag)
 Add a rectangle by giving the coordinates of its four vertices.
 
size_t addRectangleByVertices (const std::vector< helios::vec3 > &vertices, const helios::RGBAcolor &color, CoordinateSystem coordFlag)
 Add a rectangle by giving the coordinates of its four vertices.
 
size_t addRectangleByVertices (const std::vector< helios::vec3 > &vertices, const char *texture_file, CoordinateSystem coordFlag)
 Add a rectangle by giving the coordinates of its four vertices.
 
size_t addRectangleByVertices (const std::vector< helios::vec3 > &vertices, const char *texture_file, const std::vector< helios::vec2 > &uvs, CoordinateSystem coordFlag)
 Add a rectangle by giving the coordinates of its four vertices and color by texture map.
 
size_t addRectangleByVertices (const std::vector< helios::vec3 > &vertices, const helios::RGBcolor &color, const char *texture_file, const std::vector< helios::vec2 > &uvs, CoordinateSystem coordFlag)
 Add a rectangle by giving the coordinates of its four vertices and mask by texture map transparency channel, but color by R-G-B value.
 
size_t addRectangleByVertices (const std::vector< helios::vec3 > &vertices, const helios::RGBcolor &color, const char *texture_file, CoordinateSystem coordFlag)
 Add a rectangle by giving the coordinates of its four vertices - rectangle is colored by an RGB color value but is masked by the alpha channel of a PNG image file.
 
size_t addRectangleByVertices (const std::vector< helios::vec3 > &vertices, const helios::RGBcolor &color, const Glyph *glyph, CoordinateSystem coordFlag)
 Add a rectangle by giving the coordinates of its four vertices.
 
size_t addRectangleByVertices (const std::vector< helios::vec3 > &vertices, const helios::RGBAcolor &color, const Glyph *glyph, CoordinateSystem coordFlag)
 Add a rectangle by giving the coordinates of its four vertices.
 
size_t addTriangle (const helios::vec3 &vertex0, const helios::vec3 &vertex1, const helios::vec3 &vertex2, const helios::RGBcolor &color, CoordinateSystem coordFlag)
 Add a triangle by giving the coordinates of its three vertices.
 
size_t addTriangle (const helios::vec3 &vertex0, const helios::vec3 &vertex1, const helios::vec3 &vertex2, const helios::RGBAcolor &color, CoordinateSystem coordFlag)
 Add a triangle by giving the coordinates of its three vertices.
 
size_t addTriangle (const helios::vec3 &vertex0, const helios::vec3 &vertex1, const helios::vec3 &vertex2, const char *texture_file, const helios::vec2 &uv0, const helios::vec2 &uv1, const helios::vec2 &uv2, CoordinateSystem coordFlag)
 Add a triangle by giving the coordinates of its three vertices and color by texture map.
 
size_t addTriangle (const helios::vec3 &vertex0, const helios::vec3 &vertex1, const helios::vec3 &vertex2, const char *texture_file, const helios::vec2 &uv0, const helios::vec2 &uv1, const helios::vec2 &uv2, const helios::RGBAcolor &color, CoordinateSystem coordFlag)
 Add a triangle by giving the coordinates of its three vertices and color by a constant color, but mask using transparency channel of texture map.
 
std::vector< size_t > addVoxelByCenter (const helios::vec3 &center, const helios::vec3 &size, const helios::SphericalCoord &rotation, const helios::RGBcolor &color, CoordinateSystem coordFlag)
 Add a voxel by giving the coordinates of its center.
 
std::vector< size_t > addVoxelByCenter (const helios::vec3 &center, const helios::vec3 &size, const helios::SphericalCoord &rotation, const helios::RGBAcolor &color, CoordinateSystem coordFlag)
 Add a voxel by giving the coordinates of its center.
 
size_t addLine (const helios::vec3 &start, const helios::vec3 &end, const helios::RGBcolor &color, CoordinateSystem coordinate_system)
 Add Lines by giving the coordinates of points along the Lines.
 
size_t addLine (const helios::vec3 &start, const helios::vec3 &end, const helios::RGBAcolor &color, CoordinateSystem coordFlag)
 Add Lines by giving the coordinates of points along the Lines.
 
size_t addLine (const helios::vec3 &start, const helios::vec3 &end, const helios::RGBcolor &color, float line_width, CoordinateSystem coordinate_system)
 Add Lines by giving the coordinates of points along the Lines with custom line width.
 
size_t addLine (const helios::vec3 &start, const helios::vec3 &end, const helios::RGBAcolor &color, float line_width, CoordinateSystem coordFlag)
 Add Lines by giving the coordinates of points along the Lines with custom line width.
 
size_t addPoint (const helios::vec3 &position, const helios::RGBcolor &color, float pointsize, CoordinateSystem coordinate_system)
 Add a point by giving its coordinates and size.
 
size_t addPoint (const helios::vec3 &position, const helios::RGBAcolor &color, float pointsize, CoordinateSystem coordinate_system)
 Add a point by giving its coordinates and size.
 
std::vector< size_t > addSphereByCenter (float radius, const helios::vec3 &center, uint Ndivisions, const helios::RGBcolor &color, CoordinateSystem coordinate_system)
 Add a sphere by giving the radius and center.
 
std::vector< size_t > addSphereByCenter (float radius, const helios::vec3 &center, uint Ndivisions, const helios::RGBAcolor &color, CoordinateSystem coordinate_system)
 Add a sphere by giving the radius and center.
 
std::vector< size_t > addSkyDomeByCenter (float radius, const helios::vec3 &center, uint Ndivisions, const char *texture_file)
 Add a Sky Dome, which is a hemispherical dome colored by a sky texture map.
 
void addSkyDomeByCenter (float radius, const helios::vec3 &center, uint Ndivisions, const char *texture_file, int layer)
 Add a Sky Dome, which is a hemispherical dome colored by a sky texture map.
 
std::vector< size_t > addTextboxByCenter (const char *textstring, const helios::vec3 &center, const helios::SphericalCoord &rotation, const helios::RGBcolor &fontcolor, uint fontsize, const char *fontname, CoordinateSystem coordinate_system)
 Add a text box by giving the coordinates of its center.
 
void deleteGeometry (size_t geometry_id)
 Removes the geometry with the specified ID from the visualizer.
 
std::vector< helios::vec3getGeometryVertices (size_t geometry_id) const
 Get the vertices of a geometry primitive.
 
void setGeometryVertices (size_t geometry_id, const std::vector< helios::vec3 > &vertices)
 Set the vertices of a geometry primitive.
 
void addCoordinateAxes ()
 Add a coordinate axis with at the origin with unit length.
 
void addCoordinateAxes (const helios::vec3 &origin, const helios::vec3 &length, const std::string &sign)
 Add a coordinate axis.
 
void disableCoordinateAxes ()
 Remove coordinate axes (if created with Visualizer::addCoordinateAxes)
 
void addGridWireFrame (const helios::vec3 &center, const helios::vec3 &size, const helios::int3 &subdiv)
 Add a coordinate axis.
 
void enableColorbar ()
 Enable the colorbar.
 
void disableColorbar ()
 Disable the colorbar.
 
void setColorbarPosition (helios::vec3 position)
 Set the position of the colorbar in normalized window coordinates (0-1)
 
void setColorbarSize (helios::vec2 size)
 Set the size of the colorbar in normalized window units (0-1)
 
void setColorbarRange (float cmin, float cmax)
 Set the range of the Colorbar.
 
void setColorbarTicks (const std::vector< float > &ticks)
 Set the values in the colorbar where ticks and labels should be placed.
 
void setColorbarTitle (const char *title)
 Set the title of the Colorbar.
 
void setColorbarFontColor (helios::RGBcolor color)
 Set the RGB color of the colorbar text.
 
void setColorbarFontSize (uint font_size)
 Set the font size of the colorbar text.
 
void setColormap (Ctable colormap_name)
 Set the colormap used in Colorbar/visualization based on pre-defined colormaps.
 
void setColormap (const std::vector< helios::RGBcolor > &colors, const std::vector< float > &divisions)
 Set the colormap used in Colorbar/visualization based on a custom colormap.
 
Colormap getCurrentColormap () const
 Get the current colormap used in Colorbar/visualization.
 
void buildContextGeometry (helios::Context *context_ptr)
 Add all geometry from the Context to the visualizer.
 
void buildContextGeometry (helios::Context *context_ptr, const std::vector< uint > &UUIDs)
 Add select geometry from the Context to the visualizer by their UUIDs.
 
void updateContextPrimitiveColors ()
 Updates the colors of context primitives based on current visualization settings.
 
void colorContextPrimitivesByData (const char *data_name)
 Color primitives from Context by color mapping their ‘Primitive Data’.
 
void colorContextPrimitivesByData (const char *data_name, const std::vector< uint > &UUIDs)
 Color primitives from Context by color mapping their ‘Primitive Data’.
 
void colorContextPrimitivesByObjectData (const char *data_name)
 Color primitives from Context by color mapping their ‘Object Data’.
 
void colorContextPrimitivesByObjectData (const char *data_name, const std::vector< uint > &ObjIDs)
 Color primitives from Context by color mapping their ‘Object Data’.
 
void colorContextPrimitivesRandomly (const std::vector< uint > &UUIDs)
 Color primitives from Context with a random color.
 
void colorContextPrimitivesRandomly ()
 Color primitives from Context with a random color.
 
void colorContextObjectsRandomly (const std::vector< uint > &ObjIDs)
 Color objects from Context with a random color.
 
void colorContextObjectsRandomly ()
 Color objects from Context with a random color.
 
void hideWatermark ()
 Make Helios logo watermark invisible.
 
void showWatermark ()
 Make Helios logo watermark visible.
 
void updateWatermark ()
 Update watermark geometry to match current window size.
 
void hideNavigationGizmo ()
 Make navigation gizmo (coordinate axes indicator) invisible.
 
void showNavigationGizmo ()
 Make navigation gizmo (coordinate axes indicator) visible.
 
void handleGizmoClick (double screen_x, double screen_y)
 Handle mouse click for navigation gizmo interaction.
 
void handleGizmoHover (double screen_x, double screen_y)
 Handle mouse hover for navigation gizmo interaction.
 
std::vector< helios::vec3plotInteractive ()
 Plot current geometry into an interactive graphics window.
 
void plotOnce (bool getKeystrokes)
 Run one rendering loop from plotInteractive()
 
void plotDepthMap ()
 Plot the depth map (distance from camera to nearest object)
 
void plotUpdate ()
 Update the graphics window based on current geometry, then continue the program.
 
void plotUpdate (bool hide_window)
 Update the graphics window based on current geometry, then continue the program, with the option not to display the graphic window.
 
void printWindow ()
 Print the current graphics window to a JPEG image file. File will be given a default filename and saved to the current directory from which the executable was run.
 
void printWindow (const char *outfile, const std::string &image_format="jpeg")
 Print the current graphics window to an image file.
 
void displayImage (const std::vector< unsigned char > &pixel_data, uint width_pixels, uint height_pixels)
 Displays an image using the provided pixel data and dimensions.
 
void displayImage (const std::string &file_name)
 Displays an image file in the visualizer.
 
void getWindowPixelsRGB (uint *buffer) const
 Get R-G-B pixel data in the current display window.
 
void getDepthMap (float *buffer)
 Get depth buffer data for the current display window.
 
void getDepthMap (std::vector< float > &depth_pixels, uint &width_pixels, uint &height_pixels)
 
void getWindowSize (uint &width, uint &height) const
 Get the size of the display window in pixels.
 
void getFramebufferSize (uint &width, uint &height) const
 Get the size of the framebuffer in pixels.
 
void clearGeometry ()
 Clear all geometry previously added to the visualizer.
 
void clearContextGeometry ()
 Clear all Context geometry previously added to the visualizer.
 
void closeWindow () const
 Close the graphics window.
 
helios::RGBcolor getBackgroundColor () const
 Retrieves the background color of the visualizer.
 
std::vector< helios::vec3getCameraPosition () const
 Retrieves the current camera position.
 
void clearColor ()
 Clears the primitive colors based on primitive data from a previous call to colorContextPrimitivesByData() or colorContextPrimitivesByObjectData().
 
void * getWindow () const
 Retrieves the window associated with the Visualizer.
 
glm::mat4 getPerspectiveTransformationMatrix () const
 Calculates the perspective transformation matrix for mapping between two quadrilaterals.
 
void setPointCullingEnabled (bool enabled)
 Point cloud culling configuration methods.
 
void setPointCullingThreshold (size_t threshold)
 Set the minimum number of points required to trigger culling.
 
void setPointMaxRenderDistance (float distance)
 Set the maximum rendering distance for points.
 
void setPointLODFactor (float factor)
 Set the level-of-detail factor for distance-based culling.
 
void getPointRenderingMetrics (size_t &total_points, size_t &rendered_points, float &culling_time_ms) const
 Get point cloud rendering performance metrics.
 

Static Public Member Functions

static int selfTest (int argc=0, char **argv=nullptr)
 Visualizer self-test routine.
 
static double niceNumber (double value, bool round)
 Helper function to round a value to a "nice" number (1, 2, or 5 times a power of 10)
 
static std::string formatTickLabel (double value, double spacing, bool isIntegerData)
 Helper function to format a tick label with appropriate precision.
 
static std::vector< float > generateNiceTicks (float dataMin, float dataMax, bool isIntegerData, int targetTicks=5)
 Generate optimal tick values using nice numbers algorithm.
 

Friends

struct Shader
 
struct Texture
 

Detailed Description

Class for visualization of simulation results.

Definition at line 327 of file Visualizer.h.

Member Enumeration Documentation

◆ CoordinateSystem

Coordinate system to be used when specifying spatial coordinates.

Enumerator
COORDINATES_WINDOW_NORMALIZED 

Coordinates are normalized to unity and are window-aligned. The point (x,y)=(0,0) is in the bottom left corner of the window, and (x,y)=(1,1) is in the upper right corner of the window. The z-coordinate specifies the depth in the screen-normal direction, with values ranging from -1 to 1. For example, an object at z=0.5 would be in front of an object at z=0.

COORDINATES_CARTESIAN 

Coordinates are specified in a 3D Cartesian system (right-handed), where +z is vertical.

Definition at line 377 of file Visualizer.h.

◆ Ctable

Pseudocolor map tables.

Enumerator
COLORMAP_HOT 

"Hot" colormap

COLORMAP_COOL 

"Cool" colormap

COLORMAP_RAINBOW 

"Rainbow" colormap

COLORMAP_LAVA 

"Lava" colormap

COLORMAP_PARULA 

"Parula" colormap

COLORMAP_GRAY 

"Gray" colormap

COLORMAP_CUSTOM 

Custom colormap.

COLORMAP_LINES 

"Lines" colormap with distinct colors

Definition at line 387 of file Visualizer.h.

◆ LightingModel

Lighting model to use for shading primitives.

Enumerator
LIGHTING_NONE 

No shading, primitive is colored by its diffuse color.

LIGHTING_PHONG 

Phong lighting model is applied to add shading effects to the diffuse color.

LIGHTING_PHONG_SHADOWED 

Phong lighting model plus shadowing is applied to add shading effects to the diffuse color.

Definition at line 433 of file Visualizer.h.

Constructor & Destructor Documentation

◆ Visualizer() [1/4]

Visualizer::Visualizer ( uint  Wdisplay)
explicit

Visualizer constructor.

Parameters
[in]WdisplayWidth of the display window in pixels, and assumes default window aspect ratio of 1.25

Definition at line 262 of file VisualizerCore.cpp.

◆ Visualizer() [2/4]

Visualizer::Visualizer ( uint  Wdisplay,
uint  Hdisplay 
)

Visualizer constructor.

Parameters
[in]WdisplayWidth of the display window in pixels
[in]HdisplayHeight of the display window in pixels

Definition at line 266 of file VisualizerCore.cpp.

◆ Visualizer() [3/4]

Visualizer::Visualizer ( uint  Wdisplay,
uint  Hdisplay,
int  aliasing_samples 
)

Constructs a Visualizer object with the specified display dimensions and anti-aliasing settings.

Parameters
[in]WdisplayWidth of the display in pixels.
[in]HdisplayHeight of the display in pixels.
[in]aliasing_samplesNumber of anti-aliasing samples to use.

Definition at line 270 of file VisualizerCore.cpp.

◆ Visualizer() [4/4]

Visualizer::Visualizer ( uint  Wdisplay,
uint  Hdisplay,
int  aliasing_samples,
bool  window_decorations,
bool  headless 
)

Visualizer constructor with option to remove window decorations (e.g., header bar, trim). This is a workaround for an error that occurs on Linux systems when printing the window to a JPEG image (printWindow). Once a fix is found, this function will likely be removed

Parameters
[in]WdisplayWidth of the display in pixels.
[in]HdisplayHeight of the display in pixels.
[in]aliasing_samplesNumber of anti-aliasing samples to use.
[in]window_decorationsFlag to remove window decorations.
[in]headlessIf true, initializes the visualizer without opening a window.

Definition at line 274 of file VisualizerCore.cpp.

◆ ~Visualizer()

Visualizer::~Visualizer ( )

Visualizer destructor.

Definition at line 1412 of file VisualizerCore.cpp.

Member Function Documentation

◆ addCoordinateAxes() [1/2]

void Visualizer::addCoordinateAxes ( )

Add a coordinate axis with at the origin with unit length.

Definition at line 1013 of file VisualizerGeometry.cpp.

◆ addCoordinateAxes() [2/2]

void Visualizer::addCoordinateAxes ( const helios::vec3 origin,
const helios::vec3 length,
const std::string &  sign 
)

Add a coordinate axis.

Parameters
[in]origin(x,y,z) location of the coordinate axes orign
[in]lengthlength of coordinate axis lines from origin in each direction
[in]signeither "both" or "positive" should the axes be drawn in both positive and negative directions or just positive

Definition at line 1017 of file VisualizerGeometry.cpp.

◆ addGridWireFrame()

void Visualizer::addGridWireFrame ( const helios::vec3 center,
const helios::vec3 size,
const helios::int3 subdiv 
)

Add a coordinate axis.

Parameters
[in]center(x,y,z) location of the center of the grid
[in]sizesize of the grid in each direction
[in]subdivnumber of grid subdivisions in each direction

Definition at line 1063 of file VisualizerGeometry.cpp.

◆ addLine() [1/4]

size_t Visualizer::addLine ( const helios::vec3 start,
const helios::vec3 end,
const helios::RGBAcolor color,
CoordinateSystem  coordFlag 
)

Add Lines by giving the coordinates of points along the Lines.

Parameters
[in]start(x,y,z) coordinates of line starting position
[in]end(x,y,z) coordinates of line ending position
[in]colorR-G-B-A color of the line
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 416 of file VisualizerGeometry.cpp.

◆ addLine() [2/4]

size_t Visualizer::addLine ( const helios::vec3 start,
const helios::vec3 end,
const helios::RGBAcolor color,
float  line_width,
CoordinateSystem  coordFlag 
)

Add Lines by giving the coordinates of points along the Lines with custom line width.

Parameters
[in]start(x,y,z) coordinates of line starting position
[in]end(x,y,z) coordinates of line ending position
[in]colorR-G-B-A color of the line
[in]line_widthWidth of the line in pixels (rendered using geometry shaders for cross-platform wide line support)
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".
Note
Line widths are rendered using geometry shaders which expand line primitives into screen-aligned quads, providing consistent wide line rendering across all platforms including macOS.

Definition at line 428 of file VisualizerGeometry.cpp.

◆ addLine() [3/4]

size_t Visualizer::addLine ( const helios::vec3 start,
const helios::vec3 end,
const helios::RGBcolor color,
CoordinateSystem  coordinate_system 
)

Add Lines by giving the coordinates of points along the Lines.

Parameters
[in]start(x,y,z) coordinates of line starting position
[in]end(x,y,z) coordinates of line ending position
[in]colorR-G-B color of the line
[in]coordinate_systemCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 412 of file VisualizerGeometry.cpp.

◆ addLine() [4/4]

size_t Visualizer::addLine ( const helios::vec3 start,
const helios::vec3 end,
const helios::RGBcolor color,
float  line_width,
CoordinateSystem  coordinate_system 
)

Add Lines by giving the coordinates of points along the Lines with custom line width.

Parameters
[in]start(x,y,z) coordinates of line starting position
[in]end(x,y,z) coordinates of line ending position
[in]colorR-G-B color of the line
[in]line_widthWidth of the line in pixels (rendered using geometry shaders for cross-platform wide line support)
[in]coordinate_systemCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".
Note
Line widths are rendered using geometry shaders which expand line primitives into screen-aligned quads, providing consistent wide line rendering across all platforms including macOS.

Definition at line 424 of file VisualizerGeometry.cpp.

◆ addPoint() [1/2]

size_t Visualizer::addPoint ( const helios::vec3 position,
const helios::RGBAcolor color,
float  pointsize,
CoordinateSystem  coordinate_system 
)

Add a point by giving its coordinates and size.

Parameters
[in]position(x,y,z) coordinates of Point
[in]colorR-G-B-A color of the Point
[in]pointsizeSize of the point in font points
[in]coordinate_systemCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 452 of file VisualizerGeometry.cpp.

◆ addPoint() [2/2]

size_t Visualizer::addPoint ( const helios::vec3 position,
const helios::RGBcolor color,
float  pointsize,
CoordinateSystem  coordinate_system 
)

Add a point by giving its coordinates and size.

Parameters
[in]position(x,y,z) coordinates of Point
[in]colorR-G-B color of the Point
[in]pointsizeSize of the point in font points
[in]coordinate_systemCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 448 of file VisualizerGeometry.cpp.

◆ addRectangleByCenter() [1/5]

size_t Visualizer::addRectangleByCenter ( const helios::vec3 center,
const helios::vec2 size,
const helios::SphericalCoord rotation,
const char *  texture_file,
CoordinateSystem  coordFlag 
)

Add a texture mapped rectangle by giving the coordinates of its center.

Parameters
[in]center(x,y,z) location of the rectangle center
[in]sizeSize in the x- and y-directions
[in]rotationspherical rotation angle (elevation,azimuth)
[in]texture_fileFile corresponding to the JPEG image to be used as a texture map
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 69 of file VisualizerGeometry.cpp.

◆ addRectangleByCenter() [2/5]

size_t Visualizer::addRectangleByCenter ( const helios::vec3 center,
const helios::vec2 size,
const helios::SphericalCoord rotation,
const helios::RGBAcolor color,
CoordinateSystem  coordFlag 
)

Add a rectangle by giving the coordinates of its center.

Parameters
[in]center(x,y,z) location of the rectangle center
[in]sizeSize in the x- and y-directions
[in]rotationspherical rotation angle (elevation,azimuth)
[in]colorR-G-B-A color of the rectangle
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 42 of file VisualizerGeometry.cpp.

◆ addRectangleByCenter() [3/5]

size_t Visualizer::addRectangleByCenter ( const helios::vec3 center,
const helios::vec2 size,
const helios::SphericalCoord rotation,
const helios::RGBcolor color,
const char *  texture_file,
CoordinateSystem  coordFlag 
)

Add a rectangle by giving the coordinates of its center - rectangle is colored by and RGB color value but is masked by the alpha channel of a PNG image file.

Parameters
[in]center(x,y,z) location of the rectangle center
[in]sizeSize in the x- and y-directions
[in]rotationspherical rotation angle (elevation,azimuth)
[in]colorR-G-B color of the rectangle
[in]texture_fileFile corresponding to the JPEG image to be used as a texture map
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 96 of file VisualizerGeometry.cpp.

◆ addRectangleByCenter() [4/5]

size_t Visualizer::addRectangleByCenter ( const helios::vec3 center,
const helios::vec2 size,
const helios::SphericalCoord rotation,
const helios::RGBcolor color,
const Glyph glyph,
CoordinateSystem  coordFlag 
)

Add a texture masked rectangle by giving the coordinates of its center.

Parameters
[in]center(x,y,z) location of the rectangle center
[in]sizeSize in the x- and y-directions
[in]rotationspherical rotation angle (elevation,azimuth)
[in]colorR-G-B color of the rectangle
[in]glyphPixel map of true/false values for a transparency mask
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 123 of file VisualizerGeometry.cpp.

◆ addRectangleByCenter() [5/5]

size_t Visualizer::addRectangleByCenter ( const helios::vec3 center,
const helios::vec2 size,
const helios::SphericalCoord rotation,
const helios::RGBcolor color,
CoordinateSystem  coordFlag 
)

Add a rectangle by giving the coordinates of its center.

Parameters
[in]center(x,y,z) location of the rectangle center
[in]sizeSize in the x- and y-directions
[in]rotationspherical rotation angle (elevation,azimuth)
[in]colorR-G-B color of the rectangle
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 38 of file VisualizerGeometry.cpp.

◆ addRectangleByVertices() [1/8]

size_t Visualizer::addRectangleByVertices ( const std::vector< helios::vec3 > &  vertices,
const char *  texture_file,
const std::vector< helios::vec2 > &  uvs,
CoordinateSystem  coordFlag 
)

Add a rectangle by giving the coordinates of its four vertices and color by texture map.

Parameters
[in]vertices(x,y,z) coordinates of four vertices
[in]texture_fileFile corresponding to the JPEG image to be used as a texture map
[in]uvsu-v coordinates for rectangle vertices
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 185 of file VisualizerGeometry.cpp.

◆ addRectangleByVertices() [2/8]

size_t Visualizer::addRectangleByVertices ( const std::vector< helios::vec3 > &  vertices,
const char *  texture_file,
CoordinateSystem  coordFlag 
)

Add a rectangle by giving the coordinates of its four vertices.

Parameters
[in]vertices(x,y,z) coordinates of four vertices
[in]texture_fileFile corresponding to the JPEG image to be used as a texture map
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 180 of file VisualizerGeometry.cpp.

◆ addRectangleByVertices() [3/8]

size_t Visualizer::addRectangleByVertices ( const std::vector< helios::vec3 > &  vertices,
const helios::RGBAcolor color,
const Glyph glyph,
CoordinateSystem  coordFlag 
)

Add a rectangle by giving the coordinates of its four vertices.

Parameters
[in]vertices(x,y,z) coordinates of four vertices
[in]colorR-G-B-A color of the glyph
[in]glyphGlyph object used to render rectangle
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 250 of file VisualizerGeometry.cpp.

◆ addRectangleByVertices() [4/8]

size_t Visualizer::addRectangleByVertices ( const std::vector< helios::vec3 > &  vertices,
const helios::RGBAcolor color,
CoordinateSystem  coordFlag 
)

Add a rectangle by giving the coordinates of its four vertices.

Parameters
[in]vertices(x,y,z) coordinates of four vertices
[in]colorR-G-B-A color of the rectangle
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 154 of file VisualizerGeometry.cpp.

◆ addRectangleByVertices() [5/8]

size_t Visualizer::addRectangleByVertices ( const std::vector< helios::vec3 > &  vertices,
const helios::RGBcolor color,
const char *  texture_file,
const std::vector< helios::vec2 > &  uvs,
CoordinateSystem  coordFlag 
)

Add a rectangle by giving the coordinates of its four vertices and mask by texture map transparency channel, but color by R-G-B value.

Parameters
[in]vertices(x,y,z) coordinates of four vertices
[in]texture_fileFile corresponding to the JPEG image to be used as a texture map
[in]uvsu-v coordinates for rectangle vertices
[in]colorR-G-B color of the rectangle
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 218 of file VisualizerGeometry.cpp.

◆ addRectangleByVertices() [6/8]

size_t Visualizer::addRectangleByVertices ( const std::vector< helios::vec3 > &  vertices,
const helios::RGBcolor color,
const char *  texture_file,
CoordinateSystem  coordFlag 
)

Add a rectangle by giving the coordinates of its four vertices - rectangle is colored by an RGB color value but is masked by the alpha channel of a PNG image file.

Parameters
[in]vertices(x,y,z) coordinates of four vertices
[in]colorR-G-B color of the rectangle
[in]texture_fileFile corresponding to the JPEG image to be used as a texture map
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 213 of file VisualizerGeometry.cpp.

◆ addRectangleByVertices() [7/8]

size_t Visualizer::addRectangleByVertices ( const std::vector< helios::vec3 > &  vertices,
const helios::RGBcolor color,
const Glyph glyph,
CoordinateSystem  coordFlag 
)

Add a rectangle by giving the coordinates of its four vertices.

Parameters
[in]vertices(x,y,z) coordinates of four vertices
[in]colorR-G-B color of the glyph
[in]glyphGlyph object used to render rectangle
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 246 of file VisualizerGeometry.cpp.

◆ addRectangleByVertices() [8/8]

size_t Visualizer::addRectangleByVertices ( const std::vector< helios::vec3 > &  vertices,
const helios::RGBcolor color,
CoordinateSystem  coordFlag 
)

Add a rectangle by giving the coordinates of its four vertices.

Parameters
[in]vertices(x,y,z) coordinates of four vertices
[in]colorR-G-B color of the rectangle
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 150 of file VisualizerGeometry.cpp.

◆ addSkyDomeByCenter() [1/2]

std::vector< size_t > Visualizer::addSkyDomeByCenter ( float  radius,
const helios::vec3 center,
uint  Ndivisions,
const char *  texture_file 
)

Add a Sky Dome, which is a hemispherical dome colored by a sky texture map.

Deprecated:
This method is deprecated and will be removed in a future version. Use setBackgroundSkyTexture() instead, which provides a more robust sky rendering solution that dynamically scales with camera movement.
Parameters
[in]radiusRadius of the dome
[in]center(x,y,z) location of dome center
[in]NdivisionsNumber of discrete divisions in making hemisphere
[in]texture_fileName of the texture map file
See also
setBackgroundSkyTexture()

Definition at line 613 of file VisualizerGeometry.cpp.

◆ addSkyDomeByCenter() [2/2]

void Visualizer::addSkyDomeByCenter ( float  radius,
const helios::vec3 center,
uint  Ndivisions,
const char *  texture_file,
int  layer 
)

Add a Sky Dome, which is a hemispherical dome colored by a sky texture map.

Note
This function has been deprecated, as layers are no longer supported.

Definition at line 532 of file VisualizerGeometry.cpp.

◆ addSphereByCenter() [1/2]

std::vector< size_t > Visualizer::addSphereByCenter ( float  radius,
const helios::vec3 center,
uint  Ndivisions,
const helios::RGBAcolor color,
CoordinateSystem  coordinate_system 
)

Add a sphere by giving the radius and center.

Parameters
[in]radiusRadius of the sphere
[in]center(x,y,z) location of sphere center
[in]NdivisionsNumber of discrete divisions in making sphere
[in]colorR-G-B-A color of the sphere
[in]coordinate_systemCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 480 of file VisualizerGeometry.cpp.

◆ addSphereByCenter() [2/2]

std::vector< size_t > Visualizer::addSphereByCenter ( float  radius,
const helios::vec3 center,
uint  Ndivisions,
const helios::RGBcolor color,
CoordinateSystem  coordinate_system 
)

Add a sphere by giving the radius and center.

Parameters
[in]radiusRadius of the sphere
[in]center(x,y,z) location of sphere center
[in]NdivisionsNumber of discrete divisions in making sphere
[in]colorR-G-B color of the sphere
[in]coordinate_systemCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 476 of file VisualizerGeometry.cpp.

◆ addTextboxByCenter()

std::vector< size_t > Visualizer::addTextboxByCenter ( const char *  textstring,
const helios::vec3 center,
const helios::SphericalCoord rotation,
const helios::RGBcolor fontcolor,
uint  fontsize,
const char *  fontname,
CoordinateSystem  coordinate_system 
)

Add a text box by giving the coordinates of its center.

Parameters
[in]textstringString of text to display
[in]center(x,y,z) location of the text box center
[in]rotationSpherical rotation angle in radians (elevation,azimuth)
[in]fontcolorColor of the font
[in]fontsizeSize of the text font in points
[in]coordinate_systemCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 694 of file VisualizerGeometry.cpp.

◆ addTriangle() [1/4]

size_t Visualizer::addTriangle ( const helios::vec3 vertex0,
const helios::vec3 vertex1,
const helios::vec3 vertex2,
const char *  texture_file,
const helios::vec2 uv0,
const helios::vec2 uv1,
const helios::vec2 uv2,
const helios::RGBAcolor color,
CoordinateSystem  coordFlag 
)

Add a triangle by giving the coordinates of its three vertices and color by a constant color, but mask using transparency channel of texture map.

Parameters
[in]vertex0(x,y,z) location of first vertex
[in]vertex1(x,y,z) location of first vertex
[in]vertex2(x,y,z) location of first vertex
[in]texture_fileFile corresponding to the image to be used as a texture map
[in]uv0u-v texture coordinates of vertex0
[in]uv1u-v texture coordinates of vertex1
[in]uv2u-v texture coordinates of vertex2
[in]colorR-G-B-A color of the triangle
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 349 of file VisualizerGeometry.cpp.

◆ addTriangle() [2/4]

size_t Visualizer::addTriangle ( const helios::vec3 vertex0,
const helios::vec3 vertex1,
const helios::vec3 vertex2,
const char *  texture_file,
const helios::vec2 uv0,
const helios::vec2 uv1,
const helios::vec2 uv2,
CoordinateSystem  coordFlag 
)

Add a triangle by giving the coordinates of its three vertices and color by texture map.

Parameters
[in]vertex0(x,y,z) location of first vertex
[in]vertex1(x,y,z) location of first vertex
[in]vertex2(x,y,z) location of first vertex
[in]texture_fileFile corresponding to the image to be used as a texture map
[in]uv0u-v texture coordinates of vertex0
[in]uv1u-v texture coordinates of vertex1
[in]uv2u-v texture coordinates of vertex2
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 318 of file VisualizerGeometry.cpp.

◆ addTriangle() [3/4]

size_t Visualizer::addTriangle ( const helios::vec3 vertex0,
const helios::vec3 vertex1,
const helios::vec3 vertex2,
const helios::RGBAcolor color,
CoordinateSystem  coordFlag 
)

Add a triangle by giving the coordinates of its three vertices.

Parameters
[in]vertex0(x,y,z) location of first vertex
[in]vertex1(x,y,z) location of first vertex
[in]vertex2(x,y,z) location of first vertex
[in]colorR-G-B-A color of the triangle
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 290 of file VisualizerGeometry.cpp.

◆ addTriangle() [4/4]

size_t Visualizer::addTriangle ( const helios::vec3 vertex0,
const helios::vec3 vertex1,
const helios::vec3 vertex2,
const helios::RGBcolor color,
CoordinateSystem  coordFlag 
)

Add a triangle by giving the coordinates of its three vertices.

Parameters
[in]vertex0(x,y,z) location of first vertex
[in]vertex1(x,y,z) location of first vertex
[in]vertex2(x,y,z) location of first vertex
[in]colorR-G-B color of the triangle
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 286 of file VisualizerGeometry.cpp.

◆ addVoxelByCenter() [1/2]

std::vector< size_t > Visualizer::addVoxelByCenter ( const helios::vec3 center,
const helios::vec3 size,
const helios::SphericalCoord rotation,
const helios::RGBAcolor color,
CoordinateSystem  coordFlag 
)

Add a voxel by giving the coordinates of its center.

Parameters
[in]center(x,y,z) location of the voxel center
[in]sizeSize in the x-, y- and z-directions
[in]rotationSpherical rotation angle (elevation,azimuth)
[in]colorR-G-B-A color of the voxel
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 384 of file VisualizerGeometry.cpp.

◆ addVoxelByCenter() [2/2]

std::vector< size_t > Visualizer::addVoxelByCenter ( const helios::vec3 center,
const helios::vec3 size,
const helios::SphericalCoord rotation,
const helios::RGBcolor color,
CoordinateSystem  coordFlag 
)

Add a voxel by giving the coordinates of its center.

Parameters
[in]center(x,y,z) location of the voxel center
[in]sizeSize in the x-, y- and z-directions
[in]rotationSpherical rotation angle (elevation,azimuth)
[in]colorR-G-B color of the voxel
[in]coordFlagCoordinate system to be used when specifying spatial coordinates. Should be one of "Visualizer::COORDINATES_WINDOW_NORMALIZED" or "Visualizer::COORDINATES_CARTESIAN".

Definition at line 380 of file VisualizerGeometry.cpp.

◆ buildContextGeometry() [1/2]

void Visualizer::buildContextGeometry ( helios::Context context_ptr)

Add all geometry from the Context to the visualizer.

Parameters
[in]context_ptrPointer to the simulation context

Definition at line 31 of file VisualizerContext.cpp.

◆ buildContextGeometry() [2/2]

void Visualizer::buildContextGeometry ( helios::Context context_ptr,
const std::vector< uint > &  UUIDs 
)

Add select geometry from the Context to the visualizer by their UUIDs.

Parameters
[in]context_ptrPointer to the simulation context
[in]UUIDsUUIDs of Context primitives to be added to the visualizer

Definition at line 45 of file VisualizerContext.cpp.

◆ cleanupOffscreenFramebuffer()

void Visualizer::cleanupOffscreenFramebuffer ( )

Clean up offscreen framebuffer resources.

Definition at line 594 of file VisualizerCore.cpp.

◆ clearColor()

void Visualizer::clearColor ( )

Clears the primitive colors based on primitive data from a previous call to colorContextPrimitivesByData() or colorContextPrimitivesByObjectData().

Definition at line 805 of file VisualizerContext.cpp.

◆ clearContextGeometry()

void Visualizer::clearContextGeometry ( )

Clear all Context geometry previously added to the visualizer.

Definition at line 20 of file VisualizerContext.cpp.

◆ clearGeometry()

void Visualizer::clearGeometry ( )

Clear all geometry previously added to the visualizer.

Definition at line 26 of file VisualizerGeometry.cpp.

◆ closeWindow()

void Visualizer::closeWindow ( ) const

Close the graphics window.

Definition at line 489 of file VisualizerRendering.cpp.

◆ colorContextObjectsRandomly() [1/2]

void Visualizer::colorContextObjectsRandomly ( )

Color objects from Context with a random color.

Note
Useful for visualizing individual objects

Definition at line 790 of file VisualizerContext.cpp.

◆ colorContextObjectsRandomly() [2/2]

void Visualizer::colorContextObjectsRandomly ( const std::vector< uint > &  ObjIDs)

Color objects from Context with a random color.

Note
Useful for visualizing individual objects

Definition at line 776 of file VisualizerContext.cpp.

◆ colorContextPrimitivesByData() [1/2]

void Visualizer::colorContextPrimitivesByData ( const char *  data_name)

Color primitives from Context by color mapping their ‘Primitive Data’.

Parameters
[in]data_nameName of ‘Primitive Data’
Note
If the data value does not exist for a certain primitive, a value of 0 is assumed.

Definition at line 688 of file VisualizerContext.cpp.

◆ colorContextPrimitivesByData() [2/2]

void Visualizer::colorContextPrimitivesByData ( const char *  data_name,
const std::vector< uint > &  UUIDs 
)

Color primitives from Context by color mapping their ‘Primitive Data’.

Parameters
[in]data_nameName of ‘Primitive Data’
[in]UUIDsUUID's of primitives to be colored by data
Note
If the data value does not exist for a certain primitive, a value of 0 is assumed.

Definition at line 700 of file VisualizerContext.cpp.

◆ colorContextPrimitivesByObjectData() [1/2]

void Visualizer::colorContextPrimitivesByObjectData ( const char *  data_name)

Color primitives from Context by color mapping their ‘Object Data’.

Parameters
[in]data_nameName of ‘Object Data’
Note
If the data value does not exist for a certain primitive, a value of 0 is assumed.

Definition at line 712 of file VisualizerContext.cpp.

◆ colorContextPrimitivesByObjectData() [2/2]

void Visualizer::colorContextPrimitivesByObjectData ( const char *  data_name,
const std::vector< uint > &  ObjIDs 
)

Color primitives from Context by color mapping their ‘Object Data’.

Parameters
[in]data_nameName of ‘Object Data’
[in]ObjIDsObject ID's of primitives to be colored by object data
Note
If the data value does not exist for a certain primitive, a value of 0 is assumed.

Definition at line 724 of file VisualizerContext.cpp.

◆ colorContextPrimitivesRandomly() [1/2]

void Visualizer::colorContextPrimitivesRandomly ( )

Color primitives from Context with a random color.

Note
Useful for visualizing individual primitives that are part of compound objects

Definition at line 756 of file VisualizerContext.cpp.

◆ colorContextPrimitivesRandomly() [2/2]

void Visualizer::colorContextPrimitivesRandomly ( const std::vector< uint > &  UUIDs)

Color primitives from Context with a random color.

Parameters
[in]UUIDsPrimitive UUIDs to color randomly
Note
Useful for visualizing individual primitives that are part of compound objects

Definition at line 736 of file VisualizerContext.cpp.

◆ deleteGeometry()

void Visualizer::deleteGeometry ( size_t  geometry_id)

Removes the geometry with the specified ID from the visualizer.

Parameters
[in]geometry_idThe unique identifier of the geometry to delete.

Definition at line 915 of file VisualizerGeometry.cpp.

◆ disableColorbar()

void Visualizer::disableColorbar ( void  )

Disable the colorbar.

Definition at line 1918 of file VisualizerCore.cpp.

◆ disableCoordinateAxes()

void Visualizer::disableCoordinateAxes ( )

Remove coordinate axes (if created with Visualizer::addCoordinateAxes)

Definition at line 1057 of file VisualizerGeometry.cpp.

◆ disableMessages()

void Visualizer::disableMessages ( )

Disable standard output from this plug-in.

Definition at line 1478 of file VisualizerCore.cpp.

◆ displayImage() [1/2]

void Visualizer::displayImage ( const std::string &  file_name)

Displays an image file in the visualizer.

Note that this function clears any existing geometry in the visualizer.

Parameters
[in]file_namePath to the image file to display.

Definition at line 274 of file VisualizerRendering.cpp.

◆ displayImage() [2/2]

void Visualizer::displayImage ( const std::vector< unsigned char > &  pixel_data,
uint  width_pixels,
uint  height_pixels 
)

Displays an image using the provided pixel data and dimensions.

Note that this function clears any existing geometry in the visualizer.

Parameters
[in]pixel_dataThe pixel data of the image. Each pixel requires 4 components (RGBA), and the vector size should be 4 * width_pixels * height_pixels.
[in]width_pixelsThe width of the image in pixels.
[in]height_pixelsThe height of the image in pixels.
Note
The function assumes the pixel data has a length consistent with the resolution specified by width_pixels and height_pixels.

Definition at line 230 of file VisualizerRendering.cpp.

◆ enableColorbar()

void Visualizer::enableColorbar ( void  )

Enable the colorbar.

Definition at line 1914 of file VisualizerCore.cpp.

◆ enableMessages()

void Visualizer::enableMessages ( )

Enable standard output from this plug-in (default)

Definition at line 1474 of file VisualizerCore.cpp.

◆ formatTickLabel()

std::string Visualizer::formatTickLabel ( double  value,
double  spacing,
bool  isIntegerData 
)
static

Helper function to format a tick label with appropriate precision.

Parameters
[in]valueThe tick value to format
[in]spacingThe spacing between ticks
[in]isIntegerDataWhether the data represents integer values
Returns
The formatted label string

Definition at line 2024 of file VisualizerCore.cpp.

◆ generateNiceTicks()

std::vector< float > Visualizer::generateNiceTicks ( float  dataMin,
float  dataMax,
bool  isIntegerData,
int  targetTicks = 5 
)
static

Generate optimal tick values using nice numbers algorithm.

Parameters
[in]dataMinMinimum data value
[in]dataMaxMaximum data value
[in]isIntegerDataWhether the data represents integer values
[in]targetTicksTarget number of ticks (default 5)
Returns
Vector of tick values

Definition at line 2069 of file VisualizerCore.cpp.

◆ getBackgroundColor()

helios::RGBcolor Visualizer::getBackgroundColor ( ) const

Retrieves the background color of the visualizer.

Returns
The current background color as an RGBcolor object.

Definition at line 2473 of file VisualizerCore.cpp.

◆ getCameraPosition()

std::vector< helios::vec3 > Visualizer::getCameraPosition ( ) const

Retrieves the current camera position.

Returns
A vector containing the camera look-at center and the camera eye location as two elements of type helios::vec3.

Definition at line 2481 of file VisualizerCore.cpp.

◆ getCurrentColormap()

Colormap Visualizer::getCurrentColormap ( ) const

Get the current colormap used in Colorbar/visualization.

Definition at line 2180 of file VisualizerCore.cpp.

◆ getDepthMap() [1/2]

void Visualizer::getDepthMap ( float *  buffer)

Get depth buffer data for the current display window.

Parameters
[out]bufferDistance to nearest object from the camera location.

Definition at line 402 of file VisualizerRendering.cpp.

◆ getDepthMap() [2/2]

void Visualizer::getDepthMap ( std::vector< float > &  depth_pixels,
uint width_pixels,
uint height_pixels 
)

Definition at line 421 of file VisualizerRendering.cpp.

◆ getFramebufferSize()

void Visualizer::getFramebufferSize ( uint width,
uint height 
) const

Get the size of the framebuffer in pixels.

Parameters
[out]widthWidth of the framebuffer in pixels
[out]heightHeight of the framebuffer in pixels

Definition at line 484 of file VisualizerRendering.cpp.

◆ getGeometryVertices()

std::vector< helios::vec3 > Visualizer::getGeometryVertices ( size_t  geometry_id) const

Get the vertices of a geometry primitive.

Parameters
[in]geometry_idThe unique identifier of the geometry
Returns
Vector of vertices in the same coordinate system they were added with
Note
For COORDINATES_WINDOW_NORMALIZED, returns vertices in [0,1] range. For COORDINATES_CARTESIAN, returns vertices in world coordinates.

Definition at line 921 of file VisualizerGeometry.cpp.

◆ getPerspectiveTransformationMatrix()

glm::mat4 Visualizer::getPerspectiveTransformationMatrix ( ) const

Calculates the perspective transformation matrix for mapping between two quadrilaterals.

Returns
4x4 perspective transformation matrix.

Definition at line 2485 of file VisualizerCore.cpp.

◆ getPointRenderingMetrics()

void Visualizer::getPointRenderingMetrics ( size_t &  total_points,
size_t &  rendered_points,
float &  culling_time_ms 
) const

Get point cloud rendering performance metrics.

Parameters
[out]total_pointsTotal number of points in the scene
[out]rendered_pointsNumber of points actually rendered after culling
[out]culling_time_msTime spent on culling in milliseconds

Definition at line 2344 of file VisualizerRendering.cpp.

◆ getWindow()

void * Visualizer::getWindow ( ) const

Retrieves the window associated with the Visualizer.

Returns
Pointer to the window object.

Definition at line 2460 of file VisualizerCore.cpp.

◆ getWindowPixelsRGB()

void Visualizer::getWindowPixelsRGB ( uint buffer) const

Get R-G-B pixel data in the current display window.

Parameters
[out]bufferPixel data. The data is stored as r-g-b * column * row. So indices (0,1,2) would be the RGB values for row 0 and column 0, indices (3,4,5) would be RGB values for row 0 and column 1, and so on. Thus, buffer is of size 3*width*height.

Definition at line 291 of file VisualizerRendering.cpp.

◆ getWindowSize()

void Visualizer::getWindowSize ( uint width,
uint height 
) const

Get the size of the display window in pixels.

Parameters
[out]widthWidth of the display window in pixels
[out]heightHeight of the display window in pixels

Definition at line 479 of file VisualizerRendering.cpp.

◆ handleGizmoClick()

void Visualizer::handleGizmoClick ( double  screen_x,
double  screen_y 
)

Handle mouse click for navigation gizmo interaction.

Parameters
[in]screen_xMouse x-coordinate in screen space
[in]screen_yMouse y-coordinate in screen space

Definition at line 1807 of file VisualizerCore.cpp.

◆ handleGizmoHover()

void Visualizer::handleGizmoHover ( double  screen_x,
double  screen_y 
)

Handle mouse hover for navigation gizmo interaction.

Parameters
[in]screen_xMouse x-coordinate in screen space
[in]screen_yMouse y-coordinate in screen space

Definition at line 1827 of file VisualizerCore.cpp.

◆ hideNavigationGizmo()

void Visualizer::hideNavigationGizmo ( )

Make navigation gizmo (coordinate axes indicator) invisible.

Definition at line 1769 of file VisualizerCore.cpp.

◆ hideWatermark()

void Visualizer::hideWatermark ( )

Make Helios logo watermark invisible.

Definition at line 1756 of file VisualizerCore.cpp.

◆ niceNumber()

double Visualizer::niceNumber ( double  value,
bool  round 
)
static

Helper function to round a value to a "nice" number (1, 2, or 5 times a power of 10)

Parameters
[in]valueThe value to round
[in]roundIf true, round to nearest nice number; if false, round up
Returns
The rounded "nice" number

Definition at line 1983 of file VisualizerCore.cpp.

◆ plotDepthMap()

void Visualizer::plotDepthMap ( )

Plot the depth map (distance from camera to nearest object)

The resulting image is normalized depth, where white = closest and black = farthest.

Definition at line 1530 of file VisualizerRendering.cpp.

◆ plotInteractive()

std::vector< helios::vec3 > Visualizer::plotInteractive ( )

Plot current geometry into an interactive graphics window.

Definition at line 494 of file VisualizerRendering.cpp.

◆ plotOnce()

void Visualizer::plotOnce ( bool  getKeystrokes)

Run one rendering loop from plotInteractive()

Parameters
[in]getKeystrokesIf false, do not update visualization with input keystrokes.

Definition at line 656 of file VisualizerRendering.cpp.

◆ plotUpdate() [1/2]

void Visualizer::plotUpdate ( )

Update the graphics window based on current geometry, then continue the program.

Definition at line 1309 of file VisualizerRendering.cpp.

◆ plotUpdate() [2/2]

void Visualizer::plotUpdate ( bool  hide_window)

Update the graphics window based on current geometry, then continue the program, with the option not to display the graphic window.

If running a large number of renderings, or running remotely, it can be desirable to not open the graphic window.

Parameters
[in]hide_windowIf false, do not display the graphic window.

Definition at line 1313 of file VisualizerRendering.cpp.

◆ printWindow() [1/2]

void Visualizer::printWindow ( )

Print the current graphics window to a JPEG image file. File will be given a default filename and saved to the current directory from which the executable was run.

Definition at line 35 of file VisualizerRendering.cpp.

◆ printWindow() [2/2]

void Visualizer::printWindow ( const char *  outfile,
const std::string &  image_format = "jpeg" 
)

Print the current graphics window to an image file.

Parameters
[in]outfilePath to file where image should be saved.
[in]image_formatFormat of the output image: "jpeg" (default) or "png".
Note
If using PNG format with transparent background mode (setBackgroundTransparent()), the output will have alpha channel transparency.
If outfile does not have an appropriate extension, it will be appended based on image_format.

Definition at line 49 of file VisualizerRendering.cpp.

◆ renderToOffscreenBuffer()

void Visualizer::renderToOffscreenBuffer ( )

Switch rendering target to offscreen buffer.

Definition at line 796 of file VisualizerCore.cpp.

◆ selfTest()

int Visualizer::selfTest ( int  argc = 0,
char **  argv = nullptr 
)
static

Visualizer self-test routine.

Definition at line 1259 of file selfTest.cpp.

◆ setBackgroundColor()

void Visualizer::setBackgroundColor ( const helios::RGBcolor color)

Set the background color for the visualizer window.

Parameters
[in]colorBackground color

Definition at line 1523 of file VisualizerCore.cpp.

◆ setBackgroundImage()

void Visualizer::setBackgroundImage ( const char *  texture_file)

Set a custom background image.

This method sets a custom texture image as the background. The image will be stretched to fill the window while maintaining the aspect ratio of the window to avoid distortion.

Parameters
[in]texture_filePath to the texture image file to use as background
Note
Supported formats include JPEG and PNG files
See also
setBackgroundColor(), setBackgroundTransparent()

Definition at line 1598 of file VisualizerCore.cpp.

◆ setBackgroundSkyTexture()

void Visualizer::setBackgroundSkyTexture ( const char *  texture_file = nullptr,
uint  Ndivisions = 50 
)

Set a sky sphere texture as background.

Creates a dynamically scaling full sky sphere that keeps the camera always inside using shader-based transformations

Parameters
[in]texture_filePath to the spherical/equirectangular texture image file. If nullptr, uses default sky texture (plugins/visualizer/textures/SkyDome_clouds.jpg)
[in]NdivisionsNumber of divisions for sphere tessellation (default: 50)
Note
This method creates a complete sphere (not just a hemisphere) that surrounds the camera in all directions
Uses shader transformations to make the sky appear infinitely distant and always contain the camera
Can be toggled with other background methods (setBackgroundColor, setBackgroundImage, setBackgroundTransparent)
See also
setBackgroundColor(), setBackgroundImage(), setBackgroundTransparent()

Definition at line 1631 of file VisualizerCore.cpp.

◆ setBackgroundTransparent()

void Visualizer::setBackgroundTransparent ( )

Set the background to be transparent.

This method enables transparent background mode. When rendering to the screen (via plotUpdate() or plotInteractive()), a checkerboard pattern is displayed to indicate transparency. When saving to a PNG file (via printWindow() with image_format="png"), the background will have true alpha channel transparency.

Note
This only affects PNG output. JPEG output will still have an opaque background.
See also
setBackgroundColor()

Definition at line 1564 of file VisualizerCore.cpp.

◆ setCameraFieldOfView()

void Visualizer::setCameraFieldOfView ( float  angle_FOV)

Set the camera field of view (angle width) in degrees. Default value is 45 degrees.

Parameters
[in]angle_FOVAngle of camera field of view in degrees.

Definition at line 1492 of file VisualizerCore.cpp.

◆ setCameraPosition() [1/2]

void Visualizer::setCameraPosition ( const helios::SphericalCoord cameraAngle,
const helios::vec3 lookAt 
)

Set camera position.

Parameters
[in]cameraAngle(elevation,azimuth) angle to the camera with respect to the ‘lookAt’ position.
[in]lookAt(x,y,z) position of where the camera is looking at.

Definition at line 1487 of file VisualizerCore.cpp.

◆ setCameraPosition() [2/2]

void Visualizer::setCameraPosition ( const helios::vec3 cameraPosition,
const helios::vec3 lookAt 
)

Set camera position.

Parameters
[in]cameraPosition(x,y,z) position of the camera, i.e., this is where the actual camera or ‘eye’ is positioned.
[in]lookAt(x,y,z) position of where the camera is looking at.

Definition at line 1482 of file VisualizerCore.cpp.

◆ setColorbarFontColor()

void Visualizer::setColorbarFontColor ( helios::RGBcolor  color)

Set the RGB color of the colorbar text.

Parameters
[in]colorFont color

Definition at line 2144 of file VisualizerCore.cpp.

◆ setColorbarFontSize()

void Visualizer::setColorbarFontSize ( uint  font_size)

Set the font size of the colorbar text.

Parameters
[in]font_sizeFont size

Definition at line 2137 of file VisualizerCore.cpp.

◆ setColorbarPosition()

void Visualizer::setColorbarPosition ( helios::vec3  position)

Set the position of the colorbar in normalized window coordinates (0-1)

Parameters
[in]positionPosition of the colorbar in normalized window coordinates

Definition at line 1926 of file VisualizerCore.cpp.

◆ setColorbarRange()

void Visualizer::setColorbarRange ( float  cmin,
float  cmax 
)

Set the range of the Colorbar.

Parameters
[in]cminMinimum value
[out]cmaxMaximum value

Definition at line 1946 of file VisualizerCore.cpp.

◆ setColorbarSize()

void Visualizer::setColorbarSize ( helios::vec2  size)

Set the size of the colorbar in normalized window units (0-1)

Parameters
[in]sizeSize of the colorbar in normalized window units (0-1)

Definition at line 1933 of file VisualizerCore.cpp.

◆ setColorbarTicks()

void Visualizer::setColorbarTicks ( const std::vector< float > &  ticks)

Set the values in the colorbar where ticks and labels should be placed.

Parameters
[in]ticksVector of values corresponding to ticks
Note
If tick values are outside of the colorbar range (see setColorBarRange()), the colorbar will be automatically expanded to fit the tick values.

Definition at line 1955 of file VisualizerCore.cpp.

◆ setColorbarTitle()

void Visualizer::setColorbarTitle ( const char *  title)

Set the title of the Colorbar.

Parameters
[in]titleColorbar title

Definition at line 2133 of file VisualizerCore.cpp.

◆ setColormap() [1/2]

void Visualizer::setColormap ( const std::vector< helios::RGBcolor > &  colors,
const std::vector< float > &  divisions 
)

Set the colormap used in Colorbar/visualization based on a custom colormap.

Parameters
[in]colorsVector of colors defining control points on the colormap.
[in]divisionsVector of values defining the normalized coordinates of each color control point on the colormap.

Definition at line 2170 of file VisualizerCore.cpp.

◆ setColormap() [2/2]

void Visualizer::setColormap ( Ctable  colormap_name)

Set the colormap used in Colorbar/visualization based on pre-defined colormaps.

Parameters
[in]colormap_nameName of a colormap.
Note
Valid colormaps are "COLORMAP_HOT", "COLORMAP_COOL", "COLORMAP_LAVA", "COLORMAP_RAINBOW", "COLORMAP_PARULA", "COLORMAP_GRAY", "COLORMAP_LINES".

Definition at line 2148 of file VisualizerCore.cpp.

◆ setGeometryVertices()

void Visualizer::setGeometryVertices ( size_t  geometry_id,
const std::vector< helios::vec3 > &  vertices 
)

Set the vertices of a geometry primitive.

Parameters
[in]geometry_idThe unique identifier of the geometry
[in]verticesNew vertex positions in the same coordinate system the geometry was created with
Note
For COORDINATES_WINDOW_NORMALIZED, provide vertices in [0,1] range. For COORDINATES_CARTESIAN, provide vertices in world coordinates.

Definition at line 925 of file VisualizerGeometry.cpp.

◆ setLightDirection()

void Visualizer::setLightDirection ( const helios::vec3 direction)

Set the direction of the light source.

Parameters
[in]directionVector pointing in the direction of the light source (vector starts at light source and points toward scene.)

Definition at line 1496 of file VisualizerCore.cpp.

◆ setLightingModel()

void Visualizer::setLightingModel ( LightingModel  lightingmodel)

Set the lighting model for shading of all primitives.

Parameters
[in]lightingmodelLighting model to be used
See also
LightingModel

Definition at line 1501 of file VisualizerCore.cpp.

◆ setLightIntensityFactor()

void Visualizer::setLightIntensityFactor ( float  lightintensityfactor)

Set the light intensity scaling factor.

Parameters
[in]lightintensityfactorScaling factor for light intensity. Default is 1.0

Definition at line 1505 of file VisualizerCore.cpp.

◆ setPointCullingEnabled()

void Visualizer::setPointCullingEnabled ( bool  enabled)

Point cloud culling configuration methods.

Enable or disable point cloud culling optimization

Parameters
[in]enabledTrue to enable culling, false to disable

Definition at line 2328 of file VisualizerRendering.cpp.

◆ setPointCullingThreshold()

void Visualizer::setPointCullingThreshold ( size_t  threshold)

Set the minimum number of points required to trigger culling.

Parameters
[in]thresholdPoint count threshold for enabling culling

Definition at line 2332 of file VisualizerRendering.cpp.

◆ setPointLODFactor()

void Visualizer::setPointLODFactor ( float  factor)

Set the level-of-detail factor for distance-based culling.

Parameters
[in]factorLOD factor (higher values = more aggressive culling)

Definition at line 2340 of file VisualizerRendering.cpp.

◆ setPointMaxRenderDistance()

void Visualizer::setPointMaxRenderDistance ( float  distance)

Set the maximum rendering distance for points.

Parameters
[in]distanceMaximum distance in world units (0 = auto-calculate)

Definition at line 2336 of file VisualizerRendering.cpp.

◆ setupOffscreenFramebuffer()

void Visualizer::setupOffscreenFramebuffer ( )

Setup offscreen framebuffer for headless rendering.

Definition at line 445 of file VisualizerCore.cpp.

◆ showNavigationGizmo()

void Visualizer::showNavigationGizmo ( )

Make navigation gizmo (coordinate axes indicator) visible.

Definition at line 1778 of file VisualizerCore.cpp.

◆ showWatermark()

void Visualizer::showWatermark ( )

Make Helios logo watermark visible.

Definition at line 1764 of file VisualizerCore.cpp.

◆ updateContextPrimitiveColors()

void Visualizer::updateContextPrimitiveColors ( )

Updates the colors of context primitives based on current visualization settings.

This method processes all primitive geometries within the context, applies appropriate color mapping based on configured data or object data, updates their color values, and handles internal logic for colormap range adjustments and primitive existence checks.

Definition at line 482 of file VisualizerContext.cpp.

◆ updateWatermark()

void Visualizer::updateWatermark ( )

Update watermark geometry to match current window size.

Definition at line 1913 of file VisualizerRendering.cpp.

Friends And Related Symbol Documentation

◆ Shader

friend struct Shader
friend

Definition at line 1711 of file Visualizer.h.

◆ Texture

friend struct Texture
friend

Definition at line 1712 of file Visualizer.h.


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