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