DGtal 1.4.0
Loading...
Searching...
No Matches
testConvexHull2DReverse.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/MelkmanConvexHull.h"
#include "DGtal/geometry/tools/determinant/InHalfPlaneBySimple3x3Matrix.h"
Include dependency graph for testConvexHull2DReverse.cpp:

Go to the source code of this file.

Typedefs

typedef InHalfPlaneBySimple3x3Matrix< Point, double > Functor
 

Functions

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))
 
ch reverse ()
 
ch add (Point(102.2, 51.0))
 
ch add (Point(102.3, 52.3))
 
ch add (Point(103.3, 52.3))
 
ch add (Point(103.2, 53.4))
 
ch add (Point(104.2, 53.2))
 
ch add (Point(104.0, 54.2))
 
 CAPTURE (thicknessHV)
 
 CAPTURE (thicknessE)
 
 SECTION ("Testing antipodal points of ConvexHull2D")
 
 CAPTURE (thicknessEb)
 
 SECTION ("Testing same antipodal points after hull reversing ")
 

Variables

DGtal::MelkmanConvexHull< Point, Functor > ch
 
Point pHV
 
Point qHV
 
Point sHV
 
Point pE
 
Point qE
 
Point sE
 
const double thicknessHV
 
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/11/07

Functions for testing class ConvexHull2D.

This file is part of the DGtal library.

Definition in file testConvexHull2DReverse.cpp.

Typedef Documentation

◆ Functor

typedef InHalfPlaneBySimple3x3Matrix< Point, double > Functor
Initial value:
{
Aim: Implements basic operations that will be used in Point and Vector classes.
MyPointD Point
Examples
dec/exampleDECSurface.cpp, geometry/tools/determinant/exampleInHalfPlane.cpp, geometry/tools/exampleAlphaShape.cpp, and geometry/tools/exampleConvexHull2D.cpp.

Definition at line 51 of file testConvexHull2DReverse.cpp.

Function Documentation

◆ add() [1/12]

ch add ( Point(100.0, 48.2) )

◆ add() [2/12]

ch add ( Point(100.4, 47.4) )

◆ add() [3/12]

ch add ( Point(101.0, 49.1) )

◆ add() [4/12]

ch add ( Point(101.0, 50.0) )

◆ add() [5/12]

ch add ( Point(101.2, 48.2) )

◆ add() [6/12]

ch add ( Point(102.2, 50.2) )

◆ add() [7/12]

ch add ( Point(102.2, 51.0) )

◆ add() [8/12]

ch add ( Point(102.3, 52.3) )

◆ add() [9/12]

ch add ( Point(103.2, 53.4) )

◆ add() [10/12]

ch add ( Point(103.3, 52.3) )

◆ add() [11/12]

ch add ( Point(104.0, 54.2) )

◆ add() [12/12]

ch add ( Point(104.2, 53.2) )

◆ CAPTURE() [1/3]

CAPTURE ( thicknessE )

◆ CAPTURE() [2/3]

CAPTURE ( thicknessEb )

◆ CAPTURE() [3/3]

◆ reverse()

ch reverse ( )

◆ SECTION() [1/2]

SECTION ( "Testing antipodal points of ConvexHull2D" )

Definition at line 84 of file testConvexHull2DReverse.cpp.

85 {
86 REQUIRE( pHV == Point(101.2, 48.2) );
87 REQUIRE( qHV == Point(104.2, 53.2) );
88 REQUIRE( sHV == Point(102.3, 52.3) );
89 }
REQUIRE(domain.isInside(aPoint))

References pHV, qHV, REQUIRE(), and sHV.

◆ SECTION() [2/2]

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

Definition at line 104 of file testConvexHull2DReverse.cpp.

105 {
106 REQUIRE( pE == Point(101.2, 48.2) );
107 REQUIRE( qE == Point(104.2, 53.2) );
108 REQUIRE( sE == Point(102.3, 52.3) );
109 }

References pE, qE, REQUIRE(), and sE.

Variable Documentation

◆ ch

◆ pE

Point pE

Definition at line 71 of file testConvexHull2DReverse.cpp.

Referenced by SECTION().

◆ pHV

Point pHV

Definition at line 71 of file testConvexHull2DReverse.cpp.

Referenced by SECTION(), and testThicknessDefinitions().

◆ qE

Point qE

Definition at line 71 of file testConvexHull2DReverse.cpp.

Referenced by SECTION().

◆ qHV

Point qHV

Definition at line 71 of file testConvexHull2DReverse.cpp.

Referenced by SECTION(), and testThicknessDefinitions().

◆ sE

Point sE

Definition at line 71 of file testConvexHull2DReverse.cpp.

Referenced by SECTION().

◆ sHV

Point sHV

Definition at line 71 of file testConvexHull2DReverse.cpp.

Referenced by SECTION(), and testThicknessDefinitions().

◆ thicknessE

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

Definition at line 77 of file testConvexHull2DReverse.cpp.

Referenced by testConvexHullCompThickness().

◆ thicknessEb

const double thicknessEb

◆ thicknessHV