]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Provide selection for symbol constraints
authorvsv <vitaly.smetannikov@opencascade.com>
Fri, 5 Jun 2015 15:27:23 +0000 (18:27 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Fri, 5 Jun 2015 15:28:13 +0000 (18:28 +0300)
src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp
src/SketcherPrs/SketcherPrs_SymbolPrs.cpp
src/SketcherPrs/SketcherPrs_SymbolPrs.h

index 755d74c59217940d963bcbfe16987332b829acb5..59f10daf73db3713be30b202d29b58cb3fbe6b60 100644 (file)
@@ -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);
index 48f43896a1293fe9a3e3549fd93c3db7b021e74f..4d160d1ecdf6d603f8e99e4df2e431e6203c8090 100644 (file)
@@ -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_ptr<ModelAPI_Attr
   }
 }
 
+void SketcherPrs_SymbolPrs::BoundingBox (Bnd_Box& theBndBox)
+{
+  Select3D_BndBox3d aTmpBox;
+  for (Select3D_EntitySequenceIter aPntIter (mySPoints); aPntIter.More(); aPntIter.Next())
+  {
+    const Handle(Select3D_SensitiveEntity)& anEnt = aPntIter.Value();
+    aTmpBox.Combine (anEnt->BoundingBox());
+  }
+
+  theBndBox.Update (aTmpBox.CornerMin().x(), aTmpBox.CornerMin().y(), aTmpBox.CornerMin().z(),
+                    aTmpBox.CornerMax().x(), aTmpBox.CornerMax().y(), aTmpBox.CornerMax().z());
+}
+
index d03bb437bf8ab04024079e349cc91f078214c786..31fb15e5e63edf96a3a22e26ec18833aeb9805ef 100644 (file)
@@ -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: