HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_ChannelList.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * COMMENTS:
7  */
8 
9 #ifndef __HOM_ChannelList_h__
10 #define __HOM_ChannelList_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_ChannelPrim.h"
14 #include "HOM_Defines.h"
15 #include "HOM_Geometry.h"
16 #include "HOM_GUDetailHandle.h"
17 #include "HOM_Module.h"
18 #include "HOM_Errors.h"
19 #include "HOM_ElemPtr.h"
20 #include "HOM_PtrOrNull.h"
21 #include "HOM_Parm.h"
22 #include "HOM_SopNode.h"
23 
24 #include <UT/UT_StringMap.h>
25 
26 #include <string>
27 #include <vector>
28 
29 SWIGOUT(%feature("notabstract") HOM_ChannelList;)
31 
33 {
34 public:
35 #ifdef SWIG
36 %extend
37 {
39  {
40  return new HOM_ChannelList();
41  }
42 }
43 #else
45 
47 #endif
48  virtual ~HOM_ChannelList();
49 
51 
52  bool operator==(
53  const HOM_ChannelList& p) const;
54  bool operator==(
56  bool operator!=(
58 
59  void clear();
60 
61  std::vector<HOM_ElemPtr<HOM_Parm> > parms();
62  std::vector<HOM_ElemPtr<HOM_Parm> > selected();
63  std::vector<HOM_ElemPtr<HOM_Parm> > deselected();
64  std::vector<HOM_ElemPtr<HOM_Parm> > pinned();
65  std::vector<HOM_ElemPtr<HOM_Parm> > unpinned();
66  std::vector<HOM_ElemPtr<HOM_Parm> > selectedValue();
67  std::vector<HOM_ElemPtr<HOM_Parm> > deselectedValue();
68 
69  SWIGOUT(%kwargs addParm;)
70  void addParm(HOM_Parm &parm,
71  bool selected=true,
72  bool pinned=false,
73  bool valueselected=false);
74 
75  SWIGOUT(%kwargs addPath;)
76  void addPath(const std::string &path,
77  bool selected=true,
78  bool pinned=false,
79  bool valueselected=false);
80 
81  void remove(HOM_Parm &parm);
82 
83  void select(HOM_Parm &parm);
84  void deselect(HOM_Parm &parm);
85 
86  void pin(HOM_Parm &parm);
87  void unpin(HOM_Parm &parm);
88 
89  void selectValue(HOM_Parm &parm);
90  void deselectValue(HOM_Parm &parm);
91 
92  SWIGOUT(%kwargs addParms;)
93  void addParms(const std::vector<HOM_Parm*> &parms,
94  bool selected=true,
95  bool pinned=false,
96  bool valueselected=false);
97 
98  SWIGOUT(%kwargs addPaths;)
99  void addPaths(const std::vector< std::string > &paths,
100  bool selected=true,
101  bool pinned=false,
102  bool valueselected=false);
103 
104  void remove(const std::vector<HOM_Parm*> &parms);
105 
106  void select(const std::vector<HOM_Parm*> &parms);
107  void deselect(const std::vector<HOM_Parm*> &parms);
108 
109  void pin(const std::vector<HOM_Parm*> &parms);
110  void unpin(const std::vector<HOM_Parm*> &parms);
111 
112  void selectValue(const std::vector<HOM_Parm*> &parms);
113  void deselectValue(const std::vector<HOM_Parm*> &parms);
114 
115  bool contains(HOM_Parm &parm);
116  bool isSelected(HOM_Parm &parm);
117  bool isPinned(HOM_Parm &parm);
118  bool isValueSelected(HOM_Parm &parm);
119 
120  SWIGOUT(%kwargs addNodeGeometryChannels;)
121  std::string addNodeGeometryChannels(HOM_SopNode &node,
122  const std::string &pattern = "",
123  bool selected = true,
124  bool pinned = false,
125  bool valueselected = false);
126 
127  SWIGOUT(%kwargs addGeometryChannels;)
128  std::string addGeometryChannels(HOM_Geometry &geometry,
129  std::string collection_name = "",
130  const std::string &pattern = "",
131  bool selected = true,
132  bool pinned = false,
133  bool valueselected = false);
134 
135  std::vector<HOM_ElemPtr<HOM_ChannelPrim>> geometryChannels(
136  const std::string &collection_name);
137 
138  std::vector<std::string> geometryChannelCollectionNames();
139 
140  void removeGeometryChannels(const std::string &collection_name);
141 
142  void selectGeometryChannel(const std::string &collection_name,
143  const std::string &channel = "");
144  void deselectGeometryChannel(const std::string &collection_name,
145  const std::string &channel = "");
146 
147  void pinGeometryChannel(const std::string &collection_name,
148  const std::string &channel = "");
149  void unpinGeometryChannel(const std::string &collection_name,
150  const std::string &channel = "");
151 
152  void selectGeometryChannelValue(const std::string &collection_name,
153  const std::string &channel = "");
154  void deselectGeometryChannelValue(const std::string &collection_name,
155  const std::string &channel = "");
156 
157  bool containsGeometryChannel(const std::string &collection_name,
158  const std::string &channel = "");
159 
160  bool isGeometryChannelSelected(const std::string &collection_name,
161  const std::string &channel);
162  bool isGeometryChannelPinned(const std::string &collection_name,
163  const std::string &channel);
164  bool isGeometryChannelValueSelected(const std::string &collection_name,
165  const std::string &channel);
166 
167  SWIGOUT(%warnfilter(321) filter;)
169  bool keepSelection();
170  bool enableFilter();
171  bool filterTranslates();
172  bool filterRotates();
173  bool filterScales();
174 
175  void setFilter(const std::string pattern);
176 
177  void setKeepSelection(bool value);
178  void setEnableFilter(bool value);
179  void setFilterTranslates(bool value);
180  void setFilterRotates(bool value);
181  void setFilterScales(bool value);
182 
183  SWIGOUT(%kwargs asCode;)
184  std::string asCode(const std::string &var_name="chanlist");
185 
187  struct ChannelInfo
188  {
190  : selected(true)
191  , pinned(false)
192  , selectedvalue(false)
193  {}
194 
196  const std::string &n,
197  bool s=true,
198  bool p=false,
199  bool v=false)
200  : name( n )
201  , selected(s)
202  , pinned(p)
203  , selectedvalue(v)
204  {}
205 
207  const ChannelInfo& p) const
208  {
209  return
210  name == p.name &&
211  selected == p.selected &&
212  pinned == p.pinned &&
213  selectedvalue == p.selectedvalue
214  ;
215  }
216 
218  bool selected;
219  bool pinned;
221  };
222 
225  {
227  : myGeometry(nullptr), myNodeId(-1), myPattern("")
228  {
229  }
230 
232  HOM_GUDetailHandle *geometry,
233  int node_id,
234  const UT_StringHolder &pattern)
235  : myGeometry(geometry)
236  , myNodeId(node_id)
237  , myPattern(pattern)
238  {
239  }
240 
241  ~GeometryCollectionInfo() = default;
242 
243  SWIGOUT(%ignore operator=;)
245 
247  GeometryCollectionInfo &operator=(GeometryCollectionInfo &&other) = default;
248 
250  int myNodeId;
251 
253 
254  std::vector<ChannelInfo> myChannels;
255  };
256 
257  SWIGOUT(%ignore geometryCollections;)
258  UT_StringMap<GeometryCollectionInfo> &geometryCollections();
259 
260 private:
261  size_t find(const std::string &n);
262  ChannelInfo *findGeometryChannel(
263  const UT_StringHolder &collection_name,
264  const UT_StringHolder &name);
265 
266  std::vector< ChannelInfo > myChannels;
267 
268  UT_StringMap<GeometryCollectionInfo> myGeometryCollections;
269 
270  std::string myFilter;
271  bool myFilterT;
272  bool myFilterR;
273  bool myFilterS;
274  bool myEnableFilter;
275  bool myKeepSelection;
276 };
277 
278 #endif
279 
const GLdouble * v
Definition: glcorearb.h:837
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
GLdouble s
Definition: glad.h:3009
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:352
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
bool operator==(const ChannelInfo &p) const
GLdouble n
Definition: glcorearb.h:2008
#define HOM_API
Definition: HOM_API.h:13
vint4 select(const vbool4 &mask, const vint4 &a, const vint4 &b)
Definition: simd.h:4816
void ignore(T const &) VULKAN_HPP_NOEXCEPT
Definition: vulkan.hpp:6508
UT_UniquePtr< HOM_GUDetailHandle > myGeometry
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
Definition: Mat3.h:556
GeometryCollectionInfo(HOM_GUDetailHandle *geometry, int node_id, const UT_StringHolder &pattern)
GLuint const GLchar * name
Definition: glcorearb.h:786
GLushort pattern
Definition: glad.h:2583
ChannelInfo(const std::string &n, bool s=true, bool p=false, bool v=false)
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
Definition: core.h:1131
bool OIIO_UTIL_API contains(string_view a, string_view b)
Does 'a' contain the string 'b' within it?
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:542
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
Definition: core.h:2089
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1297
std::vector< ChannelInfo > myChannels