ufe  1.0
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
selection.h
Go to the documentation of this file.
1 #line 1 "E:/jenkins/workspace/ufe-full-windows/ufe/include/selection.h"
2 #ifndef _ufeSelection
3 #define _ufeSelection
4 // ===========================================================================
5 // Copyright 2018 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 "sceneItemList.h"
13 #include "sceneItem.h"
14 
15 UFE_NS_DEF {
16 
17 class SelectionTrie;
18 
20 
29 {
30 public:
31 
32  typedef SceneItemList::const_iterator const_iterator;
33  typedef SceneItemList::const_reverse_iterator const_reverse_iterator;
34 
36  Selection();
37 
39  Selection(const Selection&);
40 
42  virtual ~Selection();
43 
45  Selection& operator=(const Selection&);
46 
49 
51  Selection& operator=(Selection&& rhs);
52 
54  std::size_t size() const;
55 
57  bool empty() const;
58 
67  bool append(const SceneItem::Ptr& item);
68 
77  bool remove(const SceneItem::Ptr& item);
78 
83  void clear();
84 
91  void replaceWith(const Selection& selection);
92 
96  bool contains(const Path& path) const;
97 
106  bool containsDescendant(const Path& path) const;
107 
116  bool containsAncestor(const Path& path) const;
117 
119  const_iterator cbegin() const;
121  const_iterator begin() const;
122  const_iterator cend() const;
123  const_iterator end() const;
124  const_reverse_iterator crbegin() const;
125  const_reverse_iterator rbegin() const;
126  const_reverse_iterator crend() const;
127  const_reverse_iterator rend() const;
129 protected:
130 
132  bool doAppend(const SceneItem::Ptr& item);
138  bool doRemove(const SceneItem::Ptr& item);
139  void doClear();
140  void doReplaceWith(const Selection& selection);
142 
144  // Hook methods for append, remove, clear, and replaceWith. postAppend()
145  // and postRemove() are only called if doAppend() and doRemove() return
146  // true, respectively. Implementations in this class do nothing.
147  virtual void postAppend(const SceneItem::Ptr& item);
148  virtual void postRemove(const SceneItem::Ptr& item);
149  virtual void postClear();
150  virtual void postReplaceWith();
152 private:
153 
155 
157  inline SelectionTrie& trie();
160  inline const SelectionTrie& trie() const;
161 
162  void* fTrieStorage[2];
164 };
165 
166 }
167 
168 #endif /* _ufeSelection */
std::list< std::shared_ptr< SceneItem > > SceneItemList
Definition: sceneItemList.h:19
SceneItemList::const_reverse_iterator const_reverse_iterator
Definition: selection.h:33
SceneItemList fList
Definition: selection.h:154
Identify an object or 3D path in the scene.
Definition: path.h:37
Selection list for objects in the scene.
Definition: selection.h:28
#define UFE_NS_DEF
Definition: ufe.h:35
SceneItemList::const_iterator const_iterator
Definition: selection.h:32
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:39
#define UFE_SDK_DECL
Definition: ufeExport.h:36