Moving material into visualization loop of propagation paths to apply...

Moving material into visualization loop of propagation paths to apply different colors for different types of paths (WIP)
parent f47102b0
......@@ -15,7 +15,7 @@
#include <VistaTools/VistaFileSystemFile.h>
#include <algorithm>
// Typedefs
typedef OpenMesh::PolyMesh_ArrayKernelT<> CITAMesh;
......@@ -398,16 +398,6 @@ bool CModel::Store( const std::string& sSKPFilePath, bool bOverwite/*=true*/ ) c
SU_EXC( SULayerSetName( rPropLayer, sPropLayerName.c_str() ) );
SU_EXC( SUModelAddLayers( rModel, 1, &rPropLayer ) );
SUMaterialRef rMaterial = SU_INVALID;
SU_EXC( SUMaterialCreate( &rMaterial ) );
SUColor oSUColor;
oSUColor.red = SUByte( 255.0f );
oSUColor.green = SUByte( 0.0f );
oSUColor.blue = SUByte( 0.0f );
SU_EXC( SUMaterialSetColor( rMaterial, &oSUColor ) );
SUMaterialSetName( rMaterial, "ITA_Acoustics_DefaultPropagationPath" );
SUModelAddMaterials( rModel, 1, &rMaterial );
std::vector< SUCurveRef > vrCurves( voGeoPropPathsVisualization.size() );
for( size_t n = 0; n < voGeoPropPathsVisualization.size(); n++ )
{
......@@ -415,6 +405,16 @@ bool CModel::Store( const std::string& sSKPFilePath, bool bOverwite/*=true*/ ) c
if( oPath.size() <= 1 )
continue;
SUMaterialRef rMaterial = SU_INVALID;
SU_EXC( SUMaterialCreate( &rMaterial ) );
SUColor oSUColor;
oSUColor.red = SUByte( 255.0f ); // direktschall
oSUColor.green = SUByte( 0.0f ); // reflex, yellow (red+green) = diffr
oSUColor.blue = SUByte( 0.0f ); // late reverb
oSUColor.alpha = SUByte( 255.0f * ( 1.0f - min( (float) oPath.GetLength(), 1000.0f ) / 1000.0f ) ); // @todo get max first, then map from 0 to max length (10% alpha)
SU_EXC( SUMaterialSetColor( rMaterial, &oSUColor ) );
SUModelAddMaterials( rModel, 1, &rMaterial );
std::vector< SUEdgeRef > vrEdges( oPath.size() - 1 );
for( size_t m = 0; m < vrEdges.size(); m++ )
......
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