From b6826918feeb9e62d0b23fd74c22b0565e9a3d8d Mon Sep 17 00:00:00 2001
From: kgv <kgv@opencascade.com>
Date: Sun, 18 Dec 2016 10:18:55 +0300
Subject: [PATCH] 0028232: Visualization, StdPrs_ShadedShape - create WireFrame
 presentation for sole Vertex / Edge / Wire

---
 src/StdPrs/StdPrs_ShadedShape.cxx | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/StdPrs/StdPrs_ShadedShape.cxx b/src/StdPrs/StdPrs_ShadedShape.cxx
index e76fa32a8e..2895a02388 100644
--- a/src/StdPrs/StdPrs_ShadedShape.cxx
+++ b/src/StdPrs/StdPrs_ShadedShape.cxx
@@ -60,21 +60,19 @@ namespace
                            const TopoDS_Shape&                theShape,
                            const Handle (Prs3d_Drawer)&       theDrawer)
   {
-    Standard_Boolean aDrawAllVerticesFlag = (theDrawer->VertexDrawMode() == Prs3d_VDM_All);
-
-    if (!aDrawAllVerticesFlag && theShape.ShapeType() != TopAbs_COMPOUND)
-    {
-      return;
-    }
-
     TopExp_Explorer aShapeIter (theShape, TopAbs_FACE);
     if (!aShapeIter.More())
     {
-      // compound contains no shaded elements at all
       StdPrs_WFShape::Add (thePrs, theShape, theDrawer);
       return;
     }
 
+    const Standard_Boolean aDrawAllVerticesFlag = (theDrawer->VertexDrawMode() == Prs3d_VDM_All);
+    if (!aDrawAllVerticesFlag && theShape.ShapeType() != TopAbs_COMPOUND)
+    {
+      return;
+    }
+
     // We have to create a compound and collect all subshapes not drawn by the shading algo.
     // This includes:
     // - isolated edges