SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
10 #ifndef smtk_attribute_GroupItem_h
11 #define smtk_attribute_GroupItem_h
13 #include "smtk/CoreExports.h"
14 #include "smtk/attribute/Item.h"
21 class GroupItemDefinition;
53 typedef std::vector<std::vector<smtk::attribute::ItemPtr>>::const_iterator const_iterator;
59 std::size_t numberOfRequiredGroups()
const;
60 std::size_t maxNumberOfGroups()
const;
70 bool activeChildren =
true)
override;
72 bool isExtensible()
const;
74 std::size_t numberOfGroups()
const {
return m_items.size(); }
75 bool setNumberOfGroups(std::size_t newSize);
76 std::size_t numberOfItemsPerGroup()
const;
81 bool insertGroups(std::size_t pos, std::size_t num);
82 bool removeGroup(std::size_t element);
95 assert(m_items.size() > element);
96 assert(m_items[element].size() > ith);
97 return m_items[element][ith];
115 void detachOwningResource()
override;
117 void reset()
override;
126 bool rotate(std::size_t fromPosition, std::size_t toPosition)
override;
133 bool isConditional()
const;
141 bool conditionalsSatisfied(
bool useActiveCategories =
true)
const;
161 const_iterator begin()
const;
162 const_iterator end()
const;
177 bool hasRelevantChildren(
178 bool includeCategories =
true,
179 bool includeReadAccess =
false,
180 int readAccessLevel = 0)
const;
184 GroupItem(
Item* owningItem,
int myPosition,
int mySubGroupPosition);
192 void detachAllItems();
193 bool isValidInternal(
bool useCategories,
const std::set<std::string>& categories)
const override;
194 std::vector<std::vector<smtk::attribute::ItemPtr>> m_items;
195 unsigned int m_maxNumberOfChoices;
196 unsigned int m_minNumberOfChoices;
202 typename T::Ptr GroupItem::findAs(std::size_t element,
const std::string& iname,
SearchStyle style)
204 return smtk::dynamic_pointer_cast<T>(this->find(element, iname, style));
209 GroupItem::findAs(std::size_t element,
const std::string& iname,
SearchStyle style)
const
211 return smtk::dynamic_pointer_cast<const T>(this->find(element, iname, style));
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
Type
Definition: Item.h:65
A group item represents an array of structures in SMTK.
Definition: GroupItem.h:48
Class used to specify copy and assignment options.
Definition: CopyAssignmentOptions.h:272
SearchStyle
How should searches for items be conducted?
Definition: SearchStyle.h:24
virtual Status assign(const smtk::attribute::ConstItemPtr &sourceItem, const CopyAssignmentOptions &options=CopyAssignmentOptions())
Definition: Item.cxx:312
smtk::attribute::ItemPtr item(std::size_t element, std::size_t ith) const
Return the i-th item in for the element-th value of the group.
Definition: GroupItem.h:93
unsigned int maxNumberOfChoices() const
Returns or sets the maximum number of choices that must be set for GroupItem, whose Conditional prope...
Definition: GroupItem.h:156
smtk::shared_ptr< const smtk::attribute::ItemDefinition > ConstItemDefinitionPtr
Definition: PublicPointerDefs.h:482
void setMinNumberOfChoices(unsigned int value)
Returns or sets the minimum number of choices that must be set for the GroupItem, whose Conditional p...
Definition: GroupItem.h:147
Log messages for later presentation to a user or a file.
Definition: Logger.h:94
@ IMMEDIATE
Search only the top level items of an item or attribute.
Definition: SearchStyle.h:26
void setMaxNumberOfChoices(unsigned int value)
Returns or sets the maximum number of choices that must be set for GroupItem, whose Conditional prope...
Definition: GroupItem.h:155
The base class for items that hold information inside an attribute.
Definition: Item.h:47
A return value for methods that need to indicate both success/failure and modification/stasis.
Definition: Status.h:30
#define smtkTypeMacro(...)
Add typedefs to a class for identifcation.
Definition: SharedFromThis.h:148
smtk::shared_ptr< const smtk::attribute::Item > ConstItemPtr
Definition: PublicPointerDefs.h:476
T::Ptr findAs(const std::string &name, SearchStyle style=RECURSIVE_ACTIVE)
return a child item that matches name and satisfies the SearchStyle
Definition: Item.h:371
Represent a (possibly composite) value according to a definition.
Definition: Attribute.h:51
smtk::shared_ptr< smtk::attribute::Item > ItemPtr
Definition: PublicPointerDefs.h:474
A GroupItemDefinition represents a collection of Item Definitions.
Definition: GroupItemDefinition.h:32
smtk::attribute::ItemPtr find(const std::string &name, SearchStyle style=RECURSIVE_ACTIVE)
return a child item that matches name and satisfies the SearchStyle
Definition: Item.cxx:174
unsigned int minNumberOfChoices() const
Returns or sets the minimum number of choices that must be set for the GroupItem, whose Conditional p...
Definition: GroupItem.h:148
smtk::attribute::ItemPtr item(std::size_t ith) const
Return the i-th item in the first entry of the group.
Definition: GroupItem.h:85