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 PXR_IMAGING_GLF_VDB_TEXTURE_H
25 #define PXR_IMAGING_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 
40 
48 class GlfVdbTexture : public GlfBaseTexture {
49 public:
52  GLF_API
53  static GlfVdbTextureRefPtr New(
54  GlfVdbTextureContainerRefPtr const &textureContainer,
55  TfToken const &gridName);
56 
61  GLF_API
62  const GfBBox3d &GetBoundingBox();
63 
64  int GetNumDimensions() const override;
65 
66  GLF_API
67  VtDictionary GetTextureInfo(bool forceLoad) override;
68 
69  GLF_API
70  bool IsMinFilterSupported(GLenum filter) override;
71 
72 protected:
73  GLF_API
75  GlfVdbTextureContainerRefPtr const &textureContainer,
76  TfToken const &gridName);
77 
78  GLF_API
79  void _ReadTexture() override;
80 
81  GLF_API
82  bool _GenerateMipmap() const;
83 
84 private:
85  GlfVdbTextureContainerRefPtr const _textureContainer;
86  const TfToken _gridName;
87 
88  GfBBox3d _boundingBox;
89 };
90 
91 
92 PXR_NAMESPACE_CLOSE_SCOPE
93 
94 #endif // GLF_VDBTEXTURE_H
A map with string keys and VtValue values.
Definition: dictionary.h:63
#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:87
A container for 3-dimension textures read from the grids in an OpenVDB file.
static GLF_API GlfVdbTextureRefPtr New(GlfVdbTextureContainerRefPtr const &textureContainer, TfToken const &gridName)
Creates a new texture instance for the grid named in the OpenVDB file opened by textureContainer.
Represents a 3-dimensional texture read from grid in 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