-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESHDS : management of mesh data and SMESH document
//================================================================================
/*!
* \brief Store ID persistent during lifecycle
+ *
+ * Initially it was used to have a persistent reference to the mesh from the hypothesis
*/
//================================================================================
return empty;
}
+//================================================================================
+/*!
+ * \brief returns true if the hypothesis is assigned to any sub-shape
+ */
+//================================================================================
+
+bool SMESHDS_Mesh::IsUsedHypothesis(const SMESHDS_Hypothesis * H) const
+{
+ ShapeToHypothesis::Iterator s2h( myShapeToHypothesis );
+ for ( ; s2h.More(); s2h.Next() )
+ if ( std::find( s2h.Value().begin(), s2h.Value().end(), H ) != s2h.Value().end() )
+ return true;
+ return false;
+}
+
//=======================================================================
//function : GetScript
//purpose :
}
+void SMESHDS_Mesh::CleanDownWardConnectivity()
+{
+ myGrid->CleanDownwardConnectivity();
+}
+
void SMESHDS_Mesh::BuildDownWardConnectivity(bool withEdges)
{
myGrid->BuildDownwardConnectivity(withEdges);
myGrid->ModifyCellNodes(vtkVolId, localClonedNodeIds);
return true;
}
-
-/*! Create a volume (prism or hexahedron) by duplication of a face.
- * the nodes of the new face are already created.
- * @param vtkVolId vtk id of a volume containing the face, to get an orientation for the face.
- * @param localClonedNodeIds map old node id to new node id. The old nodes define the face in the volume.
- * @return ok if success.
- */
-bool SMESHDS_Mesh::extrudeVolumeFromFace(int vtkVolId, std::map<int,int>& localClonedNodeIds)
-{
- //MESSAGE("extrudeVolumeFromFace " << vtkVolId);
- vector<vtkIdType> orderedNodes;
- orderedNodes.clear();
- map<int, int>::const_iterator it = localClonedNodeIds.begin();
- for (; it != localClonedNodeIds.end(); ++it)
- orderedNodes.push_back(it->first);
-
- int nbNodes = myGrid->getOrderedNodesOfFace(vtkVolId, orderedNodes);
- for (int i=0; i<nbNodes; i++)
- orderedNodes.push_back(localClonedNodeIds[orderedNodes[i]]);
- SMDS_MeshVolume *vol = this->AddVolumeFromVtkIds(orderedNodes);
-
- // TODO update subshape list of elements and nodes
- return vol;
-}