Blender V2.61 - r43446

LOD_QuadricEditor.h

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