From: vsv Date: Tue, 15 Jul 2014 09:03:54 +0000 (+0400) Subject: Adaptation to new ModelAPI structure X-Git-Tag: V_0.4.4~191 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6929ae64e2dec9ba0a969f646c9d0d719da2ee8a;p=modules%2Fshaper.git Adaptation to new ModelAPI structure --- diff --git a/src/ModuleBase/ModuleBase_WidgetFeature.cpp b/src/ModuleBase/ModuleBase_WidgetFeature.cpp index 160965a1e..5f625caee 100644 --- a/src/ModuleBase/ModuleBase_WidgetFeature.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFeature.cpp @@ -62,8 +62,9 @@ bool ModuleBase_WidgetFeature::setValue(ModuleBase_WidgetValue* theValue) if (theValue) { ModuleBase_WidgetValueFeature* aFeatureValue = dynamic_cast(theValue); - if (aFeatureValue) - isDone = setFeature(aFeatureValue->feature()); + // TODO +// if (aFeatureValue) +// isDone = setFeature(aFeatureValue->feature()); } return isDone; } diff --git a/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.cpp b/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.cpp index c275f2238..a26a70d0a 100644 --- a/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.cpp @@ -47,7 +47,8 @@ bool ModuleBase_WidgetFeatureOrAttribute::setValue(ModuleBase_WidgetValue* theVa dynamic_cast(theValue); if (aFeatureValue) { boost::shared_ptr aValuePoint = aFeatureValue->point(); - FeaturePtr aValueFeature = aFeatureValue->feature(); + //TODO +/* FeaturePtr aValueFeature = aFeatureValue->feature(); if (aValueFeature) { isDone = setFeature(aValueFeature); } @@ -66,7 +67,7 @@ bool ModuleBase_WidgetFeatureOrAttribute::setValue(ModuleBase_WidgetValue* theVa } if (aFPoint) isDone = setAttribute(aFPoint); - } + }*/ } } return isDone; diff --git a/src/ModuleBase/ModuleBase_WidgetPoint2dDistance.cpp b/src/ModuleBase/ModuleBase_WidgetPoint2dDistance.cpp index 303d4508e..e43f341e5 100644 --- a/src/ModuleBase/ModuleBase_WidgetPoint2dDistance.cpp +++ b/src/ModuleBase/ModuleBase_WidgetPoint2dDistance.cpp @@ -33,11 +33,12 @@ bool ModuleBase_WidgetPoint2dDistance::setValue(ModuleBase_WidgetValue* theValue dynamic_cast(theValue); if (aFeatureValue) { boost::shared_ptr aPnt = aFeatureValue->point(); - FeaturePtr aFeature = aFeatureValue->feature(); + // TODO + /*FeaturePtr aFeature = aFeatureValue->feature(); if (aFeature && aPnt) { setPoint(aFeature, aPnt); isDone = true; - } + }*/ } } return isDone; diff --git a/src/ModuleBase/ModuleBase_WidgetValueFeature.cpp b/src/ModuleBase/ModuleBase_WidgetValueFeature.cpp index 51b39e181..da9fe5fd3 100644 --- a/src/ModuleBase/ModuleBase_WidgetValueFeature.cpp +++ b/src/ModuleBase/ModuleBase_WidgetValueFeature.cpp @@ -14,14 +14,14 @@ ModuleBase_WidgetValueFeature::~ModuleBase_WidgetValueFeature() { } -void ModuleBase_WidgetValueFeature::setFeature(const FeaturePtr& theFeature) +void ModuleBase_WidgetValueFeature::setResult(const ResultPtr& theFeature) { - myFeature = theFeature; + myResult = theFeature; } -const FeaturePtr& ModuleBase_WidgetValueFeature::feature() const +const ResultPtr& ModuleBase_WidgetValueFeature::result() const { - return myFeature; + return myResult; } void ModuleBase_WidgetValueFeature::setPoint(const boost::shared_ptr& thePoint) diff --git a/src/ModuleBase/ModuleBase_WidgetValueFeature.h b/src/ModuleBase/ModuleBase_WidgetValueFeature.h index 9bdaeb619..2de332108 100644 --- a/src/ModuleBase/ModuleBase_WidgetValueFeature.h +++ b/src/ModuleBase/ModuleBase_WidgetValueFeature.h @@ -8,7 +8,7 @@ #include #include -#include +#include #include @@ -28,11 +28,11 @@ public: /// Fill the widget values by given point /// \param thePoint the point - void setFeature(const FeaturePtr& theFeature); + void setResult(const ResultPtr& theFeature); /// Returns the widget values by given point /// \return theFeature the current feature - const FeaturePtr& feature() const; + const ResultPtr& result() const; /// Fill the widget values by given point /// \param thePoint the point @@ -43,7 +43,7 @@ public: const boost::shared_ptr& point() const; private: - FeaturePtr myFeature; + ResultPtr myResult; boost::shared_ptr myPoint; }; diff --git a/src/PartSet/PartSet_Listener.cpp b/src/PartSet/PartSet_Listener.cpp index 1b597c4dc..efbc1a706 100644 --- a/src/PartSet/PartSet_Listener.cpp +++ b/src/PartSet/PartSet_Listener.cpp @@ -46,13 +46,13 @@ void PartSet_Listener::processEvent(const Events_Message* theMessage) std::set::const_iterator anIt = aFeatures.begin(), aLast = aFeatures.end(); for (; anIt != aLast; anIt++) { ObjectPtr aObject = *anIt; - ResultPtr aResult = boost::dynamic_pointer_cast(aObject); - if (aResult) { - if (myModule->workshop()->displayer()->isVisible(aResult) || + FeaturePtr aFeature = boost::dynamic_pointer_cast(aObject); + if (aFeature) { + if (myModule->workshop()->displayer()->isVisible(aFeature->firstResult()) || aType == EVENT_OBJECT_CREATED) { - myModule->visualizePreview(aResult, true, false); + myModule->visualizePreview(aFeature->firstResult(), true, false); //if (aType == EVENT_OBJECT_CREATED) - myModule->activateFeature(aResult, true); + myModule->activateFeature(aFeature, true); } } } @@ -69,7 +69,7 @@ void PartSet_Listener::processEvent(const Events_Message* theMessage) for (; anIt != aLast; anIt++) { std::string aGroup = *anIt; if (aGroup.compare(SKETCH_KIND) == 0) { // Update only Sketch group - myModule->workshop()->displayer()->eraseDeletedFeatures(); + myModule->workshop()->displayer()->eraseDeletedResults(); myModule->updateCurrentPreview(aGroup); } } diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 02d41a0fc..b52edee63 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -186,9 +186,11 @@ void PartSet_Module::onOperationStopped(ModuleBase_Operation* theOperation) void PartSet_Module::onContextMenuCommand(const QString& theId, bool isChecked) { - QFeatureList aFeatures = myWorkshop->selector()->selection()->selectedFeatures(); + QList aFeatures = myWorkshop->selector()->selection()->selectedObjects(); if (theId == "EDIT_CMD" && (aFeatures.size() > 0)) { - editFeature(aFeatures.first()); + FeaturePtr aFeature = boost::dynamic_pointer_cast(aFeatures.first()); + if (aFeature) + editFeature(aFeature); } } @@ -301,7 +303,16 @@ void PartSet_Module::onStopSelection(const QFeatureList& theFeatures, const bool activateFeature((*anIt), false); } } - aDisplayer->stopSelection(theFeatures, isStop, false); + QResultList aResults; + foreach(FeaturePtr aFeature, theFeatures) { + if (aFeature->results().size() > 0) { + std::list& aResList = aFeature->results(); + std::list::iterator aIt; + for (aIt = aResList.begin(); aIt != aResList.end(); ++aIt) + aResults.append(*aIt); + } + } + aDisplayer->stopSelection(aResults, isStop, false); XGUI_ViewerProxy* aViewer = myWorkshop->viewer(); aViewer->enableSelection(!isStop); @@ -309,7 +320,7 @@ void PartSet_Module::onStopSelection(const QFeatureList& theFeatures, const bool aDisplayer->updateViewer(); } -void PartSet_Module::onSetSelection(const QFeatureList& theFeatures) +void PartSet_Module::onSetSelection(const QResultList& theFeatures) { XGUI_Displayer* aDisplayer = myWorkshop->displayer(); aDisplayer->setSelected(theFeatures, false); @@ -325,7 +336,7 @@ void PartSet_Module::onCloseLocalContext() void PartSet_Module::onFeatureConstructed(FeaturePtr theFeature, int theMode) { bool isDisplay = theMode != PartSet_OperationSketchBase::FM_Hide; - visualizePreview(theFeature, isDisplay, false); + // TODO visualizePreview(theFeature, isDisplay, false); if (!isDisplay) { ModuleBase_Operation* aCurOperation = myWorkshop->operationMgr()->currentOperation(); FeaturePtr aSketch; @@ -338,7 +349,7 @@ void PartSet_Module::onFeatureConstructed(FeaturePtr theFeature, int theMode) std::list::const_iterator anIt = aList.begin(), aLast = aList.end(); for (; anIt != aLast; anIt++) - visualizePreview(*anIt, false, false); + visualizePreview((*anIt)->firstResult(), false, false); aDisplayer->updateViewer(); } } @@ -433,7 +444,7 @@ void PartSet_Module::sendOperation(ModuleBase_Operation* theOperation) Events_Loop::loop()->send(aMessage); } -void PartSet_Module::visualizePreview(FeaturePtr theFeature, bool isDisplay, +void PartSet_Module::visualizePreview(ResultPtr theFeature, bool isDisplay, const bool isUpdateViewer) { ModuleBase_Operation* anOperation = myWorkshop->operationMgr()->currentOperation(); @@ -468,7 +479,7 @@ void PartSet_Module::activateFeature(FeaturePtr theFeature, const bool isUpdateV PartSet_OperationSketchBase* aPreviewOp = dynamic_cast(anOperation); if (aPreviewOp) { XGUI_Displayer* aDisplayer = myWorkshop->displayer(); - aDisplayer->activateInLocalContext(theFeature, aPreviewOp->getSelectionModes(theFeature), + aDisplayer->activateInLocalContext(theFeature->firstResult(), aPreviewOp->getSelectionModes(theFeature), isUpdateViewer); } } @@ -498,8 +509,8 @@ void PartSet_Module::updateCurrentPreview(const std::string& theCmdId) boost::dynamic_pointer_cast(*anIt); if (!aSPFeature) continue; - visualizePreview(*anIt, true, false); - aDisplayer->activateInLocalContext(*anIt, aModes, false); + visualizePreview((*anIt)->firstResult(), true, false); + aDisplayer->activateInLocalContext((*anIt)->firstResult(), aModes, false); } aDisplayer->updateViewer(); } @@ -510,16 +521,16 @@ void PartSet_Module::editFeature(FeaturePtr theFeature) return; // if (theFeature->getKind() == SKETCH_KIND) { - FeaturePtr aFeature = theFeature; - if (XGUI_Tools::isModelObject(aFeature)) { - ObjectPtr aObject = boost::dynamic_pointer_cast(aFeature); - aFeature = aObject->featureRef(); - } - - if (aFeature) { - onLaunchOperation(aFeature->getKind(), aFeature); - updateCurrentPreview(aFeature->getKind()); - } + //FeaturePtr aFeature = theFeature; + //if (XGUI_Tools::isModelObject(aFeature)) { + // ObjectPtr aObject = boost::dynamic_pointer_cast(aFeature); + // aFeature = aObject->featureRef(); + //} + + //if (aFeature) { + onLaunchOperation(theFeature->getKind(), theFeature); + updateCurrentPreview(theFeature->getKind()); + //} // } } diff --git a/src/PartSet/PartSet_Module.h b/src/PartSet/PartSet_Module.h index 627d088b1..eaec86601 100644 --- a/src/PartSet/PartSet_Module.h +++ b/src/PartSet/PartSet_Module.h @@ -55,7 +55,7 @@ public: /// \param theFeature the feature instance to be displayed /// \param isDisplay the state whether the presentation should be displayed or erased /// \param isUpdateViewer the flag whether the viewer should be updated - void visualizePreview(FeaturePtr theFeature, bool isDisplay, + void visualizePreview(ResultPtr theResult, bool isDisplay, const bool isUpdateViewer = true); /// Activates the feature in the displayer @@ -125,7 +125,7 @@ public slots: /// SLOT, to set selection /// \param theFeatures a list of features to be selected - void onSetSelection(const QFeatureList& theFeatures); + void onSetSelection(const QResultList& theFeatures); /// SLOT, to close the viewer local context void onCloseLocalContext(); diff --git a/src/PartSet/PartSet_OperationFeatureCreate.cpp b/src/PartSet/PartSet_OperationFeatureCreate.cpp index dc9e868f3..8326bfcbd 100644 --- a/src/PartSet/PartSet_OperationFeatureCreate.cpp +++ b/src/PartSet/PartSet_OperationFeatureCreate.cpp @@ -145,19 +145,21 @@ void PartSet_OperationFeatureCreate::mouseReleased(QMouseEvent* theEvent, Handle } } } - FeaturePtr aFeature; + ResultPtr aFeature; if (!theSelected.empty()) { ModuleBase_ViewerPrs aPrs = theSelected.front(); aFeature = aPrs.result(); } - else - aFeature = feature(); // for the widget distance only + // TODO + //else + // aFeature = feature(); // for the widget distance only - bool isApplyed = setWidgetValue(aFeature, aX, anY); + // TODO + /*bool isApplyed = setWidgetValue(aFeature, aX, anY); if (isApplyed) { flushUpdated(); emit activateNextWidget(myActiveWidget); - } + }*/ } void PartSet_OperationFeatureCreate::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View) theView) @@ -192,7 +194,7 @@ void PartSet_OperationFeatureCreate::onWidgetActivated(ModuleBase_ModelWidget* t if ((myPreSelection.size() > 0) && myActiveWidget) { const ModuleBase_ViewerPrs& aPrs = myPreSelection.front(); ModuleBase_WidgetValueFeature aValue; - aValue.setFeature(aPrs.result()); + aValue.setResult(aPrs.result()); if (myActiveWidget->setValue(&aValue)) { myPreSelection.remove(aPrs); emit activateNextWidget(myActiveWidget); @@ -281,7 +283,7 @@ FeaturePtr PartSet_OperationFeatureCreate::createFeature(const bool theFlushMess bool PartSet_OperationFeatureCreate::setWidgetValue(FeaturePtr theFeature, double theX, double theY) { ModuleBase_WidgetValueFeature* aValue = new ModuleBase_WidgetValueFeature(); - aValue->setFeature(theFeature); + aValue->setResult(theFeature->firstResult()); aValue->setPoint(boost::shared_ptr(new GeomAPI_Pnt2d(theX, theY))); bool isApplyed = myActiveWidget->setValue(aValue); diff --git a/src/PartSet/PartSet_OperationFeatureEdit.cpp b/src/PartSet/PartSet_OperationFeatureEdit.cpp index 6705c0e6c..e767208aa 100644 --- a/src/PartSet/PartSet_OperationFeatureEdit.cpp +++ b/src/PartSet/PartSet_OperationFeatureEdit.cpp @@ -78,23 +78,25 @@ void PartSet_OperationFeatureEdit::mousePressed(QMouseEvent* theEvent, Handle(V3 aFeature = theHighlighted.front().result(); if (!aFeature && !theSelected.empty()) // changed for a constrain aFeature = theSelected.front().result(); - - if (!aFeature || aFeature != feature()) + // TODO + /*if (!aFeature || aFeature != feature()) { commit(); emit featureConstructed(feature(), FM_Deactivation); bool aHasShift = (theEvent->modifiers() & Qt::ShiftModifier); if(aHasShift && !theHighlighted.empty()) { - QFeatureList aSelected; + QResultList aSelected; + // TODO aSelected.push_back(feature()); aSelected.push_back(theHighlighted.front().result()); emit setSelection(aSelected); } + // TODO else if (aFeature) { restartOperation(PartSet_OperationFeatureEdit::Type(), aFeature); } - } + }*/ } void PartSet_OperationFeatureEdit::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View) theView) diff --git a/src/PartSet/PartSet_OperationFeatureEditMulti.cpp b/src/PartSet/PartSet_OperationFeatureEditMulti.cpp index 960cab6b4..d66acf804 100644 --- a/src/PartSet/PartSet_OperationFeatureEditMulti.cpp +++ b/src/PartSet/PartSet_OperationFeatureEditMulti.cpp @@ -58,9 +58,10 @@ void PartSet_OperationFeatureEditMulti::initSelection(const std::list::const_iterator anIt = theSelected.begin(), aLast = theSelected.end(); - for (; anIt != aLast && !isSelected; anIt++) { + // TODO + /*for (; anIt != aLast && !isSelected; anIt++) { isSelected = (*anIt).feature() == feature(); - } + }*/ if (!isSelected) myFeatures = theHighlighted; else @@ -109,13 +110,14 @@ void PartSet_OperationFeatureEditMulti::mouseMoved(QMouseEvent* theEvent, Handle aSketchFeature->move(aDeltaX, aDeltaY); std::list::const_iterator anIt = myFeatures.begin(), aLast = myFeatures.end(); - for (; anIt != aLast; anIt++) { + // TODO + /*for (; anIt != aLast; anIt++) { FeaturePtr aFeature = (*anIt).feature(); if (!aFeature || aFeature == feature()) continue; aSketchFeature = boost::dynamic_pointer_cast(aFeature); aSketchFeature->move(aDeltaX, aDeltaY); - } + }*/ } sendFeatures(); @@ -129,12 +131,13 @@ void PartSet_OperationFeatureEditMulti::mouseReleased(QMouseEvent* theEvent, Han std::list aFeatures = myFeatures; commit(); std::list::const_iterator anIt = aFeatures.begin(), aLast = aFeatures.end(); - for (; anIt != aLast; anIt++) { + // TODO + /*for (; anIt != aLast; anIt++) { FeaturePtr aFeature = (*anIt).feature(); if (aFeature) { emit featureConstructed(aFeature, FM_Deactivation); } - } + }*/ } void PartSet_OperationFeatureEditMulti::startOperation() @@ -165,8 +168,8 @@ void PartSet_OperationFeatureEditMulti::blockSelection(bool isBlocked, const boo QFeatureList aFeatureList; std::list::const_iterator anIt = myFeatures.begin(), aLast = myFeatures.end(); - for(; anIt != aLast; anIt++) - aFeatureList.append((*anIt).feature()); + /*for(; anIt != aLast; anIt++) + aFeatureList.append((*anIt).feature());*/ if (isBlocked) { emit setSelection(QFeatureList()); emit stopSelection(aFeatureList, true); @@ -185,13 +188,14 @@ void PartSet_OperationFeatureEditMulti::sendFeatures() std::list aFeatures; std::list::const_iterator anIt = myFeatures.begin(), aLast = myFeatures.end(); - for (; anIt != aLast; anIt++) { + // TODO + /*for (; anIt != aLast; anIt++) { FeaturePtr aFeature = (*anIt).feature(); if (!aFeature) continue; ModelAPI_EventCreator::get()->sendUpdated(aFeature, anEvent); - } + }*/ Events_Loop::loop()->flush(anEvent); flushUpdated(); } diff --git a/src/PartSet/PartSet_OperationSketch.cpp b/src/PartSet/PartSet_OperationSketch.cpp index 563caf21c..2cccb18a2 100644 --- a/src/PartSet/PartSet_OperationSketch.cpp +++ b/src/PartSet/PartSet_OperationSketch.cpp @@ -91,12 +91,12 @@ void PartSet_OperationSketch::mousePressed(QMouseEvent* theEvent, Handle_V3d_Vie return; if (theHighlighted.size() == 1) { - FeaturePtr aFeature = theHighlighted.front().feature(); + ResultPtr aFeature = theHighlighted.front().result(); if (aFeature) { std::string anOperationType = PartSet_OperationFeatureEdit::Type(); if (theSelected.size() > 1) anOperationType = PartSet_OperationFeatureEditMulti::Type(); - restartOperation(anOperationType, aFeature); + // TODO restartOperation(anOperationType, aFeature); } } else @@ -117,9 +117,10 @@ void PartSet_OperationSketch::mouseReleased(QMouseEvent* theEvent, Handle_V3d_Vi /// It is empty and we have to use the process mouse release to start edition operation /// for these objects if (theSelected.size() == 1) { - FeaturePtr aFeature = theSelected.front().feature(); - if (aFeature) - restartOperation(PartSet_OperationFeatureEdit::Type(), aFeature); + ResultPtr aFeature = theSelected.front().result(); + // TODO + //if (aFeature) + // restartOperation(PartSet_OperationFeatureEdit::Type(), aFeature); } } } @@ -145,7 +146,15 @@ std::list PartSet_OperationSketch::subFeatures() const boost::shared_ptr aRefList = boost::dynamic_pointer_cast(aData->attribute(SKETCH_ATTR_FEATURES)); - return aRefList->list(); + std::list aList = aRefList->list(); + std::list::iterator aIt; + std::list aFeaList; + for (aIt = aList.begin(); aIt != aList.end(); ++aIt) { + FeaturePtr aFeature = boost::dynamic_pointer_cast(*aIt); + if (aFeature) + aFeaList.push_back(aFeature); + } + return aFeaList; } void PartSet_OperationSketch::stopOperation() diff --git a/src/PartSet/PartSet_OperationSketchBase.cpp b/src/PartSet/PartSet_OperationSketchBase.cpp index bef1dfde5..7c6864f7c 100644 --- a/src/PartSet/PartSet_OperationSketchBase.cpp +++ b/src/PartSet/PartSet_OperationSketchBase.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include @@ -35,9 +36,13 @@ boost::shared_ptr PartSet_OperationSketchBase::preview( { boost::shared_ptr aFeature = boost::dynamic_pointer_cast(theFeature); - if (!aFeature) - return boost::shared_ptr(); - return aFeature->preview(); + if (aFeature) { + ResultPtr aRes = aFeature->firstResult(); + ResultBodyPtr aBody = boost::dynamic_pointer_cast(aRes); + if (aBody) + return aBody->shape(); + } + return boost::shared_ptr(); } std::list PartSet_OperationSketchBase::subFeatures() const diff --git a/src/PartSet/PartSet_TestOCC.cpp b/src/PartSet/PartSet_TestOCC.cpp index 4cc60a5c4..c8b1e0186 100644 --- a/src/PartSet/PartSet_TestOCC.cpp +++ b/src/PartSet/PartSet_TestOCC.cpp @@ -152,12 +152,12 @@ void PartSet_TestOCC::createTestLine(XGUI_Workshop* theWorkshop) boost::dynamic_pointer_cast(aFeature); boost::shared_ptr anAIS = aSPFeature->getAISObject(aPrevAIS); if (!anAIS->empty()) - aDisplayer->redisplay(aFeature, anAIS, false); + aDisplayer->redisplay(aFeature->firstResult(), anAIS, false); std::list 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,9 +182,9 @@ void PartSet_TestOCC::createTestLine(XGUI_Workshop* theWorkshop) //aModes.push_back(TopAbs_VERTEX); //aModes.push_back(TopAbs_EDGE); //aDisplayer->activateInLocalContext(aFeature, aModes, true); - myTestObject = aFeature; + myTestObject = aFeature->firstResult(); - QFeatureList aFeatureList; + QResultList aFeatureList; aFeatureList.append(myTestObject); aDisplayer->setSelected(aFeatureList, true); } @@ -195,13 +195,14 @@ void PartSet_TestOCC::changeTestLine(XGUI_Workshop* theWorkshop) // change the line if (!myTestObject) return; - FeaturePtr aFeature = myTestObject; + ResultPtr aFeature = myTestObject; myTestDelta = myTestDelta - 50; double aDelta = myTestDelta; - 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 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 aPreview = PartSet_OperationSketchBase::preview(aFeature); boost::shared_ptr aPrevAIS; boost::shared_ptr aSPFeature = diff --git a/src/PartSet/PartSet_Tools.cpp b/src/PartSet/PartSet_Tools.cpp index 24a726a90..e2c6d3ccc 100644 --- a/src/PartSet/PartSet_Tools.cpp +++ b/src/PartSet/PartSet_Tools.cpp @@ -162,7 +162,7 @@ FeaturePtr PartSet_Tools::nearestFeature(QPoint thePoint, Handle_V3d_View theVie boost::shared_ptr(new GeomAPI_Pnt2d(aX, anY))); if (aMinDelta < 0 || aMinDelta > aDelta) { aMinDelta = aDelta; - aDeltaFeature = aPrs.result(); + // TODO aDeltaFeature = aPrs.result(); } } return aDeltaFeature; @@ -225,7 +225,7 @@ FeaturePtr PartSet_Tools::feature(FeaturePtr theFeature, const std::string& theA boost::shared_ptr anAttr = boost::dynamic_pointer_cast(aData->attribute(theAttribute)); if (anAttr) { - aFeature = anAttr->feature(); + aFeature = boost::dynamic_pointer_cast(anAttr->object()); if (!theKind.empty() && aFeature && aFeature->getKind() != theKind) { aFeature = FeaturePtr(); } @@ -277,14 +277,14 @@ void PartSet_Tools::setConstraints(FeaturePtr theSketch, FeaturePtr theFeature, boost::shared_ptr aRefList = boost::dynamic_pointer_cast(aData->attribute(SKETCH_ATTR_FEATURES)); - std::list aFeatures = aRefList->list(); - std::list::const_iterator anIt = aFeatures.begin(), aLast = aFeatures.end(); + std::list aFeatures = aRefList->list(); + std::list::const_iterator anIt = aFeatures.begin(), aLast = aFeatures.end(); std::list > anAttiributes; boost::shared_ptr aClickedPoint = boost::shared_ptr (new GeomAPI_Pnt2d(theClickedX, theClickedY)); for (; anIt != aLast; anIt++) { - FeaturePtr aFeature = *anIt; + FeaturePtr aFeature = boost::dynamic_pointer_cast(*anIt); // find the given point in the feature attributes anAttiributes = aFeature->data()->attributes(GeomDataAPI_Point2D::type()); std::list >::const_iterator anIt = anAttiributes.begin(), diff --git a/src/PartSet/PartSet_WidgetSketchLabel.h b/src/PartSet/PartSet_WidgetSketchLabel.h index 30cdaace3..839b3ec57 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.h +++ b/src/PartSet/PartSet_WidgetSketchLabel.h @@ -23,9 +23,9 @@ public: /// Saves the internal parameters to the given feature /// \param theFeature a model feature to be changed - virtual bool storeValue(FeaturePtr theFeature) const { return true;} + virtual bool storeValue(ObjectPtr theFeature) const { return true;} - virtual bool restoreValue(FeaturePtr theFeature) { return true;} + virtual bool restoreValue(ObjectPtr theFeature) { return true;} /// Returns list of widget controls /// \return a control list