chrono::particlefactory::ChRandomShapeCreator Class Referenceabstract

Description

BASE class for generators of random ChBody shapes.

#include <ChRandomShapeCreator.h>

Inheritance diagram for chrono::particlefactory::ChRandomShapeCreator:
Collaboration diagram for chrono::particlefactory::ChRandomShapeCreator:

Classes

class  AddBodyCallback
 Class to be used as a callback interface for some user-defined action to be taken each time a body is generated and added to the system. More...
 

Public Member Functions

virtual std::shared_ptr< ChBodyRandomGenerate (ChCoordsys<> mcoords)=0
 Function that creates a random ChBody particle each time it is called. More...
 
virtual std::shared_ptr< ChBodyRandomGenerateAndCallbacks (ChCoordsys<> mcoords)
 This function does RandomGenerate and also executes the the custom callback, if provided. More...
 
void RegisterAddBodyCallback (AddBodyCallback *callback)
 Set the callback function to execute at each each particle generation.
 
void SetAddCollisionShape (bool addcoll)
 Set if the created particles must include the collision shape(s). More...
 
void SetAddVisualizationAsset (bool addvisual)
 Set if the created particles must include the visualization asset(s). More...
 

Protected Attributes

AddBodyCallbackcallback_post_creation
 
bool add_collision_shape
 
bool add_visualization_asset
 

Member Function Documentation

virtual std::shared_ptr<ChBody> chrono::particlefactory::ChRandomShapeCreator::RandomGenerate ( ChCoordsys<>  mcoords)
pure virtual
virtual std::shared_ptr<ChBody> chrono::particlefactory::ChRandomShapeCreator::RandomGenerateAndCallbacks ( ChCoordsys<>  mcoords)
virtual

This function does RandomGenerate and also executes the the custom callback, if provided.

Usually no need to override.

void chrono::particlefactory::ChRandomShapeCreator::SetAddCollisionShape ( bool  addcoll)

Set if the created particles must include the collision shape(s).

Note that this is ON by default. Switching off will turn off the collision.

void chrono::particlefactory::ChRandomShapeCreator::SetAddVisualizationAsset ( bool  addvisual)

Set if the created particles must include the visualization asset(s).

This is ON by default. Switching off might be more memory efficient for very large simulations that are batch-processed only.