PeriDyno 1.0.0
Loading...
Searching...
No Matches
VectorVisualNode.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>
30 class VectorVisualNode :public Node
31 {
33
34 public:
35 typedef typename TDataType::Real Real;
36 typedef typename TDataType::Coord Coord;
37
39
40 std::string getNodeType() override { return "Visualization"; }
41
42 DECLARE_ENUM(LineMode,
43 Line = 0,
44 Cylnder = 1,
45 Arrow = 2
46 );
47 public:
48 DEF_VAR(Real, Length, 0.4, "LinLength");
49 DEF_VAR(bool, Normalize, true, "Normalize");
50
51 DEF_ENUM(LineMode, LineMode, LineMode::Line, "");
52 DEF_VAR(Real, LineWidth, 0.04, " LineWidth");
53 DEF_VAR(int, ArrowResolution, 8 , "");
54 DEF_VAR(int,Debug,0,"debug");
55
56 //In
58 DEF_ARRAY_IN(Coord, InVector, DeviceType::GPU, "");
59 DEF_ARRAY_IN(Real, Scalar, DeviceType::GPU, "");
60
61 //Normal
63 DEF_ARRAY_STATE(Coord, Normal, DeviceType::GPU, "");
64
65 //Arrow
68 DEF_ARRAY_STATE(Transform3f, TransformsCylinder, DeviceType::GPU, "Instance transform");
69 DEF_ARRAY_STATE(Transform3f, TransformsCone, DeviceType::GPU, "Instance transform");
70
71
72 protected:
73 void resetStates() override;
74 void updateStates() override;
75
76 private:
77 void varChanged();
79
80
81 std::shared_ptr<GLWireframeVisualModule> gledge;
82 std::shared_ptr<GLInstanceVisualModule> glInstanceCylinder;
83 std::shared_ptr<GLInstanceVisualModule> glInstanceCone;
88 };
89
90
91
93}
#define IMPLEMENT_TCLASS(name, T1)
Definition Object.h:103
A PointSet stores the coordinates for a set of independent points.
Definition PointSet.h:8
DEF_ARRAY_STATE(Transform3f, TransformsCone, DeviceType::GPU, "Instance transform")
std::string getNodeType() override
DArray< Real > d_ConvertColor
DArray< Coord > d_normalPt
DEF_ARRAY_STATE(Coord, Normal, DeviceType::GPU, "")
void updateStates() override
DEF_VAR(Real, Length, 0.4, "LinLength")
void resetStates() override
std::shared_ptr< GLInstanceVisualModule > glInstanceCone
std::shared_ptr< GLInstanceVisualModule > glInstanceCylinder
DEF_VAR(int, ArrowResolution, 8, "")
DEF_INSTANCE_STATE(EdgeSet< TDataType >, NormalSet, "")
DEF_VAR(bool, Normalize, true, "Normalize")
DEF_ARRAY_IN(Real, Scalar, DeviceType::GPU, "")
std::shared_ptr< GLWireframeVisualModule > gledge
DEF_INSTANCE_IN(PointSet< TDataType >, PointSet, "")
DEF_INSTANCE_STATE(TriangleSet< TDataType >, ArrowCone, "")
DECLARE_ENUM(LineMode, Line=0, Cylnder=1, Arrow=2)
DEF_ARRAY_STATE(Transform3f, TransformsCylinder, DeviceType::GPU, "Instance transform")
DEF_VAR(Real, LineWidth, 0.04, " LineWidth")
DECLARE_TCLASS(VectorVisualNode, TDataType)
DEF_ENUM(LineMode, LineMode, LineMode::Line, "")
DArray< TopologyModule::Edge > d_edges
DEF_VAR(int, Debug, 0,"debug")
DEF_INSTANCE_STATE(TriangleSet< TDataType >, ArrowCylinder, "")
DEF_ARRAY_IN(Coord, InVector, DeviceType::GPU, "")
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