HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
XUSD_HdGpMutingSceneIndex.h
Go to the documentation of this file.
1 /*
2  * Copyright 2025 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 #pragma once
18 
19 #include "HUSD_API.h"
20 
21 #include <pxr/pxr.h>
23 
25 
27 
28 /// \class XUSD_HdGpMutingSceneIndex
29 ///
30 /// Solaris scene index plugin that conditionally mutes unresolved
31 /// Hydra Generative Procedurals, by changing their primType.
32 ///
33 /// This is similar to HdGpGenerativeProceduralFilteringSceneIndex but
34 /// provides an API for (de)activation and keeps a cache of known procedural
35 /// paths for efficiency.
36 ///
39 {
40 public:
41  static
42  XUSD_HdGpMutingSceneIndexRefPtr
43  New(HdSceneIndexBaseRefPtr const &inputSceneIndex);
44 
45  // Unique external API
46  void setActive(bool active);
47 
48  // HdFilteringSceneIndexBase overrides
49  HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override;
50  SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override;
51 
52 protected:
53  void _PrimsAdded(
54  const HdSceneIndexBase &sender,
55  const HdSceneIndexObserver::AddedPrimEntries &entries) override;
56  void _PrimsRemoved(
57  const HdSceneIndexBase &sender,
58  const HdSceneIndexObserver::RemovedPrimEntries &entries) override;
59  void _PrimsDirtied(
60  const HdSceneIndexBase &sender,
61  const HdSceneIndexObserver::DirtiedPrimEntries &entries) override;
62 
63 private:
64  XUSD_HdGpMutingSceneIndex(const HdSceneIndexBaseRefPtr &scene);
65 
66  SdfPathSet myKnownProceduralPaths;
67  bool myActive;
68 };
69 
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
#define HUSD_API
Definition: HUSD_API.h:31
virtual void _PrimsRemoved(const HdSceneIndexBase &sender, const HdSceneIndexObserver::RemovedPrimEntries &entries)=0
PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_REF_PTRS(XUSD_HdGpMutingSceneIndex)
virtual SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const =0
std::vector< class SdfPath > SdfPathVector
virtual void _PrimsDirtied(const HdSceneIndexBase &sender, const HdSceneIndexObserver::DirtiedPrimEntries &entries)=0
Definition: path.h:280
that also have some descendant prim *whose name begins with which in turn has a child named baz where *the predicate active
std::set< class SdfPath > SdfPathSet
A set of SdfPaths.
Definition: path.h:199
virtual HdSceneIndexPrim GetPrim(const SdfPath &primPath) const =0
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
virtual void _PrimsAdded(const HdSceneIndexBase &sender, const HdSceneIndexObserver::AddedPrimEntries &entries)=0