AGXDynamics  2.31.1.0
agx::GranularReaderWriter Class Reference

Utility class for reading and writing granular body data to .csv, .agx and .aagx files. More...

#include <GranularReaderWriter.h>

Static Public Member Functions

static bool loadFileAGX (const agx::String &filename, agx::Physics::GranularBodyPtrVector &granularBodies, agx::Physics::GranularBodySystem *target, const agx::AffineMatrix4x4 &transform=agx::AffineMatrix4x4())
 Loads all granular bodies in a specified .agx or .aagx file for reading. More...
 
static bool writeFile (const agx::String &filename, const agx::Physics::GranularBodyPtrVector &granularBodies, agx::Physics::GranularBodySystem *source, const agx::AffineMatrix4x4 &transform=agx::AffineMatrix4x4())
 Write specified granular bodies to file with format depending on file extension. More...
 
static bool writeFileAGX (const agx::String &filename, const agx::Physics::GranularBodyPtrVector &granularBodies, agx::Physics::GranularBodySystem *source, const agx::AffineMatrix4x4 &transform=agx::AffineMatrix4x4())
 Write specified granular body data to a .agx or .aagx file. More...
 
static bool writeFileCSV (const agx::String &filename, const agx::Physics::GranularBodyPtrVector &granularBodies, agx::Physics::GranularBodySystem *source, const agx::AffineMatrix4x4 &transform=agx::AffineMatrix4x4())
 Write specified granular body data to a .agx or .aagx file. More...
 

Detailed Description

Utility class for reading and writing granular body data to .csv, .agx and .aagx files.

Definition at line 27 of file GranularReaderWriter.h.

Member Function Documentation

◆ loadFileAGX()

static bool agx::GranularReaderWriter::loadFileAGX ( const agx::String &  filename,
agx::Physics::GranularBodyPtrVector &  granularBodies,
agx::Physics::GranularBodySystem *  target,
const agx::AffineMatrix4x4 &  transform = agx::AffineMatrix4x4() 
)
static

Loads all granular bodies in a specified .agx or .aagx file for reading.

Parameters
filename- The specified name of the file to load granular body data from.
granularBodies- The target granular body vector were loaded granulars will be inserted.
target- The target granular body system the loaded particles should be inserted to.
transform- The offset transform that will be applied to particle position and velocity after loading.
Returns
true if the file was successfully loaded, false otherwise.

◆ writeFile()

static bool agx::GranularReaderWriter::writeFile ( const agx::String &  filename,
const agx::Physics::GranularBodyPtrVector &  granularBodies,
agx::Physics::GranularBodySystem *  source,
const agx::AffineMatrix4x4 &  transform = agx::AffineMatrix4x4() 
)
static

Write specified granular bodies to file with format depending on file extension.

( Supported: .csv, .agx, aagx )

Parameters
filename- The specified name of the file to save granular data to. File ending determines the specified format to save.
granularBodies- A vector of particles that should be stored to file.
source- The source granular body system that contains the specified particles.
transform- The offset transform that will be applied to particle position and velocity before writing.
Returns
true if the granular bodies could be stored to a file, false otherwise.

◆ writeFileAGX()

static bool agx::GranularReaderWriter::writeFileAGX ( const agx::String &  filename,
const agx::Physics::GranularBodyPtrVector &  granularBodies,
agx::Physics::GranularBodySystem *  source,
const agx::AffineMatrix4x4 &  transform = agx::AffineMatrix4x4() 
)
static

Write specified granular body data to a .agx or .aagx file.

Parameters
filename- The specified name of the file to save granular data to. File ending determines the specified format to save.
granularBodies- A vector of particles that should be stored to file.
source- The source granular body system that contains the specified particles.
transform- The offset transform that will be applied to particle position and velocity before writing.
Returns
true if the granular bodies could be stored to an .agx or .aagx file, false otherwise.

◆ writeFileCSV()

static bool agx::GranularReaderWriter::writeFileCSV ( const agx::String &  filename,
const agx::Physics::GranularBodyPtrVector &  granularBodies,
agx::Physics::GranularBodySystem *  source,
const agx::AffineMatrix4x4 &  transform = agx::AffineMatrix4x4() 
)
static

Write specified granular body data to a .agx or .aagx file.

Parameters
filename- The specified name of the file to save granular data to. File ending determines the specified format to save.
granularBodies- A vector of particles that should be stored to file.
source- The source granular body system that contains the specified particles.
transform- The offset transform that will be applied to particle position and velocity before writing.
Returns
true if the granular bodies could be stored to a .csv file, false otherwise.

The documentation for this class was generated from the following file: