+//================================================================================
+/*!
+ * \brief Compute submesh
+ * \param sm - submesh
+ * \retval bool - is a success
+ */
+//================================================================================
+
+bool SMESH_Gen::Compute(::SMESH_subMesh& sm)
+{
+ if ( sm.GetSubShape().ShapeType() == TopAbs_VERTEX )
+ {
+ SMESHDS_SubMesh* smDS = sm.GetSubMeshDS();
+ if ( !smDS || !smDS->NbNodes() ) {
+ TopoDS_Vertex V = TopoDS::Vertex(sm.GetSubShape());
+ gp_Pnt P = BRep_Tool::Pnt(V);
+ SMESHDS_Mesh * meshDS = sm.GetFather()->GetMeshDS();
+ if ( SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z()) )
+ meshDS->SetNodeOnVertex(node, V);
+ }
+ }
+ return sm.ComputeStateEngine(SMESH_subMesh::COMPUTE);
+}
+