Loading [MathJax]/extensions/TeX/AMSsymbols.js
DGtal 2.0.0
testViewerQuad.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/io/viewers/PolyscopeViewer.h"
#include "DGtal/io/Color.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/shapes/Shapes.h"
Include dependency graph for testViewerQuad.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/01/03

Functions for testing class PolyscopeViewer.

This file is part of the DGtal library.

Definition in file testViewerQuad.cpp.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 51 of file testViewerQuad.cpp.

52{
53 KSpace k;
54 k.init(Point(2,2,2), Point(4,4,4), true);
55
57 trace.beginBlock ( "Testing class for PolyscopeViewer" );
58
59 Point p1( 0, 0, 0 );
60 Point p2( 0, 1 , 0);
61 Point p3( 1, 1, 0);
62 Point p4(1, 0, 0 );
63 Point p5( 2, 0 , 0);
64 Point p6( 2, 1, 0);
65 RealVector n(1,1,1);
66 RealVector n2(0,1,1);
67
68 // Either is possible
69 viewer.drawQuad(p1, p2, p3, p4);
70 viewer.drawQuad(p4, p5, p6, p3);
71
72 Cell surfel = k.uCell( Point( 2,3,3) );
73 SCell surfel2 = k.sCell( Point( 6,3,3), KSpace::POS);
74 SCell surfel3 = k.sCell( Point( 8,3,3), KSpace::NEG );
75
76 viewer << surfel << surfel2 << surfel3;
77
78 trace.emphase() << "Passed." << endl;
79 trace.endBlock();
80 viewer.show();
81 return 0;
82}
bool init(const Point &lower, const Point &upper, bool isClosed)
Specifies the upper and lower bounds for the maximal cells in this space.
SCell sCell(const SPreCell &c) const
From a signed cell, returns a signed cell lying into this Khalismky space.
Cell uCell(const PreCell &c) const
From an unsigned cell, returns an unsigned cell lying into this Khalismky space.
KhalimskySpaceND< 3, Integer > KSpace
Definition StdDefs.h:146
Space::RealVector RealVector
Definition StdDefs.h:171
Space::Point Point
Definition StdDefs.h:168
KSpace::SCell SCell
Definition StdDefs.h:149
KSpace::Cell Cell
Definition StdDefs.h:148
Trace trace

References DGtal::Display3D< Space, KSpace >::drawQuad(), DGtal::KhalimskySpaceND< dim, TInteger >::init(), DGtal::KhalimskySpaceND< 3, Integer >::NEG, DGtal::KhalimskySpaceND< 3, Integer >::POS, DGtal::KhalimskySpaceND< dim, TInteger >::sCell(), DGtal::PolyscopeViewer< Space, KSpace >::show(), DGtal::trace, and DGtal::KhalimskySpaceND< dim, TInteger >::uCell().