Revision: 77847
http://sourceforge.net/p/brlcad/code/77847
Author: starseeker
Date: 2020-12-01 15:17:06 +0000 (Tue, 01 Dec 2020)
Log Message:
-----------
More future-proofing of stepcode C++
Modified Paths:
--------------
brlcad/trunk/src/conv/step/g-step/Assembly_Product.cpp
brlcad/trunk/src/conv/step/g-step/Default_Geometric_Context.cpp
brlcad/trunk/src/conv/step/g-step/ON_NurbsCurve.cpp
brlcad/trunk/src/conv/step/g-step/ON_NurbsSurface.cpp
brlcad/trunk/src/conv/step/util/list_elements.cpp
brlcad/trunk/src/other/stepcode/src/clstepcore/STEPattribute.h
Modified: brlcad/trunk/src/conv/step/g-step/Assembly_Product.cpp
===================================================================
--- brlcad/trunk/src/conv/step/g-step/Assembly_Product.cpp 2020-12-01
14:43:07 UTC (rev 77846)
+++ brlcad/trunk/src/conv/step/g-step/Assembly_Product.cpp 2020-12-01
15:17:06 UTC (rev 77847)
@@ -267,12 +267,12 @@
if (!bu_strcmp(attr->Name(), "name")) attr->StrToVal("''");
if (!bu_strcmp(attr->Name(), "description")) attr->StrToVal("''");
if (!bu_strcmp(attr->Name(), "rep_1")) {
- attr->ptr.c = new (STEPentity *);
- *(attr->ptr.c) = parent;
+ attr->Raw()->c = new (STEPentity *);
+ *(attr->Raw()->c) = parent;
}
if (!bu_strcmp(attr->Name(), "rep_2")) {
- attr->ptr.c = new (STEPentity *);
- *(attr->ptr.c) = child;
+ attr->Raw()->c = new (STEPentity *);
+ *(attr->Raw()->c) = child;
}
}
@@ -282,7 +282,7 @@
while ((attr = stepcomplex->NextAttribute()) != NULL) {
if (!bu_strcmp(attr->Name(), "transformation_operator")) {
SdaiTransformation *transformation = new
SdaiTransformation((SdaiItem_defined_transformation *)input_transformation);
- attr->ptr.sh = transformation;
+ attr->Raw()->sh = transformation;
}
}
Modified: brlcad/trunk/src/conv/step/g-step/Default_Geometric_Context.cpp
===================================================================
--- brlcad/trunk/src/conv/step/g-step/Default_Geometric_Context.cpp
2020-12-01 14:43:07 UTC (rev 77846)
+++ brlcad/trunk/src/conv/step/g-step/Default_Geometric_Context.cpp
2020-12-01 15:17:06 UTC (rev 77847)
@@ -50,8 +50,8 @@
if (!bu_strcmp(stepcomplex->EntityName(), "Si_Unit")) {
stepcomplex->ResetAttributes();
while ((attr = stepcomplex->NextAttribute()) != NULL) {
- if (!bu_strcmp(attr->Name(), "prefix")) attr->ptr.e = new
SdaiSi_prefix_var(Si_prefix__milli);
- if (!bu_strcmp(attr->Name(), "name")) attr->ptr.e = new
SdaiSi_unit_name_var(Si_unit_name__metre);
+ if (!bu_strcmp(attr->Name(), "prefix")) attr->Raw()->e = new
SdaiSi_prefix_var(Si_prefix__milli);
+ if (!bu_strcmp(attr->Name(), "name")) attr->Raw()->e = new
SdaiSi_unit_name_var(Si_unit_name__metre);
}
}
stepcomplex = stepcomplex->sc;
@@ -61,7 +61,7 @@
uncertainty->ResetAttributes();
{
while ((attr = uncertainty->NextAttribute()) != NULL) {
- if (!bu_strcmp(attr->Name(), "unit_component")) attr->ptr.sh =
new_unit;
+ if (!bu_strcmp(attr->Name(), "unit_component")) attr->Raw()->sh =
new_unit;
if (!bu_strcmp(attr->Name(), "value_component"))
attr->StrToVal("0.05");
}
}
@@ -74,7 +74,7 @@
if (!bu_strcmp(stepcomplex->EntityName(), "Si_Unit")) {
stepcomplex->ResetAttributes();
while ((attr = stepcomplex->NextAttribute()) != NULL) {
- if (!bu_strcmp(attr->Name(), "name")) attr->ptr.e = new
SdaiSi_unit_name_var(Si_unit_name__steradian);
+ if (!bu_strcmp(attr->Name(), "name")) attr->Raw()->e = new
SdaiSi_unit_name_var(Si_unit_name__steradian);
}
}
stepcomplex = stepcomplex->sc;
@@ -89,7 +89,7 @@
if (!bu_strcmp(stepcomplex->EntityName(), "Si_Unit")) {
stepcomplex->ResetAttributes();
while ((attr = stepcomplex->NextAttribute()) != NULL) {
- if (!bu_strcmp(attr->Name(), "name")) attr->ptr.e = new
SdaiSi_unit_name_var(Si_unit_name__radian);
+ if (!bu_strcmp(attr->Name(), "name")) attr->Raw()->e = new
SdaiSi_unit_name_var(Si_unit_name__radian);
}
}
stepcomplex = stepcomplex->sc;
@@ -129,8 +129,8 @@
while ((attr = stepcomplex->NextAttribute()) != NULL) {
if (!bu_strcmp(attr->Name(), "name"))
attr->StrToVal("'DEGREES'");
if (!bu_strcmp(attr->Name(), "conversion_factor")) {
- attr->ptr.c = new (STEPentity *);
- *(attr->ptr.c) = (STEPentity *)(p_ang_measure_with_unit);
+ attr->Raw()->c = new (STEPentity *);
+ *(attr->Raw()->c) = (STEPentity *)(p_ang_measure_with_unit);
}
}
}
@@ -138,8 +138,8 @@
stepcomplex->ResetAttributes();
while ((attr = stepcomplex->NextAttribute()) != NULL) {
if (!bu_strcmp(attr->Name(), "dimensions")) {
- attr->ptr.c = new (STEPentity *);
- *(attr->ptr.c) = (STEPentity *)(dimensional_exp);
+ attr->Raw()->c = new (STEPentity *);
+ *(attr->Raw()->c) = (STEPentity *)(dimensional_exp);
}
}
}
@@ -172,7 +172,7 @@
if (!bu_strcmp(attr->Name(), "uncertainty")) {
EntityAggregate *unc_agg = new EntityAggregate();
unc_agg->AddNode(new EntityNode((SDAI_Application_instance
*)uncertainty));
- attr->ptr.a = unc_agg;
+ attr->Raw()->a = unc_agg;
}
}
@@ -187,7 +187,7 @@
unit_assigned_agg->AddNode(new
EntityNode((SDAI_Application_instance *)unit_complex));
unit_assigned_agg->AddNode(new
EntityNode((SDAI_Application_instance *)ua_entry_2));
unit_assigned_agg->AddNode(new
EntityNode((SDAI_Application_instance *)ua_entry_1));
- attr->ptr.a = unit_assigned_agg;
+ attr->Raw()->a = unit_assigned_agg;
}
}
}
Modified: brlcad/trunk/src/conv/step/g-step/ON_NurbsCurve.cpp
===================================================================
--- brlcad/trunk/src/conv/step/g-step/ON_NurbsCurve.cpp 2020-12-01 14:43:07 UTC
(rev 77846)
+++ brlcad/trunk/src/conv/step/g-step/ON_NurbsCurve.cpp 2020-12-01 15:17:06 UTC
(rev 77847)
@@ -81,16 +81,16 @@
stepcomplex->ResetAttributes();
while ((attr = stepcomplex->NextAttribute()) != NULL) {
if (!bu_strcmp(attr->Name(), "degree")) {
- attr->ptr.i = new SDAI_Integer(ncurve->Degree());
+ attr->Raw()->i = new SDAI_Integer(ncurve->Degree());
}
if (!bu_strcmp(attr->Name(), "control_points_list")) {
EntityAggregate *control_pnts= new EntityAggregate();
ON_NurbsCurveCV_to_EntityAggregate(control_pnts, ncurve, info);
- attr->ptr.a = control_pnts;
+ attr->Raw()->a = control_pnts;
}
- if (!bu_strcmp(attr->Name(), "curve_form")) attr->ptr.e = new
SdaiB_spline_curve_form_var(B_spline_curve_form__unspecified);
- if (!bu_strcmp(attr->Name(), "closed_curve")) attr->ptr.e = new
SDAI_LOGICAL((Logical)(ncurve->IsClosed()));
- if (!bu_strcmp(attr->Name(), "self_intersect")) attr->ptr.e = new
SDAI_LOGICAL(LFalse);
+ if (!bu_strcmp(attr->Name(), "curve_form")) attr->Raw()->e = new
SdaiB_spline_curve_form_var(B_spline_curve_form__unspecified);
+ if (!bu_strcmp(attr->Name(), "closed_curve")) attr->Raw()->e = new
SDAI_LOGICAL((Logical)(ncurve->IsClosed()));
+ if (!bu_strcmp(attr->Name(), "self_intersect")) attr->Raw()->e = new
SDAI_LOGICAL(LFalse);
}
/* Set knots */
@@ -101,12 +101,12 @@
ON_NurbsCurveKnots_to_Aggregates(knot_multiplicities, knots, ncurve);
while ((attr = stepcomplex->NextAttribute()) != NULL) {
if (!bu_strcmp(attr->Name(), "knot_multiplicities")) {
- attr->ptr.a = knot_multiplicities;
+ attr->Raw()->a = knot_multiplicities;
}
if (!bu_strcmp(attr->Name(), "knots")) {
- attr->ptr.a = knots;
+ attr->Raw()->a = knots;
}
- if (!bu_strcmp(attr->Name(), "knot_spec")) attr->ptr.e = new
SdaiKnot_type_var(Knot_type__unspecified);
+ if (!bu_strcmp(attr->Name(), "knot_spec")) attr->Raw()->e = new
SdaiKnot_type_var(Knot_type__unspecified);
}
/* Set weights */
@@ -120,7 +120,7 @@
wnode->value = ncurve->Weight(i);
weights->AddNode(wnode);
}
- attr->ptr.a = weights;
+ attr->Raw()->a = weights;
}
/* Representation item */
Modified: brlcad/trunk/src/conv/step/g-step/ON_NurbsSurface.cpp
===================================================================
--- brlcad/trunk/src/conv/step/g-step/ON_NurbsSurface.cpp 2020-12-01
14:43:07 UTC (rev 77846)
+++ brlcad/trunk/src/conv/step/g-step/ON_NurbsSurface.cpp 2020-12-01
15:17:06 UTC (rev 77847)
@@ -127,19 +127,19 @@
stepcomplex = complex_entity->EntityPart("b_spline_surface");
stepcomplex->ResetAttributes();
while ((attr = stepcomplex->NextAttribute()) != NULL) {
- if (!bu_strcmp(attr->Name(), "u_degree")) attr->ptr.i = new
SDAI_Integer(nsurface->Degree(0));
- if (!bu_strcmp(attr->Name(), "v_degree")) attr->ptr.i = new
SDAI_Integer(nsurface->Degree(1));
+ if (!bu_strcmp(attr->Name(), "u_degree")) attr->Raw()->i = new
SDAI_Integer(nsurface->Degree(0));
+ if (!bu_strcmp(attr->Name(), "v_degree")) attr->Raw()->i = new
SDAI_Integer(nsurface->Degree(1));
if (!bu_strcmp(attr->Name(), "control_points_list")) {
GenericAggregate *control_pnts= new GenericAggregate();
ON_NurbsSurfaceCV_Initialize(nsurface, complex_entity, info);
- attr->ptr.a = control_pnts;
+ attr->Raw()->a = control_pnts;
info->surf_genagg[(STEPentity*)complex_entity] = control_pnts;
}
- if (!bu_strcmp(attr->Name(), "surface_form")) attr->ptr.e = new
SdaiB_spline_surface_form_var(B_spline_surface_form__unspecified);
- if (!bu_strcmp(attr->Name(), "u_closed")) attr->ptr.e = new
SDAI_LOGICAL((Logical)(nsurface->IsClosed(0)));
- if (!bu_strcmp(attr->Name(), "v_closed")) attr->ptr.e = new
SDAI_LOGICAL((Logical)(nsurface->IsClosed(1)));
- if (!bu_strcmp(attr->Name(), "self_intersect")) attr->ptr.e = new
SDAI_LOGICAL(LFalse);
+ if (!bu_strcmp(attr->Name(), "surface_form")) attr->Raw()->e = new
SdaiB_spline_surface_form_var(B_spline_surface_form__unspecified);
+ if (!bu_strcmp(attr->Name(), "u_closed")) attr->Raw()->e = new
SDAI_LOGICAL((Logical)(nsurface->IsClosed(0)));
+ if (!bu_strcmp(attr->Name(), "v_closed")) attr->Raw()->e = new
SDAI_LOGICAL((Logical)(nsurface->IsClosed(1)));
+ if (!bu_strcmp(attr->Name(), "self_intersect")) attr->Raw()->e = new
SDAI_LOGICAL(LFalse);
}
/* Set knots */
@@ -154,13 +154,13 @@
while ((attr = stepcomplex->NextAttribute()) != NULL) {
- if (!bu_strcmp(attr->Name(), "u_multiplicities")) attr->ptr.a =
u_multiplicities;
- if (!bu_strcmp(attr->Name(), "v_multiplicities")) attr->ptr.a =
v_multiplicities;
+ if (!bu_strcmp(attr->Name(), "u_multiplicities")) attr->Raw()->a =
u_multiplicities;
+ if (!bu_strcmp(attr->Name(), "v_multiplicities")) attr->Raw()->a =
v_multiplicities;
- if (!bu_strcmp(attr->Name(), "u_knots")) attr->ptr.a = u_knots;
- if (!bu_strcmp(attr->Name(), "v_knots")) attr->ptr.a = v_knots;
+ if (!bu_strcmp(attr->Name(), "u_knots")) attr->Raw()->a = u_knots;
+ if (!bu_strcmp(attr->Name(), "v_knots")) attr->Raw()->a = v_knots;
- if (!bu_strcmp(attr->Name(), "knot_spec")) attr->ptr.e = new
SdaiKnot_type_var(Knot_type__unspecified);
+ if (!bu_strcmp(attr->Name(), "knot_spec")) attr->Raw()->e = new
SdaiKnot_type_var(Knot_type__unspecified);
}
/* Set weights */
@@ -181,7 +181,7 @@
weights->AddNode(new GenericAggrNode(str.c_str()));
}
- attr->ptr.a = weights;
+ attr->Raw()->a = weights;
}
}
Modified: brlcad/trunk/src/conv/step/util/list_elements.cpp
===================================================================
--- brlcad/trunk/src/conv/step/util/list_elements.cpp 2020-12-01 14:43:07 UTC
(rev 77846)
+++ brlcad/trunk/src/conv/step/util/list_elements.cpp 2020-12-01 15:17:06 UTC
(rev 77847)
@@ -79,7 +79,7 @@
//cout << attrCount << " attributes." << endl;
- const EntityDescriptorList * supertypeList = &(ent->eDesc->Supertypes());
+ const EntityDescriptorList * supertypeList =
&(ent->getEDesc()->Supertypes());
EntityDescLinkNode * supertypePtr = (EntityDescLinkNode
*)supertypeList->GetHead();
entDesc = 0;
while (supertypePtr != 0) {
@@ -92,7 +92,7 @@
}
- const EntityDescriptorList * subtypeList = &(ent->eDesc->Subtypes());
+ const EntityDescriptorList * subtypeList = &(ent->getEDesc()->Subtypes());
EntityDescLinkNode * subtypePtr = (EntityDescLinkNode
*)subtypeList->GetHead();
entDesc = 0;
while (subtypePtr != 0) {
@@ -108,7 +108,7 @@
STEPattribute * attr = ent->NextAttribute();
while (attr != 0) {
- const AttrDescriptor * attrDesc = attr->aDesc;
+ const AttrDescriptor * attrDesc = attr->getADesc();
cout << " " << attrDesc->Name() << "[" << attrDesc->TypeName() <<
"]\n";
attr = ent->NextAttribute();
}
Modified: brlcad/trunk/src/other/stepcode/src/clstepcore/STEPattribute.h
===================================================================
--- brlcad/trunk/src/other/stepcode/src/clstepcore/STEPattribute.h
2020-12-01 14:43:07 UTC (rev 77846)
+++ brlcad/trunk/src/other/stepcode/src/clstepcore/STEPattribute.h
2020-12-01 15:17:06 UTC (rev 77847)
@@ -93,6 +93,10 @@
const AttrDescriptor * aDesc;
int refCount;
+ const AttrDescriptor * getADesc() {
+ return aDesc;
+ }
+
/** \union ptr
** You know which of these to use based on the return value of
** NonRefType() - see below. BASE_TYPE is defined in baseType.h
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits