PeriDyno 1.0.0
Loading...
Searching...
No Matches
NormalVisualization.h
Go to the documentation of this file.
1
16
17#pragma once
18#include "Node.h"
19#include "Topology/TriangleSet.h"
20
22#include "GLPointVisualModule.h"
25
26
27namespace dyno
28{
29 template<typename TDataType>
31 {
32 DECLARE_TCLASS(Normal, TDataType);
33
34 public:
35 typedef typename TDataType::Real Real;
36 typedef typename TDataType::Coord Coord;
37
40 {
41 d_points.clear();
42 d_edges.clear();
43 d_normalPt.clear();
44 d_normal.clear();
45 triangleCenter.clear();
46 }
47
48 std::string getNodeType() override { return "Visualization"; }
49
50 public:
51 DEF_VAR(Real, Length, 0.2, "LinLength");
52 DEF_VAR(bool, Normalize, true, "Normalize");
53
54 DEF_VAR(Real, LineWidth, 0.01, " LineWidth");
55 DEF_VAR(bool, ShowWireframe, true, "ShowWireframe");
56 DEF_VAR(int, ArrowResolution, 8 , "");
57
58 //In
60 DEF_ARRAY_IN(Coord, InNormal, DeviceType::GPU, "");
61 DEF_ARRAY_IN(Real, Scalar, DeviceType::GPU, "");
62
63 //Normal
65 DEF_ARRAY_STATE(Coord, Normal, DeviceType::GPU, "");
67
68 //Arrow
71 DEF_ARRAY_STATE(Transform3f, TransformsCylinder, DeviceType::GPU, "Instance transform");
72 DEF_ARRAY_STATE(Transform3f, TransformsCone, DeviceType::GPU, "Instance transform");
73
74
75 protected:
76 void resetStates() override;
77 void updateStates() override;
78
79 private:
80 void varChanged();
82
83 std::shared_ptr<GLInstanceVisualModule> glInstanceCylinder;
84 std::shared_ptr<GLInstanceVisualModule> glInstanceCone;
90 };
91
93}
#define IMPLEMENT_TCLASS(name, T1)
Definition Object.h:103
DArray< TopologyModule::Edge > d_edges
std::shared_ptr< GLInstanceVisualModule > glInstanceCylinder
DEF_INSTANCE_IN(TriangleSet< TDataType >, TriangleSet, "")
DEF_ARRAY_STATE(Transform3f, TransformsCone, DeviceType::GPU, "Instance transform")
DEF_INSTANCE_STATE(TriangleSet< TDataType >, ArrowCone, "")
DEF_ARRAY_STATE(Coord, Normal, DeviceType::GPU, "")
std::shared_ptr< GLInstanceVisualModule > glInstanceCone
DEF_VAR(Real, Length, 0.2, "LinLength")
DEF_VAR(Real, LineWidth, 0.01, " LineWidth")
void updateStates() override
void resetStates() override
DECLARE_TCLASS(Normal, TDataType)
DEF_INSTANCE_STATE(PointSet< TDataType >, TriangleCenter, "")
DEF_VAR(bool, Normalize, true, "Normalize")
DEF_ARRAY_IN(Real, Scalar, DeviceType::GPU, "")
DEF_INSTANCE_STATE(EdgeSet< TDataType >, NormalSet, "")
std::string getNodeType() override
DEF_ARRAY_STATE(Transform3f, TransformsCylinder, DeviceType::GPU, "Instance transform")
DEF_VAR(bool, ShowWireframe, true, "ShowWireframe")
DEF_VAR(int, ArrowResolution, 8, "")
DEF_INSTANCE_STATE(TriangleSet< TDataType >, ArrowCylinder, "")
DEF_ARRAY_IN(Coord, InNormal, DeviceType::GPU, "")
A PointSet stores the coordinates for a set of independent points.
Definition PointSet.h:8
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Array< T, DeviceType::GPU > DArray
Definition Array.inl:89
Transform< float, 3 > Transform3f