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
testDisplayKSCell.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/shapes/Shapes.h"
#include "DGtal/io/viewers/PolyscopeViewer.h"
Include dependency graph for testDisplayKSCell.cpp:

Go to the source code of this file.

Functions

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

Functions for testing class DisplayKSCell.

This file is part of the DGtal library.

Definition in file testDisplayKSCell.cpp.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 55 of file testDisplayKSCell.cpp.

56{
57
58 KSpace K;
59 Point plow(0,0,0);
60 Point pup(3,3,2);
61 Domain domain( plow, pup );
62 K.init( plow, pup, true );
63
65 trace.beginBlock ( "Testing display KSCell in Viewer 3D" );
66 // if the domain is visible can't see the cubes inside
67 // viewer << domain;
68
69
70 // Drawing cell of dimension 3
71 Cell voxelA = K.uCell(Point(1, 1, 1));
72 SCell voxelB = K.sCell(Point(1, 1, 3));
73 viewer << voxelB<< voxelA;//
74
75 // drawing cells of dimension 2
76 SCell surfelA = K.sCell( Point( 2, 1, 3 ) );
77 SCell surfelB = K.sCell( Point( 1, 0, 1 ), false );
78 Cell surfelC = K.uCell( Point( 1, 2, 1 ) );
79 SCell surfelD = K.sCell( Point( 1, 1, 0 ) );
80 Cell surfelE = K.uCell( Point( 1, 1, 2 ) );
81 viewer << surfelA << surfelB << surfelC << surfelD << surfelE;
82
83 Cell linelA = K.uCell(Point(2, 1 ,2));
84 SCell linelB = K.sCell(Point(2, 2 ,1));
85 SCell linelC = K.sCell(Point(1, 2 ,2), false);
86 viewer << linelA << linelB << linelC;
87
88 Cell center = K.uCell(Point(5,5,5));
89 // Testing display of oriented surfels:
90 SCell ssurfelXZ = K.sCell( Point( 5, 6, 5 ), false );
91 SCell ssurfelXY = K.sCell( Point( 5, 5, 6 ), false );
92 SCell ssurfelZY = K.sCell( Point( 6, 5, 5 ), false );
93 viewer<< center;
94
95 SCell ssurfelXZo = K.sCell( Point( 5, 4, 5 ), false );
96 SCell ssurfelXYo = K.sCell( Point( 5, 5, 4 ), false );
97 SCell ssurfelZYo = K.sCell( Point( 4, 5, 5 ), false );
98
99 viewer << ssurfelXZ << ssurfelXY << ssurfelZY;
100 viewer << ssurfelXZo << ssurfelXYo << ssurfelZYo;
101
102 // Testing display oriented pointels
103 Cell pointelA = K.uCell(Point(2, 2, 2));
104 SCell pointelB = K.sCell(Point(4, 4, 4), true);
105 SCell pointelC = K.sCell(Point(6, 4, 4), false);
106 SCell linelAC = K.sCell(Point(5, 4, 4), false);
107 viewer << pointelA << pointelB << pointelC << linelAC;
108
109 trace.emphase() << "Passed." << endl;
110 trace.endBlock();
111 viewer.show();
112 return 0;
113}
KhalimskySpaceND< 3, Integer > KSpace
Definition StdDefs.h:146
Space::Point Point
Definition StdDefs.h:168
KSpace::SCell SCell
Definition StdDefs.h:149
KSpace::Cell Cell
Definition StdDefs.h:148
Point center(const std::vector< Point > &points)
Trace trace
KSpace K
Domain domain

References domain, K, DGtal::PolyscopeViewer< Space, KSpace >::show(), and DGtal::trace.