All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
notice.h
Go to the documentation of this file.
1 //
2 // Copyright 2018 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 USDMAYA_NOTICE_H
25 #define USDMAYA_NOTICE_H
26 
28 
29 #include "pxr/base/tf/notice.h"
30 
31 #include "usdMaya/api.h"
32 
33 #include <maya/MMessage.h>
34 #include <maya/MObject.h>
35 
36 PXR_NAMESPACE_OPEN_SCOPE
37 
43 {
44 public:
45  PXRUSDMAYA_API
47 
49  PXRUSDMAYA_API
50  static void InstallListener();
51 
53  PXRUSDMAYA_API
54  static void RemoveListener();
55 
56 private:
57  static MCallbackId _afterNewCallbackId;
58  static MCallbackId _beforeFileReadCallbackId;
59 };
60 
61 class UsdMaya_AssemblyInstancerNoticeBase : public TfNotice
62 {
63 public:
64  PXRUSDMAYA_API
65  virtual ~UsdMaya_AssemblyInstancerNoticeBase() = default;
66 
67  PXRUSDMAYA_API
68  MObject GetAssembly() const;
69 
70  PXRUSDMAYA_API
71  MObject GetInstancer() const;
72 
73 protected:
74  PXRUSDMAYA_API
75  UsdMaya_AssemblyInstancerNoticeBase(
76  const MObject& assembly,
77  const MObject& instancer);
78 
79 private:
80  MObject _assembly;
81  MObject _instancer;
82 };
83 
87  : public UsdMaya_AssemblyInstancerNoticeBase
88 {
89 public:
90  PXRUSDMAYA_API
92  const MObject& assembly,
93  const MObject& instancer);
94 };
95 
99  : public UsdMaya_AssemblyInstancerNoticeBase
100 {
101 public:
102  PXRUSDMAYA_API
104  const MObject& assembly,
105  const MObject& instancer);
106 };
107 
108 PXR_NAMESPACE_CLOSE_SCOPE
109 
110 #endif
The base class for objects used to notify interested parties (listeners) when events have occurred...
Definition: notice.h:93
Notice sent when any reference assembly is connected as a prototype of a native Maya instancer...
Definition: notice.h:86
static PXRUSDMAYA_API void RemoveListener()
Removes any Maya callbacks for recognizing stage resets.
static PXRUSDMAYA_API void InstallListener()
Registers the proper Maya callbacks for recognizing stage resets.
Notice sent when any reference assembly was previously a prototype of a native Maya instancer but has...
Definition: notice.h:98
Notice sent when the Maya scene resets, either by opening a new scene or switching to a new scene...
Definition: notice.h:42