1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-05 18:16:23 +03:00

Corrections made for OCCT 6.9.1.beta

- Graphic3d_Camera: comparison of real to zero by == is replaced by safer check against FLT_MIN (#25760)
- BRepBuilderAPI_Copy: new option copyMesh (#26458) is documented and made combinable with copyGeom
This commit is contained in:
abv 2015-09-03 09:51:15 +03:00 committed by bugmaster
parent 969d1cafab
commit 5c8908e0f0
3 changed files with 20 additions and 34 deletions

View File

@ -26,12 +26,14 @@
#include <TopoDS_Vertex.hxx>
#include <Poly_Triangulation.hxx>
namespace {
//! Tool class implementing necessary functionality for copying geometry
class BRepBuilderAPI_Copy_Modification : public BRepTools_Modification
{
public:
BRepBuilderAPI_Copy_Modification (const Standard_Boolean copyGeom,
const Standard_Boolean copyMesh = Standard_False)
const Standard_Boolean copyMesh)
: myCopyGeom(copyGeom),
myCopyMesh(copyMesh)
{
@ -66,7 +68,8 @@ public:
if (T.IsNull())
return Standard_False;
T = T->Copy();
if (myCopyGeom)
T = T->Copy();
return Standard_True;
}
@ -143,6 +146,7 @@ private:
DEFINE_STANDARD_HANDLE(BRepBuilderAPI_Copy_Modification, BRepTools_Modification)
} // anonymous namespace
//=======================================================================
//function : BRepBuilderAPI_Copy
@ -151,7 +155,7 @@ DEFINE_STANDARD_HANDLE(BRepBuilderAPI_Copy_Modification, BRepTools_Modification)
BRepBuilderAPI_Copy::BRepBuilderAPI_Copy ()
{
myModification = new BRepBuilderAPI_Copy_Modification(Standard_True);
myModification = new BRepBuilderAPI_Copy_Modification(Standard_True, Standard_False);
}

View File

@ -22,9 +22,8 @@
#include <Standard_Handle.hxx>
#include <BRepBuilderAPI_ModifyShape.hxx>
#include <Standard_Boolean.hxx>
class TopoDS_Shape;
class TopoDS_Shape;
//! Duplication of a shape.
//! A Copy object provides a framework for:
@ -37,46 +36,28 @@ public:
DEFINE_STANDARD_ALLOC
//! Constructs an empty copy framework. Use the function
//! Perform to copy shapes.
Standard_EXPORT BRepBuilderAPI_Copy();
//! Constructs a copy framework and copies the shape S.
//! Use the function Shape to access the result.
//! If copyMesh is True, triangulation contained in original shape will be
//! copied along with geometry (by default, triangulation gets lost).
//! If copyGeom is False, only topological objects will be copied, while
//! geometry will be shared with original shape.
//! geometry and triangulation will be shared with original shape.
//! Note: the constructed framework can be reused to copy
//! other shapes: just specify them with the function Perform.
Standard_EXPORT BRepBuilderAPI_Copy(const TopoDS_Shape& S, const Standard_Boolean copyGeom = Standard_True, const Standard_Boolean copyMesh = Standard_False);
//! Copies the shape S.
//! Use the function Shape to access the result.
//! If copyMesh is True, triangulation contained in original shape will be
//! copied along with geometry (by default, triangulation gets lost).
//! If copyGeom is False, only topological objects will be copied, while
//! geometry will be shared with original shape.
//! geometry and triangulation will be shared with original shape.
Standard_EXPORT void Perform (const TopoDS_Shape& S, const Standard_Boolean copyGeom = Standard_True, const Standard_Boolean copyMesh = Standard_False);
protected:
private:
};
#endif // _BRepBuilderAPI_Copy_HeaderFile

View File

@ -50,11 +50,12 @@ namespace
// relative z-range tolerance compatible with for floating point.
static Standard_Real zEpsilon (const Standard_Real theValue)
{
if (theValue == 0)
Standard_Real anAbsValue = Abs (theValue);
if (anAbsValue <= (double)FLT_MIN)
{
return FLT_EPSILON;
return FLT_MIN;
}
Standard_Real aLogRadix = Log10 (Abs (theValue)) / Log10 (FLT_RADIX);
Standard_Real aLogRadix = Log10 (anAbsValue) / Log10 (FLT_RADIX);
Standard_Real aExp = Floor (aLogRadix);
return FLT_EPSILON * Pow (FLT_RADIX, aExp);
};