PeriDyno 1.0.0
Loading...
Searching...
No Matches
GLPointVisualNode.cpp
Go to the documentation of this file.
1#include "GLPointVisualNode.h"
2
3#include <Module/CalculateNorm.h>
5#include <ColorMapping.h>
6
7namespace dyno
8{
9 template<typename TDataType>
11 : Node()
12 {
13 auto calculateNorm = std::make_shared<CalculateNorm<DataType3f>>();
14 auto colorMapper = std::make_shared<ColorMapping<DataType3f>>();
15 colorMapper->varMax()->setValue(5.0f);
16
17 this->inVector()->connect(calculateNorm->inVec());
18 calculateNorm->outNorm()->connect(colorMapper->inScalar());
19
20 auto ptRender = std::make_shared<GLPointVisualModule>();
21 this->varColor()->connect(ptRender->varBaseColor());
22 ptRender->setColorMapMode(GLPointVisualModule::PER_VERTEX_SHADER);
23
24 this->inPoints()->connect(ptRender->inPointSet());
25 colorMapper->outColor()->connect(ptRender->inColor());
26
27 this->graphicsPipeline()->pushModule(calculateNorm);
28 this->graphicsPipeline()->pushModule(colorMapper);
29 this->graphicsPipeline()->pushModule(ptRender);
30 }
31
32 template<typename TDataType>
34 {
35 printf("GLPointVisualNode released \n");
36 }
37
38 template<typename TDataType>
40 {
41 return "Visualization";
42 }
43
44 template<typename TDataType>
46 {
47 this->animationPipeline()->update();
48 }
49
51}
#define DEFINE_CLASS(name)
Definition Object.h:140
std::string getNodeType() override
std::shared_ptr< GraphicsPipeline > graphicsPipeline()
Definition Node.cpp:320
std::shared_ptr< AnimationPipeline > animationPipeline()
Definition Node.cpp:311
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25