29#ifndef MULTI_GRID_OCTREE_DATA_INCLUDED
30#define MULTI_GRID_OCTREE_DATA_INCLUDED
33# pragma GCC system_header
38#define GRADIENT_DOMAIN_SOLUTION 1
71#define FORCE_NEUMANN_FIELD 1
75#include <unordered_map>
77#include "bspline_data.h"
102 static long long EdgeIndex(
const TreeOctNode* node ,
int eIndex ,
int maxDepth ,
int index[DIMENSION] );
104 static long long FaceIndex(
const TreeOctNode* node ,
int fIndex ,
int maxDepth,
int index[DIMENSION] );
106 static long long CornerIndex(
int depth ,
const int offSet[DIMENSION] ,
int cIndex ,
int maxDepth ,
int index[DIMENSION] );
109 static long long CenterIndex(
int depth ,
const int offSet[DIMENSION] ,
int maxDepth ,
int index[DIMENSION] );
194 template<
int Degree >
199 bool _constrainValues;
200 std::vector< int > _pointCount;
208 std::vector< PointData > _points;
209 TreeOctNode::NeighborKey3 neighborKey;
210 TreeOctNode::ConstNeighborKey3 neighborKey2;
214 Real GetLaplacian(
const int index[DIMENSION] )
const;
221 float splineValues[3][3];
224 Real GetValue(
const PointInfo points[3][3][3] ,
const bool hasPoints[3][3] ,
const int d[3] )
const;
226 class AdjacencyCountFunction
232 class AdjacencySetFunction{
234 int *adjacencies,adjacencyCount;
238 class RefineFunction{
243 class FaceEdgesFunction
246 int fIndex , maxDepth;
247 std::vector< std::pair< RootInfo , RootInfo > >* edges;
248 std::unordered_map< long long , std::pair< RootInfo , int > >* vertexCount;
256 int GetMatrixRowSize(
const TreeOctNode::Neighbors5&
neighbors5 )
const;
261 void SetLaplacianStencil(
int depth ,
double stencil[5][5][5] )
const;
262 template<
class C ,
int N >
struct Stencil{ C values[N][N][N]; };
274 template<
class C >
void UpSample(
int depth ,
const SortedTreeNodes&
sNodes , C* coefficients )
const;
278 void SetIsoCorners(
Real isoValue ,
TreeOctNode*
leaf ,
SortedTreeNodes::CornerTableData&
cData ,
char*
valuesSet ,
Real* values , TreeOctNode::ConstNeighborKey3&
nKey ,
const Real*
metSolution ,
const Stencil< double , 3 > stencil1[8] ,
const Stencil< double , 3 > stencil2[8][8] );
289 std::unordered_map< long long , int > boundaryRoots;
291 std::unordered_map< long long , std::pair< Real , pcl::poisson::Point3D< Real > > > *boundaryValues;
295 char *cornerValuesSet , *cornerNormalsSet , *edgesSet;
312 void GetMCIsoEdges(
TreeOctNode* node ,
int sDepth , std::vector< std::pair< RootInfo , RootInfo > >& edges );
313 static int GetEdgeLoops( std::vector< std::pair< RootInfo , RootInfo > >& edges , std::vector< std::vector< std::pair< RootInfo , RootInfo > > >&
loops);
314 static int InteriorFaceRootCount(
const TreeOctNode* node ,
const int &
faceIndex ,
int maxDepth );
315 static int EdgeRootCount(
const TreeOctNode* node ,
int edgeIndex ,
int maxDepth );
321 static int GetRootPair(
const RootInfo& root ,
int maxDepth ,
RootInfo& pair );
338 std::vector< pcl::poisson::Point3D<Real> >*
normals;
350 template<
typename Po
intNT>
int
370#include "multi_grid_octree_data.hpp"
Iterator class for point clouds with or without given indices.
shared_ptr< const PointCloud< PointT > > ConstPtr
void RefineBoundary(int subdivisionDepth)
void setBSplineData(int maxDepth, Real normalSmooth=-1, bool reflectBoundary=false)
static double MemoryUsage(void)
int LaplacianMatrixIteration(int subdivideDepth, bool showResidual, int minIters, double accuracy)
Real * GetSolutionGrid(int &res, float isoValue=0.f, int depth=-1)
std::vector< pcl::poisson::Point3D< Real > > * normals
void SetLaplacianConstraints(void)
Real * GetWeightGrid(int &res, int depth=-1)
static double maxMemoryUsage
pcl::poisson::BSplineData< Degree, BSplineDataReal > fData
int setTree(typename pcl::PointCloud< PointNT >::ConstPtr input_, int maxDepth, int minDepth, int kernelDepth, Real samplesPerNode, Real scaleFactor, Point3D< Real > ¢er, Real &scale, int useConfidence, Real constraintWeight, bool adaptiveWeights)
void setEdgeTable(EdgeTableData &eData, const TreeOctNode *rootNode, int depth, int threads)
void setCornerTable(CornerTableData &cData, const TreeOctNode *rootNode, int threads) const
void setEdgeTable(EdgeTableData &eData, const TreeOctNode *rootNode, int threads)
int getMaxEdgeCount(const TreeOctNode *rootNode, int depth, int threads) const
void setCornerTable(CornerTableData &cData, int threads) const
int getMaxCornerCount(const TreeOctNode *rootNode, int depth, int maxDepth, int threads) const
void set(TreeOctNode &root)
void setEdgeTable(EdgeTableData &eData, int threads)
void setCornerTable(CornerTableData &cData, const TreeOctNode *rootNode, int depth, int threads) const
Real centerWeightContribution
static long long CenterIndex(int depth, const int offSet[DIMENSION], int maxDepth, int index[DIMENSION])
static long long CornerIndex(int depth, const int offSet[DIMENSION], int cIndex, int maxDepth, int index[DIMENSION])
static long long FaceIndex(const TreeOctNode *node, int fIndex, int maxDepth, int index[DIMENSION])
static long long CornerIndexKey(const int index[DIMENSION])
static long long EdgeIndex(const TreeOctNode *node, int eIndex, int maxDepth, int index[DIMENSION])
pcl::poisson::OctNode< class TreeNodeData, Real > TreeOctNode
int idx[pcl::poisson::Cube::CORNERS]
std::vector< int > offsets
CornerIndices & operator[](const TreeOctNode *node)
std::vector< CornerIndices > cTable
CornerIndices & cornerIndices(const TreeOctNode *node)
int idx[pcl::poisson::Cube::EDGES]
std::vector< EdgeIndices > eTable
std::vector< int > offsets
EdgeIndices & operator[](const TreeOctNode *node)
EdgeIndices & edgeIndices(const TreeOctNode *node)