PeriDyno 1.0.0
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
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:
49
50 //DEF_INSTANCE_OUT(PointSet<TDataType>, PointSet, "");
51
52 DEF_VAR(float, Spacing, Real(0.02), " ");
53
54 DEF_VAR(Vec3f, CubeTilt, 0, "Cube Init Rotation");
55
56 DEF_VAR(Vec3f, X, Coord(1, 0.0f, 0.0f), "Cube Init X Rotation");
57 DEF_VAR(Vec3f, Y, Coord(0.0f, 1, 0.0f), "Cube Init Y Rotation");
58 DEF_VAR(Vec3f, Z, Coord(0.0f, 0.0f, 1), "Cube Init Z Rotation");
59
60 DEF_VAR(Real, Alpha, Real(0), " ");
61 DEF_VAR(Real, Beta, Real(0), " ");
62 DEF_VAR(Real, Gamma, Real(0), " ");
63 };
64}
#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
DEF_VAR(Real, Alpha, Real(0), " ")
DEF_VAR(Real, Beta, Real(0), " ")
DEF_VAR(Vec3f, CubeTilt, 0, "Cube Init Rotation")
bool validateInputs() override
TopologyModule::Hexahedron Hexahedron
Definition SdfSampler.h:34
DEF_NODE_PORT(VolumeOctree< TDataType >, Volume, "")
void resetStates() override
DEF_VAR(Vec3f, Z, Coord(0.0f, 0.0f, 1), "Cube Init Z Rotation")
DEF_VAR(Vec3f, Y, Coord(0.0f, 1, 0.0f), "Cube Init Y Rotation")
DEF_VAR(float, Spacing, Real(0.02), " ")
DEF_VAR(Real, Gamma, Real(0), " ")
TDataType::Real Real
Definition SdfSampler.h:32
DEF_VAR(Vec3f, X, Coord(1, 0.0f, 0.0f), "Cube Init X Rotation")
VectorND< PointType, 8 > Hexahedron
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Vector< float, 3 > Vec3f
Definition Vector3D.h:93