ufe  4.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.10-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"
18 #include "sceneItem.h"
19 #include "observer.h"
20 #include "attributesNotification.h"
21 #include "undoableCommand.h"
22 
23 #include <memory>
24 #include <vector>
25 #include <string>
26 
27 UFE_NS_DEF {
28 
52 {
53 public:
54  typedef std::shared_ptr<Attributes> Ptr;
55 
63  static Ptr attributes(const SceneItem::Ptr& item);
64 
72  static bool addObserver(
73  const SceneItem::Ptr& item, const Observer::Ptr& obs);
81  static bool addObserver(const Observer::Ptr& obs);
89  static bool removeObserver(
90  const SceneItem::Ptr& item, const Observer::Ptr& obs);
91 
99  static bool removeObserver(const Observer::Ptr& obs);
100 
106  static std::size_t nbObservers(const SceneItem::Ptr& item);
107 
113  static std::size_t nbObservers();
114 
122  static bool hasObserver(
123  const SceneItem::Ptr& item, const Observer::Ptr& obs);
124 
132  static bool hasObserver(const Observer::Ptr& obs);
133 
136  static bool hasObservers(const Path& path);
137 
144  static bool hasObservers(Rtid runTimeId);
145 
150  static void notify(const AttributeChanged& notification);
151 
153  Attributes();
155  Attributes(const Attributes&) = default;
157  virtual ~Attributes();
158 
160  virtual SceneItem::Ptr sceneItem() const = 0;
161 
163  virtual Attribute::Type attributeType(const std::string& name) = 0;
164 
171  virtual Attribute::Ptr attribute(const std::string& name) = 0;
172 
174  virtual std::vector<std::string> attributeNames() const = 0;
175 
181  virtual bool hasAttribute(const std::string& name) const = 0;
182 
190  virtual Attribute::Ptr addAttribute(const std::string& name,
191  const Attribute::Type& type);
192 
203  addAttributeCmd(const std::string& name,
204  const Attribute::Type& type) = 0;
205 
212  virtual bool removeAttribute(const std::string& name);
213 
222  virtual UndoableCommand::Ptr
223  removeAttributeCmd(const std::string& name) = 0;
224 
233  virtual Attribute::Ptr
234  renameAttribute(const std::string& originalName,
235  const std::string& newName);
236 
246  renameAttributeCmd(const std::string& originalName,
247  const std::string& newName) = 0;
248 
249 }; // end class Attributes
250 
261 {
262 public:
263  typedef std::shared_ptr<Attributes_v4_2> Ptr;
264  typedef std::vector< std::pair< std::string, std::string> > Enums;
265 
267  ~Attributes_v4_2() override;
268 
275  virtual Enums getEnums(const std::string& attrName) const = 0;
276 
277 }; // end class Attributes_v4_2
278 
279 } // end namespace
280 
281 #endif /* _ufe_attributes */
std::shared_ptr< Attribute > Ptr
Definition: attribute.h:40
std::shared_ptr< UndoableCommand > Ptr
std::string string(const Path &path)
std::shared_ptr< Attributes_v4_2 > Ptr
Definition: attributes.h:263
std::shared_ptr< Observer > Ptr
Definition: observer.h:36
Definition of macros for symbol visibility.
std::vector< std::pair< std::string, std::string > > Enums
Definition: attributes.h:264
Base class for all attribute changed notifications.
std::shared_ptr< Attributes > Ptr
Definition: attributes.h:54
Identify an object or 3D path in the scene.
Definition: path.h:37
std::shared_ptr< AttributeUndoableCommand > Ptr
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)
Abstract base class for Attributes_v4_2 interface.
Definition: attributes.h:260
std::string Type
Definition: attribute.h:41
#define UFE_SDK_DECL
Definition: ufeExport.h:36
Abstract base class for Attributes interface.
Definition: attributes.h:51