----------------------------------------------------------------------------------------------
| 923 | |
| 924 | //---------------------------------------------------------------------------------------------- |
| 925 | bool vtkHyperTreeGridGeometry3DImpl::GetHasInterface(vtkIdType cellId) const |
| 926 | { |
| 927 | // Only useful in 3D, this method makes it possible to know if the neighboring cell |
| 928 | // of _inputCellIndex offset is pure or describes an interface. |
| 929 | // It is pure if: |
| 930 | // - there is no defined interface (m_hasInterface); |
| 931 | // - there is no description of the interfaces (m_inputIntercepts); |
| 932 | // - there is a description of the interfaces but the mixed cell type is not 2 |
| 933 | // (pure cell) (m_inputIntercepts[2]); -1 and 1 describes a case of a mixed |
| 934 | // cell of a material with a single interface, 0 a case of a mixed cell of a |
| 935 | // material with a double interface; |
| 936 | // - there is no description of the normals (m_inputNormals); |
| 937 | // - there is a description of the normals but not zero. |
| 938 | if (cellId < 0) |
| 939 | { |
| 940 | return false; |
| 941 | } |
| 942 | if (!this->HasInterface) |
| 943 | { |
| 944 | return false; |
| 945 | } |
| 946 | |
| 947 | bool ret = |
| 948 | (this->InIntercepts && ((this->InIntercepts->GetTuple(cellId))[2] < 2) && this->InNormals); |
| 949 | if (ret) |
| 950 | { |
| 951 | double* normal = this->InNormals->GetTuple(cellId); |
| 952 | ret = !(normal[0] == 0. && normal[1] == 0. && normal[2] == 0.); |
| 953 | } |
| 954 | return ret; |
| 955 | } |
| 956 | |
| 957 | VTK_ABI_NAMESPACE_END |