All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vdbTexture.h
Go to the documentation of this file.
1 //
2 // Copyright 2019 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 GLF_VDB_TEXTURE_H
25 #define GLF_VDB_TEXTURE_H
26 
28 
29 #include "pxr/pxr.h"
30 #include "pxr/imaging/glf/api.h"
31 #include "pxr/imaging/glf/baseTexture.h"
32 
33 #include "pxr/base/gf/bbox3d.h"
34 #include "pxr/base/tf/declarePtrs.h"
35 
36 PXR_NAMESPACE_OPEN_SCOPE
37 
39 
48 class GlfVdbTexture : public GlfBaseTexture {
49 public:
51  GLF_API
52  static GlfVdbTextureRefPtr New(TfToken const &filePath);
53 
55  GLF_API
56  static GlfVdbTextureRefPtr New(std::string const &filePath);
57 
62  GLF_API
63  const GfBBox3d &GetBoundingBox();
64 
65  int GetNumDimensions() const override;
66 
67  GLF_API
68  VtDictionary GetTextureInfo(bool forceLoad) override;
69 
70  GLF_API
71  bool IsMinFilterSupported(GLenum filter) override;
72 
73 protected:
74  GLF_API
75  GlfVdbTexture(TfToken const &filePath);
76 
77  GLF_API
78  void _ReadTexture() override;
79 
80  GLF_API
81  bool _GenerateMipmap() const;
82 
83 private:
84  const TfToken _filePath;
85 
86  GfBBox3d _boundingBox;
87 };
88 
89 
90 PXR_NAMESPACE_CLOSE_SCOPE
91 
92 #endif // GLF_VDBTEXTURE_H
A map with string keys and VtValue values.
Definition: dictionary.h:61
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:89
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:89
static GLF_API GlfVdbTextureRefPtr New(TfToken const &filePath)
Creates a new texture instance for the OpenVDB file at filePath.
Represents a 3-dimensional texture read from an OpenVDB file.
Definition: vdbTexture.h:48
int GetNumDimensions() const override
Is this a 1-, 2- or 3-dimensional texture.
GLF_API const GfBBox3d & GetBoundingBox()
Returns the transform of the grid in the OpenVDB file as well as the bounding box of the samples in t...
Basic type: arbitrarily oriented 3D bounding box.
Definition: bbox3d.h:84
Represents a texture object in Glf.
Definition: baseTexture.h:52