Description

A filter that, when applied to a sensor, creates a GUI window to visualize the sensor (using GLFW).

This visualizes data as an image. Will only work on data that can be interpreted as image data.

#include <ChFilterVisualize.h>

Inheritance diagram for chrono::sensor::ChFilterVisualize:
Collaboration diagram for chrono::sensor::ChFilterVisualize:

Classes

struct  DestroyglfwWin
 Helper to allow GLFWwindow to be in a unique_ptr. More...
 

Public Member Functions

 ChFilterVisualize (int w, int h, std::string name={})
 Class constructor. More...
 
virtual ~ChFilterVisualize ()
 Class destructor.
 
virtual void Apply (std::shared_ptr< ChSensor > pSensor, std::shared_ptr< SensorBuffer > &bufferInOut)
 Apply function. More...
 
virtual void Initialize (std::shared_ptr< ChSensor > pSensor)
 Initializes all data needed by the filter access apply function. More...
 
- Public Member Functions inherited from chrono::sensor::ChFilter
virtual ~ChFilter ()
 Virtual class desctructor.
 
std::string & Name ()
 Accesses the name of the filter. More...
 

Protected Member Functions

void CreateGlfwWindow (std::shared_ptr< ChSensor > pSensor)
 Creates a GLFW window for this filter.
 
void MakeGlContextActive ()
 Makes this filter's GLFW window active so it can be drawn to.
 
- Protected Member Functions inherited from chrono::sensor::ChFilter
 ChFilter (std::string name)
 protected constructor for the filter which requires a name as input. More...
 

Static Protected Member Functions

static void OnNewWindow ()
 Helper function for when new window is created.
 
static void OnCloseWindow ()
 Helper function for when window is closed.
 

Protected Attributes

std::unique_ptr< GLFWwindow, DestroyglfwWinm_window
 pointer to the window
 
unsigned int m_gl_tex_id = 0
 reference data for the GL context and texture
 
bool m_window_disabled = false
 for checking if window is not allowed on sysmtem (e.g. headless rendering)
 
int m_w
 width of the window
 
int m_h
 height of the window
 

Static Protected Attributes

static int s_windowCount = 0
 keeps track of the window count
 

Constructor & Destructor Documentation

◆ ChFilterVisualize()

CH_SENSOR_API chrono::sensor::ChFilterVisualize::ChFilterVisualize ( int  w,
int  h,
std::string  name = {} 
)

Class constructor.

Parameters
wWidth of the window to create
hHeight of the window to create
nameString name of the filter

Member Function Documentation

◆ Apply()

CH_SENSOR_API void chrono::sensor::ChFilterVisualize::Apply ( std::shared_ptr< ChSensor pSensor,
std::shared_ptr< SensorBuffer > &  bufferInOut 
)
virtual

Apply function.

Visualizes data as an image.

Parameters
pSensorA pointer to the sensor on which the filter is attached.
bufferInOutA buffer that is passed into the filter.

Implements chrono::sensor::ChFilter.

Reimplemented in chrono::sensor::ChFilterVisualizePointCloud.

◆ Initialize()

virtual void chrono::sensor::ChFilterVisualize::Initialize ( std::shared_ptr< ChSensor pSensor)
inlinevirtual

Initializes all data needed by the filter access apply function.

Parameters
pSensorA pointer to the sensor.

Implements chrono::sensor::ChFilter.

Reimplemented in chrono::sensor::ChFilterVisualizePointCloud.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_sensor/filters/ChFilterVisualize.h
  • /builds/uwsbel/chrono/src/chrono_sensor/filters/ChFilterVisualize.cpp