Description
Base class for a run-time visualization system for SPH-based FSI systems.
#include <ChGpuVisualization.h>


Public Member Functions | |
virtual void | SetTitle (const std::string &title) |
Set title of the visualization window (default: ""). | |
virtual void | SetSize (int width, int height) |
Set window dimensions (default: 1280x720). | |
virtual void | AddCamera (const ChVector3d &pos, const ChVector3d &target) |
Add a camera initially at the specified position and target (look at) point. | |
virtual void | UpdateCamera (const ChVector3d &pos, const ChVector3d &target) |
Set camera position and target (look at) point. | |
virtual void | SetCameraVertical (CameraVerticalDir up) |
Set camera up vector (default: Z). | |
virtual void | SetCameraMoveScale (float scale) |
Set scale for camera movement increments (default: 0.1). More... | |
void | AttachSystem (ChSystem *system) |
Attach a user-provided Chrono system for rendering. More... | |
void | AddProxyBody (std::shared_ptr< ChBody > body) |
Add additional proxy body to supplemental system. More... | |
virtual void | Initialize () |
Initialize the run-time visualization system. More... | |
virtual bool | Render ()=0 |
Render the current state of the Chrono::Gpu system. More... | |
virtual ChVisualSystem * | GetVisualSystem () const =0 |
Return the underlying visualization system. | |
Protected Member Functions | |
ChGpuVisualization (ChSystemGpu *sysGPU) | |
Create a run-time visualization object associated with a given Chrono::Gpu system. More... | |
Protected Attributes | |
ChSystemGpu * | m_systemGPU |
associated Chrono::Gpu system | |
ChSystem * | m_system |
internal Chrono system (holds proxy bodies) | |
ChSystem * | m_user_system |
optional user-provided system | |
std::shared_ptr< ChParticleCloud > | m_particles |
particle cloud proxy for particles | |
Constructor & Destructor Documentation
◆ ChGpuVisualization()
|
protected |
Create a run-time visualization object associated with a given Chrono::Gpu system.
If a supplemental Chrono system is not provided (default), one will be created internally.
Member Function Documentation
◆ AddProxyBody()
void chrono::gpu::ChGpuVisualization::AddProxyBody | ( | std::shared_ptr< ChBody > | body | ) |
Add additional proxy body to supplemental system.
Must be called before Initialize(). The provided body is set fixed to ground and it is the caller's responsibility to update the position of this body before a call to Render().
◆ AttachSystem()
|
inline |
Attach a user-provided Chrono system for rendering.
By default, the GPU run-time visualization renders granular particles. This function can be used to also render the mechanical system interacting with the granular system.
◆ Initialize()
|
virtual |
Initialize the run-time visualization system.
If the Chrono::OpenGL module is not available, this function is no-op.
Reimplemented in chrono::gpu::ChGpuVisualizationGL.
◆ Render()
|
pure virtual |
Render the current state of the Chrono::Gpu system.
This function, typically invoked from within the main simulation loop, can only be called after construction of the Gpu system was completed (i.e., the system was initialized). This funtion querries the positions of all particles in the Gpu system in order to update the positions of the proxy bodies. Returns false if the visualization window was closed. If the Chrono::OpenGL module is not available, this function is no-op.
Implemented in chrono::gpu::ChGpuVisualizationGL.
◆ SetCameraMoveScale()
|
virtual |
Set scale for camera movement increments (default: 0.1).
Must be called before Initialize().
Reimplemented in chrono::gpu::ChGpuVisualizationGL.
The documentation for this class was generated from the following files:
- /builds/uwsbel/chrono/src/chrono_gpu/visualization/ChGpuVisualization.h
- /builds/uwsbel/chrono/src/chrono_gpu/visualization/ChGpuVisualization.cpp