return isCreated;
}
+void XGUI_Displayer::redisplay(FeaturePtr theFeature, bool isUpdateViewer)
+{
+ FeaturePtr aFeature = XGUI_Tools::realFeature(theFeature);
+ if (!isVisible(aFeature))
+ return;
+
+ Handle(AIS_InteractiveObject) aAISObj = getAISObject(aFeature);
+ boost::shared_ptr<GeomAPI_Shape> aShapePtr = aFeature->data()->shape();
+
+ Handle(AIS_Shape) aAISShape = Handle(AIS_Shape)::DownCast(aAISObj);
+ aAISShape->Set(aShapePtr->impl<TopoDS_Shape>());
+
+ AISContext()->Redisplay(aAISShape);
+}
+
void XGUI_Displayer::activateInLocalContext(FeaturePtr theFeature,
const std::list<int>& theModes, const bool isUpdateViewer)
{
Handle(AIS_InteractiveObject) theAIS,
const int theSelectionMode, const bool isUpdateViewer = true);
+ /** Redisplay the shape if it was displayed
+ * \param theFeature a feature instance
+ * \param isUpdateViewer the parameter whether the viewer should be update immediatelly
+ */
+ void redisplay(FeaturePtr theFeature, bool isUpdateViewer = true);
+
/// Redisplay the shape and activate selection of sub-shapes
/// \param theFeature a feature instance
/// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
FeaturePtr aFeature = (*aIt);
if (aFeature->getKind() == PARTSET_PART_KIND) {
aHasPart = true;
- break;
+ //break;
+ } else {
+ myDisplayer->display(aFeature, false);
}
}
+ myDisplayer->updateViewer();
if (aHasPart) {
//The created part will be created in Object Browser later and we have to activate it
// only when it is created everywere
//Update property panel on corresponding message. If there is no current operation (no
//property panel), or received message has different feature to the current - do nothing.
static Events_ID aFeatureUpdatedId = Events_Loop::loop()->eventByName(EVENT_FEATURE_UPDATED);
- if (theMessage->eventID() == aFeatureUpdatedId && myOperationMgr->hasOperation())
- {
+ if (theMessage->eventID() == aFeatureUpdatedId) {
const Model_FeatureUpdatedMessage* anUpdateMsg =
dynamic_cast<const Model_FeatureUpdatedMessage*>(theMessage);
- std::set<FeaturePtr> aFeatures = anUpdateMsg->features();
- FeaturePtr aCurrentFeature = myOperationMgr->currentOperation()->feature();
+ std::set<FeaturePtr> aFeatures = anUpdateMsg->features();
+ if (myOperationMgr->hasOperation())
+ {
+ FeaturePtr aCurrentFeature = myOperationMgr->currentOperation()->feature();
+ std::set<FeaturePtr>::const_iterator aIt;
+ for (aIt = aFeatures.begin(); aIt != aFeatures.end(); ++aIt) {
+ FeaturePtr aNewFeature = (*aIt);
+ if(aNewFeature == aCurrentFeature) {
+ myPropertyPanel->updateContentWidget(aCurrentFeature);
+ break;
+ }
+ }
+ }
+ // Redisplay feature if it is modified
std::set<FeaturePtr>::const_iterator aIt;
for (aIt = aFeatures.begin(); aIt != aFeatures.end(); ++aIt) {
- FeaturePtr aNewFeature = (*aIt);
- if(aNewFeature == aCurrentFeature) {
- myPropertyPanel->updateContentWidget(aCurrentFeature);
- break;
- }
+ FeaturePtr aFeature = (*aIt);
+ if (aFeature->getKind() != PARTSET_PART_KIND)
+ myDisplayer->redisplay(aFeature, false);
}
+ myDisplayer->updateViewer();
}
//An operation passed by message. Start it, process and commit.
const Config_PointerMessage* aPartSetMsg = dynamic_cast<const Config_PointerMessage*>(theMessage);