1 // SMESH SMESH : implementaion of SMESH idl descriptions
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 // File : SMESH_Gen.cxx
25 // Author : Paul RASCLE, EDF
29 #include "SMESH_Gen.hxx"
30 #include "SMESH_subMesh.hxx"
31 #include "SMESH_HypoFilter.hxx"
32 #include "SMESHDS_Document.hxx"
33 #include "SMDS_MeshElement.hxx"
34 #include "SMDS_MeshNode.hxx"
36 #include "utilities.h"
38 #include "Utils_ExceptHandlers.hxx"
41 #include <BRep_Tool.hxx>
42 #include <TopTools_ListOfShape.hxx>
43 #include <TopTools_ListIteratorOfListOfShape.hxx>
47 //=============================================================================
49 * default constructor:
51 //=============================================================================
53 SMESH_Gen::SMESH_Gen()
55 MESSAGE("SMESH_Gen::SMESH_Gen");
60 //=============================================================================
64 //=============================================================================
66 SMESH_Gen::~SMESH_Gen()
68 MESSAGE("SMESH_Gen::~SMESH_Gen");
71 //=============================================================================
75 //=============================================================================
77 /*SMESH_Hypothesis *SMESH_Gen::CreateHypothesis(const char *anHyp, int studyId)
78 throw(SALOME_Exception)
81 MESSAGE("CreateHypothesis("<<anHyp<<","<<studyId<<")");
82 // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
84 StudyContextStruct *myStudyContext = GetStudyContext(studyId);
86 // create a new hypothesis object, store its ref. in studyContext
88 SMESH_Hypothesis *myHypothesis = _hypothesisFactory.Create(anHyp, studyId);
89 int hypId = myHypothesis->GetID();
90 myStudyContext->mapHypothesis[hypId] = myHypothesis;
94 // store hypothesis in SMESHDS document
96 myStudyContext->myDocument->AddHypothesis(myHypothesis);
100 //=============================================================================
104 //=============================================================================
106 SMESH_Mesh* SMESH_Gen::CreateMesh(int theStudyId, bool theIsEmbeddedMode)
107 throw(SALOME_Exception)
109 Unexpect aCatch(SalomeException);
110 MESSAGE("SMESH_Gen::CreateMesh");
112 // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
113 StudyContextStruct *aStudyContext = GetStudyContext(theStudyId);
115 // create a new SMESH_mesh object
116 SMESH_Mesh *aMesh = new SMESH_Mesh(_localId++,
120 aStudyContext->myDocument);
121 aStudyContext->mapMesh[_localId] = aMesh;
126 //=============================================================================
130 //=============================================================================
132 bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
133 const TopoDS_Shape & aShape,
135 const ::MeshDimension aDim,
136 TSetOfInt* aShapesId)
138 MESSAGE("SMESH_Gen::Compute");
142 SMESH_subMesh *sm = aMesh.GetSubMesh(aShape);
144 const bool includeSelf = true;
145 const bool complexShapeFirst = true;
147 SMESH_subMeshIteratorPtr smIt;
149 if ( anUpward ) // is called from below code here
151 // -----------------------------------------------
152 // mesh all the subshapes starting from vertices
153 // -----------------------------------------------
154 smIt = sm->getDependsOnIterator(includeSelf, !complexShapeFirst);
155 while ( smIt->more() )
157 SMESH_subMesh* smToCompute = smIt->next();
159 // do not mesh vertices of a pseudo shape
160 const TopAbs_ShapeEnum aShType = smToCompute->GetSubShape().ShapeType();
161 if ( !aMesh.HasShapeToMesh() && aShType == TopAbs_VERTEX )
164 // check for preview dimension limitations
165 if ( aShapesId && GetShapeDim( aShType ) > (int)aDim )
167 // clear compute state to not show previous compute errors
168 // if preview invoked less dimension less than previous
169 smToCompute->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
173 if (smToCompute->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
174 smToCompute->ComputeStateEngine( SMESH_subMesh::COMPUTE );
176 // we check all the submeshes here and detect if any of them failed to compute
177 if (smToCompute->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE)
179 else if ( aShapesId )
180 aShapesId->insert( smToCompute->GetId() );
186 // -----------------------------------------------------------------
187 // apply algos that DO NOT require descretized boundaries and DO NOT
188 // support submeshes, starting from the most complex shapes
189 // and collect submeshes with algos that DO support submeshes
190 // -----------------------------------------------------------------
191 list< SMESH_subMesh* > smWithAlgoSupportingSubmeshes;
192 smIt = sm->getDependsOnIterator(includeSelf, complexShapeFirst);
193 while ( smIt->more() )
195 SMESH_subMesh* smToCompute = smIt->next();
196 if ( smToCompute->GetComputeState() != SMESH_subMesh::READY_TO_COMPUTE )
199 const TopoDS_Shape& aSubShape = smToCompute->GetSubShape();
200 const int aShapeDim = GetShapeDim( aSubShape );
201 if ( aShapeDim < 1 ) break;
203 // check for preview dimension limitations
204 if ( aShapesId && aShapeDim > (int)aDim )
207 SMESH_Algo* algo = GetAlgo( aMesh, aSubShape );
208 if ( algo && !algo->NeedDescretBoundary() )
210 if ( algo->SupportSubmeshes() )
211 smWithAlgoSupportingSubmeshes.push_back( smToCompute );
214 smToCompute->ComputeStateEngine( SMESH_subMesh::COMPUTE );
216 aShapesId->insert( smToCompute->GetId() );
220 // ------------------------------------------------------------
221 // compute submeshes under shapes with algos that DO NOT require
222 // descretized boundaries and DO support submeshes
223 // ------------------------------------------------------------
224 list< SMESH_subMesh* >::reverse_iterator subIt, subEnd;
225 subIt = smWithAlgoSupportingSubmeshes.rbegin();
226 subEnd = smWithAlgoSupportingSubmeshes.rend();
227 // start from lower shapes
228 for ( ; subIt != subEnd; ++subIt )
232 // get a shape the algo is assigned to
233 TopoDS_Shape algoShape;
234 if ( !GetAlgo( aMesh, sm->GetSubShape(), & algoShape ))
235 continue; // strange...
237 // look for more local algos
238 smIt = sm->getDependsOnIterator(!includeSelf, !complexShapeFirst);
239 while ( smIt->more() )
241 SMESH_subMesh* smToCompute = smIt->next();
243 const TopoDS_Shape& aSubShape = smToCompute->GetSubShape();
244 const int aShapeDim = GetShapeDim( aSubShape );
245 //if ( aSubShape.ShapeType() == TopAbs_VERTEX ) continue;
246 if ( aShapeDim < 1 ) continue;
248 // check for preview dimension limitations
249 if ( aShapesId && GetShapeDim( aSubShape.ShapeType() ) > (int)aDim )
252 SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
254 .And( SMESH_HypoFilter::IsApplicableTo( aSubShape ))
255 .And( SMESH_HypoFilter::IsMoreLocalThan( algoShape ));
257 if ( SMESH_Algo* subAlgo = (SMESH_Algo*) aMesh.GetHypothesis( aSubShape, filter, true )) {
258 SMESH_Hypothesis::Hypothesis_Status status;
259 if ( subAlgo->CheckHypothesis( aMesh, aSubShape, status ))
260 // mesh a lower smToCompute starting from vertices
261 Compute( aMesh, aSubShape, /*anUpward=*/true, aDim, aShapesId );
265 // ----------------------------------------------------------
266 // apply the algos that do not require descretized boundaries
267 // ----------------------------------------------------------
268 for ( subIt = smWithAlgoSupportingSubmeshes.rbegin(); subIt != subEnd; ++subIt )
269 if ( sm->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
271 const TopAbs_ShapeEnum aShType = sm->GetSubShape().ShapeType();
272 // check for preview dimension limitations
273 if ( aShapesId && GetShapeDim( aShType ) > (int)aDim )
276 sm->ComputeStateEngine( SMESH_subMesh::COMPUTE );
278 aShapesId->insert( sm->GetId() );
281 // -----------------------------------------------
282 // mesh the rest subshapes starting from vertices
283 // -----------------------------------------------
284 ret = Compute( aMesh, aShape, /*anUpward=*/true, aDim, aShapesId );
287 MESSAGE( "VSR - SMESH_Gen::Compute() finished, OK = " << ret);
291 //=======================================================================
292 //function : checkConformIgnoredAlgos
294 //=======================================================================
296 static bool checkConformIgnoredAlgos(SMESH_Mesh& aMesh,
297 SMESH_subMesh* aSubMesh,
298 const SMESH_Algo* aGlobIgnoAlgo,
299 const SMESH_Algo* aLocIgnoAlgo,
301 map<int, SMESH_subMesh*>& aCheckedMap,
302 list< SMESH_Gen::TAlgoStateError > & theErrors)
305 if ( aSubMesh->GetSubShape().ShapeType() == TopAbs_VERTEX)
311 const list<const SMESHDS_Hypothesis*>& listHyp =
312 aMesh.GetMeshDS()->GetHypothesis( aSubMesh->GetSubShape() );
313 list<const SMESHDS_Hypothesis*>::const_iterator it=listHyp.begin();
314 for ( ; it != listHyp.end(); it++)
316 const SMESHDS_Hypothesis * aHyp = *it;
317 if (aHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO)
320 const SMESH_Algo* algo = dynamic_cast<const SMESH_Algo*> (aHyp);
323 if ( aLocIgnoAlgo ) // algo is hidden by a local algo of upper dim
325 INFOS( "Local <" << algo->GetName() << "> is hidden by local <"
326 << aLocIgnoAlgo->GetName() << ">");
330 bool isGlobal = (aMesh.IsMainShape( aSubMesh->GetSubShape() ));
331 int dim = algo->GetDim();
332 int aMaxGlobIgnoDim = ( aGlobIgnoAlgo ? aGlobIgnoAlgo->GetDim() : -1 );
334 if ( dim < aMaxGlobIgnoDim )
336 // algo is hidden by a global algo
337 INFOS( ( isGlobal ? "Global" : "Local" )
338 << " <" << algo->GetName() << "> is hidden by global <"
339 << aGlobIgnoAlgo->GetName() << ">");
341 else if ( !algo->NeedDescretBoundary() && !isGlobal)
343 // local algo is not hidden and hides algos on sub-shapes
344 if (checkConform && !aSubMesh->IsConform( algo ))
347 checkConform = false; // no more check conformity
348 INFOS( "ERROR: Local <" << algo->GetName() <<
349 "> would produce not conform mesh: "
350 "<Not Conform Mesh Allowed> hypotesis is missing");
351 theErrors.push_back( SMESH_Gen::TAlgoStateError() );
352 theErrors.back().Set( SMESH_Hypothesis::HYP_NOTCONFORM, algo, false );
355 // sub-algos will be hidden by a local <algo>
356 const map<int, SMESH_subMesh*>& smMap = aSubMesh->DependsOn();
357 map<int, SMESH_subMesh*>::const_reverse_iterator revItSub;
358 bool checkConform2 = false;
359 for ( revItSub = smMap.rbegin(); revItSub != smMap.rend(); revItSub++)
361 checkConformIgnoredAlgos (aMesh, (*revItSub).second, aGlobIgnoAlgo,
362 algo, checkConform2, aCheckedMap, theErrors);
363 int key = (*revItSub).first;
364 SMESH_subMesh* sm = (*revItSub).second;
365 if ( aCheckedMap.find( key ) == aCheckedMap.end() )
367 aCheckedMap[ key ] = sm;
377 //=======================================================================
378 //function : checkMissing
379 //purpose : notify on missing hypothesis
380 // Return false if algo or hipothesis is missing
381 //=======================================================================
383 static bool checkMissing(SMESH_Gen* aGen,
385 SMESH_subMesh* aSubMesh,
386 const int aTopAlgoDim,
388 const bool checkNoAlgo,
389 map<int, SMESH_subMesh*>& aCheckedMap,
390 list< SMESH_Gen::TAlgoStateError > & theErrors)
392 if ( aSubMesh->GetSubShape().ShapeType() == TopAbs_VERTEX)
395 //MESSAGE("=====checkMissing");
398 SMESH_Algo* algo = 0;
400 switch (aSubMesh->GetAlgoState())
402 case SMESH_subMesh::NO_ALGO: {
405 // should there be any algo?
406 int shapeDim = SMESH_Gen::GetShapeDim( aSubMesh->GetSubShape() );
407 if (aTopAlgoDim > shapeDim)
409 MESSAGE( "ERROR: " << shapeDim << "D algorithm is missing" );
411 theErrors.push_back( SMESH_Gen::TAlgoStateError() );
412 theErrors.back().Set( SMESH_Hypothesis::HYP_MISSING, shapeDim, true );
417 case SMESH_subMesh::MISSING_HYP: {
418 // notify if an algo missing hyp is attached to aSubMesh
419 algo = aGen->GetAlgo( aMesh, aSubMesh->GetSubShape() );
421 bool IsGlobalHypothesis = aGen->IsGlobalHypothesis( algo, aMesh );
422 if (!IsGlobalHypothesis || !globalChecked[ algo->GetDim() ])
424 TAlgoStateErrorName errName = SMESH_Hypothesis::HYP_MISSING;
425 SMESH_Hypothesis::Hypothesis_Status status;
426 algo->CheckHypothesis( aMesh, aSubMesh->GetSubShape(), status );
427 if ( status == SMESH_Hypothesis::HYP_BAD_PARAMETER ) {
428 MESSAGE( "ERROR: hypothesis of " << (IsGlobalHypothesis ? "Global " : "Local ")
429 << "<" << algo->GetName() << "> has a bad parameter value");
431 } else if ( status == SMESH_Hypothesis::HYP_BAD_GEOMETRY ) {
432 MESSAGE( "ERROR: " << (IsGlobalHypothesis ? "Global " : "Local ")
433 << "<" << algo->GetName() << "> assigned to mismatching geometry");
436 MESSAGE( "ERROR: " << (IsGlobalHypothesis ? "Global " : "Local ")
437 << "<" << algo->GetName() << "> misses some hypothesis");
439 if (IsGlobalHypothesis)
440 globalChecked[ algo->GetDim() ] = true;
441 theErrors.push_back( SMESH_Gen::TAlgoStateError() );
442 theErrors.back().Set( errName, algo, IsGlobalHypothesis );
447 case SMESH_subMesh::HYP_OK:
448 algo = aGen->GetAlgo( aMesh, aSubMesh->GetSubShape() );
454 // do not check under algo that hides sub-algos or
455 // re-start checking NO_ALGO state
457 bool isTopLocalAlgo =
458 ( aTopAlgoDim <= algo->GetDim() && !aGen->IsGlobalHypothesis( algo, aMesh ));
459 if (!algo->NeedDescretBoundary() || isTopLocalAlgo)
461 bool checkNoAlgo2 = ( algo->NeedDescretBoundary() );
462 const map<int, SMESH_subMesh*>& subMeshes = aSubMesh->DependsOn();
463 map<int, SMESH_subMesh*>::const_iterator itsub;
464 for (itsub = subMeshes.begin(); itsub != subMeshes.end(); itsub++)
466 // sub-meshes should not be checked further more
467 int key = (*itsub).first;
468 SMESH_subMesh* sm = (*itsub).second;
469 if ( aCheckedMap.find( key ) == aCheckedMap.end() )
470 aCheckedMap[ key ] = sm;
474 //check algo on sub-meshes
475 int aTopAlgoDim2 = algo->GetDim();
476 if (!checkMissing (aGen, aMesh, sm, aTopAlgoDim2,
477 globalChecked, checkNoAlgo2, aCheckedMap, theErrors))
480 if (sm->GetAlgoState() == SMESH_subMesh::NO_ALGO )
481 checkNoAlgo2 = false;
489 //=======================================================================
490 //function : CheckAlgoState
491 //purpose : notify on bad state of attached algos, return false
492 // if Compute() would fail because of some algo bad state
493 //=======================================================================
495 bool SMESH_Gen::CheckAlgoState(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
497 list< TAlgoStateError > errors;
498 return GetAlgoState( aMesh, aShape, errors );
501 //=======================================================================
502 //function : GetAlgoState
503 //purpose : notify on bad state of attached algos, return false
504 // if Compute() would fail because of some algo bad state
505 // theErrors list contains problems description
506 //=======================================================================
508 bool SMESH_Gen::GetAlgoState(SMESH_Mesh& theMesh,
509 const TopoDS_Shape& theShape,
510 list< TAlgoStateError > & theErrors)
512 //MESSAGE("SMESH_Gen::CheckAlgoState");
515 bool hasAlgo = false;
517 SMESH_subMesh* sm = theMesh.GetSubMesh(theShape);
518 const SMESHDS_Mesh* meshDS = theMesh.GetMeshDS();
519 TopoDS_Shape mainShape = meshDS->ShapeToMesh();
525 const SMESH_Algo* aGlobAlgoArr[] = {0,0,0,0};
527 const list<const SMESHDS_Hypothesis*>& listHyp = meshDS->GetHypothesis( mainShape );
528 list<const SMESHDS_Hypothesis*>::const_iterator it=listHyp.begin();
529 for ( ; it != listHyp.end(); it++)
531 const SMESHDS_Hypothesis * aHyp = *it;
532 if (aHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO)
535 const SMESH_Algo* algo = dynamic_cast<const SMESH_Algo*> (aHyp);
538 int dim = algo->GetDim();
539 aGlobAlgoArr[ dim ] = algo;
544 // --------------------------------------------------------
545 // info on algos that will be ignored because of ones that
546 // don't NeedDescretBoundary() attached to super-shapes,
547 // check that a conform mesh will be produced
548 // --------------------------------------------------------
551 // find a global algo possibly hiding sub-algos
553 const SMESH_Algo* aGlobIgnoAlgo = 0;
554 for (dim = 3; dim > 0; dim--)
556 if (aGlobAlgoArr[ dim ] &&
557 !aGlobAlgoArr[ dim ]->NeedDescretBoundary())
559 aGlobIgnoAlgo = aGlobAlgoArr[ dim ];
564 const map<int, SMESH_subMesh*>& smMap = sm->DependsOn();
565 map<int, SMESH_subMesh*>::const_reverse_iterator revItSub = smMap.rbegin();
566 map<int, SMESH_subMesh*> aCheckedMap;
567 bool checkConform = ( !theMesh.IsNotConformAllowed() );
569 SMESH_subMesh* smToCheck = sm;
571 // loop on theShape and its sub-shapes
574 if ( smToCheck->GetSubShape().ShapeType() == TopAbs_VERTEX)
577 if ( aCheckedMap.find( aKey ) == aCheckedMap.end() )
578 if (!checkConformIgnoredAlgos (theMesh, smToCheck, aGlobIgnoAlgo,
579 0, checkConform, aCheckedMap, theErrors))
582 if ( smToCheck->GetAlgoState() != SMESH_subMesh::NO_ALGO )
586 if (revItSub != smMap.rend())
588 aKey = (*revItSub).first;
589 smToCheck = (*revItSub).second;
599 // ----------------------------------------------------------------
600 // info on missing hypothesis and find out if all needed algos are
602 // ----------------------------------------------------------------
604 //MESSAGE( "---info on missing hypothesis and find out if all needed algos are");
606 // find max dim of global algo
608 for (dim = 3; dim > 0; dim--)
610 if (aGlobAlgoArr[ dim ])
618 revItSub = smMap.rbegin();
619 bool checkNoAlgo = theMesh.HasShapeToMesh() ? bool( aTopAlgoDim ) : false;
620 bool globalChecked[] = { false, false, false, false };
622 // loop on theShape and its sub-shapes
625 if ( smToCheck->GetSubShape().ShapeType() == TopAbs_VERTEX)
628 if ( aCheckedMap.find( aKey ) == aCheckedMap.end() )
629 if (!checkMissing (this, theMesh, smToCheck, aTopAlgoDim,
630 globalChecked, checkNoAlgo, aCheckedMap, theErrors))
633 if (smToCheck->GetAlgoState() == SMESH_subMesh::NO_ALGO )
638 if (revItSub != smMap.rend())
640 aKey = (*revItSub).first;
641 smToCheck = (*revItSub).second;
650 INFOS( "None algorithm attached" );
651 theErrors.push_back( TAlgoStateError() );
652 theErrors.back().Set( SMESH_Hypothesis::HYP_MISSING, 1, true );
658 //=======================================================================
659 //function : IsGlobalHypothesis
660 //purpose : check if theAlgo is attached to the main shape
661 //=======================================================================
663 bool SMESH_Gen::IsGlobalHypothesis(const SMESH_Hypothesis* theHyp, SMESH_Mesh& aMesh)
665 SMESH_HypoFilter filter( SMESH_HypoFilter::Is( theHyp ));
666 return aMesh.GetHypothesis( aMesh.GetMeshDS()->ShapeToMesh(), filter, false );
669 //=============================================================================
673 //=============================================================================
675 SMESH_Algo *SMESH_Gen::GetAlgo(SMESH_Mesh & aMesh,
676 const TopoDS_Shape & aShape,
677 TopoDS_Shape* assignedTo)
680 SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
681 filter.And( filter.IsApplicableTo( aShape ));
683 return (SMESH_Algo*) aMesh.GetHypothesis( aShape, filter, true, assignedTo );
686 //=============================================================================
690 //=============================================================================
692 StudyContextStruct *SMESH_Gen::GetStudyContext(int studyId)
694 // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
696 if (_mapStudyContext.find(studyId) == _mapStudyContext.end())
698 _mapStudyContext[studyId] = new StudyContextStruct;
699 _mapStudyContext[studyId]->myDocument = new SMESHDS_Document(studyId);
701 StudyContextStruct *myStudyContext = _mapStudyContext[studyId];
702 // ASSERT(_mapStudyContext.find(studyId) != _mapStudyContext.end());
703 return myStudyContext;
706 //=============================================================================
710 //=============================================================================
712 void SMESH_Gen::Save(int studyId, const char *aUrlOfFile)
716 //=============================================================================
720 //=============================================================================
722 void SMESH_Gen::Load(int studyId, const char *aUrlOfFile)
726 //=============================================================================
730 //=============================================================================
732 void SMESH_Gen::Close(int studyId)
736 //=============================================================================
740 //=============================================================================
742 int SMESH_Gen::GetShapeDim(const TopAbs_ShapeEnum & aShapeType)
744 static vector<int> dim;
747 dim.resize( TopAbs_SHAPE, -1 );
748 dim[ TopAbs_COMPOUND ] = MeshDim_3D;
749 dim[ TopAbs_COMPSOLID ] = MeshDim_3D;
750 dim[ TopAbs_SOLID ] = MeshDim_3D;
751 dim[ TopAbs_SHELL ] = MeshDim_3D;
752 dim[ TopAbs_FACE ] = MeshDim_2D;
753 dim[ TopAbs_WIRE ] = MeshDim_1D;
754 dim[ TopAbs_EDGE ] = MeshDim_1D;
755 dim[ TopAbs_VERTEX ] = MeshDim_0D;
757 return dim[ aShapeType ];
760 //=============================================================================
764 //=============================================================================
766 int SMESH_Gen::GetANewId()
768 //MESSAGE("SMESH_Gen::GetANewId");