ufe  3.2
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
attributes.h
Go to the documentation of this file.
1 #line 1 "S:/jenkins/workspace/ECP/ufe/ufe-full-python3.9-windows/ufe/include/attributes.h"
2 #ifndef _ufe_attributes
3 #define _ufe_attributes
4 
5 // =======================================================================
6 // Copyright 2019 Autodesk, Inc. All rights reserved.
7 //
8 // This computer source code and related instructions and comments are the
9 // unpublished confidential and proprietary information of Autodesk, Inc.
10 // and are protected under applicable copyright and trade secret law. They
11 // may not be disclosed to, copied or used by any third party without the
12 // prior written consent of Autodesk, Inc.
13 // =======================================================================
14 
15 #include "common/ufeExport.h"
16 #include "attribute.h"
17 #include "sceneItem.h"
18 #include "observer.h"
19 #include "attributesNotification.h"
20 
21 #include <memory>
22 #include <vector>
23 #include <string>
24 
25 UFE_NS_DEF {
26 
50 {
51 public:
52  typedef std::shared_ptr<Attributes> Ptr;
53 
61  static Ptr attributes(const SceneItem::Ptr& item);
62 
70  static bool addObserver(
71  const SceneItem::Ptr& item, const Observer::Ptr& obs);
79  static bool addObserver(const Observer::Ptr& obs);
87  static bool removeObserver(
88  const SceneItem::Ptr& item, const Observer::Ptr& obs);
89 
97  static bool removeObserver(const Observer::Ptr& obs);
98 
104  static std::size_t nbObservers(const SceneItem::Ptr& item);
105 
111  static std::size_t nbObservers();
112 
120  static bool hasObserver(
121  const SceneItem::Ptr& item, const Observer::Ptr& obs);
122 
130  static bool hasObserver(const Observer::Ptr& obs);
131 
134  static bool hasObservers(const Path& path);
135 
142  static bool hasObservers(Rtid runTimeId);
143 
148  static void notify(const AttributeChanged& notification);
149 
151  Attributes();
153  Attributes(const Attributes&) = default;
155  virtual ~Attributes();
156 
158  virtual SceneItem::Ptr sceneItem() const = 0;
159 
161  virtual Attribute::Type attributeType(const std::string& name) = 0;
162 
169  virtual Attribute::Ptr attribute(const std::string& name) = 0;
170 
172  virtual std::vector<std::string> attributeNames() const = 0;
173 
179  virtual bool hasAttribute(const std::string& name) const = 0;
180 
181 }; // end class Attributes
182 
183 
184 } // end namespace
185 
186 #endif /* _ufe_attributes */
std::shared_ptr< Attribute > Ptr
Definition: attribute.h:40
std::string string(const Path &path)
std::shared_ptr< Observer > Ptr
Definition: observer.h:36
Definition of macros for symbol visibility.
Base class for all attribute changed notifications.
std::shared_ptr< Attributes > Ptr
Definition: attributes.h:52
Identify an object or 3D path in the scene.
Definition: path.h:37
uint32_t Rtid
Definition: rtid.h:26
#define UFE_NS_DEF
Definition: ufe.h:35
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:40
Path path(const std::string &pathString)
std::string Type
Definition: attribute.h:41
#define UFE_SDK_DECL
Definition: ufeExport.h:36
Abstract base class for Attributes interface.
Definition: attributes.h:49