DGtal 1.3.0
Loading...
Searching...
No Matches
Functions
testDigitalTopology.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/kernel/SpaceND.h"
#include "DGtal/topology/MetricAdjacency.h"
#include "DGtal/topology/DigitalTopology.h"

Go to the source code of this file.

Functions

bool testDigitalTopologyZ2 ()
 
int main (int argc, char **argv)
 

Detailed Description

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Author
Jacques-Olivier Lachaud (jacqu.nosp@m.es-o.nosp@m.livie.nosp@m.r.la.nosp@m.chaud.nosp@m.@uni.nosp@m.v-sav.nosp@m.oie..nosp@m.fr ) Laboratory of Mathematics (CNRS, UMR 5807), University of Savoie, France
Date
2010/07/07

Functions for testing class DigitalTopology.

This file is part of the DGtal library.

Definition in file testDigitalTopology.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 75 of file testDigitalTopology.cpp.

76{
77 trace.beginBlock ( "Testing class DigitalTopology" );
78 trace.info() << "Args:";
79 for ( int i = 0; i < argc; ++i )
80 trace.info() << " " << argv[ i ];
81 trace.info() << endl;
82
83 bool res = testDigitalTopologyZ2(); // && ... other tests
84 trace.emphase() << ( res ? "Passed." : "Error." ) << endl;
86 return res ? 0 : 1;
87}
void beginBlock(const std::string &keyword="")
std::ostream & emphase()
std::ostream & info()
double endBlock()
Trace trace
Definition: Common.h:154
bool testDigitalTopologyZ2()

References DGtal::Trace::beginBlock(), DGtal::Trace::emphase(), DGtal::Trace::endBlock(), DGtal::Trace::info(), testDigitalTopologyZ2(), and DGtal::trace.

◆ testDigitalTopologyZ2()

bool testDigitalTopologyZ2 ( )

Example of a test. To be completed.

Definition at line 48 of file testDigitalTopology.cpp.

49{
50 typedef SpaceND< 2 > Zi2;
53 Adj4 adj4;
54 Adj8 adj8;
55
56 trace.beginBlock ( "Testing Digital topology (4,8) in Z2." );
58 DT48 dt( adj4, adj8, JORDAN_DT );
59 trace.info() << dt << std::endl;
60 typedef DT48::ReverseTopology DT84;
61 DT84 opp_dt = dt.reverseTopology();
62 trace.info() << opp_dt << std::endl;
64
65 // should not compile
66 // typedef DigitalTopology< Adj4, bool > DTimpossible;
67 // DTimpossible dti( adj4, true );
68
69 return true;
70}
Aim: Represents a digital topology as a couple of adjacency relations.
Aim: Describes digital adjacencies in digital spaces that are defined with the 1-norm and the infinit...
MetricAdjacency< Space, 1 > Adj4
Definition: StdDefs.h:90
MetricAdjacency< Space, 2 > Adj8
Definition: StdDefs.h:92

References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), DGtal::Trace::info(), DGtal::JORDAN_DT, and DGtal::trace.

Referenced by main().