3 * ***** BEGIN GPL LICENSE BLOCK *****
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
20 * All rights reserved.
22 * The Original Code is: all of this file.
24 * Contributor(s): none yet.
26 * ***** END GPL LICENSE BLOCK *****
29 /** \file bsp/intern/BSP_CSGMesh.h
34 #ifndef NAN_INCLUDED_BSP_CSGMesh_h
35 #define NAN_INCLUDED_BSP_CSGMesh_h
37 #include "BSP_MeshPrimitives.h"
38 #include "MEM_SmartPtr.h"
39 #include "MEM_RefCountPtr.h"
40 #include "MEM_NonCopyable.h"
41 #include "../extern/CSG_BooleanOps.h"
47 public MEM_NonCopyable,
48 public MEM_RefCountable
60 std::vector<BSP_MVertex> *verts
69 // assumes that the face already has a plane equation
76 // Allocate and build the mesh edges.
77 ////////////////////////////////////
83 // Clean the mesh of edges. and edge pointers
84 // This removes the circular connectivity information
85 /////////////////////////////////////////////
91 // return a new separate copy of the
92 // mesh allocated on the heap.
99 // Reverse the winding order of every polygon
100 // in the mesh and swap the planes around.
110 std::vector<BSP_MVertex> &
114 std::vector<BSP_MFace> &
118 std::vector<BSP_MEdge> &
125 // local geometry queries.
126 /////////////////////////
133 const BSP_FaceInd & f,
134 std::vector<BSP_VertexInd> &output
139 const BSP_FaceInd & f,
140 std::vector<BSP_EdgeInd> &output
148 const BSP_EdgeInd & e,
149 std::vector<BSP_VertexInd> &output
154 const BSP_EdgeInd & e,
155 std::vector<BSP_FaceInd> &output
163 const BSP_VertexInd & v,
164 std::vector<BSP_EdgeInd> &output
169 const BSP_VertexInd & v,
170 std::vector<BSP_FaceInd> &output
173 // Returns the edge index of the edge from v1 to v2.
174 // Does this by searching the edge sets of v1 - but not v2.
175 // If you are paranoid you should check both and make sure the
176 // indices are the same. If the edge doe not exist edgeInd is empty.
180 const BSP_VertexInd &v1,
181 const BSP_VertexInd &v2
189 // make sure the edge faces have a pointer to f
197 * Return the face plane equation
202 const BSP_FaceInd &fi
207 * Recompute Face plane equations.
208 * essential if you have been messing with the object.
216 * Count the number of trinagles in the mesh.
217 * This is not the same as the number of polygons.
228 const BSP_VertexInd &v1,
229 const BSP_VertexInd &v2,
230 const BSP_FaceInd &f,
231 std::vector<BSP_EdgeInd> &new_edges
235 // Private to insure heap instantiation.
240 std::vector<BSP_MVertex> *m_verts;
241 std::vector<BSP_MFace> *m_faces;
242 std::vector<BSP_MEdge> *m_edges;
244 MT_Vector3 m_bbox_min;
245 MT_Vector3 m_bbox_max;