MCPcopy Create free account
hub / github.com/Kitware/VTK / Classify

Method Classify

Filters/FlowPaths/vtkModifiedBSPTree.cxx:1067–1101  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////// BSPNode routines /////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

1065// BSPNode routines
1066//////////////////////////////////////////////////////////////////////////////
1067void BSPNode::Classify(const double origin[3], const double dir[3], double& rDist, BSPNode*& Near,
1068 BSPNode*& Mid, BSPNode*& Far) const
1069{
1070 double tOriginToDivPlane = mChild[0]->Bounds[mAxis * 2 + 1] - origin[mAxis];
1071 double tDivDirection = dir[mAxis];
1072 if (tOriginToDivPlane > 0)
1073 {
1074 Near = mChild[0];
1075 Mid = mChild[1];
1076 Far = mChild[2];
1077 }
1078 else if (tOriginToDivPlane < 0)
1079 {
1080 Far = mChild[0];
1081 Mid = mChild[1];
1082 Near = mChild[2];
1083 }
1084 // Ray was exactly on edge of box, check direction
1085 else
1086 {
1087 if (tDivDirection < 0)
1088 {
1089 Near = mChild[0];
1090 Mid = mChild[1];
1091 Far = mChild[2];
1092 }
1093 else
1094 {
1095 Far = mChild[0];
1096 Mid = mChild[1];
1097 Near = mChild[2];
1098 }
1099 }
1100 rDist = (tDivDirection) ? tOriginToDivPlane / tDivDirection : VTK_FLOAT_MAX;
1101}
1102
1103//------------------------------------------------------------------------------
1104bool BSPNode::Inside(double point[3]) const

Callers 1

IntersectWithLineMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected