bool HexBC::insertPatchIfIdsExists(vtkSmartPointer<vtkIdList> ids) { bool foundIt=false; for(vtkIdType i=0; i<globalPatches->GetNumberOfItems(); i++) { HexPatch * p = HexPatch::SafeDownCast(globalPatches->GetItemAsObject(i)); if(p->equals(ids)) { localPatches->AddItem(p); foundIt=true; } } return foundIt; }
bool HexBC::insertPatchIfIdsExists(vtkSmartPointer<vtkIdList> ids) { bool foundIt=false; for(vtkIdType i=0;i<globalPatches->GetNumberOfItems();i++) { HexPatch * p = HexPatch::SafeDownCast(globalPatches->GetItemAsObject(i)); if(p->equals(ids)) { // std::cout << "patch exists " << i <<std::endl; patchIds->InsertUniqueId(i); foundIt=true; } } // for(vtkIdType i=0;i<allPatches->GetNumberOfItems();i++) // { // HexPatch * p = HexPatch::SafeDownCast(allPatches->GetItemAsObject(i)); // bool idsInP[4]; // //return true if all ids in ids exist in patch // for(vtkIdType j=0;j<ids->GetNumberOfIds();j++) // { // idsInP[j]=false; // for(vtkIdType k=0;p->vertIds->GetNumberOfIds();k++) // { // if(p->vertIds->GetId(k) == ids->GetId(j)) // { // idsInP[j]=true; // } // } // } // if(foundIt) // { // std::cout << "patches are equal, glbpatc" << i << std::endl; // patchIds->InsertNextId(i); // } // } return foundIt; }