HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_ViewerStateTemplate.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_ViewerStateTemplate_h
10 #define HOM_ViewerStateTemplate_h
11 
12 #include "HOM_API.h"
13 #include "HOM_Module.h"
14 #include "HOM_EnumValue.h"
15 #include "HOM_Defines.h"
16 #include "HOM_ViewerStateMenu.h"
17 #include "HOM_NodeTypeCategory.h"
18 
19 #include <string>
20 #include <vector>
21 #include <utility>
22 
24 
25 SWIGOUT(%rename(ViewerStateTemplate) HOM_ViewerStateTemplate;)
26 SWIGOUT(%feature("notabstract") HOM_ViewerStateTemplate;)
27 
29 {
30 public:
31  typedef std::vector< std::pair<std::string, std::string> > Bindings;
32  typedef std::vector< std::string > HandleParmNames;
33  typedef std::vector< std::vector<std::string> > MenuItemParms;
34 
35 #ifdef SWIG
36 %extend
37 {
39  HOM_ViewerStateTemplate(
40  std::string const & type_name,
41  std::string const & label,
42  HOM_NodeTypeCategory const & category,
43  std::vector<HOM_NodeTypeCategory*> const& contexts =
44  std::vector<HOM_NodeTypeCategory*>())
45  {
46  return HOM().newViewerStateTemplate(type_name, label, category, contexts);
47  }
48 }
49 #else
51  { HOM_CONSTRUCT_OBJECT(this) }
52 #endif
53 
55  { HOM_DESTRUCT_OBJECT(this) }
56 
57  virtual std::string __repr__() = 0;
58 
59  virtual std::string typeName() const = 0;
60 
61  virtual std::string categoryName() const = 0;
62 
63  virtual std::vector<HOM_NodeTypeCategory*> contexts() const = 0;
64 
65  SWIGOUT(%ignore bindFactory_internal;)
66  virtual void bindFactory_internal(void *callback) = 0;
67 
68  SWIGOUT(%kwargs bindParameter;)
69  virtual void bindParameter(
70  HOM_EnumValue const& param_type,
71  std::string const& name=std::string(),
72  std::string const& label=std::string(),
73  std::string const& button_icon=std::string(),
74  MenuItemParms const & menu_items=MenuItemParms(),
75  bool menu_as_button_strip=false,
76  hboost::any default_value=hboost::any(),
77  int num_components=1,
78  double min_limit=0,
79  double max_limit=1,
80  bool align=false,
81  bool toolbox=true,
82  bool hide_label=false) = 0;
83 
84  SWIGOUT(%kwargs bindHandle;)
85  virtual void bindHandle(
86  std::string const& handle_type,
87  std::string const& name,
88  std::string const& settings=std::string(),
89  bool cache_previous_parms = false,
90  HandleParmNames const& handle_parms = HandleParmNames()) = 0;
91 
92  SWIGOUT(%kwargs bindHandleStatic;)
93  virtual void bindHandleStatic(
94  std::string const& handle_type,
95  std::string const& name,
96  Bindings const & bindings,
97  std::string const& settings=std::string() ) = 0;
98 
99  SWIGOUT(%kwargs bindGadget;)
100  virtual void bindGadget(HOM_EnumValue const & drawable_type, std::string const & name,
101  std::string const & label=std::string()) = 0;
102 
103  SWIGOUT(%kwargs bindGeometrySelector;)
104  virtual void bindGeometrySelector(
105  std::string const& prompt,
106  bool allow_drag = false,
107  bool quick_select = true,
108  bool auto_start = true,
109  bool toolbox = true,
110  bool use_existing_selection = true,
111  std::string const& initial_selection=std::string(),
112  HOM_EnumValue * initial_selection_type = nullptr,
113  bool ordered = false,
114  std::vector<HOM_EnumValue *> const& geometry_types=std::vector<HOM_EnumValue *>(),
115  std::vector<HOM_EnumValue *> const& primitive_types=std::vector<HOM_EnumValue *>(),
116  bool allow_other_sops = true,
117  bool consume_selection = true,
118  HOM_EnumValue const& secure_selection = HOM_secureSelectionOption::Off,
119  std::string const& hotkey=std::string(),
120  std::string const& name=std::string()) = 0;
121 
122  SWIGOUT(%kwargs bindObjectSelector;)
123  virtual void bindObjectSelector(
124  std::string const& prompt,
125  bool quick_select = true,
126  bool auto_start = true,
127  bool toolbox = true,
128  bool use_existing_selection = true,
129  bool allow_multisel = true,
130  HOM_EnumValue const& secure_selection = HOM_secureSelectionOption::Off,
131  std::vector<std::string> const & allowed_types = std::vector<std::string>(1, "*"),
132  std::string const& hotkey=std::string(),
133  std::string const& name=std::string()) = 0;
134 
135  SWIGOUT(%kwargs bindSceneGraphSelector;)
136  virtual void bindSceneGraphSelector(
137  std::string const& prompt,
138  bool allow_drag = true,
139  bool quick_select = true,
140  bool auto_start = true,
141  bool toolbox = true,
142  bool use_existing_selection = true,
143  bool allow_multisel = true,
144  bool consume_selection = false,
145  HOM_EnumValue const& secure_selection = HOM_secureSelectionOption::Off,
146  std::vector<std::string> const& prior_selection_paths = std::vector<std::string>(),
147  HOM_EnumValue const& prim_mask = HOM_scenePrimMask::ViewerSetting,
148  std::string const& path_prefix_mask = std::string(),
149  std::string const& prim_kind = std::string(),
150  std::string const& hotkey = std::string(),
151  std::string const& name = std::string()) = 0;
152 
153  SWIGOUT(%kwargs bindDynamicsSelector;)
154  virtual void bindDynamicsSelector(
155  std::string const& prompt,
156  bool auto_start = true,
157  bool toolbox = true,
158  bool allow_objects = true,
159  bool allow_modifiers = false,
160  bool quick_select = false,
161  bool use_existing_selection = true,
162  bool allow_multisel = true,
163  HOM_EnumValue const& secure_selection = HOM_secureSelectionOption::Off,
164  std::string const& hotkey=std::string(),
165  std::string const& name=std::string()) = 0;
166 
167  SWIGOUT(%kwargs bindDynamicsPointSelector;)
168  virtual void bindDynamicsPointSelector(
169  std::string const& prompt,
170  bool auto_start = true,
171  bool toolbox = true,
172  bool allow_objects = true,
173  bool allow_modifiers = false,
174  bool quick_select = false,
175  bool use_existing_selection = true,
176  bool allow_multisel = true,
177  bool only_select_points = true,
178  bool object_based_point_selection = false,
179  bool use_last_selected_object = false,
180  HOM_EnumValue const& secure_selection = HOM_secureSelectionOption::Off,
181  std::string const& hotkey=std::string(),
182  std::string const& name=std::string()) = 0;
183 
184  SWIGOUT(%kwargs bindDynamicsPolygonSelector;)
185  virtual void bindDynamicsPolygonSelector(
186  std::string const& prompt,
187  bool auto_start = true,
188  bool toolbox = true,
189  bool quick_select = false,
190  bool use_existing_selection = true,
191  bool object_based_point_selection = false,
192  bool use_last_selected_object = false,
193  HOM_EnumValue const& secure_selection = HOM_secureSelectionOption::Off,
194  std::string const& hotkey=std::string(),
195  std::string const& name=std::string()) = 0;
196 
197  SWIGOUT(%kwargs bindDrawableSelector;)
198  virtual void bindDrawableSelector(
199  std::string const& prompt,
200  bool auto_start = true,
201  bool toolbox = true,
202  std::vector<std::string> const& drawable_mask = std::vector<std::string>(),
203  std::string const& hotkey = std::string(),
204  std::string const& name = std::string()) = 0;
205 
206  SWIGOUT(%kwargs bindSelector;)
207  virtual void bindSelector(
208  std::string const& name,
209  std::string const& selector_type,
210  std::string const& prompt,
211  std::vector<HOM_EnumValue *> primitive_types = std::vector<HOM_EnumValue *>(),
212  std::string const& group_parm_name = std::string(),
213  int input_index = 0,
214  bool input_required = true,
215  bool allow_dragging = true ) = 0;
216 
217  virtual void bindMenu( HOM_ViewerStateMenu const & menu ) = 0;
218 
219  virtual void bindIcon( std::string const & name ) = 0;
220 
221  virtual void bindSupportsSelectionChange( bool supports_change ) = 0;
222  virtual void bindSupportsMoveTool( bool supports_movetool ) = 0;
223 
224  virtual void bindPlaybackChangeEvent() = 0;
225  virtual void bindNodeChangeEvent(const std::vector<HOM_EnumValue *> &event_types) = 0;
226  virtual void bindNodeParmChangeEvent(const std::vector<std::string> &parm_names) = 0;
227 
228  virtual void bindHotkeyDefinitions(
229  HOM_PluginHotkeyDefinitions const & definitions) = 0;
230 
231  virtual void serializeParameters(bool value) = 0;
232 
233 #ifdef SWIG
234 %extend
235 {
236  virtual void bindFactory(InterpreterObject callback)
237  {
238  self->bindFactory_internal(callback);
239  }
240 }
241 #endif // SWIG
242 };
243 
244 #endif // HOM_ViewerStateTemplate_h
245 
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1343
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2545
GLsizei const GLfloat * value
Definition: glcorearb.h:824
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:312
virtual HOM_ViewerStateTemplate * newViewerStateTemplate(std::string const &type_name, std::string const &label, HOM_NodeTypeCategory const &category, std::vector< HOM_NodeTypeCategory * > const &contexts)=0
bool any(const vbool4 &v)
Definition: simd.h:3600
#define HOM_API
Definition: HOM_API.h:13
void ignore(T const &) VULKAN_HPP_NOEXCEPT
Definition: vulkan.hpp:6508
constexpr std::enable_if< I< type_count_base< T >::value, int >::type tuple_type_size(){return subtype_count< typename std::tuple_element< I, T >::type >::value+tuple_type_size< T, I+1 >);}template< typename T > struct type_count< T, typename std::enable_if< is_tuple_like< T >::value >::type >{static constexpr int value{tuple_type_size< T, 0 >)};};template< typename T > struct subtype_count{static constexpr int value{is_mutable_container< T >::value?expected_max_vector_size:type_count< T >::value};};template< typename T, typename Enable=void > struct type_count_min{static const int value{0};};template< typename T >struct type_count_min< T, typename std::enable_if<!is_mutable_container< T >::value &&!is_tuple_like< T >::value &&!is_wrapper< T >::value &&!is_complex< T >::value &&!std::is_void< T >::value >::type >{static constexpr int value{type_count< T >::value};};template< typename T > struct type_count_min< T, typename std::enable_if< is_complex< T >::value >::type >{static constexpr int value{1};};template< typename T >struct type_count_min< T, typename std::enable_if< is_wrapper< T >::value &&!is_complex< T >::value &&!is_tuple_like< T >::value >::type >{static constexpr int value{subtype_count_min< typename T::value_type >::value};};template< typename T, std::size_t I >constexpr typename std::enable_if< I==type_count_base< T >::value, int >::type tuple_type_size_min(){return 0;}template< typename T, std::size_t I > constexpr typename std::enable_if< I< type_count_base< T >::value, int >::type tuple_type_size_min(){return subtype_count_min< typename std::tuple_element< I, T >::type >::value+tuple_type_size_min< T, I+1 >);}template< typename T > struct type_count_min< T, typename std::enable_if< is_tuple_like< T >::value >::type >{static constexpr int value{tuple_type_size_min< T, 0 >)};};template< typename T > struct subtype_count_min{static constexpr int value{is_mutable_container< T >::value?((type_count< T >::value< expected_max_vector_size)?type_count< T >::value:0):type_count_min< T >::value};};template< typename T, typename Enable=void > struct expected_count{static const int value{0};};template< typename T >struct expected_count< T, typename std::enable_if<!is_mutable_container< T >::value &&!is_wrapper< T >::value &&!std::is_void< T >::value >::type >{static constexpr int value{1};};template< typename T > struct expected_count< T, typename std::enable_if< is_mutable_container< T >::value >::type >{static constexpr int value{expected_max_vector_size};};template< typename T >struct expected_count< T, typename std::enable_if<!is_mutable_container< T >::value &&is_wrapper< T >::value >::type >{static constexpr int value{expected_count< typename T::value_type >::value};};enum class object_category:int{char_value=1, integral_value=2, unsigned_integral=4, enumeration=6, boolean_value=8, floating_point=10, number_constructible=12, double_constructible=14, integer_constructible=16, string_assignable=23, string_constructible=24, other=45, wrapper_value=50, complex_number=60, tuple_value=70, container_value=80,};template< typename T, typename Enable=void > struct classify_object{static constexpr object_category value{object_category::other};};template< typename T >struct classify_object< T, typename std::enable_if< std::is_integral< T >::value &&!std::is_same< T, char >::value &&std::is_signed< T >::value &&!is_bool< T >::value &&!std::is_enum< T >::value >::type >{static constexpr object_category value{object_category::integral_value};};template< typename T >struct classify_object< T, typename std::enable_if< std::is_integral< T >::value &&std::is_unsigned< T >::value &&!std::is_same< T, char >::value &&!is_bool< T >::value >::type >{static constexpr object_category value{object_category::unsigned_integral};};template< typename T >struct classify_object< T, typename std::enable_if< std::is_same< T, char >::value &&!std::is_enum< T >::value >::type >{static constexpr object_category value{object_category::char_value};};template< typename T > struct classify_object< T, typename std::enable_if< is_bool< T >::value >::type >{static constexpr object_category value{object_category::boolean_value};};template< typename T > struct classify_object< T, typename std::enable_if< std::is_floating_point< T >::value >::type >{static constexpr object_category value{object_category::floating_point};};template< typename T >struct classify_object< T, typename std::enable_if<!std::is_floating_point< T >::value &&!std::is_integral< T >::value &&std::is_assignable< T &, std::string >::value >::type >{static constexpr object_category value{object_category::string_assignable};};template< typename T >struct classify_object< T, typename std::enable_if<!std::is_floating_point< T >::value &&!std::is_integral< T >::value &&!std::is_assignable< T &, std::string >::value &&(type_count< T >::value==1)&&std::is_constructible< T, std::string >::value >::type >{static constexpr object_category value{object_category::string_constructible};};template< typename T > struct classify_object< T, typename std::enable_if< std::is_enum< T >::value >::type >{static constexpr object_category value{object_category::enumeration};};template< typename T > struct classify_object< T, typename std::enable_if< is_complex< T >::value >::type >{static constexpr object_category value{object_category::complex_number};};template< typename T > struct uncommon_type{using type=typename std::conditional<!std::is_floating_point< T >::value &&!std::is_integral< T >::value &&!std::is_assignable< T &, std::string >::value &&!std::is_constructible< T, std::string >::value &&!is_complex< T >::value &&!is_mutable_container< T >::value &&!std::is_enum< T >::value, std::true_type, std::false_type >::type;static constexpr bool value=type::value;};template< typename T >struct classify_object< T, typename std::enable_if<(!is_mutable_container< T >::value &&is_wrapper< T >::value &&!is_tuple_like< T >::value &&uncommon_type< T >::value)>::type >{static constexpr object_category value{object_category::wrapper_value};};template< typename T >struct classify_object< T, typename std::enable_if< uncommon_type< T >::value &&type_count< T >::value==1 &&!is_wrapper< T >::value &&is_direct_constructible< T, double >::value &&is_direct_constructible< T, int >::value >::type >{static constexpr object_category value{object_category::number_constructible};};template< typename T >struct classify_object< T, typename std::enable_if< uncommon_type< T >::value &&type_count< T >::value==1 &&!is_wrapper< T >::value &&!is_direct_constructible< T, double >::value &&is_direct_constructible< T, int >::value >::type >{static constexpr object_category value{object_category::integer_constructible};};template< typename T >struct classify_object< T, typename std::enable_if< uncommon_type< T >::value &&type_count< T >::value==1 &&!is_wrapper< T >::value &&is_direct_constructible< T, double >::value &&!is_direct_constructible< T, int >::value >::type >{static constexpr object_category value{object_category::double_constructible};};template< typename T >struct classify_object< T, typename std::enable_if< is_tuple_like< T >::value &&((type_count< T >::value >=2 &&!is_wrapper< T >::value)||(uncommon_type< T >::value &&!is_direct_constructible< T, double >::value &&!is_direct_constructible< T, int >::value)||(uncommon_type< T >::value &&type_count< T >::value >=2))>::type >{static constexpr object_category value{object_category::tuple_value};};template< typename T > struct classify_object< T, typename std::enable_if< is_mutable_container< T >::value >::type >{static constexpr object_category value{object_category::container_value};};template< typename T, enable_if_t< classify_object< T >::value==object_category::char_value, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"CHAR";}template< typename T, enable_if_t< classify_object< T >::value==object_category::integral_value||classify_object< T >::value==object_category::integer_constructible, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"INT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::unsigned_integral, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"UINT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::floating_point||classify_object< T >::value==object_category::number_constructible||classify_object< T >::value==object_category::double_constructible, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"FLOAT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::enumeration, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"ENUM";}template< typename T, enable_if_t< classify_object< T >::value==object_category::boolean_value, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"BOOLEAN";}template< typename T, enable_if_t< classify_object< T >::value==object_category::complex_number, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"COMPLEX";}template< typename T, enable_if_t< classify_object< T >::value >=object_category::string_assignable &&classify_object< T >::value<=object_category::other, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"TEXT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::tuple_value &&type_count_base< T >::value >=2, detail::enabler >=detail::dummy >std::string type_name();template< typename T, enable_if_t< classify_object< T >::value==object_category::container_value||classify_object< T >::value==object_category::wrapper_value, detail::enabler >=detail::dummy >std::string type_name();template< typename T, enable_if_t< classify_object< T >::value==object_category::tuple_value &&type_count_base< T >::value==1, detail::enabler >=detail::dummy >inline std::string type_name(){return type_name< typename std::decay< typename std::tuple_element< 0, T >::type >::type >);}template< typename T, std::size_t I >inline typename std::enable_if< I==type_count_base< T >::value, std::string >::type tuple_name(){return std::string{};}template< typename T, std::size_t I >inline typename std::enable_if<(I< type_count_base< T >::value), std::string >::type tuple_name(){auto str=std::string{type_name< typename std::decay< typename std::tuple_element< I, T >::type >::type >)}+ ','+tuple_name< T, I+1 >);if(str.back()== ',') str.pop_back();return str;}template< typename T, enable_if_t< classify_object< T >::value==object_category::tuple_value &&type_count_base< T >::value >=2, detail::enabler > > std::string type_name()
Recursively generate the tuple type name.
Definition: CLI11.h:1729
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1342
GLuint const GLchar * name
Definition: glcorearb.h:786
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
std::vector< std::pair< std::string, std::string > > Bindings
std::vector< std::string > HandleParmNames
HOM_API HOM_Module & HOM()
std::vector< std::vector< std::string > > MenuItemParms