SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Attribute.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 // .NAME smtkAttribute.h - Represents a standalone piece of simulation information
11 // .SECTION Description
12 // .SECTION See Also
13 
14 #ifndef smtk_attribute_Attribute_h
15 #define smtk_attribute_Attribute_h
16 
17 #include "smtk/CoreExports.h"
18 #include "smtk/PublicPointerDefs.h"
19 #include "smtk/resource/Component.h"
20 
21 #include "smtk/attribute/CopyAssignmentOptions.h"
22 #include "smtk/attribute/ReferenceItem.h"
23 #include "smtk/attribute/SearchStyle.h"
24 #include "smtk/attribute/ValueItem.h"
25 
26 #include "smtk/common/UUID.h" // for template associatedModelEntities()
27 
28 #include <map>
29 #include <set>
30 #include <string>
31 #include <vector>
32 
33 namespace smtk
34 {
35 namespace io
36 {
37 class Logger;
38 };
39 
40 namespace attribute
41 {
42 class Evaluator;
43 class Item;
44 class Resource;
45 
49 class SMTKCORE_EXPORT Attribute : public resource::Component
50 {
51  friend class smtk::attribute::Definition;
52  friend class smtk::attribute::Resource;
53 
54 public:
56  struct SMTKCORE_EXPORT CompareByName
57  {
58  bool operator()(
60  const smtk::attribute::AttributePtr& rhs) const
61  {
62  return lhs->name() < rhs->name();
63  }
64 
65  bool operator()(
67  const smtk::attribute::WeakAttributePtr& rhs) const
68  {
69  auto left = lhs.lock();
70  if (left == nullptr)
71  {
72  return true;
73  }
74  auto right = rhs.lock();
75  if (right == nullptr)
76  {
77  return false;
78  }
79  return left->name() < right->name();
80  }
81  };
82 
84  const std::string& myName,
85  const smtk::attribute::DefinitionPtr& myDefinition)
86  {
87  return smtk::attribute::AttributePtr(new Attribute(myName, myDefinition));
88  }
89 
91  const std::string& myName,
92  const smtk::attribute::DefinitionPtr& myDefinition,
93  const smtk::common::UUID& myId)
94  {
95  return smtk::attribute::AttributePtr(new Attribute(myName, myDefinition, myId));
96  }
97 
98  ~Attribute() override;
99 
100  AttributePtr shared_from_this()
101  {
102  return static_pointer_cast<Attribute>(Component::shared_from_this());
103  }
104 
105  std::shared_ptr<const Attribute> shared_from_this() const
106  {
107  return static_pointer_cast<const Attribute>(Component::shared_from_this());
108  }
109 
110  // NOTE: To rename an attribute use the resource!
111  std::string name() const override { return m_name; }
112 
113  const std::string& type() const;
114  std::vector<std::string> types() const;
115  bool isA(const smtk::attribute::DefinitionPtr& def) const;
116  const smtk::attribute::DefinitionPtr& definition() const { return m_definition; }
117 
118  const double* color() const;
119  void setColor(double r, double g, double b, double alpha);
120  void setColor(const double* l_color)
121  {
122  this->setColor(l_color[0], l_color[1], l_color[2], l_color[3]);
123  }
124  bool isColorSet() const { return m_isColorSet; }
125  void unsetColor() { m_isColorSet = false; }
126 
134  unsigned int advanceLevel(int mode = 0) const;
135  void setLocalAdvanceLevel(int mode, unsigned int level);
136  unsigned int localAdvanceLevel(int mode = 0) const
137  {
138  return (mode == 1 ? m_localAdvanceLevel[1] : m_localAdvanceLevel[0]);
139  }
140  // unsetLocalAdvanceLevel causes the attribute to return its
141  // definition advance level information for the specified mode when calling
142  // the advanceLevel(mode) method
143  void unsetLocalAdvanceLevel(int mode = 0);
144  // Returns true if the attribute is returning its local
145  // advance level information
146  bool hasLocalAdvanceLevelInfo(int mode = 0) const
147  {
148  return (mode == 1 ? m_hasLocalAdvanceLevelInfo[1] : m_hasLocalAdvanceLevelInfo[0]);
149  }
150 
151  const std::vector<smtk::attribute::ItemPtr>& items() const { return m_items; }
152  smtk::attribute::ItemPtr item(int ith) const
153  {
154  return (ith < 0)
156  : (static_cast<unsigned int>(ith) >= m_items.size() ? smtk::attribute::ItemPtr()
157  : m_items[static_cast<std::size_t>(ith)]);
158  }
159 
171  itemAtPath(const std::string& path, const std::string& seps = "/", bool activeOnly = false) const;
173  itemAtPath(const std::string& path, const std::string& seps = "/", bool activeOnly = false);
174 
175  template<typename T>
176  typename T::ConstPtr itemAtPathAs(
177  const std::string& path,
178  const std::string& seps = "/",
179  bool activeOnly = false) const;
180  template<typename T>
181  typename T::Ptr
182  itemAtPathAs(const std::string& path, const std::string& seps = "/", bool activeOnly = false);
184 
187  std::string itemPath(const ItemPtr& item, const std::string& seps = "/") const;
189 
190  smtk::attribute::ItemPtr find(const std::string& name, SearchStyle style = RECURSIVE_ACTIVE);
191  smtk::attribute::ConstItemPtr find(const std::string& name, SearchStyle style = RECURSIVE_ACTIVE)
192  const;
193  std::size_t numberOfItems() const { return m_items.size(); }
194 
195  template<typename T>
196  typename T::Ptr findAs(const std::string& name, SearchStyle style = RECURSIVE_ACTIVE);
197 
198  template<typename T>
199  typename T::ConstPtr findAs(const std::string& name, SearchStyle style = RECURSIVE_ACTIVE) const;
200 
211  template<typename T>
212  void filterItems(
213  T& values,
214  std::function<bool(typename T::value_type)> test,
215  bool activeChildren = true);
216 
217  IntItemPtr findInt(const std::string& name);
218  ConstIntItemPtr findInt(const std::string& name) const;
219 
220  DoubleItemPtr findDouble(const std::string& name);
221  ConstDoubleItemPtr findDouble(const std::string& name) const;
222 
223  StringItemPtr findString(const std::string& name);
224  ConstStringItemPtr findString(const std::string& name) const;
225 
226  FileItemPtr findFile(const std::string& name);
227  ConstFileItemPtr findFile(const std::string& name) const;
228 
229  DirectoryItemPtr findDirectory(const std::string& name);
230  ConstDirectoryItemPtr findDirectory(const std::string& name) const;
231 
232  GroupItemPtr findGroup(const std::string& name);
233  ConstGroupItemPtr findGroup(const std::string& name) const;
234 
235  ModelEntityItemPtr findModelEntity(const std::string& name);
236  ConstModelEntityItemPtr findModelEntity(const std::string& name) const;
237 
238  VoidItemPtr findVoid(const std::string& name);
239  ConstVoidItemPtr findVoid(const std::string& name) const;
240 
241  DateTimeItemPtr findDateTime(const std::string& name);
242  ConstDateTimeItemPtr findDateTime(const std::string& name) const;
243 
244  ReferenceItemPtr findReference(const std::string& name);
245  ConstReferenceItemPtr findReference(const std::string& name) const;
246  template<typename T>
247  T entityRefsAs(const std::string& name) const;
248 
249  ResourceItemPtr findResource(const std::string& name);
250  ConstResourceItemPtr findResource(const std::string& name) const;
251 
252  ComponentItemPtr findComponent(const std::string& name);
253  ConstComponentItemPtr findComponent(const std::string& name) const;
254 
255  ConstReferenceItemPtr associatedObjects() const { return m_associatedObjects; }
256  ReferenceItemPtr associatedObjects() { return m_associatedObjects; }
257 
258  bool isObjectAssociated(const smtk::common::UUID& uid) const;
259  bool isObjectAssociated(const smtk::resource::PersistentObjectPtr& componentPtr) const;
260 
261  bool canBeAssociated(const smtk::resource::PersistentObjectPtr& obj) const;
262  bool canBeDisassociated(const smtk::resource::PersistentObjectPtr& obj, AttributePtr& probAtt)
263  const;
264  ConstReferenceItemPtr associations() const { return m_associatedObjects; }
265  ReferenceItemPtr associations() { return m_associatedObjects; }
266 
267  bool isEntityAssociated(const smtk::common::UUID& entity) const;
268  bool isEntityAssociated(const smtk::model::EntityRef& entityref) const;
269 
270  smtk::common::UUIDs associatedModelEntityIds() const;
271  template<typename T>
272  T associatedModelEntities() const;
273 
274  template<typename T>
275  T associatedObjects() const;
276 
277  bool associate(smtk::resource::PersistentObjectPtr obj);
278  bool associateEntity(const smtk::common::UUID& entity);
279  bool associateEntity(const smtk::model::EntityRef& entity);
280 
281  void disassociateEntity(const smtk::common::UUID& entity, bool reverse = true);
282  void disassociateEntity(const smtk::model::EntityRef& entity, bool reverse = true);
285  bool
286  disassociate(smtk::resource::PersistentObjectPtr obj, AttributePtr& probAtt, bool reverse = true);
288  bool disassociate(smtk::resource::PersistentObjectPtr obj, bool reverse = true);
289 
290  bool assign(
291  const AttributePtr& sourceAtt,
292  const CopyAssignmentOptions& options = CopyAssignmentOptions());
293 
294  bool assign(
295  const AttributePtr& sourceAtt,
296  const CopyAssignmentOptions& options,
297  smtk::io::Logger& logger);
298 
311  void detachItemsFromOwningResource();
312 
324  bool removeAllAssociations(bool partialRemovalOk = false);
325 
332  bool removeExpungedEntities(const smtk::model::EntityRefs& expungedEnts);
333 
334  // These methods only applies to Attributes whose
335  // definition returns true for isNodal()
336  bool appliesToBoundaryNodes() const { return m_appliesToBoundaryNodes; }
337  void setAppliesToBoundaryNodes(bool appliesValue) { m_appliesToBoundaryNodes = appliesValue; }
338  bool appliesToInteriorNodes() const { return m_appliesToInteriorNodes; }
339  void setAppliesToInteriorNodes(bool appliesValue) { m_appliesToInteriorNodes = appliesValue; }
340 
343  const smtk::attribute::Categories& categories() const;
344 
345  bool isValid(bool useActiveCategories = true) const;
346  bool isValid(const std::set<std::string>& categories) const;
347 
356  bool isRelevant(
357  bool requestCatagories = true,
358  bool includeReadAccess = false,
359  unsigned int readAccessLevel = 0) const;
360 
361  smtk::attribute::ResourcePtr attributeResource() const;
362  const smtk::resource::ResourcePtr resource() const override;
363 
364  void setUserData(const std::string& key, smtk::simulation::UserDataPtr value)
365  {
366  m_userData[key] = value;
367  }
368  smtk::simulation::UserDataPtr userData(const std::string& key) const;
369  void clearUserData(const std::string& key) { m_userData.erase(key); }
370  void clearAllUserData() { m_userData.clear(); }
371 
372  bool isAboutToBeDeleted() const { return m_aboutToBeDeleted; }
373 
374  const common::UUID& id() const override { return m_id; }
375  bool setId(const common::UUID& uid) override
376  {
377  m_id = uid;
378  return true;
379  }
380 
381  // These methods are use primarily by I/O operations. The include ID corresponds to
382  // the include directory information store in the attribute resource and is used
383  // when writing out the resource to use include files
384  void setIncludeIndex(std::size_t index) { m_includeIndex = index; }
385 
386  std::size_t includeIndex() const { return m_includeIndex; }
387 
388  // Returns true if an Evaluator can be created for this Attribute. Does not
389  // indicate that evaluation would be successful if attempted. Use
390  // doesEvaluate() for that information.
391  bool canEvaluate() const;
392 
393  // If an Evaluator can be created for this Attribute, returns the result of
394  // Evaluator::doesEvaluate(). Returns false if no Evaluator can be created.
395  bool doesEvalaute() const;
396 
397  // Returns an Evaluator for this Attribute if this Attribute's Definition is
398  // registered with an Evaluator, else returns nullptr.
399  std::unique_ptr<smtk::attribute::Evaluator> createEvaluator() const;
400 
402  {
403  public:
404  GuardedLinks(std::mutex& mutex, const smtk::resource::Component::Links& links)
405  : m_guard(mutex)
406  , m_links(links)
407  {
408  }
409 
410  const smtk::resource::Component::Links* operator->() const { return &m_links; }
411 
413  {
414  return const_cast<smtk::resource::Component::Links*>(&m_links);
415  }
416 
417  private:
418  std::unique_lock<std::mutex> m_guard;
419  const smtk::resource::Component::Links& m_links;
420  };
421 
422  // Attributes are uniquely used outside of an operation context, where they
423  // are not guarded from concurrency issues. Specifically, ReferenceItems use
424  // ResourceLinks to store references to other resources, and the
425  // Resource::Links and Component::Links API is not thread-safe. This API
426  // ensures thread safety when manipulating smtk::attribute::(Resource,Attribute
427  // Links.
428  const GuardedLinks guardedLinks() const;
429  GuardedLinks guardedLinks();
430 
431 protected:
432  Attribute(
433  const std::string& myName,
434  const smtk::attribute::DefinitionPtr& myDefinition,
435  const smtk::common::UUID& myId);
436  Attribute(const std::string& myName, const smtk::attribute::DefinitionPtr& myDefinition);
437 
439  void build();
440 
441  void removeAllItems();
445  void forceDisassociate(smtk::resource::PersistentObjectPtr);
446  void addItem(smtk::attribute::ItemPtr& iPtr) { m_items.push_back(iPtr); }
447  void setName(const std::string& newname) { m_name = newname; }
448 
449  std::string m_name;
450  std::vector<smtk::attribute::ItemPtr> m_items;
451  ReferenceItemPtr m_associatedObjects;
452  smtk::attribute::DefinitionPtr m_definition;
453  bool m_appliesToBoundaryNodes;
454  bool m_appliesToInteriorNodes;
455  bool m_isColorSet;
456  std::map<std::string, smtk::simulation::UserDataPtr> m_userData;
457  // We need something to indicate that the attribute is in process of
458  // being deleted - this is used skip certain clean up steps that
459  // would need to be done otherwise
460  bool m_aboutToBeDeleted;
461  double m_color[4];
462  smtk::common::UUID m_id;
463  std::size_t m_includeIndex;
464  bool m_hasLocalAdvanceLevelInfo[2];
465  unsigned int m_localAdvanceLevel[2];
466 };
467 
468 inline smtk::simulation::UserDataPtr Attribute::userData(const std::string& key) const
469 {
470  std::map<std::string, smtk::simulation::UserDataPtr>::const_iterator it = m_userData.find(key);
471  return ((it == m_userData.end()) ? smtk::simulation::UserDataPtr() : it->second);
472 }
473 
474 inline void Attribute::setColor(double r, double g, double b, double a)
475 {
476  m_isColorSet = true;
477  m_color[0] = r;
478  m_color[1] = g;
479  m_color[2] = b;
480  m_color[3] = a;
481 }
482 
483 template<typename T>
484 T Attribute::entityRefsAs(const std::string& iname) const
485 {
486  T result;
487  ConstReferenceItemPtr itm = this->findReference(iname);
488  if (!itm)
489  {
490  return result;
491  }
492 
493  for (auto it = itm->begin(); it != itm->end(); ++it)
494  {
495  if (!it.isSet())
496  {
497  continue;
498  }
499 
500  typename T::value_type entry = std::dynamic_pointer_cast<smtk::model::Entity>(*it);
501  if (entry.isValid())
502  {
503  result.insert(result.end(), entry);
504  }
505  }
506  return result;
507 }
508 
509 template<typename T>
510 T Attribute::associatedObjects() const
511 {
512  T result;
513  if (!m_associatedObjects)
514  {
515  return result;
516  }
517 
518  for (auto it = m_associatedObjects->begin(); it != m_associatedObjects->end(); ++it)
519  {
520  if (!it.isSet())
521  {
522  continue;
523  }
524 
525  auto entry = std::dynamic_pointer_cast<typename T::value_type::element_type>(*it);
526  if (entry)
527  {
528  result.insert(result.end(), entry);
529  }
530  }
531  return result;
532 }
533 
534 template<typename T>
536 {
537  T result;
538  if (!m_associatedObjects)
539  {
540  return result;
541  }
542 
543  for (auto it = m_associatedObjects->begin(); it != m_associatedObjects->end(); ++it)
544  {
545  if (!it.isSet())
546  {
547  continue;
548  }
549 
550  typename T::value_type entry = std::dynamic_pointer_cast<smtk::model::Entity>(*it);
551  if (entry.isValid())
552  {
553  result.insert(result.end(), entry);
554  }
555  }
556  return result;
557 }
558 
561 template<typename T>
562 typename T::Ptr
563 Attribute::itemAtPathAs(const std::string& path, const std::string& seps, bool activeOnly)
564 {
565  return smtk::dynamic_pointer_cast<T>(this->itemAtPath(path, seps, activeOnly));
566 }
567 
568 template<typename T>
569 typename T::ConstPtr
570 Attribute::itemAtPathAs(const std::string& path, const std::string& seps, bool activeOnly) const
571 {
572  return smtk::dynamic_pointer_cast<const T>(this->itemAtPath(path, seps, activeOnly));
573 }
574 
575 template<typename T>
576 typename T::Ptr Attribute::findAs(const std::string& iname, SearchStyle style)
577 {
578  return smtk::dynamic_pointer_cast<T>(this->find(iname, style));
579 }
580 
581 template<typename T>
582 typename T::ConstPtr Attribute::findAs(const std::string& iname, SearchStyle style) const
583 {
584  return smtk::dynamic_pointer_cast<const T>(this->find(iname, style));
585 }
586 
587 template<typename T>
589  T& filtered,
590  std::function<bool(typename T::value_type)> test,
591  bool activeChildren)
592 {
593  // Given an item, this lambda function which would recursively visit all children and apply test function
594  std::function<void(ItemPtr, bool)> visitor =
595  [&filtered, test, &visitor](smtk::attribute::ItemPtr item, bool activeChildrenLocal) {
596  typename T::value_type testItem =
597  smtk::dynamic_pointer_cast<typename T::value_type::element_type>(item);
598  // base condition
599  if (testItem && test(testItem))
600  {
601  filtered.insert(filtered.end(), testItem);
602  }
603  // Only items which have children would have a non-empty visitChildren method
604  item->visitChildren(visitor, activeChildrenLocal);
605  };
606 
607  for (std::size_t index = 0; index < this->numberOfItems(); ++index)
608  {
609  visitor(this->item(static_cast<int>(index)), activeChildren);
610  }
611 }
612 
613 } // namespace attribute
614 } // namespace smtk
615 
616 #endif /* smtk_attribute_Attribute_h */
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
smtk::attribute::Attribute::itemAtPath
smtk::attribute::ConstItemPtr itemAtPath(const std::string &path, const std::string &seps="/", bool activeOnly=false) const
Find an item via its path with respects to the attribute.
Definition: Attribute.cxx:194
PublicPointerDefs.h
smtk::attribute::Definition
Definition: Definition.h:45
smtk::attribute::DefinitionPtr
smtk::shared_ptr< smtk::attribute::Definition > DefinitionPtr
Definition: PublicPointerDefs.h:450
smtk::attribute::SearchStyle
SearchStyle
How should searches for items be conducted?
Definition: SearchStyle.h:24
smtk::attribute::FileItemPtr
smtk::shared_ptr< smtk::attribute::FileItem > FileItemPtr
Definition: PublicPointerDefs.h:499
smtk::attribute::ConstComponentItemPtr
smtk::shared_ptr< const smtk::attribute::ComponentItem > ConstComponentItemPtr
Definition: PublicPointerDefs.h:594
smtk::simulation::UserDataPtr
smtk::shared_ptr< smtk::simulation::UserData > UserDataPtr
Definition: PublicPointerDefs.h:671
smtk::common::UUIDs
std::set< smtk::common::UUID > UUIDs
Definition: PublicPointerDefs.h:31
smtk::attribute::ConstModelEntityItemPtr
smtk::shared_ptr< const smtk::attribute::ModelEntityItem > ConstModelEntityItemPtr
Definition: PublicPointerDefs.h:579
smtk::attribute::ComponentItemPtr
smtk::shared_ptr< smtk::attribute::ComponentItem > ComponentItemPtr
Definition: PublicPointerDefs.h:539
smtk::attribute::ConstGroupItemPtr
smtk::shared_ptr< const smtk::attribute::GroupItem > ConstGroupItemPtr
Definition: PublicPointerDefs.h:567
smtk::common::UUID
Definition: UUID.h:38
smtk::io::Logger
Log messages for later presentation to a user or a file.
Definition: Logger.h:94
smtk::attribute::GroupItemPtr
smtk::shared_ptr< smtk::attribute::GroupItem > GroupItemPtr
Definition: PublicPointerDefs.h:507
smtk::attribute::Attribute::find
smtk::attribute::ItemPtr find(const std::string &name, SearchStyle style=RECURSIVE_ACTIVE)
Return the item with the given inName, searching in the given style.
Definition: Attribute.cxx:923
smtk::attribute::StringItemPtr
smtk::shared_ptr< smtk::attribute::StringItem > StringItemPtr
Definition: PublicPointerDefs.h:516
smtk::attribute::ConstResourceItemPtr
smtk::shared_ptr< const smtk::attribute::ResourceItem > ConstResourceItemPtr
Definition: PublicPointerDefs.h:589
smtk::attribute::ResourceItemPtr
smtk::shared_ptr< smtk::attribute::ResourceItem > ResourceItemPtr
Definition: PublicPointerDefs.h:535
smtk::attribute::ConstStringItemPtr
smtk::shared_ptr< const smtk::attribute::StringItem > ConstStringItemPtr
Definition: PublicPointerDefs.h:575
smtk::attribute::Attribute::filterItems
void filterItems(T &values, std::function< bool(typename T::value_type)> test, bool activeChildren=true)
Given a container, filter items in the attribute by a lambda function.
Definition: Attribute.h:588
smtk::attribute::Attribute::id
const common::UUID & id() const override
Return a unique identifier for the object which will be persistent across sessions.
Definition: Attribute.h:374
smtk::attribute::ConstReferenceItemPtr
smtk::shared_ptr< const smtk::attribute::ReferenceItem > ConstReferenceItemPtr
Definition: PublicPointerDefs.h:584
smtkTypeMacro
#define smtkTypeMacro(...)
Add typedefs to a class for identifcation.
Definition: SharedFromThis.h:51
smtk::attribute::IntItemPtr
smtk::shared_ptr< smtk::attribute::IntItem > IntItemPtr
Definition: PublicPointerDefs.h:512
smtk::attribute::DirectoryItemPtr
smtk::shared_ptr< smtk::attribute::DirectoryItem > DirectoryItemPtr
Definition: PublicPointerDefs.h:491
smtk::attribute::AttributePtr
smtk::shared_ptr< smtk::attribute::Attribute > AttributePtr
Definition: PublicPointerDefs.h:456
smtk::attribute::ConstDateTimeItemPtr
smtk::shared_ptr< const smtk::attribute::DateTimeItem > ConstDateTimeItemPtr
Definition: PublicPointerDefs.h:544
smtk::attribute::Attribute::setId
bool setId(const common::UUID &uid) override
Assign an ID to this object (used by readers; not for arbitrary reuse).
Definition: Attribute.h:375
smtk::attribute::RECURSIVE_ACTIVE
@ RECURSIVE_ACTIVE
Recursively search for an active item.
Definition: SearchStyle.h:32
smtk::attribute::ReferenceItemPtr
smtk::shared_ptr< smtk::attribute::ReferenceItem > ReferenceItemPtr
Definition: PublicPointerDefs.h:531
smtk::attribute::ModelEntityItemPtr
smtk::shared_ptr< smtk::attribute::ModelEntityItem > ModelEntityItemPtr
Definition: PublicPointerDefs.h:520
smtk::attribute::ConstItemPtr
smtk::shared_ptr< const smtk::attribute::Item > ConstItemPtr
Definition: PublicPointerDefs.h:469
smtk::attribute::VoidItemPtr
smtk::shared_ptr< smtk::attribute::VoidItem > VoidItemPtr
Definition: PublicPointerDefs.h:527
smtk::attribute::Resource
Store information about attribute definitions and instances.
Definition: Resource.h:77
smtk::attribute::DateTimeItemPtr
smtk::shared_ptr< smtk::attribute::DateTimeItem > DateTimeItemPtr
Definition: PublicPointerDefs.h:487
smtk::attribute::Attribute
Represent a (possibly composite) value according to a definition.
Definition: Attribute.h:49
smtk::attribute::Attribute::itemAtPathAs
T::ConstPtr itemAtPathAs(const std::string &path, const std::string &seps="/", bool activeOnly=false) const
Find an item via its path with respects to the attribute.
Definition: Attribute.h:570
smtk::attribute::Categories
Represents the category constraints associated with an Attribute, Attribute Definition,...
Definition: Categories.h:32
smtk::attribute::Attribute::associatedModelEntities
T associatedModelEntities() const
Return a container of associated entityref-subclass instances.
Definition: Attribute.h:535
smtk::attribute::ConstDoubleItemPtr
smtk::shared_ptr< const smtk::attribute::DoubleItem > ConstDoubleItemPtr
Definition: PublicPointerDefs.h:554
smtk::attribute::DoubleItemPtr
smtk::shared_ptr< smtk::attribute::DoubleItem > DoubleItemPtr
Definition: PublicPointerDefs.h:495
smtk::resource::Component
Component is the base class for records stored in an smtk::resource::Resource.
Definition: Component.h:43
smtk::resource::PersistentObjectPtr
smtk::shared_ptr< smtk::resource::PersistentObject > PersistentObjectPtr
Definition: PublicPointerDefs.h:285
smtk::attribute::Attribute::name
std::string name() const override
Return the name of the object - by default it will return the UUID but that can be overridden.
Definition: Attribute.h:111
smtk::attribute::ConstFileItemPtr
smtk::shared_ptr< const smtk::attribute::FileItem > ConstFileItemPtr
Definition: PublicPointerDefs.h:558
smtk::attribute::ItemPtr
smtk::shared_ptr< smtk::attribute::Item > ItemPtr
Definition: PublicPointerDefs.h:467
smtk::attribute::ConstIntItemPtr
smtk::shared_ptr< const smtk::attribute::IntItem > ConstIntItemPtr
Definition: PublicPointerDefs.h:571
smtk::attribute::ConstVoidItemPtr
smtk::shared_ptr< const smtk::attribute::VoidItem > ConstVoidItemPtr
Definition: PublicPointerDefs.h:599
smtk::attribute::Attribute::CompareByName
Definition: Attribute.h:56
smtk::attribute::WeakAttributePtr
smtk::weak_ptr< smtk::attribute::Attribute > WeakAttributePtr
Definition: PublicPointerDefs.h:460
smtk::model::EntityRefs
std::set< smtk::model::EntityRef > EntityRefs
Definition: PublicPointerDefs.h:162
smtk::model::EntityRef
A lightweight entityref pointing to a model entity's resource.
Definition: EntityRef.h:112
smtk::attribute::ConstDirectoryItemPtr
smtk::shared_ptr< const smtk::attribute::DirectoryItem > ConstDirectoryItemPtr
Definition: PublicPointerDefs.h:549
smtk::attribute::ResourcePtr
smtk::shared_ptr< smtk::attribute::Resource > ResourcePtr
Definition: PublicPointerDefs.h:604
smtk::resource::ResourcePtr
smtk::shared_ptr< smtk::resource::Resource > ResourcePtr
Definition: PublicPointerDefs.h:295