Giter Club home page Giter Club logo

gridiron's People

Stargazers

 avatar

Watchers

 avatar

Forkers

windrobin

gridiron's Issues

Expand integration between Qt and OGRE.

Right now, all 3D widgets inherit from OgreWidget, a bare-bones integration class that wraps an Ogre::RenderWindow inside a QWidget. This is adequate for highly specialised or simple widgets, but for something like MapView, containing multiple geometric objects each needing custom behaviour (context menus, drag & drop, selection), there needs to be another layer to facilitate this in a general way.

Qt features a graphics view framework that separates scenes (QGraphicsScene) and views (QGraphicsView), allowing multiple views to show off different parts of the same scene in a similar way to the Qt's model/view framework. Scenes are made up of scene items (QGraphicsItem). Many events are forwarded from the view to the scene and into the item underneath the cursor, allowing items to have customised behaviour through subclasses.

Creating an equivalent for 3D scenes would bring about many benefits. The MapView class would become a small subclass of the view class. The Tool classes could become virtual scene items with infinite bounds (to receive all events before anything else), or otherwise stay as modes of MapView. Individual clickable items (map objects) would be represented as scene items, completely obsoleting the hacked together MapGeometry class and streamlining additions and modifications to the way geometry can be interacted with.

New classes:

  • SceneView - A subclass of OgreWidget, this class holds an Ogre::Camera from a Scene, and uses it to translate incoming mouse events to the scene's world space.
  • Scene - Encapsulates an Ogre::SceneManager and holds SceneItem objects. Forwards incoming events from SceneView objects to the appropriate SceneItem object (usually the one below the cursor). Tells SceneView objects to repaint themselves when scene changes.
  • SceneItem - An abstract class that receives events from its Scene, provides a bounding box, and informs Scene of any changes to its bounding box.

Changes:

  • MapView - Becomes a subclass of SceneView instead of a direct subclass of OgreWidget.
  • MapGeometry - Instead of staying as a monolithic class that creates, updates and holds, all the geometry in the scene, the contents of this class can be moved into various SceneItem subclasses.

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.