Description
BASE class for generators of random ChBody shapes.
#include <ChRandomShapeCreator.h>
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< ChBody > | RandomGenerate (ChCoordsys<> mcoords)=0 |
Function that creates a random ChBody particle each time it is called. More... | |
virtual std::shared_ptr< ChBody > | RandomGenerateAndCallbacks (ChCoordsys<> mcoords) |
This function does RandomGenerate and also executes the the custom callback, if provided. More... | |
void | RegisterAddBodyCallback (std::shared_ptr< 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 | |
std::shared_ptr< AddBodyCallback > | callback_post_creation |
bool | add_collision_shape |
bool | add_visualization_asset |
Member Function Documentation
◆ RandomGenerate()
|
pure virtual |
Function that creates a random ChBody particle each time it is called.
Note: it MUST BE IMPLEMENTED by children classes!
Implemented in chrono::particlefactory::ChRandomShapeCreatorFromFamilies, chrono::particlefactory::ChRandomShapeCreatorShavings, chrono::particlefactory::ChRandomShapeCreatorConvexHulls, chrono::particlefactory::ChRandomShapeCreatorCylinders, chrono::particlefactory::ChRandomShapeCreatorBoxes, and chrono::particlefactory::ChRandomShapeCreatorSpheres.
◆ RandomGenerateAndCallbacks()
|
inlinevirtual |
This function does RandomGenerate and also executes the the custom callback, if provided.
Usually no need to override.
◆ SetAddCollisionShape()
|
inline |
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.
◆ SetAddVisualizationAsset()
|
inline |
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.
The documentation for this class was generated from the following file:
- /builds/uwsbel/chrono/src/chrono/particlefactory/ChRandomShapeCreator.h