SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
ComponentItemDefinition.h
1 //=========================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //=========================================================================
10 
11 #ifndef smtk_attribute_ComponentItemDefinition_h
12 #define smtk_attribute_ComponentItemDefinition_h
13 
14 #include "smtk/attribute/ReferenceItemDefinition.h"
15 
16 #include "smtk/resource/Component.h"
17 #include "smtk/resource/Resource.h"
18 
19 namespace smtk
20 {
21 namespace attribute
22 {
23 
26 class SMTKCORE_EXPORT ComponentItemDefinition : public ReferenceItemDefinition
27 {
28 public:
31 
32  static smtk::attribute::ComponentItemDefinitionPtr New(const std::string& sname)
33  {
35  }
36 
37  ~ComponentItemDefinition() override;
38 
39  Item::Type type() const override;
40 
41  bool isValueValid(smtk::resource::ConstPersistentObjectPtr value) const override;
42 
44  smtk::attribute::ItemPtr buildItem(Attribute* owningAttribute, int itemPosition) const override;
46  smtk::attribute::ItemPtr buildItem(Item* owningItem, int position, int subGroupPosition)
47  const override;
48 
50  smtk::attribute::ItemDefinition::CopyInfo& info) const override;
51 
52 protected:
53  ComponentItemDefinition(const std::string& myName);
54 
55 private:
56  void setOnlyResources(bool choice) final { ReferenceItemDefinition::setOnlyResources(choice); }
57 };
58 
59 } // namespace attribute
60 } // namespace smtk
61 
62 #endif /* smtk_attribute_ComponentItemDefinition_h */
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
smtk::attribute::Item::Type
Type
Definition: Item.h:52
smtk::attribute::ReferenceItemDefinition::setOnlyResources
virtual void setOnlyResources(bool choice)
Set/Get a flag to determine whether the ReferenceItem should only hold references.
Definition: ReferenceItemDefinition.h:128
smtk::resource::ConstPersistentObjectPtr
smtk::shared_ptr< const smtk::resource::PersistentObject > ConstPersistentObjectPtr
Definition: PublicPointerDefs.h:287
smtk::attribute::ReferenceItemDefinition
A definition for attribute items that store smtk::resource::PersistentObjectPtr as values.
Definition: ReferenceItemDefinition.h:40
smtk::attribute::ItemDefinition::CopyInfo
Definition: ItemDefinition.h:47
smtk::attribute::Item
Definition: Item.h:43
smtkTypeMacro
#define smtkTypeMacro(...)
Add typedefs to a class for identifcation.
Definition: SharedFromThis.h:51
smtk::attribute::ComponentItemDefinitionPtr
smtk::shared_ptr< smtk::attribute::ComponentItemDefinition > ComponentItemDefinitionPtr
Definition: PublicPointerDefs.h:541
smtkSuperclassMacro
#define smtkSuperclassMacro(...)
Add a typedef to the superclass of this class.
Definition: SharedFromThis.h:87
smtk::attribute::Attribute
Represent a (possibly composite) value according to a definition.
Definition: Attribute.h:49
smtk::attribute::ComponentItemDefinition
A definition for attribute items that store component UUIDs as values.
Definition: ComponentItemDefinition.h:26
smtk::attribute::ItemPtr
smtk::shared_ptr< smtk::attribute::Item > ItemPtr
Definition: PublicPointerDefs.h:467
smtk::attribute::ItemDefinitionPtr
smtk::shared_ptr< smtk::attribute::ItemDefinition > ItemDefinitionPtr
Definition: PublicPointerDefs.h:473