Skip to content

Source Structure

Viktor Kovacs edited this page Nov 16, 2020 · 41 revisions

Main Folders

The source contains the following folders:

  • Documentation: Here you can find some documentation related stuff, like images.
  • Sources: The source code. See the following sections for details.
  • Tools: Various tools for the project.

Source Modules

You can find some subfolders under the Sources folder. Every folder contains a separate compilation unit (module). The figure below shows the hierarchy of the modules.

Architecture

Core Modules

  • NodeEngine: This module contains the code for the main engine. It implements the main logical and persistence layer of the application.
  • NodeUIEngine: This module is responsible for User Interface and Event handling. This is a platform independent layer, every platform specific operation is handled by interfaces.
  • BuiltInNodes: This is an optional module which contains some basic functionality. It is highly recommended to use this module in your application because it contains implementations for the most common use cases.

Application Modules

  • EmbeddingTutorial: This module contains the source code for the Embedding Tutorial page. This is a simple ui-less application which embeds the engine.
  • WindowsAppSupport: This module contains some windows implementations of the required interfaces. If you would like to use the engine on windows, these codes can help you a lot.
  • MacOSAppSupport: This module contains some MacOS implementations of the required interfaces. It is written in Objective-C++ using the Cocoa framework.
  • WindowsEmbeddingDemo: This is a minimal test application which embeds the engine. This is a good starting point to understand how embedding works on Windows.
  • MacOSEmbeddingDemo: This is a minimal test application which embeds the engine. This is a good starting point to understand how embedding works on MacOS with a Cocoa-based application.
  • WindowsReferenceApp: This is an example application that utilizes all of the features of the engine. It can be used as a reference implementation to check out the capabilities of the engine.

Test Modules

  • TestFramework: This is a very simple unit testing framework used by the tests.
  • NodeEngineTest: This is a platform independent automated test executable for all of the core modules.

NodeEngine

The NodeEngine module is responsible for storing the graph and do basic operations on it.

Module responsibilities:

  • Node graph operations:
    • Add/Delete nodes.
    • Connect/Disconnect nodes.
    • Merge graphs (support for Copy/Paste and Undo/Redo).
  • Node graph evaluation:
    • Calculate and cache node values.
    • Invalidate node values automatically on any change.
    • Detecting cycles in graph.
  • Serialization.
  • Localization.

NodeUIEngine

The NodeUIEngine module is responsible for the visualization logic. This is a still platform independent layer, but it works with visualization related entities. Every platform dependent functionality is implemented outside this module, and they are communicating through interfaces.

Module responsibilities:

  • Drawing of nodes and connections.
  • Store the result drawing in a platform independent data structure.
  • Handling user interactions:
    • Navigation on the canvas.
    • Mouse and keyboard events.
    • Context menu commands.
    • Copy/Paste.
    • Undo/Redo.
  • Support for easy embedding.

BuiltInNodes

The BuiltInNodes module implements some basic functionalities to make the library easier to use in another application.

Module responsibilities:

  • Basic nodes (integer, number, boolean, lists, operations, viewer, etc.).
  • Basic layouts for nodes (header, slots, buttons, etc.).

WindowsAppSupport

The WindowsAppSupport module implements some platform-dependent functionalities for Windows.

Module responsibilities:

  • Event handler implementation.
  • Drawing context implementations:
    • Gdi,
    • GdiPlus,
    • DirectX.
  • Context menu handling.
  • Basic dialog for parameter settings.
  • A full enviromnent with all of the above together.

MacOSAppSupport

The MacOSAppSupport module implements some platform-dependent functionalities for MacOS Cocoa applications. This module is in experimental state.

Module responsibilities:

  • Event handling and drawing context implementations for NSView.
  • Context menu handling.