DGtal 2.1.0
Loading...
Searching...
No Matches
testPolygon3D.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 testPolygon3D.cpp:

Go to the source code of this file.

Functions

int main ()
 

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 PolyscopeViewer.

This file is part of the DGtal library.

Definition in file testPolygon3D.cpp.

Function Documentation

◆ main()

int main ( void  )

Definition at line 44 of file testPolygon3D.cpp.

45{
46 PolyscopeViewer<> viewer;
47 trace.beginBlock ( "Testing Polygon 3D display in PolyscopeViewer" );
48 std::vector<Z3i::RealPoint> polyg1;
49
50 polyg1.push_back(Z3i::RealPoint(0,0,0));
51 polyg1.push_back(Z3i::RealPoint(0,1,0));
52 polyg1.push_back(Z3i::RealPoint(1,1,0));
53
54 viewer.drawPolygon(polyg1);
55
56 std::vector<Z3i::RealPoint> polyg2;
57
58 polyg2.push_back(Z3i::RealPoint(0,10,0));
59 polyg2.push_back(Z3i::RealPoint(0,11,0));
60 polyg2.push_back(Z3i::RealPoint(11,11,0));
61
62 viewer.drawPolygon(polyg2, "hop");
63
64 trace.emphase() << "Passed." << endl;
66 viewer.show();
67 return 0;
68}
std::string drawPolygon(const std::vector< Vec > &vertices, const std::string &uname="Polygon_{i}")
Draws a polygon.
Aim: Implements basic operations that will be used in Point and Vector classes.
void show() override
Starts the event loop and display of elements.
void beginBlock(const std::string &keyword="")
std::ostream & emphase()
double endBlock()
Trace trace

References DGtal::Trace::beginBlock(), DGtal::Display3D< Space, KSpace >::drawPolygon(), DGtal::Trace::emphase(), DGtal::Trace::endBlock(), DGtal::PolyscopeViewer< Space, KSpace >::show(), and DGtal::trace.