if( theShape.IsNull() )
return;
+ int i = 0;
if( theShape.ShapeType()==TopAbs_COMPOUND )
{
TopExp_Explorer anExplorer( theShape, TopAbs_FACE );
for( ; anExplorer.More(); anExplorer.Next() )
- ShowShape (anExplorer.Current(), theMode);
+ ShowShape (anExplorer.Current(), theMode, i);
}
else
- ShowShape(theShape, theMode);
+ ShowShape(theShape, theMode, i);
if( isFitAll )
}
}
-void TestViewer::ShowShape(const TopoDS_Shape& theShape, int theMode)
+void TestViewer::ShowShape(const TopoDS_Shape& theShape, int theMode, int& i)
{
- int i = 0;
if( theShape.ShapeType()==TopAbs_SHELL )
{
TopoDS_Iterator anIt( theShape );
- for( ; anIt.More(); anIt.Next(), i++ )
+ for( ; anIt.More(); anIt.Next())
+ {
show( anIt.Value(), theMode, false, GetColor(i) );
+ i++;
+ }
}
else if (theShape.ShapeType()==TopAbs_FACE ||
theShape.ShapeType()==TopAbs_WIRE ||
theShape.ShapeType()==TopAbs_EDGE ||
theShape.ShapeType()==TopAbs_VERTEX )
- show( theShape, theMode, false, GetColor(0) );
+ {
+ show( theShape, theMode, false, GetColor(i) );
+ i++;
+ }
}
bool AreImagesEqual( const QImage& theImage1, const QImage& theImage2, double theTolerance )
int theMode, int theSelectionMode, bool isFitAll, const char* theKey );
static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const QColor& theColor );
static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const char* theKey );
- static void ShowShape(const TopoDS_Shape& theShape, int theMode);
+ static void ShowShape(const TopoDS_Shape& theShape, int theMode, int& i);
static bool AssertImages( QString& theMessage );
static QColor GetColor(int i);
CPPUNIT_ASSERT_EQUAL( true, aMap->Add( Polyline_4, "" ) );
Handle(HYDROGUI_LandCoverMapPrs) aPrs = new HYDROGUI_LandCoverMapPrs( aMap );
+ TopoDS_Shape aSh = aMap->GetShape();
TestViewer::show( aPrs, AIS_Shaded, 0, true, "LandCover_Triangles" );
CPPUNIT_ASSERT_IMAGES