mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-05 18:16:23 +03:00
0022885: Bugfix: else clause applies to the wrong if statement because of missing braces
This commit is contained in:
parent
b8f2022a11
commit
44d9ae897c
@ -2763,13 +2763,10 @@ void AIS_InteractiveContext::ClearGlobal(const Handle(AIS_InteractiveObject)& an
|
||||
myAISDetectedSeq.Remove( i );
|
||||
}
|
||||
|
||||
if(myWasLastMain && !myLastinMain.IsNull())
|
||||
if(myLastinMain == anIObj)
|
||||
myLastinMain.Nullify();
|
||||
else
|
||||
if(!myWasLastMain && !myLastinColl.IsNull())
|
||||
if(myLastinColl == anIObj)
|
||||
myLastinColl.Nullify();
|
||||
if(myLastinMain == anIObj)
|
||||
myLastinMain.Nullify();
|
||||
if(myLastinColl == anIObj)
|
||||
myLastinColl.Nullify();
|
||||
|
||||
if(myLastPicked == anIObj)
|
||||
myLastPicked.Nullify();
|
||||
|
@ -108,7 +108,7 @@ is
|
||||
-- will be hilighted when detected by the selector.
|
||||
-- ex : be able to select center of a line without
|
||||
-- displaying all centers before selection process
|
||||
|
||||
|
||||
Erase( me : mutable;
|
||||
anIObj : InteractiveObject from AIS2D;
|
||||
UpdateVwr : Boolean from Standard = Standard_True;
|
||||
@ -118,14 +118,6 @@ is
|
||||
-- or failing that, in other local contexts which allow erasing.
|
||||
-- If <PutInCollector> is false, the object is erased but
|
||||
-- not put in the Collector.
|
||||
|
||||
EraseMode( me : mutable;
|
||||
anIObj : InteractiveObject from AIS2D;
|
||||
aMode : Integer from Standard;
|
||||
UpdateVwr : Boolean from Standard = Standard_True);
|
||||
---Purpose: Selects an erase mode. Used only if more than one
|
||||
-- mode is displayed in the main viewer. If aMode is
|
||||
-- the Prs used by default, no erase mode is selected.
|
||||
|
||||
EraseAll( me : mutable;
|
||||
PutInCollector : Boolean from Standard = Standard_True;
|
||||
|
@ -341,23 +341,6 @@ void AIS2D_InteractiveContext::Erase(
|
||||
|
||||
}
|
||||
|
||||
void AIS2D_InteractiveContext::EraseMode(
|
||||
const Handle(AIS2D_InteractiveObject)& anIObj,
|
||||
const Standard_Integer aMode,
|
||||
const Standard_Boolean /*UpdateVwr*/ ) {
|
||||
|
||||
if ( anIObj.IsNull() ) return;
|
||||
|
||||
if ( !myObjects.IsBound( anIObj ) ) return;
|
||||
|
||||
if ( anIObj->HasDisplayMode() )
|
||||
if ( anIObj->DisplayMode() == aMode ) return;
|
||||
else if ( myDisplayMode == aMode) return;
|
||||
Handle(AIS2D_GlobalStatus) GStatus = myObjects( anIObj );
|
||||
if ( GStatus->GraphicStatus() != AIS2D_DS_Displayed ) return;
|
||||
if ( GStatus->IsDModeIn( aMode ) ) {}
|
||||
}
|
||||
|
||||
void AIS2D_InteractiveContext::EraseAll (const Standard_Boolean /*PutInCollector*/,
|
||||
const Standard_Boolean UpdateVwr)
|
||||
{
|
||||
|
@ -577,18 +577,21 @@ void Bnd_Box::Add (const gp_Dir& D)
|
||||
{
|
||||
Standard_Real DX,DY,DZ;
|
||||
D.Coord(DX,DY,DZ);
|
||||
if (Abs(DX) > gp::Resolution()) {
|
||||
if (DX > 0) OpenXmax();
|
||||
else OpenXmin();
|
||||
}
|
||||
if (Abs(DY) > gp::Resolution()) {
|
||||
if (DY > 0) OpenYmax();
|
||||
else OpenYmin();
|
||||
}
|
||||
if (Abs(DZ) > gp::Resolution()) {
|
||||
if (DZ > 0) OpenZmax();
|
||||
else OpenZmin();
|
||||
}
|
||||
|
||||
if (DX < -RealEpsilon())
|
||||
OpenXmin();
|
||||
else if (DX > RealEpsilon())
|
||||
OpenXmax();
|
||||
|
||||
if (DY < -RealEpsilon())
|
||||
OpenYmin();
|
||||
else if (DY > RealEpsilon())
|
||||
OpenYmax();
|
||||
|
||||
if (DZ < -RealEpsilon())
|
||||
OpenZmin();
|
||||
else if (DZ > RealEpsilon())
|
||||
OpenZmax();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@ -204,14 +204,16 @@ void Bnd_Box2d::Add (const gp_Dir2d& D)
|
||||
{
|
||||
Standard_Real DX = D.X();
|
||||
Standard_Real DY = D.Y();
|
||||
if (DX < 0)
|
||||
if (DX < - gp::Resolution()) OpenXmin();
|
||||
else
|
||||
if (DX > gp::Resolution()) OpenXmax();
|
||||
if (DY < 0)
|
||||
if (DY < - gp::Resolution()) OpenYmin();
|
||||
else
|
||||
if (DY > gp::Resolution()) OpenYmax();
|
||||
|
||||
if (DX < -RealEpsilon())
|
||||
OpenXmin();
|
||||
else if (DX > RealEpsilon())
|
||||
OpenXmax();
|
||||
|
||||
if (DY < -RealEpsilon())
|
||||
OpenYmin();
|
||||
else if (DY > RealEpsilon())
|
||||
OpenYmax();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@ -124,28 +124,6 @@ void IGESData_GlobalSection::Init(const Handle(Interface_ParamSet)& params,
|
||||
|
||||
Standard_Integer nbp = params->NbParams();
|
||||
|
||||
// Sending of message : Incorrect number of parameters (following the IGES version)
|
||||
// Version less than 5.3
|
||||
if (theIGESVersion < 11)
|
||||
if ((nbp < 24) || (nbp > 25)) {
|
||||
// 24 or 25 parameters are expected (parameter 25 is not required)
|
||||
Message_Msg Msg39 ("XSTEP_39");
|
||||
Msg39.Arg(24);
|
||||
Msg39.Arg(25);
|
||||
if (nbp < 24) ach->SendFail(Msg39);
|
||||
else ach->SendWarning(Msg39);
|
||||
}
|
||||
|
||||
// Version 5.3
|
||||
else if ((nbp < 25) || (nbp > 26)) {
|
||||
// 25 or 26 parameters are expected (parameter 25 is not required)
|
||||
Message_Msg Msg39 ("XSTEP_39");
|
||||
Msg39.Arg(25);
|
||||
Msg39.Arg(26);
|
||||
if (nbp < 25) ach->SendFail(Msg39);
|
||||
else ach->SendWarning(Msg39);
|
||||
}
|
||||
|
||||
for (Standard_Integer i = 1; i <= nbp; i ++) {
|
||||
Standard_Integer intval = 0; Standard_Real realval = 0.0;
|
||||
Handle(TCollection_HAsciiString) strval; // doit repartir a null
|
||||
@ -227,6 +205,29 @@ void IGESData_GlobalSection::Init(const Handle(Interface_ParamSet)& params,
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
|
||||
// Sending of message : Incorrect number of parameters (following the IGES version)
|
||||
// Version less than 5.3
|
||||
if (theIGESVersion < 11)
|
||||
{
|
||||
if ((nbp < 24) || (nbp > 25)) {
|
||||
// 24 or 25 parameters are expected (parameter 25 is not required)
|
||||
Message_Msg Msg39 ("XSTEP_39");
|
||||
Msg39.Arg(24);
|
||||
Msg39.Arg(25);
|
||||
if (nbp < 24) ach->SendFail(Msg39);
|
||||
else ach->SendWarning(Msg39);
|
||||
}
|
||||
}
|
||||
// Version 5.3
|
||||
else if ((nbp < 25) || (nbp > 26)) {
|
||||
// 25 or 26 parameters are expected (parameter 25 is not required)
|
||||
Message_Msg Msg39 ("XSTEP_39");
|
||||
Msg39.Arg(25);
|
||||
Msg39.Arg(26);
|
||||
if (nbp < 25) ach->SendFail(Msg39);
|
||||
else ach->SendWarning(Msg39);
|
||||
}
|
||||
|
||||
//:45 by abv 11.12.97: if UnitFlag is not defined in the file,
|
||||
// restore it from UnitName. Repris par CKY 13-FEV-1998
|
||||
|
@ -582,8 +582,10 @@ static Standard_Boolean CheckPoles(const TColgp_Array2OfPnt& poles, Standard_Int
|
||||
Standard_Integer i0 = (uorv == 1 ? poles.LowerCol() : poles.LowerRow());
|
||||
Standard_Integer i1 = (uorv == 1 ? poles.UpperCol() : poles.UpperRow());
|
||||
for (Standard_Integer i = i0; i <= i1-1; i ++) {
|
||||
if (uorv == 1) if(poles(rank,i).IsEqual(poles(rank, i+1), 1e-15)) return Standard_True;
|
||||
else if(poles(i,rank).IsEqual(poles(i+1,rank), 1e-15)) return Standard_True;
|
||||
if (uorv == 1) {
|
||||
if(poles(rank,i).IsEqual(poles(rank, i+1), 1e-15)) return Standard_True;
|
||||
} else
|
||||
if(poles(i,rank).IsEqual(poles(i+1,rank), 1e-15)) return Standard_True;
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
@ -1031,12 +1031,12 @@ void TPrsStd_AISPresentation::AISErase (const Standard_Boolean remove)
|
||||
}
|
||||
}
|
||||
else {
|
||||
if( remove )
|
||||
if( remove ) {
|
||||
if( !ownctx.IsNull() ) {
|
||||
ownctx->Remove (myAIS,Standard_False);
|
||||
myAIS->SetToUpdate();
|
||||
}
|
||||
else
|
||||
} else
|
||||
if( !ownctx.IsNull() ) ownctx->Erase (myAIS,Standard_False);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user