Git Product home page Git Product logo

lecrapouille / simtadyn Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 3.95 MB

[Application][Version 0.4][Not Functional][Will be remade] SIMulateur TAbleur DYNamique: a GIS in a spreadsheet

License: GNU General Public License v3.0

C++ 94.17% Shell 0.53% Forth 2.43% C 0.04% Makefile 1.40% Objective-C 0.80% Scilab 0.23% RenderScript 0.03% GLSL 0.37%
gis spreadsheet graph science cartography cpp opengl forth gtkmm

simtadyn's Introduction

SimTaDyn

License: GPL v3 Coverity scan Coverage Status

Branch Linux/Mac OS Windows openSUSE Build
master Build Status Build status compiled versions
development Build Status

SimTaDyn is a proof of concept project for a geographic information system (GIS) allowing to draw geographic maps and manipulate them like a spreadsheet (Excel). The goal is to add formulas in cells and design dynamical geographic simulations (like SimCity game). Please, read this introduction to understand better the idea of this project.

alt tag This screenshot comes from the legacy version of SimTaDyn

Table of contents:

Note concerning git branches

SimTaDyn was originally a one-year student project made in 2004 release-EPITA-2004 branch. In 2017 I decided to reborn it and rewrite it from scratch master branch and development branch.

  • If you just want to see what the project can do, use the release-EPITA-2004 branch. This branch is no longer developed but is enough functional and show more functionalities than the master branch. You will have a better idea of the idea of SimTaDyn. This version crashes if the map is not currently bind to a mySQL table (create one in local). It would have been better to catch this "no connection error" and display instead an error ! You cannot save maps or develop concrete GIS applications.

  • The development branch is a total rework (and still in gestation) of the branch release-EPITA-2004 branch but currently there is less features than the 2004 branch. When you git clone the project, you will be in the development branch (not on the git master!). This branch is the default for developers. With this branch, the build may be broken due temporary experiments and miss of time. I prefer pushing partial code in temporary dev- branches and pick them in the development branch.

  • The master branch peaks stable releases from the development git branch (2017+). Code source of releases can also be downloaded directly. With OpenSUSE Build I'm trying to compile this project into different distribution packages (for the moment only deb packages, not yet RPM packages, so feel free to contribute).

What is have been done ?

  • Basic utilities for the project (container, log, maths, patterns ...).
  • Basic Forth interpreter (can runs very basic scripts).
  • Basic spreadsheet parser (compute simple sheets with basic Forth formulas).
  • Graph structure (node, arcs, zones), Map, sheet internal structures.
  • Basic loader and resource managers.
  • Scene graph and Basic OpenGL wrapper allowing to write in few line 3D OpenGL-Core scenes (like glumpy).
  • Basic GTKmm GUI (OpenGL view, Forth editor, map tools, inspectors).
  • Continuous integration (Travis-CI).

What is currently in progress ?

GUI integrating OpenGL, Forth and Maps:

  • Add GUI tools for map edition: add, remove nodes, arcs, edit cells, undo, redo.
  • OpenGL wrapper: add routines for drawing maps and graphes.
  • Map renderering.

What is has to be done ?

  • Complete Forth core system (high level words, GIS and spreadsheet manipulation
  • Link the map with a database (each cells can have several fields).
  • 2D/3D view of the map (2d for edition, 3d for the simulation).
  • Create a basic application.

simtadyn's People

Contributors

lecrapouille avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mapsworks

simtadyn's Issues

Tasks: Continuous Integration

Travis work:

  • Add build for OSX (clang only ?)

  • OSX: implement homebrew command

  • Add build for Window

  • Fix build for Window

  • Deployment: fix checkinstall bug: empty debian package in docker (while working on my computer).

  • Deployment: debian package, RPM package, different archi (32, 64). Maybe: https://en.opensuse.org ?

Tasks: Optim

  • Use more data oriented design than object oriented design
  • Use std::move and move constructor for class like Matrix, Graph, Queue, Stack (Forth stack ? swap Forth dictionaries ?)
  • add lazy matrix evaluation with templates. Use armadillo or call OpenBLAS when pure matrix else call naive matrix product which let overload operator like maxplus algebra. For this, use template specialization

Tasks: Forth & Forth Editor

Forth:

  • http://ficl.sourceforge.net

  • use LaTeX to Unicode for forth names. Use radix as hash ?

  • add radix tree for Forth index dico

  • Optimize loop: 30 times slower than pForth and 60 times slower than gforth

  • Add words: DOES>, struct, string. Add words for adding a Forth tasks scheduler.

  • Interfacing C/C++ code as Forth Words (use gtkmm modules). Use glibmm/Modules for loading .so files

  • Adding the float stack, alternative stack. Improve the data/return stack display and inside log files.

  • Avoid the user to make segfault. Allow or not allow the R> to store into the return stack or use the alternative stack ?

  • Have a better trace and debug mode in Forth

  • Reusing the idea of :: from Reforth ?

  • Idea from FreeForth: use anonymous words (no longer STATE: interpreting but only compiling). Could be great inside Forth cells.

  • Allow or not allow compiling Forth scripts inside cells (avoiding bloat the forth dictionary ?)

  • Give a name to dictionaries (forget the reason)

SimForth:

  • Add forth words like -> or -- for defining a graph like made in dot scripts. C1 C2 -> to say they are linked.

  • Gtk button for stopping a forth script.

  • race condition on the map with several forth scripts running together.

  • Forth words for manipulating the graph: select, add, remove, generate_grid ... accessing to GIS informations of each cells: read/write (be careful concurrency, race condition).

  • Forth words SQL-like: SELECT, WHERE ...

  • Add Forth words ON_REALIZE, ON_CELL_ADDED, ON_CELL_MOVED ... as events/listener that the user can implement as small forth scripts. Example: if (exists_on_dictionary("ON_MAP_REALIZE") { exec("ON_MAP_REALIZE"); }

  • Manage Forth script errors on a map cells: non empty data stack after executing a Forth script. Unknown words, circular reference, infinite loop, how to interrupt the whole scripts on other cells.

  • Detecting circular references in the spreadsheet: A1 = B1 and B1 = A1. In discrete time A1(n+1) = B1(n). Adding a delay (Z^-1) word. Discretization step is tricky: if the user add a loop on function, we no longer have a linear system: u_n = f(u_{n-1}). Add a counter to know the number of times u_n was updated ?

  • Pathologic case to test: excute a huge and low script forth. During the execution, open the forth editor notebook and edit the current running script. It should crash. Idea: use anonymous word or make read-only the text. Same idea when editing the map during the runtime of a script.

  • Example of Forth scripts: Forced-graph. Depth illusion for nodes, translate this shader code into forth :
    gl_PointSize = size * ( 351.0 / length( mvPosition.xyz ) );

Bugs: Sheets ID + SceneGraph node ID on destructor

[18:34:46][INFO][SimTaDynMap.hpp::59] Deleting SimTaDynMap #1 named 'NewMap_0'
[18:34:46][INFO][SceneGraph.tpp::112] SceneGraph delete node 'NewSheet_1'
[18:34:46][INFO][SceneGraph.tpp::112] SceneGraph delete node 'NewSheet_2'
[18:34:46][INFO][SimTaDynSheet.hpp::132] Deleting SimTaDynSheet named 'NewSheet_2' with ID #3
[18:34:46][INFO][SceneGraph.tpp::112] SceneGraph delete node ''
[18:34:46][INFO][SceneGraph.tpp::112] SceneGraph delete node 'NewSheet_3'
[18:34:46][INFO][SimTaDynSheet.hpp::132] Deleting SimTaDynSheet named 'NewSheet_1' with ID #3
[18:34:46][INFO][SceneGraph.tpp::112] SceneGraph delete node ''
[18:34:46][INFO][SimTaDynSheet.hpp::132] Deleting SimTaDynSheet named 'NewSheet_3' with ID #3

Tasks: OpenGL classes

  • Camera + world picking

  • Mesh: make a more generic class (vector of VBOs ?), visible field.

  • Basic 3D geometries: cone, arrowed-axis, sprite

  • Add sprites as node in the map.

  • Basic 2D geometries: bezier, ...

  • Fonts (X11), display the text on a bezier

  • Renderer, Renderable

  • Texture: Merge with the pending class

  • Texture: add gtk menu for loading jpeg as textures. Use the loader manager. Add a window for displaying loaded textures in a grid.

  • Texture: add a tool for applying a texture on spreadsheet zones.

  • FrameBuffer class

  • OpenGL is not working with gtkmm and OS X.

  • Can an OpenGL window be opened from gtk without using gtkglarea ? Manage several OpenGL contexts.

Tasks: GUI

General:

  • See glade.glade for the next menubar style

  • Missing GTK+ Mnemonics on the menubar (Ctr-S, Ctr-O).

  • Rethinking the UI (separate editor windows Forth/Maps ? Statusbar is useless).

  • Add a window for showing SimTaDyn files (maps, shaders, database, forth scripts) like Emacs speedbar.

Forth Editor:

  • Try to have the same interactive layout of jupyter http://jupyter.org/

  • Fix syntax coloration when inserting a text (perform the coloration on the last word of the string): it's a misunderstanding of the GTK event "on_text_inserted".

  • Split screen Emacs way.

  • Do not search forth words inside the dictionary inside a Forth comments (avoid to grey all the comments as unknown words)

  • Add windows for displaying Forth stacks, Forth dictionary.

  • Display line and column in the text editor.

  • Add a tooltip when auto-completing Forth words with the complete list of possible words. Optimize the search of partial words in dictionary not optimize (several iterations).

  • GTK+ button for editing a Forth script: right button opens a popup for editing fields (name, script, help) and save into a special files for not being lost when the application quits.

  • Forth editor: right button on a Forth word: open the file containing the highlight definition. Open the file when clicking on the INCLUDE forth word.

  • Window displaying the history of Forth commands. Bind keyboard for moving in the history.

  • Change the background color to grey when editing a read-only file.

  • Detect when another editor modified the content of a currently edited file. Popup: refresh.

  • Do not clear the text when not in interactive Forth window. Implement a special interactive forth window.

  • Ameliorer les redirections des cout/cerr dans les notebook/statusbar. Idee! dans Forth faire une virtual methode my_cout() pour le mot FORTH . et dans SimForth on redefini my_cout() pour afficher dans un notebook.

Map editor:

  • Split screen Emacs way, drag-and-drop cells

Tasks: SimTaDyn

  • Implement a SimTaDyn file: kind of zip or pak extension containing several files, MD5 and index.

  • Make Script forth as a config file (user variables). Use the Config.hpp for default values but overloaded by the config script

  • Implement spreadsheet from the graph class. Have a basic spreadsheet working.

  • Add forth words in the graph iterating on direct neighbors. Use the result of the spreadsheet as input of the computation.

  • Add a database class for managing GIS informations. Add Forth words for manipulating it. Add a visitor for managing the database, the graph ? http://blog.arkey.fr/2010/05/06/les-visiteurs-une-question-de-nommage-et-le-double-dispatch/

  • Ajouter des formats import/export: OpenStreetMap, MapInfo, Scilab. Sauvegarder dans SQL.

  • Logger: manage several logs.

  • [x ] Add a MemoryLeak manager.

  • Use smart pointers on SimTaDyn resources: maps, graph, text documents ...

Tasks: Map & Map Editor

  • Mouse events (word picking, camera move, adding, removing cells), gtk+ buttons for editing a map. Use the class RTree for mouse picking and for not drawing element outside the camera frustum (frustum culling).

  • Add Bezier curve. An arc can be displayed as a segment or polyline or bezier.

  • Add the camera mode 2D, 3D mode selection.

  • Allow adding a sprite on background as geo-reference.

  • Manage several maps: emacs-like: split screen (multiple viewports + drag-and-drop on cells) ? separate windows ?

  • Update the RTree class (use a memory manager for optimizing new/alloc nodes). Add option for debugin RTree: show bounding boxes. Convert a RTree to an Octree class when the map is dynamicaly modified: forced-graph. RTree is a static index and it's not made for dynamically insert/remove operations. To think: RTree node number of children shall be the same than Graph node container size (could store a RTree node inside the graphic card in one pass, maybe add inheritance with the pending data class) ?

  • Add layers like Excel. 1 layer = 1 field of the database.

  • Display in red cells with faulty forth script. Clicking on it makes open the file in the notebook of the Forth Editor.

  • Add spreadhseet observers/listeners: on cell content changed, position moved, deleted.

  • C++ inheritance: Add a ancestor for cells to avoid doing switch cases

  • Loader: finish shapefile loader, import/export files: OpenStreetMap, MapInfo, Scilab Ciudadsim

  • Make a doc of the map definition:

  • border: delta symbol, exclude corners.

  • delta node = nil

  • delta arc = node1, node2, excluding corners

  • delta zone = arc1, ... arcN, excluding nodes.

  • Recursive maps: A node can link to another SimTaDyn map: double clicking for opening it (like an url, forth word LOADMAP maville2.simtadyn). The Map can be store in a SQL server. We can add a sprite on the mode with a screenshot of the map (OpenGL framebuffer --> texture --> sprite). Arcs going to this node shall be represent in the map of the node (like roads and a city, when clicking on the map you load the map of this city with more details roads ...

  • Add different style of map cells iterators: depthFirstSearch_iterator, ...

  • Improve in the depthFirstSearch for the graph: due to bad distinction between from_node and to_node in the class arc. The algorithm try using the wrong node but rejects it because already visited.

  • Add the zone class with methods: Find the edge of a cloud of points. When triangulating a zone: copy GIS informations from the parent to children.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.