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_PostLayers.h"
24 #include "HUSD_Overrides.h"
25 #include "HUSD_Path.h"
26 #include <UT/UT_StringHolder.h>
27 
28 // This class is a standalone wrapper around a specific object in a USD
29 // stage wrapped in an HUSD_DataHandle. It's purpose is to serve as the data
30 // accessor for tree nodes in the Scene Graph Tree. It should not be used for
31 // any other purpose, as it is extremely inefficient. Each function call locks
32 // the HUSD_DataHandle, queries its information, then unlocks it again. This
33 // is a matter of convenience for the calling pattern of the scene graph tree.
34 // Because it is inefficient the scene graph tree caches any information that
35 // comes out of this object.
36 //
37 // Anyone else tempted to use this object should use HUSD_Info instead.
39 {
40 public:
44  OVERRIDES_IGNORE
45  };
46 
48  OverridesHandling overrides_handling
49  = OVERRIDES_IGNORE);
51  OverridesHandling overrides_handling
52  = OVERRIDES_IGNORE);
53  virtual ~HUSD_ObjectHandle();
54 
55  virtual const HUSD_DataHandle &dataHandle() const = 0;
56  virtual const HUSD_ConstOverridesPtr &overrides() const = 0;
57  virtual const HUSD_ConstPostLayersPtr &postLayers() const = 0;
58 
60  { return myOverridesHandling; }
61  const HUSD_Path &path() const
62  { return myPath; }
63  bool isValid() const
64  { return !myPath.isEmpty(); }
65 
66 private:
67  HUSD_Path myPath;
68  OverridesHandling myOverridesHandling;
69 };
70 
71 #endif
72 
OverridesHandling overridesHandling() const
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
#define HUSD_API
Definition: HUSD_API.h:32
const HUSD_Path & path() const
bool isValid() const