10#ifndef OPENVDB_POINTS_POINT_RASTERIZE_FRUSTUM_HAS_BEEN_INCLUDED
11#define OPENVDB_POINTS_POINT_RASTERIZE_FRUSTUM_HAS_BEEN_INCLUDED
16#include <openvdb/thread/Threading.h>
64 std::deque<math::Transform> mTransforms;
65 std::deque<float> mWeights;
67 float mShutterStart = -0.25f,
91 : transform(new math::Transform(_transform))
92 , camera(_transform) { }
96 bool scaleByVoxelVolume =
false,
98 accurateFrustumRadius =
false,
99 accurateSphereMotionBlur =
false,
100 velocityMotionBlur =
false,
102 float threshold = 1e-6f,
104 framesPerSecond = 24.0f;
106 radiusAttribute =
"pscale";
107 int motionSamples = 2;
121 const bool clipToFrustum =
true,
122 const bool invert =
false);
124 operator bool()
const;
135 bool mInvert =
false;
139namespace point_rasterize_internal {
141template <
typename Po
intDataGr
idT>
162template<
typename Po
intDataGr
idT>
197 template <
typename FilterT = po
ints::NullFilter>
200 bool reduceMemory =
false,
float scale = 1.0f,
const FilterT& filter = FilterT());
202 template <
typename FilterT = po
ints::NullFilter>
205 bool reduceMemory =
false,
float scale = 1.0f,
const FilterT& filter = FilterT());
207 template <
typename FilterT = po
ints::NullFilter>
210 bool reduceMemory =
false,
float scale = 1.0f,
const FilterT& filter = FilterT());
212 template <
typename Gr
idT,
typename AttributeT,
typename FilterT = po
ints::NullFilter>
215 bool reduceMemory =
false,
float scale = 1.0f,
const FilterT& filter = FilterT());
217 template <
typename Gr
idT,
typename FilterT = po
ints::NullFilter>
219 rasterizeMask(
bool reduceMemory =
false,
const FilterT& filter = FilterT());
222 template <
typename AttributeT,
typename Gr
idT,
typename FilterT>
224 performRasterization(
226 bool reduceMemory,
float scale,
const FilterT& filter);
233 std::vector<GridToRasterize> mPointGrids;
Digital Differential Analyzers specialized for VDB.
Methods for counting points in VDB Point grids.
Attribute-owned data structure for points. Point attributes are stored in leaf nodes and ordered by v...
SharedPtr< GridBase > Ptr
Definition: Grid.h:80
Container class that associates a tree with a transform and metadata.
Definition: Grid.h:571
SharedPtr< Grid > Ptr
Definition: Grid.h:573
Axis-aligned bounding box of signed integer coordinates.
Definition: Coord.h:249
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:25
Efficient rasterization of one or more VDB Points grids into a linear or frustum volume with the opti...
Definition: PointRasterizeFrustum.h:164
GridT::Ptr rasterizeAttribute(const Name &attribute, RasterMode mode=RasterMode::ACCUMULATE, bool reduceMemory=false, float scale=1.0f, const FilterT &filter=FilterT())
typename PointDataGridT::ConstPtr GridConstPtr
Definition: PointRasterizeFrustum.h:167
size_t memUsage() const
Return memory usage of the rasterizer.
size_t size() const
Return number of PointDataGrids in the rasterizer.
FrustumRasterizer(const FrustumRasterizerSettings &settings, const FrustumRasterizerMask &mask=FrustumRasterizerMask(), util::NullInterrupter *interrupt=nullptr)
main constructor
FloatGrid::Ptr rasterizeDensity(const openvdb::Name &attribute, RasterMode mode=RasterMode::MAXIMUM, bool reduceMemory=false, float scale=1.0f, const FilterT &filter=FilterT())
void addPoints(GridPtr &points, bool stream=false)
Append a PointDataGrid to the rasterizer (but don't rasterize yet).
void addPoints(GridConstPtr &points)
Append a PointDataGrid to the rasterizer (but don't rasterize yet).
GridT::Ptr rasterizeMask(bool reduceMemory=false, const FilterT &filter=FilterT())
typename PointDataGridT::Ptr GridPtr
Definition: PointRasterizeFrustum.h:166
void clear()
Clear all PointDataGrids in the rasterizer.
GridBase::Ptr rasterizeAttribute(const Name &attribute, RasterMode mode=RasterMode::ACCUMULATE, bool reduceMemory=false, float scale=1.0f, const FilterT &filter=FilterT())
FloatGrid::Ptr rasterizeUniformDensity(RasterMode mode=RasterMode::MAXIMUM, bool reduceMemory=false, float scale=1.0f, const FilterT &filter=FilterT())
A camera class that provides an interface for camera motion blur when rasterizing.
Definition: PointRasterizeFrustum.h:39
float weight(Index i) const
const math::Transform & transform(Index i) const
const math::Transform & firstTransform() const
void setShutter(float start, float end)
void appendTransform(const math::Transform &, float weight=1.0f)
bool hasWeight(Index i) const
RasterCamera(const math::Transform &transform)
const math::Transform & lastTransform() const
float shutterStart() const
Definition: PointRasterizeFrustum.h:142
SharedPtr< const Tree > ConstPtr
Definition: Tree.h:181
Definition: ValueAccessor.h:191
MatType scale(const Vec3< typename MatType::value_type > &s)
Return a matrix that scales by s.
Definition: Mat.h:615
RasterMode
How to composite points into a volume.
Definition: PointRasterizeFrustum.h:30
std::string Name
Definition: Name.h:17
Index32 Index
Definition: Types.h:54
math::BBox< Vec3d > BBoxd
Definition: Types.h:84
Definition: Exceptions.h:13
Definition: PointRasterizeFrustum.h:112
FrustumRasterizerMask()=default
bool valid(const Coord &ijk, AccessorT *acc) const
MaskTree::ConstPtr getTreePtr() const
const CoordBBox & clipBBox() const
FrustumRasterizerMask(const math::Transform &transform, const MaskGrid *mask=nullptr, const BBoxd &bbox=BBoxd(), const bool clipToFrustum=true, const bool invert=false)
A group of shared settings to be used in the Volume Rasterizer.
Definition: PointRasterizeFrustum.h:87
FrustumRasterizerSettings()=delete
math::Transform::Ptr transform
Definition: PointRasterizeFrustum.h:94
RasterCamera camera
Definition: PointRasterizeFrustum.h:95
FrustumRasterizerSettings(const math::Transform &_transform)
Definition: PointRasterizeFrustum.h:90
A struct that stores all include/exclude attribute names as strings and is internally converted into ...
Definition: PointRasterizeFrustum.h:240
std::vector< Name > excludeNames
Definition: PointRasterizeFrustum.h:242
std::vector< Name > includeNames
Definition: PointRasterizeFrustum.h:241
Base class for interrupters.
Definition: NullInterrupter.h:26
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h.in:121
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h.in:212