ufe 5.5
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.11-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"
21#include "undoableCommand.h"
22
23#include <memory>
24#include <vector>
25#include <string>
26
28
52{
53public:
54 typedef std::shared_ptr<Attributes> Ptr;
55 typedef std::vector< std::pair< std::string, std::string> > Enums;
56
64 static Ptr attributes(const SceneItem::Ptr& item);
65
73 static bool addObserver(
74 const SceneItem::Ptr& item, const Observer::Ptr& obs);
82 static bool addObserver(const Observer::Ptr& obs);
90 static bool removeObserver(
91 const SceneItem::Ptr& item, const Observer::Ptr& obs);
92
100 static bool removeObserver(const Observer::Ptr& obs);
101
107 static std::size_t nbObservers(const SceneItem::Ptr& item);
108
114 static std::size_t nbObservers();
115
123 static bool hasObserver(
124 const SceneItem::Ptr& item, const Observer::Ptr& obs);
125
133 static bool hasObserver(const Observer::Ptr& obs);
134
137 static bool hasObservers(const Path& path);
138
145 static bool hasObservers(Rtid runTimeId);
146
151 static void notify(const AttributeChanged& notification);
152
156 Attributes(const Attributes&) = default;
158 virtual ~Attributes();
159
161 virtual SceneItem::Ptr sceneItem() const = 0;
162
164 virtual Attribute::Type attributeType(const std::string& name) = 0;
165
172 virtual Attribute::Ptr attribute(const std::string& name) = 0;
173
175 virtual std::vector<std::string> attributeNames() const = 0;
176
182 virtual bool hasAttribute(const std::string& name) const = 0;
183
192 const Attribute::Type& type);
193
205 const Attribute::Type& type) = 0;
206
213 virtual bool removeAttribute(const std::string& name);
214
225
234 virtual Attribute::Ptr
235 renameAttribute(const std::string& originalName,
236 const std::string& newName);
237
247 renameAttributeCmd(const std::string& originalName,
248 const std::string& newName) = 0;
249
256 virtual Enums getEnums(const std::string& attrName) const = 0;
257}; // end class Attributes
258
259
260} // end namespace
261
262#endif /* _ufe_attributes */
Base class for all attribute changed notifications.
std::string Type
Definition: attribute.h:41
std::shared_ptr< Attribute > Ptr
Definition: attribute.h:40
std::shared_ptr< AttributeUndoableCommand > Ptr
Abstract base class for Attributes interface.
Definition: attributes.h:52
static bool hasObservers(const Path &path)
virtual UndoableCommand::Ptr removeAttributeCmd(const std::string &name)=0
virtual bool hasAttribute(const std::string &name) const =0
static std::size_t nbObservers(const SceneItem::Ptr &item)
virtual Attribute::Ptr addAttribute(const std::string &name, const Attribute::Type &type)
static bool hasObserver(const Observer::Ptr &obs)
virtual std::vector< std::string > attributeNames() const =0
virtual AddAttributeUndoableCommand::Ptr addAttributeCmd(const std::string &name, const Attribute::Type &type)=0
static bool removeObserver(const SceneItem::Ptr &item, const Observer::Ptr &obs)
static bool addObserver(const SceneItem::Ptr &item, const Observer::Ptr &obs)
virtual Enums getEnums(const std::string &attrName) const =0
virtual Attribute::Ptr attribute(const std::string &name)=0
std::vector< std::pair< std::string, std::string > > Enums
Definition: attributes.h:55
static Ptr attributes(const SceneItem::Ptr &item)
static bool addObserver(const Observer::Ptr &obs)
static bool hasObservers(Rtid runTimeId)
static std::size_t nbObservers()
Attributes(const Attributes &)=default
Default copy constructor.
virtual Attribute::Type attributeType(const std::string &name)=0
virtual SceneItem::Ptr sceneItem() const =0
static bool hasObserver(const SceneItem::Ptr &item, const Observer::Ptr &obs)
virtual Attribute::Ptr renameAttribute(const std::string &originalName, const std::string &newName)
virtual bool removeAttribute(const std::string &name)
std::shared_ptr< Attributes > Ptr
Definition: attributes.h:54
static bool removeObserver(const Observer::Ptr &obs)
virtual ~Attributes()
Destructor.
Attributes()
Constructor.
static void notify(const AttributeChanged &notification)
virtual RenameAttributeUndoableCommand::Ptr renameAttributeCmd(const std::string &originalName, const std::string &newName)=0
std::shared_ptr< Observer > Ptr
Definition: observer.h:36
Identify an object or 3D path in the scene.
Definition: path.h:38
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:44
std::shared_ptr< UndoableCommand > Ptr
std::string string(const Path &path)
Path path(const std::string &pathString)
uint32_t Rtid
Definition: rtid.h:26
#define UFE_NS_DEF
Definition: ufe.h:35
Definition of macros for symbol visibility.
#define UFE_SDK_DECL
Definition: ufeExport.h:36