Home Home Faculty Home Faculty of Computer Science
Free University of Bozen - Bolzano

Database and Information Systems

ABOUT DIS
Staff
Guests
How to reach us
Open Positions

TEACHING
BSc: DB Stream
MSc: DB Stream

COURSES
Advanced Topics in Databases
Advanced Topics in Inf. Systems
Approximation: Theory and Algorithms
Data Management Systems
Data Structures and Algorithms
Data Warehousing/Mining
Distributed Databases
Mobile Services
Seminar in Databases
Temporal and Spatial Databases

RESEARCH
Publications
PhD Projects
Software
Scientific Services
Seminars

RESEARCH PROJECTS
eBZ – 2015
COSPA
3DVDM-DS
Eurescom P817
Chorochronos
XVDM

FACULTY
IT Services
Faculty Council
Regulations

LINKS
DBLP
OnlineLibraries@unibz
G

W
About
Requirements
Download
Installation
Running
New Module
How Tos
Credits
Links

The calculateProperties Function of a Line Visualization

This web page describes how to visualize a line with the help of the 3DVDM system. In this example we draw a line between points (0, 1/2, 1/2) and (1, 1/2, 1/2). We allow the user to change one parameters of the visualization: to turn on/off the visualization.

Three blocks of code are used to visualize the tetrahedra: (i) the allocation of the memory (cf. lines 12-18 of the code below), (ii) the computation of the visualization parameters (cf. lines 19-26), and the transfer of the data to the VR++ module of the system (cf. line 33). The rest of the code is required to implement turning on/off of the visualization. For example, lines 10-26 implements the scenario, when the showObjects check box of the GUI is selected, and lines 27-32 implements the scenario, when the showObjects check box is not selected.

     1  TaskState ExampleMapper::calculateProperties()
     2  {
     3    float start[3];  // beginning of the line
     4    float end[3];    // end of the line
     5    float color_start[4]; // red,green,blue,alpha of the start point
     6    float color_end[4]; // red,green,blue,alpha of the end point
     7    unsigned long object_line; // the counter of lines
     8
     9    numberOfLines = 1;
    10   
    11    if ( showObjects == true ){
    12      if (lineProperties == NULL){
    13        lineProperties = new float[LINE_PROPERTIES*numberOfLines];
    14      } else {
    15        delete [] lineProperties;
    16        lineProperties = new float[LINE_PROPERTIES*numberOfLines];
    17      }
    18
    19      start[0] = 0.0; start[1] = 0.5; start[2] = 0.5;
    20      end[0] = 1.0; end[1] = 0.5; end[2] = 0.5;
    21      color_start[0] = color_start[1] = color_start[2] = color_start[3] = 1.0;
    22      color_end[0] = color_end[1] = color_end[2] = color_end[3] = 1.0;
    23
    24      object_line = 0;
    25      setLine(object_line, start, end, color_start, color_end);
    26
    27    } else {
    28      numberOfLines = 0;
    29      delete [] lineProperties;
    30      lineProperties = NULL;
    31    }
    32
    33	  return SEND;
    34	}
    35