Public Member Functions | |
| VoxelIntersection (helios::Context *context) | |
| Default constructor. | |
| void | calculatePrimitiveVoxelIntersection () |
| Calculate primitives that reside in all voxels for every primitive in the Context. | |
| void | calculatePrimitiveVoxelIntersection (std::vector< uint > UUIDs) |
| Calculate primitives that reside in all voxels for a subset of primitives in the Context. | |
| void | disableMessages () |
| Disable output messages (enabled by default) | |
| void | enableMessages () |
| Re-enable output messages. | |
| helios::vec3 | linesIntersection (helios::vec3 line1_point, helios::vec3 line1_direction, helios::vec3 line2_point, helios::vec3 line2_direction) |
| Calculate the intersection point of two lines. | |
| std::vector< uint > | slicePrimitive (uint UUID, std::vector< helios::vec3 > voxel_face_vertices, helios::WarningAggregator &warnings) |
| Slice a primitive (patch or triangle) into multiple triangles using a defined plane (often a voxel face) | |
| std::vector< uint > | slicePrimitivesUsingGrid (std::vector< uint > UUIDs, helios::vec3 grid_center, helios::vec3 grid_size, helios::int3 grid_divisions) |
| Slice a primitives based on a defined grid of voxels. | |
| std::vector< std::vector< uint > > | getCellPrimitives () |
| get 2D vector storing the UUIDs within each grid cell | |
| bool | approxSame (float a, float b, float absTol, float relTol) |
| compare two floating point numbers to within an absolute and relative error tolerance | |
| bool | approxSame (helios::vec3 a, helios::vec3 b, float absTol) |
| compare two vec3's to within an absolute and relative error tolerance | |
| helios::vec2 | interpolate_texture_UV_to_slice_point (helios::vec3 p1, helios::vec2 uv1, helios::vec3 p2, helios::vec2 uv2, helios::vec3 ps) |
| find the uv coordinate of a slice point | |
Static Public Member Functions | |
| static int | selfTest (int argc=0, char **argv=nullptr) |
| Self-test function (unit tests) | |
Definition at line 21 of file VoxelIntersection.h.
| VoxelIntersection::VoxelIntersection | ( | helios::Context * | context | ) |
Default constructor.
| [in] | context | Pointer to Helios context |
Definition at line 20 of file VoxelIntersection.cpp.
| bool VoxelIntersection::approxSame | ( | float | a, |
| float | b, | ||
| float | absTol, | ||
| float | relTol | ||
| ) |
compare two floating point numbers to within an absolute and relative error tolerance
| [in] | a | first floating point number to be compared |
| [in] | b | second floating point number to be compared |
| [in] | absTol | absolute tolerance for comparison |
| [in] | relTol | relative tolerance for comparison |
Definition at line 1435 of file VoxelIntersection.cpp.
| bool VoxelIntersection::approxSame | ( | helios::vec3 | a, |
| helios::vec3 | b, | ||
| float | absTol | ||
| ) |
compare two vec3's to within an absolute and relative error tolerance
| [in] | a | first vec3 to be compared |
| [in] | b | second vec3 to be compared |
| [in] | absTol | absolute tolerance for comparison |
Definition at line 1440 of file VoxelIntersection.cpp.
| void VoxelIntersection::calculatePrimitiveVoxelIntersection | ( | void | ) |
Calculate primitives that reside in all voxels for every primitive in the Context.
Definition at line 221 of file VoxelIntersection.cu.
| void VoxelIntersection::calculatePrimitiveVoxelIntersection | ( | std::vector< uint > | UUIDs | ) |
Calculate primitives that reside in all voxels for a subset of primitives in the Context.
| [in] | UUIDs | Unique universal identifiers for primitives (non-voxels) to include in intersection calculation |
Definition at line 225 of file VoxelIntersection.cu.
| void VoxelIntersection::disableMessages | ( | void | ) |
Disable output messages (enabled by default)
Definition at line 213 of file VoxelIntersection.cu.
| void VoxelIntersection::enableMessages | ( | void | ) |
Re-enable output messages.
Definition at line 217 of file VoxelIntersection.cu.
| std::vector< std::vector< uint > > VoxelIntersection::getCellPrimitives | ( | void | ) |
get 2D vector storing the UUIDs within each grid cell
Definition at line 1430 of file VoxelIntersection.cpp.
| helios::vec2 VoxelIntersection::interpolate_texture_UV_to_slice_point | ( | helios::vec3 | p1, |
| helios::vec2 | uv1, | ||
| helios::vec3 | p2, | ||
| helios::vec2 | uv2, | ||
| helios::vec3 | ps | ||
| ) |
find the uv coordinate of a slice point
| [in] | p1 | xyz coordinate of first vertex of the primitive edge that has the slice point on it |
| [in] | uv1 | uv coordinate of first vertex of the primitive edge that has the slice point on it |
| [in] | p2 | xyz coordinate of second vertex of the primitive edge that has the slice point on it |
| [in] | uv2 | uv coordinate of second vertex of the primitive edge that has the slice point on it |
| [in] | ps | xyz coordinate of the slice point |
Definition at line 1444 of file VoxelIntersection.cpp.
| helios::vec3 VoxelIntersection::linesIntersection | ( | helios::vec3 | line1_point, |
| helios::vec3 | line1_direction, | ||
| helios::vec3 | line2_point, | ||
| helios::vec3 | line2_direction | ||
| ) |
Calculate the intersection point of two lines.
| [in] | line1_point | point on the first line |
| [in] | line1_direction | direction vector of first line |
| [in] | line2_point | point on the second line |
| [in] | line2_direction | direction vector of second line |
Definition at line 46 of file VoxelIntersection.cpp.
|
static |
Self-test function (unit tests)
Definition at line 205 of file selfTest.cpp.
| std::vector< uint > VoxelIntersection::slicePrimitive | ( | uint | UUID, |
| std::vector< helios::vec3 > | voxel_face_vertices, | ||
| helios::WarningAggregator & | warnings | ||
| ) |
Slice a primitive (patch or triangle) into multiple triangles using a defined plane (often a voxel face)
| [in] | UUID | Unique universal identifier (UUID) of primitive to be sliced |
| [in] | voxel_face_vertices | a vector of at least 3 points on the plane that will be used to do the slicing |
| [in] | warnings | Reference to WarningAggregator for collecting warnings |
Definition at line 67 of file VoxelIntersection.cpp.
| std::vector< uint > VoxelIntersection::slicePrimitivesUsingGrid | ( | std::vector< uint > | UUIDs, |
| helios::vec3 | grid_center, | ||
| helios::vec3 | grid_size, | ||
| helios::int3 | grid_divisions | ||
| ) |
Slice a primitives based on a defined grid of voxels.
| [in] | UUIDs | vector of Unique universal identifiers (UUIDs) of primitives to be sliced |
| [in] | grid_center | coordinates of the center of the grid |
| [in] | grid_size | size of the grid in the x, y, z dimensions |
| [in] | grid_divisions | number of grid divisions in the x, y, and z dimensions |
Definition at line 1187 of file VoxelIntersection.cpp.