Revision: 77950
          http://sourceforge.net/p/brlcad/code/77950
Author:   starseeker
Date:     2020-12-08 16:37:33 +0000 (Tue, 08 Dec 2020)
Log Message:
-----------
Revert compatibility changes for upstream stepcode.

After discussions with Sean, it's not clear these methods would be
regarded as best practice and we may simply change upstream to
re-expose the direct pointers.

Also, rather than altering our copy, the promising results with the
extbuild experiments suggest it is time to look at getting back in
sync with upstream.  However, rather than doing this in extbuild
and conflating it with those changes, the decision is to do the
stepcode sync in a separate branch. This will allow for easier
testing and change review.

Modified Paths:
--------------
    brlcad/trunk/src/conv/step/STEPWrapper.cpp
    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/step-g/BSplineCurveWithKnots.cpp
    brlcad/trunk/src/conv/step/step-g/BSplineSurfaceWithKnots.cpp
    brlcad/trunk/src/conv/step/step-g/CartesianPoint.cpp
    brlcad/trunk/src/conv/step/step-g/Direction.cpp
    brlcad/trunk/src/conv/step/step-g/RationalBSplineCurve.cpp
    brlcad/trunk/src/conv/step/step-g/RationalBSplineSurface.cpp
    brlcad/trunk/src/conv/step/step-g/ShellBasedSurfaceModel.cpp
    brlcad/trunk/src/conv/step/step-g/SurfaceCurve.cpp
    brlcad/trunk/src/conv/step/step-g/TrimmedCurve.cpp
    brlcad/trunk/src/conv/step/util/list_elements.cpp
    brlcad/trunk/src/other/stepcode/src/clstepcore/STEPattribute.cc
    brlcad/trunk/src/other/stepcode/src/clstepcore/STEPattribute.h
    brlcad/trunk/src/other/stepcode/src/clstepcore/sdaiApplication_instance.cc
    brlcad/trunk/src/other/stepcode/src/clstepcore/sdaiApplication_instance.h

Modified: brlcad/trunk/src/conv/step/STEPWrapper.cpp
===================================================================
--- brlcad/trunk/src/conv/step/STEPWrapper.cpp  2020-12-08 15:13:05 UTC (rev 
77949)
+++ brlcad/trunk/src/conv/step/STEPWrapper.cpp  2020-12-08 16:37:33 UTC (rev 
77950)
@@ -763,7 +763,7 @@
        std::string attrname = attr->Name();
 
        if (attrname.compare(name) == 0) {
-           retValue = (Boolean)(*attr->Raw()->e).asInt();
+           retValue = (Boolean)(*attr->ptr.e).asInt();
            if (retValue > BUnset) {
                retValue = BUnset;
            }
@@ -787,7 +787,7 @@
        std::string attrname = attr->Name();
 
        if (attrname.compare(name) == 0) {
-           retValue = (*attr->Raw()->e).asInt();
+           retValue = (*attr->ptr.e).asInt();
            break;
        }
     }
@@ -808,7 +808,7 @@
        std::string attrname = attr->Name();
 
        if (attrname.compare(name) == 0) {
-           retValue = (Logical)(*attr->Raw()->e).asInt();
+           retValue = (Logical)(*attr->ptr.e).asInt();
            if (retValue > LUnknown) {
                retValue = LUnknown;
            }
@@ -875,7 +875,7 @@
        std::string attrname = attr->Name();
 
        if (attrname.compare(name) == 0) {
-           retValue = (SDAI_Application_instance *)*attr->Raw()->c;
+           retValue = (SDAI_Application_instance *)*attr->ptr.c;
            break;
        }
     }
@@ -896,7 +896,7 @@
        std::string attrname = attr->Name();
 
        if (attrname.compare(name) == 0) {
-           retValue = *attr->Raw()->i;
+           retValue = *attr->ptr.i;
            break;
        }
     }
@@ -917,7 +917,7 @@
        std::string attrname = attr->Name();
 
        if (attrname.compare(name) == 0) {
-           retValue = *attr->Raw()->r;
+           retValue = *attr->ptr.r;
            break;
        }
     }
@@ -939,7 +939,7 @@
        std::string attrname = attr->Name();
 
        if (attrname.compare(name) == 0) {
-           STEPaggregate *sa = (STEPaggregate *)attr->Raw()->a;
+           STEPaggregate *sa = (STEPaggregate *)attr->ptr.a;
 
            EntityNode *sn = (EntityNode *)sa->GetHead();
            SDAI_Application_instance *se;
@@ -977,7 +977,7 @@
            //std::cout << attr->TypeName() << std::endl;
 
 
-           GenericAggregate_ptr gp = (GenericAggregate_ptr)attr->Raw()->a;
+           GenericAggregate_ptr gp = (GenericAggregate_ptr)attr->ptr.a;
 
            STEPnode *sn = (STEPnode *)gp->GetHead();
            //EntityAggregate *ag = new EntityAggregate();
@@ -1113,7 +1113,7 @@
        std::string attrname = attr->Name();
 
        if (attrname.compare(name) == 0) {
-           retValue = (Boolean)(*attr->Raw()->e).asInt();
+           retValue = (Boolean)(*attr->ptr.e).asInt();
            if (retValue > BUnset) {
                retValue = BUnset;
            }
@@ -1137,8 +1137,8 @@
        std::string attrname = attr->Name();
 
        if (attrname.compare(name) == 0) {
-           retValue = (*attr->Raw()->e).asInt();
-           //std::cout << "debug enum: " << (*attr->Raw()->e).asStr(attrval) 
<< std::endl;
+           retValue = (*attr->ptr.e).asInt();
+           //std::cout << "debug enum: " << (*attr->ptr.e).asStr(attrval) << 
std::endl;
            break;
        }
     }
@@ -1164,7 +1164,7 @@
            std::string attrval;
            //std::cout << "attr:" << name << ":" << attr->TypeName() << ":" << 
attr->Name() << std::endl;
            //std::cout << "attr:" << attr->asStr(attrval) << std::endl;
-           retValue = (SDAI_Application_instance *)*attr->Raw()->c;
+           retValue = (SDAI_Application_instance *)*attr->ptr.c;
            break;
        }
     }
@@ -1184,7 +1184,7 @@
        std::string attrname = attr->Name();
 
        if (attrname.compare(name) == 0) {
-           retValue = (Logical)(*attr->Raw()->e).asInt();
+           retValue = (Logical)(*attr->ptr.e).asInt();
            if (retValue > LUnknown) {
                retValue = LUnknown;
            }
@@ -1207,7 +1207,7 @@
        std::string attrname = attr->Name();
 
        if (attrname.compare(name) == 0) {
-           retValue = *attr->Raw()->i;
+           retValue = *attr->ptr.i;
            break;
        }
     }
@@ -1227,7 +1227,7 @@
        std::string attrname = attr->Name();
 
        if (attrname.compare(name) == 0) {
-           retValue = *attr->Raw()->r;
+           retValue = *attr->ptr.r;
            break;
        }
     }
@@ -1247,7 +1247,7 @@
        std::string attrname = attr->Name();
 
        if (attrname.compare(name) == 0) {
-           retValue = (SDAI_Select *)attr->Raw()->sh;
+           retValue = (SDAI_Select *)attr->ptr.sh;
            break;
        }
     }
@@ -1268,7 +1268,7 @@
        std::string attrname = attr->Name();
 
        if (attrname.compare(name) == 0) {
-           STEPaggregate *sa = (STEPaggregate *)attr->Raw()->a;
+           STEPaggregate *sa = (STEPaggregate *)attr->ptr.a;
 
            EntityNode *sn = (EntityNode *)sa->GetHead();
            SDAI_Application_instance *se;
@@ -1300,7 +1300,7 @@
 
        if (attrname.compare(name) == 0) {
 
-           SelectAggregate *sa = (SelectAggregate *)attr->Raw()->a;
+           SelectAggregate *sa = (SelectAggregate *)attr->ptr.a;
            SelectNode *sn = (SelectNode *)sa->GetHead();
            while (sn) {
                l->push_back(sn->node);
@@ -1333,7 +1333,7 @@
            //std::cout << attr->TypeName() << std::endl;
 
 
-           GenericAggregate_ptr gp = (GenericAggregate_ptr)attr->Raw()->a;
+           GenericAggregate_ptr gp = (GenericAggregate_ptr)attr->ptr.a;
 
            STEPnode *sn = (STEPnode *)gp->GetHead();
            //EntityAggregate *ag = new EntityAggregate();
@@ -1377,7 +1377,7 @@
            //std::cout << attr->TypeName() << std::endl;
 
 
-           GenericAggregate_ptr gp = (GenericAggregate_ptr)attr->Raw()->a;
+           GenericAggregate_ptr gp = (GenericAggregate_ptr)attr->ptr.a;
 
            STEPnode *sn = (STEPnode *)gp->GetHead();
            //EntityAggregate *ag = new EntityAggregate();
@@ -1463,7 +1463,10 @@
        std::string attrname = attr->Name();
 
        if (attrname.compare(name) == 0) {
-           retValue = attr->asStr(attrval.c_str());
+           const char *str = attr->asStr(attrval);
+           if (str != NULL) {
+               retValue = str;
+           }
            break;
        }
     }
@@ -1589,11 +1592,11 @@
     for (int i = 0; i < level; i++) {
        std::cout << "    ";
     }
-    std::cout << "Description:" << se->getEDesc()->Description() << std::endl;
+    std::cout << "Description:" << se->eDesc->Description() << std::endl;
     for (int i = 0; i < level; i++) {
        std::cout << "    ";
     }
-    std::cout << "Entity Type:" << se->getEDesc()->Type() << std::endl;
+    std::cout << "Entity Type:" << se->eDesc->Type() << std::endl;
     for (int i = 0; i < level; i++) {
        std::cout << "    ";
     }
@@ -1607,7 +1610,7 @@
        for (int i = 0; i <= level; i++) {
            std::cout << "    ";
        }
-       std::cout << attr->Name() << ": " << attr->asStr(attrval.c_str()) << " 
TypeName: " << attr->TypeName() << " Type: " << attr->Type() << std::endl;
+       std::cout << attr->Name() << ": " << attr->asStr(attrval) << " 
TypeName: " << attr->TypeName() << " Type: " << attr->Type() << std::endl;
        if (attr->Type() == 256) {
            if (attr->IsDerived()) {
                for (int i = 0; i <= level; i++) {
@@ -1615,10 +1618,10 @@
                }
                std::cout << "        ********* DERIVED *********" << std::endl;
            } else {
-               printEntity(*(attr->Raw()->c), level + 2);
+               printEntity(*(attr->ptr.c), level + 2);
            }
        } else if ((attr->Type() == SET_TYPE) || (attr->Type() == LIST_TYPE)) {
-           STEPaggregate *sa = (STEPaggregate *)(attr->Raw()->a);
+           STEPaggregate *sa = (STEPaggregate *)(attr->ptr.a);
 
            // std::cout << "aggr:" << sa->asStr(attrval) << "  BaseType:" << 
attr->BaseType() << std::endl;
 
@@ -1647,9 +1650,9 @@
     while (sn != NULL) {
        sse = (SDAI_Application_instance *)sn->node;
 
-       if (((sse->getEDesc()->Type() == SET_TYPE) || (sse->getEDesc()->Type() 
== LIST_TYPE)) && (sse->getEDesc()->BaseType() == ENTITY_TYPE)) {
+       if (((sse->eDesc->Type() == SET_TYPE) || (sse->eDesc->Type() == 
LIST_TYPE)) && (sse->eDesc->BaseType() == ENTITY_TYPE)) {
            printEntityAggregate((STEPaggregate *)sse, level + 2);
-       } else if (sse->getEDesc()->Type() == ENTITY_TYPE) {
+       } else if (sse->eDesc->Type() == ENTITY_TYPE) {
            printEntity(sse, level + 2);
        } else {
            std::cout << "Instance Type not handled:" << std::endl;

Modified: brlcad/trunk/src/conv/step/g-step/Assembly_Product.cpp
===================================================================
--- brlcad/trunk/src/conv/step/g-step/Assembly_Product.cpp      2020-12-08 
15:13:05 UTC (rev 77949)
+++ brlcad/trunk/src/conv/step/g-step/Assembly_Product.cpp      2020-12-08 
16:37:33 UTC (rev 77950)
@@ -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->Raw()->c = new (STEPentity *);
-           *(attr->Raw()->c) = parent;
+           attr->ptr.c = new (STEPentity *);
+           *(attr->ptr.c) = parent;
        }
        if (!bu_strcmp(attr->Name(), "rep_2")) {
-           attr->Raw()->c = new (STEPentity *);
-           *(attr->Raw()->c) = child;
+           attr->ptr.c = new (STEPentity *);
+           *(attr->ptr.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->Raw()->sh = transformation;
+           attr->ptr.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-08 15:13:05 UTC (rev 77949)
+++ brlcad/trunk/src/conv/step/g-step/Default_Geometric_Context.cpp     
2020-12-08 16:37:33 UTC (rev 77950)
@@ -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->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);
+               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);
            }
        }
        stepcomplex = stepcomplex->sc;
@@ -61,7 +61,7 @@
     uncertainty->ResetAttributes();
     {
        while ((attr = uncertainty->NextAttribute()) != NULL) {
-           if (!bu_strcmp(attr->Name(), "unit_component")) attr->Raw()->sh = 
new_unit;
+           if (!bu_strcmp(attr->Name(), "unit_component")) attr->ptr.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->Raw()->e = new 
SdaiSi_unit_name_var(Si_unit_name__steradian);
+               if (!bu_strcmp(attr->Name(), "name")) attr->ptr.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->Raw()->e = new 
SdaiSi_unit_name_var(Si_unit_name__radian);
+               if (!bu_strcmp(attr->Name(), "name")) attr->ptr.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->Raw()->c = new (STEPentity *);
-                   *(attr->Raw()->c) = (STEPentity *)(p_ang_measure_with_unit);
+                   attr->ptr.c = new (STEPentity *);
+                   *(attr->ptr.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->Raw()->c = new (STEPentity *);
-                   *(attr->Raw()->c) = (STEPentity *)(dimensional_exp);
+                   attr->ptr.c = new (STEPentity *);
+                   *(attr->ptr.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->Raw()->a = unc_agg;
+                   attr->ptr.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->Raw()->a = unit_assigned_agg;
+                   attr->ptr.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-08 15:13:05 UTC 
(rev 77949)
+++ brlcad/trunk/src/conv/step/g-step/ON_NurbsCurve.cpp 2020-12-08 16:37:33 UTC 
(rev 77950)
@@ -81,16 +81,16 @@
     stepcomplex->ResetAttributes();
     while ((attr = stepcomplex->NextAttribute()) != NULL) {
        if (!bu_strcmp(attr->Name(), "degree")) {
-           attr->Raw()->i = new SDAI_Integer(ncurve->Degree());
+           attr->ptr.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->Raw()->a = control_pnts;
+           attr->ptr.a = control_pnts;
        }
-       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);
+       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);
     }
 
     /* 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->Raw()->a = knot_multiplicities;
+           attr->ptr.a = knot_multiplicities;
        }
        if (!bu_strcmp(attr->Name(), "knots")) {
-           attr->Raw()->a = knots;
+           attr->ptr.a = knots;
        }
-       if (!bu_strcmp(attr->Name(), "knot_spec")) attr->Raw()->e = new 
SdaiKnot_type_var(Knot_type__unspecified);
+       if (!bu_strcmp(attr->Name(), "knot_spec")) attr->ptr.e = new 
SdaiKnot_type_var(Knot_type__unspecified);
     }
 
     /* Set weights */
@@ -120,7 +120,7 @@
            wnode->value = ncurve->Weight(i);
            weights->AddNode(wnode);
        }
-       attr->Raw()->a = weights;
+       attr->ptr.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-08 
15:13:05 UTC (rev 77949)
+++ brlcad/trunk/src/conv/step/g-step/ON_NurbsSurface.cpp       2020-12-08 
16:37:33 UTC (rev 77950)
@@ -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->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(), "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(), "control_points_list")) {
            GenericAggregate *control_pnts= new GenericAggregate();
            ON_NurbsSurfaceCV_Initialize(nsurface, complex_entity, info);
-           attr->Raw()->a = control_pnts;
+           attr->ptr.a = control_pnts;
            info->surf_genagg[(STEPentity*)complex_entity] = control_pnts;
        }
-       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);
+       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);
     }
 
     /* Set knots */
@@ -154,13 +154,13 @@
 
     while ((attr = stepcomplex->NextAttribute()) != NULL) {
 
-       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_multiplicities")) attr->ptr.a = 
u_multiplicities;
+       if (!bu_strcmp(attr->Name(), "v_multiplicities")) attr->ptr.a = 
v_multiplicities;
 
-       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(), "u_knots")) attr->ptr.a = u_knots;
+       if (!bu_strcmp(attr->Name(), "v_knots")) attr->ptr.a = v_knots;
 
-       if (!bu_strcmp(attr->Name(), "knot_spec")) attr->Raw()->e = new 
SdaiKnot_type_var(Knot_type__unspecified);
+       if (!bu_strcmp(attr->Name(), "knot_spec")) attr->ptr.e = new 
SdaiKnot_type_var(Knot_type__unspecified);
     }
 
     /* Set weights */
@@ -181,7 +181,7 @@
                weights->AddNode(new GenericAggrNode(str.c_str()));
 
            }
-           attr->Raw()->a = weights;
+           attr->ptr.a = weights;
        }
     }
 

Modified: brlcad/trunk/src/conv/step/step-g/BSplineCurveWithKnots.cpp
===================================================================
--- brlcad/trunk/src/conv/step/step-g/BSplineCurveWithKnots.cpp 2020-12-08 
15:13:05 UTC (rev 77949)
+++ brlcad/trunk/src/conv/step/step-g/BSplineCurveWithKnots.cpp 2020-12-08 
16:37:33 UTC (rev 77950)
@@ -80,7 +80,7 @@
        STEPattribute *attr = step->getAttribute(sse, "knot_multiplicities");
 
        if (attr) {
-           STEPaggregate *sa = (STEPaggregate *)(attr->Raw()->a);
+           STEPaggregate *sa = (STEPaggregate *)(attr->ptr.a);
            if (!sa) goto step_error;
            IntNode *in = (IntNode *)sa->GetHead();
            if (!in) goto step_error;
@@ -98,7 +98,7 @@
     if (knots.empty()) {
        STEPattribute *attr = step->getAttribute(sse, "knots");
        if (attr) {
-           STEPaggregate *sa = (STEPaggregate *)(attr->Raw()->a);
+           STEPaggregate *sa = (STEPaggregate *)(attr->ptr.a);
            if (!sa) goto step_error;
            RealNode *rn = (RealNode *)sa->GetHead();
            if (!rn) goto step_error;

Modified: brlcad/trunk/src/conv/step/step-g/BSplineSurfaceWithKnots.cpp
===================================================================
--- brlcad/trunk/src/conv/step/step-g/BSplineSurfaceWithKnots.cpp       
2020-12-08 15:13:05 UTC (rev 77949)
+++ brlcad/trunk/src/conv/step/step-g/BSplineSurfaceWithKnots.cpp       
2020-12-08 16:37:33 UTC (rev 77950)
@@ -79,7 +79,7 @@
     if (u_multiplicities.empty()) {
        STEPattribute *attr = step->getAttribute(sse, "u_multiplicities");
        if (attr) {
-           STEPaggregate *sa = (STEPaggregate *)(attr->Raw()->a);
+           STEPaggregate *sa = (STEPaggregate *)(attr->ptr.a);
            if (!sa) goto step_error;
            IntNode *in = (IntNode *)sa->GetHead();
 
@@ -95,7 +95,7 @@
     if (v_multiplicities.empty()) {
        STEPattribute *attr = step->getAttribute(sse, "v_multiplicities");
        if (attr) {
-           STEPaggregate *sa = (STEPaggregate *)(attr->Raw()->a);
+           STEPaggregate *sa = (STEPaggregate *)(attr->ptr.a);
            if (!sa) goto step_error;
            IntNode *in = (IntNode *)sa->GetHead();
 
@@ -111,7 +111,7 @@
     if (u_knots.empty()) {
        STEPattribute *attr = step->getAttribute(sse, "u_knots");
        if (attr) {
-           STEPaggregate *sa = (STEPaggregate *)(attr->Raw()->a);
+           STEPaggregate *sa = (STEPaggregate *)(attr->ptr.a);
            if (!sa) goto step_error;
            RealNode *rn = (RealNode *)sa->GetHead();
 
@@ -127,7 +127,7 @@
     if (v_knots.empty()) {
        STEPattribute *attr = step->getAttribute(sse, "v_knots");
        if (attr) {
-           STEPaggregate *sa = (STEPaggregate *)(attr->Raw()->a);
+           STEPaggregate *sa = (STEPaggregate *)(attr->ptr.a);
            if (!sa) goto step_error;
            RealNode *rn = (RealNode *)sa->GetHead();
 

Modified: brlcad/trunk/src/conv/step/step-g/CartesianPoint.cpp
===================================================================
--- brlcad/trunk/src/conv/step/step-g/CartesianPoint.cpp        2020-12-08 
15:13:05 UTC (rev 77949)
+++ brlcad/trunk/src/conv/step/step-g/CartesianPoint.cpp        2020-12-08 
16:37:33 UTC (rev 77950)
@@ -73,7 +73,7 @@
 
     attr = step->getAttribute(sse, "coordinates");
     if (attr != NULL) {
-       sa = (STEPaggregate *)(attr->Raw()->a);
+       sa = (STEPaggregate *)(attr->ptr.a);
        if (!sa) goto step_error;
        RealNode *rn = (RealNode *)sa->GetHead();
        if (!rn) goto step_error;

Modified: brlcad/trunk/src/conv/step/step-g/Direction.cpp
===================================================================
--- brlcad/trunk/src/conv/step/step-g/Direction.cpp     2020-12-08 15:13:05 UTC 
(rev 77949)
+++ brlcad/trunk/src/conv/step/step-g/Direction.cpp     2020-12-08 16:37:33 UTC 
(rev 77950)
@@ -71,7 +71,7 @@
 
     STEPattribute *attr = step->getAttribute(sse, "direction_ratios");
     if (attr != NULL) {
-       STEPaggregate *sa = (STEPaggregate *)(attr->Raw()->a);
+       STEPaggregate *sa = (STEPaggregate *)(attr->ptr.a);
        RealNode *rn = (RealNode *)sa->GetHead();
        int index = 0;
        while (rn != NULL) {

Modified: brlcad/trunk/src/conv/step/step-g/RationalBSplineCurve.cpp
===================================================================
--- brlcad/trunk/src/conv/step/step-g/RationalBSplineCurve.cpp  2020-12-08 
15:13:05 UTC (rev 77949)
+++ brlcad/trunk/src/conv/step/step-g/RationalBSplineCurve.cpp  2020-12-08 
16:37:33 UTC (rev 77950)
@@ -71,7 +71,7 @@
        STEPattribute *attr = step->getAttribute(sse, "weights_data");
 
        if (attr) {
-           STEPaggregate *sa = (STEPaggregate *)(attr->Raw()->a);
+           STEPaggregate *sa = (STEPaggregate *)(attr->ptr.a);
            if (!sa) goto step_error;
            RealNode *rn = (RealNode *)sa->GetHead();
 

Modified: brlcad/trunk/src/conv/step/step-g/RationalBSplineSurface.cpp
===================================================================
--- brlcad/trunk/src/conv/step/step-g/RationalBSplineSurface.cpp        
2020-12-08 15:13:05 UTC (rev 77949)
+++ brlcad/trunk/src/conv/step/step-g/RationalBSplineSurface.cpp        
2020-12-08 16:37:33 UTC (rev 77950)
@@ -77,7 +77,7 @@
        STEPattribute *attr = step->getAttribute(sse, "weights_data");
 
        if (attr) {
-           GenericAggregate_ptr gp = (GenericAggregate_ptr)attr->Raw()->a;
+           GenericAggregate_ptr gp = (GenericAggregate_ptr)attr->ptr.a;
            if (!gp) goto step_error;
            STEPnode *sn = (STEPnode *)gp->GetHead();
            const char *eaStr;

Modified: brlcad/trunk/src/conv/step/step-g/ShellBasedSurfaceModel.cpp
===================================================================
--- brlcad/trunk/src/conv/step/step-g/ShellBasedSurfaceModel.cpp        
2020-12-08 15:13:05 UTC (rev 77949)
+++ brlcad/trunk/src/conv/step/step-g/ShellBasedSurfaceModel.cpp        
2020-12-08 16:37:33 UTC (rev 77950)
@@ -68,7 +68,7 @@
     if (sbsm_boundary.empty()) {
        STEPattribute *attr = step->getAttribute(sse, "sbsm_boundary");
        if (attr) {
-           SelectAggregate *sa = static_cast<SelectAggregate 
*>(attr->Raw()->a);
+           SelectAggregate *sa = static_cast<SelectAggregate *>(attr->ptr.a);
            if (!sa) goto step_error;
            SelectNode *sn = static_cast<SelectNode *>(sa->GetHead());
 

Modified: brlcad/trunk/src/conv/step/step-g/SurfaceCurve.cpp
===================================================================
--- brlcad/trunk/src/conv/step/step-g/SurfaceCurve.cpp  2020-12-08 15:13:05 UTC 
(rev 77949)
+++ brlcad/trunk/src/conv/step/step-g/SurfaceCurve.cpp  2020-12-08 16:37:33 UTC 
(rev 77950)
@@ -118,7 +118,7 @@
     if (associated_geometry.empty()) {
        STEPattribute *attr = step->getAttribute(sse, "associated_geometry");
        if (attr) {
-           SelectAggregate *sa = static_cast<SelectAggregate 
*>(attr->Raw()->a);
+           SelectAggregate *sa = static_cast<SelectAggregate *>(attr->ptr.a);
            if (!sa) goto step_error;
            SelectNode *sn = static_cast<SelectNode *>(sa->GetHead());
 

Modified: brlcad/trunk/src/conv/step/step-g/TrimmedCurve.cpp
===================================================================
--- brlcad/trunk/src/conv/step/step-g/TrimmedCurve.cpp  2020-12-08 15:13:05 UTC 
(rev 77949)
+++ brlcad/trunk/src/conv/step/step-g/TrimmedCurve.cpp  2020-12-08 16:37:33 UTC 
(rev 77950)
@@ -106,7 +106,7 @@
     if (trim_1.empty()) {
        STEPattribute *attr = step->getAttribute(sse, "trim_1");
        if (attr) {
-           SelectAggregate *sa = static_cast<SelectAggregate 
*>(attr->Raw()->a);
+           SelectAggregate *sa = static_cast<SelectAggregate *>(attr->ptr.a);
            if (!sa) goto step_error;
            SelectNode *sn = static_cast<SelectNode *>(sa->GetHead());
            SDAI_Select *p;
@@ -127,7 +127,7 @@
     if (trim_2.empty()) {
        STEPattribute *attr = step->getAttribute(sse, "trim_2");
        if (attr) {
-           SelectAggregate *sa = static_cast<SelectAggregate 
*>(attr->Raw()->a);
+           SelectAggregate *sa = static_cast<SelectAggregate *>(attr->ptr.a);
            if (!sa) goto step_error;
            SelectNode *sn = static_cast<SelectNode *>(sa->GetHead());
            SDAI_Select *p;

Modified: brlcad/trunk/src/conv/step/util/list_elements.cpp
===================================================================
--- brlcad/trunk/src/conv/step/util/list_elements.cpp   2020-12-08 15:13:05 UTC 
(rev 77949)
+++ brlcad/trunk/src/conv/step/util/list_elements.cpp   2020-12-08 16:37:33 UTC 
(rev 77950)
@@ -79,7 +79,7 @@
     //cout << attrCount << " attributes." << endl;
 
 
-    const EntityDescriptorList * supertypeList = 
&(ent->getEDesc()->Supertypes());
+    const EntityDescriptorList * supertypeList = &(ent->eDesc->Supertypes());
     EntityDescLinkNode * supertypePtr = (EntityDescLinkNode 
*)supertypeList->GetHead();
     entDesc = 0;
     while (supertypePtr != 0) {
@@ -92,7 +92,7 @@
     }
 
 
-    const EntityDescriptorList * subtypeList = &(ent->getEDesc()->Subtypes());
+    const EntityDescriptorList * subtypeList = &(ent->eDesc->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->getADesc();
+       const AttrDescriptor * attrDesc = attr->aDesc;
        cout << "     " << attrDesc->Name() << "[" << attrDesc->TypeName() << 
"]\n";
        attr = ent->NextAttribute();
     }

Modified: brlcad/trunk/src/other/stepcode/src/clstepcore/STEPattribute.cc
===================================================================
--- brlcad/trunk/src/other/stepcode/src/clstepcore/STEPattribute.cc     
2020-12-08 15:13:05 UTC (rev 77949)
+++ brlcad/trunk/src/other/stepcode/src/clstepcore/STEPattribute.cc     
2020-12-08 16:37:33 UTC (rev 77950)
@@ -482,99 +482,6 @@
     return const_cast<char *>( str.c_str() );
 }
 
-/*****************************************************************//**
- ** \fn asStr
- ** \param currSch - used for select type writes.  See commenting in 
SDAI_Select::STEPwrite().
- ** \returns the value of the attribute
- ** Status:  complete 3/91
- *********************************************************************/
-std::string STEPattribute::asStr( const char * currSch ) const {
-    ostringstream ss;
-    std::string str;
-
-    // The attribute has been derived by a subtype's attribute
-    if( IsDerived() )  {
-        str = "*";
-        return str;
-    }
-
-    // The attribute has been redefined by the attribute pointed
-    // to by _redefAttr so write the redefined value.
-    if( _redefAttr )  {
-        return _redefAttr->asStr( currSch );
-    }
-
-    if( is_null() )  {
-        return str;
-    }
-
-    switch( NonRefType() ) {
-        case INTEGER_TYPE:
-            ss << *( ptr.i );
-            str += ss.str();
-            break;
-
-        case NUMBER_TYPE:
-        case REAL_TYPE:
-
-            ss.precision( ( int ) Real_Num_Precision );
-            ss << *( ptr.r );
-            str += ss.str();
-            break;
-
-        case ENTITY_TYPE:
-            // print instance id only if not empty pointer
-            // and has value assigned
-            if( ( *( ptr.c ) == S_ENTITY_NULL ) || ( *( ptr.c ) == 0 ) ) {
-                break;
-            } else {
-                ( *( ptr.c ) )->STEPwrite_reference( str );
-            }
-            break;
-
-        case BINARY_TYPE:
-            if( !( ptr.b->empty() ) ) {
-                ptr.b->STEPwrite( str );
-            }
-            break;
-
-        case STRING_TYPE:
-            if( !( ( ptr.S )->empty() ) ) {
-                ptr.S->asStr( str );
-            }
-            break;
-
-        case AGGREGATE_TYPE:
-        case ARRAY_TYPE:      // DAS
-        case BAG_TYPE:        // DAS
-        case SET_TYPE:        // DAS
-        case LIST_TYPE:       // DAS
-            ptr.a->asStr( str );
-            break;
-
-        case ENUM_TYPE:
-        case BOOLEAN_TYPE:
-        case LOGICAL_TYPE:
-            ptr.e->asStr( str );
-            break;
-
-        case SELECT_TYPE:
-            ptr.sh->STEPwrite( str, currSch );
-            break;
-
-        case REFERENCE_TYPE:
-        case GENERIC_TYPE:
-            cerr << "Internal error:  " << __FILE__ <<  __LINE__
-                 << "\n" << _POC_ "\n";
-            str.clear();
-            break;
-
-        case UNKNOWN_TYPE:
-        default:
-            ptr.u->asStr( str );
-    }
-    return str;
-}
 /**
  * The value of the attribute is printed to the output stream specified by out.
  * The output is in physical file format.

Modified: brlcad/trunk/src/other/stepcode/src/clstepcore/STEPattribute.h
===================================================================
--- brlcad/trunk/src/other/stepcode/src/clstepcore/STEPattribute.h      
2020-12-08 15:13:05 UTC (rev 77949)
+++ brlcad/trunk/src/other/stepcode/src/clstepcore/STEPattribute.h      
2020-12-08 16:37:33 UTC (rev 77950)
@@ -93,10 +93,6 @@
         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
@@ -104,7 +100,7 @@
         ** class in the generated schema class library (the entity class is
         ** inherited from SDAI_Application_instance)
         */
-        union attrUnion {
+        union  {
             SDAI_String * S;                 // STRING_TYPE
             SDAI_Integer * i;                // INTEGER_TYPE (Integer is a 
long int)
             SDAI_Binary * b;                 // BINARY_TYPE
@@ -132,7 +128,6 @@
                            int addFileId = 0, const char * = NULL, bool strict 
= true );
 
         const char * asStr( std::string &, const char * = 0 ) const;
-        string asStr( const char * currSch = 0 ) const;
         // return the attr value as a string
         void STEPwrite( ostream & out = cout, const char * = 0 );
 
@@ -140,10 +135,6 @@
 
         Severity set_null();
 
-        /// allows direct access to the union containing attr data (dangerous!)
-        attrUnion * Raw() {
-            return & ptr;
-        }
 ////////////// Return info on attr
 
         int Nullable() const; // may this attribute be null?

Modified: 
brlcad/trunk/src/other/stepcode/src/clstepcore/sdaiApplication_instance.cc
===================================================================
--- brlcad/trunk/src/other/stepcode/src/clstepcore/sdaiApplication_instance.cc  
2020-12-08 15:13:05 UTC (rev 77949)
+++ brlcad/trunk/src/other/stepcode/src/clstepcore/sdaiApplication_instance.cc  
2020-12-08 16:37:33 UTC (rev 77950)
@@ -139,10 +139,6 @@
     }
 }
 
-const EntityDescriptor* SDAI_Application_instance::getEDesc() const {
-    return eDesc;
-}
-
 // BUG implement this -- FIXME function is never used
 
 SDAI_Application_instance * SDAI_Application_instance::GetMiEntity( char * 
entName ) {

Modified: 
brlcad/trunk/src/other/stepcode/src/clstepcore/sdaiApplication_instance.h
===================================================================
--- brlcad/trunk/src/other/stepcode/src/clstepcore/sdaiApplication_instance.h   
2020-12-08 15:13:05 UTC (rev 77949)
+++ brlcad/trunk/src/other/stepcode/src/clstepcore/sdaiApplication_instance.h   
2020-12-08 16:37:33 UTC (rev 77950)
@@ -52,10 +52,6 @@
             return _complex;
         }
 
-        void setEDesc( const EntityDescriptor * const ed ) {
-            eDesc = ed;
-        }
-        const EntityDescriptor * getEDesc() const;
         void StepFileId( int fid ) {
             STEPfile_id = fid;
         }

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

Reply via email to