#include <ModelAPI_Document.h>
static double myTestDelta;
-static FeaturePtr myTestFeature;
+static ResultPtr myTestObject;
#include <AIS_InteractiveContext.hxx>
#include <AIS_Shape.hxx>
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());
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;
//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);
}
}
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 =
//aDisplayer->activateInLocalContext(aFeature, aModes, true);
/*QFeatureList aFeatureList;
- aFeatureList.append(myTestFeature);
+ aFeatureList.append(myTestObject);
theWorkshop->displayer()->setSelected(aFeatureList, true);*/
theWorkshop->displayer()->updateViewer();
{
theContext->MoveTo(10, 10, theView);
theContext->Select();
-}
\ No newline at end of file
+}