Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00019 * All rights reserved. 00020 * 00021 * The Original Code is: all of this file. 00022 * 00023 * Contributor(s): none yet. 00024 * 00025 * ***** END GPL LICENSE BLOCK ***** 00026 */ 00027 00033 #ifndef NAN_INCLUDED_LOD_NdQuadricEditor_h 00034 #define NAN_INCLUDED_LOD_NdQuadricEditor_h 00035 00036 #include "common/NonCopyable.h" 00037 #include "LOD_ManMesh2.h" 00038 #include "MT_Vector3.h" 00039 #include "LOD_NdQuadric.h" 00040 00041 class LOD_ExternNormalEditor; 00042 class LOD_ExternVColorEditor; 00043 00044 00045 class LOD_NdQuadricEditor 00046 { 00047 00048 public : 00049 00050 // Creation 00052 00053 static 00054 LOD_NdQuadricEditor * 00055 New( 00056 LOD_ManMesh2 &mesh 00057 ); 00058 00059 // Property editor interface 00061 00062 void 00063 Remove( 00064 const std::vector<LOD_VertexInd> &sorted_vertices 00065 ); 00066 00067 std::vector<LOD_NdQuadric> & 00068 Quadrics( 00069 ) const { 00070 return *m_quadrics; 00071 }; 00072 00073 00074 // Editor specific methods 00076 00077 bool 00078 BuildQuadrics( 00079 const LOD_ExternNormalEditor& normal_editor, 00080 bool preserve_boundaries 00081 ); 00082 00083 void 00084 InitializeHeapKeys( 00085 const LOD_ExternVColorEditor & color_editor 00086 ); 00087 00088 00089 void 00090 ComputeEdgeCosts( 00091 const std::vector<LOD_EdgeInd> &edges, 00092 const LOD_ExternVColorEditor & color_editor 00093 ); 00094 00095 void 00096 TargetVertex( 00097 const LOD_Edge & e, 00098 TNT::Vector<MT_Scalar> &result, 00099 const LOD_ExternVColorEditor & color_editor 00100 ) const ; 00101 00102 ~LOD_NdQuadricEditor( 00103 ){ 00104 delete(m_quadrics); 00105 }; 00106 00107 00108 private : 00109 00110 std::vector<LOD_NdQuadric> * m_quadrics; 00111 00112 LOD_ManMesh2 &m_mesh; 00113 00114 private : 00115 00116 LOD_NdQuadricEditor(LOD_ManMesh2 &mesh); 00117 00118 00119 00120 }; 00121 00122 #endif 00123