688 |
khor |
1 |
//
|
|
|
2 |
// Implicit.h
|
|
|
3 |
// PointReconstruction
|
|
|
4 |
//
|
|
|
5 |
// Created by J. Andreas Bærentzen on 16/03/13.
|
|
|
6 |
// Copyright (c) 2013 J. Andreas Bærentzen. All rights reserved.
|
|
|
7 |
//
|
|
|
8 |
|
|
|
9 |
#ifndef __PointReconstruction__Implicit__
|
|
|
10 |
#define __PointReconstruction__Implicit__
|
|
|
11 |
|
|
|
12 |
#include "../CGLA/Vec3d.h"
|
|
|
13 |
#include "RGrid.h"
|
|
|
14 |
#include "XForm.h"
|
|
|
15 |
|
|
|
16 |
namespace Geometry
|
|
|
17 |
{
|
|
|
18 |
class Implicit
|
|
|
19 |
{
|
|
|
20 |
public:
|
|
|
21 |
virtual ~Implicit() {}
|
|
|
22 |
virtual double eval(const CGLA::Vec3d& p) const = 0;
|
|
|
23 |
virtual CGLA::Vec3d grad(const CGLA::Vec3d& p) const = 0;
|
|
|
24 |
void push_to_surface(CGLA::Vec3d& p, double tau=0, double max_dist=FLT_MAX) const;
|
|
|
25 |
};
|
|
|
26 |
|
|
|
27 |
XForm grid_sample(const Implicit& imp, const CGLA::Vec3d& llf, const CGLA::Vec3d& urt,
|
|
|
28 |
Geometry::RGrid<float>& grid);
|
|
|
29 |
|
|
|
30 |
class VolumetricImplicit: public Implicit {
|
|
|
31 |
const XForm xform;
|
|
|
32 |
const Geometry::RGrid<float>& grid;
|
|
|
33 |
public:
|
|
|
34 |
VolumetricImplicit(const XForm& _xform, const Geometry::RGrid<float>& _grid):
|
|
|
35 |
xform(_xform), grid(_grid) {}
|
|
|
36 |
virtual double eval(const CGLA::Vec3d& p) const;
|
|
|
37 |
virtual CGLA::Vec3d grad(const CGLA::Vec3d& p) const;
|
|
|
38 |
};
|
|
|
39 |
}
|
|
|
40 |
#endif /* defined(__PointReconstruction__Implicit__) */
|