Helios++
Helios software for LiDAR simulations
PyHeliosSimulation Class Reference

#include <PyHeliosSimulation.h>

Collaboration diagram for PyHeliosSimulation:

Public Member Functions

 PyHeliosSimulation (std::string surveyPath, std::string assetsPath="assets/", std::string outputPath="output/", size_t numThreads=0, bool lasOutput=false, bool zipOutput=false)
 Build a PyHeliosSimulation instance. More...
 
bool isStarted ()
 Check if the simulation has been started or not. More...
 
bool isPaused ()
 Check if the simulation has been paused or not. More...
 
bool isStopped ()
 Check if the simulation has been stopped or not. More...
 
bool isFinished ()
 Check if the simulation has finished or not. More...
 
bool isRunning ()
 Check if the simulation is running or not. More...
 
std::string getSurveyPath ()
 Obtain the survey path used by the simulation. More...
 
std::string getAssetsPath ()
 Obtain the path to assets directory used by the simulation. More...
 
SurveygetSurvey ()
 Obtain the survey used by the simulation. More...
 
ScannergetScanner ()
 Obtain the scanner used by the simulation. More...
 
PyPlatformWrappergetPlatform ()
 Obtain the platform used by the simulation. More...
 
PySceneWrappergetScene ()
 
int getNumLegs ()
 Obtain the number of legs. More...
 
LeggetLeg (int index)
 Obtain leg at given index. More...
 
void removeLeg (int index)
 Remove leg at given index. More...
 
LegnewLeg (int index)
 Create a new empty leg. More...
 
size_t getSimFrequency ()
 Obtain simulation frequency. More...
 
size_t getNumThreads ()
 Obtain the number of threads. More...
 
void setNumThreads (size_t numThreads)
 Set the number of threads.
 
void setSimFrequency (size_t simFrequency)
 Set the simulation frequency.
 
void setCallback (PyObject *pyCallback)
 Set the simulation callback to specified python object functor.
 
void clearCallback ()
 Clear simulation callback so it will no longer be invoked.
 
void setLasOutput (double lasOutput)
 
double getLasOutput ()
 
double getZipOutput ()
 
void setZipOutput (bool zipOutput)
 
void start ()
 Start the simulation if possible. Otherwise, PyHeliosException will be thrown.
 
void pause ()
 Pause the simulation if possible. Otherwise, PyHeliosException will be thrown.
 
void stop ()
 Stop the simulation if possible. Otherwise, PyHeliosException will be thrown.
 
void resume ()
 Resume the simulation if possible. Otherwise, PyHeliosException will be thrown.
 
PyHeliosOutputWrapperjoin ()
 Cause caller thread to wait until simulation has finished.
 
void loadSurvey (bool legNoiseDisabled=false, bool rebuildScene=false, bool writeWaveform=false, bool calcEchowidth=false, bool fullWaveNoise=false, bool platformNoiseDisabled=true)
 Load a survey XML file. More...
 
void addRotateFilter (double q0, double q1, double q2, double q3, std::string partId)
 
void addScaleFilter (double scaleFactor, std::string partId)
 
void addTranslateFilter (double x, double y, double z, std::string partId)
 
PyHeliosSimulationcopy ()
 

Public Attributes

bool finalOutput = true
 
bool exportToFile = true
 

Private Attributes

std::shared_ptr< XmlSurveyLoaderxmlreader = nullptr
 
bool started = false
 
bool paused = false
 
bool stopped = false
 
bool finished = false
 
size_t numThreads = 0
 
size_t simFrequency = 0
 
std::string surveyPath = "NULL"
 
std::string assetsPath = "NULL"
 
std::string outputPath = "NULL"
 
std::shared_ptr< Surveysurvey = nullptr
 
std::shared_ptr< SurveyPlaybackplayback = nullptr
 
boost::thread * thread = nullptr
 
std::shared_ptr< PySimulationCycleCallbackcallback = nullptr
 
bool lasOutput = false
 
bool zipOutput = false
 

Detailed Description

Author
Alberto M. Esmoris Pena
Version
1.0

Helios++ simulation wrapped to be used from Python

Constructor & Destructor Documentation

◆ PyHeliosSimulation()

PyHeliosSimulation::PyHeliosSimulation ( std::string  surveyPath,
std::string  assetsPath = "assets/",
std::string  outputPath = "output/",
size_t  numThreads = 0,
bool  lasOutput = false,
bool  zipOutput = false 
)

Build a PyHeliosSimulation instance.

Parameters
[in]surveyPathPath to the survey XML file
[in]assetsPathPath to the assets directory
See also
PyHeliosSimulation::loadSurvey( std::string, std::string, bool, bool)

Member Function Documentation

◆ getAssetsPath()

std::string PyHeliosSimulation::getAssetsPath ( )
inline

Obtain the path to assets directory used by the simulation.

Returns
Path to the assets directory used by the simulation

◆ getLeg()

Leg& PyHeliosSimulation::getLeg ( int  index)
inline

Obtain leg at given index.

Returns
Leg at given index

◆ getNumLegs()

int PyHeliosSimulation::getNumLegs ( )
inline

Obtain the number of legs.

Returns
Number of legs

◆ getNumThreads()

size_t PyHeliosSimulation::getNumThreads ( )
inline

Obtain the number of threads.

Returns
Number of threads

◆ getPlatform()

PyPlatformWrapper* PyHeliosSimulation::getPlatform ( )
inline

Obtain the platform used by the simulation.

Returns
Platform used by the simulation

◆ getScanner()

Scanner& PyHeliosSimulation::getScanner ( )
inline

Obtain the scanner used by the simulation.

Returns
Scanner used by the simulation

◆ getSimFrequency()

size_t PyHeliosSimulation::getSimFrequency ( )
inline

Obtain simulation frequency.

Returns
Simulation frequency

◆ getSurvey()

Survey& PyHeliosSimulation::getSurvey ( )
inline

Obtain the survey used by the simulation.

Returns
Survey used by the simulation

◆ getSurveyPath()

std::string PyHeliosSimulation::getSurveyPath ( )
inline

Obtain the survey path used by the simulation.

Returns
Survey path used by the simulation

◆ isFinished()

bool PyHeliosSimulation::isFinished ( )

Check if the simulation has finished or not.

Returns
True if the simulation has finished, false otherwise

◆ isPaused()

bool PyHeliosSimulation::isPaused ( )
inline

Check if the simulation has been paused or not.

Returns
True if the simulation has been paused, false otherwise

◆ isRunning()

bool PyHeliosSimulation::isRunning ( )

Check if the simulation is running or not.

Returns
True if the simulation is running, false otherwise

◆ isStarted()

bool PyHeliosSimulation::isStarted ( )
inline

Check if the simulation has been started or not.

Returns
True if the simulation has started, false otherwise

◆ isStopped()

bool PyHeliosSimulation::isStopped ( )
inline

Check if the simulation has been stopped or not.

Returns
True if the simulation has been stopped, false otherwise

◆ loadSurvey()

void PyHeliosSimulation::loadSurvey ( bool  legNoiseDisabled = false,
bool  rebuildScene = false,
bool  writeWaveform = false,
bool  calcEchowidth = false,
bool  fullWaveNoise = false,
bool  platformNoiseDisabled = true 
)

Load a survey XML file.

Parameters
[in]legNoiseDisabledTrue to disable leg noise, False to enable it
[in]rebuildSceneTrue to force scene rebuild even when a previous scene has been built, False to allow usage of previously built scene when it is available

◆ newLeg()

Leg & PyHeliosSimulation::newLeg ( int  index)

Create a new empty leg.

Returns
Created empty leg

◆ removeLeg()

void PyHeliosSimulation::removeLeg ( int  index)
inline

Remove leg at given index.

Returns
Leg at given index

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