]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Merge remote-tracking branch 'origin/BR_SHAPE_RECOGNITION' into BR_v14_rc
authorasl <asl@opencascade.com>
Mon, 15 Jun 2015 07:56:41 +0000 (10:56 +0300)
committerasl <asl@opencascade.com>
Mon, 15 Jun 2015 07:56:41 +0000 (10:56 +0300)
1  2 
src/HYDROGUI/HYDROGUI_Shape.cxx

index 05e271dd5a1d6446ca1fef78b752539ab246a05d,60962d74b4c78ad4418c94c0adfa31cfce3f8b1c..113d9724d599f522007674579110d2eb17abf1ce
@@@ -476,21 -476,12 +476,22 @@@ void HYDROGUI_Shape::setZLayer( const i
  
  Handle_AIS_InteractiveObject HYDROGUI_Shape::createShape() const
  {
-   if( myTopoShape.IsNull() )
+   if( myTopoShape.IsNull() ) {
      return Handle_AIS_InteractiveObject();
-   
+   }
    TopAbs_ShapeEnum aShapeType = myTopoShape.ShapeType();
 -  if ( aShapeType==TopAbs_EDGE || aShapeType==TopAbs_WIRE ) {
 +  bool IsWireEdgeCompound = aShapeType==TopAbs_COMPOUND;
 +  if (IsWireEdgeCompound) {
 +    TopoDS_Iterator itr(myTopoShape);
 +    while (itr.More() && IsWireEdgeCompound) {
 +      if (itr.Value().ShapeType() != TopAbs_WIRE && itr.Value().ShapeType() != TopAbs_EDGE)
 +        IsWireEdgeCompound = false;
 +      itr.Next();
 +    }
 +  }
 +
 +  if ( aShapeType==TopAbs_EDGE || aShapeType==TopAbs_WIRE || IsWireEdgeCompound) {
      return new HYDROGUI_Polyline( myTopoShape );
    } else {
      return new AIS_Shape( myTopoShape );