26 #pragma warning( push )
27 #pragma warning (disable : 4127)
291 double& minEdgeLength,
292 double& meanEdgeLength,
293 double& medianEdgeLength,
294 double& maxEdgeLength,
296 double& meanFaceArea,
297 double& medianFaceArea,
298 double& maxFaceArea);
556 bool spaceCentered =
true,
557 bool twoSided =
true,
565 template<
class IndexType>
577 const int inSize = inIndices.
size();
584 int N = outIndices.
size();
585 outIndices.
resize(N + (inSize - 2) * 3);
587 for (IndexType i = 1, outIndex = N; i <= (inSize - 2); ++i, outIndex += 3) {
588 outIndices[outIndex] = inIndices[0];
589 outIndices[outIndex + 1] = inIndices[i];
590 outIndices[outIndex + 2] = inIndices[i + 1];
600 int N = outIndices.
size();
601 outIndices.
resize(N + (inSize - 2) * 3);
604 for (IndexType i = 0, outIndex = N; i < (inSize - 2); ++i, outIndex += 3) {
606 outIndices[outIndex] = inIndices[i + 1];
607 outIndices[outIndex + 1] = inIndices[i];
608 outIndices[outIndex + 2] = inIndices[i + 2];
611 outIndices[outIndex] = inIndices[i];
612 outIndices[outIndex + 1] = inIndices[i + 1];
613 outIndices[outIndex + 2] = inIndices[i + 2];
625 int N = outIndices.
size();
626 outIndices.
resize(N + (inSize / 4) * 3);
628 for (IndexType i = 0, outIndex = N; i <= (inSize - 4); i += 4, outIndex += 6) {
629 outIndices[outIndex] = inIndices[i];
630 outIndices[outIndex + 1] = inIndices[i + 1];
631 outIndices[outIndex + 2] = inIndices[i + 3];
632 outIndices[outIndex + 3] = inIndices[i + 1];
633 outIndices[outIndex + 4] = inIndices[i + 2];
634 outIndices[outIndex + 5] = inIndices[i + 3];
644 int N = outIndices.
size();
645 outIndices.
resize(N + (inSize - 2) * 3);
647 for (IndexType i = 0, outIndex = N; i <= (inSize - 2); i += 2, outIndex += 6) {
648 outIndices[outIndex] = inIndices[i];
649 outIndices[outIndex + 1] = inIndices[i + 1];
650 outIndices[outIndex + 2] = inIndices[i + 2];
651 outIndices[outIndex + 3] = inIndices[i + 2];
652 outIndices[outIndex + 4] = inIndices[i + 1];
653 outIndices[outIndex + 5] = inIndices[i + 3];
680 int i0,
int i1,
int f,
double area);
686 #pragma warning( pop )
PrimitiveType Primitive
Definition: MeshAlg.h:48
Face()
Definition: MeshAlg.cpp:100
static void toIndexedTriList(const Array< IndexType > &inIndices, MeshAlg::Primitive inType, Array< IndexType > &outIndices)
Definition: MeshAlg.h:566
static void computeAdjacency(const Array< Vector3 > &vertexGeometry, const Array< int > &indexArray, Array< Face > &faceArray, Array< Edge > &edgeArray, Array< Vertex > &vertexArray)
Definition: MeshAlgAdjacency.cpp:193
Definition: constants.h:28
bool inFace(int f) const
Definition: MeshAlg.h:179
void resize(size_t n, bool shrinkIfNecessary=true)
Definition: Array.h:490
int vertexIndex[2]
Definition: MeshAlg.h:164
bool inEdge(int e) const
Definition: MeshAlg.h:75
Definition: constants.h:26
A rigid body RT (rotation-translation) transformation.
Definition: CoordinateFrame.h:59
static void generateGrid(Array< Vector3 > &vertex, Array< Vector2 > &texCoord, Array< int > &index, int wCells=10, int hCells=10, const Vector2 &textureScale=Vector2(1, 1), bool spaceCentered=true, bool twoSided=true, const CoordinateFrame &xform=CoordinateFrame(), const Image1::Ref &elevation=Image1::Ref())
Definition: MeshAlg.cpp:28
Definition: constants.h:29
bool contains(const T &value) const
Definition: SmallArray.h:162
static void computeWeld(const Array< Vector3 > &oldVertexPositions, Array< Vector3 > &newVertexPositions, Array< int > &toNew, Array< int > &toOld, float radius=fuzzyEpsilon32)
Definition: MeshAlgWeld.cpp:203
Vertex()
Definition: MeshAlg.h:59
shared_ptr< class Image1 > Ref
Definition: Image1.h:31
bool containsVertex(int v) const
Definition: MeshAlg.h:166
bool boundary() const
Definition: MeshAlg.h:186
static void weldBoundaryEdges(Array< Face > &faceArray, Array< Edge > &edgeArray, Array< Vertex > &vertexArray)
Definition: MeshAlgAdjacency.cpp:430
Dynamic 1D array tuned for performance.
Definition: Array.h:95
Definition: MeshAlg.h:210
int vertexIndex[3]
Definition: MeshAlg.h:110
static void computeNormals(const Array< Vector3 > &vertexArray, const Array< Face > &faceArray, const Array< Array< int > > &adjacentFaceArray, Array< Vector3 > &vertexNormalArray, Array< Vector3 > &faceNormalArray)
Definition: MeshAlg.cpp:144
static const int NONE
Definition: MeshAlg.h:103
SmallArray< int, 6 > faceIndex
Definition: MeshAlg.h:83
int faceIndex[2]
Definition: MeshAlg.h:175
bool contains(const T *array, int len, const T &e)
Definition: Array.h:1451
Definition: constants.h:19
static void computeBounds(const Array< Vector3 > &vertex, class AABox &box, class Sphere &sphere)
Definition: MeshAlg.cpp:430
float normalize(float v)
Definition: g3dmath.h:438
static void identifyBackfaces(const Array< Vector3 > &vertexArray, const Array< Face > &faceArray, const Vector4 &P, Array< bool > &backface)
Definition: MeshAlg.cpp:246
#define debugAssert(exp)
Definition: debugAssert.h:160
static void computeAreaStatistics(const Array< Vector3 > &vertexArray, const Array< int > &indexArray, double &minEdgeLength, double &meanEdgeLength, double &medianEdgeLength, double &maxEdgeLength, double &minFaceArea, double &meanFaceArea, double &medianFaceArea, double &maxFaceArea)
Definition: MeshAlg.cpp:343
void clear()
Definition: MeshAlg.h:223
static void computeFaceNormals(const Array< Vector3 > &vertexArray, const Array< Face > &faceArray, Array< Vector3 > &faceNormals, bool normalize=true)
Definition: MeshAlg.cpp:220
void clear(bool shrink=true)
Definition: Array.h:407
Definition: constants.h:27
bool containsEdge(int e) const
Definition: MeshAlg.h:143
static int countBoundaryEdges(const Array< Edge > &edgeArray)
Definition: MeshAlg.cpp:401
int size() const
Definition: Array.h:430
#define fuzzyEpsilon32
Definition: g3dmath.h:132
Definition: MeshAlg.h:159
int edgeIndex[3]
Definition: MeshAlg.h:141
Array< Vector3 > normalArray
Definition: MeshAlg.h:216
Edge reverse() const
Definition: MeshAlg.h:194
bool inFace(int f) const
Definition: MeshAlg.h:85
static int findEdgeIndex(const Array< Vector3 > &vertexArray, Array< Edge > &geometricEdgeArray, int i0, int i1, int f, double area)
bool containsVertex(int v) const
Definition: MeshAlg.h:112
Edge()
Definition: MeshAlg.cpp:108
static void computeTangentSpaceBasis(const Array< Vector3 > &vertexArray, const Array< Vector2 > &texCoordArray, const Array< Vector3 > &vertexNormalArray, const Array< Face > &faceArray, Array< Vector3 > &tangent, Array< Vector3 > &binormal)
Definition: MeshAlg.cpp:552
Geometry & operator=(const Geometry &src)
Definition: MeshAlg.cpp:117
bool containsDirectedEdge(int e) const
Definition: MeshAlg.h:152
static void weldAdjacency(const Array< Vector3 > &originalGeometry, Array< Face > &faceArray, Array< Edge > &edgeArray, Array< Vertex > &vertexArray, float radius=fuzzyEpsilon32)
Definition: MeshAlgAdjacency.cpp:623
SmallArray< int, 6 > edgeIndex
Definition: MeshAlg.h:70
float tangent(float x)
Definition: Spell.cpp:1502
uint8 const P[]
Definition: AuthenticationPackets.cpp:225
#define alwaysAssertM(exp, message)
Definition: debugAssert.h:165
static void createIndexArray(int n, Array< int > &array, int start=0, int run=1, int skip=0)
Definition: MeshAlg.cpp:316
static void debugCheckConsistency(const Array< Face > &faceArray, const Array< Edge > &edgeArray, const Array< Vertex > &vertexArray)
Definition: MeshAlgAdjacency.cpp:693
Array< Vector3 > vertexArray
Definition: MeshAlg.h:213