Blender V2.61 - r43446

LOD_ExternNormalEditor.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_ExternNormalEditor_h
00034 #define NAN_INCLUDED_ExternNormalEditor_h
00035 
00036 #include "MEM_NonCopyable.h"
00037 #include "LOD_ManMesh2.h"
00038 #include "MT_Vector3.h"
00039 #include "../extern/LOD_decimation.h"
00040 
00041 class LOD_ExternNormalEditor : public MEM_NonCopyable
00042 {
00043 
00044 public : 
00045 
00046     // Creation
00048 
00049     static
00050         LOD_ExternNormalEditor *
00051     New(
00052         LOD_Decimation_InfoPtr,
00053         LOD_ManMesh2 &mesh
00054     ); 
00055 
00056     // Property editor interface
00058 
00059 
00060     // Faces
00062         void
00063     Remove(
00064         std::vector<LOD_FaceInd> &sorted_faces
00065     );
00066 
00067         void
00068     Add(
00069     );  
00070 
00071         void
00072     Update(
00073         std::vector<LOD_FaceInd> &sorted_faces
00074     );
00075 
00076     const 
00077         std::vector<MT_Vector3> &
00078     Normals(
00079     ) const {
00080         return m_normals.Ref();
00081     };
00082     
00083 
00084     // vertex normals
00086 
00087         void
00088     RemoveVertexNormals(
00089         std::vector<LOD_VertexInd> &sorted_verts
00090     );
00091 
00092 
00093         void
00094     UpdateVertexNormals(
00095         std::vector<LOD_VertexInd> &sorted_verts
00096     );
00097 
00098     // Editor specific methods
00100 
00101         void
00102     BuildNormals(
00103     );  
00104 
00105 
00106 private :
00107 
00108     MEM_SmartPtr<std::vector<MT_Vector3> > m_normals;
00109 
00110     LOD_ManMesh2 &m_mesh;
00111     LOD_Decimation_InfoPtr m_extern_info;
00112 
00113 private :
00114     
00115         
00116     LOD_ExternNormalEditor(
00117         LOD_Decimation_InfoPtr extern_info,
00118         LOD_ManMesh2 &mesh
00119     );
00120 
00121     const 
00122         MT_Vector3 
00123     ComputeNormal(
00124         const LOD_TriFace &face
00125     ) const ;
00126 
00127     const 
00128         MT_Vector3
00129     ComputeVertexNormal (
00130         const LOD_VertexInd vi
00131     ) const;
00132 };
00133 
00134 #endif
00135