1 // Created on: 2003-09-09
2 // Created by: Alexander SOLOVYOV
3 // Copyright (c) 2003-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
21 #include <MeshVS_Mesh.ixx>
23 #include <AIS_InteractiveContext.hxx>
25 #include <Prs3d_Root.hxx>
27 #include <TColgp_Array1OfPnt.hxx>
29 #include <Select3D_SensitivePoint.hxx>
30 #include <SelectMgr_Selection.hxx>
32 #include <Aspect_MarkerStyle.hxx>
33 #include <Aspect_LineStyle.hxx>
34 #include <Aspect_InteriorStyle.hxx>
36 #include <Prs3d_PointAspect.hxx>
37 #include <Prs3d_LineAspect.hxx>
38 #include <Prs3d_ShadingAspect.hxx>
39 #include <Prs3d_Presentation.hxx>
40 #include <PrsMgr_ModedPresentation.hxx>
41 #include <PrsMgr_PresentationManager3d.hxx>
43 #include <SelectBasics_SensitiveEntity.hxx>
44 #include <SelectMgr_SequenceOfOwner.hxx>
45 #include <Select3D_SensitiveGroup.hxx>
46 #include <Select3D_SensitiveBox.hxx>
48 #include <Graphic3d_MaterialAspect.hxx>
49 #include <Graphic3d_AspectFillArea3d.hxx>
50 #include <Graphic3d_NameOfMaterial.hxx>
52 #include <TColStd_Array1OfReal.hxx>
53 #include <TColStd_Array1OfInteger.hxx>
54 #include <TColStd_MapIteratorOfPackedMapOfInteger.hxx>
55 #include <TColStd_ListIteratorOfListOfReal.hxx>
56 #include <TColStd_SequenceOfInteger.hxx>
57 #include <TColStd_ListIteratorOfListOfInteger.hxx>
59 #include <Bnd_Box.hxx>
61 #include <MeshVS_DataSource.hxx>
62 #include <MeshVS_MeshEntityOwner.hxx>
63 #include <MeshVS_MeshOwner.hxx>
64 #include <MeshVS_SensitiveMesh.hxx>
65 #include <MeshVS_DummySensitiveEntity.hxx>
66 #include <MeshVS_SensitiveSegment.hxx>
67 #include <MeshVS_SensitiveFace.hxx>
68 #include <MeshVS_DrawerAttribute.hxx>
69 #include <MeshVS_DataMapIteratorOfDataMapOfIntegerOwner.hxx>
70 #include <MeshVS_SensitivePolyhedron.hxx>
71 #include <MeshVS_SelectionModeFlags.hxx>
72 #include <MeshVS_Buffer.hxx>
74 #include <OSD_Timer.hxx>
76 //================================================================
77 // Function : Constructor MeshVS_Mesh
79 //================================================================
80 MeshVS_Mesh::MeshVS_Mesh (const Standard_Boolean theIsAllowOverlapped )
82 myDataSource.Nullify();
83 myHilighter.Nullify();
84 myWholeMeshOwner.Nullify();
85 mySelectionMethod = MeshVS_MSM_NODES;
87 SetAutoHilight ( Standard_False );
89 SetDisplayMode( MeshVS_DMF_WireFrame ); // Mode as defaut
90 SetHilightMode( MeshVS_DMF_WireFrame ); // Wireframe as default hilight mode
92 SetColor ( Quantity_NOC_WHITE );
93 SetMaterial ( Graphic3d_NOM_PLASTIC );
95 myCurrentDrawer = new MeshVS_Drawer();
96 myCurrentDrawer->SetColor ( MeshVS_DA_InteriorColor, Quantity_NOC_BLUE4 );
97 myCurrentDrawer->SetInteger ( MeshVS_DA_InteriorStyle, Aspect_IS_SOLID );
98 myCurrentDrawer->SetInteger ( MeshVS_DA_MaxFaceNodes, 10 );
99 myCurrentDrawer->SetBoolean ( MeshVS_DA_IsAllowOverlapped, theIsAllowOverlapped );
100 myCurrentDrawer->SetBoolean ( MeshVS_DA_Reflection, Standard_True );
101 myCurrentDrawer->SetDouble ( MeshVS_DA_ShrinkCoeff, 0.8 );
102 myCurrentDrawer->SetBoolean ( MeshVS_DA_ComputeTime, Standard_False );
103 myCurrentDrawer->SetBoolean ( MeshVS_DA_ComputeSelectionTime, Standard_False );
104 myCurrentDrawer->SetBoolean ( MeshVS_DA_DisplayNodes, Standard_True );
105 myCurrentDrawer->SetDouble ( MeshVS_DA_EdgeWidth, 1.0 );
106 myCurrentDrawer->SetInteger ( MeshVS_DA_EdgeType, Aspect_TOL_SOLID );
107 myCurrentDrawer->SetInteger ( MeshVS_DA_MarkerType, Aspect_TOM_O );
108 myCurrentDrawer->SetColor ( MeshVS_DA_MarkerColor, Quantity_NOC_WHITE );
109 myCurrentDrawer->SetDouble ( MeshVS_DA_MarkerScale, 1.0 );
110 myCurrentDrawer->SetInteger ( MeshVS_DA_BeamType, Aspect_TOL_SOLID );
111 myCurrentDrawer->SetDouble ( MeshVS_DA_BeamWidth, 1.0 );
112 myCurrentDrawer->SetBoolean ( MeshVS_DA_SmoothShading, Standard_False );
113 myCurrentDrawer->SetBoolean ( MeshVS_DA_SupressBackFaces, Standard_False );
115 mySelectionDrawer = new MeshVS_Drawer();
116 mySelectionDrawer->Assign ( myCurrentDrawer );
117 mySelectionDrawer->SetInteger ( MeshVS_DA_MarkerType, Aspect_TOM_STAR );
118 mySelectionDrawer->SetColor ( MeshVS_DA_MarkerColor, Quantity_NOC_GRAY80 );
119 mySelectionDrawer->SetDouble ( MeshVS_DA_MarkerScale, 2.0 );
121 mySelectionDrawer->SetColor ( MeshVS_DA_BeamColor, Quantity_NOC_GRAY80 );
122 mySelectionDrawer->SetInteger ( MeshVS_DA_BeamType, Aspect_TOL_SOLID );
123 mySelectionDrawer->SetDouble ( MeshVS_DA_BeamWidth, 3.0 );
125 myHilightDrawer = new MeshVS_Drawer ();
126 myHilightDrawer->Assign ( myCurrentDrawer );
127 myHilightDrawer->SetDouble ( MeshVS_DA_ShrinkCoeff, 0.7 );
128 myHilightDrawer->SetInteger ( MeshVS_DA_InteriorStyle, Aspect_IS_SOLID );
129 myHilightDrawer->SetColor ( MeshVS_DA_InteriorColor, Quantity_NOC_YELLOW );
130 myHilightDrawer->SetColor ( MeshVS_DA_BackInteriorColor, Quantity_NOC_YELLOW );
131 myHilightDrawer->SetColor ( MeshVS_DA_EdgeColor, Quantity_NOC_GREEN );
132 myHilightDrawer->SetInteger ( MeshVS_DA_EdgeType, Aspect_TOL_SOLID );
133 myHilightDrawer->SetDouble ( MeshVS_DA_EdgeWidth, 1.0 );
134 myHilightDrawer->SetMaterial ( MeshVS_DA_FrontMaterial, Graphic3d_NOM_PLASTIC );
135 myHilightDrawer->SetMaterial ( MeshVS_DA_BackMaterial, Graphic3d_NOM_PLASTIC );
137 myHilightDrawer->SetColor ( MeshVS_DA_BeamColor, Quantity_NOC_GRAY80 );
138 myHilightDrawer->SetInteger ( MeshVS_DA_BeamType, Aspect_TOL_SOLID );
139 myHilightDrawer->SetDouble ( MeshVS_DA_BeamWidth, 3.0 );
141 myHilightDrawer->SetInteger ( MeshVS_DA_MarkerType, Aspect_TOM_STAR );
142 myHilightDrawer->SetColor ( MeshVS_DA_MarkerColor, Quantity_NOC_GRAY80 );
143 myHilightDrawer->SetDouble ( MeshVS_DA_MarkerScale, 2.0 );
146 void MeshVS_Mesh::Destroy()
150 //================================================================
151 // Function : Compute
153 //================================================================
154 void MeshVS_Mesh::Compute ( const Handle(PrsMgr_PresentationManager3d)& thePrsMgr,
155 const Handle(Prs3d_Presentation)& thePresentation,
156 const Standard_Integer theMode )
160 Standard_Boolean ShowComputeTime = Standard_True;
161 myCurrentDrawer->GetBoolean( MeshVS_DA_ComputeTime, ShowComputeTime );
163 if ( ShowComputeTime )
169 // Repair Ids in map if necessary
170 Handle( MeshVS_DataSource ) aDS = GetDataSource();
174 const TColStd_PackedMapOfInteger& aNodes = aDS->GetAllNodes();
175 const TColStd_PackedMapOfInteger& aElems = aDS->GetAllElements();
176 Standard_Boolean HasNodes = !aNodes.IsEmpty(),
177 HasElements = !aElems.IsEmpty();
179 TColStd_PackedMapOfInteger aNodesToExclude, aElemsToExclude;
181 thePresentation->Clear();
182 Standard_Integer len = myBuilders.Length();
184 for ( Standard_Integer i=1; i<=len; i++ )
186 Handle (MeshVS_PrsBuilder) aCurrent = myBuilders.Value ( i );
187 if ( !aCurrent.IsNull() && aCurrent->TestFlags ( theMode ) )
189 aCurrent->SetPresentationManager( thePrsMgr );
191 aCurrent->Build ( thePresentation, aNodes, aNodesToExclude, Standard_False, theMode );
193 aCurrent->Build ( thePresentation, aElems, aElemsToExclude, Standard_True, theMode );
198 if ( ShowComputeTime )
200 Standard_Real sec, cpu;
201 Standard_Integer min, hour;
203 gTimer.Show ( sec, min, hour, cpu );
204 cout << "DisplayMode : " << theMode << endl;
205 cout << "Compute : " << sec << " sec" << endl;
206 cout << "Compute CPU : " << cpu << " sec" << endl << endl;
211 //================================================================
212 // Function : ComputeSelection
214 //================================================================
215 void MeshVS_Mesh::ComputeSelection ( const Handle(SelectMgr_Selection)& theSelection,
216 const Standard_Integer theMode )
220 Standard_Boolean ShowComputeSelectionTime = Standard_True;
221 myCurrentDrawer->GetBoolean( MeshVS_DA_ComputeSelectionTime, ShowComputeSelectionTime );
223 if ( ShowComputeSelectionTime )
229 Standard_Integer aMaxFaceNodes;
230 Handle( MeshVS_DataSource ) aSource = GetDataSource();
232 if ( aSource.IsNull() || myCurrentDrawer.IsNull() || !myCurrentDrawer->GetInteger
233 ( MeshVS_DA_MaxFaceNodes, aMaxFaceNodes ) || aMaxFaceNodes<=0 )
236 MeshVS_Buffer aCoordsBuf (3*aMaxFaceNodes*sizeof(Standard_Real));
237 TColStd_Array1OfReal aCoords (aCoordsBuf, 1, 3*aMaxFaceNodes);
238 Standard_Integer NbNodes;
240 MeshVS_EntityType aType;
241 Standard_Address anAddr;
242 TColStd_MapIteratorOfPackedMapOfInteger anIter;
243 Standard_Real x, y, z;
245 Standard_Integer aMode = HasDisplayMode() ? DisplayMode() : DefaultDisplayMode();
246 if ( myHilighter.IsNull() || ( aMode & MeshVS_DMF_OCCMask ) == 0 )
248 const TColStd_PackedMapOfInteger& anAllNodesMap = aSource->GetAllNodes();
249 const TColStd_PackedMapOfInteger& anAllElementsMap= aSource->GetAllElements();
250 //agv Standard_Integer i;
252 // skt: advanced mesh selection
253 if( aSource->IsAdvancedSelectionEnabled() ) {
254 Handle(MeshVS_MeshOwner) anOwner;
255 // Get the owner if it is already created
256 MeshVS_DataMapIteratorOfDataMapOfIntegerOwner anIt( GetOwnerMaps( Standard_False ) );
257 for( ; anIt.More(); anIt.Next() )
259 anOwner = Handle(MeshVS_MeshOwner)::DownCast( anIt.Value() );
260 // clear selected entities
261 if( !anOwner.IsNull() )
264 if( anOwner.IsNull() )
265 // Create one owner for the whole mesh and for all selection modes
266 anOwner = new MeshVS_MeshOwner( this, aSource, 5 );
267 // Save the owner. It will be available via GetOwnerMaps method
268 if( !myMeshOwners.IsBound( 1 ) )
269 myMeshOwners.Bind( 1, anOwner );
270 // Create one sensitive entity. It should detect mesh entities correspondingly
272 Handle(MeshVS_SensitiveMesh) aSensMesh = new MeshVS_SensitiveMesh( anOwner, theMode );
273 theSelection->Add ( aSensMesh );
278 case MeshVS_SMF_Node: // Nodes
280 myNodeOwners.Clear();
282 for ( anIter.Initialize( anAllNodesMap ); anIter.More(); anIter.Next() )
284 Standard_Integer aKey = anIter.Key();
285 if ( !myDataSource->GetGeom ( aKey, Standard_False, aCoords, NbNodes, aType ) )
288 anAddr = myDataSource->GetAddr ( aKey, Standard_False );
290 Handle (MeshVS_MeshEntityOwner) anOwner = new MeshVS_MeshEntityOwner
291 ( this, aKey, anAddr, aType, 5 );
293 myNodeOwners.Bind ( aKey, anOwner );
295 if ( IsSelectableNode( aKey ) )
300 Handle (Select3D_SensitivePoint) aPoint = new Select3D_SensitivePoint
301 ( anOwner, gp_Pnt (x, y, z) );
302 theSelection->Add ( aPoint );
305 theSelection->Add ( new MeshVS_DummySensitiveEntity ( anOwner ) );
309 case MeshVS_SMF_Mesh:
311 if( myWholeMeshOwner.IsNull() )
312 myWholeMeshOwner = new SelectMgr_EntityOwner( this );
314 switch( mySelectionMethod )
318 Standard_Real min[3], max[3]; Standard_Boolean first = Standard_True;
319 TColStd_MapIteratorOfPackedMapOfInteger anIterN( anAllNodesMap );
321 for( ; anIterN.More(); anIterN.Next() )
322 if( myDataSource->GetGeom( anIterN.Key(), Standard_False, aCoords, NbNodes, aType ) )
325 for( Standard_Integer i=1; i<=3; i++ )
326 min[i-1] = max[i-1] = aCoords( i );
327 first = Standard_False;
330 for( Standard_Integer i=1; i<=3; i++ )
332 if( aCoords( i )<min[i-1] )
333 min[i-1] = aCoords( i );
334 if( aCoords( i )>max[i-1] )
335 max[i-1] = aCoords( i );
338 box.Add( gp_Pnt( min[0], min[1], min[2] ) );
339 box.Add( gp_Pnt( max[0], max[1], max[2] ) );
341 theSelection->Add( new Select3D_SensitiveBox( myWholeMeshOwner, box ) );
345 case MeshVS_MSM_NODES:
347 TColStd_MapIteratorOfPackedMapOfInteger anIterN( anAllNodesMap );
348 for( ; anIterN.More(); anIterN.Next() )
349 if( myDataSource->GetGeom( anIterN.Key(), Standard_False, aCoords, NbNodes, aType ) &&
350 !IsHiddenNode( anIterN.Key() ) )
351 theSelection->Add( new Select3D_SensitivePoint( myWholeMeshOwner, gp_Pnt ( aCoords(1), aCoords(2), aCoords(3) ) ) );
355 case MeshVS_MSM_PRECISE:
357 Handle( Select3D_SensitiveEntity ) anEnt;
358 TColStd_MapIteratorOfPackedMapOfInteger anIterMV( anAllElementsMap );
360 TColStd_PackedMapOfInteger aSharedNodes;
361 for( ; anIterMV.More(); anIterMV.Next() )
363 Standard_Integer aKey = anIterMV.Key();
365 if( IsSelectableElem( aKey ) &&
366 myDataSource->GetGeomType( aKey, Standard_True, aType ) &&
367 aType==MeshVS_ET_Face )
369 myDataSource->GetGeom ( aKey, Standard_True, aCoords, NbNodes, aType );
373 MeshVS_Buffer aNodesBuf (NbNodes*sizeof(Standard_Integer));
374 TColStd_Array1OfInteger aElemNodes(aNodesBuf, 1, NbNodes);
375 if ( !myDataSource->GetNodesByElement ( aKey, aElemNodes, NbNodes ) )
378 TColgp_Array1OfPnt Points( 1, NbNodes );
379 for ( Standard_Integer i=1; i<=NbNodes; i++ )
381 Points (i) = gp_Pnt ( aCoords (3*i-2), aCoords (3*i-1), aCoords (3*i) );
382 aSharedNodes.Add( aElemNodes( i ) );
385 anEnt = new Select3D_SensitiveFace( myWholeMeshOwner, Points );
386 theSelection->Add( anEnt );
389 for( anIterMV.Initialize( anAllElementsMap ); anIterMV.More(); anIterMV.Next() )
391 Standard_Integer aKey = anIterMV.Key();
393 if( IsSelectableElem( aKey ) &&
394 myDataSource->GetGeomType( aKey, Standard_True, aType ) &&
395 aType==MeshVS_ET_Link )
397 myDataSource->GetGeom ( aKey, Standard_True, aCoords, NbNodes, aType );
401 MeshVS_Buffer aNodesBuf (NbNodes*sizeof(Standard_Integer));
402 TColStd_Array1OfInteger aElemNodes(aNodesBuf, 1, NbNodes);
403 if ( !myDataSource->GetNodesByElement ( aKey, aElemNodes, NbNodes ) )
406 TColgp_Array1OfPnt Points( 1, NbNodes );
407 Standard_Boolean all_shared = Standard_True;
408 for ( Standard_Integer i=1; i<=NbNodes; i++ )
410 Points (i) = gp_Pnt ( aCoords (3*i-2), aCoords (3*i-1), aCoords (3*i) );
411 all_shared = all_shared && aSharedNodes.Contains( aElemNodes( i ) );
412 aSharedNodes.Add( aElemNodes( i ) );
417 anEnt = new Select3D_SensitiveSegment( myWholeMeshOwner, Points.Value( 1 ), Points.Value( 2 ) );
418 theSelection->Add( anEnt );
422 for( anIterMV.Initialize( anAllNodesMap ); anIterMV.More(); anIterMV.Next() )
424 Standard_Integer aKey = anIterMV.Key();
425 if( IsSelectableElem( aKey ) &&
426 myDataSource->GetGeom ( aKey, Standard_False, aCoords, NbNodes, aType ) &&
427 !aSharedNodes.Contains( aKey ) )
429 anEnt = new Select3D_SensitivePoint( myWholeMeshOwner, gp_Pnt ( aCoords(1), aCoords(2), aCoords(3) ) ) ;
430 theSelection->Add( anEnt );
438 case MeshVS_SMF_Group:
440 myGroupOwners.Clear();
442 TColStd_PackedMapOfInteger anAllGroupsMap;
443 aSource->GetAllGroups( anAllGroupsMap );
445 Handle( MeshVS_HArray1OfSequenceOfInteger ) aTopo;
447 for ( anIter.Initialize( anAllGroupsMap ); anIter.More(); anIter.Next() )
449 Standard_Integer aKeyGroup = anIter.Key();
451 MeshVS_EntityType aGroupType;
452 TColStd_PackedMapOfInteger aGroupMap;
453 if ( !myDataSource->GetGroup( aKeyGroup, aGroupType, aGroupMap ) )
456 anAddr = myDataSource->GetGroupAddr ( aKeyGroup );
457 Standard_Integer aPrior = 0;
459 if( aGroupType == MeshVS_ET_Volume )
461 if ( aGroupType == MeshVS_ET_Face )
463 else if ( aGroupType == MeshVS_ET_Link )
465 else if ( aGroupType == MeshVS_ET_0D )
467 else if ( aGroupType == MeshVS_ET_Node )
470 Handle (MeshVS_MeshEntityOwner) anOwner = new MeshVS_MeshEntityOwner
471 ( this, aKeyGroup, anAddr, aGroupType, aPrior, Standard_True );
473 myGroupOwners.Bind( aKeyGroup, anOwner );
475 Standard_Boolean added = Standard_False;
476 for ( TColStd_MapIteratorOfPackedMapOfInteger anIterMG (aGroupMap);
477 anIterMG.More(); anIterMG.Next() )
479 Standard_Integer aKey = anIterMG.Key();
480 if ( aGroupType == MeshVS_ET_Node ) {
481 if( myDataSource->GetGeom( aKey, Standard_False, aCoords, NbNodes, aType ) &&
482 IsSelectableNode/*!IsHiddenNode*/( aKey ) ) {
483 theSelection->Add( new Select3D_SensitivePoint( anOwner, gp_Pnt ( aCoords(1), aCoords(2), aCoords(3) ) ) );
484 added = Standard_True;
487 else if ( myDataSource->GetGeomType ( aKey, Standard_True, aType ) &&
488 IsSelectableElem/*!IsHiddenElem*/( aKey ) ) {
489 myDataSource->GetGeom ( aKey, Standard_True, aCoords, NbNodes, aType );
491 TColgp_Array1OfPnt anArr( 1, NbNodes );
492 for ( Standard_Integer i=1; i<=NbNodes; i++ )
497 anArr.SetValue ( i, gp_Pnt ( x, y, z ) );
500 if ( aType == MeshVS_ET_Face && NbNodes > 0 ) // Faces: 2D-elements
502 Handle (MeshVS_SensitiveFace) aFace =
503 new MeshVS_SensitiveFace( anOwner, anArr );
504 theSelection->Add ( aFace );
505 added = Standard_True;
507 else if ( aType == MeshVS_ET_Link && NbNodes > 0 ) // Links: 1D-elements
509 Handle (MeshVS_SensitiveSegment) aSeg = new MeshVS_SensitiveSegment
510 ( anOwner, anArr(1), anArr(2) );
511 theSelection->Add ( aSeg );
512 added = Standard_True;
514 else if( aType == MeshVS_ET_Volume && aSource->Get3DGeom( aKey, NbNodes, aTopo ) )
516 Handle( MeshVS_SensitivePolyhedron ) aPolyhedron =
517 new MeshVS_SensitivePolyhedron( anOwner, anArr, aTopo );
518 theSelection->Add( aPolyhedron );
519 added = Standard_True;
521 else //if ( aType == MeshVS_ET_0D ) // Custom : not only 0D-elements !!!
523 Handle (SelectBasics_SensitiveEntity) anEnt =
524 myHilighter->CustomSensitiveEntity ( anOwner, aKey );
525 if (!anEnt.IsNull()) {
526 theSelection->Add ( anEnt );
527 added = Standard_True;
533 theSelection->Add ( new MeshVS_DummySensitiveEntity ( anOwner ) );
538 default: // all residuary modes
540 Handle( MeshVS_HArray1OfSequenceOfInteger ) aTopo;
542 myElementOwners.Clear();
544 MeshVS_DataMapOfIntegerOwner* CurMap = &my0DOwners;
545 if ( theMode == MeshVS_ET_Link )
546 CurMap = &myLinkOwners;
547 else if ( theMode == MeshVS_ET_Face )
548 CurMap = &myFaceOwners;
549 else if ( theMode == MeshVS_ET_Volume )
550 CurMap = &myVolumeOwners;
554 for (TColStd_MapIteratorOfPackedMapOfInteger anIterMV (anAllElementsMap);
555 anIterMV.More(); anIterMV.Next() )
557 Standard_Integer aKey = anIterMV.Key();
559 if ( myDataSource->GetGeomType ( aKey, Standard_True, aType ) && theMode == aType )
561 myDataSource->GetGeom ( aKey, Standard_True, aCoords, NbNodes, aType );
562 anAddr = myDataSource->GetAddr ( aKey, Standard_True );
564 Standard_Integer aPrior = 0;
566 if( aType == MeshVS_ET_Volume )
568 if ( aType == MeshVS_ET_Face )
570 else if ( aType == MeshVS_ET_Link )
572 else if ( aType == MeshVS_ET_0D )
575 Handle (MeshVS_MeshEntityOwner) anOwner = new MeshVS_MeshEntityOwner
576 ( this, aKey, anAddr, aType, aPrior );
578 CurMap->Bind ( aKey, anOwner );
580 if ( IsSelectableElem( aKey ) ) //The element is selectable
582 TColgp_Array1OfPnt anArr( 1, NbNodes );
583 for ( Standard_Integer i=1; i<=NbNodes; i++ )
588 anArr.SetValue ( i, gp_Pnt ( x, y, z ) );
591 if ( aType == MeshVS_ET_Face && NbNodes > 0 ) // Faces: 2D-elements
593 Handle (MeshVS_SensitiveFace) aFace =
594 new MeshVS_SensitiveFace( anOwner, anArr );
595 theSelection->Add ( aFace );
597 else if ( aType == MeshVS_ET_Link && NbNodes > 0 ) // Links: 1D-elements
599 Handle (MeshVS_SensitiveSegment) aSeg = new MeshVS_SensitiveSegment
600 ( anOwner, anArr(1), anArr(2) );
601 theSelection->Add ( aSeg );
603 else if( aType == MeshVS_ET_Volume && aSource->Get3DGeom( aKey, NbNodes, aTopo ) )
605 Handle( MeshVS_SensitivePolyhedron ) aPolyhedron =
606 new MeshVS_SensitivePolyhedron( anOwner, anArr, aTopo );
607 theSelection->Add( aPolyhedron );
609 else //if ( aType == MeshVS_ET_0D ) // Custom : not only 0D-elements !!!
611 Handle (SelectBasics_SensitiveEntity) anEnt =
612 myHilighter->CustomSensitiveEntity ( anOwner, aKey );
614 theSelection->Add ( anEnt );
618 theSelection->Add ( new MeshVS_DummySensitiveEntity ( anOwner ) );
626 if ( ShowComputeSelectionTime )
628 Standard_Real sec, cpu;
629 Standard_Integer min, hour;
631 gTimer.Show ( sec, min, hour, cpu );
632 cout << "SelectionMode : " << theMode << endl;
633 cout << "Compute selection: " << sec << " sec" << endl;
634 cout << "Compute selection CPU : " << cpu << " sec" << endl << endl;
639 //================================================================
640 // Function : GetBuildersCount
642 //================================================================
643 Standard_Integer MeshVS_Mesh::GetBuildersCount () const
645 return myBuilders.Length();
648 //================================================================
649 // Function : GetFreeId
651 //================================================================
652 Standard_Integer MeshVS_Mesh::GetFreeId () const
654 TColStd_PackedMapOfInteger Ids;
655 Standard_Integer i, len = myBuilders.Length(), curId;
657 for ( i=1; i<=len; i++ )
658 Ids.Add( myBuilders.Value(i)->GetId () );
661 while ( Ids.Contains( curId ) )
667 //================================================================
668 // Function : GetBuilder
670 //================================================================
671 Handle (MeshVS_PrsBuilder) MeshVS_Mesh::GetBuilder ( const Standard_Integer Index ) const
673 if ( Index>=1 && Index<=myBuilders.Length() )
674 return myBuilders.Value( Index );
679 //================================================================
680 // Function : GetBuilderById
682 //================================================================
683 Handle (MeshVS_PrsBuilder) MeshVS_Mesh::GetBuilderById ( const Standard_Integer Id ) const
685 Handle (MeshVS_PrsBuilder) Result;
687 Standard_Integer i, len = myBuilders.Length();
688 for ( i=1; i<=len; i++ )
689 if ( myBuilders.Value(i)->GetId () == Id )
691 Result = myBuilders.Value(i);
697 //================================================================
698 // Function : AddBuilder
700 //================================================================
701 void MeshVS_Mesh::AddBuilder ( const Handle (MeshVS_PrsBuilder)& theBuilder,
702 const Standard_Boolean TreatAsHilighter )
704 if ( theBuilder.IsNull() )
707 Standard_Integer i, n = myBuilders.Length();
708 for ( i = 1; i<=n; i++ )
709 if ( myBuilders(i)->GetPriority() < theBuilder->GetPriority() )
713 myBuilders.Append ( theBuilder );
715 myBuilders.InsertBefore ( i, theBuilder );
717 if( TreatAsHilighter )
718 myHilighter = theBuilder;
721 //================================================================
722 // Function : RemoveBuilder
724 //================================================================
725 void MeshVS_Mesh::RemoveBuilder ( const Standard_Integer theIndex )
727 Handle( MeshVS_PrsBuilder ) aBuild = GetBuilder( theIndex );
728 if ( !aBuild.IsNull() )
730 if ( aBuild == myHilighter )
731 myHilighter.Nullify();
732 myBuilders.Remove ( theIndex );
736 //================================================================
737 // Function : RemoveBuilderById
739 //================================================================
740 void MeshVS_Mesh::RemoveBuilderById ( const Standard_Integer Id )
742 Standard_Integer i, n = myBuilders.Length();
743 for ( i=1; i<=n; i++ )
745 Handle( MeshVS_PrsBuilder ) aCur = myBuilders(i);
746 if ( !aCur.IsNull() && aCur->GetId()==Id )
751 if ( GetBuilder( i )==myHilighter )
752 myHilighter.Nullify();
757 //================================================================
758 // Function : SetHiddenElems
760 //================================================================
761 void MeshVS_Mesh::SetHiddenElems ( const Handle(TColStd_HPackedMapOfInteger)& theMap )
763 myHiddenElements = theMap;
765 // Note: update of list of selectable nodes -- this is not optimal!
766 Standard_Boolean AutoSelUpdate = Standard_False;
767 if ( !GetDrawer().IsNull() && GetDrawer()->GetBoolean( MeshVS_DA_SelectableAuto, AutoSelUpdate ) &&
769 UpdateSelectableNodes();
772 //================================================================
773 // Function : SetHiddenNodes
775 //================================================================
776 void MeshVS_Mesh::SetHiddenNodes ( const Handle(TColStd_HPackedMapOfInteger)& theMap )
778 myHiddenNodes = theMap;
780 // Note: update of list of selectable nodes -- this is not optimal!
781 Standard_Boolean AutoSelUpdate = Standard_False;
782 if ( !GetDrawer().IsNull() && GetDrawer()->GetBoolean( MeshVS_DA_SelectableAuto, AutoSelUpdate ) &&
784 UpdateSelectableNodes();
787 //================================================================
788 // Function : GetHiddenElems
790 //================================================================
791 const Handle(TColStd_HPackedMapOfInteger)& MeshVS_Mesh::GetHiddenElems () const
793 return myHiddenElements;
796 //================================================================
797 // Function : GetHiddenNodes
799 //================================================================
800 const Handle(TColStd_HPackedMapOfInteger)& MeshVS_Mesh::GetHiddenNodes () const
802 return myHiddenNodes;
805 //================================================================
806 // Function : AddToMap
808 //================================================================
809 void AddToMap ( MeshVS_DataMapOfIntegerOwner& Result, const MeshVS_DataMapOfIntegerOwner& Addition )
811 MeshVS_DataMapIteratorOfDataMapOfIntegerOwner anIt ( Addition );
812 for ( ; anIt.More(); anIt.Next() )
813 if ( Result.IsBound ( anIt.Key() ) )
814 Result.ChangeFind ( anIt.Key() ) = anIt.Value();
816 Result.Bind( anIt.Key(), anIt.Value() );
819 //================================================================
820 // Function : GetOwnerMaps
822 //================================================================
823 const MeshVS_DataMapOfIntegerOwner& MeshVS_Mesh::GetOwnerMaps ( const Standard_Boolean IsElements )
825 Handle(MeshVS_DataSource) aDS = GetDataSource();
826 if( !aDS.IsNull() && aDS->IsAdvancedSelectionEnabled() )
830 if ( myElementOwners.IsEmpty() )
832 AddToMap ( myElementOwners, my0DOwners );
833 AddToMap ( myElementOwners, myLinkOwners );
834 AddToMap ( myElementOwners, myFaceOwners );
835 AddToMap ( myElementOwners, myVolumeOwners );
837 return myElementOwners;
843 //================================================================
844 // Function : IsHiddenElem
846 //================================================================
847 Standard_Boolean MeshVS_Mesh::IsHiddenElem ( const Standard_Integer theID ) const
849 return ! myHiddenElements.IsNull() && myHiddenElements->Map().Contains( theID );
852 //================================================================
853 // Function : IsHiddenNode
855 //================================================================
856 Standard_Boolean MeshVS_Mesh::IsHiddenNode ( const Standard_Integer theID ) const
858 // note that by default all nodes are hidden
859 return myHiddenNodes.IsNull() || myHiddenNodes->Map().Contains( theID );
862 //================================================================
863 // Function : GetDrawer
865 //================================================================
866 Handle( MeshVS_Drawer ) MeshVS_Mesh::GetDrawer() const
868 return myCurrentDrawer;
871 //================================================================
872 // Function : SetDrawer
874 //================================================================
875 void MeshVS_Mesh::SetDrawer(const Handle(MeshVS_Drawer)& aDrawer)
877 myCurrentDrawer = aDrawer;
880 //================================================================
881 // Function : GetDataSource
883 //================================================================
884 Handle(MeshVS_DataSource) MeshVS_Mesh::GetDataSource() const
889 //================================================================
890 // Function : SetDataSource
892 //================================================================
893 void MeshVS_Mesh::SetDataSource( const Handle(MeshVS_DataSource)& theDataSource )
895 myDataSource = theDataSource;
898 //================================================================
899 // Function : HilightSelected
901 //================================================================
902 void MeshVS_Mesh::HilightSelected ( const Handle(PrsMgr_PresentationManager3d)& thePM,
903 const SelectMgr_SequenceOfOwner& theOwners )
905 if ( myHilighter.IsNull() )
908 // if ( mySelectionPrs.IsNull() )
909 // mySelectionPrs = new Prs3d_Presentation ( thePM->StructureManager() );
913 Handle( Prs3d_Presentation ) aSelectionPrs;
915 aSelectionPrs = GetSelectPresentation( thePM );
917 if( HasPresentation() )
918 aSelectionPrs->SetTransformPersistence( Presentation()->TransformPersistenceMode(), Presentation()->TransformPersistencePoint() );
921 // It is very important to call this parent method, because it check whether
922 // mySelectionPrs is created and if not, create it.
930 Standard_Integer len = theOwners.Length(), i;
932 Handle (MeshVS_MeshEntityOwner) anOwner;
933 TColStd_PackedMapOfInteger aSelNodes, aSelElements;
935 for( i=1; i<=len; i++ )
937 anOwner = Handle (MeshVS_MeshEntityOwner)::DownCast ( theOwners.Value ( i ) );
938 if ( !anOwner.IsNull() )
940 // nkv: add support of mesh groups
941 if ( anOwner->IsGroup() ) {
942 MeshVS_EntityType aGroupType;
943 TColStd_PackedMapOfInteger aGroupMap;
944 if ( GetDataSource()->GetGroup( anOwner->ID(), aGroupType, aGroupMap ) ) {
945 if ( aGroupType == MeshVS_ET_Node ) {
946 for( TColStd_MapIteratorOfPackedMapOfInteger anIt(aGroupMap); anIt.More(); anIt.Next() )
947 if( IsSelectableNode/*!IsHiddenNode*/( anIt.Key() ) )
948 aSelNodes.Add( anIt.Key() );
951 for( TColStd_MapIteratorOfPackedMapOfInteger anIt(aGroupMap); anIt.More(); anIt.Next() )
952 if( IsSelectableElem/*!IsHiddenElem*/( anIt.Key() ) )
953 aSelElements.Add( anIt.Key() );
958 if( anOwner->Type() == MeshVS_ET_Node )
959 aSelNodes.Add( anOwner->ID() );
961 aSelElements.Add( anOwner->ID() );
964 else if( GetDataSource()->IsAdvancedSelectionEnabled() )
966 Handle(MeshVS_MeshOwner) aMeshOwner = Handle(MeshVS_MeshOwner)::DownCast ( theOwners.Value ( i ) );
967 if( !aMeshOwner.IsNull() )
969 Handle(TColStd_HPackedMapOfInteger) aNodes = aMeshOwner->GetSelectedNodes();
970 Handle(TColStd_HPackedMapOfInteger) aElems = aMeshOwner->GetSelectedElements();
971 if( !aNodes.IsNull() )
972 aSelNodes.Assign( aNodes->Map() );
973 if( !aElems.IsNull() )
974 aSelElements.Assign( aElems->Map() );
977 //agv else if( theOwners.Value ( i )==myWholeMeshOwner )
978 else if (IsWholeMeshOwner (theOwners.Value ( i )))
980 TColStd_MapIteratorOfPackedMapOfInteger anIt(GetDataSource()->GetAllNodes());
981 for( ; anIt.More(); anIt.Next() )
982 if( !IsHiddenNode( anIt.Key() ) )
983 aSelNodes.Add( anIt.Key() );
985 anIt = TColStd_MapIteratorOfPackedMapOfInteger( GetDataSource()->GetAllElements() );
986 for( ; anIt.More(); anIt.Next() )
987 if( !IsHiddenElem( anIt.Key() ) )
988 aSelElements.Add( anIt.Key() );
994 Standard_Boolean IsNeedToRedisplay = Standard_False;
996 aSelectionPrs->Clear();
998 myHilighter->SetDrawer ( mySelectionDrawer );
1000 if( aSelNodes.Extent()>0 )
1002 TColStd_PackedMapOfInteger tmp;
1003 myHilighter->Build ( aSelectionPrs, aSelNodes, tmp, Standard_False, MeshVS_DMF_SelectionPrs );
1005 if( aSelElements.Extent()>0 )
1007 TColStd_PackedMapOfInteger tmp;
1008 myHilighter->Build( aSelectionPrs, aSelElements, tmp, Standard_True, MeshVS_DMF_SelectionPrs );
1011 myHilighter->SetDrawer ( 0 );
1013 IsNeedToRedisplay = Standard_True;
1015 if ( IsNeedToRedisplay )
1017 aSelectionPrs->SetDisplayPriority(9);
1018 aSelectionPrs->Display();
1022 Standard_Real sec, cpu;
1023 Standard_Integer min, hour;
1025 gTimer.Show ( sec, min, hour, cpu );
1026 cout << "HilightSelected : " << endl;
1027 cout << aSelNodes.Extent() << " nodes " << endl;
1028 cout << aSelElements.Extent() << " elements " << endl;
1029 cout << "Time : " << sec << " sec" << endl;
1030 cout << "CPU time : " << cpu << " sec" << endl << endl;
1035 //================================================================
1036 // Function : HilightOwnerWithColor
1038 //================================================================
1039 void MeshVS_Mesh::HilightOwnerWithColor ( const Handle(PrsMgr_PresentationManager3d)& PM,
1040 const Quantity_NameOfColor Color,
1041 const Handle(SelectMgr_EntityOwner)& Owner)
1043 if ( myHilighter.IsNull() )
1046 SelectMgr_SequenceOfOwner theOwners;
1049 //if ( myHilightPrs.IsNull() )
1050 // myHilightPrs = new Prs3d_Presentation ( PM->StructureManager() );
1052 Handle( Prs3d_Presentation ) aHilightPrs;
1053 aHilightPrs = GetHilightPresentation( PM );
1055 aHilightPrs->Clear();
1058 if( HasPresentation() )
1059 aHilightPrs->SetTransformPersistence( Presentation()->TransformPersistenceMode(), Presentation()->TransformPersistencePoint() );
1062 if( Owner.IsNull() ) return;
1064 const Standard_Boolean isMeshEntityOwner = Owner->IsKind ( STANDARD_TYPE ( MeshVS_MeshEntityOwner ) );
1065 const Standard_Boolean isWholeMeshOwner =
1066 //agv !Owner.IsNull() && Owner==myWholeMeshOwner;
1067 IsWholeMeshOwner (Owner);
1069 Standard_Integer aDispMode = MeshVS_DMF_Shading;
1070 if ( HasDisplayMode() && ( DisplayMode() & MeshVS_DMF_OCCMask ) > MeshVS_DMF_WireFrame )
1071 aDispMode = ( DisplayMode() & MeshVS_DMF_OCCMask );
1072 //It because we draw hilighted owners only in shading or shrink (not in wireframe)
1074 myHilightDrawer->SetColor( MeshVS_DA_InteriorColor, Color );
1075 myHilightDrawer->SetColor( MeshVS_DA_BackInteriorColor, Color );
1076 myHilightDrawer->SetColor( MeshVS_DA_EdgeColor, Color );
1077 myHilightDrawer->SetColor( MeshVS_DA_BeamColor, Color );
1078 myHilightDrawer->SetColor( MeshVS_DA_MarkerColor, Color );
1079 myHilighter->SetDrawer( myHilightDrawer );
1081 if( isMeshEntityOwner )
1083 Handle ( MeshVS_MeshEntityOwner ) theAISOwner = Handle ( MeshVS_MeshEntityOwner )::DownCast ( Owner );
1084 MeshVS_EntityType aType = theAISOwner->Type();
1085 Standard_Integer anID = theAISOwner->ID();
1087 if ( theAISOwner->IsGroup() ) {
1088 MeshVS_EntityType aGroupType;
1089 TColStd_PackedMapOfInteger aGroupMap;
1090 if ( myDataSource->GetGroup( anID, aGroupType, aGroupMap ) ) {
1091 TColStd_PackedMapOfInteger tmp;
1092 myHilighter->Build( aHilightPrs, aGroupMap, tmp, aType!=MeshVS_ET_Node,
1093 aDispMode | MeshVS_DMF_HilightPrs );
1097 TColStd_PackedMapOfInteger anOne, tmp;
1099 myHilighter->Build( aHilightPrs, anOne, tmp, aType!=MeshVS_ET_Node,
1100 aDispMode | MeshVS_DMF_HilightPrs );
1103 else if( isWholeMeshOwner )
1105 if( ! GetDataSource().IsNull() )
1107 TColStd_PackedMapOfInteger tmp;
1108 myHilighter->Build( aHilightPrs, GetDataSource()->GetAllElements(), tmp,
1109 Standard_True, MeshVS_DMF_WireFrame );
1114 Handle(MeshVS_MeshOwner) aMeshOwner = Handle(MeshVS_MeshOwner)::DownCast ( Owner );
1115 if( !aMeshOwner.IsNull() )
1117 Handle(TColStd_HPackedMapOfInteger) aNodes = aMeshOwner->GetDetectedNodes();
1118 Handle(TColStd_HPackedMapOfInteger) aElems = aMeshOwner->GetDetectedElements();
1119 // hilight detected entities
1120 if( !aNodes.IsNull() )
1122 TColStd_PackedMapOfInteger tmp;
1123 myHilighter->Build( aHilightPrs, aNodes->Map(), tmp, Standard_False,
1124 aDispMode | MeshVS_DMF_HilightPrs );
1126 if( !aElems.IsNull() )
1128 TColStd_PackedMapOfInteger tmp;
1129 myHilighter->Build( aHilightPrs, aElems->Map(), tmp, Standard_True,
1130 aDispMode | MeshVS_DMF_HilightPrs );
1135 if( PM->IsImmediateModeOn() )
1136 PM->AddToImmediateList( aHilightPrs );
1137 myHilighter->SetDrawer ( 0 );
1140 //=======================================================================
1141 //function : ClearSelected
1143 //=======================================================================
1144 void MeshVS_Mesh::ClearSelected ()
1146 Handle( Prs3d_Presentation ) aSelectionPrs = GetSelectPresentation( NULL );
1147 if( !aSelectionPrs.IsNull() )
1148 aSelectionPrs->Clear();
1151 //=======================================================================
1152 //function : FindBuilder
1154 //=======================================================================
1155 Handle (MeshVS_PrsBuilder) MeshVS_Mesh::FindBuilder ( const Standard_CString theTypeName ) const
1157 Standard_Integer len = myBuilders.Length();
1158 Handle(MeshVS_PrsBuilder) aBuilder;
1159 Standard_Boolean IsExist = Standard_False;
1161 for ( Standard_Integer i=1; i<=len && !IsExist; i++)
1162 if ( myBuilders.Value (i)->IsKind ( theTypeName ) )
1164 aBuilder = myBuilders.Value (i);
1165 IsExist = Standard_True;
1171 //=======================================================================
1172 //function : SetHilighter
1174 //=======================================================================
1175 void MeshVS_Mesh::SetHilighter ( const Handle( MeshVS_PrsBuilder )& Builder )
1177 myHilighter = Builder;
1180 //=======================================================================
1181 //function : SetHilighter
1183 //=======================================================================
1184 Standard_Boolean MeshVS_Mesh::SetHilighter ( const Standard_Integer Index )
1186 Handle( MeshVS_PrsBuilder ) aBuild = GetBuilder( Index );
1187 Standard_Boolean aRes = ( !aBuild.IsNull() );
1189 myHilighter = aBuild;
1193 //=======================================================================
1194 //function : SetHilighter
1196 //=======================================================================
1197 Standard_Boolean MeshVS_Mesh::SetHilighterById ( const Standard_Integer Id )
1199 Handle( MeshVS_PrsBuilder ) aBuild = GetBuilderById( Id );
1200 Standard_Boolean aRes = ( !aBuild.IsNull() );
1202 myHilighter = aBuild;
1206 //=======================================================================
1207 //function : GetHilighter
1209 //=======================================================================
1210 Handle( MeshVS_PrsBuilder ) MeshVS_Mesh::GetHilighter () const
1215 //=======================================================================
1216 //function : IsSelectableElem
1218 //=======================================================================
1219 Standard_Boolean MeshVS_Mesh::IsSelectableElem ( const Standard_Integer ID ) const
1221 return ! IsHiddenElem ( ID );
1224 //=======================================================================
1225 //function : IsSelectableNode
1227 //=======================================================================
1228 Standard_Boolean MeshVS_Mesh::IsSelectableNode ( const Standard_Integer ID ) const
1230 return mySelectableNodes.IsNull() ? ! IsHiddenNode ( ID ) :
1231 mySelectableNodes->Map().Contains( ID );
1234 //=======================================================================
1235 //function : GetSelectableNodes
1237 //=======================================================================
1238 const Handle(TColStd_HPackedMapOfInteger)& MeshVS_Mesh::GetSelectableNodes () const
1240 return mySelectableNodes;
1243 //=======================================================================
1244 //function : SetSelectableNodes
1246 //=======================================================================
1247 void MeshVS_Mesh::SetSelectableNodes ( const Handle(TColStd_HPackedMapOfInteger)& Ids )
1249 mySelectableNodes = Ids;
1252 //=======================================================================
1253 //function : UpdateSelectableNodes
1255 //=======================================================================
1256 void MeshVS_Mesh::UpdateSelectableNodes()
1258 mySelectableNodes = new TColStd_HPackedMapOfInteger;
1260 Standard_Integer aMaxFaceNodes;
1261 Handle( MeshVS_DataSource ) aSource = GetDataSource();
1262 if ( aSource.IsNull() || myCurrentDrawer.IsNull() || !myCurrentDrawer->GetInteger
1263 ( MeshVS_DA_MaxFaceNodes, aMaxFaceNodes ) || aMaxFaceNodes<=0 )
1266 // all non-hidden nodes are selectable;
1267 // by default (i.e. if myHiddenNodes.IsNull()) all nodes are hidden
1268 if ( ! myHiddenNodes.IsNull() )
1270 mySelectableNodes->ChangeMap().Subtraction (aSource->GetAllNodes(),
1271 myHiddenNodes->Map());
1274 // add all nodes belonging to non-hidden elements
1275 TColStd_MapIteratorOfPackedMapOfInteger anIter( aSource->GetAllElements() );
1276 for ( ; anIter.More(); anIter.Next() )
1278 Standard_Integer aKey = anIter.Key();
1279 if ( IsHiddenElem (aKey) )
1282 MeshVS_Buffer aNodesBuf (aMaxFaceNodes*sizeof(Standard_Integer));
1283 TColStd_Array1OfInteger aNodes (aNodesBuf, 1, aMaxFaceNodes);
1284 Standard_Integer NbNodes;
1285 if ( !aSource->GetNodesByElement ( aKey, aNodes, NbNodes ) )
1287 for ( Standard_Integer i=1; i<=NbNodes; i++ )
1288 mySelectableNodes->ChangeMap().Add ( aNodes(i) );
1292 //=======================================================================
1293 //function : GetMeshSelMethod
1295 //=======================================================================
1296 MeshVS_MeshSelectionMethod MeshVS_Mesh::GetMeshSelMethod() const
1298 return mySelectionMethod;
1301 //=======================================================================
1302 //function : SetMeshSelMethod
1304 //=======================================================================
1305 void MeshVS_Mesh::SetMeshSelMethod( const MeshVS_MeshSelectionMethod M )
1307 mySelectionMethod = M;
1310 //=======================================================================
1311 //function : IsWholeMeshOwner
1313 //=======================================================================
1315 Standard_Boolean MeshVS_Mesh::IsWholeMeshOwner
1316 (const Handle(SelectMgr_EntityOwner)& theOwn) const
1318 return theOwn.IsNull() ? Standard_False : (theOwn == myWholeMeshOwner);