9 #ifndef HOM_ViewerStateTemplate_h
10 #define HOM_ViewerStateTemplate_h
31 typedef std::vector< std::pair<std::string, std::string> >
Bindings;
39 HOM_ViewerStateTemplate(
41 std::string
const &
label,
43 std::vector<HOM_NodeTypeCategory*>
const& contexts =
44 std::vector<HOM_NodeTypeCategory*>())
59 virtual std::string typeName()
const = 0;
61 virtual std::string categoryName()
const = 0;
63 virtual std::vector<HOM_NodeTypeCategory*> contexts()
const = 0;
66 virtual void bindFactory_internal(
void *callback) = 0;
69 virtual void bindParameter(
71 std::string
const&
name=std::string(),
72 std::string
const&
label=std::string(),
73 std::string
const&
help=std::string(),
74 std::string
const& button_icon=std::string(),
75 MenuItemParms
const & menu_items=MenuItemParms(),
76 bool menu_as_button_strip=
false,
83 bool hide_label=
false) = 0;
86 virtual void bindHandle(
87 std::string
const& handle_type,
88 std::string
const&
name,
89 std::string
const& settings=std::string(),
90 bool cache_previous_parms =
false,
91 HandleParmNames
const& handle_parms = HandleParmNames()) = 0;
93 SWIGOUT(%kwargs bindHandleStatic;)
94 virtual void bindHandleStatic(
95 std::string
const& handle_type,
96 std::string
const& name,
97 Bindings
const & bindings,
98 std::string
const& settings=std::string() ) = 0;
101 virtual void bindGadget(
HOM_EnumValue const & drawable_type, std::string
const & name,
102 std::string
const &
label=std::string()) = 0;
104 SWIGOUT(%kwargs bindGeometrySelector;)
105 virtual void bindGeometrySelector(
106 std::string
const& prompt,
107 bool allow_drag =
false,
108 bool quick_select =
true,
109 bool auto_start =
true,
111 bool use_existing_selection =
true,
112 std::string
const& initial_selection=std::string(),
114 bool ordered =
false,
115 std::vector<HOM_EnumValue *>
const& geometry_types=std::vector<HOM_EnumValue *>(),
116 std::vector<HOM_EnumValue *>
const& primitive_types=std::vector<HOM_EnumValue *>(),
117 bool allow_other_sops =
true,
118 bool consume_selection =
true,
119 HOM_EnumValue const& secure_selection = HOM_secureSelectionOption::Off,
120 std::string
const& hotkey=std::string(),
121 std::string
const& name=std::string()) = 0;
123 SWIGOUT(%kwargs bindObjectSelector;)
124 virtual void bindObjectSelector(
125 std::string
const& prompt,
126 bool quick_select =
true,
127 bool auto_start =
true,
129 bool use_existing_selection =
true,
130 bool allow_multisel =
true,
131 HOM_EnumValue const& secure_selection = HOM_secureSelectionOption::Off,
132 std::vector<std::string>
const & allowed_types = std::vector<std::string>(1,
"*"),
133 std::string
const& hotkey=std::string(),
134 std::string
const& name=std::string()) = 0;
136 SWIGOUT(%kwargs bindSceneGraphSelector;)
137 virtual void bindSceneGraphSelector(
138 std::string
const& prompt,
139 bool allow_drag =
true,
140 bool quick_select =
true,
141 bool auto_start =
true,
143 bool use_existing_selection =
true,
144 bool allow_multisel =
true,
145 bool consume_selection =
false,
146 HOM_EnumValue const& secure_selection = HOM_secureSelectionOption::Off,
147 std::vector<std::string>
const& prior_selection_paths = std::vector<std::string>(),
148 HOM_EnumValue const& prim_mask = HOM_scenePrimMask::ViewerSetting,
149 std::string
const& path_prefix_mask = std::string(),
150 std::string
const& prim_kind = std::string(),
151 std::string
const& hotkey = std::string(),
152 std::string
const& name = std::string()) = 0;
154 SWIGOUT(%kwargs bindDynamicsSelector;)
155 virtual void bindDynamicsSelector(
156 std::string
const& prompt,
157 bool auto_start =
true,
159 bool allow_objects =
true,
160 bool allow_modifiers =
false,
161 bool quick_select =
false,
162 bool use_existing_selection =
true,
163 bool allow_multisel =
true,
164 HOM_EnumValue const& secure_selection = HOM_secureSelectionOption::Off,
165 std::string
const& hotkey=std::string(),
166 std::string
const& name=std::string()) = 0;
168 SWIGOUT(%kwargs bindDynamicsPointSelector;)
169 virtual void bindDynamicsPointSelector(
170 std::string
const& prompt,
171 bool auto_start =
true,
173 bool allow_objects =
true,
174 bool allow_modifiers =
false,
175 bool quick_select =
false,
176 bool use_existing_selection =
true,
177 bool allow_multisel =
true,
178 bool only_select_points =
true,
179 bool object_based_point_selection =
false,
180 bool use_last_selected_object =
false,
181 HOM_EnumValue const& secure_selection = HOM_secureSelectionOption::Off,
182 std::string
const& hotkey=std::string(),
183 std::string
const& name=std::string()) = 0;
185 SWIGOUT(%kwargs bindDynamicsPolygonSelector;)
186 virtual void bindDynamicsPolygonSelector(
187 std::string
const& prompt,
188 bool auto_start =
true,
190 bool quick_select =
false,
191 bool use_existing_selection =
true,
192 bool object_based_point_selection =
false,
193 bool use_last_selected_object =
false,
194 HOM_EnumValue const& secure_selection = HOM_secureSelectionOption::Off,
195 std::string
const& hotkey=std::string(),
196 std::string
const& name=std::string()) = 0;
198 SWIGOUT(%kwargs bindDrawableSelector;)
199 virtual void bindDrawableSelector(
200 std::string
const& prompt,
201 bool auto_start =
true,
203 std::vector<std::string>
const& drawable_mask = std::vector<std::string>(),
204 std::string
const& hotkey = std::string(),
205 std::string
const& name = std::string()) = 0;
208 virtual void bindSelector(
209 std::string
const& name,
210 std::string
const& selector_type,
211 std::string
const& prompt,
212 std::vector<HOM_EnumValue *> primitive_types = std::vector<HOM_EnumValue *>(),
213 std::string
const& group_parm_name = std::string(),
215 bool input_required =
true,
216 bool allow_dragging =
true ) = 0;
220 virtual void bindIcon( std::string
const & name ) = 0;
222 virtual void bindSupportsSelectionChange(
bool supports_change ) = 0;
223 virtual void bindSupportsMoveTool(
bool supports_movetool ) = 0;
225 virtual void bindPlaybackChangeEvent() = 0;
226 virtual void bindNodeChangeEvent(
const std::vector<HOM_EnumValue *> &event_types) = 0;
227 virtual void bindNodeParmChangeEvent(
const std::vector<std::string> &parm_names) = 0;
229 virtual void bindHotkeyDefinitions(
232 virtual void serializeParameters(
bool value) = 0;
237 virtual void bindFactory(InterpreterObject callback)
239 self->bindFactory_internal(callback);
245 #endif // HOM_ViewerStateTemplate_h
#define HOM_DESTRUCT_OBJECT(pointer)
GLuint GLsizei const GLchar * label
GLsizei const GLfloat * value
HOM_ViewerStateTemplate()
string __repr__(VtArray< T > const &self)
std::string help(const App *app, const Error &e)
Printout the full help string on error (if this fn is set, the old default for CLI11) ...
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)
void ignore(T const &) VULKAN_HPP_NOEXCEPT
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.
#define HOM_CONSTRUCT_OBJECT(pointer)
GLuint const GLchar * name
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
virtual ~HOM_ViewerStateTemplate()
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