DGtal 2.0.0
Loading...
Searching...
No Matches
viewer3D-10-interaction.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/io/viewers/PolyscopeViewer.h"
Include dependency graph for viewer3D-10-interaction.cpp:

Go to the source code of this file.

Data Structures

struct  MyCallback

Typedefs

typedef PolyscopeViewer< Space, KSpaceMyViewer
typedef MyViewer::Callback Callback

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
Jacques-Olivier Lachaud (jacqu.nosp@m.es-o.nosp@m.livie.nosp@m.r.la.nosp@m.chaud.nosp@m.@uni.nosp@m.v-sav.nosp@m.oie..nosp@m.fr ) Laboratory of Mathematics (CNRS, UMR 5127), University of Savoie, France
Bertrand Kerautret (bertr.nosp@m.and..nosp@m.kerau.nosp@m.tret.nosp@m.@lori.nosp@m.a.fr ) LORIA (CNRS, UMR 7503), University of Lorraine, France
Date
2014/10/12

Simple example of class PolyscopeViewer.

This file is part of the DGtal library.

Definition in file viewer3D-10-interaction.cpp.

Typedef Documentation

◆ Callback

◆ MyViewer

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 81 of file viewer3D-10-interaction.cpp.

82{
83 Point p1( 0, 0, 0 );
84 Point p2( 5, 5 ,5 );
85 Point p3( 2, 3, 4 );
86
87 KSpace K;
88 K.init( p1, p2, true );
89
90 Point v1 = Z3i::Point(10, 10,10);
91 Point v2 = Z3i::Point(9, 9, 9);
92 Point v3 = Z3i::Point(11, 11,11);
93
94 MyViewer viewer( K );
95 viewer.setCallback(new MyCallback);
96 Z3i::SCell surfel1 = K.sCell( Point( 1, 1, 2 ), KSpace::POS );
97 Z3i::SCell surfel2 = K.sCell( Point( 3, 3, 4 ), KSpace::NEG );
98 Z3i::SCell surfel3 = K.sCell( Point( 5, 6, 5 ), KSpace::POS );
99
100 viewer.draw(surfel1, "Surfel 1");
101 viewer.draw(surfel2, "Surfel 2");
102 viewer << Point(0, 0, 1) << Point(1, 1, 2);
103
104 viewer.show();
105 return 0;
106}
KhalimskySpaceND< 3, Integer > KSpace
Definition StdDefs.h:146
Space::Point Point
Definition StdDefs.h:168
KSpace::SCell SCell
Definition StdDefs.h:149
KSpace K
PolyscopeViewer< Space, KSpace > MyViewer

References DGtal::Display3D< Space, KSpace >::draw(), K, DGtal::KhalimskySpaceND< 3, Integer >::NEG, DGtal::KhalimskySpaceND< 3, Integer >::POS, DGtal::PolyscopeViewer< Space, KSpace >::setCallback(), and DGtal::PolyscopeViewer< Space, KSpace >::show().