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.
44  void setAddLayerPosition(int position)
45  { myAddLayerPosition = position; }
46  int addLayerPosition() const
47  { return myAddLayerPosition; }
48 
49  bool removeLayer(const UT_StringRef &filepath) const;
50  bool addLayer(const UT_StringRef &filepath,
51  const HUSD_LayerOffset &offset =
53  const UT_StringMap<UT_StringHolder> &refargs =
55  const GU_DetailHandle &gdh =
56  GU_DetailHandle()) const;
57  bool addLayerForEdit(const UT_StringRef &filepath,
58  const UT_StringMap<UT_StringHolder> &refargs =
60  const GU_DetailHandle &gdh =
61  GU_DetailHandle()) const;
62  bool addLayerFromSource(const UT_StringRef &usdsource,
63  bool allow_editing) const;
64  bool addLayer() const;
65  bool applyLayerBreak() const;
66 
67 private:
68  HUSD_AutoWriteLock &myWriteLock;
69  int myAddLayerPosition;
70  bool myEditRootLayer;
71 };
72 
73 #endif
74 
void setEditRootLayer(bool edit_root_layer)
#define HUSD_API
Definition: HUSD_API.h:32
void setAddLayerPosition(int position)
bool editRootLayer() const
int addLayerPosition() const
GLintptr offset
Definition: glew.h:1682