]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModuleBase/ModuleBase_ResultPrs.cpp
Salome HOME
10f3d798b25145243c6853cb21a2df92a9c2d29d
[modules/shaper.git] / src / ModuleBase / ModuleBase_ResultPrs.cpp
1 // Copyright (C) 2014-2020  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #include "ModuleBase_ResultPrs.h"
21 #include "ModuleBase_IViewer.h"
22
23 #include <GeomAPI_PlanarEdges.h>
24 #include <GeomAPI_Edge.h>
25
26 #include <ModelAPI_Events.h>
27 #include <ModelAPI_Tools.h>
28 #include <ModelAPI_ResultConstruction.h>
29 #include <ModelAPI_ResultBody.h>
30 #include <ModelAPI_AttributeIntArray.h>
31
32 #include "ModuleBase_Tools.h"
33 #include "ModuleBase_BRepOwner.h"
34
35 #include <Events_InfoMessage.h>
36 #include <Events_Loop.h>
37 #include <Config_PropManager.h>
38
39 #include <AIS_ColoredDrawer.hxx>
40 #include <AIS_InteractiveContext.hxx>
41 #include <AIS_Selection.hxx>
42 #include <BOPTools_AlgoTools3D.hxx>
43 #include <BRep_Builder.hxx>
44 #include <Graphic3d_AspectMarker3d.hxx>
45 #include <Prs3d_Drawer.hxx>
46 #include <Prs3d.hxx>
47 #include <Prs3d_PointAspect.hxx>
48 #include <Prs3d_IsoAspect.hxx>
49 #include <Prs3d_ShadingAspect.hxx>
50 #include <Prs3d_PlaneAspect.hxx>
51 #include <SelectMgr_SequenceOfOwner.hxx>
52 #include <SelectMgr_EntityOwner.hxx>
53 #include <SelectMgr_SelectionManager.hxx>
54 #include <StdPrs_WFShape.hxx>
55 #include <StdPrs_ShadedShape.hxx>
56 #include <StdSelect_BRepSelectionTool.hxx>
57 #include <TColStd_ListIteratorOfListOfInteger.hxx>
58 #include <TopExp_Explorer.hxx>
59 #include <TopoDS.hxx>
60 #include <TopoDS_Builder.hxx>
61 #include <TopoDS_Edge.hxx>
62 #include <BRepMesh_IncrementalMesh.hxx>
63 #include <Standard_Version.hxx>
64
65 #if OCC_VERSION_HEX > 0x070400
66 #include <StdPrs_ToolTriangulatedShape.hxx>
67 #endif
68
69 //*******************************************************************************************
70
71 IMPLEMENT_STANDARD_RTTIEXT(ModuleBase_ResultPrs, ViewerData_AISShape);
72
73
74
75 //********************************************************************
76 ModuleBase_ResultPrs::ModuleBase_ResultPrs(ResultPtr theResult)
77   : ViewerData_AISShape(TopoDS_Shape()),
78     myResult(theResult),
79     myIsSubstituted(false),
80     myTransparency(1),
81     myAdditionalSelectionPriority(0)
82 {
83
84   GeomShapePtr aShapePtr = ModelAPI_Tools::shape(theResult);
85   TopoDS_Shape aShape = aShapePtr->impl<TopoDS_Shape>();
86   // Workaround for Sketch subshapes which has no discrete representation
87   // until sketch faces are built and displayed.
88   // Thus, perform discretization of such edges.
89   if (theResult->groupName() == ModelAPI_ResultConstruction::group() &&
90     aShape.ShapeType() == TopAbs_EDGE) {
91     GeomEdgePtr anEdgePtr = GeomEdgePtr(new GeomAPI_Edge(aShapePtr));
92     if (anEdgePtr->isCircle() || anEdgePtr->isArc()) {
93       TopoDS_Edge anEdge = TopoDS::Edge(aShape);
94       TopLoc_Location aLoc;
95       Handle(Poly_Polygon3D) aPoly3D = BRep_Tool::Polygon3D(anEdge, aLoc);
96       if (aPoly3D.IsNull()) {
97         double aDeflection = Config_PropManager::real("Visualization", "construction_deflection");
98         BRepMesh_IncrementalMesh(aShape, aDeflection);
99       }
100     }
101   }
102   Set(aShape);
103
104   // Activate individual repaintng if this is a part of compsolid
105   ResultBodyPtr aResOwner = ModelAPI_Tools::bodyOwner(myResult);
106   SetAutoHilight(aResOwner.get() == NULL);
107
108   // Set own free boundaries aspect in order to have free
109   // and unfree boundaries with different colors
110   Handle(Prs3d_Drawer) aDrawer = Attributes();
111   aDrawer->SetUnFreeBoundaryAspect(
112     new Prs3d_LineAspect(Quantity_NOC_YELLOW, Aspect_TOL_SOLID, 1));
113   aDrawer->SetFreeBoundaryAspect(new Prs3d_LineAspect(Quantity_NOC_GREEN, Aspect_TOL_SOLID, 1));
114   aDrawer->SetFaceBoundaryAspect(new Prs3d_LineAspect(Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1));
115
116   Quantity_Color aColor;
117   Color(aColor);
118
119   std::vector<int> aIsoValues;
120   bool isIsoVisible;
121   ModelAPI_Tools::getIsoLines(myResult, isIsoVisible, aIsoValues);
122   if (isIsoVisible) {
123     if (aIsoValues.size() == 0) {
124       aIsoValues.push_back(1);
125       aIsoValues.push_back(1);
126     }
127   }
128   else {
129     aIsoValues.push_back(0);
130     aIsoValues.push_back(0);
131   }
132   myUIsoAspect = new Prs3d_IsoAspect(aColor, Aspect_TOL_SOLID, 1, aIsoValues[0]);
133   myVIsoAspect = new Prs3d_IsoAspect(aColor, Aspect_TOL_SOLID, 1, aIsoValues[1]);
134   aDrawer->SetUIsoAspect(myUIsoAspect);
135   aDrawer->SetVIsoAspect(myVIsoAspect);
136
137   if (aDrawer->HasOwnPointAspect())
138     aDrawer->PointAspect()->SetTypeOfMarker(Aspect_TOM_PLUS);
139   else
140     aDrawer->SetPointAspect(new Prs3d_PointAspect(Aspect_TOM_PLUS, Quantity_NOC_YELLOW, 1.));
141
142   aDrawer = DynamicHilightAttributes();
143   if (aDrawer.IsNull()) {
144     if (!ModuleBase_IViewer::DefaultHighlightDrawer.IsNull()) {
145       aDrawer = new Prs3d_Drawer(*ModuleBase_IViewer::DefaultHighlightDrawer);
146       aDrawer->SetUIsoAspect(myUIsoAspect);
147       aDrawer->SetVIsoAspect(myVIsoAspect);
148       SetDynamicHilightAttributes(aDrawer);
149     }
150   }
151
152   myHiddenSubShapesDrawer = new AIS_ColoredDrawer(myDrawer);
153   Handle(Prs3d_ShadingAspect) aShadingAspect = new Prs3d_ShadingAspect();
154   aShadingAspect->SetMaterial(Graphic3d_NOM_BRASS); //default value of context material
155   aShadingAspect->Aspect()->SetEdgeColor(Quantity_NOC_BLACK);
156   myHiddenSubShapesDrawer->SetShadingAspect(aShadingAspect);
157
158   ModuleBase_Tools::setPointBallHighlighting(this);
159
160   // Define colors for wireframe mode
161   setEdgesDefaultColor();
162
163   ModuleBase_Tools::setDefaultDeviationCoefficient(Shape(), DynamicHilightAttributes());
164   ModuleBase_Tools::setDefaultDeviationCoefficient(Shape(), Attributes());
165   Attributes()->UpdatePreviousDeviationCoefficient();
166 }
167
168 //********************************************************************
169 void ModuleBase_ResultPrs::setAdditionalSelectionPriority(const int thePriority)
170 {
171   myAdditionalSelectionPriority = thePriority;
172 }
173
174 //********************************************************************
175 void ModuleBase_ResultPrs::SetColor (const Quantity_Color& theColor)
176 {
177   ViewerData_AISShape::SetColor(theColor);
178   myHiddenSubShapesDrawer->ShadingAspect()->SetColor (theColor, myCurrentFacingModel);
179   setEdgesDefaultColor();
180   myUIsoAspect->SetColor(theColor);
181   myVIsoAspect->SetColor(theColor);
182 }
183
184 void ModuleBase_ResultPrs::setEdgesDefaultColor()
185 {
186   if (myResult.get()) {
187     AttributeIntArrayPtr aColorAttr = myResult->data()->intArray(ModelAPI_Result::COLOR_ID());
188     bool aHasColor = aColorAttr.get() && aColorAttr->isInitialized();
189
190     Handle(Prs3d_Drawer) aDrawer = Attributes();
191     aDrawer->SetFaceBoundaryDraw(Standard_True);
192     aDrawer->FaceBoundaryAspect()->SetColor(Quantity_NOC_BLACK);
193
194     if (!aHasColor) {
195       aDrawer->UnFreeBoundaryAspect()->SetColor(Quantity_NOC_YELLOW);
196       aDrawer->FreeBoundaryAspect()->SetColor(Quantity_NOC_GREEN);
197       aDrawer->WireAspect()->SetColor(Quantity_NOC_RED);
198
199       aDrawer->SetUnFreeBoundaryDraw(Standard_True);
200       aDrawer->SetFreeBoundaryDraw(Standard_True);
201       aDrawer->SetWireDraw(Standard_True);
202     }
203   }
204 }
205
206
207 //********************************************************************
208 void ModuleBase_ResultPrs::setSubShapeHidden(const TopoDS_ListOfShape& theShapes)
209 {
210   TopoDS_Compound aCompound;
211   BRep_Builder aBBuilder;
212   aBBuilder.MakeCompound (aCompound);
213
214   myHiddenSubShapes = theShapes;
215   collectSubShapes(aBBuilder, aCompound, myOriginalShape, myHiddenSubShapes);
216   myVisibleCompound = aCompound;
217
218   aBBuilder.MakeCompound (aCompound);
219   TopoDS_ListOfShape::Iterator aIt(myHiddenSubShapes);
220   for (; aIt.More(); aIt.Next()) {
221     aBBuilder.Add(aCompound, aIt.Value());
222   }
223   myHiddenCompound = aCompound;
224 }
225
226 //********************************************************************
227 bool ModuleBase_ResultPrs::isSubShapeHidden(const TopoDS_Shape& theShape)
228 {
229   if (theShape.IsNull() || theShape.ShapeType() != TopAbs_FACE) // only face shape can be hidden
230     return false;
231
232   // orientation of parameter shape(come from selection) may be wrong, check isEqual() to be sure
233   TopoDS_ListOfShape::Iterator aShapeIt(myHiddenSubShapes);
234   for (; aShapeIt.More(); aShapeIt.Next()) {
235     if (theShape.IsSame(aShapeIt.Value()))
236       return true;
237   }
238
239   return true;
240 }
241
242 //********************************************************************
243 bool ModuleBase_ResultPrs::hasSubShapeVisible(
244   const TopoDS_ListOfShape& theShapesToSkip)
245 {
246   TopoDS_Compound aCompound;
247   BRep_Builder aBuilder;
248   aBuilder.MakeCompound (aCompound);
249   TopoDS_ListOfShape aShapesToSkip;
250   TopoDS_ListOfShape aHiddenCopy(myHiddenSubShapes);
251   aShapesToSkip.Append(aHiddenCopy);
252   for (TopoDS_ListOfShape::Iterator anIt(theShapesToSkip); anIt.More(); anIt.Next())
253     aShapesToSkip.Append(anIt.Value());
254
255   collectSubShapes(aBuilder, aCompound, myOriginalShape, aShapesToSkip);
256   return !BOPTools_AlgoTools3D::IsEmptyShape(aCompound);
257 }
258
259 //********************************************************************
260 bool ModuleBase_ResultPrs::setHiddenSubShapeTransparency(double theTransparency)
261 {
262   if (myTransparency == theTransparency || theTransparency > 1 || theTransparency < 0)
263     return false;
264
265   myTransparency = theTransparency;
266   myHiddenSubShapesDrawer->ShadingAspect()->SetTransparency (theTransparency, myCurrentFacingModel);
267   return true;
268 }
269
270 //********************************************************************
271 void ModuleBase_ResultPrs::Compute(
272           const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
273           const Handle(Prs3d_Presentation)& thePresentation,
274           const Standard_Integer theMode)
275 {
276   std::shared_ptr<GeomAPI_Shape> aShapePtr = myResult->shape();
277   bool aReadyToDisplay = aShapePtr.get();
278   if (aReadyToDisplay) {
279     myOriginalShape = aShapePtr->impl<TopoDS_Shape>();
280     if (myHiddenSubShapes.IsEmpty() || myOriginalShape.ShapeType() > TopAbs_FACE ) {
281       if (!myOriginalShape.IsNull()) {
282         Set(myOriginalShape);
283         myIsSubstituted = false;
284       }
285     }
286     else { // convert shape into SHELL
287       bool isEmptyShape = BOPTools_AlgoTools3D::IsEmptyShape(myVisibleCompound);
288       Set(myVisibleCompound);
289       myIsSubstituted = true;
290       if (isEmptyShape)
291         aReadyToDisplay = false;
292     }
293   }
294   // change deviation coefficient to provide more precise circle
295   try {
296     AIS_Shape::Compute(thePresentationManager, thePresentation, theMode);
297   }
298   catch (...) {
299     return;
300   }
301
302   // visualize hidden sub-shapes transparent
303   if (myResult.get()) {
304     if (myTransparency < 1 && !myHiddenSubShapes.IsEmpty())
305     {
306       StdPrs_ShadedShape::Add(thePresentation, myHiddenCompound, myHiddenSubShapesDrawer);
307       aReadyToDisplay = true;
308     }
309
310     if (!aReadyToDisplay) {
311       Events_InfoMessage("ModuleBase_ResultPrs",
312         "An empty AIS presentation: ModuleBase_ResultPrs").send();
313       static const Events_ID anEvent = Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION);
314       ModelAPI_EventCreator::get()->sendUpdated(myResult, anEvent);
315     }
316   }
317 }
318
319 //********************************************************************
320 void ModuleBase_ResultPrs::collectSubShapes(BRep_Builder& theBuilder,
321   TopoDS_Shape& theCompound, const TopoDS_Shape& theShape,
322   const TopoDS_ListOfShape& theHiddenSubShapes)
323 {
324   switch (theShape.ShapeType()) {
325     case TopAbs_COMPSOLID:
326     case TopAbs_COMPOUND: {
327       for (TopoDS_Iterator aChildIter (theShape); aChildIter.More(); aChildIter.Next())
328         collectSubShapes(theBuilder, theCompound, aChildIter.Value(), theHiddenSubShapes);
329     }
330     break;
331     case TopAbs_SOLID:
332     case TopAbs_SHELL: {
333       for (TopExp_Explorer anExp (theShape, TopAbs_FACE); anExp.More(); anExp.Next()) {
334         collectSubShapes(theBuilder, theCompound, anExp.Current(), theHiddenSubShapes);
335       }
336     }
337     break;
338     case TopAbs_WIRE: {
339       for (TopExp_Explorer anExp (theShape, TopAbs_EDGE); anExp.More(); anExp.Next()) {
340         collectSubShapes(theBuilder, theCompound, anExp.Current(), theHiddenSubShapes);
341       }
342     }
343     break;
344     case TopAbs_FACE: {
345       if (theHiddenSubShapes.Contains(theShape))
346         return; // remove hidden shape
347       theBuilder.Add(theCompound, theShape);
348     }
349     break;
350     case TopAbs_EDGE:
351     case TopAbs_VERTEX: {
352       theBuilder.Add(theCompound, theShape);
353     }
354     default:
355       break;
356   }
357 }
358
359 //********************************************************************
360 void ModuleBase_ResultPrs::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
361                                             const Standard_Integer theMode)
362 {
363   if (appendVertexSelection(aSelection, theMode))
364     return;
365
366   if (theMode > TopAbs_SHAPE) {
367     // In order to avoid using custom selection modes
368     if (theMode == ModuleBase_ResultPrs::Sel_Result) {
369       AIS_Shape::ComputeSelection(aSelection, TopAbs_COMPOUND);
370     }
371     return;
372   }
373
374   // TODO: OCCT issue should be created for the COMPOUND processing
375   // before it is fixed, the next workaround in necessary
376   if (theMode == AIS_Shape::SelectionMode(TopAbs_COMPOUND)) {
377     const TopoDS_Shape& aShape = Shape();
378     TopExp_Explorer aCompExp(aShape, TopAbs_COMPOUND);
379     // do not activate in compound mode shapes which do not contain compounds
380     if (!aCompExp.More())
381       return;
382   }
383
384   // bug 2110: if (theMode == AIS_Shape::SelectionMode(TopAbs_COMPSOLID)) {
385   //  // Limit selection area only by actual object (Shape)
386   //  ResultCompSolidPtr aCompSolid = ModelAPI_Tools::compSolidOwner(myResult);
387   //  if (aCompSolid.get()) {
388   //    std::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(aCompSolid);
389   //    if (aShapePtr.get()) {
390   //      TopoDS_Shape aShape = aShapePtr->impl<TopoDS_Shape>();
391   //   int aPriority = StdSelect_BRepSelectionTool::GetStandardPriority(aShape, TopAbs_COMPSOLID);
392   //     /// It is important to have priority for the shape of comp solid result less than priority
393   //      /// for the presentation shape which is a sub-result.
394   //      /// Reason is to select the sub-objects before: #1592
395   //      aPriority = aPriority - 1;
396   //      double aDeflection = Prs3d::GetDeflection(aShape, myDrawer);
397
398   //      Handle(ModuleBase_BRepOwner) aOwner = new ModuleBase_BRepOwner(aShape, aPriority);
399   //      StdSelect_BRepSelectionTool::ComputeSensitive(aShape, aOwner, aSelection,
400   //        aDeflection, myDrawer->HLRAngle(), 9, 500);
401
402   //      for (aSelection->Init(); aSelection->More(); aSelection->Next()) {
403   //        Handle(SelectMgr_EntityOwner) anOwner =
404   //          Handle(SelectMgr_EntityOwner)
405   //          ::DownCast(aSelection->Sensitive()->BaseSensitive()->OwnerId());
406   //        anOwner->Set(this);
407   //      }
408   //      return;
409   //    }
410   //  }
411   //}
412   AIS_Shape::ComputeSelection(aSelection, theMode);
413
414   if (myAdditionalSelectionPriority > 0) {
415     NCollection_Vector<Handle(SelectMgr_SensitiveEntity)> anEntities = aSelection->Entities();
416     for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator anIt(anEntities);
417          anIt.More();
418          anIt.Next()) {
419       Handle(SelectMgr_SensitiveEntity) anEntity = anIt.Value();
420       Handle(SelectBasics_EntityOwner) aBasicsOwner = anEntity->BaseSensitive()->OwnerId();
421       if (!aBasicsOwner.IsNull())
422         aBasicsOwner->SetPriority(aBasicsOwner->Priority() + myAdditionalSelectionPriority);
423     }
424   }
425 }
426
427 //********************************************************************
428 bool ModuleBase_ResultPrs::appendVertexSelection(const Handle(SelectMgr_Selection)& aSelection,
429                                                  const Standard_Integer /*theMode*/)
430 {
431   if (Shape().ShapeType() == TopAbs_VERTEX) {
432     const TopoDS_Shape& aShape = Shape();
433
434     int aPriority = StdSelect_BRepSelectionTool::GetStandardPriority(aShape, TopAbs_VERTEX);
435 #if OCC_VERSION_HEX > 0x070400
436     double aDeflection = StdPrs_ToolTriangulatedShape::GetDeflection(aShape, myDrawer);
437 #else
438     double aDeflection = Prs3d::GetDeflection(aShape, myDrawer);
439 #endif
440     /// The cause of this method is the last parameter of BRep owner setting into True.
441     /// That means that owner should behave like it comes from decomposition. (In this case, OCCT
442     /// visualizes it in Ring style) OCCT version is 7.0.0 with path for SHAPER module.
443     Handle(StdSelect_BRepOwner) aOwner = new StdSelect_BRepOwner(aShape, aPriority, Standard_True);
444     StdSelect_BRepSelectionTool::ComputeSensitive(aShape, aOwner, aSelection,
445                                                   aDeflection, myDrawer->HLRAngle(), 9, 500);
446
447
448     NCollection_Vector<Handle(SelectMgr_SensitiveEntity)> anEntities = aSelection->Entities();
449     for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator anIt(anEntities);
450          anIt.More();
451          anIt.Next()) {
452       Handle(SelectMgr_SensitiveEntity) anEntity = anIt.Value();
453       Handle(SelectMgr_EntityOwner) anOwner = anEntity->BaseSensitive()->OwnerId();
454       anOwner->SetSelectable(this);
455     }
456
457     return true;
458   }
459   return false;
460 }
461
462 //********************************************************************
463 void ModuleBase_ResultPrs::HilightSelected(const Handle(PrsMgr_PresentationManager3d)& thePM,
464                                            const SelectMgr_SequenceOfOwner& theOwners)
465 {
466   Handle(SelectMgr_EntityOwner) anOwner;
467   Handle(ModuleBase_BRepOwner) aCompOwner;
468   for (int i = 1; i <= theOwners.Length(); i++) {
469     anOwner = theOwners.Value(i);
470     aCompOwner = Handle(ModuleBase_BRepOwner)::DownCast(anOwner);
471     if (aCompOwner.IsNull()) {
472       thePM->Color(anOwner->Selectable(), GetContext()->SelectionStyle());
473     }
474     else {
475       TopoDS_Shape aShape = aCompOwner->Shape();
476       Handle( Prs3d_Presentation ) aSelectionPrs = GetSelectPresentation( thePM );
477       aSelectionPrs->Clear();
478
479       StdPrs_WFShape::Add(aSelectionPrs, aShape, myDrawer);
480
481       aSelectionPrs->SetDisplayPriority(9);
482       aSelectionPrs->Highlight(GetContext()->SelectionStyle());
483       aSelectionPrs->Display();
484       thePM->Color(this, GetContext()->SelectionStyle());
485     }
486   }
487 }
488
489 //********************************************************************
490 void ModuleBase_ResultPrs::HilightOwnerWithColor(const Handle(PrsMgr_PresentationManager3d)& thePM,
491                                                  const Handle(Prs3d_Drawer)& theStyle,
492                                                  const Handle(SelectMgr_EntityOwner)& theOwner)
493 {
494   Handle(StdSelect_BRepOwner) aOwner = Handle(StdSelect_BRepOwner)::DownCast(theOwner);
495   if (aOwner.IsNull())
496     return;
497
498   TopoDS_Shape aShape = aOwner->Shape();
499   if (!aShape.IsNull()) {
500     thePM->Color(this, theStyle);
501
502     Handle( Prs3d_Presentation ) aHilightPrs = GetHilightPresentation( thePM );
503     aHilightPrs->Clear();
504
505     StdPrs_WFShape::Add(aHilightPrs, aShape, myDrawer);
506     aHilightPrs->Highlight(theStyle);
507
508     if (thePM->IsImmediateModeOn())
509       thePM->AddToImmediateList(aHilightPrs);
510   }
511 }
512
513
514 //********************************************************************
515 void ModuleBase_ResultPrs::updateIsoLines()
516 {
517   std::vector<int> aIsoValues;
518   bool isIsoVisible;
519   ModelAPI_Tools::getIsoLines(myResult, isIsoVisible, aIsoValues);
520   if (isIsoVisible) {
521     if (aIsoValues.size() == 0) {
522       aIsoValues.push_back(1);
523       aIsoValues.push_back(1);
524     }
525   }
526   else {
527     if (aIsoValues.size() == 0) {
528       aIsoValues.push_back(0);
529       aIsoValues.push_back(0);
530     }
531     else {
532       aIsoValues[0] = 0;
533       aIsoValues[1] = 0;
534     }
535   }
536   myUIsoAspect->SetNumber(aIsoValues[0]);
537   myVIsoAspect->SetNumber(aIsoValues[1]);
538 }