-
Notifications
You must be signed in to change notification settings - Fork 111
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
#2412 - User can't correctly save (or make a layout) to RDF/RXN reaction several products or with separate positioned molecules #2717
Conversation
{ | ||
for (auto& section : cz.second) | ||
{ | ||
if ((_zones[cz.first].zone_type == ZoneType::EPathWay && section > 1) || it_oz2->second.count(section ^ 1)) |
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.
It's not clear what means it_oz2->second.count(section ^ 1)
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.
Added clarifying comment
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.
According to findMaxSpecialZone
zone1
, zone2
and comm_zone
are std::map<int, std::set<int>>
where key is index in _zones
and std::set<int>
is indexes of sections from this zone which intersect with molecule.
So, it's works only why sections inserted into zones in current order(I'm not sure about pathway zone which has one right zone and from 0 to n left zones)
If later section adding will be changed - this part of code broke.
Same in lines 824-825:
auto& top_zone = _zones[reaction_index].zone_sections[2];
auto& bottom_zone = _zones[reaction_index].zone_sections[3];
Maybe better define sections explicitly?
|
||
float min_distance_h = 0, min_distance_v = 0; | ||
|
||
bool result = false; | ||
|
||
if (rights_row_it != rights_row.end() && lefts_row_it != lefts_row.end()) | ||
if (rights_row_it != rights_row.end() && lefts_row_it != lefts_row.end() && lefts_row_it->second != rights_row_it->second) |
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.
What if one molecule bbox contains plus? Other molecules not checked?
maybe better before if do
while(rights_row_it != rights_row.end() && lefts_row_it != lefts_row.end() && lefts_row_it->second == rights_row_it->second){ lefts_row_it++; rights_row_it ++; }
and if change to if (rights_row_it != rights_row.end() && lefts_row_it != lefts_row.end())
connection.second = lefts_row_it->second; | ||
connection.first = rights_row_it->second; | ||
result = _reaction_components[connection.first].component_type == ReactionComponent::MOLECULE && | ||
_reaction_components[connection.second].component_type == ReactionComponent::MOLECULE; | ||
} | ||
|
||
if (tops_col_it != tops_col.end() && bottoms_col_it != bottoms_col.end()) | ||
if (tops_col_it != tops_col.end() && bottoms_col_it != bottoms_col.end() && tops_col_it->second != bottoms_col_it->second) |
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.
same here
Generic request
#1234 – issue name