Commit 29587918 authored by Armin Erraji's avatar Armin Erraji

Added test for ImageSource test of MeshModelList (wip).

parent f40d4e55
cmake_minimum_required( VERSION 2.8 )
add_subdirectory( "Diffraction")
add_subdirectory( "Reflection")
\ No newline at end of file
cmake_minimum_required( VERSION 2.8 )
project( ITAPropagationPathSimTest )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
vista_use_package( ITABase REQUIRED FIND_DEPENDENCIES )
vista_use_package( ITAPropagationPathSim REQUIRED FIND_DEPENDENCIES )
if( ITA_CORE_LIBS_BUILD_STATIC )
add_definitions( -DITA_BASE_STATIC )
endif( )
if( ITA_GEOMETRICAL_ACOUSTICS_BUILD_STATIC )
add_definitions( -DITA_PROPAGATION_PATH_SIM_STATIC -DITA_GEO_STATIC )
endif( )
add_executable( SimpleMeshModelImageSourceTest SimpleMeshModelImageSourceTest.cpp )
target_link_libraries( SimpleMeshModelImageSourceTest ${VISTA_USE_PACKAGE_LIBRARIES} )
vista_configure_app( SimpleMeshModelImageSourceTest )
vista_install( SimpleMeshModelImageSourceTest )
vista_create_default_info_file( SimpleMeshModelImageSourceTest )
set_property( TARGET SimpleMeshModelImageSourceTest PROPERTY FOLDER "ITAGeometricalAcoustics/Tests/ITAPropagationPathSim/MeshModelDiffraction" )
B໿SketchUp Model೿{18.0.16975}맑蜖軩䇎犚텸洞ÿॹ寴￿ 噃牥楳湯慍ー￾䌉䄀爀挀䌀甀爀瘀攀̀＀￾䌊䄀琀琀爀椀戀甀琀攀＀￾䌓䄀琀琀爀椀戀甀琀攀䌀漀渀琀愀椀渀攀爀＀￾䌏䄀琀琀爀椀戀甀琀攀一愀洀攀搀Ā＀￾䌐䈀愀挀欀最爀漀甀渀搀䤀洀愀最攀਀＀￾䌇䌀愀洀攀爀愀Ԁ＀￾䌊䌀漀洀瀀漀渀攀渀琀଀＀￾䌒䌀漀洀瀀漀渀攀渀琀䈀攀栀愀瘀椀漀爀Ԁ＀￾䌔䌀漀洀瀀漀渀攀渀琀䐀攀昀椀渀椀琀椀漀渀଀＀￾䌒䌀漀洀瀀漀渀攀渀琀䤀渀猀琀愀渀挀攀؀＀￾䌕䌀漀渀猀琀爀甀挀琀椀漀渀䜀攀漀洀攀琀爀礀＀￾䌑䌀漀渀猀琀爀甀挀琀椀漀渀䰀椀渀攀Ā＀￾䌒䌀漀渀猀琀爀甀挀琀椀漀渀倀漀椀渀琀＀￾䌆䌀甀爀瘀攀Ѐ＀￾䌏䐀攀昀椀渀椀琀椀漀渀䰀椀猀琀＀￾䌄䐀椀戀̀＀￾䌊䐀椀洀攀渀猀椀漀渀Ā＀￾䌐䐀椀洀攀渀猀椀漀渀䰀椀渀攀愀爀؀＀￾䌐䐀椀洀攀渀猀椀漀渀刀愀搀椀愀氀Ȁ＀￾䌏䐀椀洀攀渀猀椀漀渀匀琀礀氀攀Ѐ＀￾䌏䐀爀愀眀椀渀最䔀氀攀洀攀渀琀ऀ＀￾䌅䔀搀最攀Ȁ＀￾䌈䔀搀最攀唀猀攀Ā＀￾䌇䔀渀琀椀琀礀Ԁ＀￾䌅䘀愀挀攀̀＀￾䌒䘀愀挀攀吀攀砀琀甀爀攀䌀漀漀爀搀猀Ѐ＀￾䌌䘀漀渀琀䴀愀渀愀最攀爀＀￾䌆䜀爀漀甀瀀Ā＀￾䌆䤀洀愀最攀Ā＀￾䌆䰀愀礀攀爀Ȁ＀￾䌍䰀愀礀攀爀䴀愀渀愀最攀爀Ѐ＀￾䌅䰀漀漀瀀Ā＀￾䌉䴀愀琀攀爀椀愀氀ఀ＀￾䌐䴀愀琀攀爀椀愀氀䴀愀渀愀最攀爀Ѐ＀￾䌉倀愀最攀䰀椀猀琀Ā＀￾䌋倀漀氀礀氀椀渀攀㌀搀＀￾䌍刀攀氀愀琀椀漀渀猀栀椀瀀＀￾䌐刀攀氀愀琀椀漀渀猀栀椀瀀䴀愀瀀＀￾䌑刀攀渀搀攀爀椀渀最伀瀀琀椀漀渀猀─＀￾䌋匀挀栀攀洀愀䘀椀氀攀Ā＀￾䌑匀挀栀攀洀愀䘀椀氀琀攀爀䘀椀氀攀＀￾䌎匀挀栀攀洀愀娀椀瀀䘀椀氀攀Ā＀￾䌍匀攀挀琀椀漀渀倀氀愀渀攀̀＀￾䌋匀栀愀搀漀眀䤀渀昀漀܀＀￾䌇匀欀䘀漀渀琀Ā＀￾䌉匀欀攀琀挀栀䌀匀＀￾䌎匀欀攀琀挀栀唀瀀䴀漀搀攀氀ᰀ＀￾䌍匀欀攀琀挀栀唀瀀倀愀最攀Ā＀￾䌉匀欀瀀匀琀礀氀攀Ā＀￾䌐匀欀瀀匀琀礀氀攀䴀愀渀愀最攀爀Ȁ＀￾䌅吀攀砀琀ऀ＀￾䌊吀攀砀琀匀琀礀氀攀Ԁ＀￾䌈吀攀砀琀甀爀攀؀＀￾䌊吀栀甀洀戀渀愀椀氀Ā＀￾䌇嘀攀爀琀攀砀＀￾䌉嘀椀攀眀倀愀最攀ఀ＀￾䌊圀愀琀攀爀洀愀爀欀Ā＀￾䌑圀愀琀攀爀洀愀爀欀䴀愀渀愀最攀爀Ȁ＀￾䔒渀搀ⴀ伀昀ⴀ嘀攀爀猀椀漀渀ⴀ䴀愀瀀Ā뀀Ȁ＀ϿЀ䌀楄Ѣ鄀 褀乐േᨊ
/*
* ----------------------------------------------------------------
*
* ITA geometrical acoustics
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2018
*
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
* Tests the image (source) model algorithm.
*
*/
#include <ITAStopWatch.h>
#include <ITAStringUtils.h>
#include <ITAPropagationModels/include/ITAPropagationModels/FilterEngine.h>
#include <ITABaseDefinitions.h>
#include <ITAPropagationPathSim/UrbanEngine/UrbanImageSource.h>
#include <ITAGeo/Base.h>
#include <ITAGeo/Utils.h>
#include <ITAGeo/Urban/Model.h>
#include <ITAGeo/SketchUp/Model.h>
#include <ITAGeo/Material/Material.h>
#include <ITAGeo/Material/Manager.h>
#include <cassert>
using namespace std;
using namespace ITAGeo;
using namespace ITAPropagationPathSim;
int main( int iNumInArgs, char* pcInArgs[] )
{
string sSUFolder = "SketchUpFiles/";
string sJsonFolder = "JsonFiles/";
string sInFile = "SimpleUrbanEnvironment";
if( iNumInArgs > 1 )
sInFile = string( pcInArgs[ 1 ] );
CMaterialDirectory oMaterialDir( "./" );
SketchUp::CModel oGeoModel;
ITAGeo::Urban::CModel oUrbanModel;
oUrbanModel.SetMaterialManager( &oMaterialDir );
if (oUrbanModel.Load(sSUFolder + sInFile + ".skp"))
{
cout << "Succesffully loaded '" << sInFile << "'" << endl;
}
else
{
cerr << "Could not load " << sInFile << endl;
return 255;
}
//SketchUp geo model for adding later calculated paths to sketchUp file
oGeoModel.Load(sSUFolder + sInFile + ".skp");
//Set emitter and sensor
auto pEmitter = make_shared<CEmitter>(VistaVector3D(5.1f, 2.2f, 1.7f));
//auto pSensor = make_shared<CSensor>( VistaVector3D( 3.0f, 3.3f, 1.3f ) );
auto pSensor = make_shared< CSensor >(VistaVector3D(-3.0f, -3.3f, 2.3f));
cout << "Emitter: " << pEmitter->vPos << endl;
cout << "Sensor: " << pSensor->vPos << endl;
//Set the mirror image engine for the urban environment
ITAPropagationPathSim::UrbanEngine::MirrorImage::CSource oUrbanEngine(oUrbanModel, Order::ORDER_3);
oUrbanEngine.ConstructImages(pEmitter);
//Set the reflection sound paths
CPropagationPathList oPathListAll, oPathListVisible;
oUrbanEngine.ConstructReflectionPathsOutside(pSensor, oPathListAll);
//Get the visible sound paths
oUrbanModel.FilterVisiblePaths(oPathListAll, oPathListVisible);
//Add paths to SketchUp Visualisation
string layerName = "All_Refl_Paths_Number_Reflection_" + to_string(oPathListAll.GetNumPaths());
for (const auto &oPath : oPathListAll)
{
oGeoModel.AddPropagationPathVisualization(oPath, layerName);
}
layerName = "Visible_Refl_Paths_Number_Reflection_" + to_string(oPathListVisible.GetNumPaths());
for (const auto &oPath : oPathListVisible)
{
oGeoModel.AddPropagationPathVisualization(oPath, layerName);
}
//Add emitter and sensor to visualization
oGeoModel.AddEmitterVisualization(*pEmitter,"Emitter A");
oGeoModel.AddSensorVisualization(*pSensor, "Sensor A");
//Store model
oGeoModel.Store( sSUFolder + "SimpleUrbanImageModelTest_"+ sInFile + ".skp");
oPathListVisible.Store(sJsonFolder + "SimpleUrbanImageModelTest_" + sInFile + ".json");
return 0;
}
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