Salome HOME
Merge branch 'master' of newgeom:newgeom
authorvsv <vitaly.smetannikov@opencascade.com>
Thu, 26 Jun 2014 13:23:56 +0000 (17:23 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Thu, 26 Jun 2014 13:23:56 +0000 (17:23 +0400)
1  2 
src/PartSet/PartSet_Module.cpp

index d9009a68fefe1778c5c7f103df79899ededad5a5,2e410b5004e723c3f8939230c68020536cd0e098..206bbaa5baf315cbcc56ceeb352745f6bb5f6a7a
@@@ -138,14 -138,14 +138,14 @@@ void PartSet_Module::onFeatureTriggered
  void PartSet_Module::launchOperation(const QString& theCmdId)
  {
    ModuleBase_Operation* anOperation = createOperation(theCmdId.toStdString());
 -  //PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
 -  //if (aPreviewOp) {
 -  //  XGUI_Displayer* aDisplayer = myWorkshop->displayer();
 -  //  // Initialise operation with preliminary selection
 -  //  std::list<XGUI_ViewerPrs> aSelected = aDisplayer->getSelected();
 -  //  std::list<XGUI_ViewerPrs> aHighlighted = aDisplayer->getHighlighted();
 -  //  aPreviewOp->initSelection(aSelected, aHighlighted);
 -  //
 +  PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
 +  if (aPreviewOp) {
 +    XGUI_Displayer* aDisplayer = myWorkshop->displayer();
 +    // Initialise operation with preliminary selection
 +    std::list<XGUI_ViewerPrs> aSelected = aDisplayer->getSelected();
 +    std::list<XGUI_ViewerPrs> aHighlighted = aDisplayer->getHighlighted();
 +    aPreviewOp->initSelection(aSelected, aHighlighted);
 +  } 
    sendOperation(anOperation);
  }
  
@@@ -317,16 -317,14 +317,14 @@@ void PartSet_Module::onFeatureConstruct
      FeaturePtr aSketch;
      PartSet_OperationSketchBase* aPrevOp = dynamic_cast<PartSet_OperationSketchBase*>(aCurOperation);
      if (aPrevOp) {
-       std::map<FeaturePtr, boost::shared_ptr<GeomAPI_Shape> > aList = aPrevOp->subPreview();
+       std::list<FeaturePtr> aList = aPrevOp->subFeatures();
        XGUI_Displayer* aDisplayer = myWorkshop->displayer();
        std::list<int> aModes = aPrevOp->getSelectionModes(aPrevOp->feature());
  
-       std::map<FeaturePtr, boost::shared_ptr<GeomAPI_Shape> >::const_iterator
-                                                              anIt = aList.begin(), aLast = aList.end();
-       for (; anIt != aLast; anIt++) {
-         FeaturePtr aFeature = (*anIt).first;
-         visualizePreview(aFeature, false, false);
-       }
+       std::list<FeaturePtr>::const_iterator anIt = aList.begin(),
+                                             aLast = aList.end();
+       for (; anIt != aLast; anIt++)
+         visualizePreview(*anIt, false, false);
        aDisplayer->updateViewer();
      }
    }
@@@ -477,23 -475,19 +475,19 @@@ void PartSet_Module::updateCurrentPrevi
    if (!aFeature || aFeature->getKind() != theCmdId)
      return;
  
-   std::map<FeaturePtr, boost::shared_ptr<GeomAPI_Shape> > aList = aPreviewOp->subPreview();
+   std::list<FeaturePtr> aList = aPreviewOp->subFeatures();
    XGUI_Displayer* aDisplayer = myWorkshop->displayer();
    std::list<int> aModes = aPreviewOp->getSelectionModes(aPreviewOp->feature());
  
-   std::map<FeaturePtr, boost::shared_ptr<GeomAPI_Shape> >::const_iterator
-                                                          anIt = aList.begin(), aLast = aList.end();
+   std::list<FeaturePtr>::const_iterator anIt = aList.begin(), 
+                                         aLast = aList.end();
    for (; anIt != aLast; anIt++) {
-     FeaturePtr aFeature = (*anIt).first;
      boost::shared_ptr<SketchPlugin_Feature> aSPFeature = 
-       boost::dynamic_pointer_cast<SketchPlugin_Feature>((*anIt).first);
+       boost::dynamic_pointer_cast<SketchPlugin_Feature>(*anIt);
      if (!aSPFeature)
        continue;
-     Handle(AIS_InteractiveObject) anAIS = aSPFeature->getAISShape(aDisplayer->getAISObject(aFeature));
-     if (!anAIS.IsNull())
-       aDisplayer->redisplay(aFeature, anAIS, false);
-     aDisplayer->activateInLocalContext(aFeature, aModes, false);
+     visualizePreview(*anIt, true, false);
+     aDisplayer->activateInLocalContext(*anIt, aModes, false);
    }
    aDisplayer->updateViewer();
  }