$search
00001 /* 00002 James R. Diebel 00003 Stanford University 00004 00005 Started: 24 August 2004 00006 Last revised: 00007 00008 mesh_vert.cc - class implementation of Mesh class (mesh.hh) 00009 00010 Depends on: 00011 - Mesh class (mesh.hh) 00012 */ 00013 00014 #include "bmtk/mesh.hh" 00015 #include <iostream> 00016 00017 namespace bmtk { 00018 00020 // Per-Face Functions // 00022 void Mesh::findFaceNormals() { 00023 if (ut) tFN->start(); 00024 if (po) cout << "- Computing face normals..." << flush; 00025 for (int i=0;i<nf;i++) f[i].findNormal(); 00026 if (po) cout << "Done. " << flush; 00027 if (po) tFN->printMark(); 00028 if (ut) tFN->mark(); 00029 } 00030 00031 void Mesh::findFaceCenters() { 00032 if (po) cout << "- Computing face centers..." << flush; 00033 for (int i=0;i<nf;i++) f[i].findCenter(); 00034 if (po) cout << "Done." << endl << flush; 00035 } 00036 00037 void Mesh::findFaceDistances() { 00038 if (po) cout << "- Computing face projected distances..." << flush; 00039 for (int i=0;i<nf;i++) f[i].findDistance(); 00040 if (po) cout << "Done." << endl << flush; 00041 } 00042 00043 void Mesh::findFaceAreas() { 00044 if (po) cout << "- Computing face areas..." << flush; 00045 for (int i=0;i<nf;i++) f[i].findArea(); 00046 if (po) cout << "Done." << endl << flush; 00047 } 00048 00049 void Mesh::findFaceProps() { 00050 if (po) cout << "- Computing face properties..." << flush; 00051 for (int i=0;i<nf;i++) { 00052 f[i].findNormal(); 00053 f[i].findCenter(); 00054 f[i].findDistance(); 00055 f[i].findArea(); 00056 } 00057 if (po) cout << "Done." << endl << flush; 00058 } 00059 00060 void Mesh::saveRefNormals() { 00061 if (po) cout << "- Saving reference face normals..." << flush; 00062 for (int i=0;i<nf;i++) f[i].nr = f[i].n; 00063 if (po) cout << "Done." << endl << flush; 00064 } 00065 00066 void Mesh::blurFaceNormals(int num) { 00067 if (po) cout << "- Blurring face normals..." << flush; 00068 bool temp = po; 00069 po = false; 00070 for (int i=0;i<num;i++) { 00071 saveRefNormals(); 00072 for (int i=0;i<nf;i++) f[i].blur(); 00073 } 00074 po = temp; 00075 if (po) cout << "Done." << endl << flush; 00076 } 00077 00078 void Mesh::resetFaceFlags() { 00079 if (po) cout << "- Reseting face flags..." << flush; 00080 for (int i=0;i<nf;i++) f[i].flag = -1; 00081 if (po) cout << "Done." << endl << flush; 00082 } 00083 00084 } // namespace bmtk