This is an old revision of the document!
QML_For_Module_SyntheticMultidimensionalDataGenerator.qml
Layout (itemforModuleSyntheticMultidimensionalDataGeneratorID) consists of 2 main parts: menu that provides overview of available tools and visualization area where a scatter plot of the dataset is displayed.
recMenu): this part of the layout consists of another 3 sub-areas: (recDimensionalitySwitch) that contains an element that allows to switch between plot dimensionalities (2d/3d); (recMenuTools) that contains a number of icons that call certain functions (e.g. generate dataset) or set the interaction mode and determine how a mouse will work (e.g. Choose class); (recMenuToolsOptions) if a certain tool requires some additional parameters to be specified, they will appear in this area (e.g. magnet's power, stroke's size etc)recVisualizationArea): large area in the left and middle part of the screen is used to display a scatter plot of selected dimensions of the generated dataset.IUI/syntheticMultidimensionalDataGenerator.h(.cpp)
Module to synthetic data generation that supports (1) generation/import, (2) visualization, (3) modification, and (4) export of dataset.
generateDataset() that fills IMatrix object with uniform distributed random numbers. When updateModule() is called and an existing dataset was imported, importDataset() method is called, which converts OriginalDataset obtained from import to the internal representation of dataset, namely IMatrix object and converts IMetadata to a number of vectors which contain individual metadata attributes for all dimensions.update[Name]Layer()-method. 3-dimensional plot is implemented using purely QPainter-functionality. All models (axis, cubes, planes, datapoints) are 3D-objects, which are then projected onto xy-plane and rendered according to the z-value. This plot consists of a single layer in order to easily determine the rendering order in one place.mousePressEvent, mouseMoveEvent, mouseReleaseEvent, wheelEvent. General idea: on mousePressEvent, required interaction parameters are initialized (e.g. magnet's center, starting point of the translation etc). On mouseMoveEvent, these parameters (e.g. magnet's center is moved, selection rectangle is being drawn) and dataset itself are updated (e.g. on drag'n'drop, all selected points are moved using translation vector). On mouseReleaseEvent, parameters are set to default, and dataset is updated for the final time. Corresponding scatter plot is updated 50 times per second, following the strategy: on mousePressEvent, a timer is started which is triggered 50 times a second. On timeout(), update() method of the module, inherited from QQuickPaintedItem is called. On mouseReleaseEvent, timer is stopped and connection to update()-method is closed.exportDataset() an empty IMetadata object is created and filled with relevant data for all dimensions. This object, as well as dataset in form of IMatrix is passed to IConverterSynth::convert() method which converts these two input parameters to the suitable dataset representation.IFile/IConverterSynth.h(.cpp)
This class extends convert() method which now takes IMetadata and IMatrix object as input and saves these object in correct representation (dataset is stored as .data file, metadata is stored as .data.json).
For more details, refer to in-code documentation.