TTK
Loading...
Searching...
No Matches
FTRNode.h
Go to the documentation of this file.
1
11
12#pragma once
13
14#include "FTRDataTypes.h"
15
16#include <vector>
17
18namespace ttk {
19 namespace ftr {
20 class Node {
21 private:
22 idVertex vertexIdentifier_;
23 std::vector<idSuperArc> upArcsIds_;
24 std::vector<idSuperArc> downArcsIds_;
25
26 public:
27 Node() : vertexIdentifier_(nullVertex) {
28 }
29
30 explicit Node(const idVertex vertIdentifier)
31 : vertexIdentifier_(vertIdentifier) {
32 }
33
35 return vertexIdentifier_;
36 }
37
39 vertexIdentifier_ = v;
40 }
41
43 const valence upVal = upArcsIds_.size();
44 const valence downVal = downArcsIds_.size();
45
46 switch(upVal) {
47 case 0:
48 if(downVal == 1) {
50 }
51 break;
52 case 1:
53 if(downVal == 1) {
55 }
56 if(downVal == 2) {
58 }
59 break;
60 }
61
62 switch(downVal) {
63 case 0:
64 if(upVal == 1) {
66 }
67 break;
68 case 1:
69 if(upVal == 1) {
71 }
72 if(upVal == 2) {
74 }
75 break;
76 }
77
79 }
80
81 void reserveUpArc(const idSuperArc nbUpArc) {
82 upArcsIds_.reserve(nbUpArc);
83 }
84
86 return upArcsIds_.size();
87 }
88
89 idSuperArc getUpArc(const idSuperArc index) const {
90 return upArcsIds_[index];
91 }
92
93 void addUpArc(const idSuperArc arcId) {
94 upArcsIds_.emplace_back(arcId);
95 }
96
97 void reserveDownArc(const idSuperArc nbDownArcs) {
98 downArcsIds_.reserve(nbDownArcs);
99 }
100
102 return downArcsIds_.size();
103 }
104
105 idSuperArc getDownArc(const idSuperArc index) const {
106 return downArcsIds_[index];
107 }
108
109 void addDownArc(const idSuperArc arcId) {
110 downArcsIds_.emplace_back(arcId);
111 }
112 };
113
114 } // namespace ftr
115} // namespace ttk
TTK FTRGraph node of the Graph.
Definition FTRNode.h:20
idSuperArc getUpArc(const idSuperArc index) const
Definition FTRNode.h:89
idVertex getVertexIdentifier() const
Definition FTRNode.h:34
ftr::NodeType getType() const
Definition FTRNode.h:42
void addUpArc(const idSuperArc arcId)
Definition FTRNode.h:93
Node(const idVertex vertIdentifier)
Definition FTRNode.h:30
idSuperArc getNbUpArcs() const
Definition FTRNode.h:85
void setVerterIdentifier(const idVertex v)
Definition FTRNode.h:38
void reserveDownArc(const idSuperArc nbDownArcs)
Definition FTRNode.h:97
void reserveUpArc(const idSuperArc nbUpArc)
Definition FTRNode.h:81
idSuperArc getNbDownArcs() const
Definition FTRNode.h:101
void addDownArc(const idSuperArc arcId)
Definition FTRNode.h:109
idSuperArc getDownArc(const idSuperArc index) const
Definition FTRNode.h:105
long unsigned int idSuperArc
SuperArc index in vect_superArcs_.
SimplexId valence
for vertex up/down valence
SimplexId idVertex
Vertex index in scalars_.
The Topology ToolKit.