Introduction
This article will introduce you to a new concept which is known as data visualization. The whole tool will be explained in detail across many articles. In this article, I will explain the data structure and some of the file structures used.
Background
A previous knowledge of Data structures, Generics in C#2.0 and file structure.
File Structure
I'm using a file format used by a very famous visualization tool, tecplot. It uses 4 different file structures. For more details, you can refer to the file structure documentation.
Data Structure
There exist two main problems in defining the data structure which the tool is going to be built upon.
The first problem resulted from the various file structures being used. Data is presented in four formats and you still need to apply some algorithms and techniques to these structures. So, it's inconvenient to code a given algorithm four times for each format. What we need to solve this problem is a generic data structure. That acts as a layer between the algorithms and visualization techniques and the various file formats. We can simply imagine that we need an interface between the logic and the data format.
The second problem is that data isn't always static. Some algorithms to operate need to apply preprocessing or restructuring on the data like adaptive techniques that will be explained in later parts in detail.
So, the suitable solution for these problems is to make a hierarchical data structure, similar to the one used in 3D Studio Max. The benefits of this structure will get more clear as we proceed in more advanced visualization techniques.
Using the Code
Let's navigate through the code. you'll find some lists, generics, that hold the data in the hierarchical form we discussed above.
Class ScoOteRParser
{
protected List<Point> Points;
protected List<Edge> Edges;
protected List<Face> Faces;
protected List<Polygon> Polygons;
protected List<Element> Elements;
.
.
.
.
.
}
Below is the part of the code that's responsible for transforming the data from the various file formats to our generic hierarchical data structure:
public bool Load(string FileName){...}
#region Data Relation extraction functions
private void ReadPoints(int PointsNum){...}
private void ReadBlock(int PointsNum){...}
private bool ReadUnstructuredZone(string ZoneHeader, type Type){....}
private bool ReadFiniteElementZone(string ZoneHeader, type Type){....}
#endregion
By now, we've read the various file structures and put them into a standard data structure and we're ready to apply our data visualization techniques. You can start from here with the Line contouring algorithm.
History
- 11th August, 2006: Initial post
Nvidia Registered game developer.
Teaching Assistant,
Faculty of computer and information sciences,
Ain Shams University.
SmartLabZ QT Developer.
Have an experience of more than 2 years in c++(QT/MFC/ATL/Win32),c#, GDI,DirectX