HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OPUI_GraphDisplayOptions.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_GraphDisplayOptions.h (User Interface Library, C++)
7  *
8  * COMMENTS:
9  * A class to control the way items are displayed in the graph.
10  *
11  */
12 
13 #ifndef __OPUI_GraphDisplayOptions__
14 #define __OPUI_GraphDisplayOptions__
15 
16 #include "OPUI_API.h"
17 #include "OPUI_GraphBadge.h"
18 #include "OPUI_GraphTextBadge.h"
19 #include <OP/OP_Context.h>
20 #include <UT/UT_StringHolder.h>
21 #include <UT/UT_Color.h>
22 #include <UT/UT_Array.h>
23 #include <UT/UT_Map.h>
24 
25 class UT_OptionFile;
26 class AP_Interface;
27 class CV_Canvas;
29 class OP_Network;
30 
32 
33 extern "C" {
35  void OPUIaddBadges(OPUI_GraphBadgeArray *add_badges);
36 }
37 extern "C" {
39  void OPUIaddTextBadges(OPUI_GraphTextBadgeArray *add_textbadges);
40 }
41 
43 {
44 public:
46  virtual ~OPUI_GraphDisplayOptions();
47 
48  // Add our preference key/values to the canvas.
49  void registerPreferences(CV_Canvas &canvas);
50 
51  // Returns true if one of our options was changed by this call.
52  void setPref(const UT_StringHolder &pref,
53  const UT_StringHolder &value);
54 
55  const UT_StringHolder &perfStatName() const;
56  bool showPerfStats() const;
57  const UT_StringHolder &taskGraphPerfStatName() const;
58  bool showTaskGraphPerfStats() const;
59  const UT_StringHolder &taskGraphSortCriteria() const;
60  bool taskGraphSortDirection() const;
61  const UT_StringHolder &taskGraphCollapseMode() const;
62  bool useWorkItemColorAttribute() const;
63  const UT_StringHolder &workItemColorAttribute() const;
64  const UT_StringHolder &workItemAttrToCollapseBy() const;
65  bool showAllDependencies() const;
66  bool showSelectedDependencies() const;
67  bool showChildDependencies() const;
68  bool showSpareInputDependencies() const;
69  const UT_Array<UT_Color> &paletteColors() const;
70 
71  bool showNodeTypes() const;
72  bool showNodeShapes() const;
73  bool showCop2Previews() const;
74  bool showVopPreviews() const;
75  bool showTaskGraph() const;
76  bool showCookedWorkItems() const;
77  bool showCookingWorkItems() const;
78  bool showDirtyWorkItems() const;
79  bool showCancelledWorkItems() const;
80  bool showFailedWorkItems() const;
81  bool showStaticWorkItems() const;
82  bool showPartitionWorkItems() const;
83  bool soloHighlightedWorkItems() const;
84  bool showPromptText() const;
85  bool showSimpleShape() const;
86  bool showVopInOutLabels() const;
87  bool showStackedLook() const;
88  bool dimUnusedNodes() const;
89  bool showLopLayerColor() const;
90 
91  fpreal maxFlyoutScale() const;
92  fpreal maxNameWidth() const;
93  int minNameHeight() const;
94  int maxNameHeight() const;
95  fpreal wireFadeFactor() const;
96 
97  int maxTaskGraphDepth() const;
98  int maxTaskGraphRows() const;
99  int maxWorkItemsPerRow() const;
100 
101  int badgeCount() const
102  { return theRegisteredBadges.entries(); }
104  { return myBadgeNormalIndexes; }
106  { return myBadgeLargeIndexes; }
107  const OPUI_GraphBadge &badge(int badgeidx) const;
108  bool badgeVisible(int badgeidx,
110  OPUI_GraphBadgeInfo info,
111  UT_StringHolder &icon,
112  UT_Color &color) const;
113  int textBadgeCount() const
114  { return theRegisteredTextBadges.entries(); }
116  { return myTextBadgeIndexes; }
117  const OPUI_GraphTextBadge &textBadge(int textbadgeidx) const;
118  bool textBadgeVisible(int textbadgeidx,
119  OPUI_GraphBadgeInfo info,
120  UT_StringHolder &text,
121  bool &full_text,
122  fpreal &full_text_max_width,
123  UT_Color &color) const;
124  bool prepareSingleThreadedBadges(OP_Network *net, int num_nodes);
125  int calculateSingleThreadedBadges(
126  OPUI_GraphBadgeInfo info);
127 
128  static const UT_StringArray topInOutColorTags();
129  static const UT_StringArray topInOutColors();
130  static const UT_StringHolder topInOutColor(UT_StringHolder tag);
131 
132  static void installPlugins(const char *func_name,
133  void *func_data);
134  static void installBadges();
135  static void installTextBadges();
136 
137  static void installTopInOutColors();
138 
139  static void saveGlobalPrefs(AP_Interface &app);
140  static void loadGlobalPrefs(AP_Interface &app);
141  static void importGlobalPrefs(AP_Interface &app);
142  static void exportGlobalPrefs(AP_Interface &app);
143  static void addGlobalPref(const UT_StringHolder &pref);
144  static bool isGlobalPref(const UT_StringHolder &pref);
145 
146  static void clearAllContexts();
147 
148 private:
149  static void setGlobalPref(const UT_StringHolder &pref,
150  const UT_StringHolder &value);
151  static void getGlobalPref(const UT_StringHolder &pref,
152  UT_StringHolder &value);
153 
154  static bool loadPaletteColors(
155  const char *json_buf,
156  UT_Array<UT_Color> &colors);
157  static void loadDefaultPaletteColors(
158  UT_Array<UT_Color> &colors);
159  static void savePaletteColors(
160  const UT_Array<UT_Color> &colors,
161  UT_WorkBuffer &json_buf);
162 
163  static int findBadgeWithPref(
164  const UT_StringHolder &pref);
165  static int findTextBadgeWithPref(
166  const UT_StringHolder &pref);
167 
168  UT_StringHolder myPerfStatName;
169  bool myShowPerfStats;
170  UT_StringHolder myTaskGraphPerfStatName;
171  bool myShowTaskGraphPerfStats;
172  UT_StringHolder myTaskGraphSortCriteria;
173  bool myTaskGraphSortDirection;
174  UT_StringHolder myTaskGraphCollapseMode;
175  bool myUseWorkItemColorAttribute;
176  UT_StringHolder myWorkItemColorAttribute;
177  UT_StringHolder myWorkItemAttrToCollapseBy;
178  bool myShowAllDependencies;
179  bool myShowSelectedDependencies;
180  bool myShowChildDependencies;
181  bool myShowSpareInputDependencies;
182  bool myPaletteColorsAreDefault;
183  UT_Array<UT_Color> myPaletteColors;
184 
185  UT_Array<UT_Array<bool> > mySingleThreadedBadgeData;
186  UT_Array<UT_StringArray> mySingleThreadedBadgeIcons;
187  UT_Array<UT_Array<UT_Color> > mySingleThreadedBadgeColors;
188  UT_IntArray mySingleThreadedBadgeIndexes;
189  UT_Array<UT_StringArray> mySingleThreadedTextBadgeData;
190  UT_Array<UT_Array<UT_Color> > mySingleThreadedTextBadgeColors;
191  UT_IntArray mySingleThreadedTextBadgeIndexes;
192  int mySingleThreadedDataId;
193  UT_IntArray myBadgeNormalIndexes;
194  UT_IntArray myBadgeLargeIndexes;
195  UT_IntArray myTextBadgeIndexes;
196  OP_Context myContext;
197 
198  static fpreal theMaxFlyoutScale;
199  static fpreal theMaxNameWidth;
200  static fpreal theMinNameHeight;
201  static fpreal theMaxNameHeight;
202  static fpreal theWireFadeFactor;
203  static fpreal theSnapRadius;
204  static fpreal theConnectorSnapRadius;
205  static fpreal theShakeSensitivity;
206  static bool theShowNodeTypes;
207  static bool theShowNodeShapes;
208  static bool theShowPreviews;
209  static bool theShowTaskGraph;
210  static bool theShowCookedWorkItems;
211  static bool theShowCookingWorkItems;
212  static bool theShowDirtyWorkItems;
213  static bool theShowCancelledWorkItems;
214  static bool theShowFailedWorkItems;
215  static bool theShowStaticWorkItems;
216  static bool theShowPartitionWorkItems;
217  static bool theSoloHighlightedWorkItems;
218  static int theMaxTaskGraphDepth;
219  static int theMaxTaskGraphRows;
220  static int theMaxWorkItemsPerRow;
221  static UT_StringArray theTopInOutColorTags;
222  static UT_StringArray theTopInOutColors;
223  static bool theShowPromptText;
224  static bool theShowSimpleShape;
225  static bool theShowVopInOutLabels;
226  static bool theShowStackedLook;
227  static bool theDimUnusedNodes;
228  static bool theShowLopLayerColor;
229  static bool theShowAnimations;
230  static bool theAutoScroll;
231  static bool theTransientInfo;
232  static bool theFlagsAllowPreSelect;
233  static bool theAllowDiveIntoHDAs;
234  static bool theCopyPathsToClipboard;
235  static OPUI_OptionsCanvasMap theRegisteredCanvases;
236  static OPUI_GraphBadgeArray theRegisteredBadges;
237  static OPUI_GraphTextBadgeArray theRegisteredTextBadges;
238 };
239 
240 #endif
241 
Unsorted map container.
Definition: UT_Map.h:114
#define OPUI_API
Definition: OPUI_API.h:10
#define SYS_VISIBILITY_EXPORT
GLsizei const GLfloat * value
Definition: glcorearb.h:824
UT_Map< OPUI_GraphDisplayOptions *, CV_Canvas * > OPUI_OptionsCanvasMap
SYS_VISIBILITY_EXPORT void OPUIaddTextBadges(OPUI_GraphTextBadgeArray *add_textbadges)
SYS_VISIBILITY_EXPORT void OPUIaddBadges(OPUI_GraphBadgeArray *add_badges)
const UT_IntArray & badgeNormalIndexes() const
const UT_IntArray & badgeLargeIndexes() const
const UT_IntArray & textBadgeIndexes() const
OPUI_GraphBadgeVisibility
GLuint color
Definition: glcorearb.h:1261
fpreal64 fpreal
Definition: SYS_Types.h:283