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

add a dynamic object/field API #59

Closed
rurban opened this issue Nov 29, 2018 · 2 comments
Closed

add a dynamic object/field API #59

rurban opened this issue Nov 29, 2018 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@rurban
Copy link
Contributor

rurban commented Nov 29, 2018

It's required for interfacing dynamic languages to provide a better dynamic API, and for the importers, a precompiled list or hash of all known elements, objects and subtypes with all its properties.
These can be generated via processing the dwg.h or dwg.spec into gperf hashes or arrays.
The needed info per field would be: name, type, offsetof(), (dxf).

Then we could also implement a dwgfilter program (#64), which allows filtering on user-defined, dynamic objects and it's properties. e.g. dwglayer, dwgxrefs, ...
analog to osmfilter

we could also get rid of the massively big and unmaintainable dwg_api functions, replacing it with the dynamic versions, separated by type. and add a reflective api, e.g. return the VERTEX_2D fields, the type of the VERTEX_3D.point field, ...

  • rename dwg_get_OBJECT(dwg) to dwg_getall_OBJECT(dwg)
  • rename dwg_get_ENTITY(blkhdr) to dwg_getall_ENTITY(blkhdr)
  • add dwg_get_OBJECT(obj, field) field getters by string (single field only)
  • add dwg_set_HEADER(dwg, field, value, ...), dwg_set_OBJECT(obj, field, value, ...) set multiple fields.
    e.g. for 3RD: dwg_set_VERTEX_2D(obj, "point", 0.0, 0.0, 1.0);
@rurban rurban added the enhancement New feature or request label Nov 29, 2018
@rurban rurban self-assigned this Dec 2, 2018
rurban added a commit that referenced this issue Dec 4, 2018
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Dec 4, 2018
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Dec 4, 2018
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Dec 5, 2018
no inline structs in WIPEOUT and IMAGE.
convert inline struct { width; height } to 2RD (x,y).
The size is documented as size (u,v),
not width/height in the AutoCAD DXF docs.

This is mostly to simplify the dynapi #59
rurban added a commit that referenced this issue Dec 5, 2018
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Dec 5, 2018
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
@rurban rurban changed the title add a dynamic object/propery API add a dynamic object/field API Dec 5, 2018
@rurban rurban added this to the 0.8 milestone Dec 5, 2018
rurban added a commit that referenced this issue Dec 5, 2018
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Dec 7, 2018
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Dec 7, 2018
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Dec 10, 2018
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Dec 10, 2018
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Dec 12, 2018
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Dec 12, 2018
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Dec 19, 2018
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Dec 19, 2018
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Dec 26, 2018
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Dec 26, 2018
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Jan 16, 2019
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Jan 17, 2019
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Jan 17, 2019
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Jan 17, 2019
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
@rurban
Copy link
Contributor Author

rurban commented Jan 20, 2019

dynapi getters finished with 2d7220d
dynapi setters finished with 47386de
(still yet unused, just tested)

TODO:

  • switch over dwg_api to use it (and deprecate/delete most static funcs)
  • add a dxfgroup field and search for it. (for dxfin)
  • add convenience api (with obj, not ent/_obj) as described
  • add dynapi for common_data fields (and handles)
  • some dynamic arrays either need a size arg (eg. INSERT.attrib_handles H*) or just work with the ptr on the array. is_malloc 1, is_indirect, is_string (for null-terminated strings)

rurban added a commit that referenced this issue Jan 25, 2019
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Jan 25, 2019
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Jan 25, 2019
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Jan 27, 2019
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Jan 27, 2019
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Jan 27, 2019
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Jan 27, 2019
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Jan 27, 2019
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Jan 27, 2019
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Jan 27, 2019
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Jan 28, 2019
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Jan 28, 2019
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Jan 28, 2019
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Jan 28, 2019
Generate dwg.h struct names and field types, offsets.
TODO: types not as string?
      link _fields[] to some name array,
        either dwg_name_types or dwg_entity_names

See #59
rurban added a commit that referenced this issue Jan 28, 2019
rurban added a commit that referenced this issue Jan 28, 2019
all entites and objects, also all missing typedefs.
The api should be now complete, sans the common fields
@rurban
Copy link
Contributor Author

rurban commented Jan 30, 2019

merged with f4c7d63

@rurban rurban closed this as completed Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant