Revision: 77837
          http://sourceforge.net/p/brlcad/code/77837
Author:   starseeker
Date:     2020-12-01 02:00:21 +0000 (Tue, 01 Dec 2020)
Log Message:
-----------
Backport a couple changes from upstream stepcode.

In order to prepare our step converter code for updating to the latest
upstream stepcode, we've backported a couple changes needed to make
the current version work the way the new one will.

Discovered I was testing with the wrong stepcode branch when I tried
upgrading earlier in the extbuild branch - stepcode's master wasn't in
a working state.  The develop branch was where updates and fixes had
been applied.  Fixed upstream with a ff merge of develop onto master,
and then tried again to test building step-g.

A couple class data members we were directly reading that have now been
protected in upstream classes.  Since the old code didn't have
equivalent accessors, we add them in our fork so our converter code
is ready to shift.

We will also need to address or ignore a couple compiler warnings being
tripped by the newer stepcode generated output.  Prefer to fix the
generated code upstream, but not sure yet how hard it will be.

Only other change spotted is an adjustment of the template that lists
the generated STEP C++ files to add the *_unity.cc files.  They include
all the individual entity files that are now being written.  There is
a note that not all compilers support those files, but we will have to
see - if we need to list individual entity files build logic will be
uglier, since we will need pre-generated per-schema lists of cc and h
files for CMake and we won't have any way to auto-generate them at
CMake time out of the box.

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

Modified: brlcad/trunk/src/conv/step/step-g/BSplineCurveWithKnots.cpp
===================================================================
--- brlcad/trunk/src/conv/step/step-g/BSplineCurveWithKnots.cpp 2020-11-30 
19:47:30 UTC (rev 77836)
+++ brlcad/trunk/src/conv/step/step-g/BSplineCurveWithKnots.cpp 2020-12-01 
02:00:21 UTC (rev 77837)
@@ -80,7 +80,7 @@
        STEPattribute *attr = step->getAttribute(sse, "knot_multiplicities");
 
        if (attr) {
-           STEPaggregate *sa = (STEPaggregate *)(attr->ptr.a);
+           STEPaggregate *sa = (STEPaggregate *)(attr->Raw()->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->ptr.a);
+           STEPaggregate *sa = (STEPaggregate *)(attr->Raw()->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-11-30 19:47:30 UTC (rev 77836)
+++ brlcad/trunk/src/conv/step/step-g/BSplineSurfaceWithKnots.cpp       
2020-12-01 02:00:21 UTC (rev 77837)
@@ -79,7 +79,7 @@
     if (u_multiplicities.empty()) {
        STEPattribute *attr = step->getAttribute(sse, "u_multiplicities");
        if (attr) {
-           STEPaggregate *sa = (STEPaggregate *)(attr->ptr.a);
+           STEPaggregate *sa = (STEPaggregate *)(attr->Raw()->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->ptr.a);
+           STEPaggregate *sa = (STEPaggregate *)(attr->Raw()->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->ptr.a);
+           STEPaggregate *sa = (STEPaggregate *)(attr->Raw()->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->ptr.a);
+           STEPaggregate *sa = (STEPaggregate *)(attr->Raw()->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-11-30 
19:47:30 UTC (rev 77836)
+++ brlcad/trunk/src/conv/step/step-g/CartesianPoint.cpp        2020-12-01 
02:00:21 UTC (rev 77837)
@@ -73,7 +73,7 @@
 
     attr = step->getAttribute(sse, "coordinates");
     if (attr != NULL) {
-       sa = (STEPaggregate *)(attr->ptr.a);
+       sa = (STEPaggregate *)(attr->Raw()->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-11-30 19:47:30 UTC 
(rev 77836)
+++ brlcad/trunk/src/conv/step/step-g/Direction.cpp     2020-12-01 02:00:21 UTC 
(rev 77837)
@@ -71,7 +71,7 @@
 
     STEPattribute *attr = step->getAttribute(sse, "direction_ratios");
     if (attr != NULL) {
-       STEPaggregate *sa = (STEPaggregate *)(attr->ptr.a);
+       STEPaggregate *sa = (STEPaggregate *)(attr->Raw()->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-11-30 
19:47:30 UTC (rev 77836)
+++ brlcad/trunk/src/conv/step/step-g/RationalBSplineCurve.cpp  2020-12-01 
02:00:21 UTC (rev 77837)
@@ -71,7 +71,7 @@
        STEPattribute *attr = step->getAttribute(sse, "weights_data");
 
        if (attr) {
-           STEPaggregate *sa = (STEPaggregate *)(attr->ptr.a);
+           STEPaggregate *sa = (STEPaggregate *)(attr->Raw()->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-11-30 19:47:30 UTC (rev 77836)
+++ brlcad/trunk/src/conv/step/step-g/RationalBSplineSurface.cpp        
2020-12-01 02:00:21 UTC (rev 77837)
@@ -77,7 +77,7 @@
        STEPattribute *attr = step->getAttribute(sse, "weights_data");
 
        if (attr) {
-           GenericAggregate_ptr gp = (GenericAggregate_ptr)attr->ptr.a;
+           GenericAggregate_ptr gp = (GenericAggregate_ptr)attr->Raw()->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-11-30 19:47:30 UTC (rev 77836)
+++ brlcad/trunk/src/conv/step/step-g/ShellBasedSurfaceModel.cpp        
2020-12-01 02:00:21 UTC (rev 77837)
@@ -68,7 +68,7 @@
     if (sbsm_boundary.empty()) {
        STEPattribute *attr = step->getAttribute(sse, "sbsm_boundary");
        if (attr) {
-           SelectAggregate *sa = static_cast<SelectAggregate *>(attr->ptr.a);
+           SelectAggregate *sa = static_cast<SelectAggregate 
*>(attr->Raw()->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-11-30 19:47:30 UTC 
(rev 77836)
+++ brlcad/trunk/src/conv/step/step-g/SurfaceCurve.cpp  2020-12-01 02:00:21 UTC 
(rev 77837)
@@ -118,7 +118,7 @@
     if (associated_geometry.empty()) {
        STEPattribute *attr = step->getAttribute(sse, "associated_geometry");
        if (attr) {
-           SelectAggregate *sa = static_cast<SelectAggregate *>(attr->ptr.a);
+           SelectAggregate *sa = static_cast<SelectAggregate 
*>(attr->Raw()->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-11-30 19:47:30 UTC 
(rev 77836)
+++ brlcad/trunk/src/conv/step/step-g/TrimmedCurve.cpp  2020-12-01 02:00:21 UTC 
(rev 77837)
@@ -106,7 +106,7 @@
     if (trim_1.empty()) {
        STEPattribute *attr = step->getAttribute(sse, "trim_1");
        if (attr) {
-           SelectAggregate *sa = static_cast<SelectAggregate *>(attr->ptr.a);
+           SelectAggregate *sa = static_cast<SelectAggregate 
*>(attr->Raw()->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->ptr.a);
+           SelectAggregate *sa = static_cast<SelectAggregate 
*>(attr->Raw()->a);
            if (!sa) goto step_error;
            SelectNode *sn = static_cast<SelectNode *>(sa->GetHead());
            SDAI_Select *p;

Modified: brlcad/trunk/src/other/stepcode/src/clstepcore/STEPattribute.cc
===================================================================
--- brlcad/trunk/src/other/stepcode/src/clstepcore/STEPattribute.cc     
2020-11-30 19:47:30 UTC (rev 77836)
+++ brlcad/trunk/src/other/stepcode/src/clstepcore/STEPattribute.cc     
2020-12-01 02:00:21 UTC (rev 77837)
@@ -482,6 +482,99 @@
     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-11-30 19:47:30 UTC (rev 77836)
+++ brlcad/trunk/src/other/stepcode/src/clstepcore/STEPattribute.h      
2020-12-01 02:00:21 UTC (rev 77837)
@@ -100,7 +100,7 @@
         ** class in the generated schema class library (the entity class is
         ** inherited from SDAI_Application_instance)
         */
-        union  {
+        union attrUnion {
             SDAI_String * S;                 // STRING_TYPE
             SDAI_Integer * i;                // INTEGER_TYPE (Integer is a 
long int)
             SDAI_Binary * b;                 // BINARY_TYPE
@@ -128,6 +128,7 @@
                            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 );
 
@@ -135,6 +136,10 @@
 
         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-11-30 19:47:30 UTC (rev 77836)
+++ brlcad/trunk/src/other/stepcode/src/clstepcore/sdaiApplication_instance.cc  
2020-12-01 02:00:21 UTC (rev 77837)
@@ -139,6 +139,10 @@
     }
 }
 
+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-11-30 19:47:30 UTC (rev 77836)
+++ brlcad/trunk/src/other/stepcode/src/clstepcore/sdaiApplication_instance.h   
2020-12-01 02:00:21 UTC (rev 77837)
@@ -52,6 +52,10 @@
             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