void PartSet_Module::createFeatures()
{
- Config_ModuleReader aXMLReader = Config_ModuleReader();
- aXMLReader.readAll();
- myFeaturesInFiles = aXMLReader.featuresInFiles();
-
//!! Test registering of validators
PluginManagerPtr aMgr = ModelAPI_PluginManager::get();
ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
aFactory->registerValidator("PartSet_PerpendicularValidator", new PartSet_PerpendicularValidator);
aFactory->registerValidator("PartSet_ParallelValidator", new PartSet_ParallelValidator);
aFactory->registerValidator("PartSet_RadiusValidator", new PartSet_RadiusValidator);
+
+ Config_ModuleReader aXMLReader = Config_ModuleReader();
+ aXMLReader.readAll();
+ myFeaturesInFiles = aXMLReader.featuresInFiles();
}
void PartSet_Module::featureCreated(QAction* theFeature)
void PartSet_Module::onFeatureConstructed(FeaturePtr theFeature, int theMode)
{
- ModuleBase_Operation* aCurOperation = myWorkshop->operationMgr()->currentOperation();
- PartSet_OperationSketchBase* aPrevOp = dynamic_cast<PartSet_OperationSketchBase*>(aCurOperation);
- if (aPrevOp) {
- std::list<FeaturePtr> aList = aPrevOp->subFeatures();
- XGUI_Displayer* aDisplayer = myWorkshop->displayer();
- std::list<int> aModes = aPrevOp->getSelectionModes(aPrevOp->feature());
- std::list<FeaturePtr>::iterator aSFIt;
- for (aSFIt = aList.begin(); aSFIt != aList.end(); ++aSFIt) {
- std::list<ResultPtr> aResults = (*aSFIt)->results();
- std::list<ResultPtr>::iterator aIt;
- for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) {
- aDisplayer->activateInLocalContext((*aIt), aModes, false);
+// bool isDisplay = theMode != PartSet_OperationSketchBase::FM_Hide;
+// if (isDisplay) {
+ ModuleBase_Operation* aCurOperation = myWorkshop->operationMgr()->currentOperation();
+ PartSet_OperationSketchBase* aPrevOp = dynamic_cast<PartSet_OperationSketchBase*>(aCurOperation);
+ if (aPrevOp) {
+ std::list<FeaturePtr> aList = aPrevOp->subFeatures();
+ XGUI_Displayer* aDisplayer = myWorkshop->displayer();
+ std::list<int> aModes = aPrevOp->getSelectionModes(aPrevOp->feature());
+ std::list<FeaturePtr>::iterator aSFIt;
+ for (aSFIt = aList.begin(); aSFIt != aList.end(); ++aSFIt) {
+ std::list<ResultPtr> aResults = (*aSFIt)->results();
+ std::list<ResultPtr>::iterator aIt;
+ for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) {
+ aDisplayer->activateInLocalContext((*aIt), aModes, false);
+ }
}
}
- }
- ModelAPI_EventCreator::get()->sendUpdated(theFeature,
- Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
-
+/* FeaturePtr aFeature = aPrevOp->feature();
+ if (aFeature) {
+ std::list<ResultPtr> aResList = aFeature->results();
+ std::list<ResultPtr>::iterator aIt;
+ for (aIt = aResList.begin(); aIt != aResList.end(); ++aIt) {
+ aDisplayer->deactivate((*aIt), false);
+ }
+ }
+ }*/
+ ModelAPI_EventCreator::get()->sendUpdated(theFeature,
+ Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
+// }
+// else
+// ->erase(theFeature->firstResult(), true);
/* bool isDisplay = theMode != PartSet_OperationSketchBase::FM_Hide;
// TODO visualizePreview(theFeature, isDisplay, false);
if (!isDisplay) {
PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
if (aPreviewOp) {
XGUI_Displayer* aDisplayer = myWorkshop->displayer();
- aDisplayer->activateInLocalContext(theFeature, aPreviewOp->getSelectionModes(theFeature),
- isUpdateViewer);
-/* FeaturePtr aFeature = aPreviewOp->feature();
- if (aFeature) {
- std::list<ResultPtr> aResList = aFeature->results();
- std::list<ResultPtr>::iterator aIt;
- for (aIt = aResList.begin(); aIt != aResList.end(); ++aIt) {
- aDisplayer->deactivate((*aIt), false);
- }
- }*/
+ std::list<int> aModes = aPreviewOp->getSelectionModes(theFeature);
+ aDisplayer->activateInLocalContext(theFeature, aModes, isUpdateViewer);
}
}
Config_WidgetAPI* theWidgetApi, QList<ModuleBase_ModelWidget*>& theModelWidgets)
{
if (theType == "sketch-start-label") {
- PartSet_WidgetSketchLabel* aWgt = new PartSet_WidgetSketchLabel(theParent, theWidgetApi);
+ PartSet_WidgetSketchLabel* aWgt = new PartSet_WidgetSketchLabel(theParent, theWidgetApi, "");
aWgt->setOperationsMgr(myWorkshop->operationMgr());
theModelWidgets.append(aWgt);
return aWgt->getControl();