[Qgis-developer] inheriting QgSGeometry with 3D, topology and CAD functionality

Etienne Tourigny etourigny.dev at gmail.com
Mon Jun 4 06:14:58 PDT 2012


On Mon, Jun 4, 2012 at 5:27 AM, Nico Hardebol - CITG
<N.J.Hardebol at tudelft.nl> wrote:
> Dear developers,
>
>
>
> Thanks for the great efforts put into QGIS— the versatile and clear layout
> API and bindings to python help us greatly in the design of our custom
> (/academic) (structural) geologic field acquisition tool, DigiFract.
>
>
>
> On behalf of Martijn, our c++ developer who currently seeks to implement
> some 3D geometry (/CAD) functionality, we have a few questions.
>
> We want to extend QGIS with geometries that support two important features.
> The geometries should:
> (a) 'live' in three dimensions and function both as a QgsGeometry and CAD
> object. For the CAD functionality we use OpenCascade
> (http://www.opencascade.org/).
>
> (b) support the possibility to 'share' vertices.  Notice that  by 'sharing'
> we do not mean based on proximity by sharing vertices between different
> geometries.
>
> We had the following design in mind:
>
> We create a VertexSet that stores vertices in 2 or 3 dimensions. we want to
> create a XGeometry class that is derived from qgsGeometry. The XGeometry
> class has a reference to a VertexSet object. The geometries stored in a
> XGeometry object are actually indices of vertices that are stored in the
> VertexSet. So a line geometry is represented in the XGeometry object by: [1,
> 2, 3], indicating the indices of the vertices that span the line. Because
> the VertexSet can be shared by many geometries, vertices can easily be
> shared.
>
> This would seem like an ok design (in my view), however, the qgisGeometry
> class is not designed as a base class. Unlike some other classes in the QGIS
> API, it contains no virtual functions for example. If it did, I would (re-)
> implement a few virtual functions (such as the ones that are used to read
> and write a geometry object to file for example) and it would almost
> seamlessly integrate into QGIS without too much effort (ok, this is
> extremely naive of course).
>
> Our questions are:
> (1) Since qgisGeometry is not designed with virtual function. Does anybody
> have any suggestions how we could tackle this problem in a nice and elegant
> way?

I suggest you make a fork of the qgis project github repository.
(https://github.com/qgis/Quantum-GIS)

You can add new members and functions by simply subclassing
QgsGeometry. If you really need to re-implement some functions in
QgsGeometry (which would need to change the function's definitions
only), you could suggest this to the qgis developpers and it might be
included in qgis-2.0 . You can do this by issuing a "pull request"
(see github), and perhaps a documented entry in the issue tracker
amd/or discussions here.

>
> (2) QGIS build-and-install seem not to have an automake with configure. Is
> the most straightforward way for compiling our custom (QGIS derived) library
> by placing it in a QGIS_source and adjusting CMakeLists files? Is there a
> better way?

You can always use the qgis api to make a custom application (and link
against qgis).

But in your case you might have to make a custom qgis (with
QgsGeometry virtual functions), so it might be easier to integrate
everything in the qgis sources and modify the CMakeLists  (as you
suggest) - this is probably the simplest initial approach.

Other options is to modify qgis to your needs, and then use the
modified qgis libs in your project.

>
> (3) QGIS shows well equipped to support our custom class and academic
> software design for structural geologic purpose, aiming at better
> integration of some GIS and 3D CAD functionality. We are interested to learn
> from and contribute  to those in QGIS community with similar aim. We notice
> how some 1.8-2.0 QGIS design aiming at, for instance, refined topology
> handling, but true 3D CAD is most probably not in the scope of QGIS
> development. Anyway, interested to learn who might have a similar
> development goal.
>
> Kind regards,
>
> Nico Hardebol, on behalf of Martijn Stroeven
>
>
>
> ----------------------------------------------------
>
> TU Delft
>
> Civil Engineering and Geosciences
>
> Dept. Applied Geology
>
> Room 3.17
>
> 2628 CN Delft, NL
>
> Tel +31 15 27 82707
>
> Fax +31 15 27 81189
>
> N.J.Hardebol at tudelft.nl
>
>
>
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>


More information about the Qgis-developer mailing list