Skip to content

Commit a41e040

Browse files
Improve DIMASSOC object
1 parent b90fcfc commit a41e040

File tree

2 files changed

+34
-28
lines changed

2 files changed

+34
-28
lines changed

include/dwg.h

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5282,20 +5282,25 @@ typedef struct _dwg_object_DATALINK
52825282
typedef struct _dwg_DIMASSOC_Ref
52835283
{
52845284
struct _dwg_object_DIMASSOC *parent;
5285-
BITCODE_T classname; /*!< DXF 1 constant */
5286-
BITCODE_RC osnap_type; /*!< DXF 72 */
5287-
BITCODE_BD osnap_dist; /*!< DXF 40 */
5288-
BITCODE_3BD osnap_pt; /*!< DXF 10-30 */
5285+
BITCODE_T classname; /*!< DXF 1 constant */
5286+
BITCODE_RC osnap_type; /*!< DXF 72 */
5287+
BITCODE_BD osnap_dist; /*!< DXF 40 */
5288+
BITCODE_3BD osnap_pt; /*!< DXF 10-30 */
52895289
BITCODE_BS num_xrefs;
5290-
BITCODE_H *xrefs; /*!< DXF 331 the geometry objects, 1 or 2 */
5291-
BITCODE_BS main_subent_type; /*!< DXF 73 */
5292-
BITCODE_BL main_gsmarker; /*!< DXF 91 */
5290+
BITCODE_H *xrefs; /*!< DXF 331 the geometry objects, 1 or 2 */
5291+
BITCODE_BS main_subent_type; /*!< DXF 73 */
5292+
BITCODE_BL main_gsmarker; /*!< DXF 91 */
52935293
BITCODE_BS num_xrefpaths;
5294-
BITCODE_T *xrefpaths; /*!< DXF 301 */
5295-
BITCODE_B has_lastpt_ref; /*!< DXF 75 */
5296-
BITCODE_3BD lastpt_ref; /*!< DXF ?? */
5297-
BITCODE_BL num_intsectobj; /*!< DXF 74 */
5298-
BITCODE_H* intsectobj; /*!< DXF 332 the intersection objects, 1 or 2 */
5294+
BITCODE_T *xrefpaths; /*!< DXF 301 */
5295+
BITCODE_BS num_intersec_xrefpaths;
5296+
BITCODE_T *intersec_xrefpaths; /*!< DXF 302 */
5297+
BITCODE_B has_lastpt_ref; /*!< DXF 75 */
5298+
BITCODE_3BD lastpt_ref; /*!< DXF ?? */
5299+
BITCODE_BS intersec_subent_type; /*!< DXF 74 */
5300+
BITCODE_BL intersec_gsmarker; /*!< DXF 92 */
5301+
BITCODE_BL num_intsectobj;
5302+
BITCODE_H* intsectobj; /*!< DXF 332 the intersection objects, 1 or 2 */
5303+
BITCODE_B unknown;
52995304
} Dwg_DIMASSOC_Ref;
53005305

53015306
typedef struct _dwg_object_DIMASSOC

src/dwg.spec

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9908,30 +9908,31 @@ DWG_OBJECT (DIMASSOC)
99089908
continue;
99099909
}
99109910
LOG_HANDLE ("DIMASSOC_Ref.rcount1: %d\n", rcount1);
9911-
// DXF: 1, 72, 10, ??, 75
99129911
SUB_FIELD_T (ref[rcount1], classname, 1); // "AcDbOsnapPointRef"
99139912
SUB_FIELD_RC (ref[rcount1], osnap_type, 72); // 0-13
99149913
// idpaths:
9915-
SUB_FIELD_BL0 (ref[rcount1], num_intsectobj, 74);
9916-
SUB_HANDLE_VECTOR (ref[rcount1], intsectobj, num_intsectobj, 5, 332);
9917-
9918-
SUB_FIELD_BD (ref[rcount1], osnap_dist, 40);
9919-
SUB_FIELD_3BD (ref[rcount1], osnap_pt, 10);
9920-
9921-
// XrefFullSubentPath
9922-
SUB_FIELD_BL (ref[rcount1], num_xrefs, 0); // 1 or 2
9923-
SUB_VALUEOUTOFBOUNDS (ref[rcount1], num_xrefs, 100)
9914+
SUB_FIELD_BL (ref[rcount1], num_xrefs, 0);
99249915
SUB_HANDLE_VECTOR (ref[rcount1], xrefs, num_xrefs, 4, 331);
99259916

9926-
// restrict only when writing, not when reading?
9927-
//if (FIELD_VALUE (ref[rcount1].osnap_type) == 6 || FIELD_VALUE (ref[rcount1].osnap_type) == 11)
9928-
// {
9929-
SUB_FIELD_BL0 (ref[rcount1], main_subent_type, 73);
9917+
SUB_FIELD_BL (ref[rcount1], main_subent_type, 73);
99309918
SUB_FIELD_BL (ref[rcount1], main_gsmarker, 91);
99319919
SUB_FIELD_BL (ref[rcount1], num_xrefpaths, 0);
99329920
FIELD_VECTOR_T (ref[rcount1].xrefpaths, T, ref[rcount1].num_xrefpaths, 301)
9933-
// }
9934-
SUB_FIELD_B (ref[rcount1], has_lastpt_ref, 75);
9921+
9922+
SUB_FIELD_BD (ref[rcount1], osnap_dist, 40);
9923+
SUB_FIELD_3BD (ref[rcount1], osnap_pt, 10);
9924+
9925+
// restrict only when writing, not when reading?
9926+
if (FIELD_VALUE (ref[rcount1].osnap_type) == 6 || FIELD_VALUE (ref[rcount1].osnap_type) == 11)
9927+
{
9928+
SUB_FIELD_BL (ref[rcount1], num_intsectobj, 0);
9929+
SUB_HANDLE_VECTOR (ref[rcount1], intsectobj, num_intsectobj, 5, 332);
9930+
SUB_FIELD_BL (ref[rcount1], intersec_subent_type, 74);
9931+
SUB_FIELD_BL (ref[rcount1], intersec_gsmarker, 92);
9932+
SUB_FIELD_BL (ref[rcount1], num_intersec_xrefpaths, 0);
9933+
FIELD_VECTOR_T (ref[rcount1].intersec_xrefpaths, T, ref[rcount1].num_intersec_xrefpaths, 302)
9934+
}
9935+
SUB_FIELD_B (ref[rcount1], has_lastpt_ref, 75);
99359936
if (FIELD_VALUE (ref[rcount1].has_lastpt_ref))
99369937
{
99379938
SUB_FIELD_3BD (ref[rcount1], lastpt_ref, 0);

0 commit comments

Comments
 (0)