42 #include "DGtal/base/Common.h" 45 #include "DGtal/arithmetic/LatticePolytope2D.h" 46 #include "DGtal/io/boards/Board2D.h" 47 #include "DGtal/shapes/Shapes.h" 48 #include "DGtal/helpers/StdDefs.h" 53 using namespace DGtal;
59 std::cerr <<
"Usage: " << argv[ 0 ] <<
" <a> <b> <c>" << std::endl;
60 std::cerr <<
"\t - Cuts a square by ax+by <= c. Displays everything in files " 61 <<
"lower-integer-convex-hull*.eps" << std::endl;
67 int main(
int argc,
char** argv )
83 cip.push_front(
Point( -10, 10 ) );
84 cip.push_front(
Point( 10, 10 ) );
85 cip.push_front(
Point( 10, -10 ) );
92 board.
saveEPS(
"lower-integer-convex-hull.eps" );
96 int a = atoi( argv[ 1 ] );
97 int b = atoi( argv[ 2 ] );
98 int c = atoi( argv[ 3 ] );
102 HalfSpace hs(
Vector( a, b ), c );
114 board.
saveEPS(
"lower-integer-convex-hull-cut.eps" );
118 std::cout <<
"Number of vertices = " << cip.size() << std::endl;
119 std::cout <<
"Area = " << (((double)cip.twiceArea())/2.0) << std::endl;
120 std::cout <<
"Number of interior points = " << cip.numberInteriorPoints() << std::endl;
121 std::cout <<
"Number of boundary points = " << cip.numberBoundaryPoints() << std::endl;
DigitalSetSelector< Domain, BIG_DS+HIGH_BEL_DS >::Type DigitalSet
void push_front(const Point &K)
const Domain domain(Point(1, 2), Point(6, 5))
Custom style class redefining the pen color and the fill color. You may use Board2D::Color::None for ...
void usage(int, char **argv)
void clear(const DGtal::Color &color=DGtal::Color::None)
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: A half-space specified by a vector N and a constant c. The half-space is the set ...
Modifier class in a Board2D stream. Useful to choose your own mode for a given class. Realizes the concept CDrawableWithBoard2D.
std::string className() const
Aim: Represents a 2D polytope, i.e. a convex polygon, in the two-dimensional digital plane...
int main(int argc, char **argv)
static void makeSetFromPointPredicate(DigitalSet &aSet, const PointPredicate &aPP)
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)...