MeshKit
1.0
|
00001 #ifndef __GREENCOORDINATES3D_HPP 00002 #define __GREENCOORDINATES3D_HPP 00003 00004 #include <stdlib.h> 00005 #include <stdio.h> 00006 #include <assert.h> 00007 #include <string> 00008 #include <iostream> 00009 #include <fstream> 00010 #include <string.h> 00011 #include <limits.h> 00012 00013 #include "meshkit/MKCore.hpp" 00014 #include "meshkit/iMesh.hpp" 00015 #include "meshkit/MeshOp.hpp" 00016 #include "meshkit/ModelEnt.hpp" 00017 #include <set> 00018 #include <vector> 00019 #include <map> 00020 00021 //Green Coordinates cage-based deformation 00022 //The coordinates respect both the cage vertices position and face orientation 00023 //It has shape-preserving property and closed-form. 00024 00025 00026 00027 using namespace std; 00028 //using namespace Mesquite; 00029 00030 namespace MeshKit { 00031 00032 class GreenCoordinates3D 00033 { 00034 public: 00035 //public function 00036 GreenCoordinates3D(MKCore* core, vector< vector<double> > iNodes); 00037 void SetupCages(vector<vector<double> > cageNodes, vector< vector<int> > cageFaces, vector<vector<double> > normal); 00038 ~GreenCoordinates3D(); 00039 void Execute(); 00040 void GetDeformedVertices(vector< vector<double> > nodes, vector< vector<double> > norm, vector<vector<double> > &ReturnNodes); 00041 00042 private: 00043 double GCTriInt(vector<double> p, vector<double> v1, vector<double> v2, vector<double> iNodes); 00044 00045 private: 00046 //member variables 00047 MKCore* mk_core; 00048 vector< vector<double> > CageNodes; 00049 vector< vector<int> > CageFaces; 00050 vector< vector<double> > InteriorNodes; 00051 vector<vector<double> > Normals; 00052 vector<vector<double> > weight_v, weight_t; 00053 00054 }; 00055 00056 } 00057 #endif 00058