00001 /* 00002 mesh3d 00003 Copyright (C) 2010 Timo Suoranta 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 00010 This library 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 GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 */ 00019 00027 #ifndef MESH3D__CORNER__H 00028 #define MESH3D__CORNER__H 00029 00030 #include "mesh3d/attribute_map.h" 00031 #include "mesh3d/polygon.h" 00032 #include <memory> 00033 00034 namespace mesh3d { 00035 00036 class point; 00037 class polygon; 00038 class geometry; 00039 00041 class corner 00042 { 00043 public: 00044 mesh3d::point *point (){ return m_point; } 00045 mesh3d::polygon *polygon(){ return m_polygon; } 00046 00047 void compute_normal( 00048 std::tr1::shared_ptr<attribute_map<mesh3d::corner*, vec3> > corner_normals, 00049 std::tr1::shared_ptr<attribute_map<mesh3d::polygon*, vec3> > polygon_normals, 00050 std::tr1::shared_ptr<attribute_map<mesh3d::point*, vec3> > point_locations, 00051 float cos_max_smoothing_angle 00052 ); 00053 00054 private: 00055 friend class polygon; 00056 00057 corner(mesh3d::point *point, mesh3d::polygon *polygon) 00058 : m_point (point) 00059 , m_polygon(polygon) 00060 { 00061 } 00062 00063 private: 00064 mesh3d::point *m_point; 00065 mesh3d::polygon *m_polygon; 00066 }; 00067 00068 } 00069 00070 #endif 00071