Descriptor of a level of a Tree (name, attributes, ...). More...
#include <creaImageIOTreeLevelDescriptor.h>
Public Types | |
| typedef std::vector < AttributeDescriptor > | AttributeDescriptorListType |
| The type of attribute container. | |
Public Member Functions | |
| LevelDescriptor (const std::string &name) | |
| Ctor with name. | |
| ~LevelDescriptor () | |
| Destructor. | |
| const std::string & | GetName () const |
| Returns the name of the level. | |
| unsigned int | GetNumberOfAttributes () const |
| Returns the number of attributes of the level. | |
| void | Add (const AttributeDescriptor &) |
| Adds the AttributeDescriptor to the list. | |
| const AttributeDescriptorListType & | GetAttributeDescriptorList (int type=0) const |
| type = 1 without ID and PATIENT_ID | |
| void | CopyAttributeDescriptorList () |
| Copy the original list of attributes. | |
| const std::vector< std::string > & | GetIdentifierList () const |
| const std::vector< std::string > & | GetLabelList () const |
Private Attributes | |
| std::string | mName |
| AttributeDescriptorListType | mAttributeDescriptorList |
| AttributeDescriptorListType | mAttributeDescriptorListWID |
| std::vector< std::string > | mIdentifierList |
| The list of attributes with flag IDENTIFIER set. | |
| std::vector< std::string > | mLabelList |
| The list of attributes with flag LABEL set. | |
Descriptor of a level of a Tree (name, attributes, ...).
Definition at line 17 of file creaImageIOTreeLevelDescriptor.h.
| typedef std::vector<AttributeDescriptor> creaImageIO::tree::LevelDescriptor::AttributeDescriptorListType |
The type of attribute container.
Definition at line 36 of file creaImageIOTreeLevelDescriptor.h.
| creaImageIO::tree::LevelDescriptor::LevelDescriptor | ( | const std::string & | name | ) | [inline] |
| creaImageIO::tree::LevelDescriptor::~LevelDescriptor | ( | ) | [inline] |
| void creaImageIO::tree::LevelDescriptor::Add | ( | const AttributeDescriptor & | a | ) |
Adds the AttributeDescriptor to the list.
Definition at line 10 of file creaImageIOTreeLevelDescriptor.cpp.
References creaImageIO::tree::AttributeDescriptor::GetFlags(), creaImageIO::tree::AttributeDescriptor::GetKey(), GimmickMessage, creaImageIO::tree::AttributeDescriptor::IDENTIFIER, creaImageIO::tree::AttributeDescriptor::LABEL, mAttributeDescriptorList, mIdentifierList, and mLabelList.
{
GimmickMessage(5,"Adding Attribute Descriptor '"<<a.GetKey()
<<"' to LevelDescriptor"
<<std::endl);
mAttributeDescriptorList.push_back(a);
if ( a.GetFlags() & AttributeDescriptor::IDENTIFIER )
{
GimmickMessage(6,"Is an IDENTIFIER"<<std::endl);
mIdentifierList.push_back(a.GetKey());
}
if ( a.GetFlags() & AttributeDescriptor::LABEL )
{
GimmickMessage(6,"Is a LABEL"<<std::endl);
mLabelList.push_back(a.GetKey());
}
}

| void creaImageIO::tree::LevelDescriptor::CopyAttributeDescriptorList | ( | ) |
Copy the original list of attributes.
Definition at line 29 of file creaImageIOTreeLevelDescriptor.cpp.
References mAttributeDescriptorList, and mAttributeDescriptorListWID.
{
mAttributeDescriptorListWID = mAttributeDescriptorList;
for(AttributeDescriptorListType::iterator it = mAttributeDescriptorListWID.begin();
it != mAttributeDescriptorListWID.end(); it++)
{
if((*it).GetKey() == "ID")
{
mAttributeDescriptorListWID.erase(it);
break;
}
}
for(AttributeDescriptorListType::iterator it = mAttributeDescriptorListWID.begin();
it != mAttributeDescriptorListWID.end(); it++)
{
if((*it).GetKey() == "PARENT_ID")
{
mAttributeDescriptorListWID.erase(it);
break;
}
}
}
| const AttributeDescriptorListType& creaImageIO::tree::LevelDescriptor::GetAttributeDescriptorList | ( | int | type = 0 |
) | const [inline] |
type = 1 without ID and PATIENT_ID
Returns the list of AttributeDescriptor (const) type = 0 all attributes
Definition at line 41 of file creaImageIOTreeLevelDescriptor.h.
References mAttributeDescriptorList, and mAttributeDescriptorListWID.
{ if (type == 0)
return mAttributeDescriptorList;
else
return mAttributeDescriptorListWID;
}
| const std::vector<std::string>& creaImageIO::tree::LevelDescriptor::GetIdentifierList | ( | ) | const [inline] |
Definition at line 52 of file creaImageIOTreeLevelDescriptor.h.
References mIdentifierList.
Referenced by creaImageIO::tree::Node::Matches().
{ return mIdentifierList; }

| const std::vector<std::string>& creaImageIO::tree::LevelDescriptor::GetLabelList | ( | ) | const [inline] |
Definition at line 55 of file creaImageIOTreeLevelDescriptor.h.
References mLabelList.
Referenced by creaImageIO::tree::Node::GetLabel().
{ return mLabelList; }

| const std::string& creaImageIO::tree::LevelDescriptor::GetName | ( | ) | const [inline] |
Returns the name of the level.
Definition at line 26 of file creaImageIOTreeLevelDescriptor.h.
References mName.
Referenced by creaImageIO::SQLiteTreeHandler::DBCreate(), creaImageIO::SQLiteTreeHandler::DBImportTreeDescription(), creaImageIO::SQLiteTreeHandler::DBLoadChildren(), creaImageIO::SQLiteTreeHandler::DBRecursiveRemoveNode(), creaImageIO::SQLiteTreeHandler::getAllAttributes(), creaImageIO::SQLiteTreeHandler::GetNumberOfChildren(), creaImageIO::SQLiteTreeHandler::GetUpLevelNodeId(), creaImageIO::WxTreeView::OnLocalCopy(), creaImageIO::WxTreeView::RemoveSelected(), and creaImageIO::WxTreeView::WxTreeView().
{ return mName; }

| unsigned int creaImageIO::tree::LevelDescriptor::GetNumberOfAttributes | ( | ) | const [inline] |
Returns the number of attributes of the level.
Definition at line 29 of file creaImageIOTreeLevelDescriptor.h.
References mAttributeDescriptorList.
{ return mAttributeDescriptorList.size(); }
Definition at line 61 of file creaImageIOTreeLevelDescriptor.h.
Referenced by Add(), CopyAttributeDescriptorList(), GetAttributeDescriptorList(), and GetNumberOfAttributes().
AttributeDescriptorListType creaImageIO::tree::LevelDescriptor::mAttributeDescriptorListWID [private] |
Definition at line 63 of file creaImageIOTreeLevelDescriptor.h.
Referenced by CopyAttributeDescriptorList(), and GetAttributeDescriptorList().
std::vector<std::string> creaImageIO::tree::LevelDescriptor::mIdentifierList [private] |
The list of attributes with flag IDENTIFIER set.
Definition at line 65 of file creaImageIOTreeLevelDescriptor.h.
Referenced by Add(), and GetIdentifierList().
std::vector<std::string> creaImageIO::tree::LevelDescriptor::mLabelList [private] |
The list of attributes with flag LABEL set.
Definition at line 67 of file creaImageIOTreeLevelDescriptor.h.
Referenced by Add(), and GetLabelList().
std::string creaImageIO::tree::LevelDescriptor::mName [private] |
Definition at line 59 of file creaImageIOTreeLevelDescriptor.h.
Referenced by GetName().
1.7.1