- boost::shared_ptr<GeomAPI_Shape> aLine1 = aLine1Feature->preview();
- boost::shared_ptr<GeomAPI_Shape> aLine2 = aLine2Feature->preview();
- Handle(Geom_Plane) aPlane = new Geom_Plane(sketch()->plane()->impl<gp_Pln>());
-
- if (anAIS.IsNull())
- {
- Handle(AIS_PerpendicularRelation) aPerpendicular =
- new AIS_PerpendicularRelation(aLine1->impl<TopoDS_Shape>(), aLine2->impl<TopoDS_Shape>(), aPlane);
-
- anAIS = aPerpendicular;
- }
- else
- {
- Handle(AIS_PerpendicularRelation) aPerpendicular = Handle(AIS_PerpendicularRelation)::DownCast(anAIS);
- if (!aPerpendicular.IsNull())
- {
- aPerpendicular->SetFirstShape(aLine1->impl<TopoDS_Shape>());
- aPerpendicular->SetSecondShape(aLine2->impl<TopoDS_Shape>());
- aPerpendicular->SetPlane(aPlane);
- aPerpendicular->Redisplay(Standard_True);
- }
+ AISObjectPtr anAIS = thePrevious;
+ if (!anAIS) {
+ anAIS = SketcherPrs_Factory::perpendicularConstraint(this, sketch()->coordinatePlane());