1 // Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // GEOM OBJECT : interactive object for Geometry entities visualization
24 // File : GEOM_AISShape.cxx
25 // Author : Nicolas REJNERI
29 \class GEOM_AISShape GEOM_AISShape.hxx
33 #include "GEOM_AISShape.ixx"
34 #include "SALOME_InteractiveObject.hxx"
35 #include "GEOM_AISVector.hxx"
37 // Open CASCADE Includes
38 #include <AIS_Drawer.hxx>
39 #include <AIS_InteractiveContext.hxx>
41 #include <BRep_Tool.hxx>
43 #include <GCPnts_AbscissaPoint.hxx>
44 #include <GeomAdaptor_Curve.hxx>
48 #include <Graphic3d_AspectFillArea3d.hxx>
49 #include <Graphic3d_AspectLine3d.hxx>
50 #include <Graphic3d_AspectMarker3d.hxx>
51 #include <Graphic3d_AspectText3d.hxx>
53 #include <Prs3d_ShadingAspect.hxx>
54 #include <Prs3d_Arrow.hxx>
55 #include <Prs3d_IsoAspect.hxx>
57 #include <SelectBasics_SensitiveEntity.hxx>
58 #include <SelectMgr_EntityOwner.hxx>
59 #include <StdSelect_BRepOwner.hxx>
60 #include <SelectMgr_IndexedMapOfOwner.hxx>
61 #include <SelectMgr_Selection.hxx>
62 #include <StdSelect_DisplayMode.hxx>
63 #include <StdPrs_ShadedShape.hxx>
64 #include <StdPrs_WFDeflectionShape.hxx>
66 #include <TColStd_IndexedMapOfInteger.hxx>
67 #include <TColStd_ListIteratorOfListOfInteger.hxx>
68 #include <TColStd_ListOfInteger.hxx>
70 #include <TopoDS_Shape.hxx>
71 #include <TopTools_IndexedMapOfShape.hxx>
73 #include <TopExp_Explorer.hxx>
75 #include <TopoDS_Edge.hxx>
76 #include <TopoDS_Shape.hxx>
77 #include <TopoDS_Vertex.hxx>
79 #include <TColStd_SequenceOfInteger.hxx>
81 #include <V3d_View.hxx>
83 #include <SalomeApp_Tools.h>
85 #include <SUIT_Session.h>
86 #include <SUIT_ResourceMgr.h>
88 GEOM_AISShape::TopLevelDispMode GEOM_AISShape::myTopLevelDm = GEOM_AISShape::TopKeepCurrent;
89 Quantity_Color GEOM_AISShape::myTopLevelColor;
92 static void getEntityOwners( const Handle(AIS_InteractiveObject)& theObj,
93 const Handle(AIS_InteractiveContext)& theIC,
94 SelectMgr_IndexedMapOfOwner& theMap )
96 if ( theObj.IsNull() || theIC.IsNull() )
99 TColStd_ListOfInteger modes;
100 theIC->ActivatedModes( theObj, modes );
102 TColStd_ListIteratorOfListOfInteger itr( modes );
103 for (; itr.More(); itr.Next() ) {
105 if ( !theObj->HasSelection( m ) )
108 Handle(SelectMgr_Selection) sel = theObj->Selection( m );
110 for ( sel->Init(); sel->More(); sel->Next() ) {
111 Handle(SelectBasics_SensitiveEntity) entity = sel->Sensitive();
112 if ( entity.IsNull() )
115 Handle(SelectMgr_EntityOwner) owner =
116 Handle(SelectMgr_EntityOwner)::DownCast(entity->OwnerId());
117 if ( !owner.IsNull() )
123 static void indicesToOwners( const TColStd_IndexedMapOfInteger& aIndexMap,
124 const TopoDS_Shape& aMainShape,
125 const SelectMgr_IndexedMapOfOwner& anAllMap,
126 SelectMgr_IndexedMapOfOwner& aToHiliteMap )
128 TopTools_IndexedMapOfShape aMapOfShapes;
129 TopExp::MapShapes(aMainShape, aMapOfShapes);
131 for ( Standard_Integer i = 1, n = anAllMap.Extent(); i <= n; i++ ) {
132 Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast(anAllMap( i ));
133 if ( anOwner.IsNull() || !anOwner->HasShape() )
136 const TopoDS_Shape& aSubShape = anOwner->Shape();
137 Standard_Integer aSubShapeId = aMapOfShapes.FindIndex( aSubShape );
138 if ( !aSubShapeId || !aIndexMap.Contains( aSubShapeId ) )
141 if ( !aToHiliteMap.Contains( anOwner ) )
142 aToHiliteMap.Add( anOwner );
146 GEOM_AISShape::GEOM_AISShape(const TopoDS_Shape& shape,
147 const Standard_CString aName)
148 : SALOME_AISShape(shape),
150 myDisplayVectors(false),
151 myFieldDataType(GEOM::FDT_Double),
153 myFieldStepRangeMin(0),
154 myFieldStepRangeMax(0)
156 //rnv: Commented to avoid bug with local selection
157 //SetHilightMode( CustomHighlight ); // override setting the mode to 0 inside AIS_Shape constructor
159 myShadingColor = Quantity_Color( Quantity_NOC_GOLDENROD );
160 myPrevDisplayMode = 0;
161 storeBoundaryColors();
164 myEdgesInShadingColor = Quantity_Color( Quantity_NOC_GOLDENROD );
169 myTopLevel = Standard_False;
170 Graphic3d_MaterialAspect aMatAspect;
171 if ( !HasMaterial() ) {
172 aMatAspect.SetAmbient( 0.5 );
173 aMatAspect.SetDiffuse( 0.5 );
174 aMatAspect.SetEmissive( 0.5 );
175 aMatAspect.SetShininess(0.5 );
176 aMatAspect.SetSpecular( 0.5 );
178 myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(aMatAspect);
179 myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(aMatAspect);
183 void GEOM_AISShape::setIO(const Handle(SALOME_InteractiveObject)& io){
187 Handle(SALOME_InteractiveObject) GEOM_AISShape::getIO(){
188 Handle(SALOME_InteractiveObject) IO;
189 if ( !GetOwner().IsNull() )
190 IO = Handle(SALOME_InteractiveObject)::DownCast( GetOwner() );
194 Standard_Boolean GEOM_AISShape::hasIO(){
195 return !getIO().IsNull();
198 void GEOM_AISShape::setName(const Standard_CString aName)
202 Handle(SALOME_InteractiveObject) IO = getIO();
207 Standard_CString GEOM_AISShape::getName(){
208 return myName.ToCString();
211 void GEOM_AISShape::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
212 const Handle(Prs3d_Presentation)& aPrs,
213 const Standard_Integer aMode)
215 if (IsInfinite()) aPrs->SetInfiniteState(Standard_True); //pas de prise en compte lors du FITALL
217 Handle(AIS_InteractiveContext) anIC = GetContext();
219 bool anIsField = !myFieldStepData.isEmpty();
220 bool anIsColorField = anIsField && myFieldDataType != GEOM::FDT_String;
221 bool anIsTextField = anIsField && myFieldDataType == GEOM::FDT_String;
223 // StdSelect_DisplayMode d = (StdSelect_DisplayMode) aMode;
224 bool isTopLev = isTopLevel() && switchTopLevel();
226 case 0://StdSelect_DM_Wireframe:
227 case CustomHighlight:
230 // Restore wireframe edges colors
231 restoreBoundaryColors();
233 SetColor(topLevelColor());
234 Handle(Prs3d_LineAspect) anAspect = Attributes()->WireAspect();
235 anAspect->SetColor( topLevelColor() );
236 Attributes()->SetWireAspect( anAspect );
238 if( !isTopLev && anIsColorField && myFieldDimension == 1 )
239 drawField( aPrs, false, aMode == CustomHighlight );
241 StdPrs_WFDeflectionShape::Add(aPrs,myshape,myDrawer);
244 case 1://StdSelect_DM_Shading:
247 shadingMode(aPresentationManager, aPrs, aMode);
248 // Store wireframe edges colors
249 storeBoundaryColors();
252 case 3: //StdSelect_DM_HLR:
255 AIS_TexturedShape::Compute(aPresentationManager, aPrs, aMode);
257 shadingMode(aPresentationManager, aPrs, AIS_Shaded);
262 if ( aMode == ShadingWithEdges ) {
263 // Temporary store number of iso lines in order to recover its later
264 // when display mode is achnged to 'Wirefame' or 'Shading'.
265 // Iso lines are not displayed in 'Shading with edges' mode.
268 // Reset number of iso lines to 0
272 shadingMode(aPresentationManager, aPrs, AIS_Shaded);
274 // Store wireframe edges colors
275 storeBoundaryColors();
278 Handle(Prs3d_LineAspect) anAspect = myDrawer->UnFreeBoundaryAspect();
279 anAspect->SetColor( myEdgesInShadingColor );
280 myDrawer->SetUnFreeBoundaryAspect( anAspect );
282 anAspect = myDrawer->FreeBoundaryAspect();
283 anAspect->SetColor( myEdgesInShadingColor );
284 myDrawer->SetFreeBoundaryAspect( anAspect );
286 // Add edges to presentation
287 if( anIsColorField && myFieldDimension == 1 )
290 StdPrs_WFDeflectionShape::Add(aPrs,myshape,myDrawer);
295 const bool isVector = IsKind(STANDARD_TYPE(GEOM_AISVector));
296 TopExp_Explorer Exp ( myshape, TopAbs_EDGE );
297 for ( ; Exp.More(); Exp.Next() ) {
298 TopoDS_Vertex aV1, aV2;
299 TopoDS_Edge anEdgeE = TopoDS::Edge(Exp.Current());
301 // draw curve direction (issue 0021087)
302 anEdgeE.Orientation( TopAbs_FORWARD );
304 if ( anEdgeE.IsNull() ) continue;
306 TopExp::Vertices(anEdgeE, aV1, aV2);
307 gp_Pnt aP1 = BRep_Tool::Pnt(aV1);
308 gp_Pnt aP2 = BRep_Tool::Pnt(aV2);
312 Handle(Geom_Curve) C = BRep_Tool::Curve(anEdgeE,fp,lp);
314 if ( C.IsNull() ) continue;
316 if ( anEdgeE.Orientation() == TopAbs_FORWARD )
317 C->D1(lp, aP2, aDirVec);
319 C->D1(fp, aP1, aDirVec);
323 GeomAdaptor_Curve aAdC;
324 aAdC.Load(C, fp, lp);
325 Standard_Real aDist = GCPnts_AbscissaPoint::Length(aAdC, fp, lp);
327 if (aDist > gp::Resolution()) {
329 if ( anEdgeE.Orientation() == TopAbs_FORWARD )
334 Prs3d_Arrow::Draw(aPrs, aP2, aDir, M_PI/180.*5., aDist/10.);
339 // draw color field on vertices
340 if( anIsColorField && myFieldDimension == 0 && aMode != CustomHighlight )
345 drawField( aPrs, true );
347 // aPrs->ReCompute(); // for hidden line recomputation if necessary...
350 void GEOM_AISShape::SetShadingColor(const Quantity_Color &aCol)
352 myShadingColor = aCol;
355 void GEOM_AISShape::SetEdgesInShadingColor(const Quantity_Color &aCol)
357 myEdgesInShadingColor = aCol;
360 void GEOM_AISShape::highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndexMap,
361 const Standard_Boolean aHighlight )
363 Handle(AIS_InteractiveObject) anObj = this;
364 Handle(AIS_InteractiveContext) anIC = GetContext();
365 if ( anIC.IsNull() || !anIC->HasOpenedContext() )
368 Standard_Boolean isAutoHilight = anIC->AutomaticHilight();
369 anIC->SetAutomaticHilight( false );
371 anIC->ClearSelected( false );
374 SelectMgr_IndexedMapOfOwner anAllMap, aToHiliteMap;
376 // Get entity owners for all activated selection modes
377 getEntityOwners( anObj, anIC, anAllMap );
379 // Convert <aIndexMap> into the map of owners to highlight/unhighlight
380 indicesToOwners( aIndexMap, Shape(), anAllMap, aToHiliteMap );
383 for ( Standard_Integer i = 1, n = aToHiliteMap.Extent(); i <= n; i++ )
384 anIC->AddOrRemoveSelected( aToHiliteMap( i ), false );
387 anIC->SetAutomaticHilight( isAutoHilight );
388 anIC->HilightSelected( false );
391 void GEOM_AISShape::SetDisplayVectors(bool isDisplayed)
393 myDisplayVectors = isDisplayed;
396 void GEOM_AISShape::shadingMode(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
397 const Handle(Prs3d_Presentation)& aPrs,
398 const Standard_Integer aMode)
400 myDrawer->ShadingAspect()->Aspect()->SetDistinguishOn();
402 Graphic3d_MaterialAspect aMatAspect(Graphic3d_NOM_PLASTIC);
403 aMatAspect.SetTransparency(Transparency());
404 Graphic3d_MaterialAspect currentFrontMaterial = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
405 Graphic3d_MaterialAspect currentBackMaterial = myDrawer->ShadingAspect()->Aspect()->BackMaterial();
406 myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial( isTopLevel() ? aMatAspect : currentFrontMaterial );
407 myDrawer->ShadingAspect()->Aspect()->SetBackMaterial ( isTopLevel() ? aMatAspect : currentBackMaterial );
409 if( isTopLevel() && switchTopLevel() )
410 myDrawer->ShadingAspect()->SetColor( topLevelColor() );
412 if(myDrawer->ShadingAspect()->Aspect()->FrontMaterial().MaterialType( Graphic3d_MATERIAL_ASPECT ))
413 myDrawer->ShadingAspect()->SetColor(myShadingColor);
415 myDrawer->ShadingAspect()->SetColor(myDrawer->ShadingAspect()->Aspect()->FrontMaterial().AmbientColor());
418 bool anIsColorField = !myFieldStepData.isEmpty() && myFieldDataType != GEOM::FDT_String;
419 if( anIsColorField && ( myFieldDimension == 2 || myFieldDimension == 3 || myFieldDimension == -1 ) )
425 // PAL12113: AIS_Shape::Compute() works correctly with shapes containing no faces
426 //StdPrs_ShadedShape::Add(aPrs,myshape,myDrawer);
427 AIS_Shape::Compute(aPresentationManager, aPrs, aMode);
431 void GEOM_AISShape::storeIsoNumbers()
433 myUIsoNumber = myDrawer->UIsoAspect()->Number();
434 myVIsoNumber = myDrawer->VIsoAspect()->Number();
437 void GEOM_AISShape::restoreIsoNumbers()
439 if ( myUIsoNumber > 0 ) {
440 // Restore number of U iso lines
441 Handle(Prs3d_IsoAspect) anAspect = myDrawer->UIsoAspect();
442 anAspect->SetNumber( myUIsoNumber );
443 myDrawer->SetUIsoAspect( anAspect );
446 if ( myVIsoNumber > 0 ) {
447 // Restore number of V iso lines
448 Handle(Prs3d_IsoAspect) anAspect = myDrawer->VIsoAspect();
449 anAspect->SetNumber( myVIsoNumber );
450 myDrawer->SetVIsoAspect( anAspect );
454 void GEOM_AISShape::resetIsoNumbers()
456 Handle(Prs3d_IsoAspect) anAspect = myDrawer->UIsoAspect();
457 anAspect->SetNumber( 0 );
458 myDrawer->SetUIsoAspect( anAspect );
460 anAspect = myDrawer->VIsoAspect();
461 anAspect->SetNumber( 0 );
462 myDrawer->SetVIsoAspect( anAspect );
465 void GEOM_AISShape::storeBoundaryColors()
467 Aspect_TypeOfLine aLT;
470 myDrawer->FreeBoundaryAspect()->Aspect()->Values( myFreeBoundaryColor, aLT, aW);
471 myDrawer->UnFreeBoundaryAspect()->Aspect()->Values( myUnFreeBoundaryColor, aLT, aW);
474 void GEOM_AISShape::restoreBoundaryColors()
476 Handle(Prs3d_LineAspect) anAspect = myDrawer->FreeBoundaryAspect();
477 anAspect->SetColor( myFreeBoundaryColor );
478 myDrawer->SetFreeBoundaryAspect( anAspect );
480 anAspect = myDrawer->UnFreeBoundaryAspect();
481 anAspect->SetColor( myUnFreeBoundaryColor );
482 myDrawer->SetUnFreeBoundaryAspect( anAspect );
486 Standard_Boolean GEOM_AISShape::isTopLevel() {
490 void GEOM_AISShape::setTopLevel(Standard_Boolean f) {
493 myPrevDisplayMode = DisplayMode();
495 switch(topLevelDisplayMode()) {
496 case TopKeepCurrent : dm = myPrevDisplayMode; break;
497 case TopWireFrame : dm = AIS_WireFrame; break;
498 case TopShadingWithEdges : dm = ShadingWithEdges; break;
499 default : dm = AIS_Shaded; break;
504 SetDisplayMode(myPrevDisplayMode);
509 void GEOM_AISShape::setPrevDisplayMode(const Standard_Integer mode) {
510 myPrevDisplayMode = mode;
513 Quantity_Color GEOM_AISShape::topLevelColor() {
514 return myTopLevelColor;
517 void GEOM_AISShape::setTopLevelColor(const Quantity_Color c) {
521 GEOM_AISShape::TopLevelDispMode GEOM_AISShape::topLevelDisplayMode() {
524 void GEOM_AISShape::setTopLevelDisplayMode(const GEOM_AISShape::TopLevelDispMode dm) {
528 Standard_Boolean GEOM_AISShape::switchTopLevel() {
529 return myTopLevelDm != TopShowAdditionalWActor;
532 Standard_Boolean GEOM_AISShape::toActivate() {
533 return Standard_True;
536 void GEOM_AISShape::setFieldStepInfo( const GEOM::field_data_type theFieldDataType,
537 const int theFieldDimension,
538 const QList<QVariant>& theFieldStepData,
539 const TCollection_AsciiString& theFieldStepName,
540 const double theFieldStepRangeMin,
541 const double theFieldStepRangeMax )
543 myFieldDataType = theFieldDataType;
544 myFieldDimension = theFieldDimension;
545 myFieldStepData = theFieldStepData;
546 myFieldStepName = theFieldStepName;
547 myFieldStepRangeMin = theFieldStepRangeMin;
548 myFieldStepRangeMax = theFieldStepRangeMax;
551 void GEOM_AISShape::getFieldStepInfo( GEOM::field_data_type& theFieldDataType,
552 int& theFieldDimension,
553 QList<QVariant>& theFieldStepData,
554 TCollection_AsciiString& theFieldStepName,
555 double& theFieldStepRangeMin,
556 double& theFieldStepRangeMax ) const
558 theFieldDataType = myFieldDataType;
559 theFieldDimension = myFieldDimension;
560 theFieldStepData = myFieldStepData;
561 theFieldStepName = myFieldStepName;
562 theFieldStepRangeMin = myFieldStepRangeMin;
563 theFieldStepRangeMax = myFieldStepRangeMax;
566 void GEOM_AISShape::drawField( const Handle(Prs3d_Presentation)& thePrs,
567 const bool theIsString,
568 const bool theIsHighlight )
570 if( myFieldStepData.isEmpty() )
573 QListIterator<QVariant> aFieldStepDataIter( myFieldStepData );
575 TopAbs_ShapeEnum aShapeType = TopAbs_SHAPE;
576 switch( myFieldDimension )
578 case 0: aShapeType = TopAbs_VERTEX; break;
579 case 1: aShapeType = TopAbs_EDGE; break;
580 case 2: aShapeType = TopAbs_FACE; break;
581 case 3: aShapeType = TopAbs_SOLID; break;
582 case -1: aShapeType = TopAbs_VERTEX; break;
585 TopTools_IndexedMapOfShape aShapeMap;
586 TopExp::MapShapes( myshape, aShapeMap );
588 TColStd_IndexedMapOfInteger anIndexMap;
590 TopExp_Explorer anExp;
591 for( anExp.Init( myshape, aShapeType ); anExp.More(); anExp.Next() )
593 TopoDS_Shape aSubShape = anExp.Current();
594 if( !aSubShape.IsNull() )
596 Standard_Integer aSubShapeIndex = aShapeMap.FindIndex( aSubShape );
597 if( anIndexMap.Contains( aSubShapeIndex ) )
600 anIndexMap.Add( aSubShapeIndex );
602 Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup( thePrs );
606 if( aFieldStepDataIter.hasNext() )
608 const QVariant& aVariant = aFieldStepDataIter.next();
610 aString = aVariant.toString();
612 aQColor = aVariant.value<QColor>();
620 if( computeMassCenter( aSubShape, aCenter ) )
622 Graphic3d_Vertex aVertex( aCenter.X(), aCenter.Y(), aCenter.Z() );
624 Handle(Graphic3d_AspectText3d) anAspectText3d = new Graphic3d_AspectText3d();
625 anAspectText3d->SetStyle( Aspect_TOST_ANNOTATION );
626 aGroup->SetPrimitivesAspect( anAspectText3d );
628 aGroup->Text( aString.toLatin1().constData(), aVertex, 14 );
633 Quantity_Color aColor( aQColor.redF(), aQColor.greenF(), aQColor.blueF(), Quantity_TOC_RGB );
634 if( myFieldDimension == 0 )
636 TopoDS_Vertex aVertexShape = TopoDS::Vertex( aSubShape );
637 if( !aVertexShape.IsNull() )
639 gp_Pnt aPnt = BRep_Tool::Pnt( aVertexShape );
641 Handle(Graphic3d_AspectMarker3d) anAspectMarker3d = new Graphic3d_AspectMarker3d();
642 anAspectMarker3d->SetColor( aColor );
643 anAspectMarker3d->SetType( Aspect_TOM_POINT );
644 anAspectMarker3d->SetScale( 10.0 );
645 aGroup->SetPrimitivesAspect( anAspectMarker3d );
647 Handle(Graphic3d_ArrayOfPoints) anArray = new Graphic3d_ArrayOfPoints( 1 );
648 anArray->AddVertex( aPnt.X(), aPnt.Y(), aPnt.Z() );
650 aGroup->AddPrimitiveArray( anArray );
653 else if( myFieldDimension == 1 )
655 myDrawer->WireAspect()->SetColor( aColor );
657 myDrawer->WireAspect()->SetWidth( myOwnWidth );
659 myDrawer->WireAspect()->SetWidth( myOwnWidth + 4 );
660 StdPrs_WFDeflectionShape::Add( thePrs, aSubShape, myDrawer );
662 else if( myFieldDimension == 2 ||
663 myFieldDimension == 3 ||
664 myFieldDimension == -1 )
666 myDrawer->ShadingAspect()->SetColor( aColor );
667 StdPrs_ShadedShape::Add( thePrs, aSubShape, myDrawer );
674 Standard_Boolean GEOM_AISShape::computeMassCenter( const TopoDS_Shape& theShape,
677 Standard_Real aX = 0, aY = 0, aZ = 0;
678 Standard_Integer aNbPoints = 0;
680 TopExp_Explorer anExp;
681 for( anExp.Init( theShape, TopAbs_VERTEX ); anExp.More(); anExp.Next() )
683 TopoDS_Vertex aVertex = TopoDS::Vertex( anExp.Current() );
684 if( !aVertex.IsNull() )
686 gp_Pnt aPnt = BRep_Tool::Pnt( aVertex );
695 return Standard_False;
697 theCenter.SetCoord( aX / (Standard_Real)aNbPoints,
698 aY / (Standard_Real)aNbPoints,
699 aZ / (Standard_Real)aNbPoints );
700 return Standard_True;