- // Build a plane for angle dimension presentation {P11, P12, P3}
- TopoDS_Vertex V11, V12, V21, V22;
- TopExp::Vertices(anEdge1, V11, V12);
- TopExp::Vertices(anEdge2, V21, V22);
-
- gp_Pnt aP11 = BRep_Tool::Pnt(TopExp::FirstVertex(anEdge1));
- gp_Pnt aP12 = BRep_Tool::Pnt(TopExp::LastVertex (anEdge1));
-
- gp_Pnt aP21 = BRep_Tool::Pnt(TopExp::FirstVertex(anEdge2));
- gp_Pnt aP22 = BRep_Tool::Pnt(TopExp::LastVertex (anEdge2));
-
- // *P3
- // \
- // \
- // *P22
- // /
- // /
- // P11 / P12
- // *-----/----------*
- // \ /
- // \ /
- // *P21
- gp_Pnt aP3 (aP22.XYZ() + aP11.XYZ() - aP21.XYZ());
-
- gce_MakePln gce_MP(aP11, aP12, aP3);
- Handle(Geom_Plane) aPlane = new Geom_Plane(gce_MP.Value());
-
- // Build the angle dimension presentation
- QString aLabel;
- aLabel.sprintf("%.1f", anAngle);
-
- Handle(AIS_AngleDimension) anIO = new AIS_AngleDimension
- (anEdge1, anEdge2, aPlane, anAngle * M_PI / 180.,
- TCollection_ExtendedString((Standard_CString)aLabel.toLatin1().data()));