1 // Created on: 2003-09-09
2 // Created by: Alexander SOLOVYOV
3 // Copyright (c) 2003-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <MeshVS_Mesh.ixx>
18 #include <AIS_InteractiveContext.hxx>
20 #include <Prs3d_Root.hxx>
22 #include <TColgp_Array1OfPnt.hxx>
24 #include <Select3D_SensitivePoint.hxx>
25 #include <SelectMgr_Selection.hxx>
27 #include <Aspect_MarkerStyle.hxx>
28 #include <Aspect_LineStyle.hxx>
29 #include <Aspect_InteriorStyle.hxx>
31 #include <Prs3d_PointAspect.hxx>
32 #include <Prs3d_LineAspect.hxx>
33 #include <Prs3d_ShadingAspect.hxx>
34 #include <Prs3d_Presentation.hxx>
35 #include <PrsMgr_ModedPresentation.hxx>
36 #include <PrsMgr_PresentationManager3d.hxx>
38 #include <SelectBasics_SensitiveEntity.hxx>
39 #include <SelectMgr_SequenceOfOwner.hxx>
40 #include <Select3D_SensitiveGroup.hxx>
41 #include <Select3D_SensitiveBox.hxx>
43 #include <Graphic3d_MaterialAspect.hxx>
44 #include <Graphic3d_AspectFillArea3d.hxx>
45 #include <Graphic3d_NameOfMaterial.hxx>
47 #include <TColStd_Array1OfReal.hxx>
48 #include <TColStd_Array1OfInteger.hxx>
49 #include <TColStd_MapIteratorOfPackedMapOfInteger.hxx>
50 #include <TColStd_ListIteratorOfListOfReal.hxx>
51 #include <TColStd_SequenceOfInteger.hxx>
52 #include <TColStd_ListIteratorOfListOfInteger.hxx>
54 #include <Bnd_Box.hxx>
56 #include <MeshVS_DataSource.hxx>
57 #include <MeshVS_MeshEntityOwner.hxx>
58 #include <MeshVS_MeshOwner.hxx>
59 #include <MeshVS_SensitiveMesh.hxx>
60 #include <MeshVS_DummySensitiveEntity.hxx>
61 #include <MeshVS_SensitiveSegment.hxx>
62 #include <MeshVS_SensitiveFace.hxx>
63 #include <MeshVS_DrawerAttribute.hxx>
64 #include <MeshVS_DataMapIteratorOfDataMapOfIntegerOwner.hxx>
65 #include <MeshVS_SensitivePolyhedron.hxx>
66 #include <MeshVS_SelectionModeFlags.hxx>
67 #include <MeshVS_Buffer.hxx>
69 #include <OSD_Timer.hxx>
71 //================================================================
72 // Function : Constructor MeshVS_Mesh
74 //================================================================
75 MeshVS_Mesh::MeshVS_Mesh (const Standard_Boolean theIsAllowOverlapped )
77 myDataSource.Nullify();
78 myHilighter.Nullify();
79 myWholeMeshOwner.Nullify();
80 mySelectionMethod = MeshVS_MSM_NODES;
82 SetAutoHilight ( Standard_False );
84 SetDisplayMode( MeshVS_DMF_WireFrame ); // Mode as defaut
85 SetHilightMode( MeshVS_DMF_WireFrame ); // Wireframe as default hilight mode
87 SetColor ( Quantity_NOC_WHITE );
88 SetMaterial ( Graphic3d_NOM_PLASTIC );
90 myCurrentDrawer = new MeshVS_Drawer();
91 myCurrentDrawer->SetColor ( MeshVS_DA_InteriorColor, Quantity_NOC_BLUE4 );
92 myCurrentDrawer->SetInteger ( MeshVS_DA_InteriorStyle, Aspect_IS_SOLID );
93 myCurrentDrawer->SetInteger ( MeshVS_DA_MaxFaceNodes, 10 );
94 myCurrentDrawer->SetBoolean ( MeshVS_DA_IsAllowOverlapped, theIsAllowOverlapped );
95 myCurrentDrawer->SetBoolean ( MeshVS_DA_Reflection, Standard_True );
96 myCurrentDrawer->SetDouble ( MeshVS_DA_ShrinkCoeff, 0.8 );
97 myCurrentDrawer->SetBoolean ( MeshVS_DA_ComputeTime, Standard_False );
98 myCurrentDrawer->SetBoolean ( MeshVS_DA_ComputeSelectionTime, Standard_False );
99 myCurrentDrawer->SetBoolean ( MeshVS_DA_DisplayNodes, Standard_True );
100 myCurrentDrawer->SetDouble ( MeshVS_DA_EdgeWidth, 1.0 );
101 myCurrentDrawer->SetInteger ( MeshVS_DA_EdgeType, Aspect_TOL_SOLID );
102 myCurrentDrawer->SetInteger ( MeshVS_DA_MarkerType, Aspect_TOM_O );
103 myCurrentDrawer->SetColor ( MeshVS_DA_MarkerColor, Quantity_NOC_WHITE );
104 myCurrentDrawer->SetDouble ( MeshVS_DA_MarkerScale, 1.0 );
105 myCurrentDrawer->SetInteger ( MeshVS_DA_BeamType, Aspect_TOL_SOLID );
106 myCurrentDrawer->SetDouble ( MeshVS_DA_BeamWidth, 1.0 );
107 myCurrentDrawer->SetBoolean ( MeshVS_DA_SmoothShading, Standard_False );
108 myCurrentDrawer->SetBoolean ( MeshVS_DA_SupressBackFaces, Standard_False );
110 mySelectionDrawer = new MeshVS_Drawer();
111 mySelectionDrawer->Assign ( myCurrentDrawer );
112 mySelectionDrawer->SetInteger ( MeshVS_DA_MarkerType, Aspect_TOM_STAR );
113 mySelectionDrawer->SetColor ( MeshVS_DA_MarkerColor, Quantity_NOC_GRAY80 );
114 mySelectionDrawer->SetDouble ( MeshVS_DA_MarkerScale, 2.0 );
116 mySelectionDrawer->SetColor ( MeshVS_DA_BeamColor, Quantity_NOC_GRAY80 );
117 mySelectionDrawer->SetInteger ( MeshVS_DA_BeamType, Aspect_TOL_SOLID );
118 mySelectionDrawer->SetDouble ( MeshVS_DA_BeamWidth, 3.0 );
120 myHilightDrawer = new MeshVS_Drawer ();
121 myHilightDrawer->Assign ( myCurrentDrawer );
122 myHilightDrawer->SetDouble ( MeshVS_DA_ShrinkCoeff, 0.7 );
123 myHilightDrawer->SetInteger ( MeshVS_DA_InteriorStyle, Aspect_IS_SOLID );
124 myHilightDrawer->SetColor ( MeshVS_DA_InteriorColor, Quantity_NOC_YELLOW );
125 myHilightDrawer->SetColor ( MeshVS_DA_BackInteriorColor, Quantity_NOC_YELLOW );
126 myHilightDrawer->SetColor ( MeshVS_DA_EdgeColor, Quantity_NOC_GREEN );
127 myHilightDrawer->SetInteger ( MeshVS_DA_EdgeType, Aspect_TOL_SOLID );
128 myHilightDrawer->SetDouble ( MeshVS_DA_EdgeWidth, 1.0 );
129 myHilightDrawer->SetMaterial ( MeshVS_DA_FrontMaterial, Graphic3d_NOM_PLASTIC );
130 myHilightDrawer->SetMaterial ( MeshVS_DA_BackMaterial, Graphic3d_NOM_PLASTIC );
132 myHilightDrawer->SetColor ( MeshVS_DA_BeamColor, Quantity_NOC_GRAY80 );
133 myHilightDrawer->SetInteger ( MeshVS_DA_BeamType, Aspect_TOL_SOLID );
134 myHilightDrawer->SetDouble ( MeshVS_DA_BeamWidth, 3.0 );
136 myHilightDrawer->SetInteger ( MeshVS_DA_MarkerType, Aspect_TOM_STAR );
137 myHilightDrawer->SetColor ( MeshVS_DA_MarkerColor, Quantity_NOC_GRAY80 );
138 myHilightDrawer->SetDouble ( MeshVS_DA_MarkerScale, 2.0 );
141 void MeshVS_Mesh::Destroy()
145 //================================================================
146 // Function : Compute
148 //================================================================
149 void MeshVS_Mesh::Compute ( const Handle(PrsMgr_PresentationManager3d)& thePrsMgr,
150 const Handle(Prs3d_Presentation)& thePresentation,
151 const Standard_Integer theMode )
155 Standard_Boolean ShowComputeTime = Standard_True;
156 myCurrentDrawer->GetBoolean( MeshVS_DA_ComputeTime, ShowComputeTime );
158 if ( ShowComputeTime )
164 // Repair Ids in map if necessary
165 Handle( MeshVS_DataSource ) aDS = GetDataSource();
169 const TColStd_PackedMapOfInteger& aNodes = aDS->GetAllNodes();
170 const TColStd_PackedMapOfInteger& aElems = aDS->GetAllElements();
171 Standard_Boolean HasNodes = !aNodes.IsEmpty(),
172 HasElements = !aElems.IsEmpty();
174 TColStd_PackedMapOfInteger aNodesToExclude, aElemsToExclude;
176 thePresentation->Clear();
177 Standard_Integer len = myBuilders.Length();
179 for ( Standard_Integer i=1; i<=len; i++ )
181 Handle (MeshVS_PrsBuilder) aCurrent = myBuilders.Value ( i );
182 if ( !aCurrent.IsNull() && aCurrent->TestFlags ( theMode ) )
184 aCurrent->SetPresentationManager( thePrsMgr );
186 aCurrent->Build ( thePresentation, aNodes, aNodesToExclude, Standard_False, theMode );
188 aCurrent->Build ( thePresentation, aElems, aElemsToExclude, Standard_True, theMode );
193 if ( ShowComputeTime )
195 Standard_Real sec, cpu;
196 Standard_Integer min, hour;
198 gTimer.Show ( sec, min, hour, cpu );
199 cout << "DisplayMode : " << theMode << endl;
200 cout << "Compute : " << sec << " sec" << endl;
201 cout << "Compute CPU : " << cpu << " sec" << endl << endl;
206 //================================================================
207 // Function : ComputeSelection
209 //================================================================
210 void MeshVS_Mesh::ComputeSelection ( const Handle(SelectMgr_Selection)& theSelection,
211 const Standard_Integer theMode )
215 Standard_Boolean ShowComputeSelectionTime = Standard_True;
216 myCurrentDrawer->GetBoolean( MeshVS_DA_ComputeSelectionTime, ShowComputeSelectionTime );
218 if ( ShowComputeSelectionTime )
224 Standard_Integer aMaxFaceNodes;
225 Handle( MeshVS_DataSource ) aSource = GetDataSource();
227 if ( aSource.IsNull() || myCurrentDrawer.IsNull() || !myCurrentDrawer->GetInteger
228 ( MeshVS_DA_MaxFaceNodes, aMaxFaceNodes ) || aMaxFaceNodes<=0 )
231 MeshVS_Buffer aCoordsBuf (3*aMaxFaceNodes*sizeof(Standard_Real));
232 TColStd_Array1OfReal aCoords (aCoordsBuf, 1, 3*aMaxFaceNodes);
233 Standard_Integer NbNodes;
235 MeshVS_EntityType aType;
236 Standard_Address anAddr;
237 TColStd_MapIteratorOfPackedMapOfInteger anIter;
238 Standard_Real x, y, z;
240 Standard_Integer aMode = HasDisplayMode() ? DisplayMode() : DefaultDisplayMode();
241 if ( myHilighter.IsNull() || ( aMode & MeshVS_DMF_OCCMask ) == 0 )
243 const TColStd_PackedMapOfInteger& anAllNodesMap = aSource->GetAllNodes();
244 const TColStd_PackedMapOfInteger& anAllElementsMap= aSource->GetAllElements();
245 //agv Standard_Integer i;
247 // skt: advanced mesh selection
248 if( aSource->IsAdvancedSelectionEnabled() ) {
249 Handle(MeshVS_MeshOwner) anOwner;
250 // Get the owner if it is already created
251 MeshVS_DataMapIteratorOfDataMapOfIntegerOwner anIt( GetOwnerMaps( Standard_False ) );
252 for( ; anIt.More(); anIt.Next() )
254 anOwner = Handle(MeshVS_MeshOwner)::DownCast( anIt.Value() );
255 // clear selected entities
256 if( !anOwner.IsNull() )
259 if( anOwner.IsNull() )
260 // Create one owner for the whole mesh and for all selection modes
261 anOwner = new MeshVS_MeshOwner( this, aSource, 5 );
262 // Save the owner. It will be available via GetOwnerMaps method
263 if( !myMeshOwners.IsBound( 1 ) )
264 myMeshOwners.Bind( 1, anOwner );
265 // Create one sensitive entity. It should detect mesh entities correspondingly
267 Handle(MeshVS_SensitiveMesh) aSensMesh = new MeshVS_SensitiveMesh( anOwner, theMode );
268 theSelection->Add ( aSensMesh );
273 case MeshVS_SMF_Node: // Nodes
275 myNodeOwners.Clear();
277 for ( anIter.Initialize( anAllNodesMap ); anIter.More(); anIter.Next() )
279 Standard_Integer aKey = anIter.Key();
280 if ( !myDataSource->GetGeom ( aKey, Standard_False, aCoords, NbNodes, aType ) )
283 anAddr = myDataSource->GetAddr ( aKey, Standard_False );
285 Handle (MeshVS_MeshEntityOwner) anOwner = new MeshVS_MeshEntityOwner
286 ( this, aKey, anAddr, aType, 5 );
288 myNodeOwners.Bind ( aKey, anOwner );
290 if ( IsSelectableNode( aKey ) )
295 Handle (Select3D_SensitivePoint) aPoint = new Select3D_SensitivePoint
296 ( anOwner, gp_Pnt (x, y, z) );
297 theSelection->Add ( aPoint );
300 theSelection->Add ( new MeshVS_DummySensitiveEntity ( anOwner ) );
304 case MeshVS_SMF_Mesh:
306 if( myWholeMeshOwner.IsNull() )
307 myWholeMeshOwner = new SelectMgr_EntityOwner( this );
309 switch( mySelectionMethod )
313 Standard_Real min[3], max[3]; Standard_Boolean first = Standard_True;
314 TColStd_MapIteratorOfPackedMapOfInteger anIterN( anAllNodesMap );
316 for( ; anIterN.More(); anIterN.Next() )
317 if( myDataSource->GetGeom( anIterN.Key(), Standard_False, aCoords, NbNodes, aType ) ) {
320 for( Standard_Integer i=1; i<=3; i++ )
321 min[i-1] = max[i-1] = aCoords( i );
322 first = Standard_False;
325 for( Standard_Integer i=1; i<=3; i++ )
327 if( aCoords( i )<min[i-1] )
328 min[i-1] = aCoords( i );
329 if( aCoords( i )>max[i-1] )
330 max[i-1] = aCoords( i );
334 box.Add( gp_Pnt( min[0], min[1], min[2] ) );
335 box.Add( gp_Pnt( max[0], max[1], max[2] ) );
337 theSelection->Add( new Select3D_SensitiveBox( myWholeMeshOwner, box ) );
341 case MeshVS_MSM_NODES:
343 TColStd_MapIteratorOfPackedMapOfInteger anIterN( anAllNodesMap );
344 for( ; anIterN.More(); anIterN.Next() )
345 if( myDataSource->GetGeom( anIterN.Key(), Standard_False, aCoords, NbNodes, aType ) &&
346 !IsHiddenNode( anIterN.Key() ) )
347 theSelection->Add( new Select3D_SensitivePoint( myWholeMeshOwner, gp_Pnt ( aCoords(1), aCoords(2), aCoords(3) ) ) );
351 case MeshVS_MSM_PRECISE:
353 Handle( Select3D_SensitiveEntity ) anEnt;
354 TColStd_MapIteratorOfPackedMapOfInteger anIterMV( anAllElementsMap );
356 TColStd_PackedMapOfInteger aSharedNodes;
357 for( ; anIterMV.More(); anIterMV.Next() )
359 Standard_Integer aKey = anIterMV.Key();
361 if( IsSelectableElem( aKey ) &&
362 myDataSource->GetGeomType( aKey, Standard_True, aType ) &&
363 aType==MeshVS_ET_Face )
365 myDataSource->GetGeom ( aKey, Standard_True, aCoords, NbNodes, aType );
369 MeshVS_Buffer aNodesBuf (NbNodes*sizeof(Standard_Integer));
370 TColStd_Array1OfInteger aElemNodes(aNodesBuf, 1, NbNodes);
371 if ( !myDataSource->GetNodesByElement ( aKey, aElemNodes, NbNodes ) )
374 TColgp_Array1OfPnt Points( 1, NbNodes );
375 for ( Standard_Integer i=1; i<=NbNodes; i++ )
377 Points (i) = gp_Pnt ( aCoords (3*i-2), aCoords (3*i-1), aCoords (3*i) );
378 aSharedNodes.Add( aElemNodes( i ) );
381 anEnt = new Select3D_SensitiveFace( myWholeMeshOwner, Points );
382 theSelection->Add( anEnt );
385 for( anIterMV.Initialize( anAllElementsMap ); anIterMV.More(); anIterMV.Next() )
387 Standard_Integer aKey = anIterMV.Key();
389 if( IsSelectableElem( aKey ) &&
390 myDataSource->GetGeomType( aKey, Standard_True, aType ) &&
391 aType==MeshVS_ET_Link )
393 myDataSource->GetGeom ( aKey, Standard_True, aCoords, NbNodes, aType );
397 MeshVS_Buffer aNodesBuf (NbNodes*sizeof(Standard_Integer));
398 TColStd_Array1OfInteger aElemNodes(aNodesBuf, 1, NbNodes);
399 if ( !myDataSource->GetNodesByElement ( aKey, aElemNodes, NbNodes ) )
402 TColgp_Array1OfPnt Points( 1, NbNodes );
403 Standard_Boolean all_shared = Standard_True;
404 for ( Standard_Integer i=1; i<=NbNodes; i++ )
406 Points (i) = gp_Pnt ( aCoords (3*i-2), aCoords (3*i-1), aCoords (3*i) );
407 all_shared = all_shared && aSharedNodes.Contains( aElemNodes( i ) );
408 aSharedNodes.Add( aElemNodes( i ) );
413 anEnt = new Select3D_SensitiveSegment( myWholeMeshOwner, Points.Value( 1 ), Points.Value( 2 ) );
414 theSelection->Add( anEnt );
418 for( anIterMV.Initialize( anAllNodesMap ); anIterMV.More(); anIterMV.Next() )
420 Standard_Integer aKey = anIterMV.Key();
421 if( IsSelectableElem( aKey ) &&
422 myDataSource->GetGeom ( aKey, Standard_False, aCoords, NbNodes, aType ) &&
423 !aSharedNodes.Contains( aKey ) )
425 anEnt = new Select3D_SensitivePoint( myWholeMeshOwner, gp_Pnt ( aCoords(1), aCoords(2), aCoords(3) ) ) ;
426 theSelection->Add( anEnt );
434 case MeshVS_SMF_Group:
436 myGroupOwners.Clear();
438 TColStd_PackedMapOfInteger anAllGroupsMap;
439 aSource->GetAllGroups( anAllGroupsMap );
441 Handle( MeshVS_HArray1OfSequenceOfInteger ) aTopo;
443 for ( anIter.Initialize( anAllGroupsMap ); anIter.More(); anIter.Next() )
445 Standard_Integer aKeyGroup = anIter.Key();
447 MeshVS_EntityType aGroupType;
448 TColStd_PackedMapOfInteger aGroupMap;
449 if ( !myDataSource->GetGroup( aKeyGroup, aGroupType, aGroupMap ) )
452 anAddr = myDataSource->GetGroupAddr ( aKeyGroup );
453 Standard_Integer aPrior = 0;
455 if( aGroupType == MeshVS_ET_Volume )
457 if ( aGroupType == MeshVS_ET_Face )
459 else if ( aGroupType == MeshVS_ET_Link )
461 else if ( aGroupType == MeshVS_ET_0D )
463 else if ( aGroupType == MeshVS_ET_Node )
466 Handle (MeshVS_MeshEntityOwner) anOwner = new MeshVS_MeshEntityOwner
467 ( this, aKeyGroup, anAddr, aGroupType, aPrior, Standard_True );
469 myGroupOwners.Bind( aKeyGroup, anOwner );
471 Standard_Boolean added = Standard_False;
472 for ( TColStd_MapIteratorOfPackedMapOfInteger anIterMG (aGroupMap);
473 anIterMG.More(); anIterMG.Next() )
475 Standard_Integer aKey = anIterMG.Key();
476 if ( aGroupType == MeshVS_ET_Node ) {
477 if( myDataSource->GetGeom( aKey, Standard_False, aCoords, NbNodes, aType ) &&
478 IsSelectableNode/*!IsHiddenNode*/( aKey ) ) {
479 theSelection->Add( new Select3D_SensitivePoint( anOwner, gp_Pnt ( aCoords(1), aCoords(2), aCoords(3) ) ) );
480 added = Standard_True;
483 else if ( myDataSource->GetGeomType ( aKey, Standard_True, aType ) &&
484 IsSelectableElem/*!IsHiddenElem*/( aKey ) ) {
485 myDataSource->GetGeom ( aKey, Standard_True, aCoords, NbNodes, aType );
487 TColgp_Array1OfPnt anArr( 1, NbNodes );
488 for ( Standard_Integer i=1; i<=NbNodes; i++ )
493 anArr.SetValue ( i, gp_Pnt ( x, y, z ) );
496 if ( aType == MeshVS_ET_Face && NbNodes > 0 ) // Faces: 2D-elements
498 Handle (MeshVS_SensitiveFace) aFace =
499 new MeshVS_SensitiveFace( anOwner, anArr );
500 theSelection->Add ( aFace );
501 added = Standard_True;
503 else if ( aType == MeshVS_ET_Link && NbNodes > 0 ) // Links: 1D-elements
505 Handle (MeshVS_SensitiveSegment) aSeg = new MeshVS_SensitiveSegment
506 ( anOwner, anArr(1), anArr(2) );
507 theSelection->Add ( aSeg );
508 added = Standard_True;
510 else if( aType == MeshVS_ET_Volume && aSource->Get3DGeom( aKey, NbNodes, aTopo ) )
512 Handle( MeshVS_SensitivePolyhedron ) aPolyhedron =
513 new MeshVS_SensitivePolyhedron( anOwner, anArr, aTopo );
514 theSelection->Add( aPolyhedron );
515 added = Standard_True;
517 else //if ( aType == MeshVS_ET_0D ) // Custom : not only 0D-elements !!!
519 Handle (SelectBasics_SensitiveEntity) anEnt =
520 myHilighter->CustomSensitiveEntity ( anOwner, aKey );
521 if (!anEnt.IsNull()) {
522 theSelection->Add ( anEnt );
523 added = Standard_True;
529 theSelection->Add ( new MeshVS_DummySensitiveEntity ( anOwner ) );
534 default: // all residuary modes
536 Handle( MeshVS_HArray1OfSequenceOfInteger ) aTopo;
538 myElementOwners.Clear();
540 MeshVS_DataMapOfIntegerOwner* CurMap = &my0DOwners;
541 if ( theMode == MeshVS_ET_Link )
542 CurMap = &myLinkOwners;
543 else if ( theMode == MeshVS_ET_Face )
544 CurMap = &myFaceOwners;
545 else if ( theMode == MeshVS_ET_Volume )
546 CurMap = &myVolumeOwners;
550 for (TColStd_MapIteratorOfPackedMapOfInteger anIterMV (anAllElementsMap);
551 anIterMV.More(); anIterMV.Next() )
553 Standard_Integer aKey = anIterMV.Key();
555 if ( myDataSource->GetGeomType ( aKey, Standard_True, aType ) && theMode == aType )
557 myDataSource->GetGeom ( aKey, Standard_True, aCoords, NbNodes, aType );
558 anAddr = myDataSource->GetAddr ( aKey, Standard_True );
560 Standard_Integer aPrior = 0;
562 if( aType == MeshVS_ET_Volume )
564 if ( aType == MeshVS_ET_Face )
566 else if ( aType == MeshVS_ET_Link )
568 else if ( aType == MeshVS_ET_0D )
571 Handle (MeshVS_MeshEntityOwner) anOwner = new MeshVS_MeshEntityOwner
572 ( this, aKey, anAddr, aType, aPrior );
574 CurMap->Bind ( aKey, anOwner );
576 if ( IsSelectableElem( aKey ) ) //The element is selectable
578 TColgp_Array1OfPnt anArr( 1, NbNodes );
579 for ( Standard_Integer i=1; i<=NbNodes; i++ )
584 anArr.SetValue ( i, gp_Pnt ( x, y, z ) );
587 if ( aType == MeshVS_ET_Face && NbNodes > 0 ) // Faces: 2D-elements
589 Handle (MeshVS_SensitiveFace) aFace =
590 new MeshVS_SensitiveFace( anOwner, anArr );
591 theSelection->Add ( aFace );
593 else if ( aType == MeshVS_ET_Link && NbNodes > 0 ) // Links: 1D-elements
595 Handle (MeshVS_SensitiveSegment) aSeg = new MeshVS_SensitiveSegment
596 ( anOwner, anArr(1), anArr(2) );
597 theSelection->Add ( aSeg );
599 else if( aType == MeshVS_ET_Volume && aSource->Get3DGeom( aKey, NbNodes, aTopo ) )
601 Handle( MeshVS_SensitivePolyhedron ) aPolyhedron =
602 new MeshVS_SensitivePolyhedron( anOwner, anArr, aTopo );
603 theSelection->Add( aPolyhedron );
605 else //if ( aType == MeshVS_ET_0D ) // Custom : not only 0D-elements !!!
607 Handle (SelectBasics_SensitiveEntity) anEnt =
608 myHilighter->CustomSensitiveEntity ( anOwner, aKey );
610 theSelection->Add ( anEnt );
614 theSelection->Add ( new MeshVS_DummySensitiveEntity ( anOwner ) );
622 if ( ShowComputeSelectionTime )
624 Standard_Real sec, cpu;
625 Standard_Integer min, hour;
627 gTimer.Show ( sec, min, hour, cpu );
628 cout << "SelectionMode : " << theMode << endl;
629 cout << "Compute selection: " << sec << " sec" << endl;
630 cout << "Compute selection CPU : " << cpu << " sec" << endl << endl;
635 //================================================================
636 // Function : GetBuildersCount
638 //================================================================
639 Standard_Integer MeshVS_Mesh::GetBuildersCount () const
641 return myBuilders.Length();
644 //================================================================
645 // Function : GetFreeId
647 //================================================================
648 Standard_Integer MeshVS_Mesh::GetFreeId () const
650 TColStd_PackedMapOfInteger Ids;
651 Standard_Integer i, len = myBuilders.Length(), curId;
653 for ( i=1; i<=len; i++ )
654 Ids.Add( myBuilders.Value(i)->GetId () );
657 while ( Ids.Contains( curId ) )
663 //================================================================
664 // Function : GetBuilder
666 //================================================================
667 Handle (MeshVS_PrsBuilder) MeshVS_Mesh::GetBuilder ( const Standard_Integer Index ) const
669 if ( Index>=1 && Index<=myBuilders.Length() )
670 return myBuilders.Value( Index );
675 //================================================================
676 // Function : GetBuilderById
678 //================================================================
679 Handle (MeshVS_PrsBuilder) MeshVS_Mesh::GetBuilderById ( const Standard_Integer Id ) const
681 Handle (MeshVS_PrsBuilder) Result;
683 Standard_Integer i, len = myBuilders.Length();
684 for ( i=1; i<=len; i++ )
685 if ( myBuilders.Value(i)->GetId () == Id )
687 Result = myBuilders.Value(i);
693 //================================================================
694 // Function : AddBuilder
696 //================================================================
697 void MeshVS_Mesh::AddBuilder ( const Handle (MeshVS_PrsBuilder)& theBuilder,
698 const Standard_Boolean TreatAsHilighter )
700 if ( theBuilder.IsNull() )
703 Standard_Integer i, n = myBuilders.Length();
704 for ( i = 1; i<=n; i++ )
705 if ( myBuilders(i)->GetPriority() < theBuilder->GetPriority() )
709 myBuilders.Append ( theBuilder );
711 myBuilders.InsertBefore ( i, theBuilder );
713 if( TreatAsHilighter )
714 myHilighter = theBuilder;
717 //================================================================
718 // Function : RemoveBuilder
720 //================================================================
721 void MeshVS_Mesh::RemoveBuilder ( const Standard_Integer theIndex )
723 Handle( MeshVS_PrsBuilder ) aBuild = GetBuilder( theIndex );
724 if ( !aBuild.IsNull() )
726 if ( aBuild == myHilighter )
727 myHilighter.Nullify();
728 myBuilders.Remove ( theIndex );
732 //================================================================
733 // Function : RemoveBuilderById
735 //================================================================
736 void MeshVS_Mesh::RemoveBuilderById ( const Standard_Integer Id )
738 Standard_Integer i, n = myBuilders.Length();
739 for ( i=1; i<=n; i++ )
741 Handle( MeshVS_PrsBuilder ) aCur = myBuilders(i);
742 if ( !aCur.IsNull() && aCur->GetId()==Id )
747 if ( GetBuilder( i )==myHilighter )
748 myHilighter.Nullify();
753 //================================================================
754 // Function : SetHiddenElems
756 //================================================================
757 void MeshVS_Mesh::SetHiddenElems ( const Handle(TColStd_HPackedMapOfInteger)& theMap )
759 myHiddenElements = theMap;
761 // Note: update of list of selectable nodes -- this is not optimal!
762 Standard_Boolean AutoSelUpdate = Standard_False;
763 if ( !GetDrawer().IsNull() && GetDrawer()->GetBoolean( MeshVS_DA_SelectableAuto, AutoSelUpdate ) &&
765 UpdateSelectableNodes();
768 //================================================================
769 // Function : SetHiddenNodes
771 //================================================================
772 void MeshVS_Mesh::SetHiddenNodes ( const Handle(TColStd_HPackedMapOfInteger)& theMap )
774 myHiddenNodes = theMap;
776 // Note: update of list of selectable nodes -- this is not optimal!
777 Standard_Boolean AutoSelUpdate = Standard_False;
778 if ( !GetDrawer().IsNull() && GetDrawer()->GetBoolean( MeshVS_DA_SelectableAuto, AutoSelUpdate ) &&
780 UpdateSelectableNodes();
783 //================================================================
784 // Function : GetHiddenElems
786 //================================================================
787 const Handle(TColStd_HPackedMapOfInteger)& MeshVS_Mesh::GetHiddenElems () const
789 return myHiddenElements;
792 //================================================================
793 // Function : GetHiddenNodes
795 //================================================================
796 const Handle(TColStd_HPackedMapOfInteger)& MeshVS_Mesh::GetHiddenNodes () const
798 return myHiddenNodes;
801 //================================================================
802 // Function : AddToMap
804 //================================================================
805 void AddToMap ( MeshVS_DataMapOfIntegerOwner& Result, const MeshVS_DataMapOfIntegerOwner& Addition )
807 MeshVS_DataMapIteratorOfDataMapOfIntegerOwner anIt ( Addition );
808 for ( ; anIt.More(); anIt.Next() )
809 if ( Result.IsBound ( anIt.Key() ) )
810 Result.ChangeFind ( anIt.Key() ) = anIt.Value();
812 Result.Bind( anIt.Key(), anIt.Value() );
815 //================================================================
816 // Function : GetOwnerMaps
818 //================================================================
819 const MeshVS_DataMapOfIntegerOwner& MeshVS_Mesh::GetOwnerMaps ( const Standard_Boolean IsElements )
821 Handle(MeshVS_DataSource) aDS = GetDataSource();
822 if( !aDS.IsNull() && aDS->IsAdvancedSelectionEnabled() )
826 if ( myElementOwners.IsEmpty() )
828 AddToMap ( myElementOwners, my0DOwners );
829 AddToMap ( myElementOwners, myLinkOwners );
830 AddToMap ( myElementOwners, myFaceOwners );
831 AddToMap ( myElementOwners, myVolumeOwners );
833 return myElementOwners;
839 //================================================================
840 // Function : IsHiddenElem
842 //================================================================
843 Standard_Boolean MeshVS_Mesh::IsHiddenElem ( const Standard_Integer theID ) const
845 return ! myHiddenElements.IsNull() && myHiddenElements->Map().Contains( theID );
848 //================================================================
849 // Function : IsHiddenNode
851 //================================================================
852 Standard_Boolean MeshVS_Mesh::IsHiddenNode ( const Standard_Integer theID ) const
854 // note that by default all nodes are hidden
855 return myHiddenNodes.IsNull() || myHiddenNodes->Map().Contains( theID );
858 //================================================================
859 // Function : GetDrawer
861 //================================================================
862 Handle( MeshVS_Drawer ) MeshVS_Mesh::GetDrawer() const
864 return myCurrentDrawer;
867 //================================================================
868 // Function : SetDrawer
870 //================================================================
871 void MeshVS_Mesh::SetDrawer(const Handle(MeshVS_Drawer)& aDrawer)
873 myCurrentDrawer = aDrawer;
876 //================================================================
877 // Function : GetDataSource
879 //================================================================
880 Handle(MeshVS_DataSource) MeshVS_Mesh::GetDataSource() const
885 //================================================================
886 // Function : SetDataSource
888 //================================================================
889 void MeshVS_Mesh::SetDataSource( const Handle(MeshVS_DataSource)& theDataSource )
891 myDataSource = theDataSource;
894 //================================================================
895 // Function : HilightSelected
897 //================================================================
898 void MeshVS_Mesh::HilightSelected ( const Handle(PrsMgr_PresentationManager3d)& thePM,
899 const SelectMgr_SequenceOfOwner& theOwners )
901 if ( myHilighter.IsNull() )
904 // if ( mySelectionPrs.IsNull() )
905 // mySelectionPrs = new Prs3d_Presentation ( thePM->StructureManager() );
909 Handle( Prs3d_Presentation ) aSelectionPrs;
911 aSelectionPrs = GetSelectPresentation( thePM );
913 if( HasPresentation() )
914 aSelectionPrs->SetTransformPersistence( Presentation()->TransformPersistenceMode(), Presentation()->TransformPersistencePoint() );
917 // It is very important to call this parent method, because it check whether
918 // mySelectionPrs is created and if not, create it.
926 Standard_Integer len = theOwners.Length(), i;
928 Handle (MeshVS_MeshEntityOwner) anOwner;
929 TColStd_PackedMapOfInteger aSelNodes, aSelElements;
931 for( i=1; i<=len; i++ )
933 anOwner = Handle (MeshVS_MeshEntityOwner)::DownCast ( theOwners.Value ( i ) );
934 if ( !anOwner.IsNull() )
936 // nkv: add support of mesh groups
937 if ( anOwner->IsGroup() ) {
938 MeshVS_EntityType aGroupType;
939 TColStd_PackedMapOfInteger aGroupMap;
940 if ( GetDataSource()->GetGroup( anOwner->ID(), aGroupType, aGroupMap ) ) {
941 if ( aGroupType == MeshVS_ET_Node ) {
942 for( TColStd_MapIteratorOfPackedMapOfInteger anIt(aGroupMap); anIt.More(); anIt.Next() )
943 if( IsSelectableNode/*!IsHiddenNode*/( anIt.Key() ) )
944 aSelNodes.Add( anIt.Key() );
947 for( TColStd_MapIteratorOfPackedMapOfInteger anIt(aGroupMap); anIt.More(); anIt.Next() )
948 if( IsSelectableElem/*!IsHiddenElem*/( anIt.Key() ) )
949 aSelElements.Add( anIt.Key() );
954 if( anOwner->Type() == MeshVS_ET_Node )
955 aSelNodes.Add( anOwner->ID() );
957 aSelElements.Add( anOwner->ID() );
960 else if( GetDataSource()->IsAdvancedSelectionEnabled() )
962 Handle(MeshVS_MeshOwner) aMeshOwner = Handle(MeshVS_MeshOwner)::DownCast ( theOwners.Value ( i ) );
963 if( !aMeshOwner.IsNull() )
965 Handle(TColStd_HPackedMapOfInteger) aNodes = aMeshOwner->GetSelectedNodes();
966 Handle(TColStd_HPackedMapOfInteger) aElems = aMeshOwner->GetSelectedElements();
967 if( !aNodes.IsNull() )
968 aSelNodes.Assign( aNodes->Map() );
969 if( !aElems.IsNull() )
970 aSelElements.Assign( aElems->Map() );
973 //agv else if( theOwners.Value ( i )==myWholeMeshOwner )
974 else if (IsWholeMeshOwner (theOwners.Value ( i )))
976 TColStd_MapIteratorOfPackedMapOfInteger anIt(GetDataSource()->GetAllNodes());
977 for( ; anIt.More(); anIt.Next() )
978 if( !IsHiddenNode( anIt.Key() ) )
979 aSelNodes.Add( anIt.Key() );
981 anIt = TColStd_MapIteratorOfPackedMapOfInteger( GetDataSource()->GetAllElements() );
982 for( ; anIt.More(); anIt.Next() )
983 if( !IsHiddenElem( anIt.Key() ) )
984 aSelElements.Add( anIt.Key() );
990 Standard_Boolean IsNeedToRedisplay = Standard_False;
992 aSelectionPrs->Clear();
994 myHilighter->SetDrawer ( mySelectionDrawer );
996 if( aSelNodes.Extent()>0 )
998 TColStd_PackedMapOfInteger tmp;
999 myHilighter->Build ( aSelectionPrs, aSelNodes, tmp, Standard_False, MeshVS_DMF_SelectionPrs );
1001 if( aSelElements.Extent()>0 )
1003 TColStd_PackedMapOfInteger tmp;
1004 myHilighter->Build( aSelectionPrs, aSelElements, tmp, Standard_True, MeshVS_DMF_SelectionPrs );
1007 myHilighter->SetDrawer ( 0 );
1009 IsNeedToRedisplay = Standard_True;
1011 if ( IsNeedToRedisplay )
1013 aSelectionPrs->SetDisplayPriority(9);
1014 aSelectionPrs->Display();
1018 Standard_Real sec, cpu;
1019 Standard_Integer min, hour;
1021 gTimer.Show ( sec, min, hour, cpu );
1022 cout << "HilightSelected : " << endl;
1023 cout << aSelNodes.Extent() << " nodes " << endl;
1024 cout << aSelElements.Extent() << " elements " << endl;
1025 cout << "Time : " << sec << " sec" << endl;
1026 cout << "CPU time : " << cpu << " sec" << endl << endl;
1031 //================================================================
1032 // Function : HilightOwnerWithColor
1034 //================================================================
1035 void MeshVS_Mesh::HilightOwnerWithColor ( const Handle(PrsMgr_PresentationManager3d)& PM,
1036 const Quantity_NameOfColor Color,
1037 const Handle(SelectMgr_EntityOwner)& Owner)
1039 if ( myHilighter.IsNull() )
1042 SelectMgr_SequenceOfOwner theOwners;
1045 //if ( myHilightPrs.IsNull() )
1046 // myHilightPrs = new Prs3d_Presentation ( PM->StructureManager() );
1048 Handle( Prs3d_Presentation ) aHilightPrs;
1049 aHilightPrs = GetHilightPresentation( PM );
1051 aHilightPrs->Clear();
1054 if( HasPresentation() )
1055 aHilightPrs->SetTransformPersistence( Presentation()->TransformPersistenceMode(), Presentation()->TransformPersistencePoint() );
1058 if( Owner.IsNull() ) return;
1060 const Standard_Boolean isMeshEntityOwner = Owner->IsKind ( STANDARD_TYPE ( MeshVS_MeshEntityOwner ) );
1061 const Standard_Boolean isWholeMeshOwner =
1062 //agv !Owner.IsNull() && Owner==myWholeMeshOwner;
1063 IsWholeMeshOwner (Owner);
1065 Standard_Integer aDispMode = MeshVS_DMF_Shading;
1066 if ( HasDisplayMode() && ( DisplayMode() & MeshVS_DMF_OCCMask ) > MeshVS_DMF_WireFrame )
1067 aDispMode = ( DisplayMode() & MeshVS_DMF_OCCMask );
1068 //It because we draw hilighted owners only in shading or shrink (not in wireframe)
1070 myHilightDrawer->SetColor( MeshVS_DA_InteriorColor, Color );
1071 myHilightDrawer->SetColor( MeshVS_DA_BackInteriorColor, Color );
1072 myHilightDrawer->SetColor( MeshVS_DA_EdgeColor, Color );
1073 myHilightDrawer->SetColor( MeshVS_DA_BeamColor, Color );
1074 myHilightDrawer->SetColor( MeshVS_DA_MarkerColor, Color );
1075 myHilighter->SetDrawer( myHilightDrawer );
1077 if( isMeshEntityOwner )
1079 Handle ( MeshVS_MeshEntityOwner ) theAISOwner = Handle ( MeshVS_MeshEntityOwner )::DownCast ( Owner );
1080 MeshVS_EntityType aType = theAISOwner->Type();
1081 Standard_Integer anID = theAISOwner->ID();
1083 if ( theAISOwner->IsGroup() ) {
1084 MeshVS_EntityType aGroupType;
1085 TColStd_PackedMapOfInteger aGroupMap;
1086 if ( myDataSource->GetGroup( anID, aGroupType, aGroupMap ) ) {
1087 TColStd_PackedMapOfInteger tmp;
1088 myHilighter->Build( aHilightPrs, aGroupMap, tmp, aType!=MeshVS_ET_Node,
1089 aDispMode | MeshVS_DMF_HilightPrs );
1093 TColStd_PackedMapOfInteger anOne, tmp;
1095 myHilighter->Build( aHilightPrs, anOne, tmp, aType!=MeshVS_ET_Node,
1096 aDispMode | MeshVS_DMF_HilightPrs );
1099 else if( isWholeMeshOwner )
1101 if( ! GetDataSource().IsNull() )
1103 TColStd_PackedMapOfInteger tmp;
1104 myHilighter->Build( aHilightPrs, GetDataSource()->GetAllElements(), tmp,
1105 Standard_True, MeshVS_DMF_WireFrame );
1110 Handle(MeshVS_MeshOwner) aMeshOwner = Handle(MeshVS_MeshOwner)::DownCast ( Owner );
1111 if( !aMeshOwner.IsNull() )
1113 Handle(TColStd_HPackedMapOfInteger) aNodes = aMeshOwner->GetDetectedNodes();
1114 Handle(TColStd_HPackedMapOfInteger) aElems = aMeshOwner->GetDetectedElements();
1115 // hilight detected entities
1116 if( !aNodes.IsNull() )
1118 TColStd_PackedMapOfInteger tmp;
1119 myHilighter->Build( aHilightPrs, aNodes->Map(), tmp, Standard_False,
1120 aDispMode | MeshVS_DMF_HilightPrs );
1122 if( !aElems.IsNull() )
1124 TColStd_PackedMapOfInteger tmp;
1125 myHilighter->Build( aHilightPrs, aElems->Map(), tmp, Standard_True,
1126 aDispMode | MeshVS_DMF_HilightPrs );
1131 if (PM->IsImmediateModeOn())
1133 PM->AddToImmediateList (aHilightPrs);
1135 myHilighter->SetDrawer ( 0 );
1138 //=======================================================================
1139 //function : ClearSelected
1141 //=======================================================================
1142 void MeshVS_Mesh::ClearSelected ()
1144 Handle( Prs3d_Presentation ) aSelectionPrs = GetSelectPresentation( NULL );
1145 if( !aSelectionPrs.IsNull() )
1146 aSelectionPrs->Clear();
1149 //=======================================================================
1150 //function : FindBuilder
1152 //=======================================================================
1153 Handle (MeshVS_PrsBuilder) MeshVS_Mesh::FindBuilder ( const Standard_CString theTypeName ) const
1155 Standard_Integer len = myBuilders.Length();
1156 Handle(MeshVS_PrsBuilder) aBuilder;
1157 Standard_Boolean IsExist = Standard_False;
1159 for ( Standard_Integer i=1; i<=len && !IsExist; i++)
1160 if ( myBuilders.Value (i)->IsKind ( theTypeName ) )
1162 aBuilder = myBuilders.Value (i);
1163 IsExist = Standard_True;
1169 //=======================================================================
1170 //function : SetHilighter
1172 //=======================================================================
1173 void MeshVS_Mesh::SetHilighter ( const Handle( MeshVS_PrsBuilder )& Builder )
1175 myHilighter = Builder;
1178 //=======================================================================
1179 //function : SetHilighter
1181 //=======================================================================
1182 Standard_Boolean MeshVS_Mesh::SetHilighter ( const Standard_Integer Index )
1184 Handle( MeshVS_PrsBuilder ) aBuild = GetBuilder( Index );
1185 Standard_Boolean aRes = ( !aBuild.IsNull() );
1187 myHilighter = aBuild;
1191 //=======================================================================
1192 //function : SetHilighter
1194 //=======================================================================
1195 Standard_Boolean MeshVS_Mesh::SetHilighterById ( const Standard_Integer Id )
1197 Handle( MeshVS_PrsBuilder ) aBuild = GetBuilderById( Id );
1198 Standard_Boolean aRes = ( !aBuild.IsNull() );
1200 myHilighter = aBuild;
1204 //=======================================================================
1205 //function : GetHilighter
1207 //=======================================================================
1208 Handle( MeshVS_PrsBuilder ) MeshVS_Mesh::GetHilighter () const
1213 //=======================================================================
1214 //function : IsSelectableElem
1216 //=======================================================================
1217 Standard_Boolean MeshVS_Mesh::IsSelectableElem ( const Standard_Integer ID ) const
1219 return ! IsHiddenElem ( ID );
1222 //=======================================================================
1223 //function : IsSelectableNode
1225 //=======================================================================
1226 Standard_Boolean MeshVS_Mesh::IsSelectableNode ( const Standard_Integer ID ) const
1228 return mySelectableNodes.IsNull() ? ! IsHiddenNode ( ID ) :
1229 mySelectableNodes->Map().Contains( ID );
1232 //=======================================================================
1233 //function : GetSelectableNodes
1235 //=======================================================================
1236 const Handle(TColStd_HPackedMapOfInteger)& MeshVS_Mesh::GetSelectableNodes () const
1238 return mySelectableNodes;
1241 //=======================================================================
1242 //function : SetSelectableNodes
1244 //=======================================================================
1245 void MeshVS_Mesh::SetSelectableNodes ( const Handle(TColStd_HPackedMapOfInteger)& Ids )
1247 mySelectableNodes = Ids;
1250 //=======================================================================
1251 //function : UpdateSelectableNodes
1253 //=======================================================================
1254 void MeshVS_Mesh::UpdateSelectableNodes()
1256 mySelectableNodes = new TColStd_HPackedMapOfInteger;
1258 Standard_Integer aMaxFaceNodes;
1259 Handle( MeshVS_DataSource ) aSource = GetDataSource();
1260 if ( aSource.IsNull() || myCurrentDrawer.IsNull() || !myCurrentDrawer->GetInteger
1261 ( MeshVS_DA_MaxFaceNodes, aMaxFaceNodes ) || aMaxFaceNodes<=0 )
1264 // all non-hidden nodes are selectable;
1265 // by default (i.e. if myHiddenNodes.IsNull()) all nodes are hidden
1266 if ( ! myHiddenNodes.IsNull() )
1268 mySelectableNodes->ChangeMap().Subtraction (aSource->GetAllNodes(),
1269 myHiddenNodes->Map());
1272 // add all nodes belonging to non-hidden elements
1273 TColStd_MapIteratorOfPackedMapOfInteger anIter( aSource->GetAllElements() );
1274 for ( ; anIter.More(); anIter.Next() )
1276 Standard_Integer aKey = anIter.Key();
1277 if ( IsHiddenElem (aKey) )
1280 MeshVS_Buffer aNodesBuf (aMaxFaceNodes*sizeof(Standard_Integer));
1281 TColStd_Array1OfInteger aNodes (aNodesBuf, 1, aMaxFaceNodes);
1282 Standard_Integer NbNodes;
1283 if ( !aSource->GetNodesByElement ( aKey, aNodes, NbNodes ) )
1285 for ( Standard_Integer i=1; i<=NbNodes; i++ )
1286 mySelectableNodes->ChangeMap().Add ( aNodes(i) );
1290 //=======================================================================
1291 //function : GetMeshSelMethod
1293 //=======================================================================
1294 MeshVS_MeshSelectionMethod MeshVS_Mesh::GetMeshSelMethod() const
1296 return mySelectionMethod;
1299 //=======================================================================
1300 //function : SetMeshSelMethod
1302 //=======================================================================
1303 void MeshVS_Mesh::SetMeshSelMethod( const MeshVS_MeshSelectionMethod M )
1305 mySelectionMethod = M;
1308 //=======================================================================
1309 //function : IsWholeMeshOwner
1311 //=======================================================================
1313 Standard_Boolean MeshVS_Mesh::IsWholeMeshOwner
1314 (const Handle(SelectMgr_EntityOwner)& theOwn) const
1316 return theOwn.IsNull() ? Standard_False : (theOwn == myWholeMeshOwner);