Salome HOME
PAL17694 (New Tool About Hexahedral Meshing)
[modules/smesh.git] / src / SMESH / SMESH_Gen.cxx
1 //  SMESH SMESH : implementaion of SMESH idl descriptions
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //
23 //
24 //  File   : SMESH_Gen.cxx
25 //  Author : Paul RASCLE, EDF
26 //  Module : SMESH
27 //  $Header$
28
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"
35
36 #include "utilities.h"
37 #include "OpUtil.hxx"
38 #include "Utils_ExceptHandlers.hxx"
39
40 #include <gp_Pnt.hxx>
41 #include <BRep_Tool.hxx>
42 #include <TopTools_ListOfShape.hxx>
43 #include <TopTools_ListIteratorOfListOfShape.hxx>
44
45 using namespace std;
46
47 //=============================================================================
48 /*!
49  *  default constructor:
50  */
51 //=============================================================================
52
53 SMESH_Gen::SMESH_Gen()
54 {
55         MESSAGE("SMESH_Gen::SMESH_Gen");
56         _localId = 0;
57         _hypId = 0;
58 }
59
60 //=============================================================================
61 /*!
62  *
63  */
64 //=============================================================================
65
66 SMESH_Gen::~SMESH_Gen()
67 {
68         MESSAGE("SMESH_Gen::~SMESH_Gen");
69 }
70
71 //=============================================================================
72 /*!
73  *
74  */
75 //=============================================================================
76
77 /*SMESH_Hypothesis *SMESH_Gen::CreateHypothesis(const char *anHyp, int studyId)
78         throw(SALOME_Exception)
79 {
80
81         MESSAGE("CreateHypothesis("<<anHyp<<","<<studyId<<")");
82         // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
83
84         StudyContextStruct *myStudyContext = GetStudyContext(studyId);
85
86         // create a new hypothesis object, store its ref. in studyContext
87
88         SMESH_Hypothesis *myHypothesis = _hypothesisFactory.Create(anHyp, studyId);
89         int hypId = myHypothesis->GetID();
90         myStudyContext->mapHypothesis[hypId] = myHypothesis;
91         SCRUTE(studyId);
92         SCRUTE(hypId);
93
94         // store hypothesis in SMESHDS document
95
96         myStudyContext->myDocument->AddHypothesis(myHypothesis);
97         return myHypothesis;
98 }*/
99
100 //=============================================================================
101 /*!
102  *
103  */
104 //=============================================================================
105
106 SMESH_Mesh* SMESH_Gen::CreateMesh(int theStudyId, bool theIsEmbeddedMode)
107   throw(SALOME_Exception)
108 {
109   Unexpect aCatch(SalomeException);
110   MESSAGE("SMESH_Gen::CreateMesh");
111
112   // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
113   StudyContextStruct *aStudyContext = GetStudyContext(theStudyId);
114
115   // create a new SMESH_mesh object
116   SMESH_Mesh *aMesh = new SMESH_Mesh(_localId++,
117                                      theStudyId,
118                                      this,
119                                      theIsEmbeddedMode,
120                                      aStudyContext->myDocument);
121   aStudyContext->mapMesh[_localId] = aMesh;
122
123   return aMesh;
124 }
125
126 //=============================================================================
127 /*!
128  * Compute a mesh
129  */
130 //=============================================================================
131
132 bool SMESH_Gen::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape)
133 {
134   MESSAGE("SMESH_Gen::Compute");
135
136   bool ret = true;
137
138   SMESH_subMesh *sm = aMesh.GetSubMesh(aShape);
139
140   // -----------------------------------------------------------------
141   // apply algos that do not require descretized boundaries, starting
142   // from the most complex shapes
143   // -----------------------------------------------------------------
144
145   const bool includeSelf = true;
146   const bool complexShapeFirst = true;
147
148   SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(includeSelf,
149                                                            complexShapeFirst);
150   while ( smIt->more() )
151   {
152     SMESH_subMesh* smToCompute = smIt->next();
153
154     const TopoDS_Shape& aSubShape = smToCompute->GetSubShape();
155     if ( GetShapeDim( aSubShape ) < 1 ) break;
156
157     SMESH_Algo* algo = GetAlgo( aMesh, aSubShape );
158     if (algo && !algo->NeedDescretBoundary())
159     {
160       if (smToCompute->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
161         smToCompute->ComputeStateEngine( SMESH_subMesh::COMPUTE );
162
163       if (smToCompute->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE)
164         ret = false;;
165     }
166   }
167
168   // -----------------------------------------------
169   // mesh the rest subshapes starting from vertices
170   // -----------------------------------------------
171   smIt = sm->getDependsOnIterator(includeSelf, !complexShapeFirst);
172   while ( smIt->more() )
173   {
174     SMESH_subMesh* smToCompute = smIt->next();
175
176     if (smToCompute->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
177       smToCompute->ComputeStateEngine( SMESH_subMesh::COMPUTE );
178
179     if (smToCompute->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE)
180       ret = false;
181   }
182
183   MESSAGE( "VSR - SMESH_Gen::Compute() finished, OK = " << ret);
184   return ret;
185 }
186
187 //=======================================================================
188 //function : checkConformIgnoredAlgos
189 //purpose  :
190 //=======================================================================
191
192 static bool checkConformIgnoredAlgos(SMESH_Mesh&               aMesh,
193                                      SMESH_subMesh*            aSubMesh,
194                                      const SMESH_Algo*         aGlobIgnoAlgo,
195                                      const SMESH_Algo*         aLocIgnoAlgo,
196                                      bool &                    checkConform,
197                                      map<int, SMESH_subMesh*>& aCheckedMap,
198                                      list< SMESH_Gen::TAlgoStateError > & theErrors)
199 {
200   ASSERT( aSubMesh );
201   if ( aSubMesh->GetSubShape().ShapeType() == TopAbs_VERTEX)
202     return true;
203
204
205   bool ret = true;
206
207   const list<const SMESHDS_Hypothesis*>& listHyp =
208     aMesh.GetMeshDS()->GetHypothesis( aSubMesh->GetSubShape() );
209   list<const SMESHDS_Hypothesis*>::const_iterator it=listHyp.begin();
210   for ( ; it != listHyp.end(); it++)
211   {
212     const SMESHDS_Hypothesis * aHyp = *it;
213     if (aHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO)
214       continue;
215
216     const SMESH_Algo* algo = dynamic_cast<const SMESH_Algo*> (aHyp);
217     ASSERT ( algo );
218
219     if ( aLocIgnoAlgo ) // algo is hidden by a local algo of upper dim
220     {
221       INFOS( "Local <" << algo->GetName() << "> is hidden by local <"
222             << aLocIgnoAlgo->GetName() << ">");
223     }
224     else
225     {
226       bool isGlobal = (aMesh.IsMainShape( aSubMesh->GetSubShape() ));
227       int dim = algo->GetDim();
228       int aMaxGlobIgnoDim = ( aGlobIgnoAlgo ? aGlobIgnoAlgo->GetDim() : -1 );
229
230       if ( dim < aMaxGlobIgnoDim )
231       {
232         // algo is hidden by a global algo
233         INFOS( ( isGlobal ? "Global" : "Local" )
234               << " <" << algo->GetName() << "> is hidden by global <"
235               << aGlobIgnoAlgo->GetName() << ">");
236       }
237       else if ( !algo->NeedDescretBoundary() && !isGlobal)
238       {
239         // local algo is not hidden and hides algos on sub-shapes
240         if (checkConform && !aSubMesh->IsConform( algo ))
241         {
242           ret = false;
243           checkConform = false; // no more check conformity
244           INFOS( "ERROR: Local <" << algo->GetName() <<
245                 "> would produce not conform mesh: "
246                 "<Not Conform Mesh Allowed> hypotesis is missing");
247           theErrors.push_back( SMESH_Gen::TAlgoStateError() );
248           theErrors.back().Set( SMESH_Hypothesis::HYP_NOTCONFORM, algo, false );
249         }
250
251         // sub-algos will be hidden by a local <algo>
252         const map<int, SMESH_subMesh*>& smMap = aSubMesh->DependsOn();
253         map<int, SMESH_subMesh*>::const_reverse_iterator revItSub;
254         bool checkConform2 = false;
255         for ( revItSub = smMap.rbegin(); revItSub != smMap.rend(); revItSub++)
256         {
257           checkConformIgnoredAlgos (aMesh, (*revItSub).second, aGlobIgnoAlgo,
258                                     algo, checkConform2, aCheckedMap, theErrors);
259           int key = (*revItSub).first;
260           SMESH_subMesh* sm = (*revItSub).second;
261           if ( aCheckedMap.find( key ) == aCheckedMap.end() )
262           {
263             aCheckedMap[ key ] = sm;
264           }
265         }
266       }
267     }
268   }
269
270   return ret;
271 }
272
273 //=======================================================================
274 //function : checkMissing
275 //purpose  : notify on missing hypothesis
276 //           Return false if algo or hipothesis is missing
277 //=======================================================================
278
279 static bool checkMissing(SMESH_Gen*                aGen,
280                          SMESH_Mesh&               aMesh,
281                          SMESH_subMesh*            aSubMesh,
282                          const int                 aTopAlgoDim,
283                          bool*                     globalChecked,
284                          const bool                checkNoAlgo,
285                          map<int, SMESH_subMesh*>& aCheckedMap,
286                          list< SMESH_Gen::TAlgoStateError > & theErrors)
287 {
288   if ( aSubMesh->GetSubShape().ShapeType() == TopAbs_VERTEX)
289     return true;
290
291   //MESSAGE("=====checkMissing");
292
293   int ret = true;
294   SMESH_Algo* algo = 0;
295
296   switch (aSubMesh->GetAlgoState())
297   {
298   case SMESH_subMesh::NO_ALGO: {
299     if (checkNoAlgo)
300     {
301       // should there be any algo?
302       int shapeDim = SMESH_Gen::GetShapeDim( aSubMesh->GetSubShape() );
303       if (aTopAlgoDim > shapeDim)
304       {
305         MESSAGE( "ERROR: " << shapeDim << "D algorithm is missing" );
306         ret = false;
307         theErrors.push_back( SMESH_Gen::TAlgoStateError() );
308         theErrors.back().Set( SMESH_Hypothesis::HYP_MISSING, shapeDim, true );
309       }
310     }
311     return ret;
312   }
313   case SMESH_subMesh::MISSING_HYP: {
314     // notify if an algo missing hyp is attached to aSubMesh
315     algo = aGen->GetAlgo( aMesh, aSubMesh->GetSubShape() );
316     ASSERT( algo );
317     bool IsGlobalHypothesis = aGen->IsGlobalHypothesis( algo, aMesh );
318     if (!IsGlobalHypothesis || !globalChecked[ algo->GetDim() ])
319     {
320       TAlgoStateErrorName errName = SMESH_Hypothesis::HYP_MISSING;
321       SMESH_Hypothesis::Hypothesis_Status status;
322       algo->CheckHypothesis( aMesh, aSubMesh->GetSubShape(), status );
323       if ( status == SMESH_Hypothesis::HYP_BAD_PARAMETER ) {
324         MESSAGE( "ERROR: hypothesis of " << (IsGlobalHypothesis ? "Global " : "Local ")
325                  << "<" << algo->GetName() << "> has a bad parameter value");
326         errName = status;
327       } else if ( status == SMESH_Hypothesis::HYP_BAD_GEOMETRY ) {
328         MESSAGE( "ERROR: " << (IsGlobalHypothesis ? "Global " : "Local ")
329                  << "<" << algo->GetName() << "> assigned to mismatching geometry");
330         errName = status;
331       } else {
332         MESSAGE( "ERROR: " << (IsGlobalHypothesis ? "Global " : "Local ")
333                  << "<" << algo->GetName() << "> misses some hypothesis");
334       }
335       if (IsGlobalHypothesis)
336         globalChecked[ algo->GetDim() ] = true;
337       theErrors.push_back( SMESH_Gen::TAlgoStateError() );
338       theErrors.back().Set( errName, algo, IsGlobalHypothesis );
339     }
340     ret = false;
341     break;
342   }
343   case SMESH_subMesh::HYP_OK:
344     algo = aGen->GetAlgo( aMesh, aSubMesh->GetSubShape() );
345     ret = true;
346     break;
347   default: ASSERT(0);
348   }
349
350   // do not check under algo that hides sub-algos or
351   // re-start checking NO_ALGO state
352   ASSERT (algo);
353   bool isTopLocalAlgo =
354     ( aTopAlgoDim <= algo->GetDim() && !aGen->IsGlobalHypothesis( algo, aMesh ));
355   if (!algo->NeedDescretBoundary() || isTopLocalAlgo)
356   {
357     bool checkNoAlgo2 = ( algo->NeedDescretBoundary() );
358     const map<int, SMESH_subMesh*>& subMeshes = aSubMesh->DependsOn();
359     map<int, SMESH_subMesh*>::const_iterator itsub;
360     for (itsub = subMeshes.begin(); itsub != subMeshes.end(); itsub++)
361     {
362       // sub-meshes should not be checked further more
363       int key = (*itsub).first;
364       SMESH_subMesh* sm = (*itsub).second;
365       if ( aCheckedMap.find( key ) == aCheckedMap.end() )
366         aCheckedMap[ key ] = sm;
367
368       if (isTopLocalAlgo)
369       {
370         //check algo on sub-meshes
371         int aTopAlgoDim2 = algo->GetDim();
372         if (!checkMissing (aGen, aMesh, sm, aTopAlgoDim2,
373                            globalChecked, checkNoAlgo2, aCheckedMap, theErrors))
374         {
375           ret = false;
376           if (sm->GetAlgoState() == SMESH_subMesh::NO_ALGO )
377             checkNoAlgo2 = false;
378         }
379       }
380     }
381   }
382   return ret;
383 }
384
385 //=======================================================================
386 //function : CheckAlgoState
387 //purpose  : notify on bad state of attached algos, return false
388 //           if Compute() would fail because of some algo bad state
389 //=======================================================================
390
391 bool SMESH_Gen::CheckAlgoState(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
392 {
393   list< TAlgoStateError > errors;
394   return GetAlgoState( aMesh, aShape, errors );
395 }
396
397 //=======================================================================
398 //function : GetAlgoState
399 //purpose  : notify on bad state of attached algos, return false
400 //           if Compute() would fail because of some algo bad state
401 //           theErrors list contains problems description
402 //=======================================================================
403
404 bool SMESH_Gen::GetAlgoState(SMESH_Mesh&               theMesh,
405                              const TopoDS_Shape&       theShape,
406                              list< TAlgoStateError > & theErrors)
407 {
408   //MESSAGE("SMESH_Gen::CheckAlgoState");
409
410   bool ret = true;
411   bool hasAlgo = false;
412
413   SMESH_subMesh* sm = theMesh.GetSubMesh(theShape);
414   const SMESHDS_Mesh* meshDS = theMesh.GetMeshDS();
415   TopoDS_Shape mainShape = meshDS->ShapeToMesh();
416
417   // -----------------
418   // get global algos
419   // -----------------
420
421   const SMESH_Algo* aGlobAlgoArr[] = {0,0,0,0};
422
423   const list<const SMESHDS_Hypothesis*>& listHyp = meshDS->GetHypothesis( mainShape );
424   list<const SMESHDS_Hypothesis*>::const_iterator it=listHyp.begin();
425   for ( ; it != listHyp.end(); it++)
426   {
427     const SMESHDS_Hypothesis * aHyp = *it;
428     if (aHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO)
429       continue;
430
431     const SMESH_Algo* algo = dynamic_cast<const SMESH_Algo*> (aHyp);
432     ASSERT ( algo );
433
434     int dim = algo->GetDim();
435     aGlobAlgoArr[ dim ] = algo;
436
437     hasAlgo = true;
438   }
439
440   // --------------------------------------------------------
441   // info on algos that will be ignored because of ones that
442   // don't NeedDescretBoundary() attached to super-shapes,
443   // check that a conform mesh will be produced
444   // --------------------------------------------------------
445
446
447   // find a global algo possibly hiding sub-algos
448   int dim;
449   const SMESH_Algo* aGlobIgnoAlgo = 0;
450   for (dim = 3; dim > 0; dim--)
451   {
452     if (aGlobAlgoArr[ dim ] &&
453         !aGlobAlgoArr[ dim ]->NeedDescretBoundary())
454     {
455       aGlobIgnoAlgo = aGlobAlgoArr[ dim ];
456       break;
457     }
458   }
459
460   const map<int, SMESH_subMesh*>& smMap = sm->DependsOn();
461   map<int, SMESH_subMesh*>::const_reverse_iterator revItSub = smMap.rbegin();
462   map<int, SMESH_subMesh*> aCheckedMap;
463   bool checkConform = ( !theMesh.IsNotConformAllowed() );
464   int aKey = 1;
465   SMESH_subMesh* smToCheck = sm;
466
467   // loop on theShape and its sub-shapes
468   while ( smToCheck )
469   {
470     if ( smToCheck->GetSubShape().ShapeType() == TopAbs_VERTEX)
471       break;
472
473     if ( aCheckedMap.find( aKey ) == aCheckedMap.end() )
474       if (!checkConformIgnoredAlgos (theMesh, smToCheck, aGlobIgnoAlgo,
475                                      0, checkConform, aCheckedMap, theErrors))
476         ret = false;
477
478     if ( smToCheck->GetAlgoState() != SMESH_subMesh::NO_ALGO )
479       hasAlgo = true;
480
481     // next subMesh
482     if (revItSub != smMap.rend())
483     {
484       aKey = (*revItSub).first;
485       smToCheck = (*revItSub).second;
486       revItSub++;
487     }
488     else
489     {
490       smToCheck = 0;
491     }
492
493   }
494
495   // ----------------------------------------------------------------
496   // info on missing hypothesis and find out if all needed algos are
497   // well defined
498   // ----------------------------------------------------------------
499
500   //MESSAGE( "---info on missing hypothesis and find out if all needed algos are");
501
502   // find max dim of global algo
503   int aTopAlgoDim = 0;
504   for (dim = 3; dim > 0; dim--)
505   {
506     if (aGlobAlgoArr[ dim ])
507     {
508       aTopAlgoDim = dim;
509       break;
510     }
511   }
512   aCheckedMap.clear();
513   smToCheck = sm;
514   revItSub = smMap.rbegin();
515   bool checkNoAlgo = theMesh.HasShapeToMesh() ? bool( aTopAlgoDim ) : false;
516   bool globalChecked[] = { false, false, false, false };
517
518   // loop on theShape and its sub-shapes
519   while ( smToCheck )
520   {
521     if ( smToCheck->GetSubShape().ShapeType() == TopAbs_VERTEX)
522       break;
523
524     if ( aCheckedMap.find( aKey ) == aCheckedMap.end() )
525       if (!checkMissing (this, theMesh, smToCheck, aTopAlgoDim,
526                          globalChecked, checkNoAlgo, aCheckedMap, theErrors))
527       {
528         ret = false;
529         if (smToCheck->GetAlgoState() == SMESH_subMesh::NO_ALGO )
530           checkNoAlgo = false;
531       }
532
533     // next subMesh
534     if (revItSub != smMap.rend())
535     {
536       aKey = (*revItSub).first;
537       smToCheck = (*revItSub).second;
538       revItSub++;
539     }
540     else
541       smToCheck = 0;
542   }
543
544   if ( !hasAlgo ) {
545     ret = false;
546     INFOS( "None algorithm attached" );
547     theErrors.push_back( TAlgoStateError() );
548     theErrors.back().Set( SMESH_Hypothesis::HYP_MISSING, 1, true );
549   }
550
551   return ret;
552 }
553
554 //=======================================================================
555 //function : IsGlobalHypothesis
556 //purpose  : check if theAlgo is attached to the main shape
557 //=======================================================================
558
559 bool SMESH_Gen::IsGlobalHypothesis(const SMESH_Hypothesis* theHyp, SMESH_Mesh& aMesh)
560 {
561   SMESH_HypoFilter filter( SMESH_HypoFilter::Is( theHyp ));
562   return aMesh.GetHypothesis( aMesh.GetMeshDS()->ShapeToMesh(), filter, false );
563 }
564
565 //=============================================================================
566 /*!
567  *
568  */
569 //=============================================================================
570
571 SMESH_Algo *SMESH_Gen::GetAlgo(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape)
572 {
573
574   SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
575   filter.And( filter.IsApplicableTo( aShape ));
576
577   list <const SMESHDS_Hypothesis * > algoList;
578   aMesh.GetHypotheses( aShape, filter, algoList, true );
579
580   if ( algoList.empty() )
581     return NULL;
582
583   return const_cast<SMESH_Algo*> ( static_cast<const SMESH_Algo* >( algoList.front() ));
584 }
585
586 //=============================================================================
587 /*!
588  *
589  */
590 //=============================================================================
591
592 StudyContextStruct *SMESH_Gen::GetStudyContext(int studyId)
593 {
594         // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
595
596         if (_mapStudyContext.find(studyId) == _mapStudyContext.end())
597         {
598                 _mapStudyContext[studyId] = new StudyContextStruct;
599                 _mapStudyContext[studyId]->myDocument = new SMESHDS_Document(studyId);
600         }
601         StudyContextStruct *myStudyContext = _mapStudyContext[studyId];
602 //   ASSERT(_mapStudyContext.find(studyId) != _mapStudyContext.end());
603         return myStudyContext;
604 }
605
606 //=============================================================================
607 /*!
608  *
609  */
610 //=============================================================================
611
612 void SMESH_Gen::Save(int studyId, const char *aUrlOfFile)
613 {
614 }
615
616 //=============================================================================
617 /*!
618  *
619  */
620 //=============================================================================
621
622 void SMESH_Gen::Load(int studyId, const char *aUrlOfFile)
623 {
624 }
625
626 //=============================================================================
627 /*!
628  *
629  */
630 //=============================================================================
631
632 void SMESH_Gen::Close(int studyId)
633 {
634 }
635
636 //=============================================================================
637 /*!
638  *
639  */
640 //=============================================================================
641
642 int SMESH_Gen::GetShapeDim(const TopAbs_ShapeEnum & aShapeType)
643 {
644   static vector<int> dim;
645   if ( dim.empty() )
646   {
647     dim.resize( TopAbs_SHAPE, -1 );
648     dim[ TopAbs_COMPOUND ]  = 3;
649     dim[ TopAbs_COMPSOLID ] = 3;
650     dim[ TopAbs_SOLID ]     = 3;
651     dim[ TopAbs_SHELL ]     = 3;
652     dim[ TopAbs_FACE  ]     = 2;
653     dim[ TopAbs_WIRE ]      = 1;
654     dim[ TopAbs_EDGE ]      = 1;
655     dim[ TopAbs_VERTEX ]    = 0;
656   }
657   return dim[ aShapeType ];
658 }
659
660 //=============================================================================
661 /*!
662  *
663  */
664 //=============================================================================
665
666 int SMESH_Gen::GetANewId()
667 {
668         //MESSAGE("SMESH_Gen::GetANewId");
669         return _hypId++;
670 }