#pragma once #include "isdfinterpolator.h" #include "octreeEdge.h" #include "octreeFace.h" #include "OctreeADF.h" namespace SDF { class CoonsSdfInterp : public ISdfInterpolator { public: CoonsSdfInterp(void); ~CoonsSdfInterp(void); /* * The main interpolation function */ void setNode(octreeNode *node); double interpolate(const Point &from); private: // Computation state variables. /* * The node we're currently interpolating for. */ octreeNode *node; /* * This will store ptrs to the 8 edges of the octree node * for performing the Coons interp. */ octreeEdge *edges[8]; //////////////////////////////////////////////////////////// // the list of coefficients passing through up to 9 points of uv,vw,uw planes // (for coons interpolation) float m_R0[9]; float m_R1[9]; float m_Q0[9]; float m_Q1[9]; float m_P0[9]; float m_P1[9]; // Clears all state variables, freeing up memory and stuff. void reset(); /* * Helper functions. * These are mostly copied from Young's OctreeADF files. */ //evaluation functions float evalR0(float u, float v); float evalR1(float u, float v); float evalP0(float v, float w); float evalP1(float v, float w); float evalQ0(float u, float w); float evalQ1(float u, float w); float findCOONSInterpDist(const Point& pt); float findCOONSInterpDist(float u, float v, float w); bool isEdgeExtra(octreeEdge* e, octreeNode* no, octreeNode::Direction d1, octreeNode::Direction d2 ); void processOctreeEdges(octreeNode *no); void processOctreeFaces(octreeNode *no); }; }