-
Notifications
You must be signed in to change notification settings - Fork 177
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
#2742 [Part 2] Allow to hover on or select R-Group attachment points #2954
#2742 [Part 2] Allow to hover on or select R-Group attachment points #2954
Conversation
[WIP] Proposal to enhance R-Group attachment point selection
Notice that the following code needs to be refactored in the scope of this enhancement // packages/ketcher-core/src/application/render/restruct/rergroup.js
calcBBox(render) {
// ...
const rGroupAttachmentPointsVBox =
render.ctab.getRGroupAttachmentPointsVBoxByAtomIds(this.getAtoms(render));
if (rGroupBoundingBox && rGroupAttachmentPointsVBox) {
rGroupBoundingBox = Box2Abs.union(
rGroupBoundingBox,
rGroupAttachmentPointsVBox,
);
}
// ...
}
|
@@ -610,6 +610,16 @@ export class SGroup { | |||
return bonds; | |||
} | |||
|
|||
getRGroupAttachmentPoints(molecule: 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.
Curious, is the function used somewhere?
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.
Forgot to remove it, thank you!
const atomId = reItem.item.atomId; | ||
const atom = this.molecule.atoms.get(atomId); | ||
assert(atom != null); | ||
return !FunctionalGroup.isAtomInContractedFunctionalGroup( |
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.
functional group is subset of the sgroup, so just curious why we checking only the functional groups in this fucntion, but not any sgroup?
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.
Sorry, I think I don't really get your question, but this function is to get R-Group attachment points that are outside of contracted functional groups, does it make sense?
packages/ketcher-core/src/application/editor/actions/rgroupAttachmentPoint.ts
Show resolved
Hide resolved
Merged with #2978 |
This PR is one of the small PRs to resolve #2742 for easy review.
This PR is open for reviews but please do not merge it.
What is done in this PR?
Allow to hover on attachment points using Select Tool or R-Group Attachment Point Tool
Allow to select attachment points using Select Tool
Fix Attachment points should be within R-Group brackets #197 which was broken by the previous small PR #2742 [Part 1] Refactor R-Group attachment points as entities #2928
Check list
#1234 – issue name