Visit Gigasoft's Web Site
 ProEssentials v10 Help

YDataPtr

Scope

Pego, Pesgo, Pepso, Pe3do

Type

Pointer buffer/IntPtr of type Single (4byte)

Default

NULL

.NET

PeData.Y.UseDataAtLocation

Ocx|Vcl

set with PEvset or PEvsetcellEx

DLL

PEP_faYDATAPTR

 

Purpose

This property is used to communicate to ProEssentials that the YData property should not allocate it's own memory, but instead use the local memory address that has already been allocated to the appropriate size. If JaggedData=False, the format of the data is defined by the SubsetByPoint property.

 

Examples 146 and 123 show an implementation of this feature.

 

The advantages of using this feature are reducing the memory needs for your project:
1) multiple charts may use the same memory, for example, a 3D Surface and 2D Contour.
2) your project's logic may work with the same copy of memory as the chart.  

 

Comments

.Net developers note that methods such as PeData.Y.UseDataAtLocation are documented in Chapter 2: .Net Property Arrays  

 

.Net Non-JaggedData: PeData.Y.UseDataAtLocation
.Net JaggedData: PeData.Y.UseJaggedDataAtLocation

 

DLL develppes must set this property with PEvset (Non-Jagged) or PEvsetcellEx (Jagged-Data).

 

If greater precision is needed, set UsingYDataII to TRUE and use YDataIIPtr instead of this property.

 

Related properties:  YDataIIPtr, XDataPtr, XDataIIPtr, ZDataPtr, ZDataIIPtr, PointColorsPtr

 

C#.NET Example

// Provide local pointers, data is not copied to chart

// For Non-Jagged Data

Pesgo1.PeData.Z.UseDataAtLocation(MainWindow.tmpSongXData, MainWindow.SongSize); // providing explicit size of subset 
 

//For JaggedData
Pesgo1.PeData.Z.UseJaggedDataAtLocation(MainWindow.wavedatax, 0); // defaults size of subset as size of array

 

C / C++ Example

MyXData146 = new float[2000000];
MyYData146 = new float[8000000];  

// Provide local pointers to App data, data is not copied to chart 

// XData is smaller as DuplicateDataX is set so 4 subsets share 1 subset of data.
PEvset(m_hPE, PEP_faXDATAPTR, MyXData146, 2000000);
PEvset(m_hPE, PEP_faYDATAPTR, MyYData146, 8000000);

For Jagged-Data use PEvsetcellEx 
PEvsetcellExW(m_hPE, PEP_faXDATAPTR, 0, 10000, &m_pGlobalXData[0]);

PEvsetcellExW(m_hPE, PEP_faYDATAPTR, 0, 10000, &m_pGlobalYData[i]);