Loading [MathJax]/extensions/TeX/AMSsymbols.js
DGtal 2.0.0
testViewerQuad.cpp
Go to the documentation of this file.
1
16
29
31#include <iostream>
32#include "DGtal/base/Common.h"
33#include "DGtal/io/viewers/PolyscopeViewer.h"
34
35#include "DGtal/io/Color.h"
36#include "DGtal/helpers/StdDefs.h"
37#include "DGtal/shapes/Shapes.h"
39
40using namespace std;
41using namespace DGtal;
42using namespace Z3i;
43
45// Functions for testing class PolyscopeViewer.
47
49// Standard services - public :
50
51int main( int argc, char** argv )
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}
83// //
std::string drawQuad(const RealPoint &a, const RealPoint &b, const RealPoint &c, const RealPoint &d, const std::string &uname="Quad_{i}")
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.
void show() override
Starts the event loop and display of elements.
Z3i this namespace gathers the standard of types for 3D imagery.
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
DGtal is the top-level namespace which contains all DGtal functions and types.
Trace trace
STL namespace.
int main()
Definition testBits.cpp:56