HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HUSD_Overrides.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_Overrides_h__
19 #define __HUSD_Overrides_h__
20 
21 #include "HUSD_API.h"
22 #include "HUSD_DataHandle.h"
23 #include "HUSD_Utils.h"
24 #include <UT/UT_IntrusivePtr.h>
25 #include <UT/UT_IStream.h>
26 #include <UT/UT_UniquePtr.h>
27 #include <pxr/pxr.h>
28 #include <iosfwd>
29 #include <vector>
30 
32 
33 class XUSD_Data;
34 class XUSD_OverridesData;
35 
37 
38 class HUSD_TimeCode;
39 
40 class HUSD_API HUSD_Overrides : public UT_IntrusiveRefCounter<HUSD_Overrides>,
41  public UT_NonCopyable
42 {
43 public:
45  ~HUSD_Overrides();
46 
47  void save(std::ostream &os) const;
48  bool load(UT_IStream &is);
49  void copy(const HUSD_Overrides &src);
50  bool isEmpty() const;
51  bool isEmpty(HUSD_OverridesLayerId layer_id) const;
52 
53  void clear(const UT_StringRef &fromprim =
55  void clear(HUSD_OverridesLayerId layer_id,
56  const UT_StringRef &fromprim =
58 
59  bool setDrawMode(
61  const HUSD_FindPrims &prims,
62  const UT_StringRef &drawmode);
63  bool setActive(
65  const HUSD_FindPrims &prims,
66  bool active);
67  bool setVisible(
69  const HUSD_FindPrims &prims,
70  const HUSD_TimeCode &timecode,
71  bool visible);
72 
73  bool setSoloLights(
75  const HUSD_FindPrims &prims);
76  bool addSoloLights(
78  const HUSD_FindPrims &prims);
79  bool removeSoloLights(
81  const HUSD_FindPrims &prims);
82  bool getSoloLights(
83  std::vector<std::string> &prims) const;
84  bool setSoloGeometry(
86  const HUSD_FindPrims &prims);
87  bool addSoloGeometry(
89  const HUSD_FindPrims &prims);
90  bool removeSoloGeometry(
92  const HUSD_FindPrims &prims);
93  bool getSoloGeometry(
94  std::vector<std::string> &prims) const;
95  bool setDisplayOpacity(
97  const HUSD_FindPrims &prims,
98  const HUSD_TimeCode &timecode,
99  fpreal opacity);
100 
101  // Indicate that this override's data is being authored on a stage.
102  // We should only be locked to one XUSD_Data at a time, and we
103  // should always have a single unlock paired with each lock. The
104  // XUSD_Data pointer is passed to the unlock function only to
105  // verify this condition. When locked to an XUSD_Data, all requests
106  // to edit the owner overrides are applied to the stage's session
107  // layers directly. When unlocking, the stage's session layers are
108  // copied back into the layers stored in the myLayer array.
109  void lockToData(PXR_NS::XUSD_Data *data);
110  void unlockFromData(PXR_NS::XUSD_Data *data);
111 
112  PXR_NS::XUSD_OverridesData &data() const
113  { return *myData; }
114  exint versionId() const
115  { return myVersionId; }
116 
117 private:
119  exint myVersionId;
120 };
121 
122 #endif
123 
exint versionId() const
GLenum src
Definition: glew.h:2410
#define HUSD_API
Definition: HUSD_API.h:32
PXR_NS::XUSD_OverridesData & data() const
A reference counter base class for use with UT_IntrusivePtr.
HUSD_OverridesLayerId
Definition: HUSD_Utils.h:58
int64 exint
Definition: SYS_Types.h:120
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
static const UT_StringHolder theEmptyString
double fpreal
Definition: SYS_Types.h:276
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1245
OIIO_API bool copy(string_view from, string_view to, std::string &err)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:83