X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FViewerTest%2FViewerTest.cxx;h=a5537024bf1c408a0469bf2ebf50b0af6598c8b9;hp=ae1675a820377e6e158ad6574a71aeac900ac5ee;hb=eafb234bf120f005d1a52abc75384d33d2de1721;hpb=105aae761ef27c49cd5ca924a7af7a602a61968e diff --git a/src/ViewerTest/ViewerTest.cxx b/src/ViewerTest/ViewerTest.cxx index ae1675a820..a5537024bf 100755 --- a/src/ViewerTest/ViewerTest.cxx +++ b/src/ViewerTest/ViewerTest.cxx @@ -439,13 +439,14 @@ Handle(AIS_Shape) GetAISShapeFromName(const char* name) const Handle(AIS_InteractiveObject) IO = Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2(name)); if (!IO.IsNull()) { - if(IO->Type()==AIS_KOI_Shape) + if(IO->Type()==AIS_KOI_Shape) { if(IO->Signature()==0){ retsh = *((Handle(AIS_Shape)*)&IO); } else cout << "an Object which is not an AIS_Shape " "already has this name!!!"<SubIntensityOn(IO); else Ctx->SubIntensityOff(IO); - + } } else return 1; } @@ -1121,11 +1122,12 @@ static int VColor2 (Draw_Interpretor& di, Standard_Integer argc, const char** ar while ( it.More() ) { const Handle(AIS_InteractiveObject) ashape = Handle(AIS_InteractiveObject)::DownCast(it.Key1()); - if (!ashape.IsNull()) + if (!ashape.IsNull()) { if(HaveToSet) TheAISContext()->SetColor(ashape,ViewerTest::GetColorFromName(argv[1]),Standard_False); else TheAISContext()->UnsetColor(ashape,Standard_False); + } it.Next(); } TheAISContext()->UpdateCurrentViewer(); @@ -1218,11 +1220,12 @@ static int VTransparency (Draw_Interpretor& di, Standard_Integer argc, while ( it.More() ) { Handle(AIS_InteractiveObject) ashape = Handle(AIS_InteractiveObject)::DownCast(it.Key1()); - if (!ashape.IsNull()) + if (!ashape.IsNull()) { if(HaveToSet) TheAISContext()->SetTransparency(ashape,Draw::Atof(argv[1]),Standard_False); else TheAISContext()->UnsetTransparency(ashape,Standard_False); + } it.Next(); } TheAISContext()->UpdateCurrentViewer(); @@ -1274,11 +1277,12 @@ static int VMaterial (Draw_Interpretor& di, Standard_Integer argc, const char** if ( ThereIsName && IsBound ) { Handle(AIS_InteractiveObject) ashape = Handle(AIS_InteractiveObject)::DownCast (GetMapOfAIS().Find2(name)); - if (!ashape.IsNull()) + if (!ashape.IsNull()) { if (HaveToSet) TheAISContext()->SetMaterial(ashape,GetMaterialFromName(argv[2])); else TheAISContext()->UnsetMaterial(ashape); + } } //======================================================================= // Il n'y a pas de nom de shape @@ -1308,11 +1312,12 @@ static int VMaterial (Draw_Interpretor& di, Standard_Integer argc, const char** while ( it.More() ) { Handle(AIS_InteractiveObject) ashape = Handle(AIS_InteractiveObject)::DownCast (it.Key1()); - if (!ashape.IsNull()) + if (!ashape.IsNull()) { if (HaveToSet) TheAISContext()->SetMaterial(ashape,GetMaterialFromName(argv[1]),Standard_False); else TheAISContext()->UnsetMaterial(ashape,Standard_False); + } it.Next(); } TheAISContext()->UpdateCurrentViewer(); @@ -1399,15 +1404,16 @@ static int VWidth (Draw_Interpretor& di, Standard_Integer argc, const char** arg else if (!ThereIsCurrent && !ThereIsArgument){ ViewerTest_DoubleMapIteratorOfDoubleMapOfInteractiveAndName it(GetMapOfAIS()); - while ( it.More() ) { - Handle(AIS_InteractiveObject) ashape = - Handle(AIS_InteractiveObject)::DownCast (it.Key1()); - if (!ashape.IsNull()) - if (HaveToSet) - TheAISContext()->SetWidth(ashape,Draw::Atof(argv[1]),Standard_False); - else - TheAISContext()->UnsetWidth(ashape,Standard_False); - it.Next(); + while ( it.More() ) { + Handle(AIS_InteractiveObject) ashape = + Handle(AIS_InteractiveObject)::DownCast (it.Key1()); + if (!ashape.IsNull()) { + if (HaveToSet) + TheAISContext()->SetWidth(ashape,Draw::Atof(argv[1]),Standard_False); + else + TheAISContext()->UnsetWidth(ashape,Standard_False); + } + it.Next(); } TheAISContext()->UpdateCurrentViewer(); }