Package cz.fidentis.analyst.data.octree
Interface OctNode
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
OctNodeImpl
,OctNodeInner
,OctNodeLeaf
A single node of an Octree. Sharing vertices across meshes is supported (the
node links all faces that share the same vertex).
-
Method Summary
Modifier and TypeMethodDescriptiongetChild
(javax.vecmath.Point3d point) Returns a child node in which a given 3D point is located.javax.vecmath.Point3d
returns boundary box - corner with the smallest coordinates.getOctant
(int index) Returns a child node (octant) under specific indexReturns triangles which this oct node holdsjavax.vecmath.Point3d
returns boundary box - corner with the largest coordinates.boolean
Returnstrue
if the node is a leave node.boolean
isPointInside
(javax.vecmath.Point3d point) Checks if a 3D point lies inside the cubejavax.vecmath.Point3d
rayIntersection
(Ray ray) Calculates the intersection of a ray with this node.
-
Method Details
-
isLeafNode
boolean isLeafNode()Returnstrue
if the node is a leave node.- Returns:
true
if the node is a leave node.
-
getOctant
Returns a child node (octant) under specific index- Parameters:
index
- index of the octant returned. Must be between 0 and 7 including.- Returns:
- Octant under specific index
-
getChild
Returns a child node in which a given 3D point is located. If the point lies on the dividing planes of the cube, then the "lower" child (octant) is returned. If this node is leaf, thenull
is returned. It is supposed that the point is inside (or at the boundary) of the node's bounding cube (seeisPointInside(javax.vecmath.Point3d)
).- Parameters:
point
- point, must not benull
- Returns:
- Child node or
null
-
getTriangles
List<MeshTriangle> getTriangles()Returns triangles which this oct node holds- Returns:
- triangles which this oct node holds
-
getLowerBound
javax.vecmath.Point3d getLowerBound()returns boundary box - corner with the smallest coordinates.- Returns:
- boundary box - corner with the smallest coordinates.
-
getUpperBound
javax.vecmath.Point3d getUpperBound()returns boundary box - corner with the largest coordinates.- Returns:
- boundary box - corner with the largest coordinates.
-
isPointInside
boolean isPointInside(javax.vecmath.Point3d point) Checks if a 3D point lies inside the cube- Parameters:
point
- A 3D point to be checked. Must not benull
.- Returns:
true
if thepoint
is inside the node.
-
rayIntersection
Calculates the intersection of a ray with this node. If the ray's origin is inside the node's cube, then the second (leaving) intersection is returned. Otherwise, the first (entering) intersection is returned.- Parameters:
ray
- Ray- Returns:
- returns the intersection in the direction of the ray
- Throws:
NullPointerException
- if theray
isnull
-