All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
site.h
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef PXR_USD_PCP_SITE_H
25 #define PXR_USD_PCP_SITE_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/usd/pcp/api.h"
30 #include "pxr/usd/sdf/path.h"
31 #include "pxr/usd/sdf/types.h"
33 
34 #include <boost/operators.hpp>
35 #include <iosfwd>
36 
37 PXR_NAMESPACE_OPEN_SCOPE
38 
40 class PcpLayerStackSite;
41 
46 class PcpSite : boost::totally_ordered<PcpSite>
47 {
48 public:
49  PcpLayerStackIdentifier layerStackIdentifier;
50  SdfPath path;
51 
52  PCP_API
53  PcpSite();
54 
55  PCP_API
56  PcpSite( const PcpLayerStackIdentifier &, const SdfPath & path );
57  PCP_API
58  PcpSite( const PcpLayerStackPtr &, const SdfPath & path );
59  PCP_API
60  PcpSite( const SdfLayerHandle &, const SdfPath & path );
61  PCP_API
62  explicit PcpSite( const PcpLayerStackSite & );
63 
64  PCP_API
65  bool operator==(const PcpSite &rhs) const;
66 
67  PCP_API
68  bool operator<(const PcpSite &rhs) const;
69 
70  struct Hash {
71  PCP_API
72  size_t operator()(const PcpSite &) const;
73  };
74 };
75 
81 class PcpSiteStr : boost::totally_ordered<PcpSiteStr>
82 {
83 public:
84  PcpLayerStackIdentifierStr layerStackIdentifierStr;
85  SdfPath path;
86 
87  PCP_API
88  PcpSiteStr();
89 
90  PCP_API
91  PcpSiteStr( const PcpLayerStackIdentifierStr &, const SdfPath & path );
92  PCP_API
93  PcpSiteStr( const PcpLayerStackIdentifier &, const SdfPath & path );
94  PCP_API
95  PcpSiteStr( const SdfLayerHandle &, const SdfPath & path );
96  PCP_API
97  PcpSiteStr(PcpLayerStackSite const &);
98  PCP_API
99  PcpSiteStr(PcpSite const &);
100 
101  PCP_API
102  bool operator==(const PcpSiteStr &rhs) const;
103 
104  PCP_API
105  bool operator<(const PcpSiteStr &rhs) const;
106 
107  struct Hash {
108  PCP_API
109  size_t operator()(const PcpSiteStr &) const;
110  };
111 };
112 
117 class PcpLayerStackSite : boost::totally_ordered<PcpLayerStackSite>
118 {
119 public:
120  PcpLayerStackRefPtr layerStack;
121  SdfPath path;
122 
123  PCP_API
125 
126  PCP_API
127  PcpLayerStackSite( const PcpLayerStackRefPtr &, const SdfPath & path );
128 
129  PCP_API
130  bool operator==(const PcpLayerStackSite &rhs) const;
131 
132  PCP_API
133  bool operator<(const PcpLayerStackSite &rhs) const;
134 
135  struct Hash {
136  PCP_API
137  size_t operator()(const PcpLayerStackSite &) const;
138  };
139 };
140 
141 PCP_API
142 std::ostream& operator<<(std::ostream&, const PcpSite&);
143 PCP_API
144 std::ostream& operator<<(std::ostream&, const PcpSiteStr&);
145 PCP_API
146 std::ostream& operator<<(std::ostream&, const PcpLayerStackSite&);
147 
148 static inline
149 size_t
150 hash_value(const PcpSite& site)
151 {
152  return PcpSite::Hash()(site);
153 }
154 
155 static inline
156 size_t
157 hash_value(const PcpSiteStr& site)
158 {
159  return PcpSiteStr::Hash()(site);
160 }
161 
162 static inline
163 size_t
164 hash_value(const PcpLayerStackSite& site)
165 {
166  return PcpLayerStackSite::Hash()(site);
167 }
168 
169 PXR_NAMESPACE_CLOSE_SCOPE
170 
171 #endif // PXR_USD_PCP_SITE_H
A site specifies a path in a layer stack of scene description.
Definition: site.h:117
Standard pointer typedefs.
Represents a stack of layers that contribute opinions to composition.
Definition: layerStack.h:65
A site specifies a path in a layer stack of scene description.
Definition: site.h:46
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:89
Basic Sdf data types.
A &quot;string-based&quot; version of PcpSite.
Definition: site.h:81
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:288
A &quot;string&quot;-based version of PcpLayerStackIdentifier.
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
Arguments used to identify a layer stack.