Hugintrunk
0.1
|
An ImageVariable stores a value that can be linked to other ImageVariables of the same type. More...
#include <ImageVariable.h>
Public Member Functions | |
ImageVariable () | |
constructor More... | |
ImageVariable (Type data) | |
construct with a given initial data value More... | |
ImageVariable (ImageVariable< Type > *link) | |
Construct linked with something else. More... | |
ImageVariable (const ImageVariable &source) | |
Copy constructor. More... | |
~ImageVariable () | |
destructor More... | |
Type | getData () const |
get the variable's value More... | |
void | setData (const Type data) |
Set the variable groups' value. More... | |
void | linkWith (ImageVariable< Type > *link) |
Create a link. More... | |
void | removeLinks () |
remove all links More... | |
bool | isLinked () const |
Find out if there are other linked variables. More... | |
bool | isLinkedWith (const ImageVariable< Type > *otherVariable) const |
Find out if this variable is linked to a given variable. More... | |
Protected Attributes | |
std::shared_ptr< Type > | m_ptr |
An ImageVariable stores a value that can be linked to other ImageVariables of the same type.
When you link ImageVariables, setting one using setData sets all the other linked ImageVariables. Then when reading the ImageVariables data with getData you get the last value set on any of the linked ImageVariables.
Type | The type of the data value to store with this variable. It is the return type for getData and the parameter type for setData. |
Definition at line 48 of file ImageVariable.h.
HuginBase::ImageVariable< Type >::ImageVariable | ( | ) |
constructor
Definition at line 140 of file ImageVariable.h.
|
explicit |
construct with a given initial data value
Definition at line 145 of file ImageVariable.h.
|
explicit |
Construct linked with something else.
Sets the data from the linked item. Behaves like linkWith.
link | ImageVariable which to link with. It provides the data for the newly constructed variable. |
Definition at line 150 of file ImageVariable.h.
HuginBase::ImageVariable< Type >::ImageVariable | ( | const ImageVariable< Type > & | source | ) |
Copy constructor.
Generally copied for a getSrcImage call, so make the copy independant from the other image variables.
Definition at line 155 of file ImageVariable.h.
HuginBase::ImageVariable< Type >::~ImageVariable | ( | ) |
destructor
Definition at line 162 of file ImageVariable.h.
Type HuginBase::ImageVariable< Type >::getData | ( | ) | const |
get the variable's value
Definition at line 169 of file ImageVariable.h.
Referenced by HuginBase::PTOVariableConverterSingle< code1, code2, code3, T >::addToVariableMap(), HuginBase::PTOVariableConverterFDiff2D< code_x1, code_y1, code_x2, code_y2 >::addToVariableMap(), HuginBase::PTOVariableConverterSingle< code1, code2, code3, T >::getValueFromVariable(), HuginBase::PTOVariableConverterFDiff2D< code_x1, code_y1, code_x2, code_y2 >::getValueFromVariable(), and HuginBase::PTOVariableConverterFDiff2D< code_x1, code_y1, code_x2, code_y2 >::setValueFromVariable().
bool HuginBase::ImageVariable< Type >::isLinked | ( | ) | const |
Find out if there are other linked variables.
Definition at line 203 of file ImageVariable.h.
bool HuginBase::ImageVariable< Type >::isLinkedWith | ( | const ImageVariable< Type > * | otherVariable | ) | const |
Find out if this variable is linked to a given variable.
Find if this variable has been linked (either directly or indirectly) with the variable pointed to by otherVariable.
otherVariable | the variable to check linkage with. |
Definition at line 209 of file ImageVariable.h.
References HuginBase::ImageVariable< Type >::m_ptr.
void HuginBase::ImageVariable< Type >::linkWith | ( | ImageVariable< Type > * | link | ) |
Create a link.
After making a link to another variable, this variable, and any variables we link link to, will now have the passed in variable's data. Calling setData(data) on either variable, or any variable previously linked with either variable, sets the return value for both variable's getData() function, and the getData function of variables previously linked with either variable. (i.e. Links are bidirectional and accumlative)
link | a pointer to the variable to link with. |
Definition at line 181 of file ImageVariable.h.
References DEBUG_INFO, and HuginBase::ImageVariable< Type >::m_ptr.
void HuginBase::ImageVariable< Type >::removeLinks | ( | ) |
remove all links
After calling this, setData will only change the value of this ImageVariable.
Definition at line 197 of file ImageVariable.h.
void HuginBase::ImageVariable< Type >::setData | ( | const Type | data | ) |
Set the variable groups' value.
Calling this sets the value returned by getData for this ImageVariable and any ImageVariables linked to this one.
data | the data to be set for this group. |
Definition at line 175 of file ImageVariable.h.
References data.
Referenced by HuginBase::PTOVariableConverterSingle< code1, code2, code3, T >::setValueFromVariable(), and HuginBase::PTOVariableConverterFDiff2D< code_x1, code_y1, code_x2, code_y2 >::setValueFromVariable().
|
protected |
Definition at line 130 of file ImageVariable.h.
Referenced by HuginBase::ImageVariable< Type >::isLinkedWith(), and HuginBase::ImageVariable< Type >::linkWith().