-
Notifications
You must be signed in to change notification settings - Fork 636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify annotations #12924
Simplify annotations #12924
Conversation
I remember it is used when user drag stuff into the group, you might want to give it a test there |
I reverted to using cutouts ...and I fixed the performance by limiting the ObservableCollection notifications |
switch (e.PropertyName) | ||
{ | ||
case nameof(PortModel.Center): | ||
RaisePropertyChanged(nameof(CurvePoint1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if this is the right property for which to raise an event.
Does CurvePoint1 correspond to the end Node ?
I did see mentioned somewhere in the code that CurvePoint0 corresponds to the start Node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the Redraw function...it looks like CurvePoint3 should correspond to the end Node
…namo into simplify_annotations
@@ -198,7 +198,10 @@ public Point2D Center | |||
} | |||
internal set | |||
{ | |||
if (center.Equals(value)) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is Point2D
a struct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is
|
||
// Annotations always update their position relative to all nested Nodes | ||
// So there is no need to move the Annotation since it will be updated later anyway (performance improvement) | ||
if (locatable is AnnotationModel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this actually end up correctly setting the x and y of the annotationModel or does it draw it correctly, but leave the model data incorrect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how the notifications flow:
NestedNode.PositionUpdate => AnnotationNode.ModelDataUpdate => AnnotationViewModel.ViewModelDataUpdate
X and Y (and all other annotation model data) are set correctly in the annotation model then it draws (correctly).
/// This class supports batch operations that should defer CollectionChaned notifications. | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
public class SmartObservableCollection<T> : ObservableCollection<T> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why make this public?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it is used to bind to WPF controls
Purpose
Purpose:
Improve performance when dragging/moving Annotations.
https://jira.autodesk.com/browse/DYN-4600
Changes in this PR:
Declarations
Check these if you believe they are true
*.resx
filesRelease Notes
(FILL ME IN) Brief description of the fix / enhancement. Mandatory section
Reviewers
(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)
(FILL ME IN, optional) Any additional notes to reviewers or testers.
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of