DGtal  1.5.beta
testPolygon3D.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/io/viewers/Viewer3D.h"
#include "DGtal/io/DrawWithDisplay3DModifier.h"
#include "DGtal/io/Color.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/shapes/Shapes.h"
Include dependency graph for testPolygon3D.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
David Coeurjolly
Date
2013/09/06

Functions for testing class Viewer3D.

This file is part of the DGtal library.

Definition in file testPolygon3D.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 45 of file testPolygon3D.cpp.

46 {
47 
48  QApplication application(argc,argv);
49  Viewer3D<> viewer;
50  viewer.setWindowTitle("simpleViewer");
51  viewer.show();
52  trace.beginBlock ( "Testing Polygon 3D display in Viewer3D" );
53  std::vector<Z3i::RealPoint> polyg1;
54 
55  polyg1.push_back(Z3i::RealPoint(0,0,0));
56  polyg1.push_back(Z3i::RealPoint(0,1,0));
57  polyg1.push_back(Z3i::RealPoint(1,1,0));
58 
59  viewer.addPolygon(polyg1);
60 
61  viewer.createNewPolygonList("hop");
62 
63  std::vector<Z3i::RealPoint> polyg2;
64 
65  polyg2.push_back(Z3i::RealPoint(0,10,0));
66  polyg2.push_back(Z3i::RealPoint(0,11,0));
67  polyg2.push_back(Z3i::RealPoint(11,11,0));
68 
69  viewer.addPolygon(polyg2);
70 
71  viewer << Viewer3D<>::updateDisplay;
72 
73  bool res = application.exec();
74  trace.emphase() << ( res ? "Passed." : "Error." ) << endl;
75  trace.endBlock();
76  return res ? 0 : 1;
77 
78 
79 }
void addPolygon(const std::vector< RealPoint > &vertices)
void createNewPolygonList(std::string s="")
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:593
void beginBlock(const std::string &keyword="")
std::ostream & emphase()
double endBlock()
virtual void show()
Overload QWidget method in order to add a call to updateList() method (to ensure that the lists are w...
Trace trace
Definition: Common.h:153

References DGtal::Display3D< Space, KSpace >::addPolygon(), DGtal::Trace::beginBlock(), DGtal::Display3D< Space, KSpace >::createNewPolygonList(), DGtal::Trace::emphase(), DGtal::Trace::endBlock(), DGtal::Viewer3D< TSpace, TKSpace >::show(), and DGtal::trace.