X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketcherPrs%2FSketcherPrs_SymbolPrs.cpp;h=b953501fa8b509abe938eb6182df85e9aa36e199;hb=68420e410a9846ec7dcb2f4645030455bc374288;hp=4637f910c08de6a27b2efe79b863997c73aff634;hpb=ec6aaa4d8bd3609b04ea85683e1b1175b6632238;p=modules%2Fshaper.git diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp index 4637f910c..b953501fa 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp @@ -11,6 +11,10 @@ #include +#include +#include +#include + #ifdef WIN32 # define FSEP "\\" @@ -66,7 +70,8 @@ void SketcherPrs_SymbolPrs::prepareAspect() void SketcherPrs_SymbolPrs::addLine(const Handle(Graphic3d_Group)& theGroup, std::string theAttrName) const { - std::shared_ptr aLine = SketcherPrs_Tools::getLine(myConstraint, theAttrName); + ObjectPtr aObj = SketcherPrs_Tools::getResult(myConstraint, theAttrName); + std::shared_ptr aLine = SketcherPrs_Tools::getShape(aObj); if (aLine.get() == NULL) return; std::shared_ptr aEdge = std::shared_ptr(new GeomAPI_Edge(aLine)); @@ -79,3 +84,45 @@ void SketcherPrs_SymbolPrs::addLine(const Handle(Graphic3d_Group)& theGroup, std aLines->AddVertex(aPnt2->impl()); theGroup->AddPrimitiveArray(aLines); } + +void SketcherPrs_SymbolPrs::HilightSelected(const Handle(PrsMgr_PresentationManager3d)& thePM, + const SelectMgr_SequenceOfOwner& theOwners) +{ + + Handle( Prs3d_Presentation ) aSelectionPrs = GetSelectPresentation( thePM ); + aSelectionPrs->Clear(); + drawLines(aSelectionPrs, Quantity_NOC_WHITE); + + aSelectionPrs->SetDisplayPriority(9); + aSelectionPrs->Display(); + thePM->Highlight(this); +} + +void SketcherPrs_SymbolPrs::HilightOwnerWithColor(const Handle(PrsMgr_PresentationManager3d)& thePM, + const Quantity_NameOfColor theColor, const Handle(SelectMgr_EntityOwner)& theOwner) +{ + thePM->Color(this, theColor); + + Handle( Prs3d_Presentation ) aHilightPrs = GetHilightPresentation( thePM ); + aHilightPrs->Clear(); + drawLines(aHilightPrs, theColor); + + if (thePM->IsImmediateModeOn()) + thePM->AddToImmediateList(aHilightPrs); +} + + + +void SketcherPrs_SymbolPrs::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, + const Standard_Integer aMode) +{ + ClearSelected(); + + if (!myPntArray.IsNull()) { + Handle(SelectMgr_EntityOwner) aOwn = new SelectMgr_EntityOwner(this); + for (int i = 1; i <= myPntArray->VertexNumber(); i++) { + Handle(Select3D_SensitivePoint) aSP = new Select3D_SensitivePoint(aOwn, myPntArray->Vertice(i)); + aSelection->Add(aSP); + } + } +}