33 #include <hboost/any.hpp>
36 #define DT_LODCHOOSER_PLUGIN_NAME "Object Appearance"
37 #define DT_LIGHTBANK_PLUGIN_NAME "Light Bank"
38 #define DT_STYLER_PLUGIN_NAME "Material Style Sheets"
84 MI_ToggleUnchecked = 0x02,
85 MI_ToggleChecked = 0x06,
96 bool isToggle()
const;
97 bool toggledOn()
const;
98 bool hasSubmenu()
const;
157 const T &
get()
const {
return hboost::any_cast<
const T &>(*this); }
187 static bool getMenuItemsFromTemplate(
const PRM_Template &tpl,
216 int id()
const {
return myId; }
224 const char *typeName()
const;
247 DT_ParmDef *setOptionType(OptionType opt_type);
260 {
return myCanBeIndeterminate; }
265 {
return !readOnly(); }
304 return static_cast<const DT_ParmDefToggle &
>(def);
310 DT_ParmDefToggle *setRadio();
311 bool isRadio()
const;
320 const char *toggleIcon()
const;
364 return static_cast<const DT_ParmDefInteger &
>(def);
370 DT_ParmDefInteger *setVectorSize(
int32 size);
371 int32 vectorSize()
const;
384 DT_ParmDefInteger *setRangeLock(
bool min,
bool max);
385 void getRangeLock(
bool &
min,
bool &
max)
const;
413 int32 myRangeMin, myRangeMax;
414 bool myRangeLockMin, myRangeLockMax;
430 return static_cast<const DT_ParmDefFloat &
>(def);
435 DT_ParmDefFloat *setVectorSize(
int32 size);
436 int32 vectorSize()
const;
441 DT_ParmDefFloat *setRangeLock(
bool min,
bool max);
442 void getRangeLock(
bool &
min,
bool &
max)
const;
467 fpreal myRangeMin, myRangeMax;
468 bool myRangeLockMin, myRangeLockMax;
483 return static_cast<const DT_ParmDefColor &
>(def);
486 DT_ParmDefColor *setIncludeAlpha(
bool include_alpha);
487 bool includeAlpha()
const;
522 return static_cast<const DT_ParmDefString &
>(def);
525 DT_ParmDefString *setStringType(StringType
type);
526 StringType stringType()
const;
528 DT_ParmDefString *setHasMenu();
529 bool hasMenu()
const;
532 void copyValue(
const char *
src,
541 StringType myStringType;
560 return static_cast<const DT_ParmDefMenu &
>(def);
575 DT_ParmDefMenu *setDynamicMenu(
fpreal pref_width_in_em = 12.0);
578 bool isDynamicMenu()
const;
584 DT_ParmDefMenu *setActionMenu();
587 bool isActionMenu()
const;
590 fpreal dynamicMenuWidth()
const;
593 void copyValue(
const char *
src,
636 return static_cast<const DT_ParmDefPath &
>(def);
639 DT_ParmDefPath *setPathType(PathType
path_type);
640 PathType pathType()
const;
643 const char *opFilter()
const;
645 DT_ParmDefPath *setMultiSelection();
646 bool multiSelection()
const;
649 void copyValue(
const char *
src,
660 bool myMultiSelection;
673 return static_cast<const DT_ParmDefButton &
>(def);
677 const char *labelText()
const;
680 const char *labelIcon()
const;
708 return static_cast<const DT_ParmDefGrouped &
>(def);
711 DT_ParmDefGrouped *addGroupedDef(
const DT_ParmDefHandle &parm_def);
714 {
return myGroupedParmDefs; }
719 DT_ParmDefList myGroupedParmDefs;
740 bool sort_children =
true);
746 void setName(
const char *name);
749 void setIcon(
const char *icon);
752 void setOpId(
int op_id);
755 void setSortChildren(
bool sort_children);
757 {
return mySortChildren; }
761 DT_NodeId
id()
const {
return myId; }
765 {
return myId == other.myId; }
767 {
return myId != other.myId; }
777 void init(DT_NodeId
id, DT_NodeId parent_id,
778 const char *name,
bool sort_children);
781 DT_NodeId myParentId;
822 virtual void setNodeFilter(
const char *
pattern,
bool filter_cells) = 0;
826 virtual void nodesChanged(NodeChangeType
type,
827 const DT_NodeIdSet &node_ids) = 0;
830 virtual void sharedOptionsChanged() = 0;
836 virtual bool addInterestOnNode(DT_NodeHandle node) = 0;
841 virtual bool removeInterestOnNode(DT_NodeHandle node) = 0;
844 virtual void startRename(DT_NodeHandle node) = 0;
849 virtual void parameterDefsChanged() = 0;
853 virtual void saveTreeExpansionState(
bool match_nodes_by_name) = 0;
878 virtual bool getViewportSelection(
883 virtual void interruptViewportSelection();
901 const DT_NodeHandle &
rootNode()
const {
return myRootNode; }
933 DT_NodeList &list) = 0;
955 DT_NodeList *filtered_list)
972 {
return RS_INVALID; }
983 const char *sub_menu_token,
984 DT_NodeMenuItemList &items)
991 const char *menu_token)
1009 virtual const DT_ParmDefList &getParameterDefs() = 0;
1032 virtual ParmState getParameterValue(
const DT_Node &node,
int parm_id,
1039 virtual bool setParameterValue(
const DT_Node &node,
int parm_id,
1046 virtual bool setParameterValues(
const DT_NodeList &node_list,
1084 virtual const DT_ParmDefList &getOptionDefs();
1112 virtual void opEvent(
const DT_NodeIdSet &node_ids,
1132 const char *data_label)
1136 const char *data_label)
1142 const char *data_label)
1173 {
return writeDesktopData(os); }
1176 {
return readDesktopData(is); }
1185 static DT_NodeHandle createRootNode();
1188 DT_NodeHandle myRootNode;
1209 virtual DT_PluginHandle create(
DT_Host &host) = 0;
1250 #endif // __DT_Plugin__
const DT_NodeHandle & rootNode() const
UT_StringHolder myToolbarName
GT_API const UT_StringHolder selection
path_type
CLI enumeration of different file types.
GLuint GLsizei const GLchar * label
virtual bool getSelected(const DT_Node &node, bool &state)
SYS_VISIBILITY_EXPORT void newDataTreePluginFactory()
void copy(const DT_Value &v)
bool operator==(const DT_Node &other) const
#define SYS_VISIBILITY_EXPORT
virtual void opEvent(const DT_NodeIdSet &node_ids, OP_EventType type, void *data)
virtual bool renameNode(const DT_Node &node, const char *new_name)
Called when a request for node rename occurs.
virtual bool dragHasData(const DT_Node &node, const char *data_label)
Drag Source.
UT_Array< DT_NodeMenuItem > DT_NodeMenuItemList
UT_SharedPtr< const DT_ParmDef > DT_ParmDefHandle
virtual bool getParameterMenuItems(const DT_Node &node, int parm_id, DT_MenuItemList &items)
Use id of node(s) whose selection changed.
bool allowsMultiValueSet() const override
Dont allow triggering multiple radio buttons with one click.
const UT_StringHolder & name() const
GLboolean GLboolean GLboolean GLboolean a
UT_SharedPtr< DT_ParmDef > DT_ParmDefPtr
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
Floating point type. DT_ParmDefFloat.
bool canBeIndeterminate() const
GLenum GLenum GLsizei const GLuint GLboolean enabled
UT_SharedPtr< const DT_Node > DT_NodeHandle
virtual bool writeSceneData(std::ostream &os)
void clear()
Reset the DT_Value object to be empty.
DT_Value & operator=(const T &value)
UT_Set< DT_NodeId > DT_NodeIdSet
An unordered set of unique node identifiers.
virtual bool pasteNodes(const DT_Node &parent_node)
Called when a request to paste into a parent node occurs.
virtual bool canDeleteNode(const DT_Node &node)
The node delete operation is valid for this plugin.
virtual bool setOptionValue(int parm_id, const DT_Value &value)
Sets an option value for the plugin.
Menu type. DT_ParmDefMenu.
UT_Array< DT_NodeHandle > DT_NodeList
Use id of node(s) that should be expanded.
Opaque data type to pass values of any type across boundaries.
virtual bool getOptionValue(int parm_id, DT_Value &value)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
CompareResults OIIO_API compare(const ImageBuf &A, const ImageBuf &B, float failthresh, float warnthresh, ROI roi={}, int nthreads=0)
const UT_StringHolder & icon() const
Only show plugin option in dialog (default)
GU_API GA_OffsetArray getChildren(const GU_Detail *gdp, const GA_Offset &node, bool recurse=false)
exint DT_NodeId
A unique node identifier.
bool any(const vbool4 &v)
Objects + virtual SOP paths.
const DT_ParmDefList & groupedDefs() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
virtual ~DT_PluginFactory()
UT_Array< DT_ParmDefHandle > DT_ParmDefList
The value state is indeterminate.
virtual void nodesReordered(const DT_Node &parent_node, const UT_IntArray &from_idx, const UT_IntArray &to_idx)
bool operator!=(const DT_Node &other) const
Integer type. DT_ParmDefInteger.
Use id of node(s) that should be collapsed.
UT_StringHolder myTooltip
UT_SharedPtr< DT_Plugin > DT_PluginHandle
const UT_StringHolder & tooltip() const
virtual bool readSceneData(std::istream &is)
Toggle type. DT_ParmDefToggle.
virtual bool getNodeInfoText(const DT_Node &node, UT_WorkBuffer &info_text)
Get the info text to show in the MMB popup window.
virtual bool canCopyNodes(const DT_NodeList &list, DT_NodeList *filtered_list)
Check if the node copy operation is valid for this plugin.
const UT_StringHolder & name() const
Returns the name of the parameter definition.
GLuint const GLchar * name
virtual void runDelayedAction(int action_id, const UT_Array< UT_SharedPtr< void > > &data_list)
OptionType optionType() const
bool myCanBeIndeterminate
GLboolean GLboolean GLboolean b
Color type. DT_ParmDefColor.
Path type. DT_ParmDefPath.
virtual RenameStyle getRenameStyle(const DT_Node &node)
The node rename operation is valid for this plugin.
virtual bool getOptionMenuItems(int parm_id, DT_MenuItemList &items)
UT_Array< DT_MenuItem > DT_MenuItemList
Use id of node(s) removed.
Use parent id(s) of node(s) moved.
Show option in both toolbar and dialog.
virtual bool operator==(const DT_ParmDef &other) const =0
virtual void * dragGetData(const DT_Node &node, const char *data_label)
Drag Source.
bool sortChildren() const
virtual bool writeDesktopData(std::ostream &os)
Use id of node(s) whose value changed.
No value can be retrieved.
LeafData & operator=(const LeafData &)=delete
DT_NodeId parentId() const
virtual int getGroupedParameterId(const DT_Node &node, int parm_id)
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
virtual bool dropAccept(const DT_Node &node, DD_Source &drag_src, const char *data_label)
Drop Receiver.
const UT_StringHolder & icon() const
virtual bool copyNodes(const DT_NodeList &list)
Called when a request to copy occurs.
virtual bool readDesktopData(std::istream &is)
virtual bool canPasteNodes(const DT_Node &parent_node)
Check if the reviously copied nodes can be pasted into the given parent.
virtual bool getNodeMenu(const DT_NodeList &node_list, const char *sub_menu_token, DT_NodeMenuItemList &items)
virtual bool dropTest(const DT_Node &node, DD_Source &drag_src)
Drag Source.
virtual void dropGetChoice(const DT_Node &node, DD_Source &drag_src, DD_ChoiceList &drop_choices)
Drag Source.
virtual bool hasChildren(const DT_Node &parent)
static DT_NodeId invalidId()
A value that can be used to denote an invalid node id.
Use id of node(s) renamed.
virtual void runMenuAction(const DT_NodeList &node_list, const char *menu_token)
Button type. DT_ParmDefButton.
UT_Array< DT_NodeId > DT_NodeIdList
A flat list of node identifiers.
NodeChangeType
The list of node change types when calling DT_Host::nodesChanged.
virtual bool setSelected(const DT_Node &node, bool state)
Use parent id(s) of node(s) added.
virtual bool deleteNodes(const DT_NodeList &node_list)
Called when a request for delete occurs.
String type. DT_ParmDefString.
virtual bool allowsMultiValueSet() const