-//********************************************************************
-void XGUI_InspectionPanel::fillEdge(const TopoDS_Shape& theShape)
-{
- TopoDS_Edge aE = TopoDS::Edge(theShape);
-
- bool bDegenerated = BRep_Tool::Degenerated(aE);
-
- double aT1, aT2;
- Handle(Geom_Curve) aC3D = BRep_Tool::Curve(aE, aT1, aT2);
- GeomAdaptor_Curve aGAC(aC3D);
- GeomAbs_CurveType aCT = aGAC.GetType();
-
- if (aCT == GeomAbs_Line) { // Line
- gp_Pnt aP1, aP2;
- aGAC.D0(aT1, aP1);
- aGAC.D0(aT2, aP2);
- setLineType(aP1.XYZ(), aP2.XYZ());
-
- } else if (aCT == GeomAbs_Circle) {
- gp_Circ aCirc = aGAC.Circle();
- gp_Pnt aP = aCirc.Location();
- gp_Ax2 aAx2 = aCirc.Position();
- double aR1 = aCirc.Radius();
- gp_Dir aDir = aAx2.Axis().Direction();
-
- bool isArc = (Abs(aT2 - aT1 - aC3D->Period()) >= Precision::PConfusion());
- if (isArc) {
- gp_Pnt aP1, aP2;
- aGAC.D0(aT1, aP1);
- aGAC.D0(aT2, aP2);
- setArcType(aP.XYZ(), aDir.XYZ(), aR1, aP1.XYZ(), aP2.XYZ());
- } else
- setCircleType(aP.XYZ(), aDir.XYZ(), aR1);
-
- } else if (aCT == GeomAbs_Ellipse) {
- gp_Elips aElips = aGAC.Ellipse();
- gp_Pnt aP = aElips.Location();
- gp_Ax2 aAx2 = aElips.Position();
- double aR1 = aElips.MajorRadius();
- double aR2 = aElips.MinorRadius();
- gp_Dir aDir = aAx2.Axis().Direction();
- gp_Pnt aP1, aP2;
- aGAC.D0(aT1, aP1);
- aGAC.D0(aT2, aP2);
- bool isArc = aP1.Distance(aP2) > Precision::Confusion();
- if (isArc)
- setEllipseArcType(aP.XYZ(), aDir.XYZ(), aR1, aR2, aP1.XYZ(), aP2.XYZ());
- else
- setEllipseType(aP.XYZ(), aDir.XYZ(), aR1, aR2);
- }