PeriDyno 1.0.0
Loading...
Searching...
No Matches
Group.cu
Go to the documentation of this file.
1#include "Group.h"
2#include "Topology/PointSet.h"
3#include "GLSurfaceVisualModule.h"
4#include "GLWireframeVisualModule.h"
5#include "GLPointVisualModule.h"
6#include <sstream>
7
8
9namespace dyno
10{
11 template<typename TDataType>
12 Group<TDataType>::Group()
13 {
14 auto callback = std::make_shared<FCallBackFunc>(std::bind(&Group<TDataType>::varChanged, this));
15
16 this->varPrimitiveId()->attach(callback);
17 this->varEdgeId()->attach(callback);
18 this->varPointId()->attach(callback);
19
20 this->inPointId()->tagOptional(true);
21 this->inEdgeId()->tagOptional(true);
22 this->inPrimitiveId()->tagOptional(true);
23
24 }
25
26 template<typename TDataType>
27 void Group<TDataType>::resetStates()
28 {
29 varChanged();
30 }
31
32
33 template<typename TDataType>
34 void Group<TDataType>::varChanged()
35 {
36
37 std::string currentString;
38
39 if (this->varPointId()->getValue().size())
40 {
41 currentString = this->varPointId()->getData();
42 updateID(currentString, selectedPointID);
43 }
44
45 if (this->varEdgeId()->getValue().size())
46 {
47 currentString = this->varEdgeId()->getData();
48 updateID(currentString, selectedEdgeID);
49 }
50
51 if (this->varPrimitiveId()->getValue().size())
52 {
53 currentString = this->varPrimitiveId()->getData();
54 updateID(currentString, selectedPrimitiveID);
55 }
56
57
58 }
59
60
61 template<typename TDataType>
62 void Group<TDataType>::substrFromTwoString(std::string& first, std::string& Second, std::string& line, std::string& myStr, int& index)
63 {
64 if (index < int(line.size()))
65 {
66 size_t posStart = line.find(first, index);
67 size_t posEnd = line.find(Second, posStart + 1);
68
69
70 myStr = line.substr(posStart, posEnd - posStart);
71 index = posEnd - 1;
72
73 std::stringstream ss2(line);
74
75 }
76 else
77 {
78 return;
79 }
80
81 }
82
83
84 DEFINE_CLASS(Group);
85}