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