Helios++
Helios software for LiDAR simulations
pyhelios::PyHeliosSimulation Class Reference

#include <PyHeliosSimulation.h>

Collaboration diagram for pyhelios::PyHeliosSimulation:

Public Member Functions

 PyHeliosSimulation (std::string surveyPath, std::string assetsPath="assets/", std::string outputPath="output/", size_t numThreads=0, bool lasOutput=false, bool las10=false, bool zipOutput=false, bool splitByChannel=false, int kdtFactory=4, size_t kdtJobs=0, size_t kdtSAHLossNodes=32, int parallelizationStrategy=1, int chunkSize=32, int warehouseFactor=1)
 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...
 
PyScannerWrappergetScanner ()
 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...
 
PyScanningStripWrappernewScanningStrip (std::string const &stripId)
 Create a new empty scanning strip (with no legs) More...
 
bool assocLegWithScanningStrip (Leg &leg, PyScanningStripWrapper *strip)
 Associate given leg with given strip. More...
 
size_t getCallbackFrequency ()
 Obtain callback frequency. More...
 
size_t getSimFrequency ()
 Obtain simulation frequency. More...
 
size_t getDynSceneStep ()
 Get the step interval for the dynamic scene. Notice this method will throw an exception if the scene is not dynamic.
 
size_t getNumThreads ()
 Obtain the number of threads. More...
 
void setNumThreads (size_t numThreads)
 Set the number of threads.
 
void setCallbackFrequency (size_t const callbackFrequency)
 Set the callback frequency.
 
void setSimFrequency (size_t const simFrequency)
 Set the simulation frequency.
 
void setDynSceneStep (size_t const stepInterval)
 Set the step interval for the dynamic scene. Notice this method will throw an exception if the scene is not dynamic.
 
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.
 
std::string getFixedGpsTimeStart ()
 
void setFixedGpsTimeStart (std::string const fixedGpsTimeStart)
 
bool getLasOutput ()
 
void setLasOutput (double lasOutput_)
 
bool getLas10 ()
 
void setLas10 (double las10_)
 
bool getZipOutput ()
 
void setZipOutput (bool zipOutput_)
 
bool getSplitByChannel ()
 
void setSplitByChannel (bool splitByChannel_)
 
double getLasScale ()
 
void setLasScale (double const lasScale)
 
int getKDTFactory ()
 
void setKDTFactory (int kdtFactory)
 
size_t getKDTJobs ()
 
void setKDTJobs (size_t kdtJobs)
 
size_t getKDTSAHLossNodes ()
 
void setKDTSAHLossNodes (size_t kdtSAHLossNodes)
 
int getParallelizationStrategy ()
 
void setParallelizationStrategy (int parallelizationStrategy)
 
int getChunkSize ()
 
void setChunkSize (int chunkSize)
 
int getWarehouseFactor ()
 
void setWarehouseFactor (int warehouseFactor)
 
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)
 
void buildPulseThreadPool ()
 Build the pulse thread pool to be used by the simulation. More...
 
PyHeliosSimulationcopy ()
 
std::shared_ptr< DynScene_getDynScene ()
 Obtain scene as DynScene if possible.
 

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 callbackFrequency = 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
 
std::string fixedGpsTimeStart = ""
 
bool lasOutput = false
 
bool las10 = false
 
bool zipOutput = false
 
bool splitByChannel = false
 
double lasScale = 0.0001
 
std::shared_ptr< PulseThreadPoolInterfacepulseThreadPool
 
int kdtFactory = 4
 
size_t kdtJobs = 0
 
size_t kdtSAHLossNodes = 32
 
int parallelizationStrategy = 1
 
int chunkSize = 32
 
int warehouseFactor = 1
 

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  las10 = false,
bool  zipOutput = false,
bool  splitByChannel = false,
int  kdtFactory = 4,
size_t  kdtJobs = 0,
size_t  kdtSAHLossNodes = 32,
int  parallelizationStrategy = 1,
int  chunkSize = 32,
int  warehouseFactor = 1 
)

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

◆ assocLegWithScanningStrip()

bool PyHeliosSimulation::assocLegWithScanningStrip ( Leg leg,
PyScanningStripWrapper strip 
)

Associate given leg with given strip.

Parameters
legThe leg to be associated with given strip
stripThe strip to be associated with given leg
Returns
True if the leg was previously associated with a strip, thus it was updated. False if this is the first strip to which the leg is associated.

◆ buildPulseThreadPool()

void PyHeliosSimulation::buildPulseThreadPool ( )

Build the pulse thread pool to be used by the simulation.

See also
PyHeliosSimulation::pulseThreadPool
Simulation

◆ getAssetsPath()

std::string pyhelios::PyHeliosSimulation::getAssetsPath ( )
inline

Obtain the path to assets directory used by the simulation.

Returns
Path to the assets directory used by the simulation

◆ getCallbackFrequency()

size_t pyhelios::PyHeliosSimulation::getCallbackFrequency ( )
inline

Obtain callback frequency.

Returns
Callback frequency

◆ getLeg()

Leg& pyhelios::PyHeliosSimulation::getLeg ( int  index)
inline

Obtain leg at given index.

Returns
Leg at given index

◆ getNumLegs()

int pyhelios::PyHeliosSimulation::getNumLegs ( )
inline

Obtain the number of legs.

Returns
Number of legs

◆ getNumThreads()

size_t pyhelios::PyHeliosSimulation::getNumThreads ( )
inline

Obtain the number of threads.

Returns
Number of threads

◆ getPlatform()

PyPlatformWrapper* pyhelios::PyHeliosSimulation::getPlatform ( )
inline

Obtain the platform used by the simulation.

Returns
Platform used by the simulation

◆ getScanner()

PyScannerWrapper* pyhelios::PyHeliosSimulation::getScanner ( )
inline

Obtain the scanner used by the simulation.

Returns
Scanner used by the simulation

◆ getSimFrequency()

size_t pyhelios::PyHeliosSimulation::getSimFrequency ( )
inline

Obtain simulation frequency.

Returns
Simulation frequenc

◆ getSurvey()

Survey& pyhelios::PyHeliosSimulation::getSurvey ( )
inline

Obtain the survey used by the simulation.

Returns
Survey used by the simulation

◆ getSurveyPath()

std::string pyhelios::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 pyhelios::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 pyhelios::PyHeliosSimulation::isStarted ( )
inline

Check if the simulation has been started or not.

Returns
True if the simulation has started, false otherwise

◆ isStopped()

bool pyhelios::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.

Parameters
indexThe index specifying the position in the survey where the leg will be inserted
Returns
Created empty leg

◆ newScanningStrip()

PyScanningStripWrapper * PyHeliosSimulation::newScanningStrip ( std::string const &  stripId)

Create a new empty scanning strip (with no legs)

Parameters
stripIdThe identifier for the strip
Returns
Created empty scanning strip

◆ removeLeg()

void pyhelios::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: