#include <zonohedron.h>
Classes | |
struct | Face |
struct | Signature |
Public Types | |
typedef Point3< Scalar > | Vec3 |
Public Member Functions | |
void | addVector (Scalar x, Scalar y, Scalar z) |
void | addVector (Vec3 v) |
void | addVectors (const std::vector< Vec3 >) |
template<class MeshType > | |
void | createMesh (MeshType &output) |
const std::vector< Vec3 > & | vectors () const |
Zonohedron () | |
Private Types | |
typedef int | VecIndex |
typedef std::map< Signature, int > | VertexMap |
Private Member Functions | |
void | createInternalMesh () |
Vec3 | cross (VecIndex i, VecIndex j) |
Face & | face (VecIndex i, VecIndex j) |
void | precompteAllCrosses () |
bool | signOf_IxJoK (VecIndex i, VecIndex j, VecIndex k) |
Vec3 | toPos (const Signature &s) const |
VecIndex | vertexIndex (const Signature &s) |
Static Private Member Functions | |
static Vec3 | altVec (int i) |
static Scalar | tripleProduct (const Vec3 &a, const Vec3 &b, const Vec3 &c) |
static Vec3 | uniqueVerse (Vec3 v) |
Private Attributes | |
std::vector< Face > | _face |
int | n |
std::vector< Vec3 > | precomputedCross |
std::vector< Vec3 > | vec |
int | vertCount |
VertexMap | vertexMap |
A class to build a Zonohedron.
Given a set of input vectors, a zonohedron is defined as the convex hull of all the points which can be costructed by summing together any subset of input vectors. The surface closing this solid is composed only of flat parallelograms, (which have the input vectors as sides). It is always point-symmetric.
Mesh created by this class are pure-quad meshes (triangular bit-quad), (when coplanar vectors are fed, then planar groups of quads can be seen as forming planar faces with more than 4 vertices).
USAGE: 1) Instantiate a Zonohedron. 2) Add input vectors at will to it, with addVector(s) 3) When you are done, call createMesh.
Definition at line 54 of file zonohedron.h.
typedef Point3<Scalar> vcg::tri::Zonohedron< Scalar >::Vec3 |
Definition at line 57 of file zonohedron.h.
typedef int vcg::tri::Zonohedron< Scalar >::VecIndex [private] |
Definition at line 77 of file zonohedron.h.
typedef std::map< Signature, int > vcg::tri::Zonohedron< Scalar >::VertexMap [private] |
Definition at line 179 of file zonohedron.h.
vcg::tri::Zonohedron< Scalar >::Zonohedron | ( | ) | [inline] |
Definition at line 59 of file zonohedron.h.
void vcg::tri::Zonohedron< Scalar >::addVector | ( | Vec3 | v | ) |
static Vec3 vcg::tri::Zonohedron< Scalar >::altVec | ( | int | i | ) | [inline, static, private] |
Definition at line 130 of file zonohedron.h.
void vcg::tri::Zonohedron< Scalar >::createInternalMesh | ( | ) | [inline, private] |
Definition at line 210 of file zonohedron.h.
Vec3 vcg::tri::Zonohedron< Scalar >::cross | ( | VecIndex | i, |
VecIndex | j | ||
) | [inline, private] |
Definition at line 116 of file zonohedron.h.
Face& vcg::tri::Zonohedron< Scalar >::face | ( | VecIndex | i, |
VecIndex | j | ||
) | [inline, private] |
Definition at line 197 of file zonohedron.h.
void vcg::tri::Zonohedron< Scalar >::precompteAllCrosses | ( | ) | [inline, private] |
Definition at line 109 of file zonohedron.h.
bool vcg::tri::Zonohedron< Scalar >::signOf_IxJoK | ( | VecIndex | i, |
VecIndex | j, | ||
VecIndex | k | ||
) | [inline, private] |
Definition at line 139 of file zonohedron.h.
Vec3 vcg::tri::Zonohedron< Scalar >::toPos | ( | const Signature & | s | ) | const [inline, private] |
Definition at line 203 of file zonohedron.h.
static Scalar vcg::tri::Zonohedron< Scalar >::tripleProduct | ( | const Vec3 & | a, |
const Vec3 & | b, | ||
const Vec3 & | c | ||
) | [inline, static, private] |
Definition at line 134 of file zonohedron.h.
static Vec3 vcg::tri::Zonohedron< Scalar >::uniqueVerse | ( | Vec3 | v | ) | [inline, static, private] |
Definition at line 121 of file zonohedron.h.
const std::vector< Vec3 >& vcg::tri::Zonohedron< Scalar >::vectors | ( | ) | const [inline] |
Definition at line 65 of file zonohedron.h.
VecIndex vcg::tri::Zonohedron< Scalar >::vertexIndex | ( | const Signature & | s | ) | [inline, private] |
Definition at line 183 of file zonohedron.h.
std::vector<Face> vcg::tri::Zonohedron< Scalar >::_face [private] |
Definition at line 177 of file zonohedron.h.
int vcg::tri::Zonohedron< Scalar >::n [private] |
Definition at line 173 of file zonohedron.h.
std::vector< Vec3 > vcg::tri::Zonohedron< Scalar >::precomputedCross [private] |
Definition at line 107 of file zonohedron.h.
std::vector<Vec3> vcg::tri::Zonohedron< Scalar >::vec [private] |
Definition at line 174 of file zonohedron.h.
int vcg::tri::Zonohedron< Scalar >::vertCount [private] |
Definition at line 176 of file zonohedron.h.
VertexMap vcg::tri::Zonohedron< Scalar >::vertexMap [private] |
Definition at line 180 of file zonohedron.h.