27 #include "WDataCreatorPointsRandom.h"
48 std::uniform_real_distribution< double > unif( -0.5, 0.5 );
49 std::default_random_engine re;
53 for(
size_t pidx = 0; pidx < numPoints; ++pidx )
55 double x = unif( re ) * size.x();
56 double y = unif( re ) * size.y();
57 double z = unif( re ) * size.z();
58 vertices->push_back( origin.x() + x );
59 vertices->push_back( origin.y() + y );
60 vertices->push_back( origin.z() + z );
62 colors->push_back( color.x() );
63 colors->push_back( color.y() );
64 colors->push_back( color.z() );
WDataCreatorPointsRandom()
Default constructor.
virtual void operator()(int seed, WProgress::SPtr progress, const WColor &color, size_t numPoints, const WPosition &origin, const WPosition &size, WDataSetPoints::VertexArray vertices, WDataSetPoints::ColorArray colors)
Create the dataset.
virtual ~WDataCreatorPointsRandom()
Destructor.
Define the interface which is injected into an WObjectNDIP.
std::shared_ptr< std::vector< float > > ColorArray
Colors for each vertex in VertexArray.
std::shared_ptr< std::vector< float > > VertexArray
List of vertex coordinates in term of components of vertices.
This is a base class for everything which has a Name,Description,Icon and Properties (=NDIP).
This only is a 3d double vector.
std::shared_ptr< WProgress > SPtr
Shared pointer on a WProgress.