$darkmode
VCG Library
Public Types | Public Member Functions | List of all members
vcg::tri::TrivialSampler< MeshType > Class Template Reference

A basic sampler class that show the required interface used by the SurfaceSampling class. More...

#include <vcg/complex/algorithms/point_sampling.h>

Public Types

typedef MeshType::ScalarType ScalarType
 
typedef MeshType::CoordType CoordType
 
typedef MeshType::VertexType VertexType
 
typedef MeshType::EdgeType EdgeType
 
typedef MeshType::FaceType FaceType
 

Public Member Functions

void reset ()
 
 TrivialSampler (std::vector< CoordType > &Vec)
 
std::vector< CoordType > & SampleVec ()
 
void AddVert (const VertexType &p)
 
void AddEdge (const EdgeType &e, ScalarType u)
 
void AddFace (const FaceType &f, const CoordType &p)
 
void AddTextureSample (const FaceType &, const CoordType &, const Point2i &, float)
 

Detailed Description

template<class MeshType>
class vcg::tri::TrivialSampler< MeshType >

A basic sampler class that show the required interface used by the SurfaceSampling class.

Most of the methods of sampling classes call the AddFace method of this class with the face containing the sample and its barycentric coord. Beside being an example of how to write a sampler it provides a simple way to use the various sampling classes. For example if you just want to get a vector with positions over the surface You have just to write

vector<Point3f> myVec;
SurfaceSampling<MyMesh, TrivialSampler<MyMesh> >::Montecarlo(M, TrivialSampler<MyMesh>(myVec), SampleNum);

The documentation for this class was generated from the following file: