Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bug fixes for the Placement feature
[modules/shaper.git]
/
src
/
GeomAPI
/
GeomAPI_Face.cpp
diff --git
a/src/GeomAPI/GeomAPI_Face.cpp
b/src/GeomAPI/GeomAPI_Face.cpp
index a455a0aaa8b89cfa6f24fdfe7038b63d5ca27905..ba111a67d1936924af2049b606c934f33b45f4f9 100644
(file)
--- a/
src/GeomAPI/GeomAPI_Face.cpp
+++ b/
src/GeomAPI/GeomAPI_Face.cpp
@@
-11,6
+11,7
@@
#include <TopoDS_Face.hxx>
#include <TopoDS.hxx>
#include <BRep_Tool.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS.hxx>
#include <BRep_Tool.hxx>
+#include <BRepAdaptor_Surface.hxx>
#include <Geom_Surface.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Surface.hxx>
#include <Geom_Plane.hxx>
@@
-69,17
+70,20
@@
bool GeomAPI_Face::isPlanar() const
std::shared_ptr<GeomAPI_Pln> GeomAPI_Face::getPlane() const
{
const TopoDS_Shape& aShape = const_cast<GeomAPI_Face*>(this)->impl<TopoDS_Shape>();
std::shared_ptr<GeomAPI_Pln> GeomAPI_Face::getPlane() const
{
const TopoDS_Shape& aShape = const_cast<GeomAPI_Face*>(this)->impl<TopoDS_Shape>();
-
Handle(Geom_Surface) aSurf = BRep_Tool::Surface
(TopoDS::Face(aShape));
+
BRepAdaptor_Surface aSurfAdapt
(TopoDS::Face(aShape));
- if (
!aSurf->IsKind(STANDARD_TYPE(Geom_Plane))
)
+ if (
aSurfAdapt.GetType() != GeomAbs_Plane
)
return std::shared_ptr<GeomAPI_Pln>();
// Obtain central point
double aUMin, aUMax, aVMin, aVMax;
return std::shared_ptr<GeomAPI_Pln>();
// Obtain central point
double aUMin, aUMax, aVMin, aVMax;
- aSurf->Bounds(aUMin, aUMax, aVMin, aVMax);
+ aUMin = aSurfAdapt.FirstUParameter();
+ aUMax = aSurfAdapt.LastUParameter();
+ aVMin = aSurfAdapt.FirstVParameter();
+ aVMax = aSurfAdapt.LastVParameter();
gp_Pnt aCentralPnt;
gp_Vec aDU, aDV;
gp_Pnt aCentralPnt;
gp_Vec aDU, aDV;
- aSurf
->
D1((aUMin+aUMax)*0.5, (aVMin+aVMax)*0.5, aCentralPnt, aDU, aDV);
+ aSurf
Adapt.
D1((aUMin+aUMax)*0.5, (aVMin+aVMax)*0.5, aCentralPnt, aDU, aDV);
std::shared_ptr<GeomAPI_Pnt> aCenter(
new GeomAPI_Pnt(aCentralPnt.X(), aCentralPnt.Y(), aCentralPnt.Z()));
std::shared_ptr<GeomAPI_Pnt> aCenter(
new GeomAPI_Pnt(aCentralPnt.X(), aCentralPnt.Y(), aCentralPnt.Z()));