PeriDyno 1.2.1
Loading...
Searching...
No Matches
SdfSampler.h
Go to the documentation of this file.
1
16#pragma once
17#include "Node.h"
18#include "Topology/LevelSet.h"
20#include <cmath>
21#include <Volume/VolumeOctree.h>
22#include <Volume/Volume.h >
23#include "Samplers/Sampler.h"
24
25namespace dyno {
26
27 template<typename TDataType>
28 class SdfSampler : public Sampler<TDataType>
29 {
30 DECLARE_TCLASS(SdfSampler, TDataType)
31 public:
32 typedef typename TDataType::Real Real;
33 typedef typename TDataType::Coord Coord;
35
37 ~SdfSampler() override;
38
39 void resetStates() override;
40
41 bool validateInputs() override;
42
43 std::shared_ptr<dyno::DistanceField3D<TDataType>> convert2Uniform(
45 Real h);
46
47 public:
48
50
52
53
54
55 //DEF_INSTANCE_OUT(PointSet<TDataType>, PointSet, "");
56
57 DEF_VAR(float, Spacing, Real(0.02), " ");
58
59 private:
60
61 std::shared_ptr<DistanceField3D<TDataType>> m_inputSDF;
62
63
64 //DEF_VAR(Vec3f, CubeTilt, 0, "Cube Init Rotation");
65
66 //DEF_VAR(Vec3f, X, Coord(1, 0.0f, 0.0f), "Cube Init X Rotation");
67 //DEF_VAR(Vec3f, Y, Coord(0.0f, 1, 0.0f), "Cube Init Y Rotation");
68 //DEF_VAR(Vec3f, Z, Coord(0.0f, 0.0f, 1), "Cube Init Z Rotation");
69
70 //DEF_VAR(Real, Alpha, Real(0), " ");
71 //DEF_VAR(Real, Beta, Real(0), " ");
72 //DEF_VAR(Real, Gamma, Real(0), " ");
73
75
76 Coord mX = Coord(1.0f, 0.0f, 0.0f); //Cube Init X Rotation
77 Coord mY = Coord(0.0f, 1.0f, 0.0f); //Cube Init Y Rotation
78 Coord mZ = Coord(0.0f, 0.0f, 1.0f); //Cube Init Z Rotation
79
80 Real mAlpha = 0.0f;
81 Real mBeta = 0.0f;
82 Real mGamma = 0.0f;
83
84 };
85}
#define DECLARE_TCLASS(name, T1)
Definition Object.h:87
~SdfSampler() override
std::shared_ptr< dyno::DistanceField3D< TDataType > > convert2Uniform(VolumeOctree< TDataType > *volume, Real h)
TDataType::Coord Coord
Definition SdfSampler.h:33
bool validateInputs() override
TopologyModule::Hexahedron Hexahedron
Definition SdfSampler.h:34
void resetStates() override
std::shared_ptr< DistanceField3D< TDataType > > m_inputSDF
Definition SdfSampler.h:61
DEF_VAR(float, Spacing, Real(0.02), " ")
TDataType::Real Real
Definition SdfSampler.h:32
DEF_NODE_PORT(Volume< TDataType >, Volume, "")
DEF_NODE_PORT(VolumeOctree< TDataType >, VolumeOctree, "")
VectorND< PointType, 8 > Hexahedron
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25