Page 1 of 1

SurfaceNearestTool

Posted: Thu Jul 03, 2008 3:37 am
by 15049432
Is there some trick to get this tool to work? I can't get it to show up on my SurfaceSeries.

I notice some other (old) threads reporting problems. Has this tool been fixed since then?

Posted: Thu Jul 03, 2008 8:35 am
by yeray
Hi LVL,

Could you explain us what is your exact problem so we can reproduce it here? Or, you could also send us a simple example project we can run "as-is" to reproduce the problem here too.
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Have you seen the "Surface Nearest" demo at All features/Tools?

Posted: Thu Jul 03, 2008 8:55 pm
by 15049432
Hi Yeray,

Firstly, apologies...since I seem to have started this thread in the wrong forum! I'm actually using the v8 ActiveX control in and MFC application.

I'm populating a 3d surface series with an irregular grid and adding the tool in code. The surface shows up OK, and if I start the editor I can see that the tool has been added and linked to the series. However, it seems no matter what options I choose for the tool it doesn't show up on the surface.

Posted: Fri Jul 04, 2008 8:53 am
by yeray
Hi LVL,

I've tested the tool as you suggest and it seems to work fine for me here. Could you tell me if I'm missing any important step to reproduce it?

Code: Select all

Private Sub Command1_Click()
  TeeEditor1.ShowEditor
End Sub

Private Sub Form_Load()
Dim x, z As Integer
  TeeCommander1.Chart = TChart1
  TeeEditor1.Chart = TChart1
  
  TChart1.AddSeries scSurface
  TChart1.Series(0).asSurface.IrregularGrid = True
  
  For x = 1 To 10
    For z = 1 To 10
      TChart1.Series(0).asSurface.AddXYZ x, Rnd * 10, z, "", clTeeColor
    Next z
  Next x
  TChart1.Tools.Add tcSurfaceNearest
  TChart1.Tools.Items(0).asSurfaceNearest.Series = TChart1.Series(0)
End Sub

Posted: Tue Jul 08, 2008 4:41 am
by 15049432
Hi Yeray,

Your VB example also works fine for me, but I cannot get the tool to work in VC6...

It just doesn't show up in the colours I choose. Very occasionally if I set all the colours to 'None' the active column 'disappears' as I move the mouse, but it isn't reliable and seems to depend on the orientation of the chart.

Posted: Tue Jul 08, 2008 8:27 am
by narcis
Hi LVL,

Code snippet below works fine for me here. Could you please check if it works fine at your end and, if necessary, modify it so that we can reproduce the problem here?

Code: Select all

	m_Chart1.AddSeries(scSurface);
	m_Chart1.Series(0).FillSampleValues(50);

	m_Chart1.GetTools().Add(tcSurfaceNearest);

	VARIANT TheSeries;
	TheSeries.vt=VT_I2;
	TheSeries.intVal=0; 

	m_Chart1.GetTools().GetItems(0).GetAsSurfaceNearest().SetSeries(TheSeries);
	m_Chart1.GetTools().GetItems(0).GetAsSurfaceNearest().SetColumnColor(RGB(255,0,0));
	m_Chart1.GetTools().GetItems(0).GetAsSurfaceNearest().SetRowColor(RGB(0,0,255));
	m_Chart1.GetTools().GetItems(0).GetAsSurfaceNearest().SetCellColor(RGB(0,255,0));
Thanks in advance.

Posted: Wed Jul 09, 2008 2:23 am
by 15049432
Hi Narcis,

That code works well, and I also discovered the problem. The SurfaceNearest tool disappears if you turn on SmoothPalette...you can even see this effect in the demo program.

Anyway, I found that the NearestPoint tool better suits my needs, so I'm using that.

Thanks for the help.

Posted: Wed Jul 09, 2008 8:28 am
by narcis
Hi LVL,

Thanks for reporting. I could reproduce the issue here and added it (TV52013200) to our defect list to be fixed for next releases.