00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef FUNCTION_DATA_INCLUDED
00030 #define FUNCTION_DATA_INCLUDED
00031
00032 #define BOUNDARY_CONDITIONS 1
00033
00034 #if defined __GNUC__
00035 # pragma GCC system_header
00036 #endif
00037
00038
00039 #include "ppolynomial.h"
00040
00041 namespace pcl
00042 {
00043 namespace poisson
00044 {
00045
00046 template<int Degree,class Real>
00047 class FunctionData{
00048 bool useDotRatios;
00049 int normalize;
00050 #if BOUNDARY_CONDITIONS
00051 bool reflectBoundary;
00052 #endif // BOUNDARY_CONDITIONS
00053 public:
00054 const static int DOT_FLAG = 1;
00055 const static int D_DOT_FLAG = 2;
00056 const static int D2_DOT_FLAG = 4;
00057 const static int VALUE_FLAG = 1;
00058 const static int D_VALUE_FLAG = 2;
00059
00060 int depth , res , res2;
00061 Real *dotTable , *dDotTable , *d2DotTable;
00062 Real *valueTables , *dValueTables;
00063 #if BOUNDARY_CONDITIONS
00064 PPolynomial<Degree> baseFunction , leftBaseFunction , rightBaseFunction;
00065 PPolynomial<Degree-1> dBaseFunction , dLeftBaseFunction , dRightBaseFunction;
00066 #else // !BOUNDARY_CONDITIONS
00067 PPolynomial<Degree> baseFunction;
00068 PPolynomial<Degree-1> dBaseFunction;
00069 #endif // BOUNDARY_CONDITIONS
00070 PPolynomial<Degree+1>* baseFunctions;
00071
00072 FunctionData(void);
00073 ~FunctionData(void);
00074
00075 virtual void setDotTables(const int& flags);
00076 virtual void clearDotTables(const int& flags);
00077
00078 virtual void setValueTables(const int& flags,const double& smooth=0);
00079 virtual void setValueTables(const int& flags,const double& valueSmooth,const double& normalSmooth);
00080 virtual void clearValueTables(void);
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096 #if BOUNDARY_CONDITIONS
00097 void set( const int& maxDepth , const PPolynomial<Degree>& F , const int& normalize , bool useDotRatios=true , bool reflectBoundary=false );
00098 #else // !BOUNDARY_CONDITIONS
00099 void set(const int& maxDepth,const PPolynomial<Degree>& F,const int& normalize , bool useDotRatios=true );
00100 #endif // BOUNDARY_CONDITIONS
00101
00102 #if BOUNDARY_CONDITIONS
00103 Real dotProduct( const double& center1 , const double& width1 , const double& center2 , const double& width2 , int boundary1 , int boundary2 ) const;
00104 Real dDotProduct( const double& center1 , const double& width1 , const double& center2 , const double& width2 , int boundary1 , int boundary2 ) const;
00105 Real d2DotProduct( const double& center1 , const double& width1 , const double& center2 , const double& width2 , int boundary1 , int boundary2 ) const;
00106 #else // !BOUNDARY_CONDITIONS
00107 Real dotProduct( const double& center1 , const double& width1 , const double& center2 , const double& width2 ) const;
00108 Real dDotProduct( const double& center1 , const double& width1 , const double& center2 , const double& width2 ) const;
00109 Real d2DotProduct( const double& center1 , const double& width1 , const double& center2 , const double& width2 ) const;
00110 #endif // BOUNDARY_CONDITIONS
00111
00112 static inline int SymmetricIndex( const int& i1 , const int& i2 );
00113 static inline int SymmetricIndex( const int& i1 , const int& i2 , int& index );
00114 };
00115
00116
00117 }
00118 }
00119
00120
00121 #include "function_data.hpp"
00122
00123 #endif // FUNCTION_DATA_INCLUDED