From 3c61d41dbfce0a868f1db34b8c81c4c0b3f54789 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 23 Nov 2014 10:55:36 +0100 Subject: [PATCH] + fix bug in mesh bounding box, fix clang warning --- src/App/PropertyStandard.cpp | 2 +- src/Mod/Mesh/App/Mesh.cpp | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/App/PropertyStandard.cpp b/src/App/PropertyStandard.cpp index b10418f69..92ee3090a 100644 --- a/src/App/PropertyStandard.cpp +++ b/src/App/PropertyStandard.cpp @@ -283,7 +283,7 @@ void PropertyEnumeration::setEnums(const char** plEnums) // check for NULL termination const char* p = *_EnumArray; unsigned int i=0; - while(*(p++) != NULL)i++; + while(*(p++) != 0)i++; // very unlikely to have enums with more then 5000 entries! assert(i<5000); } diff --git a/src/Mod/Mesh/App/Mesh.cpp b/src/Mod/Mesh/App/Mesh.cpp index f08de844f..c7d623487 100644 --- a/src/Mod/Mesh/App/Mesh.cpp +++ b/src/Mod/Mesh/App/Mesh.cpp @@ -148,11 +148,13 @@ Base::BoundBox3d MeshObject::getBoundBox(void)const { const_cast(_kernel).RecalcBoundBox(); Base::BoundBox3f Bnd = _kernel.GetBoundBox(); - + Base::BoundBox3d Bnd2; - for(int i =0 ;i<=7;i++) - Bnd2.Add(transformToOutside(Bnd.CalcPoint(i))); - + if (Bnd.IsValid()) { + for (int i =0 ;i<=7;i++) + Bnd2.Add(transformToOutside(Bnd.CalcPoint(i))); + } + return Bnd2; }