diff options
Diffstat (limited to 'dep/include/g3dlite/G3D/MeshBuilder.h')
-rw-r--r-- | dep/include/g3dlite/G3D/MeshBuilder.h | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/dep/include/g3dlite/G3D/MeshBuilder.h b/dep/include/g3dlite/G3D/MeshBuilder.h deleted file mode 100644 index 9920d59d7d3..00000000000 --- a/dep/include/g3dlite/G3D/MeshBuilder.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - @file MeshBuilder.h - - @maintainer Morgan McGuire, http://graphics.cs.williams.edu - - @created 2002-02-27 - @edited 2004-10-04 - */ -#ifndef G3D_MESHBUILDER_H -#define G3D_MESHBUILDER_H - -#include "G3D/platform.h" -#include "G3D/Array.h" -#include "G3D/Vector3.h" -#include "G3D/Triangle.h" - -namespace G3D { - -/** - Allows creation of optimized watertight meshes from unoptimized polygon soups. - See also G3D::MeshAlg for algorithms that operate on the output. - */ -class MeshBuilder { -public: - - /** - Set setWeldRadius to AUTO_WELD to weld vertices closer than 1/2 - the smallest edge length in a model. - */ - enum {AUTO_WELD = -100}; - -private: - /** Indices of vertices in <B>or near</B> a grid cell. */ - typedef Array<int> List; - - std::string name; - - /** - All of the triangles, as a long triangle list. - */ - Array<Vector3> triList; - - void centerTriList(); - void computeBounds(Vector3& min, Vector3& max); - - bool _twoSided; - - /** Collapse radius */ - double close; - -public: - - inline MeshBuilder(bool twoSided = false) : _twoSided(twoSided), close(AUTO_WELD) {} - - /** Writes the model to the arrays, which can then be used with - G3D::IFSModel::save and G3D::MeshAlg */ - void commit(std::string& name, Array<int>& indexArray, Array<Vector3>& vertexArray); - - /** - Adds a new triangle to the model. (Counter clockwise) - */ - void addTriangle(const Vector3& a, const Vector3& b, const Vector3& c); - - /** - Adds two new triangles to the model. (Counter clockwise) - */ - void addQuad(const Vector3& a, const Vector3& b, const Vector3& c, const Vector3& d); - - void addTriangle(const Triangle& t); - - void setName(const std::string& n); - - /** Vertices within this distance are considered identical. - Use AUTO_WELD (the default) to have the distance be a function of the model size.*/ - void setWeldRadius(double r) { - close = r; - } -}; - -} // namespace - -#endif |