Revision: 76022
          http://sourceforge.net/p/brlcad/code/76022
Author:   d_rossberg
Date:     2020-06-04 15:48:14 +0000 (Thu, 04 Jun 2020)
Log Message:
-----------
a vector list (vlist) interface class and a plot to VectorList database 
function (backport from MOOSE)

Modified Paths:
--------------
    rt^3/trunk/include/brlcad/ConstDatabase.h
    rt^3/trunk/src/coreInterface/CMakeLists.txt
    rt^3/trunk/src/coreInterface/ConstDatabase.cpp

Added Paths:
-----------
    rt^3/trunk/include/brlcad/VectorList.h
    rt^3/trunk/src/coreInterface/VectorList.cpp

Modified: rt^3/trunk/include/brlcad/ConstDatabase.h
===================================================================
--- rt^3/trunk/include/brlcad/ConstDatabase.h   2020-06-04 15:25:25 UTC (rev 
76021)
+++ rt^3/trunk/include/brlcad/ConstDatabase.h   2020-06-04 15:48:14 UTC (rev 
76022)
@@ -32,6 +32,7 @@
 
 #include <brlcad/cicommon.h>
 #include <brlcad/Object.h>
+#include <brlcad/VectorList.h>
 
 
 struct rt_i;
@@ -121,10 +122,16 @@
         /// overloaded member function, provided for convenience: selects a 
single object and and returns a copy of it
         /** Do not forget to BRLCAD::Object::Destroy() the copy when you are 
finished with it! */
         Object*              Get(const char* objectName) const;
+        //@}
 
+        /// @name Generating alternative representations
         /// facetizes a single object's tree and returns it as a non-manifold 
geometry
         /** Do not forget to BRLCAD::Object::Destroy() the non-manifold 
geometry when you are finished with it! */
         NonManifoldGeometry* Facetize(const char* objectName) const;
+
+        /// plot a single object's tree and write the resulting wireframe to a 
vector list
+        void                 Plot(const char* objectName,
+                                  VectorList& vectorList) const;
         //@}
 
         /// @name Active set functions

Added: rt^3/trunk/include/brlcad/VectorList.h
===================================================================
--- rt^3/trunk/include/brlcad/VectorList.h                              (rev 0)
+++ rt^3/trunk/include/brlcad/VectorList.h      2020-06-04 15:48:14 UTC (rev 
76022)
@@ -0,0 +1,508 @@
+/*                    V E C T O R L I S T. H
+ * BRL-CAD
+ *
+ * Copyright (c) 2020 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+/** @file VectorList.h
+ *
+ *  BRL-CAD core C++ interface:
+ *      vlist declaration
+ */
+
+#ifndef BRLCAD_VECTORLIST_INCLUDED
+#define BRLCAD_VECTORLIST_INCLUDED
+
+#include <cstddef>
+
+#include <brlcad/cicommon.h>
+
+
+struct bu_list;
+struct bn_vlist;
+
+
+namespace BRLCAD {
+    class BRLCAD_COREINTERFACE_EXPORT VectorList {
+    public:
+        VectorList(void);
+        VectorList(const VectorList& original);
+        ~VectorList(void);
+
+        const VectorList& operator=(const VectorList& original);
+
+        class BRLCAD_COREINTERFACE_EXPORT Element {
+        public:
+            virtual ~Element(void) {}
+
+            enum ElementType {
+                PointDraw,
+                PointSize,
+                LineMove,
+                LineDraw,
+                LineWidth,
+                TriangleStart,
+                TriangleMove,
+                TriangleDraw,
+                TriangleEnd,
+                TriangleVertexNormal,
+                PolygonStart,
+                PolygonMove,
+                PolygonDraw,
+                PolygonEnd,
+                PolygonVertexNormal,
+                DisplaySpace,
+                ModelSpace
+            };
+
+            virtual ElementType Type(void) const = 0;
+
+        protected:
+            bn_vlist* m_chunk;
+            size_t    m_index;
+
+            Element(void) : m_chunk(0), m_index(-1) {}
+            Element(const Element& original) : m_chunk(0), m_index(-1) {}
+            Element(bn_vlist* chunk,
+                    size_t    index) : m_chunk(chunk), m_index(index) {}
+
+            const Element& operator=(const Element& original); // not 
implemented
+        };
+
+        class BRLCAD_COREINTERFACE_EXPORT LineMove : public Element {
+        public:
+            LineMove(void) : Element(), m_point() {}
+            LineMove(const LineMove& original) : 
VectorList::Element(original), m_point(original.m_point) {}
+            LineMove(const Vector3D& point) : Element(), m_point(point) {}
+            virtual ~LineMove(void) {}
+
+            const LineMove&     operator=(const LineMove& original);
+
+            virtual ElementType Type(void) const;
+
+            Vector3D            Point(void) const;
+            void                SetPoint(const Vector3D& point);
+
+        private:
+            Vector3D m_point;
+
+            LineMove(bn_vlist* chunk,
+                     size_t    index);
+
+            friend class VectorList;
+        };
+
+        class BRLCAD_COREINTERFACE_EXPORT LineDraw : public Element {
+        public:
+            LineDraw(void) : Element(), m_point() {}
+            LineDraw(const LineDraw& original) : 
VectorList::Element(original), m_point(original.m_point) {}
+            LineDraw(const Vector3D& point) : Element(), m_point(point) {}
+            virtual ~LineDraw(void) {}
+
+            const LineDraw&     operator=(const LineDraw& original);
+
+            virtual ElementType Type(void) const;
+
+            Vector3D            Point(void) const;
+            void                SetPoint(const Vector3D& point);
+
+        private:
+            Vector3D m_point;
+
+            LineDraw(bn_vlist* chunk,
+                     size_t    index);
+
+            friend class VectorList;
+        };
+
+        class BRLCAD_COREINTERFACE_EXPORT LineWidth : public Element {
+        public:
+            LineWidth(void) : Element(), m_width(1.) {}
+            LineWidth(const LineWidth& original) : 
VectorList::Element(original), m_width(original.m_width) {}
+            LineWidth(double width) : Element(), m_width(width) {}
+            virtual ~LineWidth(void) {}
+
+            const LineWidth&    operator=(const LineWidth& original);
+
+            virtual ElementType Type(void) const;
+
+            double              Width(void) const;
+            void                SetWidth(double width);
+
+        private:
+            double m_width;
+
+            LineWidth(bn_vlist* chunk,
+                      size_t    index);
+
+            friend class VectorList;
+       };
+
+        class BRLCAD_COREINTERFACE_EXPORT PolygonStart : public Element {
+        public:
+            PolygonStart(void) : Element(), m_normal() {}
+            PolygonStart(const PolygonStart& original) : 
VectorList::Element(original), m_normal(original.m_normal) {}
+            PolygonStart(const Vector3D& normal) : Element(), m_normal(normal) 
{}
+            virtual ~PolygonStart(void) {}
+
+            const PolygonStart& operator=(const PolygonStart& original);
+
+            virtual ElementType Type(void) const;
+
+            Vector3D            Normal(void) const;
+            void                SetNormal(const Vector3D& normal);
+
+        private:
+            Vector3D m_normal;
+
+            PolygonStart(bn_vlist* chunk,
+                         size_t    index);
+
+            friend class VectorList;
+       };
+
+        class BRLCAD_COREINTERFACE_EXPORT PolygonMove : public Element {
+        public:
+            PolygonMove(void) : Element(), m_point() {}
+            PolygonMove(const PolygonMove& original) : 
VectorList::Element(original), m_point(original.m_point) {}
+            PolygonMove(const Vector3D& point) : Element(), m_point(point) {}
+            virtual ~PolygonMove(void) {}
+
+            const PolygonMove&  operator=(const PolygonMove& original);
+
+            virtual ElementType Type(void) const;
+
+            Vector3D            Point(void) const;
+            void                SetPoint(const Vector3D& point);
+
+        private:
+            Vector3D m_point;
+
+            PolygonMove(bn_vlist* chunk,
+                        size_t    index);
+
+            friend class VectorList;
+        };
+
+        class BRLCAD_COREINTERFACE_EXPORT PolygonDraw : public Element {
+        public:
+            PolygonDraw(void) : Element(), m_point() {}
+            PolygonDraw(const PolygonDraw& original) : 
VectorList::Element(original), m_point(original.m_point) {}
+            PolygonDraw(const Vector3D& point) : Element(), m_point(point) {}
+            virtual ~PolygonDraw(void) {}
+
+            const PolygonDraw&  operator=(const PolygonDraw& original);
+
+            virtual ElementType Type(void) const;
+
+            Vector3D            Point(void) const;
+            void                SetPoint(const Vector3D& point);
+
+        private:
+            Vector3D m_point;
+
+            PolygonDraw(bn_vlist* chunk,
+                        size_t    index);
+
+            friend class VectorList;
+        };
+
+        class BRLCAD_COREINTERFACE_EXPORT PolygonEnd : public Element {
+        public:
+            PolygonEnd(void) : Element(), m_point() {}
+            PolygonEnd(const PolygonEnd& original) : 
VectorList::Element(original), m_point(original.m_point) {}
+            PolygonEnd(const Vector3D& point) : Element(), m_point(point) {}
+            virtual ~PolygonEnd(void) {}
+
+            const PolygonEnd&   operator=(const PolygonEnd& original);
+
+            virtual ElementType Type(void) const;
+
+            Vector3D            Point(void) const;
+            void                SetPoint(const Vector3D& point);
+
+        private:
+            Vector3D m_point;
+
+            PolygonEnd(bn_vlist* chunk,
+                       size_t    index);
+
+            friend class VectorList;
+        };
+
+        class BRLCAD_COREINTERFACE_EXPORT PolygonVertexNormal : public Element 
{
+        public:
+            PolygonVertexNormal(void) : Element(), m_normal() {}
+            PolygonVertexNormal(const PolygonVertexNormal& original) : 
VectorList::Element(original), m_normal(original.m_normal) {}
+            PolygonVertexNormal(const Vector3D& normal) : Element(), 
m_normal(normal) {}
+            virtual ~PolygonVertexNormal(void) {}
+
+            const PolygonVertexNormal& operator=(const PolygonVertexNormal& 
original);
+
+            virtual ElementType        Type(void) const;
+
+            Vector3D                   Normal(void) const;
+            void                       SetNormal(const Vector3D& normal);
+
+        private:
+            Vector3D m_normal;
+
+            PolygonVertexNormal(bn_vlist* chunk,
+                                size_t    index);
+
+            friend class VectorList;
+        };
+
+        class BRLCAD_COREINTERFACE_EXPORT TriangleStart : public Element {
+        public:
+            TriangleStart(void) : Element(), m_normal() {}
+            TriangleStart(const TriangleStart& original) : 
VectorList::Element(original), m_normal(original.m_normal) {}
+            TriangleStart(const Vector3D& normal) : Element(), 
m_normal(normal) {}
+            virtual ~TriangleStart(void) {}
+
+            const TriangleStart& operator=(const TriangleStart& original);
+
+            virtual ElementType  Type(void) const;
+
+            Vector3D             Normal(void) const;
+            void                 SetNormal(const Vector3D& normal);
+
+        private:
+            Vector3D m_normal;
+
+            TriangleStart(bn_vlist* chunk,
+                          size_t    index);
+
+            friend class VectorList;
+        };
+
+        class BRLCAD_COREINTERFACE_EXPORT TriangleMove : public Element {
+        public:
+            TriangleMove(void) : Element(), m_point() {}
+            TriangleMove(const TriangleMove& original) : 
VectorList::Element(original), m_point(original.m_point) {}
+            TriangleMove(const Vector3D& point) : Element(), m_point(point) {}
+            virtual ~TriangleMove(void) {}
+
+            const TriangleMove& operator=(const TriangleMove& original);
+
+            virtual ElementType Type(void) const;
+
+            Vector3D            Point(void) const;
+            void                SetPoint(const Vector3D& point);
+
+        private:
+            Vector3D m_point;
+
+            TriangleMove(bn_vlist* chunk,
+                         size_t    index);
+
+            friend class VectorList;
+        };
+
+        class BRLCAD_COREINTERFACE_EXPORT TriangleDraw : public Element {
+        public:
+            TriangleDraw(void) : Element(), m_point() {}
+            TriangleDraw(const TriangleDraw& original) : 
VectorList::Element(original), m_point(original.m_point) {}
+            TriangleDraw(const Vector3D& point) : Element(), m_point(point) {}
+            virtual ~TriangleDraw(void) {}
+
+            const TriangleDraw& operator=(const TriangleDraw& original);
+
+            virtual ElementType Type(void) const;
+
+            Vector3D            Point(void) const;
+            void                SetPoint(const Vector3D& point);
+
+        private:
+            Vector3D m_point;
+
+            TriangleDraw(bn_vlist* chunk,
+                         size_t    index);
+
+            friend class VectorList;
+        };
+
+        class BRLCAD_COREINTERFACE_EXPORT TriangleEnd : public Element {
+        public:
+            TriangleEnd(void) : Element(), m_point() {}
+            TriangleEnd(const TriangleEnd& original) : 
VectorList::Element(original), m_point(original.m_point) {}
+            TriangleEnd(const Vector3D& point) : Element(), m_point(point) {}
+            virtual ~TriangleEnd(void) {}
+
+            const TriangleEnd&  operator=(const TriangleEnd& original);
+
+            virtual ElementType Type(void) const;
+
+            Vector3D            Point(void) const;
+            void                SetPoint(const Vector3D& point);
+
+        private:
+            Vector3D m_point;
+
+            TriangleEnd(bn_vlist* chunk,
+                        size_t    index);
+
+            friend class VectorList;
+        };
+
+        class BRLCAD_COREINTERFACE_EXPORT TriangleVertexNormal : public 
Element {
+        public:
+            TriangleVertexNormal(void) : Element(), m_normal() {}
+            TriangleVertexNormal(const TriangleVertexNormal& original) : 
VectorList::Element(original), m_normal(original.m_normal) {}
+            TriangleVertexNormal(const Vector3D& normal) : Element(), 
m_normal(normal) {}
+            virtual ~TriangleVertexNormal(void) {}
+
+            const TriangleVertexNormal& operator=(const TriangleVertexNormal& 
original);
+
+            virtual ElementType         Type(void) const;
+
+            Vector3D                    Normal(void) const;
+            void                        SetNormal(const Vector3D& normal);
+
+        private:
+            Vector3D m_normal;
+
+            TriangleVertexNormal(bn_vlist* chunk,
+                                 size_t    index);
+
+            friend class VectorList;
+        };
+
+        class BRLCAD_COREINTERFACE_EXPORT PointDraw : public Element {
+        public:
+            PointDraw(void) : Element(), m_point() {}
+            PointDraw(const PointDraw& original) : 
VectorList::Element(original), m_point(original.m_point) {}
+            PointDraw(const Vector3D& point) : Element(), m_point(point) {}
+            virtual ~PointDraw(void) {}
+
+            const PointDraw&    operator=(const PointDraw& original);
+
+            virtual ElementType Type(void) const;
+
+            Vector3D            Point(void) const;
+            void                SetPoint(const Vector3D& point);
+
+        private:
+            Vector3D m_point;
+
+            PointDraw(bn_vlist* chunk,
+                      size_t    index);
+
+            friend class VectorList;
+        };
+
+        class BRLCAD_COREINTERFACE_EXPORT PointSize : public Element {
+        public:
+            PointSize(void) : Element(), m_size(1.) {}
+            PointSize(const PointSize& original) : 
VectorList::Element(original), m_size(original.m_size) {}
+            PointSize(double size) : Element(), m_size(size) {}
+            virtual ~PointSize(void) {}
+
+            const PointSize&    operator=(const PointSize& original);
+
+            virtual ElementType Type(void) const;
+
+            double              Size(void) const;
+            void                SetSize(double size);
+
+        private:
+            double m_size;
+
+            PointSize(bn_vlist* chunk,
+                      size_t    index);
+
+            friend class VectorList;
+        };
+
+        class BRLCAD_COREINTERFACE_EXPORT DisplaySpace : public Element {
+        public:
+            DisplaySpace(void) : Element(), m_referencePoint() {}
+            DisplaySpace(const DisplaySpace& original) : 
VectorList::Element(original), m_referencePoint(original.m_referencePoint) {}
+            DisplaySpace(const Vector3D& referencePoint) : Element(), 
m_referencePoint(referencePoint) {}
+            virtual ~DisplaySpace(void) {}
+
+            const DisplaySpace& operator=(const DisplaySpace& original);
+
+            virtual ElementType Type(void) const;
+
+            Vector3D            ReferencePoint(void) const;
+            void                SetReferencePoint(const Vector3D& 
referencePoint);
+
+        private:
+            Vector3D m_referencePoint;
+
+            DisplaySpace(bn_vlist* chunk,
+                         size_t    index);
+
+            friend class VectorList;
+        };
+
+        class BRLCAD_COREINTERFACE_EXPORT ModelSpace : public Element {
+        public:
+            ModelSpace(void) : Element() {}
+            ModelSpace(const ModelSpace& original) : 
VectorList::Element(original) {}
+            virtual ~ModelSpace(void) {}
+
+            const ModelSpace& operator=(const ModelSpace& original);
+
+            virtual ElementType Type(void) const;
+
+        private:
+            ModelSpace(bn_vlist* chunk,
+                       size_t    index);
+
+            friend class VectorList;
+        };
+
+        class ConstElementCallback {
+        public:
+            virtual ~ConstElementCallback(void) {}
+
+            virtual bool operator()(Element* element) = 0;
+
+        protected:
+            ConstElementCallback(void) {}
+            ConstElementCallback(const ConstElementCallback&) {}
+            const ConstElementCallback& operator=(const ConstElementCallback&) 
{return *this;}
+        };
+
+        class ElementCallback {
+        public:
+            virtual ~ElementCallback(void) {}
+
+            virtual bool operator()(Element* element) = 0;
+
+        protected:
+            ElementCallback(void) {}
+            ElementCallback(const ElementCallback&) {}
+            const ElementCallback& operator=(const ElementCallback&) {return 
*this;}
+        };
+
+        void              Iterate(ConstElementCallback& callBack) const;
+        void              Iterate(ElementCallback& callBack);
+
+        bool              Append(const Element& element);
+        void              Clear(void);
+
+    private:
+        bu_list* m_vlist;
+
+        friend class ConstDatabase;
+    };
+};
+
+
+#endif // BRLCAD_VECTORLIST_INCLUDED


Property changes on: rt^3/trunk/include/brlcad/VectorList.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: rt^3/trunk/src/coreInterface/CMakeLists.txt
===================================================================
--- rt^3/trunk/src/coreInterface/CMakeLists.txt 2020-06-04 15:25:25 UTC (rev 
76021)
+++ rt^3/trunk/src/coreInterface/CMakeLists.txt 2020-06-04 15:48:14 UTC (rev 
76022)
@@ -73,6 +73,7 @@
                Sphere.cpp
                Torus.cpp
                Unknown.cpp
+               VectorList.cpp
        )
 
        IF(MSVC)
@@ -124,6 +125,7 @@
                ${RT3_SOURCE_DIR}/include/brlcad/Sphere.h
                ${RT3_SOURCE_DIR}/include/brlcad/Torus.h
                ${RT3_SOURCE_DIR}/include/brlcad/Unknown.h
+               ${RT3_SOURCE_DIR}/include/brlcad/VectorList.h
        )
        INSTALL(FILES ${coreinterface_inst_HDRS} DESTINATION include/brlcad)
        TARGET_LINK_LIBRARIES(coreinterface ${BRLCAD_NMG_LIBRARY} 
${BRLCAD_WDB_LIBRARY} ${BRLCAD_RT_LIBRARY} ${BRLCAD_BN_LIBRARY} 
${BRLCAD_BU_LIBRARY})

Modified: rt^3/trunk/src/coreInterface/ConstDatabase.cpp
===================================================================
--- rt^3/trunk/src/coreInterface/ConstDatabase.cpp      2020-06-04 15:25:25 UTC 
(rev 76021)
+++ rt^3/trunk/src/coreInterface/ConstDatabase.cpp      2020-06-04 15:48:14 UTC 
(rev 76022)
@@ -487,6 +487,60 @@
 }
 
 
+static tree* PlotLeaf
+(
+    db_tree_state*      tsp,
+    const db_full_path* pathp,
+    rt_db_internal*     ip,
+    void*               clientData
+) {
+    tree*    ret   = TREE_NULL;
+    bu_list* vlist = static_cast<bu_list*>(clientData);
+
+    if (ip->idb_meth->ft_plot != 0) {
+        if (ip->idb_meth->ft_plot(vlist, ip, tsp->ts_ttol, tsp->ts_tol, 0) == 
0) {
+            // Indicate success by returning something other than TREE_NULL
+            BU_GET(ret, tree);
+            RT_TREE_INIT(ret);
+            ret->tr_op = OP_NOP;
+        }
+    }
+
+    return ret;
+}
+
+
+void ConstDatabase::Plot
+(
+    const char* objectName,
+    VectorList& vectorList
+) const {
+    if (m_rtip != 0) {
+        if (!BU_SETJUMP) {
+            db_tree_state initState;
+
+            db_init_db_tree_state(&initState, m_rtip->rti_dbip, m_resp);
+            initState.ts_ttol = &m_rtip->rti_ttol;
+            initState.ts_tol  = &m_rtip->rti_tol;
+
+            db_walk_tree(m_rtip->rti_dbip,
+                         1,
+                         &objectName,
+                         1,
+                         &initState,
+                         0,
+                         0,
+                         PlotLeaf,
+                         vectorList.m_vlist);
+        }
+        else
+            BU_UNSETJUMP;
+
+        BU_UNSETJUMP;
+    }
+}
+
+
 void ConstDatabase::Select
 (
     const char* objectName

Added: rt^3/trunk/src/coreInterface/VectorList.cpp
===================================================================
--- rt^3/trunk/src/coreInterface/VectorList.cpp                         (rev 0)
+++ rt^3/trunk/src/coreInterface/VectorList.cpp 2020-06-04 15:48:14 UTC (rev 
76022)
@@ -0,0 +1,1318 @@
+/*                    V E C T O R L I S T. C P P
+ * BRL-CAD
+ *
+ * Copyright (c) 2020 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+/** @file VectorList.cpp
+ *
+ *  BRL-CAD core C++ interface:
+ *      vlist implementation
+ */
+
+#include <cassert>
+
+#include "bu/parallel.h"
+#include "rt/global.h"
+#include "rt/vlist.h"
+
+#include <brlcad/VectorList.h>
+
+
+using namespace BRLCAD;
+
+
+//
+// BRLCAD::VectorList::PointDraw
+//
+const VectorList::PointDraw& VectorList::PointDraw::operator=
+(
+    const PointDraw& original
+) {
+    if (this != &original)
+        SetPoint(original.Point());
+
+    return *this;
+}
+
+
+VectorList::Element::ElementType VectorList::PointDraw::Type(void) const {
+    return VectorList::Element::PointDraw;
+}
+
+
+Vector3D VectorList::PointDraw::Point(void) const {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        return m_chunk->pt[m_index];
+    }
+    else
+        return m_point;
+}
+
+
+void VectorList::PointDraw::SetPoint
+(
+    const Vector3D& point
+) {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        VMOVE(m_chunk->pt[m_index], point.coordinates);
+    }
+    else
+        m_point = point;
+}
+
+
+VectorList::PointDraw::PointDraw
+(
+    bn_vlist* chunk,
+    size_t    index
+) : VectorList::Element(chunk, index), m_point() {}
+
+
+//
+// BRLCAD::VectorList::PointSize
+//
+const VectorList::PointSize& VectorList::PointSize::operator=
+(
+    const PointSize& original
+) {
+    if (this != &original)
+        SetSize(original.Size());
+
+    return *this;
+}
+
+
+VectorList::Element::ElementType VectorList::PointSize::Type(void) const {
+    return VectorList::Element::PointSize;
+}
+
+
+double VectorList::PointSize::Size(void) const {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        return m_chunk->pt[m_index][0];
+    }
+    else
+        return m_size;
+}
+
+
+void VectorList::PointSize::SetSize
+(
+    double size
+) {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        m_chunk->pt[m_index][0] = size;
+    }
+    else
+        m_size = size;
+}
+
+
+VectorList::PointSize::PointSize
+(
+    bn_vlist* chunk,
+    size_t    index
+) : VectorList::Element(chunk, index), m_size(1.) {}
+
+
+//
+// BRLCAD::VectorList::LineMove
+//
+const VectorList::LineMove& VectorList::LineMove::operator=
+(
+    const LineMove& original
+) {
+    if (this != &original)
+        SetPoint(original.Point());
+
+    return *this;
+}
+
+
+VectorList::Element::ElementType VectorList::LineMove::Type(void) const {
+    return VectorList::Element::LineMove;
+}
+
+
+Vector3D VectorList::LineMove::Point(void) const {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        return m_chunk->pt[m_index];
+    }
+    else
+        return m_point;
+}
+
+
+void VectorList::LineMove::SetPoint
+(
+    const Vector3D& point
+) {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        VMOVE(m_chunk->pt[m_index], point.coordinates);
+    }
+    else
+        m_point = point;
+}
+
+
+VectorList::LineMove::LineMove
+(
+    bn_vlist* chunk,
+    size_t    index
+) : VectorList::Element(chunk, index), m_point() {}
+
+
+//
+// BRLCAD::VectorList::LineDraw
+//
+const VectorList::LineDraw& VectorList::LineDraw::operator=
+(
+    const LineDraw& original
+) {
+    if (this != &original)
+        SetPoint(original.Point());
+
+    return *this;
+}
+
+
+VectorList::Element::ElementType VectorList::LineDraw::Type(void) const {
+    return VectorList::Element::LineDraw;
+}
+
+
+Vector3D VectorList::LineDraw::Point(void) const {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        return m_chunk->pt[m_index];
+    }
+    else
+        return m_point;
+}
+
+
+void VectorList::LineDraw::SetPoint
+(
+    const Vector3D& point
+) {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        VMOVE(m_chunk->pt[m_index], point.coordinates);
+    }
+    else
+        m_point = point;
+}
+
+
+VectorList::LineDraw::LineDraw
+(
+    bn_vlist* chunk,
+    size_t    index
+) : VectorList::Element(chunk, index), m_point() {}
+
+
+//
+// BRLCAD::VectorList::LineWidth
+//
+const VectorList::LineWidth& VectorList::LineWidth::operator=
+(
+    const LineWidth& original
+) {
+    if (this != &original)
+        SetWidth(original.Width());
+
+    return *this;
+}
+
+
+VectorList::Element::ElementType VectorList::LineWidth::Type(void) const {
+    return VectorList::Element::LineWidth;
+}
+
+
+double VectorList::LineWidth::Width(void) const {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        return m_chunk->pt[m_index][0];
+    }
+    else
+        return m_width;
+}
+
+
+void VectorList::LineWidth::SetWidth
+(
+    double width
+) {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        m_chunk->pt[m_index][0] = width;
+    }
+    else
+        m_width = width;
+}
+
+
+VectorList::LineWidth::LineWidth
+(
+    bn_vlist* chunk,
+    size_t    index
+) : VectorList::Element(chunk, index), m_width(1.) {}
+
+
+//
+// BRLCAD::VectorList::TriangleStart
+//
+const VectorList::TriangleStart& VectorList::TriangleStart::operator=
+(
+    const TriangleStart& original
+) {
+    if (this != &original)
+        SetNormal(original.Normal());
+
+    return *this;
+}
+
+
+VectorList::Element::ElementType VectorList::TriangleStart::Type(void) const {
+    return VectorList::Element::TriangleStart;
+}
+
+
+Vector3D VectorList::TriangleStart::Normal(void) const {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        return m_chunk->pt[m_index];
+    }
+    else
+        return m_normal;
+}
+
+
+void VectorList::TriangleStart::SetNormal
+(
+    const Vector3D& normal
+) {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        VMOVE(m_chunk->pt[m_index], normal.coordinates);
+    }
+    else
+        m_normal = normal;
+}
+
+
+VectorList::TriangleStart::TriangleStart
+(
+    bn_vlist* chunk,
+    size_t    index
+) : VectorList::Element(chunk, index), m_normal() {}
+
+
+//
+// BRLCAD::VectorList::TriangleMove
+//
+const VectorList::TriangleMove& VectorList::TriangleMove::operator=
+(
+    const TriangleMove& original
+) {
+    if (this != &original)
+        SetPoint(original.Point());
+
+    return *this;
+}
+
+
+VectorList::Element::ElementType VectorList::TriangleMove::Type(void) const {
+    return VectorList::Element::TriangleMove;
+}
+
+
+Vector3D VectorList::TriangleMove::Point(void) const {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        return m_chunk->pt[m_index];
+    }
+    else
+        return m_point;
+}
+
+
+void VectorList::TriangleMove::SetPoint
+(
+    const Vector3D& point
+) {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        VMOVE(m_chunk->pt[m_index], point.coordinates);
+    }
+    else
+        m_point = point;
+}
+
+
+VectorList::TriangleMove::TriangleMove
+(
+    bn_vlist* chunk,
+    size_t    index
+) : VectorList::Element(chunk, index), m_point() {}
+
+
+//
+// BRLCAD::VectorList::TriangleDraw
+//
+const VectorList::TriangleDraw& VectorList::TriangleDraw::operator=
+(
+    const TriangleDraw& original
+) {
+    if (this != &original)
+        SetPoint(original.Point());
+
+    return *this;
+}
+
+
+VectorList::Element::ElementType VectorList::TriangleDraw::Type(void) const {
+    return VectorList::Element::TriangleDraw;
+}
+
+
+Vector3D VectorList::TriangleDraw::Point(void) const {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        return m_chunk->pt[m_index];
+    }
+    else
+        return m_point;
+}
+
+
+void VectorList::TriangleDraw::SetPoint
+(
+    const Vector3D& point
+) {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        VMOVE(m_chunk->pt[m_index], point.coordinates);
+    }
+    else
+        m_point = point;
+}
+
+
+VectorList::TriangleDraw::TriangleDraw
+(
+    bn_vlist* chunk,
+    size_t    index
+) : VectorList::Element(chunk, index), m_point() {}
+
+
+//
+// BRLCAD::VectorList::TriangleEnd
+//
+const VectorList::TriangleEnd& VectorList::TriangleEnd::operator=
+(
+    const TriangleEnd& original
+) {
+    if (this != &original)
+        SetPoint(original.Point());
+
+    return *this;
+}
+
+
+VectorList::Element::ElementType VectorList::TriangleEnd::Type(void) const {
+    return VectorList::Element::TriangleEnd;
+}
+
+
+Vector3D VectorList::TriangleEnd::Point(void) const {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        return m_chunk->pt[m_index];
+    }
+    else
+        return m_point;
+}
+
+
+void VectorList::TriangleEnd::SetPoint
+(
+    const Vector3D& point
+) {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        VMOVE(m_chunk->pt[m_index], point.coordinates);
+    }
+    else
+        m_point = point;
+}
+
+
+VectorList::TriangleEnd::TriangleEnd
+(
+    bn_vlist* chunk,
+    size_t    index
+) : VectorList::Element(chunk, index), m_point() {}
+
+
+//
+// BRLCAD::VectorList::TriangleVertexNormal
+//
+const VectorList::TriangleVertexNormal& 
VectorList::TriangleVertexNormal::operator=
+(
+    const TriangleVertexNormal& original
+) {
+    if (this != &original)
+        SetNormal(original.Normal());
+
+    return *this;
+}
+
+
+VectorList::Element::ElementType VectorList::TriangleVertexNormal::Type(void) 
const {
+    return VectorList::Element::TriangleVertexNormal;
+}
+
+
+Vector3D VectorList::TriangleVertexNormal::Normal(void) const {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        return m_chunk->pt[m_index];
+    }
+    else
+        return m_normal;
+}
+
+
+void VectorList::TriangleVertexNormal::SetNormal
+(
+    const Vector3D& normal
+) {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        VMOVE(m_chunk->pt[m_index], normal.coordinates);
+    }
+    else
+        m_normal = normal;
+}
+
+
+VectorList::TriangleVertexNormal::TriangleVertexNormal
+(
+    bn_vlist* chunk,
+    size_t    index
+) : VectorList::Element(chunk, index), m_normal() {}
+
+
+//
+// BRLCAD::VectorList::PolygonStart
+//
+const VectorList::PolygonStart& VectorList::PolygonStart::operator=
+(
+    const PolygonStart& original
+) {
+    if (this != &original)
+        SetNormal(original.Normal());
+
+    return *this;
+}
+
+
+VectorList::Element::ElementType VectorList::PolygonStart::Type(void) const {
+    return VectorList::Element::PolygonStart;
+}
+
+
+Vector3D VectorList::PolygonStart::Normal(void) const {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        return m_chunk->pt[m_index];
+    }
+    else
+        return m_normal;
+}
+
+
+void VectorList::PolygonStart::SetNormal
+(
+    const Vector3D& normal
+) {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        VMOVE(m_chunk->pt[m_index], normal.coordinates);
+    }
+    else
+        m_normal = normal;
+}
+
+
+VectorList::PolygonStart::PolygonStart
+(
+    bn_vlist* chunk,
+    size_t    index
+) : VectorList::Element(chunk, index), m_normal() {}
+
+
+//
+// BRLCAD::VectorList::PolygonMove
+//
+const VectorList::PolygonMove& VectorList::PolygonMove::operator=
+(
+    const PolygonMove& original
+) {
+    if (this != &original)
+        SetPoint(original.Point());
+
+    return *this;
+}
+
+
+VectorList::Element::ElementType VectorList::PolygonMove::Type(void) const {
+    return VectorList::Element::PolygonMove;
+}
+
+
+Vector3D VectorList::PolygonMove::Point(void) const {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        return m_chunk->pt[m_index];
+    }
+    else
+        return m_point;
+}
+
+
+void VectorList::PolygonMove::SetPoint
+(
+    const Vector3D& point
+) {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        VMOVE(m_chunk->pt[m_index], point.coordinates);
+    }
+    else
+        m_point = point;
+}
+
+
+VectorList::PolygonMove::PolygonMove
+(
+    bn_vlist* chunk,
+    size_t    index
+) : VectorList::Element(chunk, index), m_point() {}
+
+
+//
+// BRLCAD::VectorList::PolygonDraw
+//
+const VectorList::PolygonDraw& VectorList::PolygonDraw::operator=
+(
+    const PolygonDraw& original
+) {
+    if (this != &original)
+        SetPoint(original.Point());
+
+    return *this;
+}
+
+
+VectorList::Element::ElementType VectorList::PolygonDraw::Type(void) const {
+    return VectorList::Element::PolygonDraw;
+}
+
+
+Vector3D VectorList::PolygonDraw::Point(void) const {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        return m_chunk->pt[m_index];
+    }
+    else
+        return m_point;
+}
+
+
+void VectorList::PolygonDraw::SetPoint
+(
+    const Vector3D& point
+) {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        VMOVE(m_chunk->pt[m_index], point.coordinates);
+    }
+    else
+        m_point = point;
+}
+
+
+VectorList::PolygonDraw::PolygonDraw
+(
+    bn_vlist* chunk,
+    size_t    index
+) : VectorList::Element(chunk, index), m_point() {}
+
+
+//
+// BRLCAD::VectorList::PolygonEnd
+//
+const VectorList::PolygonEnd& VectorList::PolygonEnd::operator=
+(
+    const PolygonEnd& original
+) {
+    if (this != &original)
+        SetPoint(original.Point());
+
+    return *this;
+}
+
+
+VectorList::Element::ElementType VectorList::PolygonEnd::Type(void) const {
+    return VectorList::Element::PolygonEnd;
+}
+
+
+Vector3D VectorList::PolygonEnd::Point(void) const {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        return m_chunk->pt[m_index];
+    }
+    else
+        return m_point;
+}
+
+
+void VectorList::PolygonEnd::SetPoint
+(
+    const Vector3D& point
+) {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        VMOVE(m_chunk->pt[m_index], point.coordinates);
+    }
+    else
+        m_point = point;
+}
+
+
+VectorList::PolygonEnd::PolygonEnd
+(
+    bn_vlist* chunk,
+    size_t    index
+) : VectorList::Element(chunk, index), m_point() {}
+
+
+//
+// BRLCAD::VectorList::PolygonVertexNormal
+//
+const VectorList::PolygonVertexNormal& 
VectorList::PolygonVertexNormal::operator=
+(
+    const PolygonVertexNormal& original
+) {
+    if (this != &original)
+        SetNormal(original.Normal());
+
+    return *this;
+}
+
+
+VectorList::Element::ElementType VectorList::PolygonVertexNormal::Type(void) 
const {
+    return VectorList::Element::PolygonVertexNormal;
+}
+
+
+Vector3D VectorList::PolygonVertexNormal::Normal(void) const {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        return m_chunk->pt[m_index];
+    }
+    else
+        return m_normal;
+}
+
+
+void VectorList::PolygonVertexNormal::SetNormal
+(
+    const Vector3D& normal
+) {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        VMOVE(m_chunk->pt[m_index], normal.coordinates);
+    }
+    else
+        m_normal = normal;
+}
+
+
+VectorList::PolygonVertexNormal::PolygonVertexNormal
+(
+    bn_vlist* chunk,
+    size_t    index
+) : VectorList::Element(chunk, index), m_normal() {}
+
+
+//
+// BRLCAD::VectorList::DisplaySpace
+//
+const VectorList::DisplaySpace& VectorList::DisplaySpace::operator=
+(
+    const DisplaySpace& original
+) {
+    if (this != &original)
+        SetReferencePoint(original.ReferencePoint());
+
+    return *this;
+}
+
+
+VectorList::Element::ElementType VectorList::DisplaySpace::Type(void) const {
+    return VectorList::Element::DisplaySpace;
+}
+
+
+Vector3D VectorList::DisplaySpace::ReferencePoint(void) const {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        return m_chunk->pt[m_index];
+    }
+    else
+        return m_referencePoint;
+}
+
+
+void VectorList::DisplaySpace::SetReferencePoint
+(
+    const Vector3D& referencePoint
+) {
+    if (m_chunk != 0) {
+        assert(m_index < m_chunk->nused);
+        VMOVE(m_chunk->pt[m_index], referencePoint.coordinates);
+    }
+    else
+        m_referencePoint = referencePoint;
+}
+
+
+VectorList::DisplaySpace::DisplaySpace
+(
+    bn_vlist* chunk,
+    size_t    index
+) : VectorList::Element(chunk, index), m_referencePoint() {}
+
+
+//
+// BRLCAD::VectorList::ModelSpace
+//
+const VectorList::ModelSpace& VectorList::ModelSpace::operator=
+(
+    const ModelSpace& original
+) {
+    return *this;
+}
+
+
+VectorList::Element::ElementType VectorList::ModelSpace::Type(void) const {
+    return VectorList::Element::ModelSpace;
+}
+
+
+VectorList::ModelSpace::ModelSpace
+(
+    bn_vlist* chunk,
+    size_t    index
+) : VectorList::Element(chunk, index) {}
+
+
+//
+// BRLCAD::VectorList
+//
+VectorList::VectorList(void) {
+    m_vlist = new bu_list;
+    BU_LIST_INIT(m_vlist);
+}
+
+
+VectorList::VectorList
+(
+    const VectorList& original
+) {
+    m_vlist = new bu_list;
+    BU_LIST_INIT(m_vlist);
+
+    if (!BU_SETJUMP)
+        rt_vlist_copy(m_vlist, original.m_vlist);
+    else
+        BU_UNSETJUMP;
+
+    BU_UNSETJUMP;
+}
+
+
+VectorList::~VectorList(void) {
+    RT_FREE_VLIST(m_vlist);
+    delete m_vlist;
+}
+
+
+const VectorList& VectorList::operator=
+(
+    const VectorList& original
+) {
+    if (&original != this) {
+        RT_FREE_VLIST(m_vlist);
+
+        if (!BU_SETJUMP)
+            rt_vlist_copy(m_vlist, original.m_vlist);
+        else
+            BU_UNSETJUMP;
+
+        BU_UNSETJUMP;
+    }
+
+    return *this;
+}
+
+
+void VectorList::Iterate
+(
+    VectorList::ConstElementCallback& callBack
+) const {
+    if (m_vlist != 0) {
+        bool      cont = true;
+        bn_vlist* chunk;
+
+        for (BU_LIST_FOR(chunk, bn_vlist, m_vlist)) {
+            for (size_t i = 0; i < chunk->nused; ++i) {
+                switch (chunk->cmd[i]) {
+                    case BN_VLIST_LINE_MOVE: {
+                        LineMove element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_LINE_DRAW: {
+                        LineDraw element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_POLY_START: {
+                        PolygonStart element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_POLY_MOVE: {
+                        PolygonMove element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_POLY_DRAW: {
+                        PolygonDraw element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_POLY_END: {
+                        PolygonEnd element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_POLY_VERTNORM: {
+                        PolygonVertexNormal element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_TRI_START: {
+                        TriangleStart element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_TRI_MOVE: {
+                        TriangleMove element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_TRI_DRAW: {
+                        TriangleDraw element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_TRI_END: {
+                        TriangleEnd element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_TRI_VERTNORM: {
+                        TriangleVertexNormal element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_POINT_DRAW: {
+                        PointDraw element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_POINT_SIZE: {
+                        PointSize element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_LINE_WIDTH: {
+                        LineWidth element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_DISPLAY_MAT: {
+                        DisplaySpace element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_MODEL_MAT: {
+                        ModelSpace element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    default:
+                        if (!callBack(0))
+                            cont = false;
+                }
+
+                if (!cont)
+                    return;
+            }
+        }
+    }
+}
+
+
+void VectorList::Iterate
+(
+    VectorList::ElementCallback& callBack
+) {
+    if (m_vlist != 0) {
+        bool      cont = true;
+        bn_vlist* chunk;
+
+        for (BU_LIST_FOR(chunk, bn_vlist, m_vlist)) {
+            for (size_t i = 0; i < chunk->nused; ++i) {
+                switch (chunk->cmd[i]) {
+                    case BN_VLIST_LINE_MOVE: {
+                        LineMove element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_LINE_DRAW: {
+                        LineDraw element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_POLY_START: {
+                        PolygonStart element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_POLY_MOVE: {
+                        PolygonMove element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_POLY_DRAW: {
+                        PolygonDraw element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_POLY_END: {
+                        PolygonEnd element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_POLY_VERTNORM: {
+                        PolygonVertexNormal element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_TRI_START: {
+                        TriangleStart element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_TRI_MOVE: {
+                        TriangleMove element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_TRI_DRAW: {
+                        TriangleDraw element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_TRI_END: {
+                        TriangleEnd element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_TRI_VERTNORM: {
+                        TriangleVertexNormal element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_POINT_DRAW: {
+                        PointDraw element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_POINT_SIZE: {
+                        PointSize element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_LINE_WIDTH: {
+                        LineWidth element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_DISPLAY_MAT: {
+                        DisplaySpace element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    case BN_VLIST_MODEL_MAT: {
+                        ModelSpace element(chunk, i);
+
+                        if (!callBack(&element))
+                            cont = false;
+                    }
+
+                    default:
+                        if (!callBack(0))
+                            cont = false;
+                }
+
+                if (!cont)
+                    return;
+            }
+        }
+    }
+}
+
+
+bool VectorList::Append
+(
+    const Element& element
+) {
+    bool ret = false;
+
+    if (!BU_SETJUMP) {
+        switch (element.Type()) {
+            case Element::ElementType::PointDraw: {
+                const PointDraw& actualElement = static_cast<const 
PointDraw&>(element);
+
+                RT_ADD_VLIST(m_vlist, actualElement.Point().coordinates, 
BN_VLIST_POINT_DRAW);
+                break;
+            }
+
+            case Element::ElementType::PointSize: {
+                const PointSize& actualElement = static_cast<const 
PointSize&>(element);
+
+                RT_VLIST_SET_POINT_SIZE(m_vlist, actualElement.Size());
+                break;
+            }
+
+            case Element::ElementType::LineMove: {
+                const LineMove& actualElement = static_cast<const 
LineMove&>(element);
+
+                RT_ADD_VLIST(m_vlist, actualElement.Point().coordinates, 
BN_VLIST_LINE_MOVE);
+                break;
+            }
+
+            case Element::ElementType::LineDraw: {
+                const LineDraw& actualElement = static_cast<const 
LineDraw&>(element);
+
+                RT_ADD_VLIST(m_vlist, actualElement.Point().coordinates, 
BN_VLIST_LINE_DRAW);
+                break;
+            }
+
+            case Element::ElementType::LineWidth: {
+                const LineWidth& actualElement = static_cast<const 
LineWidth&>(element);
+
+                RT_VLIST_SET_LINE_WIDTH(m_vlist, actualElement.Width());
+                break;
+            }
+
+            case Element::ElementType::TriangleStart: {
+                const TriangleStart& actualElement = static_cast<const 
TriangleStart&>(element);
+
+                RT_ADD_VLIST(m_vlist, actualElement.Normal().coordinates, 
BN_VLIST_TRI_START);
+                break;
+            }
+
+            case Element::ElementType::TriangleMove: {
+                const TriangleMove& actualElement = static_cast<const 
TriangleMove&>(element);
+
+                RT_ADD_VLIST(m_vlist, actualElement.Point().coordinates, 
BN_VLIST_TRI_MOVE);
+                break;
+            }
+
+            case Element::ElementType::TriangleDraw: {
+                const TriangleDraw& actualElement = static_cast<const 
TriangleDraw&>(element);
+
+                RT_ADD_VLIST(m_vlist, actualElement.Point().coordinates, 
BN_VLIST_TRI_DRAW);
+                break;
+            }
+
+            case Element::ElementType::TriangleEnd: {
+                const TriangleEnd& actualElement = static_cast<const 
TriangleEnd&>(element);
+
+                RT_ADD_VLIST(m_vlist, actualElement.Point().coordinates, 
BN_VLIST_TRI_END);
+                break;
+            }
+
+            case Element::ElementType::TriangleVertexNormal: {
+                const TriangleVertexNormal& actualElement = static_cast<const 
TriangleVertexNormal&>(element);
+
+                RT_ADD_VLIST(m_vlist, actualElement.Normal().coordinates, 
BN_VLIST_TRI_VERTNORM);
+                break;
+            }
+
+            case Element::ElementType::PolygonStart: {
+                const PolygonStart& actualElement = static_cast<const 
PolygonStart&>(element);
+
+                RT_ADD_VLIST(m_vlist, actualElement.Normal().coordinates, 
BN_VLIST_POLY_START);
+                break;
+            }
+
+            case Element::ElementType::PolygonMove: {
+                const PolygonMove& actualElement = static_cast<const 
PolygonMove&>(element);
+
+                RT_ADD_VLIST(m_vlist, actualElement.Point().coordinates, 
BN_VLIST_POLY_MOVE);
+                break;
+            }
+
+            case Element::ElementType::PolygonDraw: {
+                const PolygonDraw& actualElement = static_cast<const 
PolygonDraw&>(element);
+
+                RT_ADD_VLIST(m_vlist, actualElement.Point().coordinates, 
BN_VLIST_POLY_DRAW);
+                break;
+            }
+
+            case Element::ElementType::PolygonEnd: {
+                const PolygonEnd& actualElement = static_cast<const 
PolygonEnd&>(element);
+
+                RT_ADD_VLIST(m_vlist, actualElement.Point().coordinates, 
BN_VLIST_POLY_END);
+                break;
+            }
+
+            case Element::ElementType::PolygonVertexNormal: {
+                const PolygonVertexNormal& actualElement = static_cast<const 
PolygonVertexNormal&>(element);
+
+                RT_ADD_VLIST(m_vlist, actualElement.Normal().coordinates, 
BN_VLIST_POLY_VERTNORM);
+                break;
+            }
+
+            case Element::ElementType::DisplaySpace: {
+                const DisplaySpace& actualElement = static_cast<const 
DisplaySpace&>(element);
+
+                RT_VLIST_SET_DISP_MAT(m_vlist, 
actualElement.ReferencePoint().coordinates);
+                break;
+            }
+
+            case Element::ElementType::ModelSpace:
+                RT_VLIST_SET_MODEL_MAT(m_vlist);
+        }
+
+        ret = true;
+    }
+    else
+        BU_UNSETJUMP;
+
+    BU_UNSETJUMP;
+
+    return ret;
+}
+
+
+void VectorList::Clear(void) {
+    RT_FREE_VLIST(m_vlist);
+}


Property changes on: rt^3/trunk/src/coreInterface/VectorList.cpp
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
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