Commit 75a06d4c authored by Pascal Palenda's avatar Pascal Palenda
Browse files

Change function naming style - WIP

parent 45fe0ea8
......@@ -117,25 +117,25 @@ int main( int argc, char* argv[] )
cout << "Loading task from file with path '" << sTaskPath << "'" << endl;
LoadTask( oTask, sTaskPath );
if( oTask.oScene.getSourceMap().size() != 1 )
if( oTask.oScene.GetSourceMap().size() != 1 )
{
cerr << "[ERROR] Please provide a single source in task file" << endl;
return 255;
}
if( oTask.oScene.getReceiverMap().size() != 1 )
if( oTask.oScene.GetReceiverMap().size() != 1 )
{
cerr << "[ERROR] Please provide a single receiver in task file, portals are not supported by simulator yet" << endl;
return 255;
}
cout << "Task acknowledged" << endl;
cout << " --- Task scene: " << endl << oTask.oScene.toString() << endl;
cout << " --- Task scene: " << endl << oTask.oScene.ToString() << endl;
auto pRavenSimulator = std::make_shared< CSimulator > ( oTask.eSimulationType, sRPFFile );
cout << "Performing simulation" << endl;
pRavenSimulator->compute( &oTask, &oResult );
pRavenSimulator->Compute( &oTask, &oResult );
cout << "Exporting result to '" << sResultPath << "'" << endl;
if( bNormalize )
......@@ -153,7 +153,7 @@ int main( int argc, char* argv[] )
int c = _getch ( );
if ( c == 'y' )
storeProfilerData ( "SimulationProfile.json" );
StoreProfilerData ( "SimulationProfile.json" );
}
catch( ITAException& err )
{
......@@ -187,7 +187,7 @@ void LoadTask ( CSimulationTask& oTask, const std::string& sPath )
std::string sSimulationType = INIFileReadString ( sPath, "Task", "Simulation", "DS+ER_IS+DD_RT" );
auto eSimulationType = ParseSimulationType ( sSimulationType );
oTask.eSimulationType = eSimulationType;
oTask.oScene.loadFormINI( sPath );
oTask.oScene.LoadFormIni( sPath );
return;
}
......
......@@ -15,7 +15,7 @@ using namespace raven;
struct ResultDump : IResultHandler
{
void postResultReceived ( std::unique_ptr<CSimulationResult> result ) override
void PostResultReceived ( std::unique_ptr<CSimulationResult> result ) override
{
resultVector.push_back ( result.release ( ) );
......@@ -70,14 +70,14 @@ int main ( )
std::ofstream myfile;
myfile.open ( "CompleteTest_Master_Test_Config.json" );
myfile << utils::JSONConfigUtils::writeVistaPropertyListToJSON ( oConfig.store ( ) ).write_formatted ( );
myfile << utils::JSONConfigUtils::WriteVistaPropertyListToJSON ( oConfig.Store ( ) ).write_formatted ( );
myfile.close ( );
auto masterController = std::make_unique<CMasterSimulationController> ( oConfig );
const auto resultHandler = std::make_unique<ResultDump> ( );
masterController->attachResultHandler ( resultHandler.get ( ) );
masterController->AttachResultHandler ( resultHandler.get ( ) );
auto update = std::make_unique<CUpdateScene> ( 1 );
auto source = std::make_unique<C3DObject> (
......@@ -85,10 +85,10 @@ int main ( )
auto receiver = std::make_unique<C3DObject> (
VistaVector3D ( -0.5, 1.5, -0.5 ), VistaQuaternion ( 0, 0, 0, 1 ), C3DObject::Type::receiver, 1 );
update->setSourceReceiverPair ( std::move ( source ),
update->SetSourceReceiverPair ( std::move ( source ),
std::move ( receiver ) );
masterController->postUpdate ( std::move ( update ) );
masterController->PostUpdate ( std::move ( update ) );
// We need to wait a bit for the workers to start working
VistaTimeUtils::Sleep ( 500 );
......@@ -99,7 +99,7 @@ int main ( )
std::ofstream myProfile;
myProfile.open ( "profiler.json" );
myProfile << ::profiler::profilerToJSON ( ).str ( );
myProfile << ::profiler::ProfilerToJson ( ).str ( );
myProfile.close ( );
return 0;
......
......@@ -59,25 +59,25 @@ namespace ITA
/// \brief Get the position of the C3DObject.
/// \return a const ref to the position.
///
const VistaVector3D& getPosition ( ) const;
const VistaVector3D& GetPosition ( ) const;
///
/// \brief Get the orientation of the C3DObject.
/// \return a const ref to the orientation.
///
const VistaQuaternion& getOrientation ( ) const;
const VistaQuaternion& GetOrientation ( ) const;
///
/// \brief Get the ID of the object.
/// \return the ID of the C3DObject.
///
unsigned int getID ( ) const;
unsigned int GetId ( ) const;
///
/// \brief Get the Type of the object.
/// \return the Type of the C3DObject.
///
Type getType ( ) const;
Type GetType ( ) const;
///
/// \brief Compare two C3DObjects, with a given tolerance.
......@@ -88,7 +88,7 @@ namespace ITA
/// \param dTolerance the allowed tolerance.
/// \return true if the given object is the same as this with the given tolerance.
///
bool isEqualTolerance ( const C3DObject& obj, double dTolerance ) const;
bool IsEqualTolerance ( const C3DObject& obj, double dTolerance ) const;
///
/// \brief Serialize the object.
......@@ -147,10 +147,10 @@ namespace ITA
///
inline bool operator==( const C3DObject& lhs, const C3DObject& rhs )
{
return lhs.getType ( ) == rhs.getType ( ) &&
lhs.getID ( ) == rhs.getID ( ) &&
lhs.getPosition ( ) == rhs.getPosition ( ) &&
lhs.getOrientation ( ) == rhs.getOrientation ( );
return lhs.GetType ( ) == rhs.GetType ( ) &&
lhs.GetId ( ) == rhs.GetId ( ) &&
lhs.GetPosition ( ) == rhs.GetPosition ( ) &&
lhs.GetOrientation ( ) == rhs.GetOrientation ( );
}
} // namespace simulation_scheduler
......
......@@ -73,9 +73,9 @@ namespace ITA
bool bInvertCondition = false;
VistaPropertyList store() const override = 0;
VistaPropertyList Store() const override = 0;
void load(const VistaPropertyList& oProperties) override = 0;
void Load(const VistaPropertyList& oProperties) override = 0;
private:
std::string m_sFilterType;
......@@ -87,7 +87,7 @@ namespace ITA
/// \param newUpdate the CUpdateScene to check for audibility.
/// \return true if the change between \p previousState and \p newUpdate is audible, else false.
///
virtual bool changeIsAudible ( const CUpdateScene& previousState, const CUpdateScene& newUpdate ) const = 0;
virtual bool ChangeIsAudible ( const CUpdateScene& previousState, const CUpdateScene& newUpdate ) const = 0;
protected:
///
......@@ -97,7 +97,7 @@ namespace ITA
/// \param previousState CUpdateScene of the previous state.
/// \param newUpdate new CUpdateScene.
///
static void checkUpdateTimestamp ( const CUpdateScene& previousState, const CUpdateScene& newUpdate );
static void CheckUpdateTimestamp ( const CUpdateScene& previousState, const CUpdateScene& newUpdate );
};
///
......@@ -120,20 +120,20 @@ namespace ITA
/// \param type name of the filter type to be registered.
/// \param createFunction the corresponding create function.
///
static void registerFilter ( const std::string& type, CreateCallback createFunction );
static void RegisterFilter ( const std::string& type, CreateCallback createFunction );
///
/// \brief Unregister a type of filter from the factory.
/// \param type name of the filter type to be removed.
///
static void unregisterFilter ( const std::string& type );
static void UnregisterFilter ( const std::string& type );
///
/// \brief Factory method.
/// \param pConfig the configuration for the filter.
/// \return a pointer to the created filter.
///
static std::unique_ptr<IAudibilityFilter> createFilter ( const std::shared_ptr<IAudibilityFilter::AudibilityFilterConfig>& pConfig );
static std::unique_ptr<IAudibilityFilter> CreateFilter ( const std::shared_ptr<IAudibilityFilter::AudibilityFilterConfig>& pConfig );
private:
///
......
......@@ -41,9 +41,9 @@ namespace ITA
std::string sStartFilter;
VistaPropertyList store ( ) const override;
VistaPropertyList Store ( ) const override;
void load ( const VistaPropertyList& oProperties ) override;
void Load ( const VistaPropertyList& oProperties ) override;
};
CFilterNetwork ( ) = delete;
......@@ -66,7 +66,7 @@ namespace ITA
/// \param newUpdate the CUpdateScene to check.
/// \return true if the change between \p previousState and \p newUpdate is audible, else false.
///
bool evaluateNetwork ( const CUpdateScene& previousState, const CUpdateScene& newUpdate ) const;
bool EvaluateNetwork ( const CUpdateScene& previousState, const CUpdateScene& newUpdate ) const;
private:
///
......@@ -101,7 +101,7 @@ namespace ITA
/// \param newUpdate the CUpdateScene to check.
/// \return true if the change between \p previousState and \p newUpdate is audible, else false.
///
bool evaluate ( const CUpdateScene& previousState, const CUpdateScene& newUpdate );
bool Evaluate ( const CUpdateScene& previousState, const CUpdateScene& newUpdate );
///
/// \brief Children of the node.
......@@ -135,13 +135,13 @@ namespace ITA
/// \brief Create all the actual filter instances that were configured.
/// \param vpFilterConfigs vector of all filters that should be created.
///
void createFilters ( const std::vector<std::shared_ptr<IAudibilityFilter::AudibilityFilterConfig>>& vpFilterConfigs );
void CreateFilters ( const std::vector<std::shared_ptr<IAudibilityFilter::AudibilityFilterConfig>>& vpFilterConfigs );
///
/// \brief Build the network tree.
/// \param oConfig configuration from which to build the tree.
///
void buildNetwork ( const FilterNetworkConfig& oConfig );
void BuildNetwork ( const FilterNetworkConfig& oConfig );
///
/// \brief Recursive helper method for building the network tree.
......@@ -149,7 +149,7 @@ namespace ITA
/// \param oRoot the root from which to build the tree.
/// \param oRootConfig
///
void networkBuilderHelper ( const std::map<std::string, std::shared_ptr<IAudibilityFilter::AudibilityFilterConfig>>& mConfigMap,
void NetworkBuilderHelper ( const std::map<std::string, std::shared_ptr<IAudibilityFilter::AudibilityFilterConfig>>& mConfigMap,
NetworkTreeNode& oRoot,
const IAudibilityFilter::AudibilityFilterConfig& oRootConfig );
......
......@@ -44,9 +44,9 @@ namespace ITA
double dStrengthFactor = 1.0;
VistaPropertyList store ( ) const override;
VistaPropertyList Store ( ) const override;
void load ( const VistaPropertyList& oProperties ) override;
void Load ( const VistaPropertyList& oProperties ) override;
};
CPerceptiveRotationFilter ( ) = delete;
......@@ -68,19 +68,19 @@ namespace ITA
/// \param newUpdate the CUpdateScene to check for audibility.
/// \return true if the change between \p previousState and \p newUpdate is audible, else false.
///
virtual bool changeIsAudible ( const CUpdateScene& previousState, const CUpdateScene& newUpdate ) const override;
virtual bool ChangeIsAudible ( const CUpdateScene& previousState, const CUpdateScene& newUpdate ) const override;
///
/// \brief Return a unique type identifying string.
/// \return a unique type identifying string.
///
static std::string getType ( );
static std::string GetType ( );
///
/// \brief Factory function for a filter.
/// \remark This function should to be static.
///
static std::unique_ptr<IAudibilityFilter> createFilter ( const std::shared_ptr<IAudibilityFilter::AudibilityFilterConfig>& pConfig );
static std::unique_ptr<IAudibilityFilter> CreateFilter ( const std::shared_ptr<IAudibilityFilter::AudibilityFilterConfig>& pConfig );
private:
///
......@@ -91,7 +91,7 @@ namespace ITA
/// \param elevation elevation angle for the query direction.
/// \return the data point for the given direction
///
static std::pair<double, double> findNearest ( int azimuth, int elevation );
static std::pair<double, double> FindNearest ( int azimuth, int elevation );
///
/// \brief Strength factor
......
......@@ -36,9 +36,9 @@ namespace ITA
double dRate = 1.0;
VistaPropertyList store ( ) const override;
VistaPropertyList Store ( ) const override;
void load ( const VistaPropertyList& oProperties ) override;
void Load ( const VistaPropertyList& oProperties ) override;
};
CRateFilter ( ) = delete;
......@@ -60,19 +60,19 @@ namespace ITA
/// \param newUpdate the CUpdateScene to check for audibility.
/// \return true if the change between \p previousState and \p newUpdate is audible, else false.
///
virtual bool changeIsAudible ( const CUpdateScene& previousState, const CUpdateScene& newUpdate ) const override;
virtual bool ChangeIsAudible ( const CUpdateScene& previousState, const CUpdateScene& newUpdate ) const override;
///
/// \brief Return a unique type identifying string.
/// \return a unique type identifying string.
///
static std::string getType();
static std::string GetType();
///
/// \brief Factory function for a filter.
/// \remark This function should to be static.
///
static std::unique_ptr<IAudibilityFilter> createFilter ( const std::shared_ptr<IAudibilityFilter::AudibilityFilterConfig>& pConfig );
static std::unique_ptr<IAudibilityFilter> CreateFilter ( const std::shared_ptr<IAudibilityFilter::AudibilityFilterConfig>& pConfig );
private:
///
......
......@@ -33,9 +33,9 @@ namespace ITA
double dReverberationRadius = 5.0;
VistaPropertyList store ( ) const override;
VistaPropertyList Store ( ) const override;
void load ( const VistaPropertyList& oProperties ) override;
void Load ( const VistaPropertyList& oProperties ) override;
};
CReverberationRadiusFilter ( ) = delete;
......@@ -57,19 +57,19 @@ namespace ITA
/// \param newUpdate the CUpdateScene to check for audibility.
/// \return true if the change between \p previousState and \p newUpdate is audible, else false.
///
virtual bool changeIsAudible ( const CUpdateScene& previousState, const CUpdateScene& newUpdate ) const override;
virtual bool ChangeIsAudible ( const CUpdateScene& previousState, const CUpdateScene& newUpdate ) const override;
///
/// \brief Return a unique type identifying string.
/// \return a unique type identifying string.
///
static std::string getType ( );
static std::string GetType ( );
///
/// \brief Factory function for a filter.
/// \remark This function should to be static.
///
static std::unique_ptr<IAudibilityFilter> createFilter ( const std::shared_ptr<IAudibilityFilter::AudibilityFilterConfig>& pConfig );
static std::unique_ptr<IAudibilityFilter> CreateFilter ( const std::shared_ptr<IAudibilityFilter::AudibilityFilterConfig>& pConfig );
private:
///
......
......@@ -57,9 +57,9 @@ namespace ITA
RotationModes eMode = RotationModes::absolute;
VistaPropertyList store ( ) const override;
VistaPropertyList Store ( ) const override;
void load ( const VistaPropertyList& oProperties ) override;
void Load ( const VistaPropertyList& oProperties ) override;
};
CRotationFilter ( ) = delete;
......@@ -81,19 +81,19 @@ namespace ITA
/// \param newUpdate the CUpdateScene to check for audibility.
/// \return true if the change between \p previousState and \p newUpdate is audible, else false.
///
virtual bool changeIsAudible ( const CUpdateScene& previousState, const CUpdateScene& newUpdate ) const override;
virtual bool ChangeIsAudible ( const CUpdateScene& previousState, const CUpdateScene& newUpdate ) const override;
///
/// \brief Return a unique type identifying string.
/// \return a unique type identifying string.
///
static std::string getType ( );
static std::string GetType ( );
///
/// \brief Factory function for a filter.
/// \remark This function should to be static.
///
static std::unique_ptr<IAudibilityFilter> createFilter ( const std::shared_ptr<IAudibilityFilter::AudibilityFilterConfig>& pConfig );
static std::unique_ptr<IAudibilityFilter> CreateFilter ( const std::shared_ptr<IAudibilityFilter::AudibilityFilterConfig>& pConfig );
private:
///
......@@ -104,7 +104,7 @@ namespace ITA
/// \param newUpdate the CUpdateScene to check for audibility.
/// \return true if the change between \p previousState and \p newUpdate is audible, else false.
///
bool checkRelativeRotation ( const CUpdateScene& previousState, const CUpdateScene& newUpdate ) const;
bool CheckRelativeRotation ( const CUpdateScene& previousState, const CUpdateScene& newUpdate ) const;
///
/// \brief Check if the absolute rotation of source and receiver exceeds the configured thresholds.
......@@ -114,7 +114,7 @@ namespace ITA
/// \param newUpdate the CUpdateScene to check for audibility.
/// \return true if the change between \p previousState and \p newUpdate is audible, else false.
///
bool checkAbsoluteRotation ( const CUpdateScene& previousState, const CUpdateScene& newUpdate ) const;
bool CheckAbsoluteRotation ( const CUpdateScene& previousState, const CUpdateScene& newUpdate ) const;
///
/// \brief The minimum translation, above which the filter deems the update audible.
......
......@@ -44,9 +44,9 @@ namespace ITA
TranslationModes eMode = TranslationModes::absolute;
VistaPropertyList store ( ) const override;
VistaPropertyList Store ( ) const override;
void load ( const VistaPropertyList& oProperties ) override;
void Load ( const VistaPropertyList& oProperties ) override;
};
CTranslationFilter ( ) = delete;
......@@ -69,19 +69,19 @@ namespace ITA
/// \param newUpdate the CUpdateScene to check for audibility.
/// \return true if the change between \p previousState and \p newUpdate is audible, else false.
///
virtual bool changeIsAudible ( const CUpdateScene& previousState, const CUpdateScene& newUpdate ) const override;
virtual bool ChangeIsAudible ( const CUpdateScene& previousState, const CUpdateScene& newUpdate ) const override;
///
/// \brief Return a unique type identifying string.
/// \return a unique type identifying string.
///
static std::string getType ( );
static std::string GetType ( );
///
/// \brief Factory function for a filter.
/// \remark This function should to be static.
///
static std::unique_ptr<IAudibilityFilter> createFilter ( const std::shared_ptr<IAudibilityFilter::AudibilityFilterConfig>& pConfig );
static std::unique_ptr<IAudibilityFilter> CreateFilter ( const std::shared_ptr<IAudibilityFilter::AudibilityFilterConfig>& pConfig );
private:
///
......
......@@ -42,9 +42,9 @@ namespace ITA
/// As such, the definition is represented by a pair of VistaVector3D%s.
std::vector<std::pair<VistaVector3D, VistaVector3D>> vpZones;
VistaPropertyList store ( ) const override;
VistaPropertyList Store ( ) const override;
void load ( const VistaPropertyList& oProperties ) override;
void Load ( const VistaPropertyList& oProperties ) override;
};
CZoneFilter ( ) = delete;
......@@ -62,19 +62,19 @@ namespace ITA
/// \remark \p previousState is not used by this function.
/// \return true, source or receiver of \p newUpdate lie inside any of the defined zones.
///
bool changeIsAudible(const CUpdateScene& previousState, const CUpdateScene& newUpdate) const override;
bool ChangeIsAudible(const CUpdateScene& previousState, const CUpdateScene& newUpdate) const override;
///
/// \brief Return a unique type identifying string.
/// \return a unique type identifying string.
///
static std::string getType ( );
static std::string GetType ( );
///
/// \brief Factory function for CZoneFilter.
/// \remark This function should to be static.
///
static std::unique_ptr<IAudibilityFilter> createFilter ( const std::shared_ptr<IAudibilityFilter::AudibilityFilterConfig>& pConfig );
static std::unique_ptr<IAudibilityFilter> CreateFilter ( const std::shared_ptr<IAudibilityFilter::AudibilityFilterConfig>& pConfig );
private:
///
......
......@@ -21,13 +21,13 @@ namespace ITA
/// \brief Store the config as a VistaPropertyList.
/// \return a VistaPropertyList with the config properties.
///
virtual VistaPropertyList store ( ) const = 0;
virtual VistaPropertyList Store ( ) const = 0;
///
/// \brief Load the config from a VistaPropertyList.
/// \param oProperties a VistaPropertyList fro which to load the config properties.
///
virtual void load ( const VistaPropertyList& oProperties ) = 0;
virtual void Load ( const VistaPropertyList& oProperties ) = 0;
};
} // namespace simulation_scheduler
} // namespace ITA
......
......@@ -65,7 +65,7 @@ namespace ITA
/// \brief Method to clone the object.
/// \return a clone of the object.
///
std::unique_ptr<CSimulationResult> clone ( ) const override;
std::unique_ptr<CSimulationResult> Clone ( ) const override;
};
} // namespace simulation_scheduler
......
......@@ -32,18 +32,18 @@ namespace ITA
///
/// \brief Issue an event with the name \p NAME.
///
#define PROFILER_EVENT_COUNT( NAME) profiler::addEventCount( NAME, __FUNCTION__, __FILE__ );
#define PROFILER_EVENT_COUNT( NAME) profiler::AddEventCount( NAME, __FUNCTION__, __FILE__ );
///
/// \brief Add the value \p VALUE to the profiler under the name \p NAME.
///
#define PROFILER_VALUE( NAME, VALUE) profiler::addValue( NAME, VALUE, __FUNCTION__, __FILE__ );
#define PROFILER_VALUE( NAME, VALUE) profiler::AddValue( NAME, VALUE, __FUNCTION__, __FILE__ );
///
/// \brief Start a section with the name \p NAME.
///
#define PROFILER_SECTION( NAME ) profiler::CSection PROFILER_UNIQUE_SECTION(__LINE__);\
profiler::startSection(PROFILER_UNIQUE_SECTION(__LINE__), NAME, __FUNCTION__, __FILE__ );
profiler::StartSection(PROFILER_UNIQUE_SECTION(__LINE__), NAME, __FUNCTION__, __FILE__ );
///
/// \brief Start a section with the name "Full".
......@@ -53,21 +53,21 @@ namespace ITA
///
/// \brief End the last opened section in this thread.
///
#define PROFILER_END_SECTION() profiler::endSection();
#define PROFILER_END_SECTION() profiler::EndSection();
///
/// \brief Name the current thread.
///
/// Only the first invocation of this has an effect.
///
#define PROFILER_NAME_THREAD( NAME ) profiler::nameThread( NAME );
#define PROFILER_NAME_THREAD( NAME ) profiler::NameThread( NAME );
///
/// \brief Name the current thread "Main".
///
/// Only the first invocation of this has an effect.
///
#define PROFILER_NAME_THREAD_MAIN( ) profiler::nameThread( "Main" );
#define PROFILER_NAME_THREAD_MAIN( ) profiler::NameThread( "Main" );
namespace profiler
{
......@@ -79,7 +79,7 @@ namespace ITA
///
/// This class is used to time a section of code.
/// It does not have to be ended manually, as the destruction of the object will register as the end of the section.
/// However, the section can still be ended manually by calling ::endSection().
/// However, the section can still be ended manually by calling ::EndSection().
///
class ITA_SIMULATION_SCHEDULER_API CSection
{
......@@ -89,17 +89,17 @@ namespace ITA
///
/// \brief Start the timing for the section.
///
void start ( );
void Start ( );
///
/// \brief End the timing for the section.
///
void end ( );