AL_USDMaya  0.29.4
USD to Maya Bridge
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
PrimFilter.h
1 //
2 // Copyright 2017 Animal Logic
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 #pragma once
17 
18 #include "../../Api.h"
19 
20 #include <vector>
21 #include "pxr/usd/usd/prim.h"
22 #include "pxr/usd/sdf/path.h"
23 #include "AL/usd/utils/ForwardDeclares.h"
24 
25 PXR_NAMESPACE_USING_DIRECTIVE
26 
27 namespace AL {
28 namespace usdmaya {
29 namespace nodes {
30 namespace proxy {
31 
32 //----------------------------------------------------------------------------------------------------------------------
36 //----------------------------------------------------------------------------------------------------------------------
38 {
46  virtual TfToken getTypeForPath(const SdfPath& path) = 0;
47 
54  virtual bool getTypeInfo(TfToken type, bool& supportsUpdate, bool& requiresParent) = 0;
55 };
56 
57 //----------------------------------------------------------------------------------------------------------------------
59 //----------------------------------------------------------------------------------------------------------------------
61 {
62 public:
63 
68  AL_USDMAYA_PUBLIC
69  PrimFilter(const SdfPathVector& previousPrims, const AL::usd::utils::UsdPrimVector& newPrimSet, PrimFilterInterface* proxy);
70 
72  inline const std::vector<UsdPrim>& newPrimSet() const
73  { return m_newPrimSet; }
74 
76  inline const std::vector<UsdPrim>& transformsToCreate() const
77  { return m_transformsToCreate; }
78 
80  inline const std::vector<UsdPrim>& updatablePrimSet() const
81  { return m_updatablePrimSet; }
82 
84  inline const SdfPathVector& removedPrimSet() const
85  { return m_removedPrimSet; }
86 
87 private:
88  std::vector<UsdPrim> m_newPrimSet;
89  std::vector<UsdPrim> m_transformsToCreate;
90  std::vector<UsdPrim> m_updatablePrimSet;
91  SdfPathVector m_removedPrimSet;
92 };
93 
94 //----------------------------------------------------------------------------------------------------------------------
95 } // proxy
96 } // nodes
97 } // usdmaya
98 } // AL
99 //----------------------------------------------------------------------------------------------------------------------
100 
virtual TfToken getTypeForPath(const SdfPath &path)=0
Given a path to a prim, this method will return some type information for the prim found at that path...
const SdfPathVector & removedPrimSet() const
returns the list of prims that have been removed from the stage
Definition: PrimFilter.h:84
const std::vector< UsdPrim > & newPrimSet() const
returns the set of prims to create
Definition: PrimFilter.h:72
AL_USDMAYA_PUBLIC PrimFilter(const SdfPathVector &previousPrims, const AL::usd::utils::UsdPrimVector &newPrimSet, PrimFilterInterface *proxy)
constructor constructs the prim filter
const std::vector< UsdPrim > & transformsToCreate() const
returns the set of prims that require created transforms
Definition: PrimFilter.h:76
const std::vector< UsdPrim > & updatablePrimSet() const
returns the list of prims that needs to be updated
Definition: PrimFilter.h:80
The prim filter needs to know about some state provided in the proxy shape node. In order to maintain...
Definition: PrimFilter.h:37
A class to filter the prims during a variant switch.
Definition: PrimFilter.h:60
virtual bool getTypeInfo(TfToken type, bool &supportsUpdate, bool &requiresParent)=0
for a specific type, this method should return whether it supports update, and if that type requires ...