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

Method ProbeForCellInterface

Filters/HyperTree/vtkHyperTreeGridGeometryImpl.cxx:98–183  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

96
97//----------------------------------------------------------------------------------------------
98bool vtkHyperTreeGridGeometryImpl::ProbeForCellInterface(vtkIdType cellId, bool invert)
99{
100 // This method determines if the cell with the cellId offset cell is a mixed cell
101 // and if so, its characteristics.
102 // Return :
103 // - if there is an interface on this cell (m_hasInterfaceOnThisCell);
104 // - the type of the mixed cell (m_cell_interface_type):
105 // - 2 is pure cell;
106 // - -1 is mixed cell with an interface plane describes by m_cell_intercepts[0]; normals is
107 // entering;
108 // - 0 is mixed cell with the double interfaces plane describe by m_cell_intercepts[0]
109 // and m_cell_intercepts[1];
110 // - 1 is mixed cell with an interface describes plane by m_cell_intercepts[1]; normals is
111 // outgoing;
112 // - the normals not zero; this same normals for all interfaces plane in the same mixed cell.
113 if (!this->HasInterface)
114 {
115 this->HasInterfaceOnThisCell = false;
116 this->CellInterfaceType = 2; // we consider pure cell
117 return false;
118 }
119 double* intercepts = this->InIntercepts->GetTuple(cellId);
120 if (intercepts == nullptr)
121 {
122 this->HasInterfaceOnThisCell = false;
123 this->CellInterfaceType = 2; // we consider pure cell
124 return false;
125 }
126 this->CellIntercepts[0] = intercepts[0];
127 this->CellIntercepts[1] = intercepts[1];
128 this->CellIntercepts[2] = intercepts[2];
129 this->CellInterfaceType = static_cast<int>(this->CellIntercepts[2]);
130 if (this->CellInterfaceType >= 2)
131 {
132 this->HasInterfaceOnThisCell = false;
133 this->CellInterfaceType = 2; // we consider pure cell
134 return false;
135 }
136 double* normal = this->InNormals->GetTuple(cellId);
137 if (normal == nullptr)
138 {
139 this->HasInterfaceOnThisCell = false;
140 this->CellInterfaceType = 2; // we consider pure cell
141 return false;
142 }
143 if (normal[0] == 0. && normal[1] == 0. && normal[2] == 0.)
144 {
145 this->HasInterfaceOnThisCell = false;
146 this->CellInterfaceType = 2; // we consider pure cell
147 return false;
148 }
149 this->CellNormals[0] = normal[0];
150 this->CellNormals[1] = normal[1];
151 this->CellNormals[2] = normal[2];
152 if (this->CellInterfaceType == 0)
153 {
154 double dD = this->CellIntercepts[1] - this->CellIntercepts[0];
155 if (!invert || dD >= 0)

Callers 2

GenerateCellSurfaceMethod · 0.80

Calls 1

GetTupleMethod · 0.45

Tested by

no test coverage detected