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 primitive kind value to be set on the primitive if we
47  // have to create it.
48  void setRefType(const UT_StringHolder &reftype)
49  { myRefType = reftype; }
50  const UT_StringHolder &refType() const
51  { return myRefType; }
52  // Specify the primitive kind value to be set on the primitive if we
53  // have to create it.
54  void setRefEditOp(const UT_StringHolder &refeditop)
55  { myRefEditOp = refeditop; }
56  const UT_StringHolder &refEditOp() const
57  { return myRefEditOp; }
58 
59  bool addReference(const UT_StringRef &primpath,
60  const UT_StringRef &reffilepath,
61  const UT_StringRef &refprimpath,
62  const HUSD_LayerOffset &offset =
64  const UT_StringMap<UT_StringHolder> &refargs =
66  const GU_DetailHandle &gdh =
67  GU_DetailHandle()) const;
68  bool removeReference(const UT_StringRef &primpath,
69  const UT_StringRef &reffilepath,
70  const UT_StringRef &refprimpath,
71  const HUSD_LayerOffset &offset =
73  const UT_StringMap<UT_StringHolder> &refargs =
75  bool define_parent_prims = false) const;
76  bool clearLayerReferenceEdits(const UT_StringRef &primpath,
77  bool define_parent_prims = false);
78  bool clearReferences(const UT_StringRef &primpath,
79  bool define_parent_prims = false);
80 
81 private:
82  HUSD_AutoWriteLock &myWriteLock;
83  UT_StringHolder myPrimKind;
84  UT_StringHolder myRefType;
85  UT_StringHolder myRefEditOp;
86  UT_StringHolder myParentPrimType;
87 };
88 
89 #endif
90 
void setRefEditOp(const UT_StringHolder &refeditop)
#define HUSD_API
Definition: HUSD_API.h:32
void setPrimKind(const UT_StringHolder &kind)
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)
GLintptr offset
Definition: glew.h:1682
const UT_StringHolder & refType() const