- return anAIS;
-
- 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>());
-
- boost::shared_ptr<GeomDataAPI_Point2D> aFlyoutAttr =
- boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(CONSTRAINT_ATTR_FLYOUT_VALUE_PNT));
- boost::shared_ptr<GeomAPI_Pnt2d> aFOPnt2d = aFlyoutAttr->pnt();
- boost::shared_ptr<GeomAPI_Pnt> aFlyoutPnt = sketch()->to3D(aFOPnt2d->x(), aFOPnt2d->y());
-
- if (anAIS.IsNull())
- {
- Handle(AIS_PerpendicularRelation) aPerpendicular =
- new AIS_PerpendicularRelation(aLine1->impl<TopoDS_Shape>(), aLine2->impl<TopoDS_Shape>(), aPlane);
- aPerpendicular->SetPosition(aFlyoutPnt->impl<gp_Pnt>());
- 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->SetPosition(aFlyoutPnt->impl<gp_Pnt>());
- aPerpendicular->Redisplay(Standard_True);
- }
- }
+ return thePrevious;
+
+ boost::shared_ptr<GeomAPI_Pln> aPlane = sketch()->plane();
+ boost::shared_ptr<GeomAPI_Shape> aLine1, aLine2;
+ boost::shared_ptr<ModelAPI_ResultConstruction> aConst1 =
+ boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(anAttr1->object());
+ if (aConst1) aLine1 = aConst1->shape();
+ boost::shared_ptr<ModelAPI_ResultConstruction> aConst2 =
+ boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(anAttr2->object());
+ if (aConst2) aLine2 = aConst2->shape();
+
+ boost::shared_ptr<GeomAPI_AISObject> anAIS = thePrevious;
+ if (!anAIS)
+ anAIS = boost::shared_ptr<GeomAPI_AISObject>(new GeomAPI_AISObject);
+ anAIS->createPerpendicular(aLine1, aLine2, aPlane);