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

region color #153

Merged
merged 4 commits into from
Aug 9, 2024
Merged

region color #153

merged 4 commits into from
Aug 9, 2024

Conversation

AliHaider93
Copy link
Contributor

implementation of random coloring for the regions

for (size_t i = 0; i < names.size(); i++) {
mk_addmember(names[i].c_str(), &(geometry_head.l), NULL, WMOP_UNION);
mk_addmember(names[i].c_str(), &(all_head.l), NULL, WMOP_UNION);
}
mk_lfcomb(wdbp, geometry.getBaseName(), &geometry_head, 0);

mk_comb(wdbp, geometry.getBaseName(), &geometry_head.l, 1, (char*)NULL, (char*)NULL, rgb, ID_COMBINATION, 0, 0, 0, 0, 0, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Is this (char*) cast really necessary?
  • The id or region_id is usually a unique number of a region, and not related to ID_COMBINATION. The "default" would be an increasing integer.
  • Why not mk_lcomb()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checking and will update.

mk_lfcomb(wdbp, geometry.getBaseName(), &geometry_head, 0);

mk_lcomb(wdbp, geometry.getBaseName(), &geometry_head, 1, NULL, NULL, rgb, region_id);
++region_id;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more (new) thing 😈: Please, start the region IDs with 1. You can do this by writing ++region_id inside the mk_lcomb: mk_lcomb(wdbp, geometry.getBaseName(), &geometry_head, 1, NULL, NULL, rgb, ++region_id);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, will update.

@drossberg drossberg merged commit cf73468 into BRL-CAD:devel_k-g Aug 9, 2024
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.

2 participants