Giter VIP home page Giter VIP logo

gas-trapezoidal-maps-final-prject's Introduction

Implementation of a trapezoidal map (building and search)

A Trapezoidal Map implementation with C++ QT Creator and cg3lib

header


Repository

https://github.com/marinimau/GAS-Trapezoidal-maps-final-prject

Project Organization

The organization of the project is as follows:


Algorithms

TrapezoidalMapBuilder

contains the algorithms for the construction of the trapezoidal map and the dag. The flow of construction is as follows:

  1. Segment normalization (leftP.x < right.P)
  2. FollowSegment
  3. Evaluation of the number of trapezoid interested by the insertion: a. Simple insertion b. Two interested trapezoids insertion c. Many: combine methods of a and b.
  4. In all three cases the flow of the insertion is: a. Create new trapezoids b. Update internal and external adjacencies c. Update the dag d. Deactivate old trapezoids.

TrapezoidalMap Query:

Implements the methods to execute a point query on the dag.


Data Structures

Dag

Implements the dag (a pointer to the root, and a list to store the nodes to avoid dynamic allocation).

Node

data structure used to save the nodes of the dag. It has an attribute “type” to specify the type of the node (p, q, segment, trapezoid). Each node has an attribute value that points at the object linked to the node. Node also has pointers to left and right childs.

SegmentIntesectionChecker

Already implemented.

Trapezoid

data Structure used to store the single trapezoid using: topSegment, bottomSegment, leftP and rightP, saves also 4 pointers to manage the adjacency, and a pointer to the node that saves it in the dag.

TrapezoidalMap

data structure used to save all the trapezoids of the trapezoidalMap (using list). Save also a pointer to the trapezoids resulting from the pointQuery, it is used by the drawable to enhance it.

TrapezoidalMapDataset

Already implemented.

VerticalSegment

used to manage the vertical segment separately in the ui. Vertical segments are obtained from the list of trapezoids.


Drawables

DrawableTrapezoid

drawable for the trapezoids of the trapezoidalMap

DrawableVerticalSegment

drawable for the vertical segments of the trapezoidalMap


Managers

TrapezoidalMapManager

Already implemented.


Utils

ConsistenceChecker

Implements some tests which are executed at each segment insertion. It is evaluated:

  1. The correctness of followSegment output
  2. The equality of the sum of the areas of the trapezoids affected by the insertion and those inserted in their place.
  3. The correctness of adjacencies

These tests heavily affect performance , for this reason they are executed only in debug mode.

FileUtils

Already implemented.

FillColor

contains a method to calculate the fill color of each trapezoids based on the value of its vertices.

PointUtils

contains methods for calculate intersections, evaluate if 2 points are degenerate and others.


Technologies

Results

Tests are performed with the provided dataset and in release mode (except for 10.000). Time expressed in seconds

test time (seconds)
random10.txt 4.4e-05
random20.txt 9.5e-05
random40.txt 0.000178
random50.txt 0.000228
random100.txt 0.000464
random500.txt 0.001485
random1000.txt 0.002385
random2000.txt 0.005249
random5000.txt 0.014229
random 10000 0.034327




Screenshot

10 segments: 10 segments

10 segments (no fill): 10 segments no fill

query: query

5000 segments: 5000 segments

gas-trapezoidal-maps-final-prject's People

Contributors

marinimau avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

gas-trapezoidal-maps-final-prject's Issues

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.