Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Windows
 Charting and Real-Time Graphics Tools for Windows
 contouring random xyz data
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Alb

4 Posts

Posted - 04 Mar 2008 :  16:57:13  Show Profile  Reply with Quote
Hi,

I'm using the GCL version 3.0, and I'm trying to create a contour plot of randomly oriented xyz data. I'm using QCGraphWnd::WGContourPlot(...). The data input for this method is a QCStaticData object, and from what I can see, there is no way to create a QCStaticData object with randomly oriented xyz data. So how do I do this?

Thank you,
Al

quinncurtis

1164 Posts

Posted - 05 Mar 2008 :  11:05:37  Show Profile  Reply with Quote
You can use randomly oriented xyz data. To do that you use a QCStatic constructor that creates a group dataset. The x-values of the group data set are the x-values of the data points. The y-values of the group dataset are organized as two groups, the first group are the y-values of the data points, the second group are the z-values of the datapoints. Here is a slight re-working of the data generating routine of the ContourD example program.

CContourDDoc::CContourDDoc()
{
    int      i,j, k = 0;
    static  BOOL fInit = TRUE;

    // create simulation data for plots
/*--------------------------------------------------------------*/
    if (fInit) // do not initialize data twice
    {
      WGStart();    // Initialize the DLL if WGCreatePage is no the first call  

      realtype x=0, y=0, z=0;
      int nNump1 = 30 * 30; // 900 points
      int nNumGroups = 2;
      int kk = 0;

//  lpX1 and lpY1 are defined in ContourDDoc.h as
// LPREAL  lpX1;
// LPREAL  lpY1;
// don't forget to delete lpX1 and lpY1 when you are done with them in the class's destructor
      lpX1 = new realtype [nNump1];
      lpY1  = new realtype [nNumGroups * nNump1];

      for (i=0; i < 30; i++)
      {
	 for (j=0; j < 30; j++)
	 {
	    x = (realtype) j / 2.0 -7.5;
	    y = (realtype)i / 2.0 - 7.5;
	    z = functionproc1(x, y);
	    lpX1[kk] = x;
	    lpY1[kk * 2] = y;
	    lpY1[kk * 2 + 1] = z;
	    kk++;
	  }
       }
       pContourData = new QCStaticData ("Contour Data",lpX1,lpY1, nNump1, nNumGroups);
       fInit = FALSE;
    }
	 
}

CContourDDoc::~CContourDDoc()
{
  delete pContourData;
  delete lpX1;
  delete lpY1;
}

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07