HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData Class Reference

Class that stores endpoints of a y range for each x value within a specified range and step size. More...

#include <ConvexVoxelizer.h>

Public Member Functions

 XYRangeData ()=default
 
 XYRangeData (const ValueT &xmin, const ValueT &xmax, const Index &step=1)
 Constructor that sets the x range to span a given interval with a specific step size. This initializes all y ranges as empty. More...
 
void expandYRange (const ValueT &x, const ValueT &ymin, const ValueT &ymax)
 Expands the y range for a given x value by updating the minimum and maximum y values if the new ones extend the current range. More...
 
void expandYMin (const ValueT &x, const ValueT &ymin)
 Sets the minimum y value for a given x value, if the provided ymin is smaller than the current value. More...
 
void expandYMax (const ValueT &x, const ValueT &ymax)
 Sets the maximum y value for a given x value, if the provided ymax is larger than the current value. More...
 
void expandYRange (const ValueT &x, const ValueT &y)
 Expands the y range for a given x by adjusting ymin or ymax if the given y is smaller or larger. More...
 
void setYMin (const ValueT &x, const ValueT &ymin)
 Set the minimum y value for a given x value, even if it is larger than the current value. More...
 
void setYMax (const ValueT &x, const ValueT &ymax)
 Set the maximum y value for a given x value, even if it is smaller than the current value. More...
 
void clearYRange (const ValueT &x)
 Clears the y range for a given x value, setting it to an empty interval. More...
 
void clear ()
 Clears the data container. More...
 
void reset (const ValueT &xmin, const ValueT &xmax, const Index &step=1)
 Resets the x range to span a given interval with a specific step size. This initializes all y ranges as empty. More...
 
Index step () const
 Retrieves the step size used for the x values. More...
 
Index size () const
 Returns the number of x points in the current range. More...
 
ValueT start () const
 Retrieves the starting x value in the range. More...
 
ValueT end () const
 Retrieves the ending x value in the range. More...
 
ValueT getX (const Index &i) const
 Converts an index to its corresponding x value. More...
 
ValueT getYMin (const Index &i) const
 Gets the minimum y value for a given index. More...
 
ValueT getYMax (const Index &i) const
 Gets the maximum y value for a given index. More...
 
ValueT getYMin (const ValueT &x) const
 Gets the minimum y value for a given x value. More...
 
ValueT getYMax (const ValueT &x) const
 Gets the maximum y value for a given x value. More...
 
void XYData (ValueT &x, ValueT &ymin, ValueT &ymax, const Index &i) const
 Retrieves the x, ymin, and ymax values for a given index. More...
 
bool isEmpty () const
 Returns true if the container has no x values or if all y ranges are empty. More...
 
void merge (const XYRangeData &xydata)
 Merges another XYRangeData into the current instance by combining y ranges over the overlapping x range. More...
 
void trim ()
 Trims the x range by removing empty or invalid y ranges from the beginning and end. Truncates the range if all values are invalid. More...
 

Detailed Description

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
class openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData

Class that stores endpoints of a y range for each x value within a specified range and step size.

This class tracks y ranges (defined by ymin and ymax) for each x value over a defined interval, using a configurable step size. It allows updating, expanding, and resetting the y ranges, as well as merging data from other instances and trimming invalid entries.

Definition at line 445 of file ConvexVoxelizer.h.

Constructor & Destructor Documentation

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::XYRangeData ( )
default
template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::XYRangeData ( const ValueT &  xmin,
const ValueT &  xmax,
const Index &  step = 1 
)
inline

Constructor that sets the x range to span a given interval with a specific step size. This initializes all y ranges as empty.

Parameters
xminThe lower bound of the x range.
xmaxThe upper bound of the x range.
stepThe step size between x values. Defaults to 1.

Definition at line 457 of file ConvexVoxelizer.h.

Member Function Documentation

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::clear ( )
inline

Clears the data container.

Definition at line 557 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::clearYRange ( const ValueT &  x)
inline

Clears the y range for a given x value, setting it to an empty interval.

Parameters
xThe x value.

Definition at line 547 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
ValueT openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::end ( void  ) const
inline

Retrieves the ending x value in the range.

Returns
The end of the x range.

Definition at line 607 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::expandYMax ( const ValueT &  x,
const ValueT &  ymax 
)
inline

Sets the maximum y value for a given x value, if the provided ymax is larger than the current value.

Parameters
xThe x value.
ymaxThe maximum y value to possibly be set.

Definition at line 494 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::expandYMin ( const ValueT &  x,
const ValueT &  ymin 
)
inline

Sets the minimum y value for a given x value, if the provided ymin is smaller than the current value.

Parameters
xThe x value.
yminThe minimum y value to possibly be set.

Definition at line 481 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::expandYRange ( const ValueT &  x,
const ValueT &  ymin,
const ValueT &  ymax 
)
inline

Expands the y range for a given x value by updating the minimum and maximum y values if the new ones extend the current range.

Parameters
xThe x value.
yminThe new minimum y value to compare with and possibly update the current minimum at x.
ymaxThe new maximum y value to compare with and possibly update the current maximum at x.

Definition at line 470 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::expandYRange ( const ValueT &  x,
const ValueT &  y 
)
inline

Expands the y range for a given x by adjusting ymin or ymax if the given y is smaller or larger.

Parameters
xThe x value.
yThe y value to use for expanding the range.

Definition at line 507 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
ValueT openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::getX ( const Index &  i) const
inline

Converts an index to its corresponding x value.

Parameters
iThe index value.
Returns
The corresponding x value.

Definition at line 612 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
ValueT openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::getYMax ( const Index &  i) const
inline

Gets the maximum y value for a given index.

Parameters
iThe index value.
Returns
The maximum y value.

Definition at line 622 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
ValueT openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::getYMax ( const ValueT &  x) const
inline

Gets the maximum y value for a given x value.

Parameters
xThe x value.
Returns
The maximum y value at the given x.
Note
x is rounded to the nearest value in the x range.

Definition at line 634 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
ValueT openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::getYMin ( const Index &  i) const
inline

Gets the minimum y value for a given index.

Parameters
iThe index value.
Returns
The minimum y value.

Definition at line 617 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
ValueT openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::getYMin ( const ValueT &  x) const
inline

Gets the minimum y value for a given x value.

Parameters
xThe x value.
Returns
The minimum y value at the given x.
Note
x is rounded to the nearest value in the x range.

Definition at line 628 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
bool openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::isEmpty ( ) const
inline

Returns true if the container has no x values or if all y ranges are empty.

Definition at line 650 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::merge ( const XYRangeData &  xydata)
inline

Merges another XYRangeData into the current instance by combining y ranges over the overlapping x range.

Parameters
xydataThe XYRangeData to merge with.

Definition at line 667 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::reset ( const ValueT &  xmin,
const ValueT &  xmax,
const Index &  step = 1 
)
inline

Resets the x range to span a given interval with a specific step size. This initializes all y ranges as empty.

Parameters
xminThe lower bound of the x range.
xmaxThe upper bound of the x range.
stepThe step size between x values. Defaults to 1.

Definition at line 577 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::setYMax ( const ValueT &  x,
const ValueT &  ymax 
)
inline

Set the maximum y value for a given x value, even if it is smaller than the current value.

Parameters
xThe x value.
ymaxThe maximum y value to reset.

Definition at line 537 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::setYMin ( const ValueT &  x,
const ValueT &  ymin 
)
inline

Set the minimum y value for a given x value, even if it is larger than the current value.

Parameters
xThe x value.
yminThe minimum y value to reset.

Definition at line 525 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
Index openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::size ( void  ) const
inline

Returns the number of x points in the current range.

Returns
The size of the x range.

Definition at line 599 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
ValueT openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::start ( ) const
inline

Retrieves the starting x value in the range.

Returns
The start of the x range.

Definition at line 603 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
Index openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::step ( ) const
inline

Retrieves the step size used for the x values.

Returns
The step size.

Definition at line 595 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::trim ( )
inline

Trims the x range by removing empty or invalid y ranges from the beginning and end. Truncates the range if all values are invalid.

Definition at line 702 of file ConvexVoxelizer.h.

template<typename GridType, typename Derived, typename InterruptType = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::ConvexVoxelizer< GridType, Derived, InterruptType >::XYRangeData::XYData ( ValueT &  x,
ValueT &  ymin,
ValueT &  ymax,
const Index &  i 
) const
inline

Retrieves the x, ymin, and ymax values for a given index.

Parameters
xOutput parameter for the x value.
yminOutput parameter for the minimum y value.
ymaxOutput parameter for the maximum y value.
iThe index to query.

Definition at line 642 of file ConvexVoxelizer.h.


The documentation for this class was generated from the following file: