Commit 5f0ab1ab authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen

Merging

parents c184deaf 3bfe86ec
......@@ -116,7 +116,7 @@ ITA_BASE_API void INIFileRequireNonemptyKey(const std::string& sINIFilename,
* | Diese Funktionen lsen Ausnahmen aus falls: |
* | |
* | - die INI-Datei nicht existiert |
* | - der Wert nicht als gewnschter Datentyp interpretierbar ist. | |
* | - der Wert nicht als gewnschter Datentyp interpretierbar ist. |
* | |
* +----------------------------------------------------------------------------------------------+ */
......
......@@ -429,6 +429,12 @@ template< typename T > inline void linspace( std::vector< T >& dest, T a, T b, T
// (Note a and b must be powers of two, otherwise an exception is thrown)
ITA_BASE_API void pow2space( std::vector< int >& dest, const int a, const int b );
// returns the elevation angle (0 = frontal direction) in radians from a polar angle theta (0 = above)
ITA_BASE_API double theta2elevation(const double dThetaRAD);
// returns the polar angle theta (0 = above) in radians from a given elevation angle (0 = frontal direction)
ITA_BASE_API double elevation2theta(const double dElevationRAD);
// Calculates the factorial of an positive integer m
ITA_BASE_API int factorial( const int m );
......@@ -438,11 +444,17 @@ ITA_BASE_API double SHNormalizeConst( const int m, const int n );
//Calculates the Kronecker delta
ITA_BASE_API int SHKronecker( const int m );
// Returns the index of a basefunction with degree m and order n
// Returns the linear index of a basefunction with degree m and order n, linear indexing starts with 0
ITA_BASE_API int SHDegreeOrder2Linear( const int m, const int n );
// Returns degree and order of a basefunctions from a linear index, linear indexing starts with 0
ITA_BASE_API void SHLinear2DegreeOrder(const int iLinear, int &m, int &n);
// Calculates the remax weightings up to a given order
ITA_BASE_API std::vector<double> HOARemaxWeights(int iTruncationOrder);
//Calculates the realvalued Basefunctions of SH for e.g. Ambisonics
ITA_BASE_API std::vector<double> SHRealvaluedBasefunctions( const double elevation, const double azimuth, const int maxOrder );
ITA_BASE_API std::vector<double> SHRealvaluedBasefunctions( const double thetaRAD, const double azimuthRAD, const int maxOrder );
//Calculates the associated legendre polynomials
ITA_BASE_API std::vector<double> SHAssociatedLegendre( const int N, const double mu );
......
......@@ -385,11 +385,10 @@ std::vector< std::string > splitString( const std::string& s, const std::string&
return splitString( s, char( sSeparator[ 0 ] ) );
else
ITA_EXCEPT0( NOT_IMPLEMENTED ); // TODO: Implement for strings
return v;
}
void regexSplitString( const std::string& src, std::vector< std::string >& dest, const std::string& regex, bool bMatchCase ) {
void regexSplitString( const std::string& src, std::vector< std::string >& dest, const std::string& regex, bool bMatchCase )
{
dest.clear();
if( src.empty() ) return;
......@@ -587,7 +586,8 @@ bool ITAConversion::StringToDouble( const std::string& s, double& d ) {
return bValid;
}
bool ITAConversion::StringToIntVec( const std::string& s, std::vector<int>& v, std::string sSeparatorRegex, bool bMatchCase ) {
bool ITAConversion::StringToIntVec( const std::string& s, std::vector<int>& v, std::string sSeparatorRegex, bool bMatchCase )
{
// [fwe 2008-07-09] TODO: Diese Implementierung ist mal eben gebaut und hemdsärmelig! Verbessern!
pcrecpp::RE_Options re_opts;
re_opts.set_multiline( true );
......@@ -598,19 +598,23 @@ bool ITAConversion::StringToIntVec( const std::string& s, std::vector<int>& v, s
std::string part;
v.clear();
while( re.FindAndConsume( &input, &part ) ) {
while( re.FindAndConsume( &input, &part ) )
{
int i;
if( !StringToInt( part, i ) ) {
if( !StringToInt( part, i ) )
{
v.clear();
return false;
}
v.push_back( i );
}
std::string e = re.error();
return true;
}
bool ITAConversion::StringToUIntVec( const std::string& s, std::vector<unsigned int>& v, std::string sSeparatorRegex, bool bMatchCase ) {
bool ITAConversion::StringToUIntVec( const std::string& s, std::vector<unsigned int>& v, std::string sSeparatorRegex, bool bMatchCase )
{
// [fwe 2008-07-09] TODO: Diese Implementierung ist mal eben gebaut und hemdsärmelig! Verbessern!
pcrecpp::RE_Options re_opts;
re_opts.set_multiline( true );
......@@ -621,9 +625,11 @@ bool ITAConversion::StringToUIntVec( const std::string& s, std::vector<unsigned
std::string part;
v.clear();
while( re.FindAndConsume( &input, &part ) ) {
while( re.FindAndConsume( &input, &part ) )
{
unsigned int i;
if( !StringToUInt( part, i ) ) {
if( !StringToUInt( part, i ) )
{
v.clear();
return false;
}
......
......@@ -7,6 +7,15 @@ include( VistaCommon )
vista_use_package( ITABase REQUIRED FIND_DEPENDENCIES )
add_executable( ITAStringUtilsTest ITAStringUtilsTest.cpp )
target_link_libraries( ITAStringUtilsTest ${VISTA_USE_PACKAGE_LIBRARIES} )
vista_configure_app( ITAStringUtilsTest )
vista_install( ITAStringUtilsTest )
vista_create_default_info_file( ITAStringUtilsTest )
set_property( TARGET ITAStringUtilsTest PROPERTY FOLDER "ITACoreLibs/Tests/ITABase" )
add_executable( ITABaseSampleBufferTest ITABaseSampleBufferTest.cpp )
target_link_libraries( ITABaseSampleBufferTest ${VISTA_USE_PACKAGE_LIBRARIES} )
......
#include <ITAStringUtils.h>
#include <iostream>
using namespace std;
int main( int, char** )
{
std::vector< int > v = StringToIntVec( "1,2,3,4" );
for( int n : v )
cout << n << endl;
return 0;
}
......@@ -4,9 +4,11 @@ project( VistaTests )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
vista_use_package( VistaCoreLibs REQUIRED COMPONENTS VistaInterProcComm FIND_DEPENDENCIES )
if( WIN32 AND ITA_VISTA_BUILD_STATIC )
list( APPEND VISTA_USE_PACKAGE_LIBRARIES Ws2_32 Winmm )
endif( )
add_executable( VistaTickerTest VistaTickerTest.cpp )
target_link_libraries( VistaTickerTest ${VISTA_USE_PACKAGE_LIBRARIES} )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment