Skip to content

Commit

Permalink
#2389 Preview: Margin is not correct for reaction with plus when rea…
Browse files Browse the repository at this point in the history
…ction margin size is changed (#2405)

Co-authored-by: Aliakasndr Dziarkach <[email protected]>
  • Loading branch information
AliaksandrDziarkach and Aliakasndr Dziarkach authored Sep 19, 2024
1 parent c44b31d commit b97a4a6
Show file tree
Hide file tree
Showing 20 changed files with 629 additions and 168 deletions.
2 changes: 1 addition & 1 deletion api/c/indigo/src/indigo_abbreviations_expand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ namespace indigo
// Layout expanded parts
MoleculeLayout ml(mol, self.smart_layout);
ml.max_iterations = self.layout_max_iterations;
ml.layout_orientation = (layout_orientation_value)self.layout_orientation;
ml.layout_orientation = (LAYOUT_ORIENTATION)self.layout_orientation;
ml.respect_existing_layout = true;
// Check if there are not bonds at all or if the coordinates are invalid
if (fabs(avg_bond_length) > 0.001)
Expand Down
8 changes: 4 additions & 4 deletions api/c/indigo/src/indigo_layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ CEXPORT int indigoLayout(int object)

ml.max_iterations = self.layout_max_iterations;
ml.bond_length = LayoutOptions::DEFAULT_BOND_LENGTH;
ml.layout_orientation = (layout_orientation_value)self.layout_orientation;
ml.layout_orientation = (LAYOUT_ORIENTATION)self.layout_orientation;
if (self.layout_preserve_existing || mol->hasAtropoStereoBonds())
ml.respect_existing_layout = true;

Expand Down Expand Up @@ -106,13 +106,13 @@ CEXPORT int indigoLayout(int object)
if (!no_layout)
{
ReactionLayout rl(rxn, self.smart_layout, self.layout_options);
rl.max_iterations = self.layout_max_iterations;
rl.layout_orientation = (layout_orientation_value)self.layout_orientation;
rl.setMaxIterations(self.layout_max_iterations);
rl.setLayoutOrientation((LAYOUT_ORIENTATION)self.layout_orientation);
// TODO::ACS Why removed?
// rl.bond_length = LayoutOptions::DEFAULT_BOND_LENGTH;
// rl.reaction_margin_size = self.layout_horintervalfactor;
if (self.layout_preserve_existing)
rl.preserve_molecule_layout = true;
rl.setPreserveMoleculeLayout(true);
rl.make();
try
{
Expand Down
4 changes: 2 additions & 2 deletions api/c/indigo/src/indigo_product_enumerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ CEXPORT int indigoReactionProductEnumerate(int reaction, int monomers)
if (has_coord && self.rpe_params.is_layout)
{
ReactionLayout layout(out_reaction, self.smart_layout);
layout.layout_orientation = (layout_orientation_value)self.layout_orientation;
layout.setLayoutOrientation((LAYOUT_ORIENTATION)self.layout_orientation);
layout.make();
out_reaction.markStereocenterBonds();
}
Expand Down Expand Up @@ -166,7 +166,7 @@ CEXPORT int indigoTransform(int reaction, int monomers)
rt.arom_options = self.arom_options;
rt.layout_flag = self.rpe_params.transform_is_layout;
rt.smart_layout = self.smart_layout;
rt.layout_orientation = (layout_orientation_value)self.layout_orientation;
rt.layout_orientation = (LAYOUT_ORIENTATION)self.layout_orientation;

// Try to work with molecule first
bool is_mol = false;
Expand Down
Loading

0 comments on commit b97a4a6

Please sign in to comment.