chrono::fsi::sph::ChFsiVisualizationVSG Class Reference

Description

VSG-based run-time visualization system for SPH-based FSI systems.

Used as a plugin to a Chrono::VSG visualization system. Note that using run-time visualization for an FSI system incurs the penalty of collecting positions of all particles every time the Render() function is invoked.

#include <ChFsiVisualizationVSG.h>

Inheritance diagram for chrono::fsi::sph::ChFsiVisualizationVSG:
Collaboration diagram for chrono::fsi::sph::ChFsiVisualizationVSG:

Classes

class  MarkerVisibilityCallback
 Class to be used as a callback interface for dynamic visibility of SPH particles or BCE markers. More...
 
class  ParticleColorCallback
 Class to be used as a callback interface for dynamic coloring of SPH particles. More...
 

Public Types

enum  RenderMode { POINTS, WIREFRAME, SOLID }
 Rendering mode for particles and mesh objects.
 

Public Member Functions

 ChFsiVisualizationVSG (ChFsiSystemSPH *sysFSI)
 
 ChFsiVisualizationVSG (ChFsiFluidSystemSPH *sysSPH)
 
virtual void OnAttach () override
 Allow this plugin to perform any operations when it is attached to a VSG visual system. More...
 
virtual void OnInitialize () override
 Allow this plugin to perform any pre-initialization operations. More...
 
virtual void OnRender () override
 Allow this plugin to perform any pre-rendering operations. More...
 
void SetColorFluidMarkers (const ChColor &col)
 Set default color for fluid SPH particles (default: [0.10, 0.40, 0.65]).
 
void SetColorBoundaryMarkers (const ChColor &col)
 Set default color for boundary BCE markers (default: [0.65, 0.30, 0.03]).
 
void SetColorRigidBodyMarkers (const ChColor &col)
 Set default color for rigid body BCE markers (default: [0.10, 0.60, 0.30]).
 
void SetColorFlexBodyMarkers (const ChColor &col)
 Set default color for flex body BCE markers (default: [0.40, 0.10, 0.65]).
 
void SetSPHColorCallback (std::shared_ptr< ParticleColorCallback > functor)
 Set a callback for dynamic coloring of SPH particles. More...
 
void SetSPHVisibilityCallback (std::shared_ptr< MarkerVisibilityCallback > functor)
 Set a callback for dynamic visibility of SPH particles. More...
 
void SetBCEVisibilityCallback (std::shared_ptr< MarkerVisibilityCallback > functor)
 Set a callback for dynamic visibility of boundary BCE markers. More...
 
void SetImageOutputDirectory (const std::string &dir)
 Set output directory for saving frame snapshots (default: ".").
 
void SetImageOutput (bool val)
 Enable/disable writing of frame snapshots to file.
 
void EnableFluidMarkers (bool val)
 Enable/disable rendering of fluid SPH particles (default: true).
 
void EnableRigidBodyMarkers (bool val)
 Enable/disable rendering of rigid-body BCE markers (default: true).
 
void EnableFlexBodyMarkers (bool val)
 Enable/disable rendering of flex-body BCE markers (default: true).
 
void EnableBoundaryMarkers (bool val)
 Enable/disable rendering of boundary BCE markers (default: false).
 
void AddProxyBody (std::shared_ptr< ChBody > body)
 Add additional proxy body to supplemental system. More...
 
ChSystemGetSystem () const
 Return the internal Chrono system that holds visualization shapes.
 
- Public Member Functions inherited from chrono::vsg3d::ChVisualSystemVSGPlugin
void AddEventHandler (std::shared_ptr< ChEventHandlerVSG > eh)
 TODO - remove AddEventHandler? A plugin can call the VSG system's AddEventHandler in its OnAttach() function. More...
 
ChVisualSystemVSGGetVisualSystemVSG () const
 Get a reference to the VSG visual system to which the plugin was attached.
 

Friends

class FSIStatsVSG
 

Additional Inherited Members

- Protected Attributes inherited from chrono::vsg3d::ChVisualSystemVSGPlugin
std::vector< std::shared_ptr< ChEventHandlerVSG > > m_evhandler
 list of all additional event handlers
 
ChVisualSystemVSGm_vsys
 associated VSG visual system
 

Member Function Documentation

◆ AddProxyBody()

void chrono::fsi::sph::ChFsiVisualizationVSG::AddProxyBody ( std::shared_ptr< ChBody body)
inline

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().

◆ OnAttach()

void chrono::fsi::sph::ChFsiVisualizationVSG::OnAttach ( )
overridevirtual

Allow this plugin to perform any operations when it is attached to a VSG visual system.

The pointer m_vsys to the associated VSG visual system is set before calling OnAttach.

Reimplemented from chrono::vsg3d::ChVisualSystemVSGPlugin.

◆ OnInitialize()

void chrono::fsi::sph::ChFsiVisualizationVSG::OnInitialize ( )
overridevirtual

Allow this plugin to perform any pre-initialization operations.

This function is called before the initialization of the associated VSG visual system.

Reimplemented from chrono::vsg3d::ChVisualSystemVSGPlugin.

◆ OnRender()

void chrono::fsi::sph::ChFsiVisualizationVSG::OnRender ( )
overridevirtual

Allow this plugin to perform any pre-rendering operations.

This function is called before updating and rendering the associated VSG visual system.

Reimplemented from chrono::vsg3d::ChVisualSystemVSGPlugin.

◆ SetBCEVisibilityCallback()

void chrono::fsi::sph::ChFsiVisualizationVSG::SetBCEVisibilityCallback ( std::shared_ptr< MarkerVisibilityCallback functor)
inline

Set a callback for dynamic visibility of boundary BCE markers.

If none provided, all boundary BCE markers are visible.

◆ SetSPHColorCallback()

void chrono::fsi::sph::ChFsiVisualizationVSG::SetSPHColorCallback ( std::shared_ptr< ParticleColorCallback functor)
inline

Set a callback for dynamic coloring of SPH particles.

If none provided, SPH particles are rendered with a default color.

◆ SetSPHVisibilityCallback()

void chrono::fsi::sph::ChFsiVisualizationVSG::SetSPHVisibilityCallback ( std::shared_ptr< MarkerVisibilityCallback functor)
inline

Set a callback for dynamic visibility of SPH particles.

If none provided, all SPH particles are visible.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_fsi/sph/visualization/ChFsiVisualizationVSG.h
  • /builds/uwsbel/chrono/src/chrono_fsi/sph/visualization/ChFsiVisualizationVSG.cpp