Skip to content

Commit

Permalink
Use the define rather than a raw number
Browse files Browse the repository at this point in the history
Arguably this isn't strictly accurate, since libnmg I/O versioning isn't
TECHNICALLY tied in a data sense to .g I/O versions, but functionally it should
be fine and provides at least a little context.

The broader problem here is needing to use versioned librt routines in an API
that only really wants to be working with rt_db_internal structs.  Wondering if
it wouldn't be cleaner to encode versioning of the idb_ptr data in the
rt_db_internal container rather than needing to propagate the dbip for that...
  • Loading branch information
starseeker committed Feb 3, 2025
1 parent 4d3de1e commit 54ac880
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions include/rt/db_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ struct rt_functab; /* forward declaration */

/**
* A handle on the internal format of a BRL-CAD database object.
*
* TODO - right now, rt_db_internal doesn't encode any notion of data version,
* which appears to be a major reason some APIs need to pass a dbip through in
* addition to the rt_db_internal. Should we add an idb_version entry here to
* indicate idb_ptr data versioning?
*/
struct rt_db_internal {
uint32_t idb_magic;
Expand Down
2 changes: 1 addition & 1 deletion src/librt/primitives/nmg/nmg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1633,7 +1633,7 @@ rt_nmg_mat(struct rt_db_internal *rop, const mat_t mat, const struct rt_db_inter
return BRLCAD_ERROR;

// Import
struct model *nm = nmg_import(&ext, mat, 5);
struct model *nm = nmg_import(&ext, mat, BRLCAD_DB_FORMAT_LATEST);
nmg_km(m);
rop->idb_ptr = nm;

Expand Down

0 comments on commit 54ac880

Please sign in to comment.