HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HUSD_EditLayers.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_EditLayers_h__
19 #define __HUSD_EditLayers_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:
32  ~HUSD_EditLayers();
33 
34  // Controls whether this object should edit the layers on the root layer
35  // of the stage, or edit the sublayers on the active layer.
36  void setEditRootLayer(bool edit_root_layer)
37  { myEditRootLayer = edit_root_layer; }
38  bool editRootLayer() const
39  { return myEditRootLayer; }
40 
41  // Controls the position where new layers should be added. A value of
42  // zero indicates the strongest layer position, and -1 indicates the
43  // weakest layer position.
45  { myAddLayerPosition = position; }
46  int addLayerPosition() const
47  { return myAddLayerPosition; }
48 
49  // Determines if the stage root layer's root prim metadata should be copied
50  // from the first new sublayer in an addLayers call.
51  void setCopyRootPrimMetadataToStage(bool copymetadata)
52  { myCopyRootPrimMetadataToStage = copymetadata; }
54  { return myCopyRootPrimMetadataToStage; }
55 
56  bool removeLayers(const UT_StringArray &filepaths) const;
57  bool addLayers(const UT_StringArray &filepaths,
61  const UT_Array<GU_DetailHandle>&gdhs =
63  bool addLayer(const UT_StringRef &filepath,
64  const HUSD_LayerOffset &offset =
66  const UT_StringMap<UT_StringHolder> &refargs =
68  const GU_DetailHandle &gdh =
69  GU_DetailHandle()) const;
70  bool addLayerForEdit(const UT_StringRef &filepath,
71  const UT_StringMap<UT_StringHolder> &refargs =
73  const GU_DetailHandle &gdh =
74  GU_DetailHandle()) const;
75  bool addLayerFromSource(const UT_StringRef &usdsource,
76  bool allow_editing) const;
77  bool addLayer() const;
78  bool applyLayerBreak() const;
79 
80 private:
81  HUSD_AutoWriteLock &myWriteLock;
82  int myAddLayerPosition;
83  bool myEditRootLayer;
84  bool myCopyRootPrimMetadataToStage;
85 };
86 
87 #endif
88 
void setEditRootLayer(bool edit_root_layer)
void setCopyRootPrimMetadataToStage(bool copymetadata)
#define HUSD_API
Definition: HUSD_API.h:32
void setAddLayerPosition(int position)
GLuint GLsizei const GLuint const GLintptr * offsets
Definition: glcorearb.h:2621
GLintptr offset
Definition: glcorearb.h:665
bool editRootLayer() const
int addLayerPosition() const
SIM_API const UT_StringHolder position
bool copyRootPrimMetadataToStage() const