PeriDyno 1.0.0
Loading...
Searching...
No Matches
VolumeOctreeBoolean.h
Go to the documentation of this file.
1
16#pragma once
17#include "VolumeOctree.h"
19
21#include "Topology/TriangleSet.h"
23#include "Vector.h"
24#include "VolumeHelper.h"
25
26namespace dyno {
27
28 template<typename TDataType>
29 class VolumeOctreeBoolean : public VolumeOctree<TDataType>
30 {
32 public:
33 typedef typename TDataType::Real Real;
34 typedef typename TDataType::Coord Coord;
36
37 DECLARE_ENUM(BooleanOperation,
38 UNION_SET = 0,
39 INTERSECTION_SET = 1,
40 SUBTRACTION_SET = 2);
41
43 ~VolumeOctreeBoolean() override;
44
45 DEF_NODE_PORT(VolumeOctree<TDataType>, OctreeA, "Volume Octree A");
46 DEF_NODE_PORT(VolumeOctree<TDataType>, OctreeB, "Volume Octree B");
47
48 DEF_VAR(bool, MinDx, true, "");
49
50 DEF_ENUM(BooleanOperation, BooleanType,BooleanOperation::INTERSECTION_SET, "Boolean operation type");
51
52 //void setSignOperation(VolumeHelper<TDataType>::BooleanOperation msign) { this->varBooleanType()->getDataPtr()->setCurrentKey(msign); }
53
54 protected:
55 Coord lowerBound() override { return m_origin; }
56 Coord upperBound() override { return m_origin + m_dx * Coord(m_nx, m_ny, m_nz); }
57
58 bool validateInputs() override;
59
60 void resetStates() override;
61
62 void updateStates() override;
63
64 void initParameter();
65
67
68 private:
69 //原来的origin相对于新的origin的偏移量
72
73 int m_nx;
74 int m_ny;
75 int m_nz;
78 int m_level0 = 0;
79
80 int m_reconstructed_model = EMPTY; //0表示不需要重构,1表示重构模型A,2表示重构模型B
81 };
82}
#define DECLARE_TCLASS(name, T1)
Definition Object.h:87
Vector< PointType, 3 > Triangle
DECLARE_ENUM(BooleanOperation, UNION_SET=0, INTERSECTION_SET=1, SUBTRACTION_SET=2)
DEF_NODE_PORT(VolumeOctree< TDataType >, OctreeB, "Volume Octree B")
TopologyModule::Triangle Triangle
DEF_ENUM(BooleanOperation, BooleanType, BooleanOperation::INTERSECTION_SET, "Boolean operation type")
DEF_NODE_PORT(VolumeOctree< TDataType >, OctreeA, "Volume Octree A")
DEF_VAR(bool, MinDx, true, "")
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
constexpr int EMPTY