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
contextOps.h
Go to the documentation of this file.
1 #line 1 "S:/jenkins/workspace/ECP/ufe/ufe-full-python3.10-windows/ufe/include/contextOps.h"
2 #ifndef _contextOps
3 #define _contextOps
4 // ===========================================================================
5 // Copyright 2020 Autodesk, Inc. All rights reserved.
6 //
7 // Use of this software is subject to the terms of the Autodesk license
8 // agreement provided at the time of installation or download, or which
9 // otherwise accompanies this software in either electronic or hard copy form.
10 // ===========================================================================
11 
12 #include "common/ufeExport.h"
13 
14 #include "sceneItem.h"
15 #include "undoableCommand.h"
16 
17 #include <memory>
18 #include <vector>
19 #include <string>
20 
21 UFE_NS_DEF {
22 
24 
30 
31  enum HasChildren { kNoChildren = false, kHasChildren = true };
32  enum Checkable { kNotCheckable = false, kCheckable = true };
33  enum Checked { kNotChecked = false, kChecked = true };
34  enum Exclusive { kNotExclusive = false, kExclusive = true };
35  enum Enabled { kDisabled = false, kEnabled = true };
36 
37  enum SeparatorTag { kSeparator };
38 
39  ContextItem() = default;
41  const std::string& argItem,
42  const std::string& argLabel,
43  bool argHasChildren = false,
44  bool argCheckable = false,
45  bool argChecked = false,
46  bool argExclusive = false,
47  bool argEnabled = true
48  );
51  const std::string& argItem,
52  const std::string& argLabel,
53  const std::string& argImage,
54  bool argHasChildren = false,
55  bool argCheckable = false,
56  bool argChecked = false,
57  bool argExclusive = false,
58  bool argEnabled = true
59  );
61  ContextItem(SeparatorTag, const std::string& argLabel = "");
62 
64  std::string item{};
65 
67  std::string label{};
68 
70  std::string image{};
71 
74  bool hasChildren{false};
75 
77  bool checkable{false};
78 
80  bool checked{false};
81 
84  bool exclusive{false};
85 
87  bool enabled{true};
88 
90  bool separator{false};
91 };
92 
94 
109 {
110 public:
111  typedef std::shared_ptr<ContextOps> Ptr;
112  typedef std::vector<std::string> ItemPath;
113  typedef std::vector<ContextItem> Items;
114 
122  static Ptr contextOps(const SceneItem::Ptr& item);
123 
125  ContextOps();
127  ContextOps(const ContextOps&) = default;
129  virtual ~ContextOps();
130 
132  virtual SceneItem::Ptr sceneItem() const = 0;
133 
136  virtual Items getItems(const ItemPath& itemPath) const = 0;
137 
143  virtual void doOp(const ItemPath& itemPath);
144 
153  virtual UndoableCommand::Ptr doOpCmd(const ItemPath& itemPath) = 0;
154 };
155 
156 }
157 
158 #endif /* _contextOps */
std::shared_ptr< UndoableCommand > Ptr
std::shared_ptr< ContextOps > Ptr
Definition: contextOps.h:111
std::string string(const Path &path)
Definition of macros for symbol visibility.
Structure to describe contextual operations.
Definition: contextOps.h:29
#define UFE_NS_DEF
Definition: ufe.h:35
std::vector< std::string > ItemPath
Definition: contextOps.h:112
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:40
std::vector< ContextItem > Items
Definition: contextOps.h:113
#define UFE_SDK_DECL
Definition: ufeExport.h:36
Abstract base class for context operations interface.
Definition: contextOps.h:108