The reconstruction code can be interfaced via Reconstructors.h and Extrapolator.h. To use the library, you must choose a finite element type and define three specific data streams by overriding virtual classes.
1. Define Finite Element Types
Reconstruction requires template parameters for the floating point type (Real, typically float) and the dimension (Dim, fixed at 3).
FEMSig: Describes the 1D finite element type. It is a composite of the Degree (integer) and BoundaryType (one of BOUNDARY_FREE, BOUNDARY_DIRICHLET, or BOUNDARY_NEUMANN defined in BSplineData.h).static const unsigned int FEMSig = FEMDegreeAndBType< Degree , BoundaryType >::Signature;
FEMSigs: Describes the tensor-product finite element type (typically isotropic).using FEMSigs = IsotropicUIntPack< Dim , FEMSig >;
2. Implement Data Streams
You must implement the following three stream classes by overriding their virtual methods:
Input Sample Stream
Derive from InputSampleStream< Real , Dim >. Overrides:
void reset(): Resets the stream to the start (required for the two-pass reconstruction process).bool read( Point< Real , Dim > &p , Point< Real , Dim > &n ): Reads the next position/normal pair. Returns true if successful, false at end-of-stream.
Output Polygon Stream
Derive from OutputPolygonStream. Overrides:
size_t size(): Returns the number of polygons written.size_t write( const std::vector< node_index_type > &polygon ): Writes a polygon as a vector of integral indices. Returns the index of the written polygon.
Output Vertex Stream
Derive from OutputVertexStream< Real , Dim >. Overrides:
size_t size(): Returns the number of vertices written.size_t write( Point< Real , Dim > p , Point< Real , Dim > g , Real w ): Writes vertex position p, gradient g, and density weight w. Returns the index of the written vertex.