DGtal
0.6.devel
Main Page
Related Pages
Modules
Namespaces
Data Structures
Examples
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
tests
kernel
testHyperRectDomain-snippet.cpp
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
DGtal::int32_t
rawA[ ] = { 1, 2, 3 ,4};
49
const
DGtal::int32_t
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
}
Generated on Wed Dec 19 2012 19:10:39 for DGtal by
1.8.1.1