Refactoring and some unnecessary test changes

parent 0bfbe227
......@@ -38,7 +38,7 @@ int main( int argc, char** argv )
if( idx < 13 + 2 )
cerr << "Could not retrieve supported input formats from OpenMesh" << endl;
string sSupportedImportFiles = s.substr( 13, idx - 2 - 13 );
s = CHalfedgeMeshModel::GetSupportedInputFormats();
s = CHalfedgeMeshModel::GetSupportedOutputFormats();
idx = s.find_first_of( ";;" );
if( idx < 13 + 2 )
cerr << "Could not retrieve supported input formats from OpenMesh" << endl;
......
......@@ -41,7 +41,7 @@ namespace ITAGeoUtils
* Calculates the dot product of all edges with the start-vertex-to-point vector and compares
* them among each other. Only, if all dot products have the same sign, the function will return true.
*/
ITA_GEO_API bool IsPointInPolygon( const VistaVector3D& v3Point, VistaPolygon& oPolygon );
ITA_GEO_API bool IsPointInConvexPolygon( const VistaVector3D& v3Point, VistaPolygon& oPolygon );
//! Returns only true, if a ray casts through given polygon, false otherwise
ITA_GEO_API bool RayPolygonIntersectionTest( const VistaRay& rRay, VistaPolygon& oPolygon, VistaVector3D& v3IntersectionPoint );
......
......@@ -53,7 +53,6 @@ CITAGeoHalfedgeSketchUpReader::~CITAGeoHalfedgeSketchUpReader()
bool CITAGeoHalfedgeSketchUpReader::read( const std::string& sFilePath, OpenMesh::IO::BaseImporter& oBaseImporter, OpenMesh::IO::Options& )
{
SUInitialize();
SUResult sur;
......
......@@ -46,7 +46,7 @@ bool ITAGeoUtils::CalculateDiffractionAperturePoint( const VistaVector3D& v3Star
return ITAGeoUtils::IsDiffractionAperturePointInRange( v3StartVertex, v3EndVertex, v3AperturePoint );
}
bool ITAGeoUtils::IsPointInPolygon( const VistaVector3D& v3Point, VistaPolygon& oPolygon )
bool ITAGeoUtils::IsPointInConvexPolygon( const VistaVector3D& v3Point, VistaPolygon& oPolygon )
{
std::vector< VistaVector3D* > vv3PolyPoints;
oPolygon.GetPolyPoints( vv3PolyPoints );
......@@ -60,8 +60,8 @@ bool ITAGeoUtils::IsPointInPolygon( const VistaVector3D& v3Point, VistaPolygon&
const size_t iNextNextIdx = ( i + 2 ) % vv3PolyPoints.size();
const float fDotProduct1 = ( *vv3PolyPoints[ iNextIdx ] - *vv3PolyPoints[ i ] ).Dot( v3Point - *vv3PolyPoints[ i ] );
const float fDotProduct2 = ( *vv3PolyPoints[ iNextNextIdx ] - *vv3PolyPoints[ iNextIdx ] ).Dot( v3Point - *vv3PolyPoints[ iNextIdx ] );
// @todo jst: use single copysign function call
// Compare signs between pairs
if( std::copysignf( 1.0f, fDotProduct1 ) != std::copysignf( 1.0f, fDotProduct2 ) )
return false;
}
......@@ -88,7 +88,7 @@ bool ITAGeoUtils::RayPolygonIntersectionTest( const VistaRay& rRay, VistaPolygon
if( !oPlane.CalcIntersectionPoint( rRay, v3InteractionPoint ) )
return false;
return IsPointInPolygon( v3InteractionPoint, oPolygon );
return IsPointInConvexPolygon( v3InteractionPoint, oPolygon );
}
void ITAGeoUtils::MirrorPointOverPlane( const VistaVector3D& v3Point, const VistaPlane& oPlane, VistaVector3D& v3MirroredPoint )
......
......@@ -30,9 +30,9 @@ using namespace ITAGeo;
int main( int, char** )
{
std::string sBasePath = "./";
std::string sBasePath = "C:/dev/RAVEN/RavenDistributedComputingInterface/examples/";
string sSuffix = "skp";
std::string sModelName = "SimpleRoom";
std::string sModelName = "simple_room";
VistaFileSystemFile oFile( sBasePath + sModelName + "." + sSuffix );
CMaterialDirectory oMatDir( "." );
......
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