DGtal  0.9.3
Typedefs | Functions | Variables
testConvexHull2DThickness.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "ConfigTest.h"
#include "DGtalCatch.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/geometry/tools/Hull2DHelpers.h"
#include "DGtal/geometry/tools/determinant/InHalfPlaneBySimple3x3Matrix.h"
Include dependency graph for testConvexHull2DThickness.cpp:

Go to the source code of this file.

Typedefs

typedef InHalfPlaneBySimple3x3Matrix< Point, DGtal::int64_tFunctor
 

Functions

ch add (Point(0, 0))
 
ch add (Point(1, 0))
 
ch add (Point(1, 1))
 
 SECTION ("Testing computation of horizontal/vertical thickness of ConvexHull2D")
 
 SECTION ("Testing computation of euclidean thickness of ConvexHull2D")
 
ch add (Point(104.0, 54.2))
 
ch add (Point(104.2, 53.2))
 
ch add (Point(103.2, 53.4))
 
ch add (Point(103.3, 52.3))
 
ch add (Point(102.3, 52.3))
 
ch add (Point(102.2, 51.0))
 
ch add (Point(102.2, 50.2))
 
ch add (Point(101.0, 50.0))
 
ch add (Point(101.0, 49.1))
 
ch add (Point(101.2, 48.2))
 
ch add (Point(100.0, 48.2))
 
ch add (Point(100.4, 47.4))
 
 CAPTURE (thicknessHV)
 
 CAPTURE (thicknessE)
 
 SECTION ("Testing antipodal points of ConvexHull2D")
 
ch reverse ()
 
 CAPTURE (thicknessEb)
 
 SECTION ("Testing same antipodal points after hull reversing ")
 

Variables

DGtal::MelkmanConvexHull< Point, Functorch
 
Point pHV
 
Point qHV
 
Point sHV
 
Point pE
 
Point qE
 
Point sE
 
double thicknessHV
 
double thicknessEucl
 
const double thicknessE
 
const double thicknessEb
 

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
Bertrand Kerautret (kerau.nosp@m.tre@.nosp@m.loria.nosp@m..fr ) LORIA (CNRS, UMR 7503), University of Nancy, France
Date
2015/10/16

Functions for testing class ConvexHull2D-catch.

This file is part of the DGtal library.

Definition in file testConvexHull2DThickness.cpp.

Typedef Documentation

◆ Functor

Initial value:
{
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:141
MyPointD Point
Definition: testClone2.cpp:383

Definition at line 50 of file testConvexHull2DThickness.cpp.

Function Documentation

◆ add() [1/15]

ch add ( Point(0, 0)  )

◆ add() [2/15]

ch add ( Point(1, 0)  )

◆ add() [3/15]

ch add ( Point(1, 1)  )

◆ add() [4/15]

ch add ( Point(104.0, 54.2)  )

◆ add() [5/15]

ch add ( Point(104.2, 53.2)  )

◆ add() [6/15]

ch add ( Point(103.2, 53.4)  )

◆ add() [7/15]

ch add ( Point(103.3, 52.3)  )

◆ add() [8/15]

ch add ( Point(102.3, 52.3)  )

◆ add() [9/15]

ch add ( Point(102.2, 51.0)  )

◆ add() [10/15]

ch add ( Point(102.2, 50.2)  )

◆ add() [11/15]

ch add ( Point(101.0, 50.0)  )

◆ add() [12/15]

ch add ( Point(101.0, 49.1)  )

◆ add() [13/15]

ch add ( Point(101.2, 48.2)  )

◆ add() [14/15]

ch add ( Point(100.0, 48.2)  )

◆ add() [15/15]

ch add ( Point(100.4, 47.4)  )

◆ CAPTURE() [1/3]

CAPTURE ( thicknessHV  )

◆ CAPTURE() [2/3]

CAPTURE ( thicknessE  )

◆ CAPTURE() [3/3]

CAPTURE ( thicknessEb  )

◆ reverse()

ch reverse ( )

◆ SECTION() [1/4]

SECTION ( "Testing computation of horizontal/vertical thickness of ConvexHull2D"  )

Definition at line 69 of file testConvexHull2DThickness.cpp.

References REQUIRE().

Referenced by SECTION().

70  {
71  REQUIRE( thicknessHV == 1.0 );
72  REQUIRE( pHV == Point(0,0) );
73  REQUIRE( qHV==Point(1,0) );
74  REQUIRE( sHV==Point(1,1) );
75  }
REQUIRE(domain.isInside(aPoint))
MyPointD Point
Definition: testClone2.cpp:383
double thicknessHV

◆ SECTION() [2/4]

SECTION ( "Testing computation of euclidean thickness of ConvexHull2D"  )

◆ SECTION() [3/4]

SECTION ( "Testing antipodal points of ConvexHull2D"  )

Definition at line 120 of file testConvexHull2DThickness.cpp.

References REQUIRE(), DGtal::MelkmanConvexHull< TPoint, TOrientationFunctor >::reverse(), and SECTION().

121  {
122  REQUIRE( pHV == Point(101.2, 48.2) );
123  REQUIRE( qHV == Point(104.2, 53.2) );
124  REQUIRE( sHV == Point(102.3, 52.3) );
125  }
REQUIRE(domain.isInside(aPoint))
MyPointD Point
Definition: testClone2.cpp:383

◆ SECTION() [4/4]

SECTION ( "Testing same antipodal points after hull reversing "  )

Definition at line 140 of file testConvexHull2DThickness.cpp.

References REQUIRE().

141  {
142  REQUIRE( pE == Point(101.2, 48.2) );
143  REQUIRE( qE == Point(104.2, 53.2) );
144  REQUIRE( sE == Point(102.3, 52.3) );
145  }
REQUIRE(domain.isInside(aPoint))
MyPointD Point
Definition: testClone2.cpp:383

Variable Documentation

◆ ch

Definition at line 53 of file testConvexHull2DThickness.cpp.

Referenced by SECTION().

◆ pE

Point pE

Definition at line 58 of file testConvexHull2DThickness.cpp.

Referenced by SECTION().

◆ pHV

Point pHV

Definition at line 58 of file testConvexHull2DThickness.cpp.

Referenced by SECTION().

◆ qE

Point qE

Definition at line 58 of file testConvexHull2DThickness.cpp.

Referenced by SECTION().

◆ qHV

Point qHV

Definition at line 58 of file testConvexHull2DThickness.cpp.

Referenced by SECTION().

◆ sE

Point sE

Definition at line 58 of file testConvexHull2DThickness.cpp.

Referenced by SECTION().

◆ sHV

Point sHV

Definition at line 58 of file testConvexHull2DThickness.cpp.

Referenced by SECTION().

◆ thicknessE

const double thicknessE
Initial value:
pE, qE, sE)
DGtal::MelkmanConvexHull< Point, Functor > ch
double computeHullThickness(const ForwardIterator &itb, const ForwardIterator &ite, const ThicknessDefinition &def)
Procedure to compute the convex hull thickness given from different definitions (Horizontal/vertical ...

Definition at line 113 of file testConvexHull2DThickness.cpp.

◆ thicknessEb

const double thicknessEb
Initial value:
pE, qE, sE)
DGtal::MelkmanConvexHull< Point, Functor > ch
double computeHullThickness(const ForwardIterator &itb, const ForwardIterator &ite, const ThicknessDefinition &def)
Procedure to compute the convex hull thickness given from different definitions (Horizontal/vertical ...

Definition at line 134 of file testConvexHull2DThickness.cpp.

◆ thicknessEucl

double thicknessEucl
Initial value:
=
pE, qE, sE)
DGtal::MelkmanConvexHull< Point, Functor > ch
double computeHullThickness(const ForwardIterator &itb, const ForwardIterator &ite, const ThicknessDefinition &def)
Procedure to compute the convex hull thickness given from different definitions (Horizontal/vertical ...

Definition at line 64 of file testConvexHull2DThickness.cpp.

◆ thicknessHV

const double thicknessHV
Initial value:
=
pHV, qHV, sHV)
DGtal::MelkmanConvexHull< Point, Functor > ch
double computeHullThickness(const ForwardIterator &itb, const ForwardIterator &ite, const ThicknessDefinition &def)
Procedure to compute the convex hull thickness given from different definitions (Horizontal/vertical ...

Definition at line 59 of file testConvexHull2DThickness.cpp.