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.
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.
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
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #include <HYDROGUI_Shape.h>
20 #include <HYDROGUI_Tool.h>
21 #include <HYDROGUI_Polyline.h>
22 #include <HYDROGUI_AISShape.h>
24 #include <HYDROData_Channel.h>
25 #include <HYDROData_Document.h>
26 #include <HYDROData_DummyObject3D.h>
27 #include <HYDROData_ImmersibleZone.h>
28 #include <HYDROData_BCPolygon.h>
29 #include <HYDROData_Obstacle.h>
30 #include <HYDROData_PolylineXY.h>
31 #include <HYDROData_Polyline3D.h>
32 #include <HYDROData_Profile.h>
33 #include <HYDROData_ShapesGroup.h>
34 #include <HYDROData_Stream.h>
35 #include <HYDROData_Zone.h>
36 #include <HYDROData_LandCoverMap.h>
38 #include <BRep_Builder.hxx>
39 #include <BRepBuilderAPI_MakeFace.hxx>
40 #include <Prs3d_IsoAspect.hxx>
42 #include <TopoDS_Face.hxx>
43 #include <TopoDS_Wire.hxx>
44 #include <TopExp_Explorer.hxx>
47 #include <SUIT_ResourceMgr.h>
48 #include <SUIT_Session.h>
51 #include "HYDRO_trace.hxx"
53 HYDROGUI_Shape::HYDROGUI_Shape( const Handle(AIS_InteractiveContext)& theContext,
54 const Handle(HYDROData_Entity)& theObject,
56 : myContext( theContext ),
57 myObject( theObject ),
58 myZLayer( theZLayer ),
59 myIsHighlight( false ),
60 myFillingColor( Qt::transparent ),
61 myBorderColor( Qt::black ),
62 myHighlightColor( Qt::white ),
63 myIsToUpdate( false ),
65 myDisplayMode( AIS_Shaded ),
66 mySelectionMode( AIS_Shape::SelectionMode( TopAbs_SHAPE ) )
70 HYDROGUI_Shape::~HYDROGUI_Shape()
75 Handle(AIS_InteractiveContext) HYDROGUI_Shape::getContext() const
80 Handle(HYDROData_Entity) HYDROGUI_Shape::getObject() const
85 TopoDS_Shape HYDROGUI_Shape::getTopoShape() const
90 bool HYDROGUI_Shape::getIsToUpdate() const
95 void HYDROGUI_Shape::setIsToUpdate( bool theState )
97 myIsToUpdate = theState;
100 bool HYDROGUI_Shape::isVisible() const
105 QList<Handle(AIS_InteractiveObject)> HYDROGUI_Shape::getAISObjects() const
110 void HYDROGUI_Shape::display( const bool theIsUpdateViewer )
112 if ( myContext.IsNull() || myShapes.empty() || !isVisible() )
115 displayShape( theIsUpdateViewer );
118 void HYDROGUI_Shape::erase( const bool theIsUpdateViewer )
120 if ( myContext.IsNull() || myShapes.empty() )
123 eraseShape( theIsUpdateViewer );
126 void HYDROGUI_Shape::update( bool isUpdateViewer,
127 bool isDeactivateSelection )
130 DEBTRACE("update " << isUpdateViewer << " " << isDeactivateSelection);
131 setIsToUpdate( false );
133 if ( myContext.IsNull() )
136 // Try to retrieve information from object
137 if ( !myObject.IsNull() )
139 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document();
141 if ( myObject->IsKind( STANDARD_TYPE(HYDROData_ImmersibleZone) ) )
143 Handle(HYDROData_ImmersibleZone) aZoneObj =
144 Handle(HYDROData_ImmersibleZone)::DownCast( myObject );
146 TopoDS_Shape aZoneShape = aZoneObj->GetTopShape();
147 if ( !aZoneShape.IsNull() ) {
148 if ( aZoneShape.ShapeType() == TopAbs_FACE ) {
149 TopoDS_Face aZoneFace = TopoDS::Face( aZoneShape );
150 setFace( aZoneFace, false, false, "" );
152 myTopoShape = aZoneShape;
153 //TODO: myDisplayMode = myTextureFileName.isEmpty() ? AIS_Shaded : AIS_Shaded+2;
154 myDisplayMode = AIS_Shaded;
157 updateShape( false, false );
161 QColor aFillingColor = aZoneObj->GetFillingColor();
162 QColor aBorderColor = aZoneObj->GetBorderColor();
164 setFillingColor( aFillingColor, false, false );
165 setBorderColor( aBorderColor, false, false );
167 else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_PolylineXY) ) )
169 Handle(HYDROData_PolylineXY) aPolyline =
170 Handle(HYDROData_PolylineXY)::DownCast( myObject );
172 TopoDS_Shape aPolylineShape = aPolyline->GetShape();
174 if ( !aPolylineShape.IsNull() )
176 if ( aPolylineShape.ShapeType() == TopAbs_WIRE )
178 TopoDS_Wire aPolylineWire = TopoDS::Wire( aPolylineShape );
179 setWire( aPolylineWire, false, false );
183 myTopoShape = aPolylineShape;
184 // Set shading mode to avoid that hilight presentation is equal to "normal" object presentation.
185 // Note that hilight presentation is always to be on top ( i.e. in the top Z layer ).
186 myDisplayMode = AIS_Shaded;
189 updateShape( false, false );
193 //QColor aWireColor = aPolyline->GetWireColor();
194 std::vector<QColor> aSectColors;
195 //TODO backward comp. with old aWireColor??
196 int nbSec = aPolyline->NbSections();
197 for (int i = 0; i < nbSec; i++)
200 aPolyline->GetSectionColor(i, aColor);
201 aSectColors.push_back(aColor);
205 //setBorderColor( aWireColor, false, false );
207 foreach( Handle(AIS_InteractiveObject) aShape, myShapes )
209 if( !myTopoShape.IsNull() )
211 Handle(HYDROGUI_Polyline) aPShape = Handle(HYDROGUI_Polyline)::DownCast( aShape );
212 bool WireOrCmp = myTopoShape.ShapeType() == TopAbs_WIRE || myTopoShape.ShapeType() == TopAbs_COMPOUND;
213 if ( !aPShape.IsNull() && WireOrCmp)
215 TopTools_IndexedMapOfShape MW;
216 TopExp::MapShapes(myTopoShape, TopAbs_WIRE, MW);
217 if (MW.Extent() == nbSec)
219 for (int i=0;i<nbSec;i++)
221 const TopoDS_Shape& CW = MW(i+1);
222 Quantity_Color aFColor( getQuantityColorVal( aSectColors[i].red() ),
223 getQuantityColorVal( aSectColors[i].green() ),
224 getQuantityColorVal( aSectColors[i].blue() ),
226 aPShape->myShapeToColor.Add(CW, aFColor);
234 else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_Polyline3D) ) )
236 Handle(HYDROData_Polyline3D) aPolyline =
237 Handle(HYDROData_Polyline3D)::DownCast( myObject );
239 TopoDS_Shape aPolylineShape = aPolyline->GetShape3D();
241 if ( !aPolylineShape.IsNull() ) {
242 if ( aPolylineShape.ShapeType() == TopAbs_WIRE ) {
243 TopoDS_Wire aPolylineWire = TopoDS::Wire( aPolylineShape );
244 setWire( aPolylineWire, false, false );
246 myTopoShape = aPolylineShape;
247 // Set shading mode to avoid that hilight presentation is equal to "normal" object presentation.
248 // Note that hilight presentation is always to be on top ( i.e. in the top Z layer ).
249 myDisplayMode = AIS_Shaded;
252 updateShape( false, false );
256 QColor aWireColor = aPolyline->GetBorderColor();
257 setBorderColor( aWireColor, false, false );
259 else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_Zone) ) )
261 Handle(HYDROData_Zone) aZone =
262 Handle(HYDROData_Zone)::DownCast( myObject );
264 TopoDS_Face aZoneFace = TopoDS::Face( aZone->GetShape() );
266 setFace( aZoneFace, false, false, "" );
267 if( aZone->IsMergingNeed() && aZone->GetMergeType() == HYDROData_Zone::Merge_UNKNOWN )
269 // Red color for a zone with bathymetry conflict
270 setFillingColor( Qt::red );
274 // Set the filling color for zone
275 setFillingColor( aZone->GetColor( Qt::darkBlue ) );
278 else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_Profile) ) )
280 Handle(HYDROData_Profile) aProfile =
281 Handle(HYDROData_Profile)::DownCast( myObject );
283 TopoDS_Wire aProfileWire;
285 if ( aProfile->IsValid() ) {
286 TopoDS_Shape aProfileShape = aProfile->GetShape3D();
288 if ( !aProfileShape.IsNull() &&
289 aProfileShape.ShapeType() == TopAbs_WIRE ) {
290 aProfileWire = TopoDS::Wire( aProfileShape );
294 setWire( aProfileWire, false, false );
296 QColor aWireColor = aProfile->GetBorderColor();
297 setBorderColor( aWireColor, false, false );
299 else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_Stream) ) ||
300 myObject->IsKind( STANDARD_TYPE(HYDROData_Channel) ) ||
301 myObject->IsKind( STANDARD_TYPE(HYDROData_Obstacle) ) )
303 Handle(HYDROData_Object) aGeomObject =
304 Handle(HYDROData_Object)::DownCast( myObject );
306 TopoDS_Shape anObjShape = aGeomObject->GetTopShape();
308 setShape( anObjShape, false, false );
310 QColor aFillingColor = aGeomObject->GetFillingColor();
311 QColor aBorderColor = aGeomObject->GetBorderColor();
313 setFillingColor( aFillingColor, false, false );
314 setBorderColor( aBorderColor, false, false );
316 else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_DummyObject3D) ) )
318 Handle(HYDROData_DummyObject3D) anObject3D =
319 Handle(HYDROData_DummyObject3D)::DownCast( myObject );
320 TopoDS_Shape aShape3D = anObject3D->GetShape();
322 setShape( aShape3D, false, false );
324 QColor aFillingColor = anObject3D->GetFillingColor();
325 QColor aBorderColor = anObject3D->GetBorderColor();
327 setFillingColor( aFillingColor, false, false );
328 setBorderColor( aBorderColor, false, false );
330 else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_ShapesGroup) ) )
332 Handle(HYDROData_ShapesGroup) aShapesGroup =
333 Handle(HYDROData_ShapesGroup)::DownCast( myObject );
335 TopTools_SequenceOfShape aShapes;
336 aShapesGroup->GetShapes( aShapes );
338 TopoDS_Compound aCompound;
339 BRep_Builder aCompoundBuilder;
340 aCompoundBuilder.MakeCompound( aCompound );
342 for ( int i = 1, n = aShapes.Length(); i <= n; ++i )
344 const TopoDS_Shape& aShape = aShapes.Value( i );
345 aCompoundBuilder.Add( aCompound, aShape );
348 setShape( aCompound, false, false );
350 else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_BCPolygon) ) )
352 Handle(HYDROData_BCPolygon) aBCObj = Handle(HYDROData_BCPolygon)::DownCast( myObject );
354 TopoDS_Shape aBCShape = aBCObj->GetTopShape();
355 if ( !aBCShape.IsNull() )
357 if ( aBCShape.ShapeType() == TopAbs_FACE )
359 TopoDS_Face aBCFace = TopoDS::Face( aBCShape );
360 setFace( aBCFace, false, false, "" );
364 myTopoShape = aBCShape;
365 myDisplayMode = AIS_Shaded;
367 updateShape( false, false );
371 QColor aFillingColor = aBCObj->GetFillingColor();
372 QColor aBorderColor = aBCObj->GetBorderColor();
373 aFillingColor.setAlpha(175);
375 setFillingColor( aFillingColor, false, false );
376 setBorderColor( aBorderColor, false, false );
381 if ( myShapes.empty() || !isVisible() )
384 displayShape( isUpdateViewer );
386 if (isDeactivateSelection)
387 foreach( Handle(AIS_InteractiveObject) aShape, myShapes )
388 myContext->Deactivate( aShape );
391 void HYDROGUI_Shape::setVisible( const bool theState,
392 const bool theIsUpdateViewer )
394 DEBTRACE("setVisible")
395 myIsVisible = theState;
397 if ( myShapes.empty() )
400 if ( ( myIsVisible && myContext->IsDisplayed( myShapes[0] ) ) ||
401 ( !myIsVisible && !myContext->IsDisplayed( myShapes[0] ) ) )
405 displayShape( theIsUpdateViewer );
408 eraseShape( theIsUpdateViewer );
411 void HYDROGUI_Shape::highlight( bool theIsHighlight, bool isUpdateViewer )
413 DEBTRACE("highlight " << theIsHighlight << " " << isUpdateViewer);
414 if ( myIsHighlight == theIsHighlight )
417 myIsHighlight = theIsHighlight;
419 if ( myContext.IsNull() || myShapes.empty() )
422 colorShapeBorder( getActiveColor() );
423 displayShape( isUpdateViewer );
426 bool HYDROGUI_Shape::isHighlighted() const
428 DEBTRACE("isHighlighted " << myIsHighlight);
429 return myIsHighlight;
432 void HYDROGUI_Shape::setWire( const TopoDS_Wire& theWire,
433 const bool theToDisplay,
434 const bool theIsUpdateViewer )
436 myTopoShape = theWire;
437 // To avoid that hilight presentation is equal to "normal" object presentation.
438 // Note that hilight presentation is always to be on top ( i.e. in the top Z layer ).
439 myDisplayMode = AIS_Shaded;
442 updateShape( theToDisplay, theIsUpdateViewer );
445 void HYDROGUI_Shape::setFaces( const TopoDS_Compound& theWires,
446 const bool theToDisplay,
447 const bool theIsUpdateViewer )
449 TopExp_Explorer anExp( theWires, TopAbs_WIRE );
450 TopoDS_Compound aCompound;
451 BRep_Builder aBuilder;
452 aBuilder.MakeCompound( aCompound );
454 for ( ; anExp.More(); anExp.Next() ) {
455 TopoDS_Wire aWire = TopoDS::Wire( anExp.Current() );
456 if ( aWire.IsNull() ) {
460 BRepBuilderAPI_MakeFace aMakeFace( aWire, Standard_True );
462 if( aMakeFace.IsDone() ) {
463 aBuilder.Add( aCompound, aMakeFace.Face() );
467 myTopoShape = aCompound;
468 myDisplayMode = AIS_Shaded;
471 updateShape( theToDisplay, theIsUpdateViewer );
474 void HYDROGUI_Shape::setFace( const TopoDS_Wire& theWire,
475 const bool theToDisplay,
476 const bool theIsUpdateViewer,
477 const QString& theTextureFileName )
479 BRepBuilderAPI_MakeFace aFaceBuilder( theWire, Standard_True );
480 aFaceBuilder.Build();
481 if( aFaceBuilder.IsDone() )
483 TopoDS_Face aFace = aFaceBuilder.Face();
484 setFace( aFace, theToDisplay, theIsUpdateViewer, theTextureFileName );
488 void HYDROGUI_Shape::setFace( const TopoDS_Face& theFace,
489 const bool theToDisplay,
490 const bool theIsUpdateViewer,
491 const QString& theTextureFileName )
493 myTopoShape = theFace;
494 myDisplayMode = theTextureFileName.isEmpty() ? AIS_Shaded : AIS_Shaded+2;
495 //Note: AIS_Shaded+2 is the same as AIS_ExactHLR
496 //TODO: it would be more suitable to use TexturedShape mode from GEOM_AISShape
499 updateShape( theToDisplay, theIsUpdateViewer );
502 void HYDROGUI_Shape::setShape( const TopoDS_Shape& theShape,
503 const bool theToDisplay,
504 const bool theIsUpdateViewer,
505 const int theDisplayMode )
507 myTopoShape = theShape;
508 myDisplayMode = theDisplayMode;
511 updateShape( theToDisplay, theIsUpdateViewer );
514 void HYDROGUI_Shape::setFillingColor( const QColor& theColor,
515 const bool theToDisplay,
516 const bool theIsUpdateViewer )
518 myFillingColor = theColor;
519 updateShape( theToDisplay, theIsUpdateViewer );
522 QColor HYDROGUI_Shape::getFillingColor() const
524 return myFillingColor;
527 void HYDROGUI_Shape::setBorderColor( const QColor& theColor,
528 const bool theToDisplay,
529 const bool theIsUpdateViewer )
531 myBorderColor = theColor;
532 updateShape( theToDisplay, theIsUpdateViewer );
535 QColor HYDROGUI_Shape::getBorderColor() const
537 return myBorderColor;
540 void HYDROGUI_Shape::setHighlightColor( const QColor& theColor )
542 myHighlightColor = theColor;
545 QColor HYDROGUI_Shape::getHighlightColor() const
547 return myHighlightColor;
550 void HYDROGUI_Shape::setZLayer( const int theZLayer )
552 if ( myZLayer == theZLayer )
555 myZLayer = theZLayer;
556 if( isVisible() && !myContext.IsNull() && myZLayer >= 0 )
557 foreach( Handle(AIS_InteractiveObject) aShape, myShapes )
558 myContext->SetZLayer( aShape, myZLayer );
561 QList<Handle(AIS_InteractiveObject)> HYDROGUI_Shape::createShape() const
563 QList<Handle(AIS_InteractiveObject)> shapes;
564 if( myTopoShape.IsNull() ) {
568 TopAbs_ShapeEnum aShapeType = myTopoShape.ShapeType();
569 bool IsWireEdgeCompound = aShapeType==TopAbs_COMPOUND;
570 if (IsWireEdgeCompound) {
571 TopoDS_Iterator itr(myTopoShape);
572 while (itr.More() && IsWireEdgeCompound) {
573 if (itr.Value().ShapeType() != TopAbs_WIRE && itr.Value().ShapeType() != TopAbs_EDGE)
574 IsWireEdgeCompound = false;
579 if ( aShapeType==TopAbs_EDGE || aShapeType==TopAbs_WIRE || IsWireEdgeCompound)
581 SUIT_ResourceMgr* aResMgr = 0;
582 SUIT_Session* aSession = SUIT_Session::session();
584 aResMgr = SUIT_Session::session()->resourceMgr();
589 if( myShapes.length()>1 )
591 Handle(HYDROGUI_Arrow) arrow = Handle(HYDROGUI_Arrow)::DownCast( myShapes[1] );
592 if( !arrow.IsNull() )
594 aType = arrow->GetType();
595 aSize = arrow->GetSize();
598 if( aResMgr && ( aType<0 || aSize < 0 ) )
600 aResMgr->value( "polyline", "arrow_type", aType );
601 aResMgr->value( "polyline", "arrow_size", aSize );
604 shapes.append( HYDROGUI_Polyline::createPresentations( myTopoShape, aType, aSize ) );
608 shapes.append( new HYDROGUI_AISShape( myTopoShape ) );
613 void HYDROGUI_Shape::buildShape()
615 // Erase previously created shape
618 myShapes = createShape();
619 if( myShapes.empty() )
622 foreach( Handle(AIS_InteractiveObject) aShape, myShapes )
624 Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast( aShape );
625 if( !anAISShape.IsNull() )
626 anAISShape ->SetHLRAngleAndDeviation( 0.001 );
628 if ( !myObject.IsNull() )
629 aShape->SetOwner( myObject );
631 if ( !myObject.IsNull() && !myObject->IsKind( STANDARD_TYPE(HYDROData_LandCoverMap) ) )
632 aShape->SetTransparency( 0 );
633 aShape->SetDisplayMode( (AIS_DisplayMode)myDisplayMode );
635 // Init default params for shape
636 const Handle(Prs3d_Drawer)& anAttributes = aShape->Attributes();
637 if ( !anAttributes.IsNull() )
639 Handle(Prs3d_IsoAspect) anIsoAspect = anAttributes->UIsoAspect();
640 if ( !anIsoAspect.IsNull() ) {
641 anIsoAspect->SetNumber( 0 );
642 anAttributes->SetUIsoAspect( anIsoAspect );
645 anIsoAspect = anAttributes->VIsoAspect();
646 if ( !anIsoAspect.IsNull() )
648 anIsoAspect->SetNumber( 0 );
649 anAttributes->SetVIsoAspect( anIsoAspect );
652 if ( myDisplayMode == AIS_Shaded )
654 aShape->SetMaterial( Graphic3d_NOM_PLASTIC );
656 else if ( myDisplayMode == AIS_WireFrame )
658 anAttributes->SetWireDraw( true );
664 void HYDROGUI_Shape::updateShape( const bool theToDisplay,
665 const bool theIsUpdateViewer )
667 DEBTRACE("updateShape " << theToDisplay << " " << theIsUpdateViewer);
668 foreach( Handle(AIS_InteractiveObject) aShape, myShapes )
670 const Handle(Prs3d_Drawer)& anAttributes = aShape->Attributes();
671 if ( !anAttributes.IsNull() )
673 if ( myDisplayMode == AIS_Shaded && myFillingColor.isValid() )
675 Quantity_Color aFillingColor( getQuantityColorVal( myFillingColor.red() ),
676 getQuantityColorVal( myFillingColor.green() ),
677 getQuantityColorVal( myFillingColor.blue() ),
680 aShape->SetColor( aFillingColor );
681 aShape->SetTransparency( 1 - getQuantityColorVal( myFillingColor.alpha() ) );
683 else if ( myDisplayMode == AIS_WireFrame )
691 colorShapeBorder( myBorderColor );
692 if ( !theToDisplay || !isVisible() || myContext.IsNull() )
695 displayShape( theIsUpdateViewer );
698 void HYDROGUI_Shape::displayShape( const bool theIsUpdateViewer )
700 DEBTRACE("displayShape " << theIsUpdateViewer << " " << mySelectionMode << " AIScontext " << myContext.get());
702 foreach( Handle(AIS_InteractiveObject) aShape, myShapes )
704 if ( mySelectionMode >= 0 )
705 // Display object with selection
706 myContext->Display( aShape, Standard_False );
709 // Display object without selection
710 myContext->Display( aShape, myDisplayMode, -1, Standard_False, Standard_False );
714 if ( mySelectionMode >= 0 )
716 foreach( Handle(AIS_InteractiveObject) aShape, myShapes )
717 myContext->Activate( aShape, mySelectionMode, Standard_True );
722 foreach( Handle(AIS_InteractiveObject) aShape, myShapes )
723 myContext->SetZLayer( aShape, myZLayer );
726 if ( theIsUpdateViewer ) {
727 myContext->UpdateCurrentViewer();
731 void HYDROGUI_Shape::eraseShape( const bool theIsUpdateViewer )
733 foreach( Handle(AIS_InteractiveObject) aShape, myShapes )
734 myContext->Erase( aShape, Standard_False );
736 if( theIsUpdateViewer )
737 myContext->UpdateCurrentViewer();
740 QColor HYDROGUI_Shape::getActiveColor() const
742 return isHighlighted() ? myHighlightColor : myBorderColor;
745 double HYDROGUI_Shape::getQuantityColorVal( const int theColorVal )
747 return theColorVal == 0 ? 0 : ( (double)theColorVal / 255 );
750 void HYDROGUI_Shape::colorShapeBorder( const QColor& theColor )
752 foreach( Handle(AIS_InteractiveObject) aShape1, myShapes )
754 const Handle(Prs3d_Drawer)& anAttributes = aShape1->Attributes();
755 if ( anAttributes.IsNull() )
758 Quantity_Color aBorderColor( getQuantityColorVal( theColor.red() ),
759 getQuantityColorVal( theColor.green() ),
760 getQuantityColorVal( theColor.blue() ),
763 if( !myTopoShape.IsNull() )
765 if ( myTopoShape.ShapeType() == TopAbs_WIRE ) // Note that we display polylines in shaded mode
767 aShape1->SetColor( aBorderColor );
769 else if ( myDisplayMode == AIS_Shaded )
771 Handle(HYDROGUI_AISShape) aShape = Handle(HYDROGUI_AISShape)::DownCast( aShape1 );
772 if( !aShape.IsNull() )
773 aShape->SetBorderColor( aBorderColor );
775 else if ( myDisplayMode == AIS_WireFrame )
777 aShape1->SetColor( aBorderColor );
783 void HYDROGUI_Shape::setDisplayMode( int theDisplayMode )
785 myDisplayMode = theDisplayMode;
788 void HYDROGUI_Shape::setSelectionMode( int theSelectionMode )
790 mySelectionMode = theSelectionMode;