]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge branch 'master' of newgeom:newgeom.git
authorsbh <sergey.belash@opencascade.com>
Thu, 9 Oct 2014 10:15:11 +0000 (14:15 +0400)
committersbh <sergey.belash@opencascade.com>
Thu, 9 Oct 2014 10:15:11 +0000 (14:15 +0400)
20 files changed:
src/FeaturesPlugin/extrusion_widget.xml
src/GeomAPI/CMakeLists.txt
src/GeomAPI/GeomAPI_Wire.cpp [new file with mode: 0644]
src/GeomAPI/GeomAPI_Wire.h [new file with mode: 0644]
src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp
src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.h
src/ModuleBase/ModuleBase_Definitions.h
src/ModuleBase/ModuleBase_IWorkshop.h
src/ModuleBase/ModuleBase_Operation.cpp
src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp
src/ModuleBase/ModuleBase_WidgetShapeSelector.h
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_OperationSketch.cpp
src/PartSet/PartSet_OperationSketch.h
src/SketchPlugin/SketchPlugin_Sketch.cpp
src/SketchSolver/SketchSolver_ConstraintGroup.cpp
src/SketchSolver/SketchSolver_ConstraintGroup.h
src/XGUI/XGUI_ModuleConnector.cpp
src/XGUI/XGUI_ModuleConnector.h
src/XGUI/XGUI_ViewerFilters.cpp

index 0bcf41643e799e782f2f921cafcf460e4f5748cc..426bb3fd592e17d2af551090f2da9f80a9f7655e 100644 (file)
@@ -4,7 +4,8 @@
     icon=":icons/sketch.png" 
     tooltip="Select a face for extrusion"
     activate="true"
-    shape_types="face"
+    shape_types="face wire"
+    use_subshapes="true"
   />
   <doublevalue id="extrusion_size" label="Size" min="0" step="1.0" default="0" icon=":icons/dimension_v.png" tooltip="Set size of extrusion">
     <validator id="GeomValidators_Positive"/>
index e5cad12b1a677fb3172fe5ec2dc3978b0d2ada86..f2e238051b1a78c16b33e8323d27f0078dd2acaa 100644 (file)
@@ -19,6 +19,7 @@ SET(PROJECT_HEADERS
     GeomAPI_Pln.h
     GeomAPI_Shape.h
     GeomAPI_Edge.h
+    GeomAPI_Wire.h
     GeomAPI_AISObject.h
     GeomAPI_IPresentable.h
     GeomAPI_Curve.h 
@@ -39,6 +40,7 @@ SET(PROJECT_SOURCES
     GeomAPI_Pln.cpp
     GeomAPI_Shape.cpp
     GeomAPI_Edge.cpp
+    GeomAPI_Wire.cpp
     GeomAPI_AISObject.cpp
     GeomAPI_Curve.cpp
 )
diff --git a/src/GeomAPI/GeomAPI_Wire.cpp b/src/GeomAPI/GeomAPI_Wire.cpp
new file mode 100644 (file)
index 0000000..6932444
--- /dev/null
@@ -0,0 +1,48 @@
+// File:        GeomAPI_Wire.cpp
+// Created:     06 Oct 2014
+// Author:      Sergey BELASH
+
+#include <GeomAPI_Interface.h>
+#include <GeomAPI_Wire.h>
+
+#include <Standard_TypeDef.hxx>
+#include <TopAbs_ShapeEnum.hxx>
+
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Wire.hxx>
+#include <BRep_Builder.hxx>
+#include <BRepTools_WireExplorer.hxx>
+
+#include <list>
+
+GeomAPI_Wire::GeomAPI_Wire() : GeomAPI_Shape()
+{
+  TopoDS_Compound aBigWireImpl;
+  BRep_Builder aBuilder;
+  aBuilder.MakeCompound(aBigWireImpl);
+  this->setImpl(new TopoDS_Shape(aBigWireImpl));
+}
+
+void GeomAPI_Wire::addEdge(boost::shared_ptr<GeomAPI_Shape> theEdge)
+{
+  const TopoDS_Edge& anEdge = theEdge->impl<TopoDS_Edge>();
+  if (anEdge.ShapeType() != TopAbs_EDGE)
+    return;
+  TopoDS_Shape& aWire = const_cast<TopoDS_Shape&>(impl<TopoDS_Shape>());
+  BRep_Builder aBuilder;
+  aBuilder.Add(aWire, anEdge);
+}
+
+std::list<boost::shared_ptr<GeomAPI_Shape> > GeomAPI_Wire::getEdges()
+{
+  TopoDS_Shape& aShape = const_cast<TopoDS_Shape&>(impl<TopoDS_Shape>());
+  BRepTools_WireExplorer aWireExp(TopoDS::Wire(aShape));
+  std::list<boost::shared_ptr<GeomAPI_Shape> > aResult;
+  for (; aWireExp.More(); aWireExp.Next()) {
+    boost::shared_ptr<GeomAPI_Shape> anEdge(new GeomAPI_Shape);
+    anEdge->setImpl(new TopoDS_Shape(aWireExp.Current()));
+    aResult.push_back(anEdge);
+  }
+  return aResult;
+}
diff --git a/src/GeomAPI/GeomAPI_Wire.h b/src/GeomAPI/GeomAPI_Wire.h
new file mode 100644 (file)
index 0000000..de849ef
--- /dev/null
@@ -0,0 +1,43 @@
+// File:        GeomAPI_Wire.hxx
+// Created:     24 Jul 2014
+// Author:      Artem ZHIDKOV
+
+#ifndef GEOMAPI_WIRE_H_
+#define GEOMAPI_WIRE_H_
+
+#include <GeomAPI.h>
+#include <GeomAPI_Edge.h>
+
+#include <boost/smart_ptr/shared_ptr.hpp>
+
+#include <list>
+
+/**\class GeomAPI_Wire
+ * \ingroup DataModel
+ * \brief Interface to the edge object
+ */
+
+class GEOMAPI_EXPORT GeomAPI_Wire : public GeomAPI_Shape
+{
+ public:
+  /// Creation of empty (null) shape
+  GeomAPI_Wire();
+
+  virtual bool isVertex() const
+  {
+    return false;
+  }
+
+  /// Returns whether the shape is an edge
+  virtual bool isEdge() const
+  {
+    return false;
+  }
+
+  void addEdge(boost::shared_ptr<GeomAPI_Shape> theEdge);
+  std::list<boost::shared_ptr<GeomAPI_Shape> > getEdges();
+
+};
+
+#endif
+
index 20c3211ee1e402dd44cdbeeb20663c3d66e79874..0d0fc34183ce5cdb61dcc341e98ccc075a8915f3 100644 (file)
@@ -3,6 +3,7 @@
 // Author:      Artem ZHIDKOV
 
 #include <GeomAlgoAPI_SketchBuilder.h>
+#include <GeomAPI_Wire.h>
 
 #include <set>
 
@@ -370,6 +371,23 @@ void GeomAlgoAPI_SketchBuilder::createFaces(
     fixIntersections(theResultFaces);
 }
 
+void GeomAlgoAPI_SketchBuilder::createFaces(const boost::shared_ptr<GeomAPI_Pnt>& theOrigin,
+                                            const boost::shared_ptr<GeomAPI_Dir>& theDirX,
+                                            const boost::shared_ptr<GeomAPI_Dir>& theDirY,
+                                            const boost::shared_ptr<GeomAPI_Dir>& theNorm,
+                                            const boost::shared_ptr<GeomAPI_Shape>& theWire,
+                                            std::list<boost::shared_ptr<GeomAPI_Shape> >& theResultFaces)
+{
+  boost::shared_ptr<GeomAPI_Wire> aWire = boost::dynamic_pointer_cast<GeomAPI_Wire>(theWire);
+  if(!aWire)
+    return;
+  // Filter wires, return only faces.
+  std::list<boost::shared_ptr<GeomAPI_Shape> > aFilteredWires;
+  createFaces(theOrigin, theDirX, theDirY, theNorm,
+              aWire->getEdges(), theResultFaces, aFilteredWires);
+}
+
+
 void GeomAlgoAPI_SketchBuilder::fixIntersections(
     std::list<boost::shared_ptr<GeomAPI_Shape> >& theFaces)
 {
index 22eafe77ef05252485c8b63d52b0f5d6c8f68cbd..86505f82dbb8fd94299b51d443113656e7b9278d 100644 (file)
@@ -42,6 +42,25 @@ class GEOMALGOAPI_EXPORT GeomAlgoAPI_SketchBuilder
                           std::list<boost::shared_ptr<GeomAPI_Shape> >& theResultFaces,
                           std::list<boost::shared_ptr<GeomAPI_Shape> >& theResultWires);
 
+  /** \brief Creates list of faces and unclosed wires on basis of the features of the sketch
+   *  \param[in]  theOrigin      origin point of the sketch
+   *  \param[in]  theDirX        x-direction of the sketch
+   *  \param[in]  theDirY        y-direction of the sketch
+   *  \param[in]  theNorm        normal of the sketch
+   *  \param[in]  theWire        a wire which contains all edges
+   *  \param[out] theResultFaces faces based on closed wires
+   *
+   *  The algorithm searches all loops of edges surrounding lesser squares.
+   *  It finds the vertex with minimal coordinates along X axis (theDirX) and then
+   *  goes through the edges passing the surrounding area on the left.
+   */
+  static void createFaces(const boost::shared_ptr<GeomAPI_Pnt>& theOrigin,
+                          const boost::shared_ptr<GeomAPI_Dir>& theDirX,
+                          const boost::shared_ptr<GeomAPI_Dir>& theDirY,
+                          const boost::shared_ptr<GeomAPI_Dir>& theNorm,
+                          const boost::shared_ptr<GeomAPI_Shape>& theWire,
+                          std::list<boost::shared_ptr<GeomAPI_Shape> >& theResultFaces);
+
   /** \brief Searches intersections between the faces in the list 
    *         and make holes in the faces to avoid intersections
    *  \param[in,out] theFaces list of faces to proccess
index 56049acec437d3ace6a27f5c9922e9c4edcf9629..926de63ca9fb4a83dc85f9403c747bdecc31abe0 100644 (file)
@@ -10,5 +10,4 @@ typedef QList<short> QShortList;     //!< list of short int values
 typedef QList<double> QDoubleList;    //!< list of double values
 typedef QList<FeaturePtr> QFeatureList;  //!< List of features
 typedef QList<ResultPtr> QResultList;  //!< List of results
-
 #endif
index d4b9265ca1868233629abd8744451fc8eced7f5d..700f2baecbaf66e5006740ec6f939b3f8684896f 100644 (file)
@@ -6,6 +6,7 @@
 #define ModuleBase_IWorkshop_H
 
 #include "ModuleBase.h"
+#include "ModuleBase_Definitions.h"
 
 #include <ModelAPI_Object.h>
 
@@ -32,6 +33,13 @@ Q_OBJECT
 
   virtual ModuleBase_ISelection* selection() const = 0;
 
+  /// Activate sub-shapes selection (opens local context)
+  /// Types has to be dined according to TopAbs_ShapeEnum
+  virtual void activateSubShapesSelection(const QIntList& theTypes) = 0;
+
+  /// Deactivate sub-shapes selection (closes local context)
+  virtual void deactivateSubShapesSelection() = 0;
+
   //! Returns instance of loaded module
   virtual ModuleBase_IModule* module() const = 0;
 
index d8f50a4cd51e1a94f8d264df51c001741676dae5..d55bdc3f0e54ef8dcc5ccacb6158db8f1aa0fb43 100644 (file)
@@ -210,8 +210,8 @@ bool ModuleBase_Operation::commit()
     disconnect(myPropertyPanel, 0, this, 0);
 
     stopOperation();
-
     ModelAPI_Session::get()->finishOperation();
+
     emit stopped();
 
     afterCommitOperation();
index c800f9a7d4f5b8511647cd22207ab90cec35e069..b73adf626a29fbfcf45c646e20823f2f5fdd9b63 100644 (file)
@@ -60,7 +60,7 @@ ModuleBase_WidgetShapeSelector::ModuleBase_WidgetShapeSelector(QWidget* theParen
                                                      const Config_WidgetAPI* theData,
                                                      const std::string& theParentId)
     : ModuleBase_ModelWidget(theParent, theData, theParentId),
-      myWorkshop(theWorkshop), myIsActive(false)
+      myWorkshop(theWorkshop), myIsActive(false), myUseSubShapes(false)
 {
   myContainer = new QWidget(theParent);
   QHBoxLayout* aLayout = new QHBoxLayout(myContainer);
@@ -89,6 +89,12 @@ ModuleBase_WidgetShapeSelector::ModuleBase_WidgetShapeSelector(QWidget* theParen
 
   std::string aTypes = theData->getProperty("shape_types");
   myShapeTypes = QString(aTypes.c_str()).split(' ');
+
+  std::string aUseSubShapes = theData->getProperty("use_subshapes");
+  if (aUseSubShapes.length() > 0) {
+    QString aVal(aUseSubShapes.c_str());
+    myUseSubShapes = (aVal.toUpper() == "TRUE");
+  }
 }
 
 //********************************************************************
@@ -251,10 +257,19 @@ void ModuleBase_WidgetShapeSelector::activateSelection(bool toActivate)
     myTextLine->setPalette(myInactivePalet);
   updateSelectionName();
 
-  if (myIsActive)
+  if (myIsActive) {
     connect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
-  else
+    if (myUseSubShapes) {
+      QIntList aList;
+      foreach (QString aType, myShapeTypes)
+        aList.append(shapeType(aType));
+      myWorkshop->activateSubShapesSelection(aList);
+    }
+  } else {
     disconnect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
+    if (myUseSubShapes) 
+      myWorkshop->deactivateSubShapesSelection();
+  }
 }
 
 //********************************************************************
index 7446122705d4af04dddb8dc2c8fc460cd363a11d..aa79150bfa3152375b4e6aa08d1b40b871376fab 100644 (file)
@@ -91,6 +91,9 @@ private:
   ObjectPtr mySelectedObject;
   QStringList myShapeTypes;
 
+  /// If true then local selector has to be activated in context
+  bool myUseSubShapes;
+
   QPalette myBasePalet;
   QPalette myInactivePalet;
 
index 0232196f9d608f3d439ff197151e2185fecdcf54..3ada0450be9e24064d97904d6dde6157ea05cdca 100644 (file)
@@ -155,6 +155,7 @@ void PartSet_Module::onOperationStarted(ModuleBase_Operation* theOperation)
     aDisplayer->deactivateObjectsOutOfContext();
   } else {
     Handle(AIS_InteractiveContext) aAIS = xWorkshop()->viewer()->AISContext();
+    //TODO (VSV): We have to open Local context because at neutral point filters don't work (bug 25340)
     aAIS->AddFilter(myDocumentShapeFilter);
   }
 }
index fdb56312b0aa0462f86fa5f147e7ca7bb8f349b4..2c8426c0485e87dc9773f95bcc251b417ecf18ea 100644 (file)
@@ -155,7 +155,10 @@ void PartSet_OperationSketch::stopOperation()
   PartSet_OperationSketchBase::stopOperation();
   emit featureConstructed(feature(), FM_Hide);
   emit closeLocalContext();
+}
 
+void PartSet_OperationSketch::afterCommitOperation()
+{
   FeaturePtr aFeature = feature();
   std::list<ResultPtr> aResults = aFeature->results();
   std::list<ResultPtr>::const_iterator aIt;
index 94ddf02d91e173e034c2eedb3edc0354be737454..f885503e308e0c81013b4a1541381540ffefdf8c 100644 (file)
@@ -112,6 +112,9 @@ signals:
   /// Default impl calls corresponding slot and commits immediately.
   virtual void startOperation();
 
+  /// Virtual method called after operation committed (see commit() method for more description)
+  virtual void afterCommitOperation();
+
  private:
   std::list<ModuleBase_ViewerPrs> myFeatures;  ///< the features to apply the edit operation
 };
index 1bc1b469cce3187af65006bbb02a5aa1cbbf868e..0bbcfe2a76969e396527c3ff6a184ea247fe0a00 100644 (file)
@@ -2,19 +2,31 @@
 // Created:     27 Mar 2014
 // Author:      Mikhail PONIKAROV
 
-#include "SketchPlugin_Sketch.h"
-#include <ModelAPI_Data.h>
-#include <ModelAPI_AttributeRefList.h>
+#include <Config_PropManager.h>
+
+#include <GeomAlgoAPI_CompoundBuilder.h>
+#include <GeomAlgoAPI_FaceBuilder.h>
+
 #include <GeomAPI_AISObject.h>
+#include <GeomAPI_Dir.h>
+#include <GeomAPI_Wire.h>
 #include <GeomAPI_XYZ.h>
+
 #include <GeomDataAPI_Dir.h>
 #include <GeomDataAPI_Point.h>
-#include <GeomAlgoAPI_FaceBuilder.h>
-#include <GeomAlgoAPI_CompoundBuilder.h>
-#include <GeomAlgoAPI_SketchBuilder.h>
+
+#include <ModelAPI_AttributeRefList.h>
+#include <ModelAPI_Data.h>
+#include <ModelAPI_Document.h>
+#include <ModelAPI_Feature.h>
+#include <ModelAPI_Object.h>
 #include <ModelAPI_ResultConstruction.h>
 
-#include <Config_PropManager.h>
+#include <SketchPlugin_Sketch.h>
+
+#include <boost/smart_ptr/shared_ptr.hpp>
+
+#include <vector>
 
 using namespace std;
 
@@ -74,15 +86,17 @@ void SketchPlugin_Sketch::execute()
 
   if (aFeaturesPreview.empty())
     return;
-  std::list<boost::shared_ptr<GeomAPI_Shape> > aLoops;
-  std::list<boost::shared_ptr<GeomAPI_Shape> > aWires;
-  GeomAlgoAPI_SketchBuilder::createFaces(anOrigin->pnt(), aDirX->dir(), aDirY->dir(), aNorm->dir(),
-                                         aFeaturesPreview, aLoops, aWires);
 
-  aLoops.insert(aLoops.end(), aWires.begin(), aWires.end());
-  boost::shared_ptr<GeomAPI_Shape> aCompound = GeomAlgoAPI_CompoundBuilder::compound(aLoops);
+  // Collect all edges as one big wire
+  boost::shared_ptr<GeomAPI_Wire> aBigWire(new GeomAPI_Wire);
+  std::list<boost::shared_ptr<GeomAPI_Shape> >::const_iterator aShapeIt = aFeaturesPreview.begin();
+  for (; aShapeIt != aFeaturesPreview.end(); ++aShapeIt) {
+    aBigWire->addEdge(*aShapeIt);
+  }
+//  GeomAlgoAPI_SketchBuilder::createFaces(anOrigin->pnt(), aDirX->dir(), aDirY->dir(), aNorm->dir(),
+//                                         aFeaturesPreview, aLoops, aWires);
   boost::shared_ptr<ModelAPI_ResultConstruction> aConstr = document()->createConstruction(data());
-  aConstr->setShape(aCompound);
+  aConstr->setShape(aBigWire);
   setResult(aConstr);
 }
 
index a7bffde09597e83ccf5f2528bc5dc4c0c5e41028..53461bb5df161163821a7fd07c77141e89b14ef5 100644 (file)
@@ -79,10 +79,7 @@ SketchSolver_ConstraintGroup::SketchSolver_ConstraintGroup(
   myEntities.clear();
   myEntOfConstr.clear();
   myConstraints.clear();
-
   myTempConstraints.clear();
-  myTempPointWhereDragged.clear();
-  myTempPointWDrgdID = 0;
 
   // Initialize workplane
   myWorkplane.h = SLVS_E_UNKNOWN;
@@ -101,7 +98,6 @@ SketchSolver_ConstraintGroup::~SketchSolver_ConstraintGroup()
   myConstraints.clear();
   myConstraintMap.clear();
   myTempConstraints.clear();
-  myTempPointWhereDragged.clear();
 
   // If the group with maximal identifier is deleted, decrease the indexer
   if (myID == myGroupIndexer)
@@ -397,23 +393,26 @@ Slvs_hEntity SketchSolver_ConstraintGroup::changeEntity(
   }
   /// \todo Other types of entities
 
+  Slvs_hEntity aResult = SLVS_E_UNKNOWN; // Unsupported or wrong entity type
+
   if (isEntExists) {
     if (!myEntOfConstr[aEntPos]) // the entity is not used by constraints, no need to resolve them
       myNeedToSolve = isNeedToSolve;
     else
       myNeedToSolve = myNeedToSolve || isNeedToSolve;
-    return aEntIter->second;
-  }
-
-  if (aNewEntity.h != SLVS_E_UNKNOWN) {
+    aResult = aEntIter->second;
+  } else if (aNewEntity.h != SLVS_E_UNKNOWN) {
     myEntities.push_back(aNewEntity);
     myEntOfConstr.push_back(false);
     myEntityAttrMap[theEntity] = aNewEntity.h;
-    return aNewEntity.h;
+    aResult = aNewEntity.h;
   }
 
-  // Unsupported or wrong entity type
-  return SLVS_E_UNKNOWN;
+  // If the attribute was changed by the user, we need to fix it before solving
+  if (myNeedToSolve && theEntity->isImmutable())
+    addTemporaryConstraintWhereDragged(theEntity);
+
+  return aResult;
 }
 
 // ============================================================================
@@ -648,7 +647,6 @@ bool SketchSolver_ConstraintGroup::resolveConstraints()
   myConstrSolver.setParameters(myParams);
   myConstrSolver.setEntities(myEntities);
   myConstrSolver.setConstraints(myConstraints);
-  myConstrSolver.setDraggedParameters(myTempPointWhereDragged);
 
   int aResult = myConstrSolver.solve();
   if (aResult == SLVS_RESULT_OKAY) {  // solution succeeded, store results into correspondent attributes
@@ -700,18 +698,6 @@ void SketchSolver_ConstraintGroup::mergeGroups(const SketchSolver_ConstraintGrou
       myTempConstraints.push_back(aFind->second);
   }
 
-  if (myTempPointWhereDragged.empty())
-    myTempPointWhereDragged = theGroup.myTempPointWhereDragged;
-  else if (!theGroup.myTempPointWhereDragged.empty()) {  // Need to create additional transient constraint
-    std::map<boost::shared_ptr<ModelAPI_Attribute>, Slvs_hEntity>::const_iterator aFeatureIter =
-        theGroup.myEntityAttrMap.begin();
-    for (; aFeatureIter != theGroup.myEntityAttrMap.end(); aFeatureIter++)
-      if (aFeatureIter->second == myTempPointWDrgdID) {
-        addTemporaryConstraintWhereDragged(aFeatureIter->first);
-        break;
-      }
-  }
-
   myNeedToSolve = myNeedToSolve || theGroup.myNeedToSolve;
 }
 
@@ -1015,21 +1001,8 @@ void SketchSolver_ConstraintGroup::addTemporaryConstraintWhereDragged(
   if (anEntIter == myEntityAttrMap.end())
     return;
 
-  // If this is a first dragged point, its parameters should be placed 
-  // into Slvs_System::dragged field to avoid system inconsistense
-  if (myTempPointWhereDragged.empty()) {
-    int anEntPos = Search(anEntIter->second, myEntities);
-    Slvs_hParam* aDraggedParam = myEntities[anEntPos].param;
-    for (int i = 0; i < 4; i++, aDraggedParam++)
-      if (*aDraggedParam != 0)
-        myTempPointWhereDragged.push_back(*aDraggedParam);
-    myTempPointWDrgdID = myEntities[anEntPos].h;
-    return;
-  }
-
   // Get identifiers of all dragged points
   std::set<Slvs_hEntity> aDraggedPntID;
-  aDraggedPntID.insert(myTempPointWDrgdID);
   std::list<Slvs_hConstraint>::iterator aTmpCoIter = myTempConstraints.begin();
   for (; aTmpCoIter != myTempConstraints.end(); aTmpCoIter++) {
     unsigned int aConstrPos = Search(*aTmpCoIter, myConstraints);
@@ -1077,9 +1050,6 @@ void SketchSolver_ConstraintGroup::removeTemporaryConstraints()
       myConstrMaxID--;
   }
   myTempConstraints.clear();
-
-  // Clear basic dragged point
-  myTempPointWhereDragged.clear();
 }
 
 // ============================================================================
index 6024f8caecab8cebac7dd567d8d2ccb312531838..f6f450f26a2c89b6a1aee57a3e612937b52a4249 100644 (file)
@@ -209,8 +209,6 @@ protected:
 
   SketchSolver_Solver myConstrSolver;  ///< Solver for set of equations obtained by constraints
 
-  std::vector<Slvs_hParam> myTempPointWhereDragged;  ///< Parameters of one of the points which is moved by user
-  Slvs_hEntity myTempPointWDrgdID;      ///< Identifier of such point
   std::list<Slvs_hConstraint> myTempConstraints;  ///< The list of identifiers of temporary constraints (SLVS_C_WHERE_DRAGGED) applied for all other points moved by user
 
   // SketchPlugin entities
index 4c36e61d17bc916dd5ea553bbdce976d4f074841..aecada78b636372148cee115f97b7caae6ce0f53 100644 (file)
@@ -47,3 +47,19 @@ ModuleBase_Operation* XGUI_ModuleConnector::currentOperation() const
 {
   return myWorkshop->operationMgr()->currentOperation();
 }
+
+
+void XGUI_ModuleConnector::activateSubShapesSelection(const QIntList& theTypes)
+{
+  Handle(AIS_InteractiveContext) aAIS = myWorkshop->viewer()->AISContext();
+  if (!aAIS->HasOpenedContext())
+    aAIS->OpenLocalContext();
+  foreach(int aType, theTypes)
+    aAIS->ActivateStandardMode((TopAbs_ShapeEnum)aType);
+}
+
+void XGUI_ModuleConnector::deactivateSubShapesSelection()
+{
+  Handle(AIS_InteractiveContext) aAIS = myWorkshop->viewer()->AISContext();
+  aAIS->CloseAllContexts();
+}
index c78c1d82a20ea8353cb79a3321b35e62261de3b7..054ad0872e5db2944c72c4c2cf2f89dd3873922b 100644 (file)
@@ -27,6 +27,13 @@ Q_OBJECT
   //! Returns list of currently selected data objects
   virtual ModuleBase_ISelection* selection() const;
 
+  /// Activate sub-shapes selection (opens local context if it was not opened)
+  /// Types has to be dined according to TopAbs_ShapeEnum
+  virtual void activateSubShapesSelection(const QIntList& theTypes);
+
+  /// Deactivate sub-shapes selection (closes local context)
+  virtual void deactivateSubShapesSelection();
+
   //! Returns instance of loaded module
   virtual ModuleBase_IModule* module() const;
 
index c99c5bbfc2d51507c42fc6c7f0f9298325f2dd73..6efd9143e2d7da816ddb789c4b7859e4a617671a 100644 (file)
@@ -15,7 +15,7 @@ IMPLEMENT_STANDARD_HANDLE(XGUI_ShapeDocumentFilter, SelectMgr_Filter);
 IMPLEMENT_STANDARD_RTTIEXT(XGUI_ShapeDocumentFilter, SelectMgr_Filter);
 
 
-//TODO (VSV): Check bug in OCCT: Filter result is ignored
+//TODO (VSV): Check bug in OCCT: Filter result is ignored (bug25340)
 Standard_Boolean XGUI_ShapeDocumentFilter::IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const
 {
   if (theOwner->HasSelectable()) {