@@ -76,6 +76,49 @@ function sortVarNested(vars::Vector{Symbol})::Vector{Symbol}
76
76
return retvars
77
77
end
78
78
79
+ """
80
+ $SIGNATURES
81
+
82
+ Return the factor type used in a `::DFGFactor`.
83
+
84
+ Notes:
85
+ - OBSOLETE, use newer getFactorType instead.
86
+
87
+ Related
88
+
89
+ getFactorType
90
+ """
91
+ function getfnctype (data:: GenericFunctionNodeData )
92
+ # TODO what is this?
93
+ if typeof (data). name. name == :VariableNodeData
94
+ return VariableNodeData
95
+ end
96
+
97
+ # this looks right
98
+ return data. fnc. usrfnc!
99
+ end
100
+ function getfnctype (fact:: DFGFactor ; solveKey:: Symbol = :default )
101
+ data = getData (fact) # TODO , solveKey=solveKey)
102
+ return getfnctype (data)
103
+ end
104
+ function getfnctype (dfg:: T , lbl:: Symbol ; solveKey:: Symbol = :default ) where T <: AbstractDFG
105
+ getfnctype (getFactor (dfg, exvertid))
106
+ end
107
+
108
+ """
109
+ $SIGNATURES
110
+
111
+ Return user factor type from factor graph identified by label `::Symbol`.
112
+
113
+ Notes
114
+ - Replaces older `getfnctype`.
115
+ """
116
+ getFactorType (data:: GenericFunctionNodeData ) = data. fnc. usrfnc!
117
+ getFactorType (fct:: DFGFactor ) = getFactorType (getData (fct))
118
+ function getFactorType (dfg:: G , lbl:: Symbol ) where G <: AbstractDFG
119
+ getFactorType (getFactor (dfg, lbl))
120
+ end
121
+
79
122
80
123
"""
81
124
$SIGNATURES
@@ -102,3 +145,29 @@ function lsfPriors(dfg::G)::Vector{Symbol} where G <: AbstractDFG
102
145
end
103
146
return priors
104
147
end
148
+
149
+ """
150
+ $(SIGNATURES)
151
+
152
+ Variable nodes softtype information holding a variety of meta data associated with the type of variable stored in that node of the factor graph.
153
+
154
+ Related
155
+
156
+ getVariableType
157
+ """
158
+ function getSofttype (vnd:: VariableNodeData )
159
+ return vnd. softtype
160
+ end
161
+ function getSofttype (v:: DFGVariable ; solveKey:: Symbol = :default )
162
+ return getSofttype (getData (v, solveKey= solveKey))
163
+ end
164
+
165
+ """
166
+ $SIGNATURES
167
+
168
+ Return the DFGVariable softtype in factor graph `dfg<:AbstractDFG` and label `::Symbol`.
169
+ """
170
+ getVariableType (var:: DFGVariable ; solveKey:: Symbol = :default ) = getSofttype (var, solvekey= solvekey)
171
+ function getVariableType (dfg:: G , lbl:: Symbol ; solveKey:: Symbol = :default ) where G <: AbstractDFG
172
+ getVariableType (getVariable (dfg, lbl), solveKey= solveKey)
173
+ end
0 commit comments