HuginBase::ImageVariable< Type > Class Template Reference
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 | |
| ImageVariable (Type data) | |
| construct with a given initial data value | |
| ImageVariable (ImageVariable< Type > *link) | |
| Construct linked with something else. | |
| ImageVariable (const ImageVariable &source) | |
| Copy constructor. | |
| ~ImageVariable () | |
| destructor | |
| Type | getData () const |
| get the variable's value | |
| void | setData (const Type data) |
| Set the variable groups' value. | |
| void | linkWith (ImageVariable< Type > *link) |
| Create a link. | |
| void | removeLinks () |
| remove all links | |
| bool | isLinked () const |
| Find out if there are other linked variables. | |
| bool | isLinkedWith (const ImageVariable< Type > *otherVariable) const |
| Find out if this variable is linked to a given variable. | |
Protected Member Functions | |
| bool | searchBackwards (const ImageVariable< Type > *otherVariable) const |
| Find if we are linked to another ImageVariable earlier in the list. | |
| bool | searchForwards (const ImageVariable< Type > *otherVariable) const |
| Find if we are linked to another ImageVariable later in the list. | |
| ImageVariable< Type > * | findStart () |
| Find the first item in the list of links with this ImageVariable. | |
| ImageVariable< Type > * | findEnd () |
| Find the last item in the list of links with this ImageVariable. | |
| void | setBackwards (const Type data) |
| Set all linked variables earlier in the list to some given data. | |
| void | setForwards (const Type data) |
| Set all linked variables later in the list to some given data. | |
Protected Attributes | |
| Type | m_data |
| the data that will be returned when getData() is called. | |
| ImageVariable< Type > * | m_linkPrevious |
| The item preceding us in the list of links. | |
| ImageVariable< Type > * | m_linkNext |
| The item following us in the list of links. | |
Detailed Description
template<class Type>
class HuginBase::ImageVariable< Type >
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.
- Todo:
- These will probably be copied when creating the Undo/redo data, but their pointers will remain the same. Therefore when copying a SrcPanoImg, we should offset all the pointers by the difference between the old and new SrcPanoImg, so the links are relatively the same.
Constructor & Destructor Documentation
|
|||||||||
|
constructor
|
|
||||||||||
|
construct with a given initial data value
|
|
||||||||||
|
Construct linked with something else. Sets the data from the linked item. Behaves like linkWith.
|
|
||||||||||
|
Copy constructor. Genrally copied for a getSrcImage call, so make the copy independant from the other image variables. |
|
|||||||||
|
destructor
|
Member Function Documentation
|
|||||||||
|
Find the last item in the list of links with this ImageVariable.
|
|
|||||||||
|
Find the first item in the list of links with this ImageVariable.
|
|
|||||||||
|
get the variable's value
|
|
|||||||||
|
Find out if there are other linked variables.
|
|
||||||||||
|
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. The execution time depends on how the variables were linked. If linked like in the example in linkWith, then it is fastest to use the variable with the largest array index to look for the other one. In the worst case, the variables are not linked, and the time taken is O(n) where n is the number of linked variables to this object.
|
|
||||||||||
|
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) It takes longer to link when this element is already linked to many other variables. The fastest way to link an array of variables is: for (int index = 1; index < size; index++) { variables_array[index].linkWith(&(variables_array[index - 1])); } worst case time is O(n+m) where n is the number of linked variables to the object you are calling from, and m is the number of linked variables of the object you pass as a pointer.
|
|
|||||||||
|
remove all links After calling this, setData will only change the value of this ImageVariable. |
|
||||||||||
|
Find if we are linked to another ImageVariable earlier in the list.
|
|
||||||||||
|
Find if we are linked to another ImageVariable later in the list.
|
|
||||||||||
|
Set all linked variables earlier in the list to some given data.
|
|
||||||||||
|
Set the variable groups' value. Calling this sets the value returned by getData for this ImageVariable and any ImageVariables linked to this one.
|
|
||||||||||
|
Set all linked variables later in the list to some given data.
|
Member Data Documentation
|
|||||
|
the data that will be returned when getData() is called.
|
|
|||||
|
The item following us in the list of links.
|
|
|||||
|
The item preceding us in the list of links.
|
The documentation for this class was generated from the following file:
- hugin_base/panodata/ImageVariable.h
1.3.9.1