mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0031842: Coding Rules, BOPAlgo - eliminate CLang warning -fsanitize=undefined reference binding to null pointer
Added NULL checks before Progress Scope pointer dereference.
This commit is contained in:
parent
2958b91f62
commit
d922149528
@ -387,7 +387,10 @@ void BOPAlgo_BOP::Perform()
|
||||
pPF=new BOPAlgo_PaveFiller(aAllocator);
|
||||
pPF->SetArguments(aLS);
|
||||
pPF->SetRunParallel(myRunParallel);
|
||||
pPF->SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
pPF->SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
pPF->SetFuzzyValue(myFuzzyValue);
|
||||
pPF->SetNonDestructive(myNonDestructive);
|
||||
pPF->SetGlue(myGlue);
|
||||
|
@ -195,7 +195,10 @@ void BOPAlgo_Builder::Perform()
|
||||
//
|
||||
pPF->SetArguments(myArguments);
|
||||
pPF->SetRunParallel(myRunParallel);
|
||||
pPF->SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
pPF->SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
pPF->SetFuzzyValue(myFuzzyValue);
|
||||
pPF->SetNonDestructive(myNonDestructive);
|
||||
pPF->SetGlue(myGlue);
|
||||
@ -632,7 +635,10 @@ void BOPAlgo_Builder::BuildBOP(const TopTools_ListOfShape& theObjects,
|
||||
aBS.SetRunParallel(myRunParallel);
|
||||
aBS.SetContext(myContext);
|
||||
aBS.SetFuzzyValue(myFuzzyValue);
|
||||
aBS.SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
aBS.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
aBS.Perform();
|
||||
|
||||
// Resulting solids
|
||||
|
@ -450,7 +450,10 @@ void BOPAlgo_Builder::BuildSplitFaces()
|
||||
aBF.SetFace(aF);
|
||||
aBF.SetShapes(aLE);
|
||||
aBF.SetRunParallel(myRunParallel);
|
||||
aBF.SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
aBF.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
//
|
||||
}// for (i=0; i<aNbS; ++i) {
|
||||
//
|
||||
@ -637,7 +640,10 @@ void BOPAlgo_Builder::FillSameDomainFaces()
|
||||
aPSB.Shape1() = aF1;
|
||||
aPSB.Shape2() = aF2;
|
||||
aPSB.SetFuzzyValue(myFuzzyValue);
|
||||
aPSB.SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
aPSB.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -790,7 +796,10 @@ void BOPAlgo_Builder::FillInternalVertices()
|
||||
aVFI.SetVertex(aV);
|
||||
aVFI.SetFace(aFIm);
|
||||
aVFI.SetFuzzyValue(myFuzzyValue);
|
||||
aVFI.SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
aVFI.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -432,7 +432,10 @@ void BOPAlgo_Builder::BuildSplitSolids(TopTools_DataMapOfShapeShape& theDraftSol
|
||||
aBS.SetSolid(aSolid);
|
||||
aBS.SetShapes(aSFS);
|
||||
aBS.SetRunParallel(myRunParallel);
|
||||
aBS.SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
aBS.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
}//for (i=0; i<aNbS; ++i) {
|
||||
//
|
||||
Standard_Integer k, aNbBS;
|
||||
|
@ -432,7 +432,10 @@ void BOPAlgo_CheckerSI::CheckFaceSelfIntersection()
|
||||
aFaceSelfIntersect.SetFace(aF);
|
||||
aFaceSelfIntersect.SetTolF(aTolF);
|
||||
//
|
||||
aFaceSelfIntersect.SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
aFaceSelfIntersect.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Integer aNbFace = aVFace.Length();
|
||||
|
@ -86,7 +86,10 @@ void BOPAlgo_MakerVolume::Perform()
|
||||
}
|
||||
//
|
||||
pPF->SetRunParallel(myRunParallel);
|
||||
pPF->SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
pPF->SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
pPF->SetFuzzyValue(myFuzzyValue);
|
||||
pPF->SetNonDestructive(myNonDestructive);
|
||||
pPF->SetGlue(myGlue);
|
||||
|
@ -264,7 +264,10 @@ void BOPAlgo_PaveFiller::IntersectVE
|
||||
aVESolver.SetEdge(aE);
|
||||
aVESolver.SetPaveBlock(aPB);
|
||||
aVESolver.SetFuzzyValue(myFuzzyValue);
|
||||
aVESolver.SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
aVESolver.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
|
@ -253,7 +253,10 @@ void BOPAlgo_PaveFiller::PerformEE()
|
||||
anEdgeEdge.SetEdge2(aE2, aT21, aT22);
|
||||
anEdgeEdge.SetBoxes (aBB1, aBB2);
|
||||
anEdgeEdge.SetFuzzyValue(myFuzzyValue);
|
||||
anEdgeEdge.SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
anEdgeEdge.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
}//for (; aIt2.More(); aIt2.Next()) {
|
||||
}//for (; aIt1.More(); aIt1.Next()) {
|
||||
}//for (; myIterator->More(); myIterator->Next()) {
|
||||
@ -1070,10 +1073,17 @@ void BOPAlgo_PaveFiller::ForceInterfEE()
|
||||
anEdgeEdge.SetEdge2(aE2, aT21, aT22);
|
||||
anEdgeEdge.SetBoxes (myDS->ShapeInfo(nE1).Box(), myDS->ShapeInfo (nE2).Box());
|
||||
if (bUseAddTol)
|
||||
{
|
||||
anEdgeEdge.SetFuzzyValue(myFuzzyValue + aTolAdd);
|
||||
}
|
||||
else
|
||||
{
|
||||
anEdgeEdge.SetFuzzyValue(myFuzzyValue);
|
||||
anEdgeEdge.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
anEdgeEdge.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -217,7 +217,10 @@ void BOPAlgo_PaveFiller::PerformVF()
|
||||
aVertexFace.SetVertex(aV);
|
||||
aVertexFace.SetFace(aF);
|
||||
aVertexFace.SetFuzzyValue(myFuzzyValue);
|
||||
aVertexFace.SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
aVertexFace.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
}//for (; myIterator->More(); myIterator->Next()) {
|
||||
//
|
||||
aNbVF=aVVF.Length();
|
||||
|
@ -278,7 +278,10 @@ void BOPAlgo_PaveFiller::PerformEF()
|
||||
aSR = aPBRange;
|
||||
BOPTools_AlgoTools::CorrectRange(aE, aF, aSR, aPBRange);
|
||||
aEdgeFace.SetRange (aPBRange);
|
||||
aEdgeFace.SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
aEdgeFace.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
// Save the pair to avoid their forced intersection
|
||||
BOPDS_MapOfPaveBlock* pMPB = myFPBDone.ChangeSeek(nF);
|
||||
if (!pMPB)
|
||||
@ -1010,7 +1013,10 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
|
||||
aEdgeFace.SetFuzzyValue(myFuzzyValue + aTolAdd);
|
||||
aEdgeFace.UseQuickCoincidenceCheck(Standard_True);
|
||||
aEdgeFace.SetRange(IntTools_Range(aPB->Pave1().Parameter(), aPB->Pave2().Parameter()));
|
||||
aEdgeFace.SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
aEdgeFace.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -308,7 +308,10 @@ void BOPAlgo_PaveFiller::PerformFF()
|
||||
//
|
||||
aFaceFace.SetParameters(bApprox, bCompC2D1, bCompC2D2, anApproxTol);
|
||||
aFaceFace.SetFuzzyValue(myFuzzyValue);
|
||||
aFaceFace.SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
aFaceFace.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// for the Glue mode just add all interferences of that type
|
||||
@ -1019,7 +1022,10 @@ void BOPAlgo_PaveFiller::PostTreatFF
|
||||
}
|
||||
//
|
||||
// 2 Fuse shapes
|
||||
aPF.SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
aPF.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
aPF.SetRunParallel(myRunParallel);
|
||||
aPF.SetArguments(aLS);
|
||||
aPF.Perform();
|
||||
|
@ -484,7 +484,10 @@ void BOPAlgo_PaveFiller::MakeSplitEdges()
|
||||
aBSE.SetCommonBlock(aCB);
|
||||
}
|
||||
aBSE.SetDS(myDS);
|
||||
aBSE.SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
aBSE.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
} // for (; aItPB.More(); aItPB.Next()) {
|
||||
} // for (i=0; i<aNbPBP; ++i) {
|
||||
//
|
||||
@ -596,7 +599,10 @@ void BOPAlgo_PaveFiller::MakePCurves()
|
||||
BOPAlgo_MPC& aMPC=aVMPC.Appended();
|
||||
aMPC.SetEdge(aE);
|
||||
aMPC.SetFace(aF1F);
|
||||
aMPC.SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
aMPC.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
}
|
||||
//
|
||||
// On
|
||||
@ -660,7 +666,10 @@ void BOPAlgo_PaveFiller::MakePCurves()
|
||||
|
||||
aMPC.SetEdge(aE);
|
||||
aMPC.SetFace(aF1F);
|
||||
aMPC.SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
aMPC.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
}
|
||||
}// for (i=0; i<aNbFI; ++i) {
|
||||
//
|
||||
@ -710,7 +719,10 @@ void BOPAlgo_PaveFiller::MakePCurves()
|
||||
aMPC.SetEdge(aE);
|
||||
aMPC.SetFace(aFf[m]);
|
||||
aMPC.SetFlag(Standard_True);
|
||||
aMPC.SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
aMPC.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -89,7 +89,10 @@ void BOPAlgo_Splitter::Perform()
|
||||
BOPAlgo_PaveFiller *pPF = new BOPAlgo_PaveFiller();
|
||||
pPF->SetArguments(aLS);
|
||||
pPF->SetRunParallel(myRunParallel);
|
||||
pPF->SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
pPF->SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
pPF->SetFuzzyValue(myFuzzyValue);
|
||||
pPF->SetNonDestructive(myNonDestructive);
|
||||
pPF->SetGlue(myGlue);
|
||||
|
@ -125,7 +125,10 @@ void BRepAlgoAPI_BuilderAlgo::IntersectShapes(const TopTools_ListOfShape& theArg
|
||||
myDSFiller->SetArguments(theArgs);
|
||||
// Set options for intersection
|
||||
myDSFiller->SetRunParallel(myRunParallel);
|
||||
myDSFiller->SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
myDSFiller->SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
myDSFiller->SetFuzzyValue(myFuzzyValue);
|
||||
myDSFiller->SetNonDestructive(myNonDestructive);
|
||||
myDSFiller->SetGlue(myGlue);
|
||||
@ -145,7 +148,10 @@ void BRepAlgoAPI_BuilderAlgo::BuildResult()
|
||||
{
|
||||
// Set options to the builder
|
||||
myBuilder->SetRunParallel(myRunParallel);
|
||||
myBuilder->SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
myBuilder->SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
myBuilder->SetCheckInverted(myCheckInverted);
|
||||
myBuilder->SetToFillHistory(myFillHistory);
|
||||
// Perform building of the result with pre-calculated intersections
|
||||
|
@ -94,7 +94,10 @@ void BRepAlgoAPI_Check::Perform()
|
||||
anAnalyzer.SelfInterMode() = myTestSI;
|
||||
// Set options from BOPAlgo_Options
|
||||
anAnalyzer.SetRunParallel(myRunParallel);
|
||||
anAnalyzer.SetProgressIndicator(*myProgressScope);
|
||||
if (myProgressScope != NULL)
|
||||
{
|
||||
anAnalyzer.SetProgressIndicator(*myProgressScope);
|
||||
}
|
||||
anAnalyzer.SetFuzzyValue(myFuzzyValue);
|
||||
// Perform the check
|
||||
anAnalyzer.Perform();
|
||||
|
Loading…
x
Reference in New Issue
Block a user