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 00029 namespace MeshKit { 00030 00031 class GreenCoordinates3D 00032 { 00033 public: 00034 //public function 00035 GreenCoordinates3D(MKCore* core, vector< vector<double> > iNodes); 00036 void SetupCages(vector<vector<double> > cageNodes, vector< vector<int> > cageFaces, vector<vector<double> > normal); 00037 ~GreenCoordinates3D(); 00038 void Execute(); 00039 void GetDeformedVertices(vector< vector<double> > nodes, vector< vector<double> > norm, vector<vector<double> > &ReturnNodes); 00040 00041 private: 00042 double GCTriInt(vector<double> p, vector<double> v1, vector<double> v2, vector<double> iNodes); 00043 00044 private: 00045 //member variables 00046 MKCore* mk_core; 00047 vector< vector<double> > CageNodes; 00048 vector< vector<int> > CageFaces; 00049 vector< vector<double> > InteriorNodes; 00050 vector<vector<double> > Normals; 00051 vector<vector<double> > weight_v, weight_t; 00052 00053 }; 00054 00055 } 00056 #endif 00057