Adding image source count function

parent 8c36209f
......@@ -101,6 +101,15 @@ namespace ITAGeoUtils
*/
ITA_GEO_API bool RojectPoint( const VistaVector3D& v3VertexStart, const VistaVector3D& v3VertexEnd, const VistaVector3D& v3SourcePlaneNormal, const VistaVector3D& v3TargetPlaneNormal, const VistaVector3D& v3Point, VistaVector3D& v3RojectedPoint );
//! Calculates the number of required images for a given order and face number
/**
* @param[in] iFaceCount Number of faces
* @param[in] iOrder Image order (ZERO = no images)
*
* @return Numer of required images (not necessarily audible)
*/
ITA_GEO_API unsigned long int CalculateNumberOfImages( const int iFaceCount, const int iOrder );
};
#endif // INCLUDE_WATCHER_ITA_GEO_UTILS
......@@ -53,7 +53,7 @@ bool ITAGeoUtils::IsPointInPolygon( const VistaVector3D& v3Point, VistaPolygon&
if( vv3PolyPoints.size() < 3 )
return false;
for( size_t i = 0; i < vv3PolyPoints.size() - 2; i++ )
{
if( vv3PolyPoints[ i ]->Dot( *vv3PolyPoints[ i + 1 ] ) !=
......@@ -75,7 +75,7 @@ bool ITAGeoUtils::RayPolygonIntersectionTest( const VistaRay& rRay, VistaPolygon
{
std::vector< VistaVector3D* > vv3PolyPoints;
oPolygon.GetPolyPoints( vv3PolyPoints );
VistaPlane oPlane;
oPlane.SetOrigin( *vv3PolyPoints[ 0 ] );
oPlane.SetNormVector( oPolygon.GetUpVector() );
......@@ -203,3 +203,14 @@ bool ITAGeoUtils::RojectPoint( const VistaVector3D& v3VertexStart, const VistaVe
return v3NextRotatedPosition;
*/
}
ITA_GEO_API unsigned long int ITAGeoUtils::CalculateNumberOfImages( const int iFaceCount, const int iOrder )
{
if( iOrder <= 0 )
return 0;
if( iOrder == 1 )
return iFaceCount;
return CalculateNumberOfImages( iFaceCount, iOrder - 1 ) + iFaceCount * ( unsigned long int ) std::pow( ( iFaceCount - 1 ), ( iOrder - 1 ) );
}
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