Example of geometric predicates.
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/kernel/SpaceND.h"
#include "DGtal/kernel/domains/HyperRectDomain.h"
#include "DGtal/geometry/tools/determinant/Simple2x2DetComputer.h"
#include "DGtal/geometry/tools/determinant/SimpleIncremental2x2DetComputer.h"
#include "DGtal/geometry/tools/determinant/AvnaimEtAl2x2DetSignComputer.h"
#include "DGtal/geometry/tools/determinant/Filtered2x2DetComputer.h"
#include "DGtal/geometry/tools/determinant/InHalfPlaneBy2x2DetComputer.h"
#include "DGtal/geometry/tools/determinant/PredicateFromOrientationFunctor2.h"
#include "DGtal/geometry/tools/determinant/InHalfPlaneBySimple3x3Matrix.h"
using namespace std;
bool
{
typedef SpaceND< 2, DGtal::int16_t > DigitalSpace;
typedef HyperRectDomain< DigitalSpace >
Domain;
typedef InHalfPlaneBySimple3x3Matrix<Point, DGtal::int32_t> OrientationFunctor;
OrientationFunctor orientationFunctor;
PredicateFromOrientationFunctor2<OrientationFunctor>
pointPredicate( orientationFunctor );
pointPredicate.init( P, Q );
bool isCCW;
isCCW = pointPredicate( R );
return isCCW;
}
void
{
{
typedef PointVector<2, DGtal::int32_t>
Point;
typedef InHalfPlaneBySimple3x3Matrix<Point, DGtal::int64_t>
Functor;
BOOST_VERIFY(a);
delete a;
}
{
typedef PointVector<2, DGtal::int64_t>
Point;
typedef AvnaimEtAl2x2DetSignComputer<double> DetComputer;
typedef Filtered2x2DetComputer<DetComputer> FDetComputer;
typedef InHalfPlaneBy2x2DetComputer<Point, FDetComputer>
Functor;
BOOST_VERIFY(a);
delete a;
}
{
typedef PointVector<2, DGtal::int64_t>
Point;
typedef AvnaimEtAl2x2DetSignComputer<DGtal::int64_t> DetComputer;
typedef InHalfPlaneBy2x2DetComputer<Point, DetComputer>
Functor;
BOOST_VERIFY( a);
delete a;
}
{
typedef PointVector<2, DGtal::int64_t>
Point;
typedef AvnaimEtAl2x2DetSignComputer<long double> DetComputer;
typedef Filtered2x2DetComputer<DetComputer> FDetComputer;
typedef InHalfPlaneBy2x2DetComputer<Point, FDetComputer>
Functor;
BOOST_VERIFY(a == a);
delete a;
}
#ifdef WITH_BIGINTEGER
{
typedef PointVector<2, DGtal::BigInteger>
Point;
typedef Simple2x2DetComputer<DGtal::BigInteger> DetComputer;
typedef InHalfPlaneBy2x2DetComputer<Point, DetComputer>
Functor;
BOOST_VERIFY( a);
delete a;
}
#endif
}
int main(
int argc,
char** argv )
{
for ( int i = 0; i < argc; ++i )
return 0;
}
void beginBlock(const std::string &keyword="")
DGtal is the top-level namespace which contains all DGtal functions and types.
int main(int argc, char **argv)
InHalfPlaneBySimple3x3Matrix< Point, double > Functor
HyperRectDomain< Space > Domain