Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 296

Summary: [TV52015793] Contour Series FilledLevels problems. When you add values of Contour...
Product: VCL TeeChart Reporter: sandra pazos <sandra>
Component: SeriesAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: major CC: david
Priority: Normal    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:
Attachments: Fixed Contour filling (irregular grid)

Description sandra pazos 2013-11-20 10:37:01 EST
Contour Series FilledLevels problems.
When you add values of Contour Series using a increment diferent than 1, and you active FilledLevels= true, the contour isn't  filled and its pen black 
Problem appears in .Net Version too, concretly in bug number(TF02015794) and it works in verion 8 of VCL.
I have made a simple code to reproduce the problem: 
unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, TeEngine, TeeSurfa, StdCtrls, ExtCtrls, TeeProcs, Chart;
type
  TForm1 = class(TForm)
    Chart1: TChart;
    Button1: TButton;
    Series1: TContourSeries;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var X,Z:Integer;
begin
  Chart1.View3D:=False;
  Series1.Brush.Style:=bsSolid;
  Series1.IrregularGrid:=true;
  Series1.Clear;
      For X:=1 To 10  do
      begin
          For Z:=1 To 5 do
          begin
                 Series1.AddXYZ(X, Random(100), Z*100);
          end;
      end;
end;
end.

 [created:2011-10-20T16:11:08.000+01:00 reported by:sandra@steema.com reported in version:]
Comment 1 david berneda 2013-12-04 10:10:38 EST
This problem is almost fixed with the latest sources.

There is a difference in the algorithm that calculates the contour level lines, and the one that calculates the polygons to fill each cell.

Latest source code solves this problem partially.
There is pending to make both algorithms exactly the same.

The difference is at TeeSurfa.pas unit, TLevelDifs.PointSect method.
The new "Interpolate" variable controls which calculation method to use.

When filling contour cells, Interpolate is currently False.
Comment 2 david berneda 2013-12-12 06:55:34 EST
This problem should be fixed in latest sources.
Please find attached picture showing the output of this test code.

The Contour filling algorithm has been rewritten and now it matches the same calculation code used to generate the contour level lines.

This same code is reused by TIsoSurfaceSeries to fill cells in 2D and 3D.

Also, a new Contour property has been added for easier usage:

ContourSeries1.Filled := True;

which is equivalent to:

ContourSeries1.Brush.Style := bsSolid;

(both ways do the same and are compatible)
Comment 3 david berneda 2013-12-12 06:56:27 EST
Created attachment 55 [details]
Fixed Contour filling (irregular grid)