#include <HxBlob2dRelation.h>
Public Methods | |
| HxBlob2dRelation () | |
| Constructor. More... | |
| ~HxBlob2dRelation () | |
| Destructor. More... | |
| int | ident () const |
| The identifier of this relation. More... | |
| void | add (HxBlob2d *blob, HxBlob2dList rels) |
| Add a blob and its relations. More... | |
| HxBlob2dListConstIter | getBlobBegin () const |
| Get begin of the blobs. More... | |
| HxBlob2dListConstIter | getBlobEnd () const |
| Get end (STL term) of the blobs. More... | |
| HxBlob2dList | findRelatedBlobs (HxBlob2d *blob) |
| Find relations of given blob. More... | |
| HxBlob2dListConstIter | findRelatedBlobsBegin (HxBlob2d *blob) const |
| Get begin of related blobs list. More... | |
| HxBlob2dListConstIter | findRelatedBlobsEnd (HxBlob2d *blob) const |
| Get end (STL term) of related blobs list. More... | |
| HxBlob2dListBackInserter | findRelatedBlobsInserter (HxBlob2d *blob) |
| Get a backinserter for related blobs list. More... | |
| STD_OSTREAM & | put (STD_OSTREAM &os) const |
| Put relation on stream. More... | |
Basically, for each blob a list "related" blobs is stored.
|
|
Constructor.
00016 {
00017 }
|
|
|
Destructor.
00020 {
00021 // todo
00022 }
|
|
|
The identifier of this relation.
|
|
||||||||||||
|
Add a blob and its relations.
00026 {
00027 _head.push_back(blob);
00028 _tail.push_back(rels);
00029 }
|
|
|
Get begin of the blobs.
00033 {
00034 return _head.begin();
00035 }
|
|
|
Get end (STL term) of the blobs.
00039 {
00040 return _head.end();
00041 }
|
|
|
Find relations of given blob.
00045 {
00046 for (int i=0 ; i<_head.size() ; i++)
00047 if (_head[i] == blob)
00048 return _tail[i];
00049 return HxBlob2dList();
00050 }
|
|
|
Get begin of related blobs list.
00054 {
00055 for (int i=0 ; i<_head.size() ; i++)
00056 if (_head[i] == blob)
00057 return _tail[i].begin();
00058 return HxBlob2dListConstIter();
00059 }
|
|
|
Get end (STL term) of related blobs list.
00063 {
00064 for (int i=0 ; i<_head.size() ; i++)
00065 if (_head[i] == blob)
00066 return _tail[i].end();
00067 return HxBlob2dListConstIter();
00068 }
|
|
|
Get a backinserter for related blobs list.
00072 {
00073 for (int i=0 ; i<_head.size() ; i++)
00074 if (_head[i] == blob)
00075 return std::back_inserter(_tail[i]);
00076 static HxBlob2dList dummyList;
00077 return std::back_inserter(dummyList);
00078 }
|
|
|
Put relation on stream.
00082 {
00083 os << "Blob2dRelation " << STD_ENDL;
00084 for(int i=0 ; i<_head.size() ; i++) {
00085 os << " blob " << _head[i]->ident() << " rels ";
00086 for (HxBlob2dListConstIter b=_tail[i].begin() ;
00087 b < _tail[i].end() ; b++)
00088 os << (*b)->ident() << ", ";
00089 os << STD_ENDL;
00090 }
00091 return os;
00092 }
|
1.2.12 written by Dimitri van Heesch,
© 1997-2001