HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
targetIndex.h
Go to the documentation of this file.
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_TARGET_INDEX_H
25 #define PXR_USD_PCP_TARGET_INDEX_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/usd/pcp/api.h"
29 #include "pxr/usd/pcp/errors.h"
31 #include "pxr/usd/sdf/path.h"
32 
34 
36 class PcpCache;
37 class PcpPropertyIndex;
38 
39 /// \class PcpTargetIndex
40 ///
41 /// A PcpTargetIndex represents the results of indexing the target
42 /// paths of a relationship or attribute. Note that this is just
43 /// the result; it does not retain all of the input arguments used
44 /// in computing the index, such as the owning property.
45 ///
49  bool hasTargetOpinions = false;
50 };
51 
52 /// Build a PcpTargetIndex representing the target paths of the given
53 /// property.
54 ///
55 /// \p propIndex is a PcpPropertyIndex of the relationship or attribute.
56 /// \p relOrAttrType indicates if the property is a relationship
57 /// or attribute.
58 /// \p allErrors will contain any errors encountered while
59 /// performing this operation.
60 ///
61 /// Note that this function will skip the validation checks performed
62 /// by PcpBuildFilteredTargetIndex. See documentation below for details.
63 PCP_API
64 void
66  const PcpSite& propSite,
67  const PcpPropertyIndex& propIndex,
68  const SdfSpecType relOrAttrType,
69  PcpTargetIndex *targetIndex,
70  PcpErrorVector *allErrors);
71 
72 /// Like PcpBuildTargetIndex, but optionally filters the result by
73 /// enforcing permissions restrictions and a stopProperty.
74 ///
75 /// If \p localOnly is \c true then this will compose relationship
76 /// targets from local nodes only. If \p stopProperty is not \c
77 /// NULL then this will stop composing relationship targets at \p
78 /// stopProperty, including \p stopProperty iff \p includeStopProperty
79 /// is \c true.
80 ///
81 /// \p cacheForValidation is a PcpCache that will be used to compute
82 /// additional prim indexes as needed for validation. NULL may be
83 /// passed in, but doing so will disable validation that relies on
84 /// this cache, which includes permissions checks.
85 ///
86 /// \p deletedPaths, if not \c NULL, will be populated with target
87 /// paths whose deletion contributed to the computed value of
88 /// \c targetIndex->paths.
89 ///
90 /// \p allErrors will contain any errors encountered while
91 /// performing this operation.
92 PCP_API
93 void
95  const PcpSite& propSite,
96  const PcpPropertyIndex& propIndex,
97  const SdfSpecType relOrAttrType,
98  const bool localOnly,
99  const SdfSpecHandle &stopProperty,
100  const bool includeStopProperty,
101  PcpCache *cacheForValidation,
102  PcpTargetIndex *targetIndex,
103  SdfPathVector *deletedPaths,
104  PcpErrorVector *allErrors);
105 
107 
108 #endif // PXR_USD_PCP_TARGET_INDEX_H
Definition: cache.h:93
Definition: spec.h:49
Definition: site.h:45
SdfPathVector paths
Definition: targetIndex.h:47
PcpErrorVector localErrors
Definition: targetIndex.h:48
std::vector< class SdfPath > SdfPathVector
A vector of SdfPaths.
Definition: path.h:211
std::vector< PcpErrorBasePtr > PcpErrorVector
Definition: errors.h:78
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
SdfSpecType
Definition: types.h:85
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
PCP_API void PcpBuildTargetIndex(const PcpSite &propSite, const PcpPropertyIndex &propIndex, const SdfSpecType relOrAttrType, PcpTargetIndex *targetIndex, PcpErrorVector *allErrors)
PXR_NAMESPACE_OPEN_SCOPE SDF_DECLARE_HANDLES(SdfSpec)
PCP_API void PcpBuildFilteredTargetIndex(const PcpSite &propSite, const PcpPropertyIndex &propIndex, const SdfSpecType relOrAttrType, const bool localOnly, const SdfSpecHandle &stopProperty, const bool includeStopProperty, PcpCache *cacheForValidation, PcpTargetIndex *targetIndex, SdfPathVector *deletedPaths, PcpErrorVector *allErrors)
#define PCP_API
Definition: api.h:40
bool hasTargetOpinions
Definition: targetIndex.h:49