Skip to content
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

Closed

Conversation

yuleicul
Copy link
Collaborator

@yuleicul yuleicul commented Jul 25, 2023

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?

Check list

  • unit-tests written
  • e2e-tests written
  • documentation updated
  • PR name follows the pattern #1234 – issue name
  • branch name doesn't contain '#'
  • PR is linked with the issue
  • base branch (master or release/xx) is correct
  • task status changed to "Code review"

@auto-assign auto-assign bot requested review from Nitvex and SashaGraves July 25, 2023 03:22
@yuleicul yuleicul linked an issue Jul 25, 2023 that may be closed by this pull request
@yuleicul
Copy link
Collaborator Author

yuleicul commented Jul 25, 2023

[WIP] Proposal to enhance R-Group attachment point selection

  1. Allow to be selected by fragment tool

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,
      );
    }

    // ...
  }
  1. Allow to move

@yuleicul yuleicul requested review from kaluginserg and StarlaStarla and removed request for Nitvex and SashaGraves July 25, 2023 03:27
@@ -610,6 +610,16 @@ export class SGroup {
return bonds;
}

getRGroupAttachmentPoints(molecule: Struct) {
Copy link
Collaborator

@kaluginserg kaluginserg Jul 25, 2023

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?

Copy link
Collaborator Author

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(
Copy link
Collaborator

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?

Copy link
Collaborator Author

@yuleicul yuleicul Jul 27, 2023

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?

@yuleicul
Copy link
Collaborator Author

yuleicul commented Aug 1, 2023

Merged with #2978

@yuleicul yuleicul closed this Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attachment point selection edition and deletion
3 participants