1 // Copyright (C) 2007-2016 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
24 \class GEOM_AISShape GEOM_AISShape.hxx
28 #include "GEOM_AISShape.hxx"
29 #include "GEOM_AISVector.hxx"
31 #include <GEOMUtils.hxx>
33 #include <Basics_OCCTVersion.hxx>
35 // Open CASCADE Includes
36 #include <AIS_InteractiveContext.hxx>
37 #include <BRep_Tool.hxx>
38 #include <GCPnts_AbscissaPoint.hxx>
39 #include <GeomAdaptor_Curve.hxx>
43 #include <Graphic3d_AspectFillArea3d.hxx>
44 #include <Graphic3d_AspectLine3d.hxx>
45 #include <Graphic3d_AspectMarker3d.hxx>
46 #include <Graphic3d_AspectText3d.hxx>
47 #include <Graphic3d_ArrayOfPoints.hxx>
49 #include <Prs3d_ShadingAspect.hxx>
50 #include <Prs3d_Arrow.hxx>
51 #include <Prs3d_IsoAspect.hxx>
52 #if OCC_VERSION_LARGE > 0x06070200
53 #include <Prs3d_VertexDrawMode.hxx>
56 #include <SelectBasics_SensitiveEntity.hxx>
57 #include <SelectMgr_EntityOwner.hxx>
58 #include <StdSelect_BRepOwner.hxx>
59 #include <SelectMgr_IndexedMapOfOwner.hxx>
60 #include <SelectMgr_Selection.hxx>
61 #include <StdSelect_DisplayMode.hxx>
62 #include <StdPrs_ShadedShape.hxx>
63 #if OCC_VERSION_MAJOR < 7
64 #include <StdPrs_WFDeflectionShape.hxx>
66 #include <StdPrs_WFShape.hxx>
69 #include <TColStd_IndexedMapOfInteger.hxx>
70 #include <TColStd_ListIteratorOfListOfInteger.hxx>
71 #include <TColStd_ListOfInteger.hxx>
73 #include <TopoDS_Shape.hxx>
74 #include <TopTools_IndexedMapOfShape.hxx>
76 #include <TopExp_Explorer.hxx>
78 #include <TopoDS_Edge.hxx>
79 #include <TopoDS_Shape.hxx>
80 #include <TopoDS_Vertex.hxx>
82 #include <TColStd_SequenceOfInteger.hxx>
84 #include <V3d_View.hxx>
86 #include <SalomeApp_Tools.h>
87 #include <SUIT_Session.h>
88 #include <SUIT_ResourceMgr.h>
90 OCCT_IMPLEMENT_STANDARD_RTTIEXT(GEOM_AISShape, SALOME_AISShape)
92 GEOM_AISShape::TopLevelDispMode GEOM_AISShape::myTopLevelDm = GEOM_AISShape::TopKeepCurrent;
93 Quantity_Color GEOM_AISShape::myTopLevelColor;
96 static void getEntityOwners( const Handle(AIS_InteractiveObject)& theObj,
97 const Handle(AIS_InteractiveContext)& theIC,
98 SelectMgr_IndexedMapOfOwner& theMap )
100 if ( theObj.IsNull() || theIC.IsNull() )
103 TColStd_ListOfInteger modes;
104 theIC->ActivatedModes( theObj, modes );
106 TColStd_ListIteratorOfListOfInteger itr( modes );
107 for (; itr.More(); itr.Next() ) {
109 if ( !theObj->HasSelection( m ) )
112 Handle(SelectMgr_Selection) sel = theObj->Selection( m );
114 for ( sel->Init(); sel->More(); sel->Next() ) {
115 #if OCC_VERSION_LARGE > 0x06080100
116 const Handle(SelectMgr_SensitiveEntity) aHSenEntity = sel->Sensitive();
117 if( aHSenEntity.IsNull() )
120 Handle(SelectBasics_SensitiveEntity) entity = aHSenEntity->BaseSensitive();
122 Handle(SelectBasics_SensitiveEntity) entity = sel->Sensitive();
124 if ( entity.IsNull() )
126 Handle(SelectMgr_EntityOwner) owner =
127 Handle(SelectMgr_EntityOwner)::DownCast(entity->OwnerId());
128 if ( !owner.IsNull() )
134 static void indicesToOwners( const TColStd_IndexedMapOfInteger& aIndexMap,
135 const TopoDS_Shape& aMainShape,
136 const SelectMgr_IndexedMapOfOwner& anAllMap,
137 SelectMgr_IndexedMapOfOwner& aToHiliteMap )
139 TopTools_IndexedMapOfShape aMapOfShapes;
140 TopExp::MapShapes(aMainShape, aMapOfShapes);
142 for ( Standard_Integer i = 1, n = anAllMap.Extent(); i <= n; i++ ) {
143 Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast(anAllMap( i ));
144 if ( anOwner.IsNull() || !anOwner->HasShape() )
147 const TopoDS_Shape& aSubShape = anOwner->Shape();
148 Standard_Integer aSubShapeId = aMapOfShapes.FindIndex( aSubShape );
149 if ( !aSubShapeId || !aIndexMap.Contains( aSubShapeId ) )
152 if ( !aToHiliteMap.Contains( anOwner ) )
153 aToHiliteMap.Add( anOwner );
157 GEOM_AISShape::GEOM_AISShape(const TopoDS_Shape& shape,
158 const Standard_CString aName)
159 : SALOME_AISShape(shape),
161 myDisplayVectors(false),
162 myDisplayVertices(false),
163 myFieldDataType(GEOM::FDT_Double),
165 myFieldStepRangeMin(0),
166 myFieldStepRangeMax(0)
168 //rnv: Commented to avoid bug with local selection
169 //SetHilightMode( CustomHighlight ); // override setting the mode to 0 inside AIS_Shape constructor
171 myShadingColor = Quantity_Color( Quantity_NOC_GOLDENROD );
172 myPrevDisplayMode = 0;
174 myEdgesInShadingColor = Quantity_Color( Quantity_NOC_GOLDENROD );
176 myTopLevel = Standard_False;
177 Graphic3d_MaterialAspect aMatAspect;
178 if ( !HasMaterial() ) {
179 aMatAspect.SetAmbient( 0.5 );
180 aMatAspect.SetDiffuse( 0.5 );
181 aMatAspect.SetEmissive( 0.5 );
182 aMatAspect.SetShininess(0.5 );
183 aMatAspect.SetSpecular( 0.5 );
185 myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(aMatAspect);
186 myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(aMatAspect);
190 GEOM_AISShape::~GEOM_AISShape()
194 void GEOM_AISShape::setIO(const Handle(SALOME_InteractiveObject)& io){
198 Handle(SALOME_InteractiveObject) GEOM_AISShape::getIO(){
199 Handle(SALOME_InteractiveObject) IO;
200 if ( !GetOwner().IsNull() )
201 IO = Handle(SALOME_InteractiveObject)::DownCast( GetOwner() );
205 Standard_Boolean GEOM_AISShape::hasIO(){
206 return !getIO().IsNull();
209 void GEOM_AISShape::setName(const Standard_CString aName)
213 Handle(SALOME_InteractiveObject) IO = getIO();
218 Standard_CString GEOM_AISShape::getName(){
219 return myName.ToCString();
222 void GEOM_AISShape::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
223 const Handle(Prs3d_Presentation)& aPrs,
224 const Standard_Integer aMode)
226 if (IsInfinite()) aPrs->SetInfiniteState(Standard_True); //pas de prise en compte lors du FITALL
228 Handle(AIS_InteractiveContext) anIC = GetContext();
229 // AKL: use old behavior to avoid keeping object's wireframe
230 // if to change shape properties (for example: 'Clear Top Level State','Color', 'Isos')
231 // calling popup menu over(!) the shape in OCC viewer.
232 anIC->SetToHilightSelected( false );
234 bool anIsField = !myFieldStepData.isEmpty();
235 bool anIsColorField = anIsField && myFieldDataType != GEOM::FDT_String;
236 bool anIsTextField = anIsField && myFieldDataType == GEOM::FDT_String;
238 #if OCC_VERSION_LARGE > 0x06070200
239 if (isShowVertices())
240 myDrawer->SetVertexDrawMode(Prs3d_VDM_All);
243 // StdSelect_DisplayMode d = (StdSelect_DisplayMode) aMode;
244 bool isTopLev = isTopLevel() && switchTopLevel();
247 case CustomHighlight:
250 SetColor(topLevelColor());
251 Handle(Prs3d_LineAspect) anAspect = Attributes()->WireAspect();
252 anAspect->SetColor( topLevelColor() );
253 Attributes()->SetWireAspect( anAspect );
255 if( !isTopLev && anIsColorField && myFieldDimension == 1 )
256 drawField( aPrs, false, aMode == CustomHighlight );
258 #if OCC_VERSION_MAJOR < 7
259 StdPrs_WFDeflectionShape::Add(aPrs,myshape,myDrawer);
261 StdPrs_WFShape::Add(aPrs,myshape,myDrawer);
267 shadingMode(aPresentationManager, aPrs, aMode);
270 case ShadingWithEdges:
272 myDrawer->SetFaceBoundaryDraw( Standard_True );
273 shadingMode(aPresentationManager, aPrs, Shading);
274 if( anIsColorField && myFieldDimension == 1 ) {
275 myDrawer->SetFaceBoundaryDraw( Standard_False );
282 #ifdef USE_TEXTURED_SHAPE
283 AIS_TexturedShape::Compute(aPresentationManager, aPrs, aMode);
285 AIS_Shape::Compute(aPresentationManager, aPrs, aMode);
291 const bool isVector = IsKind(STANDARD_TYPE(GEOM_AISVector));
292 TopExp_Explorer Exp ( myshape, TopAbs_EDGE );
293 for ( ; Exp.More(); Exp.Next() ) {
294 TopoDS_Vertex aV1, aV2;
295 TopoDS_Edge anEdgeE = TopoDS::Edge(Exp.Current());
297 // draw curve direction (issue 0021087)
298 anEdgeE.Orientation( TopAbs_FORWARD );
300 if ( anEdgeE.IsNull() ) continue;
302 TopExp::Vertices(anEdgeE, aV1, aV2);
303 gp_Pnt aP1 = BRep_Tool::Pnt(aV1);
304 gp_Pnt aP2 = BRep_Tool::Pnt(aV2);
308 Handle(Geom_Curve) C = BRep_Tool::Curve(anEdgeE,fp,lp);
310 if ( C.IsNull() ) continue;
312 if ( anEdgeE.Orientation() == TopAbs_FORWARD )
313 C->D1(lp, aP2, aDirVec);
315 C->D1(fp, aP1, aDirVec);
319 GeomAdaptor_Curve aAdC;
320 aAdC.Load(C, fp, lp);
321 Standard_Real aDist = GCPnts_AbscissaPoint::Length(aAdC, fp, lp);
323 if (aDist > gp::Resolution()) {
325 if ( anEdgeE.Orientation() == TopAbs_FORWARD )
330 Prs3d_Arrow::Draw(aPrs, aP2, aDir, M_PI/180.*5., aDist/10.);
335 // draw color field on vertices
336 if( anIsColorField && myFieldDimension == 0 && aMode != CustomHighlight )
341 drawField( aPrs, true );
346 // aPrs->ReCompute(); // for hidden line recomputation if necessary...
349 void GEOM_AISShape::SetShadingColor(const Quantity_Color &aCol)
351 myShadingColor = aCol;
354 void GEOM_AISShape::SetEdgesInShadingColor(const Quantity_Color &aCol)
356 myEdgesInShadingColor = aCol;
359 void GEOM_AISShape::SetLabelColor(const Quantity_Color &aCol) {
363 void GEOM_AISShape::highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndexMap,
364 const Standard_Boolean aHighlight )
366 Handle(AIS_InteractiveObject) anObj = this;
367 Handle(AIS_InteractiveContext) anIC = GetContext();
368 if ( anIC.IsNull() || !anIC->HasOpenedContext() )
371 Standard_Boolean isAutoHilight = anIC->AutomaticHilight();
372 anIC->SetAutomaticHilight( false );
374 anIC->ClearSelected( false );
377 SelectMgr_IndexedMapOfOwner anAllMap, aToHiliteMap;
379 // Get entity owners for all activated selection modes
380 getEntityOwners( anObj, anIC, anAllMap );
382 // Convert <aIndexMap> into the map of owners to highlight/unhighlight
383 indicesToOwners( aIndexMap, Shape(), anAllMap, aToHiliteMap );
386 for ( Standard_Integer i = 1, n = aToHiliteMap.Extent(); i <= n; i++ )
387 anIC->AddOrRemoveSelected( aToHiliteMap( i ), false );
390 anIC->SetAutomaticHilight( isAutoHilight );
391 anIC->HilightSelected( false );
394 void GEOM_AISShape::SetDisplayVectors(bool isDisplayed)
396 myDisplayVectors = isDisplayed;
399 void GEOM_AISShape::SetDisplayVertices(bool isDisplayed)
401 myDisplayVertices = isDisplayed;
404 void GEOM_AISShape::SetDisplayName(bool isDisplayed)
406 myDisplayName = isDisplayed;
409 void GEOM_AISShape::shadingMode(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
410 const Handle(Prs3d_Presentation)& aPrs,
411 const Standard_Integer aMode)
413 myDrawer->ShadingAspect()->Aspect()->SetDistinguishOn();
415 Graphic3d_MaterialAspect aMatAspect(Graphic3d_NOM_PLASTIC);
416 aMatAspect.SetTransparency(Transparency());
417 Graphic3d_MaterialAspect currentFrontMaterial = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
418 Graphic3d_MaterialAspect currentBackMaterial = myDrawer->ShadingAspect()->Aspect()->BackMaterial();
419 myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial( isTopLevel() ? aMatAspect : currentFrontMaterial );
420 myDrawer->ShadingAspect()->Aspect()->SetBackMaterial ( isTopLevel() ? aMatAspect : currentBackMaterial );
422 if( isTopLevel() && switchTopLevel() )
423 myDrawer->ShadingAspect()->SetColor( topLevelColor() );
425 if(myDrawer->ShadingAspect()->Aspect()->FrontMaterial().MaterialType( Graphic3d_MATERIAL_ASPECT ))
426 myDrawer->ShadingAspect()->SetColor(myShadingColor);
428 myDrawer->ShadingAspect()->SetColor(myDrawer->ShadingAspect()->Aspect()->FrontMaterial().AmbientColor());
431 bool anIsColorField = !myFieldStepData.isEmpty() && myFieldDataType != GEOM::FDT_String;
432 if( anIsColorField && ( myFieldDimension == 2 || myFieldDimension == 3 || myFieldDimension == -1 ) )
438 // PAL12113: AIS_Shape::Compute() works correctly with shapes containing no faces
439 //StdPrs_ShadedShape::Add(aPrs,myshape,myDrawer);
440 #ifdef USE_TEXTURED_SHAPE
441 AIS_TexturedShape::Compute(aPresentationManager, aPrs, aMode);
443 AIS_Shape::Compute(aPresentationManager, aPrs, aMode);
448 Standard_Boolean GEOM_AISShape::isTopLevel() {
452 void GEOM_AISShape::setTopLevel(Standard_Boolean f) {
455 myPrevDisplayMode = DisplayMode();
457 switch(topLevelDisplayMode()) {
458 case TopWireFrame : dm = Wireframe; break;
459 case TopShading : dm = Shading; break;
460 case TopShadingWithEdges : dm = ShadingWithEdges; break;
461 default : dm = myPrevDisplayMode; break;
466 SetDisplayMode(myPrevDisplayMode);
471 void GEOM_AISShape::setPrevDisplayMode(const Standard_Integer mode) {
472 myPrevDisplayMode = mode;
475 Quantity_Color GEOM_AISShape::topLevelColor() {
476 return myTopLevelColor;
479 void GEOM_AISShape::setTopLevelColor(const Quantity_Color c) {
483 GEOM_AISShape::TopLevelDispMode GEOM_AISShape::topLevelDisplayMode() {
486 void GEOM_AISShape::setTopLevelDisplayMode(const GEOM_AISShape::TopLevelDispMode dm) {
490 Standard_Boolean GEOM_AISShape::switchTopLevel() {
491 return myTopLevelDm != TopShowAdditionalWActor;
494 Standard_Boolean GEOM_AISShape::toActivate() {
495 return ( myTopLevel && myTopLevelDm == TopShowAdditionalWActor ) ? false : true;
498 void GEOM_AISShape::setFieldStepInfo( const GEOM::field_data_type theFieldDataType,
499 const int theFieldDimension,
500 const QList<QVariant>& theFieldStepData,
501 const TCollection_AsciiString& theFieldStepName,
502 const double theFieldStepRangeMin,
503 const double theFieldStepRangeMax )
505 myFieldDataType = theFieldDataType;
506 myFieldDimension = theFieldDimension;
507 myFieldStepData = theFieldStepData;
508 myFieldStepName = theFieldStepName;
509 myFieldStepRangeMin = theFieldStepRangeMin;
510 myFieldStepRangeMax = theFieldStepRangeMax;
513 void GEOM_AISShape::getFieldStepInfo( GEOM::field_data_type& theFieldDataType,
514 int& theFieldDimension,
515 QList<QVariant>& theFieldStepData,
516 TCollection_AsciiString& theFieldStepName,
517 double& theFieldStepRangeMin,
518 double& theFieldStepRangeMax ) const
520 theFieldDataType = myFieldDataType;
521 theFieldDimension = myFieldDimension;
522 theFieldStepData = myFieldStepData;
523 theFieldStepName = myFieldStepName;
524 theFieldStepRangeMin = myFieldStepRangeMin;
525 theFieldStepRangeMax = myFieldStepRangeMax;
528 void GEOM_AISShape::drawField( const Handle(Prs3d_Presentation)& thePrs,
529 const bool theIsString,
530 const bool theIsHighlight )
532 if( myFieldStepData.isEmpty() )
535 QListIterator<QVariant> aFieldStepDataIter( myFieldStepData );
537 TopAbs_ShapeEnum aShapeType = TopAbs_SHAPE;
538 switch( myFieldDimension )
540 case 0: aShapeType = TopAbs_VERTEX; break;
541 case 1: aShapeType = TopAbs_EDGE; break;
542 case 2: aShapeType = TopAbs_FACE; break;
543 case 3: aShapeType = TopAbs_SOLID; break;
544 case -1: aShapeType = TopAbs_VERTEX; break;
547 TopTools_IndexedMapOfShape aShapeMap;
548 TopExp::MapShapes( myshape, aShapeMap );
550 TColStd_IndexedMapOfInteger anIndexMap;
552 TopExp_Explorer anExp;
553 for( anExp.Init( myshape, aShapeType ); anExp.More(); anExp.Next() )
555 TopoDS_Shape aSubShape = anExp.Current();
556 if( !aSubShape.IsNull() )
558 Standard_Integer aSubShapeIndex = aShapeMap.FindIndex( aSubShape );
559 if( anIndexMap.Contains( aSubShapeIndex ) )
562 anIndexMap.Add( aSubShapeIndex );
564 Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup( thePrs );
568 if( aFieldStepDataIter.hasNext() )
570 const QVariant& aVariant = aFieldStepDataIter.next();
572 aString = aVariant.toString();
574 aQColor = aVariant.value<QColor>();
582 if( computeMassCenter( aSubShape, aCenter ) )
584 Graphic3d_Vertex aVertex( aCenter.X(), aCenter.Y(), aCenter.Z() );
586 Handle(Graphic3d_AspectText3d) anAspectText3d = new Graphic3d_AspectText3d();
587 anAspectText3d->SetStyle( Aspect_TOST_ANNOTATION );
588 anAspectText3d->SetColor( myLabelColor );
589 aGroup->SetPrimitivesAspect( anAspectText3d );
591 aGroup->Text( aString.toLatin1().constData(), aVertex, 14 );
596 Quantity_Color aColor( aQColor.redF(), aQColor.greenF(), aQColor.blueF(), Quantity_TOC_RGB );
597 if( myFieldDimension == 0 )
599 TopoDS_Vertex aVertexShape = TopoDS::Vertex( aSubShape );
600 if( !aVertexShape.IsNull() )
602 gp_Pnt aPnt = BRep_Tool::Pnt( aVertexShape );
604 Handle(Graphic3d_AspectMarker3d) anAspectMarker3d = new Graphic3d_AspectMarker3d();
605 anAspectMarker3d->SetColor( aColor );
606 anAspectMarker3d->SetType( Aspect_TOM_POINT );
607 anAspectMarker3d->SetScale( 10.0 );
608 aGroup->SetPrimitivesAspect( anAspectMarker3d );
610 Handle(Graphic3d_ArrayOfPoints) anArray = new Graphic3d_ArrayOfPoints( 1 );
611 anArray->AddVertex( aPnt.X(), aPnt.Y(), aPnt.Z() );
613 aGroup->AddPrimitiveArray( anArray );
616 else if( myFieldDimension == 1 )
618 myDrawer->WireAspect()->SetColor( aColor );
620 myDrawer->WireAspect()->SetWidth( myOwnWidth );
622 myDrawer->WireAspect()->SetWidth( myOwnWidth + 4 );
623 #if OCC_VERSION_MAJOR < 7
624 StdPrs_WFDeflectionShape::Add( thePrs, aSubShape, myDrawer );
626 StdPrs_WFShape::Add( thePrs, aSubShape, myDrawer );
629 else if( myFieldDimension == 2 ||
630 myFieldDimension == 3 ||
631 myFieldDimension == -1 )
633 myDrawer->ShadingAspect()->SetColor( aColor );
634 StdPrs_ShadedShape::Add( thePrs, aSubShape, myDrawer );
641 void GEOM_AISShape::drawName( const Handle(Prs3d_Presentation)& thePrs )
643 Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup( thePrs );
645 gp_Ax3 anAx3 = GEOMUtils::GetPosition(myshape);
646 gp_Pnt aCenter = anAx3.Location();
648 Graphic3d_Vertex aVertex( aCenter.X(), aCenter.Y(), aCenter.Z() );
650 Handle(Graphic3d_AspectText3d) anAspectText3d = new Graphic3d_AspectText3d();
651 anAspectText3d->SetStyle( Aspect_TOST_ANNOTATION );
652 anAspectText3d->SetColor( myLabelColor );
653 aGroup->SetPrimitivesAspect( anAspectText3d );
655 const char* aName = getIO()->getName();
656 aGroup->Text( TCollection_ExtendedString( aName ), aVertex, 16 );
659 Standard_Boolean GEOM_AISShape::computeMassCenter( const TopoDS_Shape& theShape,
662 Standard_Real aX = 0, aY = 0, aZ = 0;
663 Standard_Integer aNbPoints = 0;
665 TopExp_Explorer anExp;
666 for( anExp.Init( theShape, TopAbs_VERTEX ); anExp.More(); anExp.Next() )
668 TopoDS_Vertex aVertex = TopoDS::Vertex( anExp.Current() );
669 if( !aVertex.IsNull() )
671 gp_Pnt aPnt = BRep_Tool::Pnt( aVertex );
680 return Standard_False;
682 theCenter.SetCoord( aX / (Standard_Real)aNbPoints,
683 aY / (Standard_Real)aNbPoints,
684 aZ / (Standard_Real)aNbPoints );
685 return Standard_True;