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 bsp/intern/BSP_CSGMesh.h
33
#ifndef __BSP_CSGMESH_H__
34
#define __BSP_CSGMESH_H__
36
#include "BSP_MeshPrimitives.h"
37
#include "MEM_SmartPtr.h"
38
#include "MEM_RefCountPtr.h"
39
#include "MEM_NonCopyable.h"
40
#include "../extern/CSG_BooleanOps.h"
46
public MEM_NonCopyable,
47
public MEM_RefCountable
59
std::vector<BSP_MVertex> *verts
68
// assumes that the face already has a plane equation
75
// Allocate and build the mesh edges.
76
////////////////////////////////////
82
// Clean the mesh of edges. and edge pointers
83
// This removes the circular connectivity information
84
/////////////////////////////////////////////
90
// return a new separate copy of the
91
// mesh allocated on the heap.
98
// Reverse the winding order of every polygon
99
// in the mesh and swap the planes around.
109
std::vector<BSP_MVertex> &
112
std::vector<BSP_MFace> &
116
std::vector<BSP_MEdge> &
123
// local geometry queries.
124
/////////////////////////
131
const BSP_FaceInd & f,
132
std::vector<BSP_VertexInd> &output
137
const BSP_FaceInd & f,
138
std::vector<BSP_EdgeInd> &output
146
const BSP_EdgeInd & e,
147
std::vector<BSP_VertexInd> &output
152
const BSP_EdgeInd & e,
153
std::vector<BSP_FaceInd> &output
161
const BSP_VertexInd & v,
162
std::vector<BSP_EdgeInd> &output
167
const BSP_VertexInd & v,
168
std::vector<BSP_FaceInd> &output
171
// Returns the edge index of the edge from v1 to v2.
172
// Does this by searching the edge sets of v1 - but not v2.
173
// If you are paranoid you should check both and make sure the
174
// indices are the same. If the edge doe not exist edgeInd is empty.
178
const BSP_VertexInd &v1,
179
const BSP_VertexInd &v2
187
// make sure the edge faces have a pointer to f
195
* Return the face plane equation
200
const BSP_FaceInd &fi
205
* Recompute Face plane equations.
206
* essential if you have been messing with the object.
214
* Count the number of trinagles in the mesh.
215
* This is not the same as the number of polygons.
226
const BSP_VertexInd &v1,
227
const BSP_VertexInd &v2,
228
const BSP_FaceInd &f,
229
std::vector<BSP_EdgeInd> &new_edges
233
// Private to insure heap instantiation.
238
std::vector<BSP_MVertex> *m_verts;
239
std::vector<BSP_MFace> *m_faces;
240
std::vector<BSP_MEdge> *m_edges;
242
MT_Vector3 m_bbox_min;
243
MT_Vector3 m_bbox_max;