Skip to content

Commit

Permalink
Improve DIMASSOC object
Browse files Browse the repository at this point in the history
  • Loading branch information
michal-josef-spacek committed Oct 10, 2024
1 parent b90fcfc commit a41e040
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 28 deletions.
29 changes: 17 additions & 12 deletions include/dwg.h
Original file line number Diff line number Diff line change
Expand Up @@ -5282,20 +5282,25 @@ typedef struct _dwg_object_DATALINK
typedef struct _dwg_DIMASSOC_Ref
{
struct _dwg_object_DIMASSOC *parent;
BITCODE_T classname; /*!< DXF 1 constant */
BITCODE_RC osnap_type; /*!< DXF 72 */
BITCODE_BD osnap_dist; /*!< DXF 40 */
BITCODE_3BD osnap_pt; /*!< DXF 10-30 */
BITCODE_T classname; /*!< DXF 1 constant */
BITCODE_RC osnap_type; /*!< DXF 72 */
BITCODE_BD osnap_dist; /*!< DXF 40 */
BITCODE_3BD osnap_pt; /*!< DXF 10-30 */
BITCODE_BS num_xrefs;
BITCODE_H *xrefs; /*!< DXF 331 the geometry objects, 1 or 2 */
BITCODE_BS main_subent_type; /*!< DXF 73 */
BITCODE_BL main_gsmarker; /*!< DXF 91 */
BITCODE_H *xrefs; /*!< DXF 331 the geometry objects, 1 or 2 */
BITCODE_BS main_subent_type; /*!< DXF 73 */
BITCODE_BL main_gsmarker; /*!< DXF 91 */
BITCODE_BS num_xrefpaths;
BITCODE_T *xrefpaths; /*!< DXF 301 */
BITCODE_B has_lastpt_ref; /*!< DXF 75 */
BITCODE_3BD lastpt_ref; /*!< DXF ?? */
BITCODE_BL num_intsectobj; /*!< DXF 74 */
BITCODE_H* intsectobj; /*!< DXF 332 the intersection objects, 1 or 2 */
BITCODE_T *xrefpaths; /*!< DXF 301 */
BITCODE_BS num_intersec_xrefpaths;
BITCODE_T *intersec_xrefpaths; /*!< DXF 302 */
BITCODE_B has_lastpt_ref; /*!< DXF 75 */
BITCODE_3BD lastpt_ref; /*!< DXF ?? */
BITCODE_BS intersec_subent_type; /*!< DXF 74 */
BITCODE_BL intersec_gsmarker; /*!< DXF 92 */
BITCODE_BL num_intsectobj;
BITCODE_H* intsectobj; /*!< DXF 332 the intersection objects, 1 or 2 */
BITCODE_B unknown;
} Dwg_DIMASSOC_Ref;

typedef struct _dwg_object_DIMASSOC
Expand Down
33 changes: 17 additions & 16 deletions src/dwg.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9908,30 +9908,31 @@ DWG_OBJECT (DIMASSOC)
continue;
}
LOG_HANDLE ("DIMASSOC_Ref.rcount1: %d\n", rcount1);
// DXF: 1, 72, 10, ??, 75
SUB_FIELD_T (ref[rcount1], classname, 1); // "AcDbOsnapPointRef"
SUB_FIELD_RC (ref[rcount1], osnap_type, 72); // 0-13
// idpaths:
SUB_FIELD_BL0 (ref[rcount1], num_intsectobj, 74);
SUB_HANDLE_VECTOR (ref[rcount1], intsectobj, num_intsectobj, 5, 332);

SUB_FIELD_BD (ref[rcount1], osnap_dist, 40);
SUB_FIELD_3BD (ref[rcount1], osnap_pt, 10);

// XrefFullSubentPath
SUB_FIELD_BL (ref[rcount1], num_xrefs, 0); // 1 or 2
SUB_VALUEOUTOFBOUNDS (ref[rcount1], num_xrefs, 100)
SUB_FIELD_BL (ref[rcount1], num_xrefs, 0);
SUB_HANDLE_VECTOR (ref[rcount1], xrefs, num_xrefs, 4, 331);

// restrict only when writing, not when reading?
//if (FIELD_VALUE (ref[rcount1].osnap_type) == 6 || FIELD_VALUE (ref[rcount1].osnap_type) == 11)
// {
SUB_FIELD_BL0 (ref[rcount1], main_subent_type, 73);
SUB_FIELD_BL (ref[rcount1], main_subent_type, 73);
SUB_FIELD_BL (ref[rcount1], main_gsmarker, 91);
SUB_FIELD_BL (ref[rcount1], num_xrefpaths, 0);
FIELD_VECTOR_T (ref[rcount1].xrefpaths, T, ref[rcount1].num_xrefpaths, 301)
// }
SUB_FIELD_B (ref[rcount1], has_lastpt_ref, 75);

SUB_FIELD_BD (ref[rcount1], osnap_dist, 40);
SUB_FIELD_3BD (ref[rcount1], osnap_pt, 10);

// restrict only when writing, not when reading?
if (FIELD_VALUE (ref[rcount1].osnap_type) == 6 || FIELD_VALUE (ref[rcount1].osnap_type) == 11)
{
SUB_FIELD_BL (ref[rcount1], num_intsectobj, 0);
SUB_HANDLE_VECTOR (ref[rcount1], intsectobj, num_intsectobj, 5, 332);
SUB_FIELD_BL (ref[rcount1], intersec_subent_type, 74);
SUB_FIELD_BL (ref[rcount1], intersec_gsmarker, 92);
SUB_FIELD_BL (ref[rcount1], num_intersec_xrefpaths, 0);
FIELD_VECTOR_T (ref[rcount1].intersec_xrefpaths, T, ref[rcount1].num_intersec_xrefpaths, 302)
}
SUB_FIELD_B (ref[rcount1], has_lastpt_ref, 75);
if (FIELD_VALUE (ref[rcount1].has_lastpt_ref))
{
SUB_FIELD_3BD (ref[rcount1], lastpt_ref, 0);
Expand Down

0 comments on commit a41e040

Please sign in to comment.