X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FSketcherPrs%2FSketcherPrs_SymbolPrs.cpp;h=b8bdd9db71111e3cfbf3e5e3ca2bc6330fc25bbf;hb=53445a818411b3b71e3457f5e2e97c5f23d69cb7;hp=6b345ffb2fac0161d29a504c00e394b707c646cf;hpb=2532fb2df83ee1ddd9ff3e8b381d3788eaa15b69;p=modules%2Fshaper.git diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp index 6b345ffb2..b8bdd9db7 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp @@ -14,7 +14,8 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or +// email : webmaster.salome@opencascade.com // #include "SketcherPrs_SymbolPrs.h" @@ -25,6 +26,8 @@ #include #include +#include + #include #include @@ -56,7 +59,7 @@ #endif /// Step between icons -static const double MyDist = 0.02; +static const double MyDist = 0.015; //************************************************************** @@ -96,7 +99,7 @@ public: // Update selection position only if there is no selected object // because it can corrupt selection of other objects - if ((myContext->NbCurrents() == 0) && (myContext->NbSelected() == 0)) { + if (myContext->NbSelected() == 0) { myContext->MainSelector()->RebuildSensitivesTree(myObj); myContext->MainSelector()->RebuildObjectsTree (false); } @@ -116,8 +119,10 @@ std::map SketcherPrs_SymbolPrs::myIconsM SketcherPrs_SymbolPrs::SketcherPrs_SymbolPrs(ModelAPI_Feature* theConstraint, - const std::shared_ptr& thePlane) - : AIS_InteractiveObject(), myConstraint(theConstraint), myPlane(thePlane), myIsCustomColor(false) + SketchPlugin_Sketch* theSketcher) + : AIS_InteractiveObject(), myConstraint(theConstraint), + myPlane(theSketcher->coordinatePlane()), myIsCustomColor(false), + mySketcher(theSketcher) { SetAutoHilight(Standard_False); } @@ -237,7 +242,7 @@ void SketcherPrs_SymbolPrs::HilightSelected(const Handle(PrsMgr_PresentationMana //********************************************************************************* void SketcherPrs_SymbolPrs::HilightOwnerWithColor( const Handle(PrsMgr_PresentationManager3d)& thePM, - const Handle(Graphic3d_HighlightStyle)& theStyle, + const Handle(Prs3d_Drawer)& theStyle, const Handle(SelectMgr_EntityOwner)& theOwner) { thePM->Color(this, theStyle); @@ -336,6 +341,18 @@ void SketcherPrs_SymbolPrs::SetCustomColor(const std::vector& theColor) if (!myAspect.IsNull()) myAspect->SetColor (myCustomColor); + + Handle(Prs3d_Presentation) aPrs = Presentation(); + if (!aPrs.IsNull()) { + if (myIsCustomColor) { + Handle(Graphic3d_PresentationAttributes) aAttr = new Graphic3d_PresentationAttributes(); + aAttr->SetColor(myCustomColor); + aPrs->Highlight(aAttr); + } + else { + aPrs->UnHighlight(); + } + } } //********************************************************************************* @@ -343,8 +360,6 @@ void SketcherPrs_SymbolPrs::drawShape(const std::shared_ptr& theS const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const { - int aColNam = theColor.Name(); - //cout<<"### SketcherPrs_SymbolPrs::drawShape "<