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

Method CreateChildNodes

Common/DataModel/vtkOctreePointLocatorNode.cxx:42–74  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

40
41//------------------------------------------------------------------------------
42void vtkOctreePointLocatorNode::CreateChildNodes()
43{
44 if (!this->Children)
45 {
46 int i;
47 double midpoint[3];
48 for (i = 0; i < 3; i++)
49 {
50 midpoint[i] = (this->MinBounds[i] + this->MaxBounds[i]) * .5;
51 }
52 this->Children = new vtkOctreePointLocatorNode*[8];
53 for (i = 0; i < 8; i++)
54 {
55 this->Children[i] = vtkOctreePointLocatorNode::New();
56 double NewMin[3], NewMax[3];
57 for (int j = 0; j < 3; j++)
58 {
59 if (!((i >> j) & 1))
60 {
61 NewMin[j] = this->MinBounds[j];
62 NewMax[j] = midpoint[j];
63 }
64 else
65 {
66 NewMin[j] = midpoint[j];
67 NewMax[j] = this->MaxBounds[j];
68 }
69 }
70 this->Children[i]->SetMinBounds(NewMin);
71 this->Children[i]->SetMaxBounds(NewMax);
72 }
73 }
74}
75
76//------------------------------------------------------------------------------
77void vtkOctreePointLocatorNode::DeleteChildNodes()

Callers

nothing calls this directly

Calls 3

SetMinBoundsMethod · 0.80
SetMaxBoundsMethod · 0.80
NewFunction · 0.50

Tested by

no test coverage detected