Isoline drawing algorithm and programming implementation based on case table
Hou Feng-Zhen,Zhuang Jian-Jun,Ning Xin-Bao
DOI: https://doi.org/10.3321/j.issn:0469-5097.2008.04.006
2008-01-01
Abstract:The isoline map is a representing method of discrete data in graphics,which is widely used in the technical scope and construction project of water conservancy,civil works,geological exploration and oil exploration etc.It visualizes the process of data analysis.The procedure of drawing an isoline map generally includes the following steps: meshing the discrete data point,interpolating the points with equivalent field value on every mesh edge,connecting all the equivalent points to draw an isoline,polishing the isoline map,such as smooth-processing,marking each isoline and displaying the data by filling with color etc.Here,the paper introduces a simple but effective algorithm of drawing and smoothing an isoline map.It has the same time complexity as the traditional algorithm.However,it does not need to trace the isoline and determine its trend.Using this algorithm,we just need to divide the 2D surface into a number of quadrilaterals which are adjacent together.Each quadrilateral is the smallest unit of the isoline drawing and its four vertices are the nearest four data points.As long as we traverse all the units we have divided before one by one in turn,we draw each section of isoline under the case-table's instruction during the process,which will produce all of the line sections.From a macroscopic aspect,all the line sections within the unit can be connected and form a smooth isoline.We also introduce how to design and achieve the program for connecting,smoothing and filling the isoline with color by OpenGL.It can be used in the 64-channels epicardial mapping system which is developed by ourselves to realize real-time displaying and post processing of the data.By means of strong OpenGL's modeling ability and rasterization technology with hardware acceleration,we will realize the isoline's smoothing and filling more effectively and quickly which will enable its filling effect of the color to a pixel class.What's more,its speed can satisfy the real-time display of mapping data.All these can make the epicardial mapping more visual and reliable.In the last part of this paper,we provide the effect pictures for the comparison between these two algorithms,which are respectively based on our isoline drawing and the traditional tracing way.Our algorithm mainly aims at the step of generating a contour by connecting all of the equivalent points.That is why we compared it with the traditional one on time complexity at this step.Both algorithms have the same O(row*col),the 'row' represents the number of the data mesh's rows and the 'column' represents the number of the data mesh's columns.Judging from the effect pictures,we find that both algorithms have equivalent contours which shows that our isoline drawing algorithm is an effective contour drawing algorithm.The algorithm introduced in this paper can be used widely in all quadrilateral data meshes whether the quadrilateral is rectangle or not.In the meantime,this procedure also serves as an all-purpose isoline drawing module and can be imbedded into other related numerical calculation system.