00001 // Wild Magic Source Code 00002 // David Eberly 00003 // http://www.geometrictools.com 00004 // Copyright (c) 1998-2007 00005 // 00006 // This library is free software; you can redistribute it and/or modify it 00007 // under the terms of the GNU Lesser General Public License as published by 00008 // the Free Software Foundation; either version 2.1 of the License, or (at 00009 // your option) any later version. The license is available for reading at 00010 // either of the locations: 00011 // http://www.gnu.org/copyleft/lgpl.html 00012 // http://www.geometrictools.com/License/WildMagicLicense.pdf 00013 // The license applies to versions 0 through 4 of Wild Magic. 00014 // 00015 // Version: 4.0.0 (2006/06/28) 00016 00017 #ifndef WM4MESHCURVATURE_H 00018 #define WM4MESHCURVATURE_H 00019 00020 #include "Wm4FoundationLIB.h" 00021 #include "Wm4Matrix3.h" 00022 #include "Wm4Matrix2.h" 00023 00024 namespace Wm4 00025 { 00026 00027 template <class Real> 00028 class WM4_FOUNDATION_ITEM MeshCurvature 00029 { 00030 public: 00031 // The caller is responsible for deleting the input arrays. 00032 MeshCurvature (int iVQuantity, const Vector3<Real>* akVertex, 00033 int iTQuantity, const int* aiIndex); 00034 00035 virtual ~MeshCurvature (); 00036 00037 // input values from the constructor 00038 int GetVQuantity () const; 00039 const Vector3<Real>* GetVertices () const; 00040 int GetTQuantity () const; 00041 const int* GetIndices () const; 00042 00043 // derived quantites from the input mesh 00044 const Vector3<Real>* GetNormals () const; 00045 const Real* GetMinCurvatures () const; 00046 const Real* GetMaxCurvatures () const; 00047 const Vector3<Real>* GetMinDirections () const; 00048 const Vector3<Real>* GetMaxDirections () const; 00049 00050 protected: 00051 int m_iVQuantity; 00052 const Vector3<Real>* m_akVertex; 00053 int m_iTQuantity; 00054 const int* m_aiIndex; 00055 00056 Vector3<Real>* m_akNormal; 00057 Real* m_afMinCurvature; 00058 Real* m_afMaxCurvature; 00059 Vector3<Real>* m_akMinDirection; 00060 Vector3<Real>* m_akMaxDirection; 00061 }; 00062 00063 typedef MeshCurvature<float> MeshCurvaturef; 00064 typedef MeshCurvature<double> MeshCurvatured; 00065 00066 } 00067 00068 #endif