Geom_orientation.cpp 1.39 KB
Newer Older
Pierre Kraemer's avatar
Pierre Kraemer committed
1 2 3 4 5 6 7 8
#include <iostream>
#include <Geometry/orientation.h>

using namespace CGoGN;

int main()
{
	typedef Geom::Vec3f VEC3;
Sylvain Thery's avatar
Sylvain Thery committed
9 10
	std::cout << "Check Geometry/orientation.h" << std::endl;
	std::cout << "Check Status : PARTIAL" << std::endl;
Pierre Kraemer's avatar
Pierre Kraemer committed
11 12 13 14 15 16 17
	
	// OrientationLine testOrientationLines<VEC3>(const VEC3& a,  const VEC3& b, const VEC3& c, const VEC3& d);
	
	// Orientation3D testOrientation3D<VEC3>(const VEC3& P, const VEC3& A, const VEC3& B, const VEC3& C);
	
	// Orientation3D testOrientation3D<VEC3>(const VEC3& P, const VEC3& N, const VEC3& PP);
	
Sylvain Thery's avatar
Sylvain Thery committed
18
	std::cout << "Check testOrientation2D : Start" << std::endl;
Pierre Kraemer's avatar
Pierre Kraemer committed
19 20 21 22 23
	VEC3 p1(0,0,0);
	VEC3 p2(5,0,0);
	VEC3 p3(5,5,0);
	VEC3 p4(5,10,0);
	if(Geom::testOrientation2D<VEC3>(p3,p2,p1)!= Geom::RIGHT) {
Sylvain Thery's avatar
Sylvain Thery committed
24
		std::cout << "ERROR : testOrientation2D : testRight" << std::endl;
Pierre Kraemer's avatar
Pierre Kraemer committed
25 26 27
	}
	
	if(Geom::testOrientation2D<VEC3>(p1,p2,p3)!= Geom::LEFT) {
Sylvain Thery's avatar
Sylvain Thery committed
28
		std::cout << "ERROR : testOrientation2D : testLeft" << std::endl;
Pierre Kraemer's avatar
Pierre Kraemer committed
29 30 31 32 33 34 35
	}
	
	if(Geom::testOrientation2D<VEC3>(p4,p2,p3)!= Geom::ALIGNED 
		|| Geom::testOrientation2D<VEC3>(p2,p2,p3)!= Geom::ALIGNED
		|| Geom::testOrientation2D<VEC3>(p3,p2,p3)!= Geom::ALIGNED
		|| Geom::testOrientation2D<VEC3>(p2,p2,p2)!= Geom::ALIGNED
		) {
Sylvain Thery's avatar
Sylvain Thery committed
36
		std::cout << "ERROR : testOrientation2D : testAligned" << std::endl;
Pierre Kraemer's avatar
Pierre Kraemer committed
37 38
	}
	
Sylvain Thery's avatar
Sylvain Thery committed
39
	std::cout << "Check testOrientation2D : Done" << std::endl;
Pierre Kraemer's avatar
Pierre Kraemer committed
40 41 42 43

	// bool isTetrahedronWellOriented<VEC3>(const VEC3 points[4], bool CCW = true) ;

	return 0;
Sylvain Thery's avatar
Sylvain Thery committed
44
}