]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/PartSet/PartSet_TestOCC.cpp
Salome HOME
Merge branch 'master' of newgeom:newgeom.git
[modules/shaper.git] / src / PartSet / PartSet_TestOCC.cpp
index aaa3c3c590a9b777ce65361c8e9571c080bf216e..df5567aee9e6ffc55b1d4dd64b3d3cc4678ead72 100644 (file)
@@ -18,7 +18,7 @@
 #include <ModelAPI_Document.h>
 
 static double myTestDelta;
-static FeaturePtr myTestFeature;
+static ResultPtr myTestObject;
 
 #include <AIS_InteractiveContext.hxx>
 #include <AIS_Shape.hxx>
@@ -31,13 +31,13 @@ static FeaturePtr myTestFeature;
 
 void PartSet_TestOCC::testSelection(XGUI_Workshop* theWorkshop)
 {
-  if (!myTestFeature) {
+  if (!myTestObject) {
     PartSet_TestOCC::createTestLine(theWorkshop);
     PartSet_TestOCC::moveMouse(theWorkshop->viewer()->AISContext(),
                                theWorkshop->viewer()->activeView());
     PartSet_TestOCC::changeTestLine(theWorkshop);
   }
-  boost::shared_ptr<GeomAPI_AISObject> anIO = theWorkshop->displayer()->getAISObject(myTestFeature);
+  boost::shared_ptr<GeomAPI_AISObject> anIO = theWorkshop->displayer()->getAISObject(myTestObject);
   if (!anIO->empty()) {
     theWorkshop->viewer()->AISContext()->MoveTo(0, 0, theWorkshop->viewer()->activeView());
     theWorkshop->viewer()->AISContext()->Select(0, 0, 2500, 2500, theWorkshop->viewer()->activeView());
@@ -152,12 +152,12 @@ void PartSet_TestOCC::createTestLine(XGUI_Workshop* theWorkshop)
       boost::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
     boost::shared_ptr<GeomAPI_AISObject> anAIS = aSPFeature->getAISObject(aPrevAIS);
     if (!anAIS->empty())
-      aDisplayer->redisplay(aFeature, anAIS, false);
+      aDisplayer->redisplay(aFeature->firstResult(), anAIS, false);
 
     std::list<int> aModes;
     aModes.push_back(TopAbs_VERTEX);
     aModes.push_back(TopAbs_EDGE);
-    aDisplayer->activateInLocalContext(aFeature, aModes, true);
+    aDisplayer->activateInLocalContext(aFeature->firstResult(), aModes, true);
 
     // change the line
     /*double aDelta = -200;
@@ -182,10 +182,10 @@ void PartSet_TestOCC::createTestLine(XGUI_Workshop* theWorkshop)
     //aModes.push_back(TopAbs_VERTEX);
     //aModes.push_back(TopAbs_EDGE);
     //aDisplayer->activateInLocalContext(aFeature, aModes, true);
-    myTestFeature = aFeature;
+    myTestObject = aFeature->firstResult();
 
-    QFeatureList aFeatureList;
-    aFeatureList.append(myTestFeature);
+    QResultList aFeatureList;
+    aFeatureList.append(myTestObject);
     aDisplayer->setSelected(aFeatureList, true);
   }
 }
@@ -193,15 +193,16 @@ void PartSet_TestOCC::createTestLine(XGUI_Workshop* theWorkshop)
 void PartSet_TestOCC::changeTestLine(XGUI_Workshop* theWorkshop)
 {
   // change the line
-  if (!myTestFeature)
+  if (!myTestObject)
     return;
-  FeaturePtr aFeature = myTestFeature;
+  ResultPtr aFeature = myTestObject;
 
   myTestDelta = myTestDelta - 50;
   double aDelta = myTestDelta;
-  PartSet_Tools::setFeaturePoint(aFeature, -100/*aDelta*/, -100/*aDelta*/, SketchPlugin_Line::START_ID());
-  PartSet_Tools::setFeaturePoint(aFeature, 200/*aDelta*2*/, 200/*aDelta*2*/, SketchPlugin_Line::END_ID());
-  boost::shared_ptr<GeomAPI_Shape> aPreview = PartSet_OperationSketchBase::preview(aFeature);
+  // TODO
+  //PartSet_Tools::setFeaturePoint(aFeature, -100/*aDelta*/, -100/*aDelta*/, LINE_ATTR_START);
+  //PartSet_Tools::setFeaturePoint(aFeature, 200/*aDelta*2*/, 200/*aDelta*2*/, LINE_ATTR_END);
+  //boost::shared_ptr<GeomAPI_Shape> aPreview = PartSet_OperationSketchBase::preview(aFeature);
 
   boost::shared_ptr<GeomAPI_AISObject> aPrevAIS;
   boost::shared_ptr<SketchPlugin_Feature> aSPFeature = 
@@ -216,7 +217,7 @@ void PartSet_TestOCC::changeTestLine(XGUI_Workshop* theWorkshop)
   //aDisplayer->activateInLocalContext(aFeature, aModes, true);
 
   /*QFeatureList aFeatureList;
-  aFeatureList.append(myTestFeature);
+  aFeatureList.append(myTestObject);
   theWorkshop->displayer()->setSelected(aFeatureList, true);*/
 
   theWorkshop->displayer()->updateViewer();
@@ -226,4 +227,4 @@ void PartSet_TestOCC::moveMouse(Handle(AIS_InteractiveContext) theContext, Handl
 {
   theContext->MoveTo(10, 10, theView);
   theContext->Select();
-}
\ No newline at end of file
+}