32#include "DGtal/base/Common.h"
33#include "DGtal/helpers/StdDefs.h"
34#include "DGtal/geometry/tools/SphericalAccumulator.h"
35#include "DGtal/io/viewers/Viewer3D.h"
36#include "DGtal/io/boards/Board3D.h"
46bool testSphericalViewer(
int argc,
char **argv)
48 QApplication application(argc,argv);
57 for(
unsigned int i=0; i< 10000; i++)
58 accumulator.addDirection(
Vector (1+10.0*(rand()-RAND_MAX/2)/(
double)RAND_MAX,
59 (1+10.0*(rand()-RAND_MAX/2))/(
double)RAND_MAX,
60 (1+10.0*(rand()-RAND_MAX/2))/(
double)RAND_MAX));
66 viewer << accumulator;
70 board.
saveOBJ(
"testSpherical.obj");
81 viewer << Viewer3D<>::updateDisplay;
82 bool res = application.exec();
83 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
87bool testSphericalViewerInteger(
int argc,
char **argv)
89 QApplication application(argc,argv);
91 trace.
beginBlock (
"Testing Spherical Accumulator Viewer with Integer numbers..." );
98 for(
unsigned int i=0; i< 10000; i++)
99 accumulator.addDirection(
Vector (1+(rand()-RAND_MAX/2),
100 (1+(rand()-RAND_MAX/2)),
101 (1+(rand()-RAND_MAX/2))));
116 viewer << Viewer3D<>::updateDisplay;
117 bool res = application.exec();
118 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
126int main(
int argc,
char** argv )
130 for (
int i = 0; i < argc; ++i )
134 bool res = testSphericalViewer(argc,argv)
135 && testSphericalViewerInteger(argc,argv);
136 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
The class Board3D is a type of Display3D which export the figures in the format OBJ/MTL when calling ...
void saveOBJ(const std::string &filename, const bool isNormalized=false)
Aim: Implements basic operations that will be used in Point and Vector classes.
Aim: implements an accumulator (as histograms for 1D scalars) adapted to spherical point samples.
std::vector< Quantity >::const_iterator ConstIterator
Type to iterate on bin values.
void beginBlock(const std::string &keyword="")
virtual void show()
Overload QWidget method in order to add a call to updateList() method (to ensure that the lists are w...
DGtal is the top-level namespace which contains all DGtal functions and types.
static void draw(Display3D< Space, KSpace > &display, const DGtal::DiscreteExteriorCalculus< dimEmbedded, dimAmbient, TLinearAlgebraBackend, TInteger > &calculus)