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