|
ADDING VISUALIZATION
MODES - VERSION 1.0
Preface
In order to handle the vast range of input types
Liquid is expected to, sensory data is constrained to a single
format per sensor class called the output format.
The output format describes what kind of data (type)
sensors from a given class should return, and how it should be
formatted (constrained). Each of the supported output formats
(see Output
Descriptors for Developers) is visualized in a different
manner.
INFO: The component-based architecture
of Liquid which is suppose to allow the toolkits visualization
library to be extended has not yet been fully finalized (as of
version 1.0). The process of adding new visualization modes requires
hard-coding the new medium into the toolkit at all levels of its
hierarchy, Liquid, Liquid Device Drivers (LDD) and Liquid Client
Applications (LCA).
TO ADD A NEW VISUALIZATION MODE
Before proceeding with this tutorial make sure you
have finished Adding
Output Formats. The process of adding a new visualization
mode to the toolkits library involves 5 stages:
STAGE 1: UPDATE resetData(..)
Liquid uses the method resetData(..)
to wipe the contents of the SENSOR_DATA
structure it uses to facilitate the storage and transfer of sensory
input. Append the necessary code to the method in order to clear
the input container created in the Adding
Output Formats tutorial.
resetData(..) can be located
in the source file Vis.cpp of the Liquid project space,
download it here.
STAGE 2: CREATE A NEW COLLECT METHOD
Liquid uses methods that start with the prefix collectXXX(..)
to obtain sensor input from an LDD and store it in the respective
element of a SENSOR_DATA structure.
collectXXX(..) methods
can be located in the source file Vis.cpp of the Liquid
project space, download it here.
Consult the source code on how to fashion your own collect method.
On completion of this step add the method definition
to the source file Vis.h.
STAGE 3: CREATE A NEW DRAW METHOD
Liquid uses methods that start with the prefix drawXXX(..)
to visual sensor input obtained from an LDD.
drawXXX(..) methods can
be located in the source file Vis.cpp of the Liquid project
space, download it here.
Consult the source code on how to fashion your own draw method.
The visualization mode must be drawn within a window
that measures by 760 pixels on the X axis and 270 pixels on the
Y axis. The window is drawn from the position (20,20).
On completion of this step add the method definition
to the source file Vis.h.
INFO: A basic knowledge of
the OpenGL graphics API is required in order to complete this
stage.
STAGE 4: CREATE A NEW NETWORK METHOD
Liquid uses methods that start with the prefix networkXXX(..)
to collect and package sensor input into a nondescript data buffer
for transmission over a TCP connection.
networkXXX(..) methods
can be located in the source file Network.cpp of the
Liquid project space, download it here.
Consult the source code on how to fashion your own collect method.
STAGE 5: UPDATE RenderSensor()
Liquid uses the method RenderSensor()
to collect input from the loaded sensors using the appropriate
collectXXX(..) method and render the
currently selected sensors input using the respective drawXXX(..)
method.
RenderSensor() can be
located in the source file Main.cpp of the Liquid project
space, download it here.
Insert the necessary source code to make use of the newly supported
output formats collect and draw methods when required by the Liquid
application. Consult the source code on how this should be done.
STAGE 6: UPDATE THE OUTPUT SERVER
Liquid uses the method SensorProc(..)
to run the OUTPUT
server. It selects the required networkXXX(..)
method when posting data to an LCA.
SensorProc(..) can be
located in the source file Network.cpp of the Liquid
project space, download it here.
Insert the necessary source code to access the newly supported
output formats network method when required by the Liquid application.
Consult the source code on how this should be done.
STAGE 7: ODDS +
ENDS
You have now successfully added your new visualization
mode. To finish this tutorial open the LCA project space (download
from here)
and using a combination of the collectXXX(..)
and networkXXX(..) methods write an
interpreter for the data stream the OUTPUT server will send you
newly supported output format in.
The necessary source code should be inserted into
the method SensorProc(..) of the source
file Client.cpp.
******************************************************************************************
Now you have completed this tutorial you can finish
Adding Sensor Classes.
The variable names you selected to represent the
constraint parameters in Adding
Output Formats
should be used as the parameter names in stage 2 of the Adding
Sensor Classes tutorial.
.
. back to Manual Index
|