DGtal
0.9.2
Main Page
Related Pages
Modules
Namespaces
Data Structures
Examples
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
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
}
DGtal::SpaceND
Aim: SpaceND is a utility class that defines the fundamental structure of a Digital Space in ND...
Definition:
SpaceND.h:95
DGtal::HyperRectDomain
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
Definition:
HyperRectDomain.h:92
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition:
ClosedIntegerHalfPlane.h:48
Generated on Mon Jun 27 2016 09:38:20 for DGtal by
1.8.10