HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HUSD_EditCustomData.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_EditCustomData_h__
19 #define __HUSD_EditCustomData_h__
20 
21 #include "HUSD_API.h"
22 #include "HUSD_DataHandle.h"
23 #include "HUSD_TimeCode.h"
24 #include <UT/UT_StringHolder.h>
25 
26 class HUSD_FindPrims;
27 class HUSD_FindProps;
28 
30 {
31 public:
34 
35  // This flag controls whether all future calls to this object should
36  // just affect the active layer, or should also be applied to the stage
37  // root layer.
38  void setModifyRootLayer(bool modifyrootlayer);
39 
40  // These functions set the actual custom data on the layer, prim, or
41  // property. The UtValueType parameters can be any of:
42  // bool
43  // int
44  // int64
45  // UT_Vector2i
46  // UT_Vector3i
47  // UT_Vector4i
48  // fpreal32
49  // fpreal64
50  // UT_Vector2F
51  // UT_Vector3F
52  // UT_Vector4F
53  // UT_QuaternionF
54  // UT_QuaternionH
55  // UT_Matrix3D
56  // UT_Matrix4D
57  // UT_StringHolder
58  // UT_Array<UT_StringHolder>
59  // HUSD_AssetPath
60  // UT_Array<HUSD_AssetPath>
61  // HUSD_Token
62  // UT_Array<HUSD_Token>
63  // Make sure to explicitly cast to one of these data types, even if
64  // implicit conversions exist.
65  template<typename UtValueType>
66  bool setLayerCustomData(const UT_StringRef &key,
67  const UtValueType &value) const;
68  template<typename UtValueType>
69  bool setCustomData(const HUSD_FindPrims &findprims,
70  const UT_StringRef &key,
71  const UtValueType &value) const;
72  template<typename UtValueType>
73  bool setCustomData(const HUSD_FindProps &findprops,
74  const UT_StringRef &key,
75  const UtValueType &value) const;
76 
77  bool setIconCustomData(const HUSD_FindPrims &findprims,
78  const UT_StringHolder &icon);
79  bool setIconCustomData(const HUSD_FindProps &findprops,
80  const UT_StringHolder &icon);
81 
82  bool removeLayerCustomData(const UT_StringRef &key) const;
83  bool removeCustomData(const HUSD_FindPrims &findprims,
84  const UT_StringRef &key) const;
85  bool removeCustomData(const HUSD_FindProps &findprops,
86  const UT_StringRef &key) const;
87 
88  bool clearLayerCustomData() const;
89  bool clearCustomData(const HUSD_FindPrims &findprims) const;
90  bool clearCustomData(const HUSD_FindProps &findprops) const;
91 
92 private:
93  HUSD_AutoWriteLock &myWriteLock;
94  bool myModifyRootLayer;
95 };
96 
97 #endif
98 
#define HUSD_API
Definition: HUSD_API.h:32
Definition: core.h:1131