From 9ba380fab3a652a02914433fcb9b2338a350e5fa Mon Sep 17 00:00:00 2001 From: SZY <> Date: Thu, 28 Apr 2011 15:22:18 +0000 Subject: [PATCH] OCC22315 Correction of pure misprint in TDatsXtd & ViewerTest --- src/TDataXtd/TDataXtd_Constraint.cxx | 2 +- src/ViewerTest/ViewerTest.cxx | 36 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/TDataXtd/TDataXtd_Constraint.cxx b/src/TDataXtd/TDataXtd_Constraint.cxx index 1f92d24a11..94b350e548 100755 --- a/src/TDataXtd/TDataXtd_Constraint.cxx +++ b/src/TDataXtd/TDataXtd_Constraint.cxx @@ -216,7 +216,7 @@ const Handle(TNaming_NamedShape)& TDataXtd_Constraint::GetPlane() const void TDataXtd_Constraint::SetType (const TDataXtd_ConstraintEnum CTR) { // OCC2932 correction - if(myType = CTR) return; + if(myType == CTR) return; Backup(); myType = CTR; diff --git a/src/ViewerTest/ViewerTest.cxx b/src/ViewerTest/ViewerTest.cxx index ba4e8487f0..a2df927886 100755 --- a/src/ViewerTest/ViewerTest.cxx +++ b/src/ViewerTest/ViewerTest.cxx @@ -1659,17 +1659,17 @@ Standard_Integer VTexture (Draw_Interpretor& di,Standard_Integer argc, const cha if(myAISContext.IsNull()) { di << "use 'vinit' command before " << argv[0] << "\n"; - return 1; + return 0; } Handle(AIS_InteractiveObject) TheAisIO; Handle(AIS_TexturedShape) myShape; Standard_Integer myPreviousMode = 0; - if (argc<2 || !argv[1]) + if (!argv[1]) { di << argv[0] <<" syntax error - Type 'help vtex'"<<"\n"; - return 1; + return 0; } TCollection_AsciiString name = argv[1]; @@ -1681,7 +1681,7 @@ Standard_Integer VTexture (Draw_Interpretor& di,Standard_Integer argc, const cha if (TheAisIO.IsNull()) { di <<"shape "<IsKind(STANDARD_TYPE(AIS_TexturedShape)) && !TheAisIO.IsNull()) @@ -1691,7 +1691,7 @@ Standard_Integer VTexture (Draw_Interpretor& di,Standard_Integer argc, const cha } else { - myAISContext->Clear(TheAisIO,Standard_False); + myAISContext->Erase(TheAisIO,Standard_False); myShape = new AIS_TexturedShape (DBRep::Get(argv[1])); GetMapOfAIS().UnBind1(TheAisIO); GetMapOfAIS().UnBind2(name); @@ -1703,9 +1703,9 @@ Standard_Integer VTexture (Draw_Interpretor& di,Standard_Integer argc, const cha if(argc<=1) { di << argv[0] <<" syntax error - Type 'help vtex'" << "\n"; - return 1; + return 0; } - if (argc>2 && argv[2]) + if (argv[2]) { if(strcasecmp(argv[2],"?")==0) { @@ -1744,7 +1744,7 @@ Standard_Integer VTexture (Draw_Interpretor& di,Standard_Integer argc, const cha if(argc<2) { di << argv[0] <<" syntax error - Type 'help vtex'" << "\n"; - return 1; + return 0; } myShape->SetTextureScale (( argv[2] ? Standard_True : Standard_False ), @@ -1756,7 +1756,7 @@ Standard_Integer VTexture (Draw_Interpretor& di,Standard_Integer argc, const cha if(argc<2) { di << argv[0] <<" syntax error - Type 'help vtex'" << "\n"; - return 1; + return 0; } myShape->SetTextureOrigin (( argv[2] ? Standard_True : Standard_False ), ( argv[2] ? atof(argv[2]) : 0.0 ), @@ -1767,9 +1767,9 @@ Standard_Integer VTexture (Draw_Interpretor& di,Standard_Integer argc, const cha if(argc<2) { di << argv[0] <<" syntax error - Type 'help vtex'" << "\n"; - return 1; + return 0; } - if (argc>2 && argv[2]) + if (argv[2]) { di <<"Texture repeat enabled"<<"\n"; myShape->SetTextureRepeat(Standard_True, atof(argv[2]), atof(argv[argc-1]) ); @@ -1789,7 +1789,7 @@ Standard_Integer VTexture (Draw_Interpretor& di,Standard_Integer argc, const cha if(argc<2) { di << argv[0] <<" syntax error - Type 'help vtex'" << "\n"; - return 1; + return 0; } myShape->SetTextureRepeat(Standard_False); myShape->SetTextureOrigin(Standard_False); @@ -1805,7 +1805,7 @@ Standard_Integer VTexture (Draw_Interpretor& di,Standard_Integer argc, const cha myAISContext->Display(myShape, Standard_True); myAISContext->Update(myShape,Standard_True); } - return 0; + return 1; } //============================================================================== @@ -2066,7 +2066,7 @@ static int VPerf(Draw_Interpretor& di, Standard_Integer , const char** argv) { // Function : VAnimation //================================================================================== static int VAnimation (Draw_Interpretor& di, Standard_Integer argc, const char** argv) { - if (argc =! 5) { + if (argc != 5) { di<<"Use: "<OpenLocalContext(); // step 1: prepare the data - if(curindex !=0){ + if(curindex != 0){ Handle(AIS_SignatureFilter) F1 = new AIS_SignatureFilter(TheType,TheSignature); TheAISContext()->AddFilter(F1); } @@ -2639,7 +2639,7 @@ Handle(AIS_InteractiveObject) ViewerTest::PickObject(const AIS_KindOfInteractive // step 1: prepare the data - if(curindex !=0){ + if(curindex != 0){ Handle(AIS_SignatureFilter) F1 = new AIS_SignatureFilter(TheType,TheSignature); TheAISContext()->AddFilter(F1); } @@ -2666,7 +2666,7 @@ Handle(AIS_InteractiveObject) ViewerTest::PickObject(const AIS_KindOfInteractive IO = TheAISContext()->SelectedInteractive(); } - if(curindex!=0) + if(curindex != 0) TheAISContext()->CloseLocalContext(curindex); return IO; } @@ -3079,7 +3079,7 @@ static int VIOTypes( Draw_Interpretor& di, Standard_Integer , const char** ) static int VEraseType( Draw_Interpretor& , Standard_Integer argc, const char** argv) { - if(argc!=2) return 1; + if(argc != 2) return 1; AIS_KindOfInteractive TheType; Standard_Integer TheSign(-1); -- 2.20.1