HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HUSD_ObjectHandle.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 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 
18 #ifndef __HUSD_ObjectHandle_h__
19 #define __HUSD_ObjectHandle_h__
20 
21 #include "HUSD_API.h"
22 #include "HUSD_DataHandle.h"
23 #include "HUSD_Overrides.h"
24 #include "HUSD_Path.h"
25 #include <UT/UT_StringHolder.h>
26 
27 // This class is a standalone wrapper around a specific object in a USD
28 // stage wrapped in an HUSD_DataHandle. It's purpose is to serve as the data
29 // accessor for tree nodes in the Scene Graph Tree. It should not be used for
30 // any other purpose, as it is extremely inefficient. Each function call locks
31 // the HUSD_DataHandle, queries its information, then unlocks it again. This
32 // is a matter of convenience for the calling pattern of the scene graph tree.
33 // Because it is inefficient the scene graph tree caches any information that
34 // comes out of this object.
35 //
36 // Anyone else tempted to use this object should use HUSD_Info instead.
38 {
39 public:
43  OVERRIDES_IGNORE
44  };
45 
47  OverridesHandling overrides_handling
48  = OVERRIDES_IGNORE);
50  OverridesHandling overrides_handling
51  = OVERRIDES_IGNORE);
52  virtual ~HUSD_ObjectHandle();
53 
54  virtual const HUSD_DataHandle &dataHandle() const = 0;
55  virtual const HUSD_ConstOverridesPtr&overrides() const = 0;
57  { return myOverridesHandling; }
58 
59  const HUSD_Path &path() const
60  { return myPath; }
61  bool isValid() const
62  { return !myPath.isEmpty(); }
63 
64 private:
65  HUSD_Path myPath;
66  OverridesHandling myOverridesHandling;
67 };
68 
69 #endif
70 
OverridesHandling overridesHandling() const
#define HUSD_API
Definition: HUSD_API.h:32
GLsizei const GLchar *const * path
Definition: glew.h:6461
const HUSD_Path & path() const
bool isValid() const