Point Cloud Library (PCL) 1.13.0
Loading...
Searching...
No Matches
function_data.h
1/*
2Copyright (c) 2006, Michael Kazhdan and Matthew Bolitho
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without modification,
6are permitted provided that the following conditions are met:
7
8Redistributions of source code must retain the above copyright notice, this list of
9conditions and the following disclaimer. Redistributions in binary form must reproduce
10the above copyright notice, this list of conditions and the following disclaimer
11in the documentation and/or other materials provided with the distribution.
12
13Neither the name of the Johns Hopkins University nor the names of its contributors
14may be used to endorse or promote products derived from this software without specific
15prior written permission.
16
17THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
18EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES
19OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
20SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
22TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
25ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
26DAMAGE.
27*/
28
29#ifndef FUNCTION_DATA_INCLUDED
30#define FUNCTION_DATA_INCLUDED
31
32#define BOUNDARY_CONDITIONS 1
33
34#if defined __GNUC__
35# pragma GCC system_header
36#endif
37
38
39#include "ppolynomial.h"
40
41namespace pcl
42{
43 namespace poisson
44 {
45
46 template<int Degree,class Real>
48 bool useDotRatios;
49 int normalize;
50#if BOUNDARY_CONDITIONS
51 bool reflectBoundary;
52#endif // BOUNDARY_CONDITIONS
53 public:
54 const static int DOT_FLAG = 1;
55 const static int D_DOT_FLAG = 2;
56 const static int D2_DOT_FLAG = 4;
57 const static int VALUE_FLAG = 1;
58 const static int D_VALUE_FLAG = 2;
59
60 int depth , res , res2;
63#if BOUNDARY_CONDITIONS
64 PPolynomial<Degree> baseFunction , leftBaseFunction , rightBaseFunction;
65 PPolynomial<Degree-1> dBaseFunction , dLeftBaseFunction , dRightBaseFunction;
66#else // !BOUNDARY_CONDITIONS
69#endif // BOUNDARY_CONDITIONS
71
72 FunctionData(void);
73 ~FunctionData(void);
74
75 virtual void setDotTables(const int& flags);
76 virtual void clearDotTables(const int& flags);
77
78 virtual void setValueTables(const int& flags,const double& smooth=0);
79 virtual void setValueTables(const int& flags,const double& valueSmooth,const double& normalSmooth);
80 virtual void clearValueTables(void);
81
82 /********************************************************
83 * Sets the translates and scales of the basis function
84 * up to the prescribed depth
85 * <maxDepth> the maximum depth
86 * <F> the basis function
87 * <normalize> how the functions should be scaled
88 * 0] Value at zero equals 1
89 * 1] Integral equals 1
90 * 2] L2-norm equals 1
91 * <useDotRatios> specifies if dot-products of derivatives
92 * should be pre-divided by function integrals
93 * <reflectBoundary> spcifies if function space should be
94 * forced to be reflectively symmetric across the boundary
95 ********************************************************/
96#if BOUNDARY_CONDITIONS
97 void set( const int& maxDepth , const PPolynomial<Degree>& F , const int& normalize , bool useDotRatios=true , bool reflectBoundary=false );
98#else // !BOUNDARY_CONDITIONS
99 void set(const int& maxDepth,const PPolynomial<Degree>& F,const int& normalize , bool useDotRatios=true );
100#endif // BOUNDARY_CONDITIONS
101
102#if BOUNDARY_CONDITIONS
103 Real dotProduct( const double& center1 , const double& width1 , const double& center2 , const double& width2 , int boundary1 , int boundary2 ) const;
104 Real dDotProduct( const double& center1 , const double& width1 , const double& center2 , const double& width2 , int boundary1 , int boundary2 ) const;
105 Real d2DotProduct( const double& center1 , const double& width1 , const double& center2 , const double& width2 , int boundary1 , int boundary2 ) const;
106#else // !BOUNDARY_CONDITIONS
107 Real dotProduct( const double& center1 , const double& width1 , const double& center2 , const double& width2 ) const;
108 Real dDotProduct( const double& center1 , const double& width1 , const double& center2 , const double& width2 ) const;
109 Real d2DotProduct( const double& center1 , const double& width1 , const double& center2 , const double& width2 ) const;
110#endif // BOUNDARY_CONDITIONS
111
112 static inline int SymmetricIndex( const int& i1 , const int& i2 );
113 static inline int SymmetricIndex( const int& i1 , const int& i2 , int& index );
114 };
115
116
117 }
118}
119
120
121#include "function_data.hpp"
122
123#endif // FUNCTION_DATA_INCLUDED
virtual void setDotTables(const int &flags)
static const int D_VALUE_FLAG
Real dotProduct(const double &center1, const double &width1, const double &center2, const double &width2) const
PPolynomial< Degree > baseFunction
Real d2DotProduct(const double &center1, const double &width1, const double &center2, const double &width2) const
static const int DOT_FLAG
static const int D_DOT_FLAG
PPolynomial< Degree-1 > dBaseFunction
virtual void clearValueTables(void)
PPolynomial< Degree+1 > * baseFunctions
static const int VALUE_FLAG
static const int D2_DOT_FLAG
static int SymmetricIndex(const int &i1, const int &i2)
virtual void setValueTables(const int &flags, const double &smooth=0)
void set(const int &maxDepth, const PPolynomial< Degree > &F, const int &normalize, bool useDotRatios=true)
virtual void clearDotTables(const int &flags)
Real dDotProduct(const double &center1, const double &width1, const double &center2, const double &width2) const