[Git][debian-gis-team/libcitygml][experimental] 5 commits: New upstream version 2.5.1

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Thu May 11 11:14:50 BST 2023



Bas Couwenberg pushed to branch experimental at Debian GIS Project / libcitygml


Commits:
126eeaf3 by Bas Couwenberg at 2023-05-11T11:24:23+02:00
New upstream version 2.5.1
- - - - -
1aaeb371 by Bas Couwenberg at 2023-05-11T11:24:24+02:00
Update upstream source from tag 'upstream/2.5.1'

Update to upstream version '2.5.1'
with Debian dir 0a3f1de682a8f809a1e3c08c3e3e0ea3eb1fb251
- - - - -
098de1f5 by Bas Couwenberg at 2023-05-11T11:24:41+02:00
New upstream release.

- - - - -
367d37bc by Bas Couwenberg at 2023-05-11T11:34:54+02:00
Update symbols for amd64.

- - - - -
981c48c0 by Bas Couwenberg at 2023-05-11T11:34:54+02:00
Set distribution to experimental.

- - - - -


4 changed files:

- debian/changelog
- debian/libcitygml2.symbols
- sources/include/citygml/tesselator.h
- sources/src/citygml/tesselator.cpp


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+libcitygml (2.5.1-1~exp1) experimental; urgency=medium
+
+  * Team upload.
+  * New upstream release.
+  * Update symbols for amd64.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Thu, 11 May 2023 11:24:58 +0200
+
 libcitygml (2.5.0-1~exp1) experimental; urgency=medium
 
   * Team upload.


=====================================
debian/libcitygml2.symbols
=====================================
@@ -1,4 +1,4 @@
-# SymbolsHelper-Confirmed: 2.5.0 amd64
+# SymbolsHelper-Confirmed: 2.5.1 amd64
 libcitygml.so.2 #PACKAGE# #MINVER#
 * Build-Depends-Package: libcitygml-dev
  _Z11toStdStringB5cxx11PKDs at Base 2.0.4
@@ -10,6 +10,7 @@ libcitygml.so.2 #PACKAGE# #MINVER#
  _ZN10Tesselator13beginCallbackEjPv at Base 0.14
  _ZN10Tesselator13errorCallbackEjPv at Base 0.14
  _ZN10Tesselator15combineCallbackEPdPPvPfS2_S1_ at Base 0.14
+ _ZN10Tesselator15processContoursEv at Base 2.5.1
  _ZN10Tesselator18vertexDataCallbackEPvS0_ at Base 1.4.3
  _ZN10Tesselator4initERK5TVec3IdE at Base 2.5.0
  _ZN10Tesselator7computeEv at Base 0.14
@@ -1464,6 +1465,7 @@ libcitygml.so.2 #PACKAGE# #MINVER#
  (optional=templinst)_ZNSt6vectorI5TVec2IfESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_ at Base 2.0.4
  (optional=templinst)_ZNSt6vectorI5TVec3IdESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_ at Base 2.0.4
  (optional=templinst)_ZNSt6vectorI5TVec3IdESaIS1_EE17_M_realloc_insertIJS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_ at Base 2.5.0
+ (optional=templinst)_ZNSt6vectorIN10Tesselator10ContourRefESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_ at Base 2.5.1
  (optional=templinst)_ZNSt6vectorIN7citygml14PolygonManager14PolygonRequestESaIS2_EE17_M_realloc_insertIJS2_EEEvN9__gnu_cxx17__normal_iteratorIPS2_S4_EEDpOT_ at Base 2.0.4
  (optional=templinst)_ZNSt6vectorIN7citygml15GeometryManager15GeometryRequestESaIS2_EE17_M_realloc_insertIJS2_EEEvN9__gnu_cxx17__normal_iteratorIPS2_S4_EEDpOT_ at Base 2.0.4
  (optional=templinst)_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_M_realloc_insertIJRKS5_EEEvN9__gnu_cxx17__normal_iteratorIPS5_S7_EEDpOT_ at Base 2.0.4


=====================================
sources/include/citygml/tesselator.h
=====================================
@@ -57,6 +57,8 @@ public:
     void compute() override;
 
 private:
+    void processContours();
+
     typedef void (APIENTRY *GLU_TESS_CALLBACK)();
     static void CALLBACK beginCallback( GLenum, void* );
     static void CALLBACK vertexDataCallback( GLvoid*, void* );
@@ -65,9 +67,18 @@ private:
     static void CALLBACK errorCallback(GLenum, void*);
 
 private:
+    // 
+    struct ContourRef {
+        ContourRef(unsigned int index, unsigned int length) : index(index), length(length) {}
+        unsigned int index;
+        unsigned int length;
+    };
+
     GLUtesselator *_tobj;
-    GLenum  _curMode;
+    GLenum _curMode;
     GLenum _windingRule;
+    std::vector<TVec3d> _originalVertices;
+    std::vector<ContourRef> _contourQueue;
 };
 
 #endif // __TESSELATOR_H__


=====================================
sources/src/citygml/tesselator.cpp
=====================================
@@ -61,6 +61,7 @@ Tesselator::~Tesselator()
 
 void Tesselator::compute()
 {
+    processContours();
     gluTessEndPolygon( _tobj );
 }
 
@@ -69,15 +70,30 @@ void Tesselator::addContour(const std::vector<TVec3d>& pts, std::vector<std::vec
     unsigned int pos = _vertices.size();
     TesselatorBase::addContour(pts, textureCoordinatesLists);
 
-    gluTessBeginContour( _tobj );
-
     unsigned int len = pts.size();
-    for ( unsigned int i = 0; i < len; i++ )
+    // Add contour to queue, and process later.
+    ContourRef contour(pos, len);
+    _contourQueue.push_back(contour);
+}
+
+void Tesselator::processContours()
+{
+    _originalVertices = _vertices;
+
+    for (const ContourRef& contour : _contourQueue)
     {
-        gluTessVertex( _tobj, &(_vertices[pos + i][0]), &_indices[pos + i] );
-    }
+        gluTessBeginContour( _tobj );
 
-    gluTessEndContour( _tobj );
+        for ( unsigned int i = 0; i < contour.length; i++ )
+        {
+            void* data = reinterpret_cast<void*>(static_cast<uintptr_t>(_indices[contour.index + i]));
+            gluTessVertex( _tobj, &(_originalVertices[contour.index + i][0]), data );
+        }
+
+        gluTessEndContour( _tobj );
+    }
+    _contourQueue.clear();
+    _originalVertices.clear();
 }
 
 void CALLBACK Tesselator::beginCallback( GLenum which, void* userData )
@@ -89,7 +105,7 @@ void CALLBACK Tesselator::beginCallback( GLenum which, void* userData )
 void CALLBACK Tesselator::vertexDataCallback( GLvoid *data, void* userData )
 {
     Tesselator *tess = static_cast<Tesselator*>(userData);
-    unsigned int index = *reinterpret_cast<unsigned int*>(data);
+    unsigned int index = static_cast<unsigned int>(reinterpret_cast<uintptr_t>(data));
 
     assert(index < tess->_vertices.size());
 
@@ -113,8 +129,8 @@ void CALLBACK Tesselator::combineCallback( GLdouble coords[3], void* vertex_data
             TVec2f newTexCoord(0,0);
 
             for (int i = 0; i < 4; i++) {
-                if (vertex_data[i] != nullptr) {
-                    unsigned int vertexIndex = *reinterpret_cast<unsigned int*>(vertex_data[i]);
+                if (weight[i] > 0.0f) {
+                    unsigned int vertexIndex = static_cast<unsigned int>(reinterpret_cast<uintptr_t>(vertex_data[i]));
                     newTexCoord = newTexCoord + weight[i] * texcords.at(vertexIndex);
                 }
             }
@@ -126,7 +142,7 @@ void CALLBACK Tesselator::combineCallback( GLdouble coords[3], void* vertex_data
         }
     }
 
-    *outData = &tess->_indices.back();
+    *outData = reinterpret_cast<void*>(static_cast<uintptr_t>(tess->_indices.back()));
 }
 
 void CALLBACK Tesselator::endCallback( void* userData )



View it on GitLab: https://salsa.debian.org/debian-gis-team/libcitygml/-/compare/5fe91b94a70d8a3c4231134d1ec83172d9740002...981c48c047da7ae52473bbacff46457b81313c4a

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/libcitygml/-/compare/5fe91b94a70d8a3c4231134d1ec83172d9740002...981c48c047da7ae52473bbacff46457b81313c4a
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20230511/9de7345b/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list