Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Issue #2059 point in sketch is created not on selected line of external sketchPlane...
[modules/shaper.git]
/
src
/
Model
/
Model_Data.cpp
diff --git
a/src/Model/Model_Data.cpp
b/src/Model/Model_Data.cpp
index 4cfc34a59d32229da50e8f7f157e6f4110deee4f..cbe96e2b3c043caf58214590311b078b170ec851 100644
(file)
--- a/
src/Model/Model_Data.cpp
+++ b/
src/Model/Model_Data.cpp
@@
-94,8
+94,12
@@
void Model_Data::setLabel(TDF_Label theLab)
std::string Model_Data::name()
{
Handle(TDataStd_Name) aName;
std::string Model_Data::name()
{
Handle(TDataStd_Name) aName;
- if (myLab.FindAttribute(TDataStd_Name::GetID(), aName))
+ if (myLab.FindAttribute(TDataStd_Name::GetID(), aName)) {
+#ifdef DEBUG_NAMES
+ myObject->myName = TCollection_AsciiString(aName->Get()).ToCString();
+#endif
return std::string(TCollection_AsciiString(aName->Get()).ToCString());
return std::string(TCollection_AsciiString(aName->Get()).ToCString());
+ }
return ""; // not defined
}
return ""; // not defined
}
@@
-118,6
+122,9
@@
void Model_Data::setName(const std::string& theName)
std::dynamic_pointer_cast<Model_Document>(myObject->document())->
changeNamingName(anOldName, theName);
}
std::dynamic_pointer_cast<Model_Document>(myObject->document())->
changeNamingName(anOldName, theName);
}
+#ifdef DEBUG_NAMES
+ myObject->myName = theName;
+#endif
}
AttributePtr Model_Data::addAttribute(const std::string& theID, const std::string theAttrType)
}
AttributePtr Model_Data::addAttribute(const std::string& theID, const std::string theAttrType)
@@
-295,11
+302,18
@@
void Model_Data::sendAttributeUpdated(ModelAPI_Attribute* theAttr)
if (myWasChangedButBlocked.empty() || *(myWasChangedButBlocked.rbegin()) != theAttr)
myWasChangedButBlocked.push_back(theAttr);
}
if (myWasChangedButBlocked.empty() || *(myWasChangedButBlocked.rbegin()) != theAttr)
myWasChangedButBlocked.push_back(theAttr);
}
+ } else {
+ // trim: need to redisplay
+ if (myObject) {
+ static const Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY);
+ ModelAPI_EventCreator::get()->sendUpdated(myObject, anEvent);
+ }
}
}
}
}
-
void
Model_Data::blockSendAttributeUpdated(const bool theBlock, const bool theSendMessage)
+
bool
Model_Data::blockSendAttributeUpdated(const bool theBlock, const bool theSendMessage)
{
{
+ bool aWasBlocked = !mySendAttributeUpdated;
if (mySendAttributeUpdated == theBlock) {
mySendAttributeUpdated = !theBlock;
if (mySendAttributeUpdated && !myWasChangedButBlocked.empty()) {
if (mySendAttributeUpdated == theBlock) {
mySendAttributeUpdated = !theBlock;
if (mySendAttributeUpdated && !myWasChangedButBlocked.empty()) {
@@
-320,6
+334,7
@@
void Model_Data::blockSendAttributeUpdated(const bool theBlock, const bool theSe
}
}
}
}
}
}
+ return aWasBlocked;
}
void Model_Data::erase()
}
void Model_Data::erase()
@@
-462,8
+477,7
@@
void Model_Data::addBackReference(FeaturePtr theFeature, std::string theAttrID,
// the second condition is for history upper than concealment causer, so the feature result may
// be displayed and previewed; also for avoiding of quick show/hide on history
// moving deep down
// the second condition is for history upper than concealment causer, so the feature result may
// be displayed and previewed; also for avoiding of quick show/hide on history
// moving deep down
- if (aRes && !theFeature->isDisabled() &&
- !ModelAPI_Session::get()->validators()->isUnconcealed(aRes, theFeature)) {
+ if (aRes && !theFeature->isDisabled()) {
aRes->setIsConcealed(true);
}
}
aRes->setIsConcealed(true);
}
}
@@
-481,10
+495,8
@@
void Model_Data::updateConcealmentFlag()
std::shared_ptr<ModelAPI_Result> aRes =
std::dynamic_pointer_cast<ModelAPI_Result>(myObject);
if (aRes.get()) {
std::shared_ptr<ModelAPI_Result> aRes =
std::dynamic_pointer_cast<ModelAPI_Result>(myObject);
if (aRes.get()) {
- if (!ModelAPI_Session::get()->validators()->isUnconcealed(aRes, aFeature)) {
- aRes->setIsConcealed(true); // set concealed
- return;
- }
+ aRes->setIsConcealed(true); // set concealed
+ return;
}
}
}
}
}
}
@@
-632,7
+644,8
@@
static void copyAttrs(TDF_Label theSource, TDF_Label theDestination) {
aTargetAttr = anAttrIter.Value()->NewEmpty();
theDestination.AddAttribute(aTargetAttr);
}
aTargetAttr = anAttrIter.Value()->NewEmpty();
theDestination.AddAttribute(aTargetAttr);
}
- Handle(TDF_RelocationTable) aRelocTable = new TDF_RelocationTable(); // no relocation, empty map
+ // no special relocation, empty map, but self-relocation is on: copy references w/o changes
+ Handle(TDF_RelocationTable) aRelocTable = new TDF_RelocationTable(Standard_True);
anAttrIter.Value()->Paste(aTargetAttr, aRelocTable);
}
// copy the sub-labels content
anAttrIter.Value()->Paste(aTargetAttr, aRelocTable);
}
// copy the sub-labels content