HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HUSD_Preferences.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 Side Effects Software Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 #ifndef __HUSD_Preferences_h__
19 #define __HUSD_Preferences_h__
20 
21 #include "HUSD_API.h"
22 #include <UT/UT_Color.h>
23 #include <UT/UT_Function.h>
24 #include <UT/UT_Map.h>
25 #include <UT/UT_StringHolder.h>
26 
28 {
29 public:
30  // Returns a string containing the concatenation of all the default paths
31  // that are likely to end up containing collections. This string is built
32  // by combining other preferences.
33  static const UT_StringHolder defaultCollectionsSearchPath();
34 
35  static const UT_StringHolder &defaultNewPrimPath();
36  static bool setDefaultNewPrimPath(
37  const UT_StringHolder &path);
38 
39  static const UT_StringHolder &defaultCollectionsPrimPath();
40  static bool setDefaultCollectionsPrimPath(
41  const UT_StringHolder &path);
42 
43  static const UT_StringHolder &defaultCollectionsPrimType();
44  static bool setDefaultCollectionsPrimType(
45  const UT_StringHolder &primtype);
46 
47  static const UT_StringHolder &defaultLightsPrimPath();
48  static bool setDefaultLightsPrimPath(
49  const UT_StringHolder &path);
50 
51  static const UT_StringHolder &defaultCamerasPrimPath();
52  static bool setDefaultCamerasPrimPath(
53  const UT_StringHolder &path);
54 
55  static const UT_StringHolder &defaultTransformSuffix();
56  static bool setDefaultTransformSuffix(
57  const UT_StringHolder &suffix);
58 
59  static bool showResolvedPaths();
60  static bool setShowResolvedPaths(
61  bool show_resolved_paths);
62 
63  static bool panesFollowCurrentNode();
64  static bool setPanesFollowCurrentNode(
65  bool follow_current_node);
66 
67  static bool panesShowViewportStage();
68  static bool setPanesShowViewportStage(
69  bool show_viewport_stage);
70 
71  static bool panesShowPostLayers();
72  static bool setPanesShowPostLayers(
73  bool show_post_layers);
74 
75  static bool autoSetAssetResolverContext();
76  static bool setAutoSetAssetResolverContext(
77  bool auto_set_context);
78 
79  static bool updateRendererInBackground();
80  static bool setUpdateRendererInBackground(
81  bool update_in_background);
82 
83  static bool loadPayloadsByDefault();
84  static bool setLoadPayloadsByDefault(
85  bool load_payloads);
86 
87  static bool useSimplifiedLinkerUi();
88  static bool setUseSimplifiedLinkerUi(
89  bool use_simplified_linker_ui);
90 
91  static bool usingHoudiniMetersPerUnit();
92  static double defaultMetersPerUnit();
93  static bool setDefaultMetersPerUnit(
94  double metersperunit);
95 
96  static bool usingUsdUpAxis();
97  static UT_StringHolder defaultUpAxis();
98  static bool setDefaultUpAxis(
99  const UT_StringHolder &upaxis);
100 
101  static bool allowViewportOnlyPayloads();
102  static bool setAllowViewportOnlyPayloads(
103  bool allow_viewport_only_payloads);
104 
105  static bool pathParameterCompletion();
106  static bool setPathParameterCompletion(
107  bool path_parameter_completion);
108 
109  static bool savePrefs();
110  static bool loadPrefs();
111 
113  static int addPrefChangeCallback(
114  PrefChangeCallback callback);
115  static void removePrefChangeCallback(int id);
116 
117 private:
118  static void runPrefChangeCallbacks();
119 
120  static UT_StringHolder theDefaultNewPrimPath;
121  static UT_StringHolder theDefaultCollectionsPrimPath;
122  static UT_StringHolder theDefaultCollectionsPrimType;
123  static UT_StringHolder theDefaultLightsPrimPath;
124  static UT_StringHolder theDefaultCamerasPrimPath;
125  static UT_StringHolder theDefaultTransformSuffix;
126  static bool theShowResolvedPaths;
127  static bool thePanesFollowCurrentNode;
128  static bool thePanesShowViewportStage;
129  static bool thePanesShowPostLayers;
130  static bool theAutoSetAssetResolverContext;
131  static bool theUpdateRendererInBackground;
132  static bool theLoadPayloadsByDefault;
133  static bool theUseSimplifiedLinkerUi;
134  static double theDefaultMetersPerUnit;
135  static UT_StringHolder theDefaultUpAxis;
136  static bool theAllowViewportOnlyPayloads;
137  static bool thePathParameterCompletion;
138  static UT_Map<int, PrefChangeCallback> thePrefChangeCallbacks;
139  static int thePrefChangeCallbackId;
140 };
141 
142 #endif
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
#define HUSD_API
Definition: HUSD_API.h:32
UT_Function< void(void)> PrefChangeCallback
std::function< T > UT_Function
Definition: UT_Function.h:37