2
* ***** BEGIN GPL LICENSE BLOCK *****
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation; either version 2
7
* of the License, or (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software Foundation,
16
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19
* All rights reserved.
21
* The Original Code is: all of this file.
23
* Contributor(s): none yet.
25
* ***** END GPL LICENSE BLOCK *****
28
/** \file decimation/intern/LOD_ManMesh2.h
33
#ifndef __LOD_MANMESH2_H__
34
#define __LOD_MANMESH2_H__
36
#include "LOD_MeshPrimitives.h"
37
#include "MEM_SmartPtr.h"
40
template <class HeapType> class CTR_UHeap;
42
class LOD_ExternBufferEditor;
44
class LOD_ManMesh2 // Manifold 2 dimensional mesh
54
// take ownership of the vertices.
58
MEM_SmartPtr<std::vector<LOD_Vertex> > verts
61
// Add a triangle to the mesh
71
std::vector<LOD_EdgeInd> & new_edges
77
std::vector<LOD_Vertex> &
81
std::vector<LOD_TriFace> &
85
std::vector<LOD_Edge> &
92
// local geometry queries
93
/////////////////////////
101
std::vector<LOD_VertexInd> &output
107
std::vector<LOD_EdgeInd> &output
116
std::vector<LOD_VertexInd> &output
122
std::vector<LOD_FaceInd> &output
131
std::vector<LOD_EdgeInd> &output
137
std::vector<LOD_FaceInd> &output
158
// Remove a primitive from the mesh
159
///////////////////////////////////
161
// These methods assume you have correctly
162
// tidied up the index pointers in other primitives,
163
// so that nothing refers to this object any more
165
// These methods exchange the primitive with the
166
// last primitive in the vector. It modifies everything
167
// pointing to the last primitive correctly.
169
// FIXME refactor extern editor out of primitive deletion
170
// insead return a vector of primitives that need to be
171
// modified and do this externally
175
LOD_ExternBufferEditor & extern_editor,
182
CTR_UHeap<LOD_Edge> *heap
187
LOD_ExternBufferEditor & extern_editor,
191
// Sanity Check routines
192
////////////////////////
194
// Make sure the edge sets and the vertex sets are
202
// basic sanity checking of an edge list bails out if there are more than 1024
211
// Check to see that the edges of v1 and v2 are unique.
222
// Returns the edge index of the edge from v1 to v2.
223
// Does this by searching the edge sets of v1 - but not v2.
224
// If you are paranoid you should check both and make sure the
225
// indices are the same. If the edge doe not exist edgeInd is empty.
229
const LOD_VertexInd v1,
230
const LOD_VertexInd v2
233
// Insert an edge into the mesh
234
// Tie up the ptrs and create space for the edge
235
// returns manifold errors - need to sort out memory edges
239
const LOD_VertexInd v1,
240
const LOD_VertexInd v2,
242
std::vector<LOD_EdgeInd> &new_edges
251
MEM_SmartPtr< std::vector<LOD_Vertex> > m_verts;
252
MEM_SmartPtr< std::vector<LOD_TriFace> > m_faces;
253
MEM_SmartPtr< std::vector<LOD_Edge> > m_edges;
255
// not sure of these descrtiptions of the mesh should
256
// reside in this class coz may lead to very bloated interface.
258
MT_Vector3 m_bbox_min;
259
MT_Vector3 m_bbox_max;