DGtal  0.9.3
Functions
test3DDomain2DView.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "ConfigTest.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/io/viewers/Viewer3D.h"
Include dependency graph for test3DDomain2DView.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
2013/05/11

Functions for testing class 3DDomain2DView.

This file is part of the DGtal library.

Definition in file test3DDomain2DView.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 46 of file test3DDomain2DView.cpp.

References DGtal::Trace::beginBlock(), DGtal::HyperRectDomain< TSpace >::className(), DGtal::Trace::emphase(), DGtal::Trace::endBlock(), DGtal::Viewer3D< Space, KSpace >::show(), and DGtal::trace.

47 {
48 
49 
50 
51  QApplication application(argc,argv);
52  Viewer3D<> viewer;
53  viewer.setWindowTitle("simpleViewer");
54  viewer.show();
55  trace.beginBlock ( "Testing class 3DDomain2DView" );
56 
57  Z2i::Point p1( 0, 0 );
58  Z2i::Point p2( 10, 15 );
59 
60  Z3i::Point p13D( 0, 0, 0 );
61  Z3i::Point p23D( 10, 15, 0 );
62 
63  Z3i::Point p13Dt( 20, 20, 20 );
64  Z3i::Point p23Dt( 30, 35, 20 );
65 
66  Z3i::Point p13Dtt( 40, 20, 20 );
67  Z3i::Point p23Dtt( 50, 35, 20 );
68 
69  HyperRectDomain<Z2i::Space> dom ( p1,p2 );
70  HyperRectDomain<Z2i::Space> dom2 ( p1,p2 );
71  HyperRectDomain<Z2i::Space> dom3 ( p1,p2 );
72 
73  HyperRectDomain<Z2i::Space> dom4 ( p1,p2 );
74  HyperRectDomain<Z2i::Space> dom5 ( p1,p2 );
75  HyperRectDomain<Z2i::Space> dom6 ( p1,p2 );
76 
77  HyperRectDomain<Z2i::Space> dom7 ( p1,p2 );
78  HyperRectDomain<Z2i::Space> dom8 ( p1,p2 );
79  HyperRectDomain<Z2i::Space> dom9 ( p1,p2 );
80 
81  viewer << p13D << p23D << p13Dt << p23Dt << p13Dtt << p23Dtt;
82  viewer << dom << dom2 << dom3;
83  viewer << SetMode3D( dom4.className(), "Grid" );
84  viewer << dom4 << dom5 << dom6;
85  viewer << SetMode3D( dom4.className(), "Grid" );
86  viewer << dom7 << dom8 << dom9;
87 
88  viewer << Update2DDomainPosition<Space, KSpace>(0, Viewer3D<Space, KSpace>::xDirection, 0, 0, 0);
89  viewer << Update2DDomainPosition<Space, KSpace>(1, Viewer3D<Space, KSpace>::yDirection, 0, 0, 0);
90  viewer << Update2DDomainPosition<Space, KSpace>(2, Viewer3D<Space, KSpace>::zDirection, 0, 0, 0);
91 
92  viewer << Update2DDomainPosition<Space, KSpace>(3, Viewer3D<Space, KSpace>::xDirection, 0, 0, 0);
93  viewer << Update2DDomainPosition<Space, KSpace>(4, Viewer3D<Space, KSpace>::yDirection, 0, 0, 0);
94  viewer << Update2DDomainPosition<Space, KSpace>(5, Viewer3D<Space, KSpace>::zDirection, 0, 0, 0);
95 
96  viewer << Update2DDomainPosition<Space, KSpace>(6, Viewer3D<Space, KSpace>::xDirection, 0, 0, 0);
97  viewer << Update2DDomainPosition<Space, KSpace>(7, Viewer3D<Space, KSpace>::yDirection, 0, 0, 0);
98  viewer << Update2DDomainPosition<Space, KSpace>(8, Viewer3D<Space, KSpace>::zDirection, 0, 0, 0);
99 
100  viewer << DGtal::Translate2DDomain(3, 20, 20 ,20);
101  viewer << DGtal::Translate2DDomain(4, 20, 20 ,20);
102  viewer << DGtal::Translate2DDomain(5, 20, 20 ,20);
103 
104  viewer << DGtal::Translate2DDomain(6, 40, 20 ,20);
105  viewer << DGtal::Translate2DDomain(7, 40, 20 ,20);
106  viewer << DGtal::Translate2DDomain(8, 40, 20 ,20);
107 
108  viewer << Viewer3D<>::updateDisplay;
109 
110  bool res = application.exec();
111  trace.emphase() << ( res ? "Passed." : "Error." ) << endl;
112  trace.endBlock();
113  return res ? 0 : 1;
114 }
void beginBlock(const std::string &keyword="")
Trace trace
Definition: Common.h:137
virtual void show()
Overload QWidget method in order to add a call to updateList() method (to ensure that the lists are w...
Aim: Parallelepidec region of a digital space, model of a &#39;CDomain&#39;.
double endBlock()
std::ostream & emphase()
class to modify the data of an given image and also the possibility to translate it (optional)...
Modifier class in a Display3D stream. Useful to choose your own mode for a given class. Realizes the concept CDrawableWithDisplay3D.