File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/config/TeX-MML-AM_CHTML/MathJax.js
DGtal 2.0.0
viewDualSurface.cpp File Reference
#include <iostream>
#include <algorithm>
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/topology/helpers/Surfaces.h"
#include "ConfigExamples.h"
#include "DGtal/io/viewers/PolyscopeViewer.h"
Include dependency graph for viewDualSurface.cpp:

Go to the source code of this file.

Data Structures

struct  LessThanOnFace< Vector >
struct  ConfigPointPredicate< Vector >

Functions

template<typename Vector>
Vector wedge (const Vector &v1, const Vector &v2)
template<typename Vector>
void naiveConvexHull (std::vector< std::vector< unsigned int > > &indices, const std::vector< Vector > &points, bool left_handed)
double rescale (double x)
template<typename Viewer, typename Vector>
void viewPolygons (Viewer &viewer, const DGtal::Color &color, const std::vector< std::vector< unsigned int > > &indices, const std::vector< Vector > &points)
template<typename Vector>
unsigned int dim (const Vector &z)
template<typename Vector>
unsigned int openDim (const Vector &z)
template<typename Vector>
Vector lower (const Vector &z, unsigned int k)
template<typename Vector>
Vector upper (const Vector &z, unsigned int k)
template<typename Vector>
unsigned int nbLighted (std::map< Vector, bool > &f, const Vector &z)
template<typename Vector>
bool lightBetween (std::map< Vector, bool > &f, const Vector &z)
template<typename Vector>
bool lightMax (std::map< Vector, bool > &f, const Vector &z)
template<typename Vector>
bool lightMinMax (std::map< Vector, bool > &f, const Vector &z)
template<typename Vector>
bool lightMaxMin (std::map< Vector, bool > &f, const Vector &z)
template<typename Vector>
bool lightEpsilon (std::map< Vector, bool > &f, const Vector &z, unsigned int epsilon)
template<typename Vector>
void fillCfg (std::map< Vector, bool > &f, const Vector &z, unsigned int cfg)
template<typename Vector>
void localDualVolume (std::vector< Vector > &points, std::map< Vector, bool > &f, const Vector &z)
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/.

Date
2011/03/25

An example file named viewDualSurface.

This file is part of the DGtal library.

Definition in file viewDualSurface.cpp.

Function Documentation

◆ dim()

template<typename Vector>
unsigned int dim ( const Vector & z)

Definition at line 174 of file viewDualSurface.cpp.

175{
176 unsigned int d = 0;
177 for ( unsigned int i = 0; i < Vector::dimension; ++i )
178 if ( ( z[ i ] % 2 ) == 1 ) ++d;
179 return d;
180}
static const Dimension dimension

References DGtal::PointVector< dim, Integer >::dimension.

◆ fillCfg()

template<typename Vector>
void fillCfg ( std::map< Vector, bool > & f,
const Vector & z,
unsigned int cfg )
Examples
io/viewDualSurface.cpp.

Definition at line 337 of file viewDualSurface.cpp.

340{
341 unsigned int d = dim( z );
342 if ( d == 0 )
343 {
344 f[ z ] = (cfg == 1);
345 //std::cerr << "f[" << z << "] = " << f[ z ] << std::endl;
346 }
347 else
348 {
349 unsigned n = 1 << ( d - 1 );
350 unsigned int cfgLow = 0;
351 unsigned int cfgUp = 0;
352 for ( unsigned int j = 0; j < n; ++j )
353 {
354 cfgLow += ( cfg & 1 ) << j;
355 cfg >>= 1;
356 cfgUp += ( cfg & 1 ) << j;
357 cfg >>= 1;
358 }
359 unsigned int i = openDim( z );
360 fillCfg( f, lower( z, i ), cfgLow );
361 fillCfg( f, upper( z, i ), cfgUp );
362 }
363}
Vector lower(const Vector &z, unsigned int k)
unsigned int openDim(const Vector &z)
void fillCfg(std::map< Vector, bool > &f, const Vector &z, unsigned int cfg)
Vector upper(const Vector &z, unsigned int k)

References dim, fillCfg(), lower(), openDim(), and upper().

Referenced by fillCfg(), and main().

◆ lightBetween()

template<typename Vector>
bool lightBetween ( std::map< Vector, bool > & f,
const Vector & z )
Examples
io/viewDualSurface.cpp.

Definition at line 218 of file viewDualSurface.cpp.

220{
221 unsigned int d = dim( z );
222 if ( d == 0 ) return f[ z ];
223 else if ( d == 1 )
224 {
225 unsigned int i = openDim( z );
226 return f[ lower( z, i ) ] || f[ upper( z, i ) ];
227 }
228 else
229 {
230 Vector v1, v2;
231 for ( unsigned int i = 0; i < Vector::dimension; ++i )
232 {
233 v1[ i ] = ( ( z[ i ] % 2 ) == 1 ) ? z[ i ] - 1 : z[ i ];
234 v2[ i ] = ( ( z[ i ] % 2 ) == 1 ) ? z[ i ] + 1 : z[ i ];
235 }
236 Domain domain( v1, v2 );
237 for ( Domain::ConstIterator it = domain.begin(), itE = domain.end();
238 it != itE; ++it )
239 {
240 if ( *it == z ) break;
241 Point zp = z*2 - *it;
242 // std::cerr << *it << " <--> " << zp << std::endl;
243 if ( lightBetween( f, *it ) && lightBetween( f, zp ) )
244 return true;
245 }
246 return false;
247 }
248
249}
Domain domain
bool lightBetween(std::map< Vector, bool > &f, const Vector &z)

References dim, DGtal::PointVector< dim, Integer >::dimension, domain, lightBetween(), lower(), openDim(), and upper().

Referenced by lightBetween(), and main().

◆ lightEpsilon()

template<typename Vector>
bool lightEpsilon ( std::map< Vector, bool > & f,
const Vector & z,
unsigned int epsilon )
Examples
io/viewDualSurface.cpp.

Definition at line 309 of file viewDualSurface.cpp.

312{
313 unsigned int d = dim( z );
314 if ( d == 0 ) return f[ z ];
315 else
316 {
317 Vector tmp( z );
318 bool eps_d = ( ( epsilon >> (d-1)) & 1 ) != 0;
319 bool val = eps_d ? true : false;
320 for ( unsigned i = 0; i < d; ++i )
321 {
322 unsigned int k = openDim( tmp );
323 tmp = lower( tmp, k );
324 if ( eps_d )
325 val = val && ( lightEpsilon( f, lower( z, k ), epsilon )
326 || lightEpsilon( f, upper( z, k ), epsilon ) );
327 else
328 val = val || ( lightEpsilon( f, lower( z, k ), epsilon )
329 && lightEpsilon( f, upper( z, k ), epsilon ) );
330 }
331 return val;
332 }
333}
bool lightEpsilon(std::map< Vector, bool > &f, const Vector &z, unsigned int epsilon)

References dim, lightEpsilon(), lower(), openDim(), and upper().

Referenced by lightEpsilon().

◆ lightMax()

template<typename Vector>
bool lightMax ( std::map< Vector, bool > & f,
const Vector & z )
Examples
io/viewDualSurface.cpp.

Definition at line 253 of file viewDualSurface.cpp.

255{
256 unsigned int d = dim( z );
257 if ( d == 0 ) return f[ z ];
258 else if ( d == 1 )
259 {
260 unsigned int i = openDim( z );
261 return f[ lower( z, i ) ] || f[ upper( z, i ) ];
262 }
263 else // if ( d > 1 )
264 {
265 unsigned int n = nbLighted( f, z );
266 return n >= 2;
267 }
268}
unsigned int nbLighted(std::map< Vector, bool > &f, const Vector &z)

References dim, lower(), nbLighted(), openDim(), and upper().

◆ lightMaxMin()

template<typename Vector>
bool lightMaxMin ( std::map< Vector, bool > & f,
const Vector & z )
Examples
io/viewDualSurface.cpp.

Definition at line 289 of file viewDualSurface.cpp.

291{
292 unsigned int d = dim( z );
293 if ( d == 0 ) return f[ z ];
294 else
295 {
296 Vector tmp( z );
297 bool val = false;
298 for ( unsigned i = 0; i < d; ++i )
299 {
300 unsigned int k = openDim( tmp );
301 tmp = lower( tmp, k );
302 val = val || ( lightMaxMin( f, lower( z, k ) ) && lightMaxMin( f, upper( z, k ) ) );
303 }
304 return val;
305 }
306}
bool lightMaxMin(std::map< Vector, bool > &f, const Vector &z)

References dim, lightMaxMin(), lower(), openDim(), and upper().

Referenced by lightMaxMin().

◆ lightMinMax()

template<typename Vector>
bool lightMinMax ( std::map< Vector, bool > & f,
const Vector & z )
Examples
io/viewDualSurface.cpp.

Definition at line 270 of file viewDualSurface.cpp.

272{
273 unsigned int d = dim( z );
274 if ( d == 0 ) return f[ z ];
275 else
276 {
277 Vector tmp( z );
278 bool val = true;
279 for ( unsigned i = 0; i < d; ++i )
280 {
281 unsigned int k = openDim( tmp );
282 tmp = lower( tmp, k );
283 val = val && ( lightMinMax( f, lower( z, k ) ) || lightMinMax( f, upper( z, k ) ) );
284 }
285 return val;
286 }
287}
bool lightMinMax(std::map< Vector, bool > &f, const Vector &z)

References dim, lightMinMax(), lower(), openDim(), and upper().

Referenced by lightMinMax().

◆ localDualVolume()

template<typename Vector>
void localDualVolume ( std::vector< Vector > & points,
std::map< Vector, bool > & f,
const Vector & z )
Examples
io/viewDualSurface.cpp.

Definition at line 366 of file viewDualSurface.cpp.

369{
370 points.clear();
372 for ( Z3i::Domain::ConstIterator it = domain.begin(), itE = domain.end();
373 it != itE; ++it )
374 {
375 if ( f[ *it ] ) points.push_back( *it );
376 }
377}
static Self diagonal(Component val=1)
HyperRectDomain< Space > Domain
Definition StdDefs.h:172

References DGtal::PointVector< dim, Integer >::diagonal(), and domain.

Referenced by main().

◆ lower()

template<typename Vector>
Vector lower ( const Vector & z,
unsigned int k )
Examples
geometry/volumes/distance/voronoimap2D.cpp, and io/viewDualSurface.cpp.

Definition at line 190 of file viewDualSurface.cpp.

191{
192 Vector z2( z );
193 --z2[ k ];
194 return z2;
195}

Referenced by DGtal::ExactPredicateLpPowerSeparableMetric< Space, 2 >::binarySearchHidden(), DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::binarySearchHidden(), DGtal::ExactPredicateLpSeparableMetric< TSpace, p, RawValue >::binarySearchHidden(), DGtal::InexactPredicateLpSeparableMetric< TSpace, TValue >::binarySearchHidden(), DGtal::SeparableMetricAdapter< TMetric >::binarySearchHidden(), DGtal::concepts::CDigitalSetArchetype< TDomain >::computeBoundingBox(), DGtal::DigitalSetByAssociativeContainer< Domain, Container >::computeBoundingBox(), DGtal::DigitalSetBySTLSet< Domain, Compare >::computeBoundingBox(), DGtal::DigitalSetBySTLVector< Domain >::computeBoundingBox(), DGtal::DigitalSetFromMap< Image >::computeBoundingBox(), fillCfg(), DGtal::HyperRectDomain_Iterator< Point >::HyperRectDomain_Iterator(), DGtal::HyperRectDomain_subIterator< Point >::HyperRectDomain_subIterator(), DGtal::KhalimskySpaceND< dimAmbient, TInteger >::init(), DGtal::KhalimskySpaceND< dimAmbient, TInteger >::init(), DGtal::KhalimskySpaceND< dimAmbient, TInteger >::init(), DGtal::KhalimskySpaceND< dimAmbient, TInteger >::KhalimskySpaceND(), lightBetween(), lightEpsilon(), lightMax(), lightMaxMin(), lightMinMax(), main(), nbLighted(), DGtal::KhalimskyPreSpaceND< 2, Integer >::sNext(), DGtal::KhalimskySpaceND< dimAmbient, TInteger >::sNext(), DGtal::KhalimskyPreSpaceND< 2, Integer >::uNext(), and DGtal::KhalimskySpaceND< dimAmbient, TInteger >::uNext().

◆ main()

int main ( int argc,
char ** argv )

Definition at line 392 of file viewDualSurface.cpp.

393{
394 typedef KSpace::CellSet CellSet;
395
396 KSpace KS;
397
399 viewer.allowReuseList = true;
400
401 DGtal::Color fillColor( 200, 200, 220, 255 );
402 DGtal::Color surfelColor( 255, 0, 0, 150 );
403 DGtal::Color voxelColor( 150, 150, 0, 150 );
404
405 // Create lists for display:
406 // List will inherit current parameters of viewer
407 viewer << surfelColor;
408 std::string surfels = viewer.newQuadList("Surfels");
409 viewer << voxelColor;
410 std::string polys = viewer.newPolygonList("Polygons");
411
412 std::vector<Vector> pts;
413
414 unsigned int cfg = argc > 1 ? atoi( argv[1] ) : 0;
415 unsigned int cfg2 = argc > 2 ? atoi( argv[2] ) : 255;
416 std::map< Vector, bool > f;
417 for ( unsigned int y = 0; (y < 16) && (cfg <= cfg2); ++y )
418 for ( unsigned int x = 0; (x < 16) && (cfg <= cfg2); ++x, ++cfg )
419 {
420 Vector offset( x*6, y*6, 0 );
421 fillCfg( f, offset + Vector( 1, 1, 1 ), cfg );
422 Domain domain( offset + Vector( 0, 0, 0), offset + Vector( 2, 2, 2 ) );
423 KSpace K;
424 K.init( Vector( 0, 0, 0), Vector( 2, 2, 2 ), true );
425 ConfigPointPredicate<Vector> cpp( f, offset );
426 CellSet aBoundary;
427 Surfaces<KSpace>::uMakeBoundary( aBoundary, K, cpp, Vector( 0, 0, 0), Vector( 1, 1, 1 ) );
428
429 viewer.setCurrentList(surfels);
430 for ( CellSet::const_iterator it = aBoundary.begin(), itE = aBoundary.end();
431 it != itE; ++it )
432 {
433 viewer << surfelColor;
434 viewer << KS.uTranslation( *it, offset/2 );
435 }
436 for ( Domain::ConstIterator it = domain.begin(), itE = domain.end();
437 it != itE; ++it )
438 {
439 // lightEpsilon( f, *it, 5 ); // {1,-1,1}=5 // interesting
440 f[ *it ] = lightBetween( f, *it );
441 }
442
443 viewer << fillColor;
444 std::vector< std::vector< unsigned int > > indices;
445 Domain domain2( offset + Vector( 0, 0, 0), offset + Vector( 1, 1, 1 ) );
446
447 viewer.setCurrentList(polys);
448 for ( Domain::ConstIterator it = domain.begin(), itE = domain.end();
449 it != itE; ++it )
450 {
451 localDualVolume( pts, f, *it );
452 indices.clear();
453 naiveConvexHull( indices, pts, false ); // right_handed
454 viewPolygons( viewer, fillColor, indices, pts );
455 }
456 }
457 viewer.show();
458 return 0;
459}
Structure representing an RGB triple with alpha component.
Definition Color.h:77
Cell uTranslation(const Cell &p, const Vector &vec) const
Add the vector [vec] to [p].
static void uMakeBoundary(CellSet &aBoundary, const KSpace &aKSpace, const PointPredicate &pp, const Point &aLowerBound, const Point &aUpperBound)
KhalimskySpaceND< 3, Integer > KSpace
Definition StdDefs.h:146
Space::Vector Vector
Definition StdDefs.h:169
KSpace K
void naiveConvexHull(std::vector< std::vector< unsigned int > > &indices, const std::vector< Vector > &points, bool left_handed)
void viewPolygons(Viewer &viewer, const DGtal::Color &color, const std::vector< std::vector< unsigned int > > &indices, const std::vector< Vector > &points)
void localDualVolume(std::vector< Vector > &points, std::map< Vector, bool > &f, const Vector &z)

References DGtal::Display3D< Space, KSpace >::allowReuseList, domain, fillCfg(), K, lightBetween(), localDualVolume(), naiveConvexHull(), DGtal::Display3D< Space, KSpace >::newPolygonList(), DGtal::Display3D< Space, KSpace >::newQuadList(), DGtal::Display3D< Space, KSpace >::setCurrentList(), DGtal::PolyscopeViewer< Space, KSpace >::show(), DGtal::Surfaces< TKSpace >::uMakeBoundary(), DGtal::KhalimskySpaceND< dim, TInteger >::uTranslation(), and viewPolygons().

◆ naiveConvexHull()

template<typename Vector>
void naiveConvexHull ( std::vector< std::vector< unsigned int > > & indices,
const std::vector< Vector > & points,
bool left_handed )
Examples
io/viewDualSurface.cpp.

Definition at line 80 of file viewDualSurface.cpp.

83{
84 typedef typename Vector::Component Scalar;
85 // Checks all triplets of points.
86 std::vector< unsigned int > aFace;
87 for ( unsigned int i1 = 0; i1 < points.size(); ++i1 )
88 for ( unsigned int i2 = 0; i2 < points.size(); ++i2 )
89 if ( i1 != i2 )
90 for ( unsigned int i3 = i1 > i2 ? i1+1 : i2+1; i3 < points.size(); ++i3 )
91 {
92 Vector P12 = points[ i2 ] - points[ i1 ];
93 Vector P13 = points[ i3 ] - points[ i1 ];
94 Vector N = wedge( P12, P13 );
95 if ( N == Vector::zero ) continue;
96
97 unsigned int nbBadPos = 0;
98 for ( unsigned int i4 = 0; i4 < points.size(); ++i4 )
99 {
100 Vector P14 = points[ i4 ] - points[ i1 ];
101 Scalar c = N.dot( P14 );
102 if ( c == 0 ) aFace.push_back( i4 );
103 else if ( ( left_handed && ( c > 0 ) )
104 || ( ! left_handed && ( c < 0 ) ) )
105 ++nbBadPos;
106 }
107 if ( nbBadPos == 0 )
108 {
109 LessThanOnFace<Vector> LTOF( N, points[ aFace[ 0 ] ], points );
110 std::sort( ++aFace.begin(), aFace.end(), LTOF );
111 indices.push_back( aFace );
112 }
113 aFace.clear();
114 }
115 // purge faces.
116 for ( unsigned int i = 0; i < indices.size(); ++i )
117 {
118 auto s = indices[ i ].size();
119 for ( unsigned int j = i+1; j < indices.size(); )
120 {
121 if ( indices[ j ].size() == s )
122 {
123 bool equal = true;
124 for ( unsigned int k = 0; equal && ( k < s ); ++k )
125 if ( indices[ i ][ k ] != indices[ j ][ k ] )
126 equal = false;
127 if ( equal )
128 {
129 std::swap( indices[ j ], indices.back() );
130 indices.pop_back();
131 }
132 else
133 ++j;
134 }
135 else ++j;
136 }
137 }
138}
Vector wedge(const Vector &v1, const Vector &v2)

References wedge(), and DGtal::PointVector< dim, Integer >::zero.

Referenced by main().

◆ nbLighted()

template<typename Vector>
unsigned int nbLighted ( std::map< Vector, bool > & f,
const Vector & z )
Examples
io/viewDualSurface.cpp.

Definition at line 205 of file viewDualSurface.cpp.

207{ // z of dim >=2
208 unsigned int d = dim( z );
209 if ( d == 0 ) return f[ z ] ? 1 : 0;
210 unsigned int i = openDim( z );
211 return nbLighted( f, lower( z, i ) )
212 + nbLighted( f, upper( z, i ) );
213}

References dim, lower(), nbLighted(), openDim(), and upper().

Referenced by lightMax(), and nbLighted().

◆ openDim()

template<typename Vector>
unsigned int openDim ( const Vector & z)
Examples
io/viewDualSurface.cpp.

Definition at line 183 of file viewDualSurface.cpp.

184{
185 for ( unsigned int i = 0; i < Vector::dimension; ++i )
186 if ( ( z[ i ] % 2 ) == 1 ) return i;
187 return Vector::dimension;
188}

References DGtal::PointVector< dim, Integer >::dimension.

Referenced by fillCfg(), lightBetween(), lightEpsilon(), lightMax(), lightMaxMin(), lightMinMax(), and nbLighted().

◆ rescale()

double rescale ( double x)
Examples
io/viewDualSurface.cpp.

Definition at line 140 of file viewDualSurface.cpp.

141{
142 return ( x - 1.0 ) * 0.5 + 0.5;
143}

Referenced by viewPolygons().

◆ upper()

template<typename Vector>
Vector upper ( const Vector & z,
unsigned int k )
Examples
geometry/volumes/distance/voronoimap2D.cpp, and io/viewDualSurface.cpp.

Definition at line 197 of file viewDualSurface.cpp.

198{
199 Vector z2( z );
200 ++z2[ k ];
201 return z2;
202}

Referenced by DGtal::ExactPredicateLpPowerSeparableMetric< Space, 2 >::binarySearchHidden(), DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::binarySearchHidden(), DGtal::ExactPredicateLpSeparableMetric< TSpace, p, RawValue >::binarySearchHidden(), DGtal::InexactPredicateLpSeparableMetric< TSpace, TValue >::binarySearchHidden(), DGtal::SeparableMetricAdapter< TMetric >::binarySearchHidden(), DGtal::concepts::CDigitalSetArchetype< TDomain >::computeBoundingBox(), DGtal::DigitalSetByAssociativeContainer< Domain, Container >::computeBoundingBox(), DGtal::DigitalSetBySTLSet< Domain, Compare >::computeBoundingBox(), DGtal::DigitalSetBySTLVector< Domain >::computeBoundingBox(), DGtal::DigitalSetFromMap< Image >::computeBoundingBox(), fillCfg(), DGtal::HyperRectDomain_Iterator< Point >::HyperRectDomain_Iterator(), DGtal::HyperRectDomain_subIterator< Point >::HyperRectDomain_subIterator(), DGtal::KhalimskySpaceND< dimAmbient, TInteger >::init(), DGtal::KhalimskySpaceND< dimAmbient, TInteger >::init(), DGtal::KhalimskySpaceND< dimAmbient, TInteger >::init(), DGtal::KhalimskySpaceND< dimAmbient, TInteger >::KhalimskySpaceND(), lightBetween(), lightEpsilon(), lightMax(), lightMaxMin(), lightMinMax(), main(), nbLighted(), DGtal::KhalimskyPreSpaceND< 2, Integer >::sNext(), DGtal::KhalimskySpaceND< dimAmbient, TInteger >::sNext(), DGtal::KhalimskyPreSpaceND< 2, Integer >::uNext(), and DGtal::KhalimskySpaceND< dimAmbient, TInteger >::uNext().

◆ viewPolygons()

template<typename Viewer, typename Vector>
void viewPolygons ( Viewer & viewer,
const DGtal::Color & color,
const std::vector< std::vector< unsigned int > > & indices,
const std::vector< Vector > & points )
Examples
io/viewDualSurface.cpp.

Definition at line 147 of file viewDualSurface.cpp.

152{
153 typedef typename Viewer::RealPoint RealPoint;
154 std::vector<RealPoint> pts3d;
155
156 for ( unsigned int f = 0; f < indices.size(); ++f )
157 {
158 pts3d.clear();
159 RealPoint P;
160 for ( unsigned int v = 0; v < indices[ f ].size(); ++v )
161 {
162 unsigned int i = indices[ f ][ v ];
163 P[0] = rescale( points[ i ][ 0 ] );
164 P[1] = rescale( points[ i ][ 1 ] );
165 P[2] = rescale( points[ i ][ 2 ] );
166 pts3d.push_back( P );
167 }
168
169 viewer.drawPolygon( pts3d );
170 }
171}
std::string drawPolygon(const std::vector< Vec > &vertices, const std::string &uname="Polygon_{i}")
Draws a polygon.
typename Space::RealPoint RealPoint
Definition Display3D.h:391
Space::RealPoint RealPoint
Definition StdDefs.h:170
double rescale(double x)

References DGtal::Display3D< Space, KSpace >::drawPolygon(), and rescale().

Referenced by main().

◆ wedge()

template<typename Vector>
Vector wedge ( const Vector & v1,
const Vector & v2 )
Examples
io/viewDualSurface.cpp.

Definition at line 54 of file viewDualSurface.cpp.

55{
56 return Vector( v1[ 1 ] * v2[ 2 ] - v1[ 2 ] * v2[ 1 ],
57 v1[ 2 ] * v2[ 0 ] - v1[ 0 ] * v2[ 2 ],
58 v1[ 0 ] * v2[ 1 ] - v1[ 1 ] * v2[ 0 ] );
59}

Referenced by naiveConvexHull(), and LessThanOnFace< Vector >::operator()().