From c8267b77ef90089e10d178b1192c542c013de309 Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 5 Jun 2015 18:27:23 +0300 Subject: [PATCH] Provide selection for symbol constraints --- .../ModuleBase_WidgetMultiSelector.cpp | 3 +-- src/SketcherPrs/SketcherPrs_SymbolPrs.cpp | 20 +++++++++++++++++-- src/SketcherPrs/SketcherPrs_SymbolPrs.h | 2 ++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp index 755d74c59..59f10daf7 100644 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp @@ -68,8 +68,7 @@ ModuleBase_WidgetMultiSelector::ModuleBase_WidgetMultiSelector(QWidget* theParen myTypeCombo->setVisible(false); } -// Modification for specification of 1.3.0 - std::string aLabelText = "";//theData->getProperty("label"); + std::string aLabelText = theData->getProperty("label"); QLabel* aListLabel = new QLabel(!aLabelText.empty() ? aLabelText.c_str() : tr("Selected objects:"), this); aMainLay->addWidget(aListLabel, 1, 0); diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp index 48f43896a..4d160d1ec 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp @@ -444,8 +444,11 @@ void SketcherPrs_SymbolPrs::Render(const Handle(OpenGl_Workspace)& theWorkspace) // Update selection position only if there is no selected object // because it can corrupt selection of other objects - //if ((GetContext()->NbCurrents() == 0) && (GetContext()->NbSelected() == 0)) - // GetContext()->RecomputeSelectionOnly(this); + if ((GetContext()->NbCurrents() == 0) && (GetContext()->NbSelected() == 0)) + { + GetContext()->MainSelector()->RebuildSensitivesTree (this); + GetContext()->MainSelector()->RebuildObjectsTree (false); + } } @@ -497,3 +500,16 @@ void SketcherPrs_SymbolPrs::drawListOfShapes(const std::shared_ptrBoundingBox()); + } + + theBndBox.Update (aTmpBox.CornerMin().x(), aTmpBox.CornerMin().y(), aTmpBox.CornerMin().z(), + aTmpBox.CornerMax().x(), aTmpBox.CornerMax().y(), aTmpBox.CornerMax().z()); +} + diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.h b/src/SketcherPrs/SketcherPrs_SymbolPrs.h index d03bb437b..31fb15e5e 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.h +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.h @@ -75,6 +75,8 @@ public: /// \param theContext is an OpenGL context void Release (OpenGl_Context* theContext); + Standard_EXPORT virtual void BoundingBox (Bnd_Box& theBndBox) Standard_OVERRIDE; + DEFINE_STANDARD_RTTI(SketcherPrs_SymbolPrs) protected: -- 2.39.2