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 usingHoudiniMetersPerUnit();
88  static double defaultMetersPerUnit();
89  static bool setDefaultMetersPerUnit(
90  double metersperunit);
91 
92  static bool usingUsdUpAxis();
93  static UT_StringHolder defaultUpAxis();
94  static bool setDefaultUpAxis(
95  const UT_StringHolder &upaxis);
96 
97  static bool allowViewportOnlyPayloads();
98  static bool setAllowViewportOnlyPayloads(
99  bool allow_viewport_only_payloads);
100 
101  static bool pathParameterCompletion();
102  static bool setPathParameterCompletion(
103  bool path_parameter_completion);
104 
105  static bool savePrefs();
106  static bool loadPrefs();
107 
109  static int addPrefChangeCallback(
110  PrefChangeCallback callback);
111  static void removePrefChangeCallback(int id);
112 
113 private:
114  static void runPrefChangeCallbacks();
115 
116  static UT_StringHolder theDefaultNewPrimPath;
117  static UT_StringHolder theDefaultCollectionsPrimPath;
118  static UT_StringHolder theDefaultCollectionsPrimType;
119  static UT_StringHolder theDefaultLightsPrimPath;
120  static UT_StringHolder theDefaultCamerasPrimPath;
121  static UT_StringHolder theDefaultTransformSuffix;
122  static bool theShowResolvedPaths;
123  static bool thePanesFollowCurrentNode;
124  static bool thePanesShowViewportStage;
125  static bool thePanesShowPostLayers;
126  static bool theAutoSetAssetResolverContext;
127  static bool theUpdateRendererInBackground;
128  static bool theLoadPayloadsByDefault;
129  static double theDefaultMetersPerUnit;
130  static UT_StringHolder theDefaultUpAxis;
131  static bool theAllowViewportOnlyPayloads;
132  static bool thePathParameterCompletion;
133  static UT_Map<int, PrefChangeCallback> thePrefChangeCallbacks;
134  static int thePrefChangeCallbackId;
135 };
136 
137 #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