Loading...
Searching...
No Matches
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 <iosfwd>
35
36PXR_NAMESPACE_OPEN_SCOPE
37
40
46{
47public:
48 PcpLayerStackIdentifier layerStackIdentifier;
49 SdfPath path;
50
51 PCP_API
52 PcpSite();
53
54 PCP_API
55 PcpSite( const PcpLayerStackIdentifier &, const SdfPath & path );
56 PCP_API
57 PcpSite( const PcpLayerStackPtr &, const SdfPath & path );
58 PCP_API
59 PcpSite( const SdfLayerHandle &, const SdfPath & path );
60 PCP_API
61 PcpSite( const PcpLayerStackSite & );
62
63 PCP_API
64 bool operator==(const PcpSite &rhs) const;
65
66 bool operator!=(const PcpSite &rhs) const {
67 return !(*this == rhs);
68 }
69
70 PCP_API
71 bool operator<(const PcpSite &rhs) const;
72
73 bool operator<=(const PcpSite &rhs) const {
74 return !(rhs < *this);
75 }
76
77 bool operator>(const PcpSite &rhs) const {
78 return rhs < *this;
79 }
80
81 bool operator>=(const PcpSite &rhs) const {
82 return !(*this < rhs);
83 }
84
85 struct Hash {
86 PCP_API
87 size_t operator()(const PcpSite &) const;
88 };
89};
90
96{
97public:
98 PcpLayerStackRefPtr layerStack;
99 SdfPath path;
100
101 PCP_API
103
104 PCP_API
105 PcpLayerStackSite( const PcpLayerStackRefPtr &, const SdfPath & path );
106
107 PCP_API
108 bool operator==(const PcpLayerStackSite &rhs) const;
109
110 bool operator!=(const PcpLayerStackSite &rhs) const {
111 return !(*this == rhs);
112 }
113
114 PCP_API
115 bool operator<(const PcpLayerStackSite &rhs) const;
116
117 bool operator<=(const PcpLayerStackSite &rhs) const {
118 return !(rhs < *this);
119 }
120
121 bool operator>(const PcpLayerStackSite &rhs) const {
122 return rhs < *this;
123 }
124
125 bool operator>=(const PcpLayerStackSite &rhs) const {
126 return !(*this < rhs);
127 }
128
129
130 struct Hash {
131 PCP_API
132 size_t operator()(const PcpLayerStackSite &) const;
133 };
134};
135
136PCP_API
137std::ostream& operator<<(std::ostream&, const PcpSite&);
138PCP_API
139std::ostream& operator<<(std::ostream&, const PcpLayerStackSite&);
140
141static inline
142size_t
143hash_value(const PcpSite& site)
144{
145 return PcpSite::Hash()(site);
146}
147
148static inline
149size_t
150hash_value(const PcpLayerStackSite& site)
151{
152 return PcpLayerStackSite::Hash()(site);
153}
154
155PXR_NAMESPACE_CLOSE_SCOPE
156
157#endif // PXR_USD_PCP_SITE_H
Represents a stack of layers that contribute opinions to composition.
Definition: layerStack.h:67
Arguments used to identify a layer stack.
A site specifies a path in a layer stack of scene description.
Definition: site.h:96
A site specifies a path in a layer stack of scene description.
Definition: site.h:46
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:291
Standard pointer typedefs.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:89
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
size_t hash_value(const half h)
Overload hash_value for half.
Definition: half.h:45
Basic Sdf data types.