CellexalVR  1.1.0
A virtual reality platform for the exploration and analysis of single-cell gene expression data
CellexalVR.AnalysisObjects.Graph.OctreeNode Class Reference

Private class to represent one node in the octree used for collision detection More...

Public Member Functions

override string ToString ()
 Returns a string representation of this node and all its children. May produce very long strings for very large trees. More...
 
void ChangeGroupRecursively (int group)
 Changes the group of this node and all of its children (and grand-children and so on) recursively. More...
 
List< OctreeNodeGetSkeletonNodesRecursive (OctreeNode node, List< OctreeNode > nodes=null, int currentNodeLevel=0, int desiredNodeLevel=0)
 
OctreeNode NodeContainingPoint (Vector3 point)
 Returns the smallest node that contains a point. The retured node might not be a leaf. More...
 
bool PointInside (Vector3 point)
 Checks if a point is inside this node. More...
 
bool PointInsideSelectionTool (Vector3 selectionToolCenter, Vector3 pointPosWorldSpace)
 Checks if a point is inside the selection tool by raycasting. More...
 
bool PointInsideSphere (Vector3 sphereCenter, float sqrRadius)
 Checks if this point is inside a sphere. More...
 
void ResetIteration ()
 Sets NodeIterated to false for this node and all of its children recursively. More...
 
OctreeNode FirstLeafNotIterated ()
 Finds the first leaf node (using depth first) that has NodeIterated == false. Returns null if no non-iterated node was found. More...
 
List< OctreeNodeAllLeavesUnder (bool includeIterated=true)
 Returns a List<OctreeNode> all leaves that are under this node in the octree. More...
 

Public Attributes

OctreeNode parent
 
OctreeNode[] children
 Not always of length 8. Empty children are removed when the octree is constructed to save some memory. More...
 
GraphPoint point
 Null if this is not a leaf. Only leaves represents points in the graph. More...
 
Vector3 pos
 
Vector3 center
 Not the geometrical center, just a point inside the node that defines corners for its children, unless this is a leaf node. More...
 
Vector3 size
 
bool rejected
 
bool completelyInside
 

Properties

int Group [get, set]
 The group that this node belongs to. -1 means no group, 0 or a positive number means some group. If this is a leaf node, this should be the same as the group that the selection tool has given the GraphPoint. If this is not a leaf node, this is not -1 if all its children are of that group. More...
 
bool NodeIterated [get, set]
 

Detailed Description

Private class to represent one node in the octree used for collision detection

Member Function Documentation

◆ AllLeavesUnder()

List<OctreeNode> CellexalVR.AnalysisObjects.Graph.OctreeNode.AllLeavesUnder ( bool  includeIterated = true)

Returns a List<OctreeNode> all leaves that are under this node in the octree.

Parameters
includeIteratedTrue if nodes marked as iterated (OctreeNode.NodeIterated) should be included, false if they should not.

◆ ChangeGroupRecursively()

void CellexalVR.AnalysisObjects.Graph.OctreeNode.ChangeGroupRecursively ( int  group)

Changes the group of this node and all of its children (and grand-children and so on) recursively.

Parameters
groupThe new group.

◆ FirstLeafNotIterated()

OctreeNode CellexalVR.AnalysisObjects.Graph.OctreeNode.FirstLeafNotIterated ( )

Finds the first leaf node (using depth first) that has NodeIterated == false. Returns null if no non-iterated node was found.

◆ NodeContainingPoint()

OctreeNode CellexalVR.AnalysisObjects.Graph.OctreeNode.NodeContainingPoint ( Vector3  point)

Returns the smallest node that contains a point. The retured node might not be a leaf.

Parameters
pointThe point to look for a node around.
Returns
The that contains the point.

◆ PointInside()

bool CellexalVR.AnalysisObjects.Graph.OctreeNode.PointInside ( Vector3  point)

Checks if a point is inside this node.

◆ PointInsideSelectionTool()

bool CellexalVR.AnalysisObjects.Graph.OctreeNode.PointInsideSelectionTool ( Vector3  selectionToolCenter,
Vector3  pointPosWorldSpace 
)

Checks if a point is inside the selection tool by raycasting.

Parameters
selectionToolCenterThe selection tool's position in world space.
pointPosWorldSpaceThis node's position in world space. (use Transform.TransformPoint(node.splitCenter) )
Returns
True if this point is inside the selection tool.

◆ PointInsideSphere()

bool CellexalVR.AnalysisObjects.Graph.OctreeNode.PointInsideSphere ( Vector3  sphereCenter,
float  sqrRadius 
)

Checks if this point is inside a sphere.

Parameters
sphereCenterThe sphere's center point, in local coordinates.
radiusThe sphere's radius.
Returns
True if this point is inside the sphere. False otherwise.

◆ ResetIteration()

void CellexalVR.AnalysisObjects.Graph.OctreeNode.ResetIteration ( )

Sets NodeIterated to false for this node and all of its children recursively.

◆ ToString()

override string CellexalVR.AnalysisObjects.Graph.OctreeNode.ToString ( )

Returns a string representation of this node and all its children. May produce very long strings for very large trees.

Member Data Documentation

◆ center

Vector3 CellexalVR.AnalysisObjects.Graph.OctreeNode.center

Not the geometrical center, just a point inside the node that defines corners for its children, unless this is a leaf node.

◆ children

OctreeNode [] CellexalVR.AnalysisObjects.Graph.OctreeNode.children

Not always of length 8. Empty children are removed when the octree is constructed to save some memory.

◆ point

GraphPoint CellexalVR.AnalysisObjects.Graph.OctreeNode.point

Null if this is not a leaf. Only leaves represents points in the graph.

Property Documentation

◆ Group

int CellexalVR.AnalysisObjects.Graph.OctreeNode.Group
getset

The group that this node belongs to. -1 means no group, 0 or a positive number means some group. If this is a leaf node, this should be the same as the group that the selection tool has given the GraphPoint. If this is not a leaf node, this is not -1 if all its children are of that group.


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