WIP

parent 5647b4a3
......@@ -67,7 +67,7 @@ namespace ITAGeo
VistaVector3D v3InteractionPoint; //!< Point of geometric interaction, has to be further defined by deriving class
std::shared_ptr< IAcousticMaterial > pAcousticMaterial; //!< Acoustic material connection, i.e. absorption coefficient
bool bProtected; //!< Protect this anchor from destruction in DeleteAnchorsAndClear function
bool bProtected; //!< Protect this anchor from destruction in DeleteAnchorsAndClear function @todo might be unnecessary with shared ptr concept
CPropagationAnchor();
CPropagationAnchor( const VistaVector3D& v3Pos );
......@@ -233,14 +233,7 @@ namespace ITAGeo
};
ITA_GEO_API typedef std::vector< CPropagationAnchor* > CPropagationPath; //!< Geometric propagation path
//! Clears and deletes all anchors of path without protection flag enabled
/**
* @note Calls destructor on all anchors - make sure that no double deletion occurs!
*/
ITA_GEO_API void DeleteAnchorsAndClear( CPropagationPath& oDestructiblePath );
ITA_GEO_API typedef std::vector< std::shared_ptr< CPropagationAnchor > > CPropagationPath; //!< Geometric propagation path
}
......@@ -266,7 +259,7 @@ inline std::ostream& operator<<( std::ostream& os, const ITAGeo::CPropagationPat
os << "GeoPropagationPath: " << vPaths.size() << " anchors found" << std::endl;
for( size_t i = 0; i < vPaths.size(); i++ )
{
const ITAGeo::CPropagationAnchor* pAnchor( vPaths[ i ] );
auto pAnchor( vPaths[ i ] );
os << " GeoAnchor #" << std::setw( 3 ) << 1 + i << ": " << pAnchor << std::endl;
}
return os;
......
......@@ -46,12 +46,3 @@ ITAGeo::CPropagationAnchor::~CPropagationAnchor()
{
}
void ITAGeo::DeleteAnchorsAndClear( ITAGeo::CPropagationPath& oDestructiblePath )
{
for( size_t n = 0; n < oDestructiblePath.size(); n++ )
if( !oDestructiblePath[ n ]->bProtected )
delete oDestructiblePath[ n ];
oDestructiblePath.clear();
}
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