HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HUSD_EditReferences.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_EditReferences_h__
19 #define __HUSD_EditReferences_h__
20 
21 #include "HUSD_API.h"
22 #include "HUSD_DataHandle.h"
23 #include "HUSD_LayerOffset.h"
24 #include <GU/GU_DetailHandle.h>
25 #include <UT/UT_StringHolder.h>
26 #include <UT/UT_StringMap.h>
27 
29 {
30 public:
33 
34  // Setting the primitive type for any parent primitives that need to be
35  // created when creating the reference primitive.
36  void setParentPrimType(const UT_StringHolder &primtype)
37  { myParentPrimType = primtype; }
39  { return myParentPrimType; }
40  // Specify the primitive kind value to be set on the primitive if we
41  // have to create it.
42  void setPrimKind(const UT_StringHolder &kind)
43  { myPrimKind = kind; }
44  const UT_StringHolder &primKind() const
45  { return myPrimKind; }
46  // Specify the reference type to use (refeernce, specialize, inherit).
47  void setRefType(const UT_StringHolder &reftype)
48  { myRefType = reftype; }
49  const UT_StringHolder &refType() const
50  { return myRefType; }
51  // Specify the way to edit the reference list (append, prepend, etc).
52  void setRefEditOp(const UT_StringHolder &refeditop)
53  { myRefEditOp = refeditop; }
54  const UT_StringHolder &refEditOp() const
55  { return myRefEditOp; }
56 
57  bool addReference(const UT_StringRef &primpath,
58  const UT_StringRef &reffilepath,
59  const UT_StringRef &refprimpath,
60  const HUSD_LayerOffset &offset =
62  const UT_StringMap<UT_StringHolder> &refargs =
64  const GU_DetailHandle &gdh =
65  GU_DetailHandle()) const;
66  bool addReference(const HUSD_FindPrims &findprims,
67  const UT_StringRef &reffilepath,
68  const UT_StringRef &refprimpath,
69  const HUSD_LayerOffset &offset =
71  const UT_StringMap<UT_StringHolder> &refargs =
73  const GU_DetailHandle &gdh =
74  GU_DetailHandle()) const;
75  bool removeReference(const UT_StringRef &primpath,
76  const UT_StringRef &reffilepath,
77  const UT_StringRef &refprimpath,
78  const HUSD_LayerOffset &offset =
80  const UT_StringMap<UT_StringHolder> &refargs =
82  bool define_parent_prims = false) const;
83  bool removeReference(const HUSD_FindPrims &findprims,
84  const UT_StringRef &reffilepath,
85  const UT_StringRef &refprimpath,
86  const HUSD_LayerOffset &offset =
88  const UT_StringMap<UT_StringHolder> &refargs =
90  bool define_parent_prims = false) const;
91  bool clearLayerReferenceEdits(const UT_StringRef &primpath,
92  bool define_parent_prims = false);
93  bool clearLayerReferenceEdits(
94  const HUSD_FindPrims &findprims,
95  bool define_parent_prims = false);
96  bool clearReferences(const UT_StringRef &primpath,
97  bool define_parent_prims = false);
98  bool clearReferences(
99  const HUSD_FindPrims &findprims,
100  bool define_parent_prims = false);
101 
102 private:
103  HUSD_AutoWriteLock &myWriteLock;
104  UT_StringHolder myPrimKind;
105  UT_StringHolder myRefType;
106  UT_StringHolder myRefEditOp;
107  UT_StringHolder myParentPrimType;
108 };
109 
110 #endif
111 
void setRefEditOp(const UT_StringHolder &refeditop)
#define HUSD_API
Definition: HUSD_API.h:32
void setPrimKind(const UT_StringHolder &kind)
GLintptr offset
Definition: glcorearb.h:665
const UT_StringHolder & primKind() const
const UT_StringHolder & refEditOp() const
const UT_StringHolder & parentPrimType() const
void setRefType(const UT_StringHolder &reftype)
void setParentPrimType(const UT_StringHolder &primtype)
const UT_StringHolder & refType() const