Salome HOME
Remove references to land cover object from data model and GUI in order to have a...
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Shape.cxx
1 // Copyright (C) 2014-2015  EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
6 //
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10 // Lesser General Public License for more details.
11 //
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
15 //
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
17 //
18
19 #include <HYDROGUI_Shape.h>
20 #include <HYDROGUI_Tool.h>
21 #include <HYDROGUI_Polyline.h>
22
23 #include <HYDROData_Channel.h>
24 #include <HYDROData_Document.h>
25 #include <HYDROData_DummyObject3D.h>
26 #include <HYDROData_ImmersibleZone.h>
27 #include <HYDROData_Obstacle.h>
28 #include <HYDROData_PolylineXY.h>
29 #include <HYDROData_Polyline3D.h>
30 #include <HYDROData_Profile.h>
31 #include <HYDROData_ShapesGroup.h>
32 #include <HYDROData_Stream.h>
33 #include <HYDROData_Zone.h>
34
35 #include <AIS_Shape.hxx>
36 #include <BRep_Builder.hxx>
37 #include <BRepBuilderAPI_MakeFace.hxx>
38 #include <Graphic3d_AspectFillArea3d.hxx>
39 #include <Prs3d_IsoAspect.hxx>
40 #include <Prs3d_ShadingAspect.hxx>
41 #include <TopoDS.hxx>
42 #include <TopoDS_Face.hxx>
43 #include <TopoDS_Wire.hxx>
44 #include <TopExp_Explorer.hxx>
45
46 HYDROGUI_Shape::HYDROGUI_Shape( const Handle(AIS_InteractiveContext)& theContext,
47                                 const Handle(HYDROData_Entity)&       theObject,
48                                 const int                             theZLayer )
49 : myContext( theContext ),
50   myObject( theObject ),
51   myZLayer( theZLayer ),
52   myIsHighlight( false ),
53   myFillingColor( Qt::transparent ),
54   myBorderColor( Qt::black ),
55   myHighlightColor( Qt::white ),
56   myIsToUpdate( false ),
57   myIsVisible( true ),
58   myDisplayMode( AIS_Shaded )
59 {
60 }
61
62 HYDROGUI_Shape::~HYDROGUI_Shape()
63 {
64   erase( false );
65
66   if ( !myShape.IsNull() )
67     myShape.Nullify();
68 }
69
70 Handle(AIS_InteractiveContext) HYDROGUI_Shape::getContext() const
71 {
72   return myContext;
73 }
74
75 Handle(HYDROData_Entity) HYDROGUI_Shape::getObject() const
76 {
77   return myObject;
78 }
79
80 TopoDS_Shape HYDROGUI_Shape::getTopoShape() const
81 {
82   return myTopoShape;
83 }
84
85 bool HYDROGUI_Shape::getIsToUpdate() const
86 {
87   return myIsToUpdate;
88 }
89
90 void HYDROGUI_Shape::setIsToUpdate( bool theState )
91 {
92   myIsToUpdate = theState;
93 }
94
95 bool HYDROGUI_Shape::isVisible() const
96 {
97   return myIsVisible;
98 }
99
100 Handle(AIS_InteractiveObject) HYDROGUI_Shape::getAISObject() const
101 {
102   return myShape;
103 }
104
105 void HYDROGUI_Shape::display( const bool theIsUpdateViewer )
106 {
107   if ( myContext.IsNull() || myShape.IsNull() || !isVisible() )
108     return;
109
110   displayShape( theIsUpdateViewer );
111 }
112
113 void HYDROGUI_Shape::erase( const bool theIsUpdateViewer )
114 {
115   if ( myContext.IsNull() || myShape.IsNull() )
116     return;
117
118   myContext->Erase( myShape, theIsUpdateViewer );
119 }
120
121 void HYDROGUI_Shape::update( bool isUpdateViewer,
122                              bool isDeactivateSelection )
123
124 {
125   setIsToUpdate( false );
126
127   if ( myContext.IsNull() )
128     return;
129
130   // Try to retrieve information from object
131   if ( !myObject.IsNull() )
132   {
133     Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myObject->Label() );
134   
135     if ( myObject->IsKind( STANDARD_TYPE(HYDROData_ImmersibleZone) ) )
136     {
137       Handle(HYDROData_ImmersibleZone) aZoneObj =
138         Handle(HYDROData_ImmersibleZone)::DownCast( myObject );
139
140       TopoDS_Shape aZoneShape = aZoneObj->GetTopShape();
141       if ( !aZoneShape.IsNull() ) {
142         if ( aZoneShape.ShapeType() == TopAbs_FACE ) {
143           TopoDS_Face aZoneFace = TopoDS::Face( aZoneShape );
144           setFace( aZoneFace, false, false, "" );
145         } else {
146           myTopoShape = aZoneShape;
147           //TODO: myDisplayMode = myTextureFileName.isEmpty() ? AIS_Shaded : AIS_Shaded+2;
148           myDisplayMode = AIS_Shaded;
149
150           buildShape();
151           updateShape( false, false );
152         }
153       }
154
155       QColor aFillingColor = aZoneObj->GetFillingColor();
156       QColor aBorderColor = aZoneObj->GetBorderColor();
157
158       setFillingColor( aFillingColor, false, false );
159       setBorderColor( aBorderColor, false, false );
160     }
161     else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_PolylineXY) ) )
162     {
163       Handle(HYDROData_PolylineXY) aPolyline =
164         Handle(HYDROData_PolylineXY)::DownCast( myObject );
165
166       TopoDS_Shape aPolylineShape = aPolyline->GetShape();
167
168       if ( !aPolylineShape.IsNull() ) {
169         if ( aPolylineShape.ShapeType() == TopAbs_WIRE ) {
170           TopoDS_Wire aPolylineWire = TopoDS::Wire( aPolylineShape );
171           setWire( aPolylineWire, false, false );  
172         } else {
173           myTopoShape = aPolylineShape;
174           // Set shading mode to avoid that hilight presentation is equal to "normal" object presentation.
175           // Note that hilight presentation is always to be on top ( i.e. in the top Z layer ).
176           myDisplayMode = AIS_Shaded;
177
178           buildShape();
179           updateShape( false, false );
180         }
181       }
182
183       QColor aWireColor = aPolyline->GetWireColor();
184       setBorderColor( aWireColor, false, false );
185     }
186     else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_Polyline3D) ) )
187     {
188       Handle(HYDROData_Polyline3D) aPolyline =
189         Handle(HYDROData_Polyline3D)::DownCast( myObject );
190
191       TopoDS_Shape aPolylineShape = aPolyline->GetShape3D();
192
193       if ( !aPolylineShape.IsNull() ) {
194         if ( aPolylineShape.ShapeType() == TopAbs_WIRE ) {
195           TopoDS_Wire aPolylineWire = TopoDS::Wire( aPolylineShape );
196           setWire( aPolylineWire, false, false );  
197         } else {
198           myTopoShape = aPolylineShape;
199           // Set shading mode to avoid that hilight presentation is equal to "normal" object presentation.
200           // Note that hilight presentation is always to be on top ( i.e. in the top Z layer ).
201           myDisplayMode = AIS_Shaded;
202
203           buildShape();
204           updateShape( false, false );
205         }
206       }
207
208       QColor aWireColor = aPolyline->GetBorderColor();
209       setBorderColor( aWireColor, false, false );
210     }
211     else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_Zone) ) )
212     {
213       Handle(HYDROData_Zone) aZone =
214         Handle(HYDROData_Zone)::DownCast( myObject );
215
216       TopoDS_Face aZoneFace = TopoDS::Face( aZone->GetShape() );
217
218       setFace( aZoneFace, false, false, "" );
219       if (aZone->IsMergingNeed() && aZone->GetMergeType() == HYDROData_Zone::Merge_UNKNOWN )
220       {
221         // Red color for a zone with bathymetry conflict
222         setFillingColor( Qt::red );
223       }
224       else
225       {
226                     // Set the filling color for zone
227         setFillingColor( aZone->GetColor( Qt::darkBlue ) );
228       }
229     }
230     else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_Profile) ) )
231     {
232       Handle(HYDROData_Profile) aProfile =
233         Handle(HYDROData_Profile)::DownCast( myObject );
234
235       TopoDS_Wire aProfileWire;
236
237       if ( aProfile->IsValid() ) {
238         TopoDS_Shape aProfileShape = aProfile->GetShape3D();
239
240         if ( !aProfileShape.IsNull() && 
241              aProfileShape.ShapeType() == TopAbs_WIRE ) {
242           aProfileWire = TopoDS::Wire( aProfileShape );
243         }
244       }
245
246       setWire( aProfileWire, false, false );  
247
248       QColor aWireColor = aProfile->GetBorderColor();
249       setBorderColor( aWireColor, false, false );
250     }
251     else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_Stream) ) ||
252               myObject->IsKind( STANDARD_TYPE(HYDROData_Channel) ) ||
253               myObject->IsKind( STANDARD_TYPE(HYDROData_Obstacle) ) )
254     {
255       Handle(HYDROData_Object) aGeomObject =
256         Handle(HYDROData_Object)::DownCast( myObject );
257
258       TopoDS_Shape anObjShape = aGeomObject->GetTopShape();
259
260       setShape( anObjShape, false, false );
261
262       QColor aFillingColor = aGeomObject->GetFillingColor();
263       QColor aBorderColor = aGeomObject->GetBorderColor();
264
265       setFillingColor( aFillingColor, false, false );
266       setBorderColor( aBorderColor, false, false );
267     }
268     else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_DummyObject3D) ) )
269     {
270       Handle(HYDROData_DummyObject3D) anObject3D =
271         Handle(HYDROData_DummyObject3D)::DownCast( myObject );
272       TopoDS_Shape aShape3D = anObject3D->GetShape();
273
274       setShape( aShape3D, false, false );
275
276       QColor aFillingColor = anObject3D->GetFillingColor();
277       QColor aBorderColor = anObject3D->GetBorderColor();
278
279       setFillingColor( aFillingColor, false, false );
280       setBorderColor( aBorderColor, false, false );
281     }
282     else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_ShapesGroup) ) )
283     {
284       Handle(HYDROData_ShapesGroup) aShapesGroup =
285         Handle(HYDROData_ShapesGroup)::DownCast( myObject );
286
287       TopTools_SequenceOfShape aShapes;
288       aShapesGroup->GetShapes( aShapes );
289
290       TopoDS_Compound aCompound;
291       BRep_Builder aCompoundBuilder;
292       aCompoundBuilder.MakeCompound( aCompound );
293
294       for ( int i = 1, n = aShapes.Length(); i <= n; ++i )
295       {
296         const TopoDS_Shape& aShape = aShapes.Value( i );
297         aCompoundBuilder.Add( aCompound, aShape );
298       }
299
300       setShape( aCompound, false, false );  
301     }
302   }
303  
304   if ( myShape.IsNull() || !isVisible() )
305     return;
306
307   displayShape( isUpdateViewer );
308
309   if (isDeactivateSelection)
310     myContext->Deactivate(myShape);
311 }
312
313 void HYDROGUI_Shape::setVisible( const bool theState,
314                                  const bool theIsUpdateViewer )
315 {
316   myIsVisible = theState;
317
318   if ( myShape.IsNull() )
319     return;
320
321   if ( ( myIsVisible && myContext->IsDisplayed( myShape ) ) ||
322        ( !myIsVisible && !myContext->IsDisplayed( myShape ) ) )
323     return;
324
325   if ( myIsVisible ) {
326     displayShape( theIsUpdateViewer );
327   }
328   else
329     myContext->Erase( myShape, theIsUpdateViewer );
330 }
331
332 void HYDROGUI_Shape::highlight( bool theIsHighlight, bool isUpdateViewer )
333 {
334   if ( myIsHighlight == theIsHighlight )
335     return;
336
337   myIsHighlight = theIsHighlight;
338
339   if ( myContext.IsNull() || myShape.IsNull() )
340     return;
341
342   colorShapeBorder( getActiveColor() );
343   displayShape( isUpdateViewer );
344 }
345
346 bool HYDROGUI_Shape::isHighlighted() const
347 {
348   return myIsHighlight;
349 }
350
351 void HYDROGUI_Shape::setWire( const TopoDS_Wire& theWire,
352                               const bool         theToDisplay,
353                               const bool         theIsUpdateViewer )
354 {
355   myTopoShape = theWire;
356   // To avoid that hilight presentation is equal to "normal" object presentation.
357   // Note that hilight presentation is always to be on top ( i.e. in the top Z layer ).
358   myDisplayMode = AIS_Shaded;
359
360   buildShape();
361   updateShape( theToDisplay, theIsUpdateViewer );
362 }
363
364 void HYDROGUI_Shape::setFaces( const TopoDS_Compound& theWires,
365                                const bool             theToDisplay,
366                                const bool             theIsUpdateViewer )
367 {
368   TopExp_Explorer anExp( theWires, TopAbs_WIRE );
369   TopoDS_Compound aCompound;
370   BRep_Builder aBuilder;
371     aBuilder.MakeCompound( aCompound );
372
373   for ( ; anExp.More(); anExp.Next() ) {
374     TopoDS_Wire aWire = TopoDS::Wire( anExp.Current() );
375     if ( aWire.IsNull() ) {
376       continue;
377     }
378
379     BRepBuilderAPI_MakeFace aMakeFace( aWire, Standard_True );
380     aMakeFace.Build();
381     if( aMakeFace.IsDone() ) {
382       aBuilder.Add( aCompound, aMakeFace.Face() );
383     }
384   }
385
386   myTopoShape = aCompound;
387   myDisplayMode = AIS_Shaded;
388
389   buildShape();
390   updateShape( theToDisplay, theIsUpdateViewer );
391 }
392
393 void HYDROGUI_Shape::setFace( const TopoDS_Wire& theWire,
394                               const bool         theToDisplay,
395                               const bool         theIsUpdateViewer,
396                               const QString&     theTextureFileName )
397 {
398   BRepBuilderAPI_MakeFace aFaceBuilder( theWire, Standard_True );
399   aFaceBuilder.Build();
400   if( aFaceBuilder.IsDone() )
401   {
402     TopoDS_Face aFace = aFaceBuilder.Face();
403     setFace( aFace, theToDisplay, theIsUpdateViewer, theTextureFileName );
404   }
405 }
406
407 void HYDROGUI_Shape::setFace( const TopoDS_Face& theFace,
408                               const bool         theToDisplay,
409                               const bool         theIsUpdateViewer,
410                               const QString&     theTextureFileName )
411 {
412   myTopoShape = theFace;
413   myDisplayMode = theTextureFileName.isEmpty() ? AIS_Shaded : AIS_Shaded+2;
414   //Note: AIS_Shaded+2 is the same as AIS_ExactHLR
415   //TODO: it would be more suitable to use TexturedShape mode from GEOM_AISShape
416
417   buildShape();
418   updateShape( theToDisplay, theIsUpdateViewer );
419 }
420
421 void HYDROGUI_Shape::setShape( const TopoDS_Shape& theShape,
422                                const bool          theToDisplay,
423                                const bool          theIsUpdateViewer )
424 {
425   myTopoShape = theShape;
426   myDisplayMode = AIS_Shaded;
427
428   buildShape();
429   updateShape( theToDisplay, theIsUpdateViewer );
430 }
431
432 void HYDROGUI_Shape::setFillingColor( const QColor& theColor,
433                                       const bool    theToDisplay,
434                                       const bool    theIsUpdateViewer )
435 {
436   myFillingColor = theColor;
437   updateShape( theToDisplay, theIsUpdateViewer );
438 }
439
440 QColor HYDROGUI_Shape::getFillingColor() const
441 {
442   return myFillingColor;
443 }
444
445 void HYDROGUI_Shape::setBorderColor( const QColor& theColor,
446                                      const bool    theToDisplay,
447                                      const bool    theIsUpdateViewer )
448
449   myBorderColor = theColor;
450   updateShape( theToDisplay, theIsUpdateViewer );
451 }
452
453 QColor HYDROGUI_Shape::getBorderColor() const
454 {
455   return myBorderColor;
456 }
457
458 void HYDROGUI_Shape::setHighlightColor( const QColor& theColor )
459 {
460   myHighlightColor = theColor;
461 }
462
463 QColor HYDROGUI_Shape::getHighlightColor() const
464 {
465   return myHighlightColor;
466 }
467
468 void HYDROGUI_Shape::setZLayer( const int theZLayer )
469 {
470   if ( myZLayer == theZLayer )
471     return;
472
473   myZLayer = theZLayer;
474   if ( !myShape.IsNull() && isVisible() && !myContext.IsNull() && myZLayer >= 0 )
475     myContext->SetZLayer( myShape, myZLayer );
476 }
477
478 Handle_AIS_InteractiveObject HYDROGUI_Shape::createShape() const
479 {
480   if( myTopoShape.IsNull() ) {
481     return Handle_AIS_InteractiveObject();
482   }
483
484   TopAbs_ShapeEnum aShapeType = myTopoShape.ShapeType();
485   bool IsWireEdgeCompound = aShapeType==TopAbs_COMPOUND;
486   if (IsWireEdgeCompound) {
487     TopoDS_Iterator itr(myTopoShape);
488     while (itr.More() && IsWireEdgeCompound) {
489       if (itr.Value().ShapeType() != TopAbs_WIRE && itr.Value().ShapeType() != TopAbs_EDGE)
490         IsWireEdgeCompound = false;
491       itr.Next();
492     }
493   }
494
495   if ( aShapeType==TopAbs_EDGE || aShapeType==TopAbs_WIRE || IsWireEdgeCompound) {
496     return new HYDROGUI_Polyline( myTopoShape );
497   } else {
498     return new AIS_Shape( myTopoShape );
499   }
500 }
501
502 void HYDROGUI_Shape::buildShape()
503 {
504   // Erase previously created shape
505   erase();
506
507   myShape = createShape();
508   if( myShape.IsNull() )
509     return;
510
511   Handle_AIS_Shape anAISShape = Handle_AIS_Shape::DownCast( myShape );
512   if( !anAISShape.IsNull() )
513     anAISShape ->SetHLRAngleAndDeviation( 0.001 );
514
515   if ( !myObject.IsNull() )
516     myShape->SetOwner( myObject );
517
518   myShape->SetTransparency( 0 );
519   myShape->SetDisplayMode( (AIS_DisplayMode)myDisplayMode );
520
521     // Init default params for shape
522   const Handle(Prs3d_Drawer)& anAttributes = myShape->Attributes();
523   if ( !anAttributes.IsNull() )
524   {
525     Handle(Prs3d_IsoAspect) anIsoAspect = anAttributes->UIsoAspect();
526     if ( !anIsoAspect.IsNull() ) {
527       anIsoAspect->SetNumber( 0 );
528       anAttributes->SetUIsoAspect( anIsoAspect );
529     }
530       
531     anIsoAspect = anAttributes->VIsoAspect();
532     if ( !anIsoAspect.IsNull() ) {
533       anIsoAspect->SetNumber( 0 );
534       anAttributes->SetVIsoAspect( anIsoAspect );
535     }
536
537     if ( myDisplayMode == AIS_Shaded )
538     {
539       Handle(Prs3d_ShadingAspect) aShadingAspect = anAttributes->ShadingAspect();
540       if ( !aShadingAspect.IsNull() )
541       {
542         Graphic3d_MaterialAspect aMatAspect( Graphic3d_NOM_PLASTIC );
543         //aMatAspect.SetAmbient( 1 );
544         //aMatAspect.SetDiffuse( 0 );
545
546         aShadingAspect->Aspect()->SetFrontMaterial( aMatAspect );
547         aShadingAspect->Aspect()->SetBackMaterial( aMatAspect );
548       }
549     }
550     else if ( myDisplayMode == AIS_WireFrame )
551     {
552       anAttributes->SetWireDraw( true );
553     }
554   }
555 }
556
557 void HYDROGUI_Shape::updateShape( const bool theToDisplay,
558                                   const bool theIsUpdateViewer )
559 {
560   if ( myShape.IsNull() )
561     return;
562
563   const Handle(Prs3d_Drawer)& anAttributes = myShape->Attributes();
564   if ( !anAttributes.IsNull() )
565   {
566     if ( myDisplayMode == AIS_Shaded )
567     {
568       // Coloring face filling
569       Handle(Prs3d_ShadingAspect) aShadingAspect = anAttributes->ShadingAspect();
570       if ( !aShadingAspect.IsNull() )
571       {
572         Quantity_Color aFillingColor( getQuantityColorVal( myFillingColor.red() ), 
573                                       getQuantityColorVal( myFillingColor.green() ),
574                                       getQuantityColorVal( myFillingColor.blue() ),
575                                       Quantity_TOC_RGB );
576
577         aShadingAspect->SetColor( aFillingColor );
578         aShadingAspect->SetTransparency( 1 - getQuantityColorVal( myFillingColor.alpha() ) );
579       }
580     }
581     else if ( myDisplayMode == AIS_WireFrame )
582     {
583     }
584
585     // Coloring borders
586     colorShapeBorder( getActiveColor() );
587   }
588
589   if ( !theToDisplay || !isVisible() || myContext.IsNull() )
590     return;
591   
592   displayShape( theIsUpdateViewer );
593 }
594
595 void HYDROGUI_Shape::displayShape( const bool theIsUpdateViewer )
596 {
597   myContext->Display( myShape, Standard_False );
598
599   if ( myZLayer >= 0 )
600     myContext->SetZLayer( myShape, myZLayer );
601
602   if ( theIsUpdateViewer ) {
603     myContext->UpdateCurrentViewer();
604   }
605 }
606
607 QColor HYDROGUI_Shape::getActiveColor() const
608 {
609   return isHighlighted() ? myHighlightColor : myBorderColor;
610 }
611
612 double HYDROGUI_Shape::getQuantityColorVal( const int theColorVal )
613 {
614   return theColorVal == 0 ? 0 : ( (double)theColorVal / 255 );
615 }
616
617 void HYDROGUI_Shape::colorShapeBorder( const QColor& theColor )
618 {
619   if ( myShape.IsNull() )
620     return;
621
622   const Handle(Prs3d_Drawer)& anAttributes = myShape->Attributes();
623   if ( anAttributes.IsNull() )
624     return;
625
626   Quantity_Color aBorderColor( getQuantityColorVal( theColor.red() ), 
627                                getQuantityColorVal( theColor.green() ),
628                                getQuantityColorVal( theColor.blue() ),
629                                Quantity_TOC_RGB );
630   
631   if( !myTopoShape.IsNull() )
632   {
633     if ( myTopoShape.ShapeType() == TopAbs_WIRE ) // Note that we display polylines in shaded mode
634     {
635       myShape->SetColor( aBorderColor );
636     }
637     else if ( myDisplayMode == AIS_Shaded )
638     {
639       if ( theColor.alpha() == 0 )
640       {
641         anAttributes->SetFaceBoundaryDraw( false );
642       }
643       else
644       {
645         anAttributes->SetFaceBoundaryDraw( true );
646   
647         Handle(Prs3d_LineAspect) aBoundaryAspect = anAttributes->FaceBoundaryAspect();
648         if ( !aBoundaryAspect.IsNull() )
649         {
650           aBoundaryAspect->SetColor( aBorderColor );
651           anAttributes->SetFaceBoundaryAspect( aBoundaryAspect );
652         }
653         Handle(Prs3d_LineAspect) aWireAspect = anAttributes->WireAspect();
654         if ( !aWireAspect.IsNull() )
655         {
656           aWireAspect->SetColor( aBorderColor );
657           anAttributes->SetWireAspect( aWireAspect );
658         }
659       }
660     }
661     else if ( myDisplayMode == AIS_WireFrame )
662     {
663       myShape->SetColor( aBorderColor );
664     }
665   }
666 }
667
668 void HYDROGUI_Shape::setDisplayMode( int theDisplayMode )
669 {
670   myDisplayMode = theDisplayMode;
671 }