HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OPUI_GraphBadge.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  * NAME: OPUI_GraphBadge.h (User Interface Library, C++)
7  *
8  * COMMENTS:
9  * A class to describe a node badge.
10  *
11  */
12 
13 #ifndef __OPUI_GraphBadge__
14 #define __OPUI_GraphBadge__
15 
16 #include "OPUI_API.h"
17 #include <UT/UT_Array.h>
18 #include <UT/UT_Color.h>
19 #include <UT/UT_StringHolder.h>
20 #include <UT/UT_Error.h>
21 #include <variant>
22 
23 class OPUI_GraphBadge;
24 class OP_Context;
25 class OP_Node;
26 
32 };
33 
37 };
38 
39 /// Holder of the UN_Node handle.
40 // Using this holder instead of directly UN_Node handle to avoid exporting UN
41 // headers to HDK.
42 // TODO: FIXME: Once UN headers are available in HDK, remove this holder class!
43 #include <UT/UT_UniquePtr.h>
44 class UN_ConstNode;
45 
47 {
48 public:
50  OPUI_UnNodeHolder( const OPUI_UnNodeHolder &other );
51  explicit OPUI_UnNodeHolder( const UN_ConstNode &un_node );
53 
55 
56  explicit operator bool() const;
57 
58  const UN_ConstNode * get() const { return myUnNode.get(); }
59  const UN_ConstNode * operator->() const { return myUnNode.get(); }
60  const UN_ConstNode & operator*() const { return *myUnNode; }
61 
62 
63 private:
65 };
66 
67 
69 {
70 public:
71  using Node = std::variant<OP_Node*, OPUI_UnNodeHolder>;
72 
73  OP_Node * opNode() const
74  {
75  auto p = std::get_if<OP_Node*>(&myItem);
76  return p ? *p : nullptr;
77  }
78 
79  const UN_ConstNode * unNode() const
80  {
81  auto p =std::get_if<OPUI_UnNodeHolder>(&myItem);
82  return p ? p->get() : nullptr;
83  }
84 
88  bool myCurrent;
89  bool myPicked;
90 };
91 
93  OPUI_GraphBadgeVisibility visibility,
94  OP_Context &context,
95  UT_StringHolder &icon,
96  UT_Color &clr);
98 
100 {
101 public:
102  OPUI_GraphBadge(const UT_StringHolder &pref,
103  const UT_StringHolder &category,
104  const UT_StringHolder &description,
105  const UT_StringHolder &icon,
108  OPUI_GraphBadgeThreading threading);
109  ~OPUI_GraphBadge();
110 
112  { return myPreferenceName; }
114  { return myPreferenceCategory; }
116  { return myDescription; }
117  const UT_StringHolder &getIcon() const
118  { return myIcon; }
120  { return myDefaultVisibility; }
122  { return myBadgeTest; }
123  bool getThreadSafe() const
124  { return myThreadSafe; }
125 
127  { return myVisibility; }
129  { myVisibility = vis; }
130 
131  static void addBadges(OPUI_GraphBadgeArray &add_badges);
132 
149 
159 
163 
166 
170 
171 private:
172  UT_StringHolder myPreferenceName;
173  UT_StringHolder myPreferenceCategory;
174  UT_StringHolder myDescription;
175  UT_StringHolder myIcon;
176  OPUI_GraphBadgeVisibility myDefaultVisibility;
177  OPUI_GraphBadgeVisibility myVisibility;
178  OPUI_GraphBadgeTest myBadgeTest;
179  bool myThreadSafe;
180 };
181 
182 #endif
183 
static const UT_StringHolder theCommentPref
OPUI_GraphBadgeVisibility getVisibility() const
static const UT_StringHolder theNodeDiveablePref
bool getThreadSafe() const
static const UT_StringHolder the64bitPref
OP_Node * opNode() const
cvex test(vector P=0;int unbound=3;export float s=0;export vector Cf=0;)
Definition: test.vfl:11
static const UT_StringHolder theParametersBadgeCategory
static const UT_StringHolder theLopDebugPref
#define OPUI_API
Definition: OPUI_API.h:10
Definition: Node.h:52
static const UT_StringHolder theKinematicsPref
static const UT_StringHolder theLoadFromDiskPref
static const UT_StringHolder theHDALockedPref
UT_ErrorSeverity myErrorSeverity
static const UT_StringHolder theLopUnloadedPayloadsPref
UT_ErrorSeverity
Definition: UT_Error.h:25
static const UT_StringHolder theConstraintsPref
const UT_StringHolder & getPreferenceName() const
static const UT_StringHolder theNodeHasDataPref
OPUI_GraphBadgeVisibility getDefaultVisibility() const
const UT_StringHolder & getDescription() const
OutGridT const XformOp bool bool
UT_Array< OPUI_GraphBadge > OPUI_GraphBadgeArray
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
static const UT_StringHolder theNotCompilablePref
static const UT_StringHolder theErrorPref
static const UT_StringHolder theHasTakeDataPref
static const UT_StringHolder theContinuousCookPref
static const UT_StringHolder theLopPopulationMaskPref
OPUI_GraphBadgeTest getBadgeTest() const
void setVisibility(OPUI_GraphBadgeVisibility vis)
static const UT_StringHolder theMainBadgeCategory
static const UT_StringHolder theChildErrorPref
OPUI_GraphBadgeVisibility
const UT_StringHolder & getIcon() const
static const UT_StringHolder theNodeUnloadPref
static const UT_StringHolder theNeedsCookPref
static const UT_StringHolder theMessagePref
static const UT_StringHolder theDynamicTOPPref
static const UT_StringHolder theTimeDepPref
const UN_ConstNode * operator->() const
LeafData & operator=(const LeafData &)=delete
static const UT_StringHolder theMQClientsAuthPref
static const UT_StringHolder theTagsPref
const UT_StringHolder & getPreferenceCategory() const
OPUI_GraphBadgeThreading
const UN_ConstNode * unNode() const
static const UT_StringHolder theContextSpecificBadgeCategory
static const UT_StringHolder theHDAUnlockedPref
static const UT_StringHolder theMQServerAuthPref
static const UT_StringHolder theHDADelaySyncPref
static const UT_StringHolder theVexCachePref
static const UT_StringHolder theWarningPref
bool(* OPUI_GraphBadgeTest)(const OPUI_GraphBadgeInfo &info, OPUI_GraphBadgeVisibility visibility, OP_Context &context, UT_StringHolder &icon, UT_Color &clr)
static const UT_StringHolder theNodeLockedPref
static const UT_StringHolder theLiveRenderPref
const UN_ConstNode & operator*() const