All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
errors.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 PCP_ERRORS_H
25 #define PCP_ERRORS_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/usd/pcp/api.h"
29 #include "pxr/usd/pcp/site.h"
30 #include "pxr/usd/pcp/types.h"
31 #include "pxr/usd/sdf/layer.h"
32 #include "pxr/usd/sdf/layerOffset.h"
33 #include "pxr/usd/sdf/path.h"
34 
35 #include "pxr/base/tf/enum.h"
36 
37 #include <memory>
38 #include <string>
39 #include <vector>
40 
41 PXR_NAMESPACE_OPEN_SCOPE
42 
43 // Forward declaration:
44 class PcpCache;
45 
50 enum PcpErrorType {
51  PcpErrorType_ArcCycle,
52  PcpErrorType_ArcPermissionDenied,
53  PcpErrorType_InconsistentPropertyType,
54  PcpErrorType_InconsistentAttributeType,
55  PcpErrorType_InconsistentAttributeVariability,
56  PcpErrorType_InternalAssetPath,
57  PcpErrorType_InvalidPrimPath,
58  PcpErrorType_InvalidAssetPath,
59  PcpErrorType_InvalidInstanceTargetPath,
60  PcpErrorType_InvalidExternalTargetPath,
61  PcpErrorType_InvalidTargetPath,
62  PcpErrorType_InvalidReferenceOffset,
63  PcpErrorType_InvalidSublayerOffset,
64  PcpErrorType_InvalidSublayerOwnership,
65  PcpErrorType_InvalidSublayerPath,
66  PcpErrorType_InvalidVariantSelection,
67  PcpErrorType_MutedAssetPath,
68  PcpErrorType_OpinionAtRelocationSource,
69  PcpErrorType_PrimPermissionDenied,
70  PcpErrorType_PropertyPermissionDenied,
71  PcpErrorType_SublayerCycle,
72  PcpErrorType_TargetPermissionDenied,
73  PcpErrorType_UnresolvedPrimPath
74 };
75 
76 // Forward declarations:
77 class PcpErrorBase;
78 typedef std::shared_ptr<PcpErrorBase> PcpErrorBasePtr;
79 typedef std::vector<PcpErrorBasePtr> PcpErrorVector;
80 
85 class PcpErrorBase {
86 public:
88  PCP_API virtual ~PcpErrorBase();
90  virtual std::string ToString() const = 0;
91 
94 
100 
101 protected:
104 };
105 
107 
108 // Forward declarations:
109 class PcpErrorArcCycle;
110 typedef std::shared_ptr<PcpErrorArcCycle> PcpErrorArcCyclePtr;
111 
117 public:
119  static PcpErrorArcCyclePtr New();
121  PCP_API ~PcpErrorArcCycle();
123  PCP_API virtual std::string ToString() const;
124 
125  PcpSiteTracker cycle;
126 
127 private:
130 };
131 
133 
134 // Forward declarations:
136 typedef std::shared_ptr<PcpErrorArcPermissionDenied>
137  PcpErrorArcPermissionDeniedPtr;
138 
145 public:
147  static PcpErrorArcPermissionDeniedPtr New();
151  PCP_API virtual std::string ToString() const;
152 
159 
160 private:
163 };
164 
166 
167 class PcpErrorInconsistentPropertyBase : public PcpErrorBase {
168 public:
170  PCP_API virtual ~PcpErrorInconsistentPropertyBase();
171 
173  std::string definingLayerIdentifier;
175  SdfPath definingSpecPath;
176 
178  std::string conflictingLayerIdentifier;
180  SdfPath conflictingSpecPath;
181 
182 protected:
184  PcpErrorInconsistentPropertyBase(TfEnum errorType);
185 };
186 
188 
189 // Forward declarations:
191 typedef std::shared_ptr<PcpErrorInconsistentPropertyType>
192  PcpErrorInconsistentPropertyTypePtr;
193 
199  public PcpErrorInconsistentPropertyBase {
200 public:
202  static PcpErrorInconsistentPropertyTypePtr New();
206  PCP_API virtual std::string ToString() const;
207 
212 
213 private:
216 };
217 
219 
220 // Forward declarations:
222 typedef std::shared_ptr<PcpErrorInconsistentAttributeType>
223  PcpErrorInconsistentAttributeTypePtr;
224 
230  public PcpErrorInconsistentPropertyBase {
231 public:
233  static PcpErrorInconsistentAttributeTypePtr New();
237  PCP_API virtual std::string ToString() const;
238 
243 
244 private:
247 };
248 
250 
251 // Forward declarations:
253 typedef std::shared_ptr<PcpErrorInconsistentAttributeVariability>
254  PcpErrorInconsistentAttributeVariabilityPtr;
255 
261  public PcpErrorInconsistentPropertyBase {
262 public:
264  static PcpErrorInconsistentAttributeVariabilityPtr New();
268  PCP_API virtual std::string ToString() const;
269 
274 
275 private:
278 };
279 
281 
282 // Forward declarations:
284 typedef std::shared_ptr<PcpErrorInternalAssetPath>
285  PcpErrorInternalAssetPathPtr;
286 
292 public:
294  static PcpErrorInternalAssetPathPtr New();
296  PCP_API ~PcpErrorInternalAssetPath();
298  PCP_API virtual std::string ToString() const;
299 
302  SdfPath targetPath;
303  std::string assetPath;
304  std::string resolvedAssetPath;
305  PcpArcType arcType;
306 
307 private:
310 };
311 
313 
314 // Forward declarations:
316 typedef std::shared_ptr<PcpErrorInvalidPrimPath>
317  PcpErrorInvalidPrimPathPtr;
318 
324 public:
326  static PcpErrorInvalidPrimPathPtr New();
328  PCP_API ~PcpErrorInvalidPrimPath();
330  PCP_API virtual std::string ToString() const;
331 
334  SdfPath primPath;
335  PcpArcType arcType;
336 
337 private:
340 };
341 
343 
344 // Forward declarations:
345 class PcpErrorInvalidAssetPathBase;
346 typedef std::shared_ptr<PcpErrorInvalidAssetPathBase>
347  PcpErrorInvalidAssetPathBasePtr;
348 
349 class PcpErrorInvalidAssetPathBase : public PcpErrorBase {
350 public:
352  PCP_API ~PcpErrorInvalidAssetPathBase();
353 
355  PcpSite site;
356  SdfPath targetPath;
357  std::string assetPath;
358  std::string resolvedAssetPath;
359  PcpArcType arcType;
360  SdfLayerHandle layer;
361  std::string messages;
362 
363 protected:
365  PcpErrorInvalidAssetPathBase(TfEnum errorType);
366 };
367 
369 
370 // Forward declarations:
372 typedef std::shared_ptr<PcpErrorInvalidAssetPath>
373  PcpErrorInvalidAssetPathPtr;
374 
379 class PcpErrorInvalidAssetPath : public PcpErrorInvalidAssetPathBase {
380 public:
382  static PcpErrorInvalidAssetPathPtr New();
384  PCP_API ~PcpErrorInvalidAssetPath();
386  PCP_API virtual std::string ToString() const;
387 
388 private:
391 };
392 
394 
395 // Forward declarations:
397 typedef std::shared_ptr<PcpErrorMutedAssetPath>
398  PcpErrorMutedAssetPathPtr;
399 
404 class PcpErrorMutedAssetPath : public PcpErrorInvalidAssetPathBase {
405 public:
407  static PcpErrorMutedAssetPathPtr New();
409  PCP_API ~PcpErrorMutedAssetPath();
411  PCP_API virtual std::string ToString() const;
412 
413 private:
416 };
417 
419 
420 // Forward declarations:
422 typedef std::shared_ptr<PcpErrorTargetPathBase>
423  PcpErrorTargetPathBasePtr;
424 
430 public:
432  PCP_API ~PcpErrorTargetPathBase();
433 
441  SdfLayerHandle layer;
442 
448 
449 protected:
451 };
452 
454 
455 // Forward declarations:
457 typedef std::shared_ptr<PcpErrorInvalidInstanceTargetPath>
458  PcpErrorInvalidInstanceTargetPathPtr;
459 
466 public:
468  static PcpErrorInvalidInstanceTargetPathPtr New();
472  PCP_API virtual std::string ToString() const;
473 
474 private:
477 };
478 
480 
481 // Forward declarations:
483 typedef std::shared_ptr<PcpErrorInvalidExternalTargetPath>
484  PcpErrorInvalidExternalTargetPathPtr;
485 
492 public:
494  static PcpErrorInvalidExternalTargetPathPtr New();
498  PCP_API virtual std::string ToString() const;
499 
500  PcpArcType ownerArcType;
501  SdfPath ownerIntroPath;
502 
503 private:
506 };
507 
509 
510 // Forward declarations:
512 typedef std::shared_ptr<PcpErrorInvalidTargetPath>
513  PcpErrorInvalidTargetPathPtr;
514 
520 public:
522  static PcpErrorInvalidTargetPathPtr New();
524  PCP_API ~PcpErrorInvalidTargetPath();
526  PCP_API virtual std::string ToString() const;
527 
528 private:
531 };
532 
534 
535 // Forward declarations:
537 typedef std::shared_ptr<PcpErrorInvalidSublayerOffset>
538  PcpErrorInvalidSublayerOffsetPtr;
539 
545 public:
547  static PcpErrorInvalidSublayerOffsetPtr New();
551  PCP_API virtual std::string ToString() const;
552 
553  SdfLayerHandle layer;
554  SdfLayerHandle sublayer;
555  SdfLayerOffset offset;
556 
557 private:
560 };
561 
563 
564 // Forward declarations:
566 typedef std::shared_ptr<PcpErrorInvalidReferenceOffset>
567  PcpErrorInvalidReferenceOffsetPtr;
568 
574 public:
576  static PcpErrorInvalidReferenceOffsetPtr New();
580  PCP_API virtual std::string ToString() const;
581 
582  SdfLayerHandle layer;
583  SdfPath sourcePath;
584  std::string assetPath;
585  SdfPath targetPath;
586  SdfLayerOffset offset;
587 
588 private:
591 };
592 
594 
595 // Forward declarations:
597 typedef std::shared_ptr<PcpErrorInvalidSublayerOwnership>
598  PcpErrorInvalidSublayerOwnershipPtr;
599 
605 public:
607  static PcpErrorInvalidSublayerOwnershipPtr New();
611  PCP_API virtual std::string ToString() const;
612 
613  std::string owner;
614  SdfLayerHandle layer;
615  SdfLayerHandleVector sublayers;
616 
617 private:
620 };
621 
623 
624 // Forward declarations:
626 typedef std::shared_ptr<PcpErrorInvalidSublayerPath>
627  PcpErrorInvalidSublayerPathPtr;
628 
634 public:
636  static PcpErrorInvalidSublayerPathPtr New();
640  PCP_API virtual std::string ToString() const;
641 
642  SdfLayerHandle layer;
643  std::string sublayerPath;
644  std::string messages;
645 
646 private:
649 };
650 
652 
653 // Forward declarations:
655 typedef std::shared_ptr<PcpErrorInvalidVariantSelection>
656  PcpErrorInvalidVariantSelectionPtr;
657 
663 public:
665  static PcpErrorInvalidVariantSelectionPtr New();
669  PCP_API virtual std::string ToString() const;
670 
671  std::string siteAssetPath;
672  SdfPath sitePath;
673  std::string vset, vsel;
674 
675 private:
678 };
679 
681 
682 // Forward declarations:
684 typedef std::shared_ptr<PcpErrorOpinionAtRelocationSource>
685  PcpErrorOpinionAtRelocationSourcePtr;
686 
692 public:
694  static PcpErrorOpinionAtRelocationSourcePtr New();
698  PCP_API virtual std::string ToString() const;
699 
700  SdfLayerHandle layer;
701  SdfPath path;
702 
703 private:
706 };
707 
709 
710 // Forward declarations:
712 typedef std::shared_ptr<PcpErrorPrimPermissionDenied>
713  PcpErrorPrimPermissionDeniedPtr;
714 
720 public:
722  static PcpErrorPrimPermissionDeniedPtr New();
726  PCP_API virtual std::string ToString() const;
727 
732 
733 private:
736 };
737 
739 
740 // Forward declarations:
742 typedef std::shared_ptr<PcpErrorPropertyPermissionDenied>
743  PcpErrorPropertyPermissionDeniedPtr;
744 
750 public:
752  static PcpErrorPropertyPermissionDeniedPtr New();
756  PCP_API virtual std::string ToString() const;
757 
758  SdfPath propPath;
759  SdfSpecType propType;
760  std::string layerPath;
761 
762 private:
765 };
766 
768 
769 // Forward declarations:
771 typedef std::shared_ptr<PcpErrorSublayerCycle> PcpErrorSublayerCyclePtr;
772 
778 public:
780  static PcpErrorSublayerCyclePtr New();
782  PCP_API ~PcpErrorSublayerCycle();
784  PCP_API virtual std::string ToString() const;
785 
786  SdfLayerHandle layer;
787  SdfLayerHandle sublayer;
788 
789 private:
792 };
793 
795 
796 // Forward declarations:
798 typedef std::shared_ptr<PcpErrorTargetPermissionDenied>
799  PcpErrorTargetPermissionDeniedPtr;
800 
806 public:
808  static PcpErrorTargetPermissionDeniedPtr New();
812  PCP_API virtual std::string ToString() const;
813 
814 private:
817 };
818 
820 
821 // Forward declarations:
823 typedef std::shared_ptr<PcpErrorUnresolvedPrimPath>
824  PcpErrorUnresolvedPrimPathPtr;
825 
831 public:
833  static PcpErrorUnresolvedPrimPathPtr New();
835  PCP_API ~PcpErrorUnresolvedPrimPath();
837  PCP_API virtual std::string ToString() const;
838 
841  SdfPath unresolvedPath;
842  PcpArcType arcType;
843 
844 private:
847 };
848 
850 PCP_API
851 void PcpRaiseErrors(const PcpErrorVector &errors);
852 
853 PXR_NAMESPACE_CLOSE_SCOPE
854 
855 #endif // PCP_ERRORS_H
static PcpErrorInvalidInstanceTargetPathPtr New()
Returns a new error object.
PcpSite site
The site where the invalid arc was expressed.
Definition: errors.h:154
virtual PCP_API std::string ToString() const
Converts error to string message.
Invalid asset paths used by references or payloads.
Definition: errors.h:379
virtual PCP_API std::string ToString() const
Converts error to string message.
static PcpErrorInvalidSublayerPathPtr New()
Returns a new error object.
PcpSite privateSite
The private, invalid target of the arc.
Definition: errors.h:156
SdfPath owningPath
The path to the property where the target was authored.
Definition: errors.h:437
SdfLayerHandle layer
The layer containing the property where the target was authored.
Definition: errors.h:441
SdfSpecType definingSpecType
The type of the defining spec.
Definition: errors.h:209
Sublayers that use invalid layer offsets.
Definition: errors.h:573
static PcpErrorInvalidSublayerOwnershipPtr New()
Returns a new error object.
static PcpErrorPropertyPermissionDeniedPtr New()
Returns a new error object.
static PcpErrorInvalidSublayerOffsetPtr New()
Returns a new error object.
Arcs that were not made between PcpNodes because of permission restrictions.
Definition: errors.h:144
static PcpErrorOpinionAtRelocationSourcePtr New()
Returns a new error object.
virtual PCP_API std::string ToString() const
Converts error to string message.
PCP_API ~PcpErrorInvalidSublayerOwnership()
Destructor.
PCP_API ~PcpErrorPrimPermissionDenied()
Destructor.
PcpSiteStr site
The site where the invalid arc was expressed.
Definition: errors.h:840
virtual PCP_API std::string ToString() const
Converts error to string message.
static PcpErrorInvalidReferenceOffsetPtr New()
Returns a new error object.
virtual PCP_API std::string ToString() const
Converts error to string message.
static PcpErrorArcCyclePtr New()
Returns a new error object.
PCP_API ~PcpErrorInvalidPrimPath()
Destructor.
virtual PCP_API std::string ToString() const
Converts error to string message.
PcpSite site
The site where the invalid arc was expressed.
Definition: errors.h:333
virtual PCP_API std::string ToString() const
Converts error to string message.
PcpCache is the context required to make requests of the Pcp composition algorithm and cache the resu...
Definition: cache.h:91
PCP_API ~PcpErrorInvalidVariantSelection()
Destructor.
A site specifies a path in a layer stack of scene description.
Definition: site.h:46
static PcpErrorMutedAssetPathPtr New()
Returns a new error object.
Attributes that have specs with conflicting variability.
Definition: errors.h:260
Invalid target or connection path authored in an inherited class that points to an instance of that c...
Definition: errors.h:465
PCP_API ~PcpErrorTargetPathBase()
Destructor.
An enum class that records both enum type and enum value.
Definition: enum.h:140
Layers that recursively sublayer themselves.
Definition: errors.h:777
SdfSpecType
An enum that specifies the type of an object.
Definition: types.h:91
Asset paths that could not be both resolved and loaded.
Definition: errors.h:633
Invalid variant selections.
Definition: errors.h:662
static PcpErrorInternalAssetPathPtr New()
Returns a new error object.
TfToken definingValueType
The value type from the defining spec.
Definition: errors.h:240
Layers with illegal opinions about private prims.
Definition: errors.h:719
static PcpErrorPrimPermissionDeniedPtr New()
Returns a new error object.
PCP_API ~PcpErrorTargetPermissionDenied()
Destructor.
static PcpErrorInvalidPrimPathPtr New()
Returns a new error object.
static PcpErrorUnresolvedPrimPathPtr New()
Returns a new error object.
virtual PCP_API std::string ToString() const
Converts error to string message.
Properties that have specs with conflicting definitions.
Definition: errors.h:198
static PcpErrorInvalidExternalTargetPathPtr New()
Returns a new error object.
Opinions were found at a relocation source path.
Definition: errors.h:691
static PcpErrorInvalidTargetPathPtr New()
Returns a new error object.
virtual PCP_API std::string ToString() const
Converts error to string message.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:89
A &quot;string-based&quot; version of PcpSite.
Definition: site.h:81
PCP_API ~PcpErrorSublayerCycle()
Destructor.
Sublayers that use invalid layer offsets.
Definition: errors.h:544
PCP_API ~PcpErrorInconsistentAttributeType()
Destructor.
Paths with illegal opinions about private targets.
Definition: errors.h:805
virtual std::string ToString() const =0
Converts error to string message.
SdfPath targetPath
The invalid target or connection path that was authored.
Definition: errors.h:435
const TfEnum errorType
The error code.
Definition: errors.h:93
virtual PCP_API std::string ToString() const
Converts error to string message.
std::vector< PcpSiteTrackerSegment > PcpSiteTracker
Represents a single path through the composition tree.
Definition: types.h:130
static PcpErrorArcPermissionDeniedPtr New()
Returns a new error object.
Base class for composition errors related to target or connection paths.
Definition: errors.h:429
PCP_API ~PcpErrorUnresolvedPrimPath()
Destructor.
Invalid target or connection path.
Definition: errors.h:519
PCP_API ~PcpErrorInvalidReferenceOffset()
Destructor.
Invalid target or connection path in some scope that points to an object outside of that scope...
Definition: errors.h:491
static PcpErrorInconsistentAttributeTypePtr New()
Returns a new error object.
static PcpErrorInconsistentAttributeVariabilityPtr New()
Returns a new error object.
Invalid prim paths used by references or payloads.
Definition: errors.h:323
PcpSite site
The site where the invalid arc was expressed.
Definition: errors.h:301
PcpArcType arcType
The type of arc.
Definition: errors.h:158
PCP_API ~PcpErrorInconsistentPropertyType()
Destructor.
virtual PCP_API std::string ToString() const
Converts error to string message.
SdfVariability
An enum that identifies variability types for attributes.
Definition: types.h:182
TfToken conflictingValueType
The value type from the conflicting spec.
Definition: errors.h:242
Muted asset paths used by references or payloads.
Definition: errors.h:404
virtual PCP_API std::string ToString() const
Converts error to string message.
PcpArcType
Describes the type of arc connecting two nodes in the prim index.
Definition: types.h:46
PCP_API ~PcpErrorInvalidTargetPath()
Destructor.
PCP_API ~PcpErrorInvalidSublayerPath()
Destructor.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:287
static PcpErrorInvalidAssetPathPtr New()
Returns a new error object.
PcpSiteStr rootSite
The site of the composed prim or property being computed when the error was encountered.
Definition: errors.h:99
PcpSiteStr site
The site where the invalid arc was expressed.
Definition: errors.h:729
static PcpErrorSublayerCyclePtr New()
Returns a new error object.
static PcpErrorTargetPermissionDeniedPtr New()
Returns a new error object.
Asset paths that could not be both resolved and loaded.
Definition: errors.h:830
PcpErrorBase(TfEnum errorType)
Constructor.
virtual PCP_API std::string ToString() const
Converts error to string message.
static PcpErrorInconsistentPropertyTypePtr New()
Returns a new error object.
virtual PCP_API std::string ToString() const
Converts error to string message.
Sibling layers that have the same owner.
Definition: errors.h:604
virtual PCP_API std::string ToString() const
Converts error to string message.
PCP_API ~PcpErrorMutedAssetPath()
Destructor.
virtual PCP_API std::string ToString() const
Converts error to string message.
virtual PCP_API std::string ToString() const
Converts error to string message.
Layers with illegal opinions about private properties.
Definition: errors.h:749
PCP_API ~PcpErrorInternalAssetPath()
Destructor.
PCP_API ~PcpErrorArcCycle()
Destructor.
Attributes that have specs with conflicting definitions.
Definition: errors.h:229
virtual PCP_API ~PcpErrorBase()
Destructor.
PCP_API ~PcpErrorOpinionAtRelocationSource()
Destructor.
static PcpErrorInvalidVariantSelectionPtr New()
Returns a new error object.
virtual PCP_API std::string ToString() const
Converts error to string message.
virtual PCP_API std::string ToString() const
Converts error to string message.
PCP_API ~PcpErrorInvalidExternalTargetPath()
Destructor.
PCP_API ~PcpErrorPropertyPermissionDenied()
Destructor.
Arcs between PcpNodes that form a cycle.
Definition: errors.h:116
SdfPath composedTargetPath
The target or connection path in the composed scene.
Definition: errors.h:447
PCP_API ~PcpErrorInconsistentAttributeVariability()
Destructor.
PCP_API ~PcpErrorInvalidSublayerOffset()
Destructor.
Error about an arc that is prohibited due to being internal to an asset.
Definition: errors.h:291
Represents a time offset and scale between layers.
Definition: layerOffset.h:61
SdfVariability conflictingVariability
The variability of the conflicting spec.
Definition: errors.h:273
PCP_API ~PcpErrorInvalidInstanceTargetPath()
Destructor.
PcpSiteStr privateSite
The private, invalid target of the arc.
Definition: errors.h:731
virtual PCP_API std::string ToString() const
Converts error to string message.
virtual PCP_API std::string ToString() const
Converts error to string message.
SdfVariability definingVariability
The variability of the defining spec.
Definition: errors.h:271
PCP_API ~PcpErrorArcPermissionDenied()
Destructor.
virtual PCP_API std::string ToString() const
Converts error to string message.
PCP_API ~PcpErrorInvalidAssetPath()
Destructor.
virtual PCP_API std::string ToString() const
Converts error to string message.
SdfSpecType conflictingSpecType
The type of the conflicting spec.
Definition: errors.h:211
SdfSpecType ownerSpecType
The spec type of the property where the target was authored.
Definition: errors.h:439
Base class for all error types.
Definition: errors.h:85