1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +03:00

Compare commits

...

2 Commits

Author SHA1 Message Date
abk
c12f6ce826 Access to vertex 3D point and edge degenerated flag was made through class
BRep_Tool.
2013-03-12 19:44:26 +04:00
abk
ac28983edf Work of draw function nexplode for degenerated edges was restored in case
of exploding by edges.
2013-03-12 19:44:21 +04:00

View File

@@ -51,6 +51,8 @@
#include <BRepGProp.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <Draw_ProgressIndicator.hxx>
#include <BRep_Tool.hxx>
#include <GProp_PGProps.hxx>
// memory management
#include <Standard.hxx>
@@ -618,7 +620,6 @@ static Standard_Integer nexplode(Draw_Interpretor& di,
TColStd_Array1OfInteger OrderInd(1,MaxShapes);
// gp_Pnt GPoint;
GProp_GProps GPr;
// Standard_Integer InOfminX = 1,aTemp;
Standard_Integer aTemp;
TColStd_Array1OfReal MidXYZ(1,MaxShapes); //X,Y,Z;
@@ -627,8 +628,29 @@ static Standard_Integer nexplode(Draw_Interpretor& di,
// Computing of CentreOfMass
for (Index=1; Index <= MaxShapes; Index++) {
OrderInd.SetValue(Index,Index);
BRepGProp::LinearProperties(aShapes(Index),GPr);
gp_Pnt GPoint = GPr.CentreOfMass();
const TopoDS_Shape & aS = aShapes(Index);
gp_Pnt GPoint;
TopoDS_Edge anES;
if (typ != TopAbs_EDGE ||
(anES = TopoDS::Edge(aS), BRep_Tool::Degenerated(anES)))
{
GProp_GProps GPr;
BRepGProp::LinearProperties(aS,GPr);
GPoint = GPr.CentreOfMass();
}
else
{
GProp_PGProps aPD;
for (TopExp_Explorer aVE(anES, TopAbs_VERTEX); aVE.More(); aVE.Next())
{
TopoDS_Vertex aVS = TopoDS::Vertex(aVE.Current());
gp_Pnt aP = BRep_Tool::Pnt(aVS);
aP.Transform(anES.Location());
aP.Transform(aS.Location());
aPD.AddPoint(aP);
}
GPoint = aPD.CentreOfMass();
}
MidXYZ.SetValue(Index, GPoint.X()*999 + GPoint.Y()*99 +
GPoint.Z()*0.9);
}