DGtal  0.9.3
testHyperRectDomain-snippet.cpp
Go to the documentation of this file.
1 
33 #include <algorithm> //for std::copy()
34 #include <iterator>
35 #include <iostream>
36 #include <DGtal/kernel/SpaceND.h>
37 #include <DGtal/kernel/domains/HyperRectDomain.h>
38 
39 
40 using namespace DGtal;
41 
42 int main()
43 {
44  //We create a digital Space based on 'int' integers and in dimension 4
45  typedef DGtal::SpaceND<4> Space4D;
46  typedef Space4D::Point Point4D;
47 
48  const Space4D::Integer rawA[ ] = { 1, 2, 3 ,4};
49  const Space4D::Integer rawB[ ] = { 4, 4, 5 ,5};
50  Point4D A ( rawA );
51  Point4D B ( rawB );
52 
53  //Domain construction from two points
54  HyperRectDomain<Space4D> myDomain ( A, B );
55 
56  //We just iterate on the Domain points and print out the point coordinates.
57  std::copy ( myDomain.begin(),
58  myDomain.end(),
59  std::ostream_iterator<Point4D> ( std::cout, " " ) );
60 }
const ConstIterator & end() const
Aim: SpaceND is a utility class that defines the fundamental structure of a Digital Space in ND...
Definition: SpaceND.h:95
Aim: Parallelepidec region of a digital space, model of a &#39;CDomain&#39;.
const ConstIterator & begin() const
DGtal is the top-level namespace which contains all DGtal functions and types.
MyPointD Point
Definition: testClone2.cpp:383