Blender  V2.59
LOD_QuadricEditor.h
Go to the documentation of this file.
00001 /*
00002  * $Id: LOD_QuadricEditor.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_QuadricEditor_h
00035 #define NAN_INCLUDED_LOD_QuadricEditor_h
00036 
00037 #include "MEM_NonCopyable.h"
00038 #include "LOD_ManMesh2.h"
00039 #include "MT_Vector3.h"
00040 #include "LOD_Quadric.h"
00041 
00042 class LOD_ExternNormalEditor;
00043 
00044 
00045 class LOD_QuadricEditor : public MEM_NonCopyable
00046 {
00047 
00048 public : 
00049 
00050         // Creation
00052 
00053         static
00054                 LOD_QuadricEditor *
00055         New(
00056                 LOD_ManMesh2 &mesh
00057         ); 
00058 
00059         // Property editor interface
00061 
00062                 void
00063         Remove(
00064                 std::vector<LOD_VertexInd> &sorted_vertices
00065         );
00066 
00067                 void
00068         Update(
00069                 std::vector<LOD_FaceInd> &sorted_vertices
00070         );
00071 
00072 
00073                 std::vector<LOD_Quadric> &
00074         Quadrics(
00075         ) const {
00076                 return *m_quadrics;
00077         };
00078 
00079 
00080         // Editor specific methods
00082 
00083                 bool
00084         BuildQuadrics(
00085                 LOD_ExternNormalEditor& normal_editor,
00086                 bool preserve_boundaries
00087         );      
00088 
00089 
00090                 void
00091         ComputeEdgeCosts(
00092                 std::vector<LOD_EdgeInd> &edges
00093         );      
00094 
00095                 MT_Vector3 
00096         TargetVertex(
00097                 LOD_Edge &e
00098         );
00099 
00100         ~LOD_QuadricEditor(
00101          ){
00102                 delete(m_quadrics);
00103         };
00104 
00105                 
00106 private :
00107 
00108         std::vector<LOD_Quadric> * m_quadrics;
00109 
00110         LOD_ManMesh2 &m_mesh;
00111 
00112 private :
00113         
00114         LOD_QuadricEditor(LOD_ManMesh2 &mesh);
00115 
00116 
00117 
00118 };
00119 
00120 #endif
00121