05-26-2010 09:06 AM
hi,
I'm using the library CW 3D graph.
I would to plot several 3D curves on the same graph : is it possible?
To draw my curves, I use : CW3DGraphLib__DCWGraph3DPlot3DMesh(graphHandle,NULL,xVt2,yVt2,zVt2,CA_DEFAULT_VAL)
thanks..
Adeline
Solved! Go to Solution.
05-26-2010 09:37 AM
05-27-2010 09:17 AM
thanks, I read it...
but I don't find how to do it...
bye
Adeline
05-27-2010 03:15 PM
You should be able to do it just like any other graph by "Plotting" additional curves. And you would keep track of it with a plot handle returned.
i believe the functions are:
CA_VariantSet1DArray (&var_theta, CAVT_DOUBLE, cell_cnt, &theta_array);
CA_VariantSet1DArray (&var_phi, CAVT_DOUBLE, cell_cnt, &phi_array);
CA_VariantSet1DArray (&var_mag, CAVT_DOUBLE, cell_cnt, &mag_array);
CW3DGraphLib__DCWGraph3DPlot3DCurve(graph_handle,NULL,var_phi,var_theta,var_mag,CA_DEFAULT_VAL)
of course you can use x,y,x coordinate system as well.
05-28-2010 02:44 AM
ok
for the moment, I do like that....
-----------------------------------------------------------------------------------------
fenetre_3D = LoadPanel (fenetrePrinc, "interfac.uir",REP_G_3D);
GetObjHandleFromActiveXCtrl (fenetre_3D,REP_G_3D_GRAPH3D_PIECE , &graphHandle);
CW3DGraphLib__DCWGraph3DGetPlots (graphHandle, NULL, &plotsHandle);
CW3DGraphLib_CWPlots3DItem (plotsHandle, NULL, CA_VariantInt(1),&plotHandle);
DisplayPanel(fenetre_3D);
CA_VariantSet1DArray(&xVt, CAVT_DOUBLE,nombre,&Px) ;
CA_VariantSet1DArray(&yVt, CAVT_DOUBLE,nombre,&Py) ;
CA_VariantSet1DArray(&zVt, CAVT_DOUBLE,nombre,&Pz) ;
CW3DGraphLib__DCWGraph3DPlot3DMesh(plotHandle,NULL,xVt,yVt,zVt,CA_DEFAULT_VAL);
------------------------------------------------------------------------------------------------------
but the curve doesn't appear...but I don't know why...
ciao ciao
Adeline
05-28-2010 02:58 AM
Hi,
- In the samples provided with CVI you will notice some error checking. Your code does not check for any errors...
- In the samples provided with CVI the curves do appear, I have tried the samples yesterday before answering your question. Why don't you have a look at these samples?
05-28-2010 03:16 AM
yes, I have looked at this sample... that's why I don't understand...
I do as they did....on the same example...
05-28-2010 04:20 AM
ok it's great I found what it didn't work!!
I had to add at some places :
CW3DGraphLib_CWPlots3DItem (plotsHandle, NULL, CA_VariantShort(1),&plotHandle);
CW3DGraphLib_CWPlot3DSetMultiPlot (plotHandle, NULL, VTRUE);
CW3DGraphLib_CWPlots3DItem (plotsHandle, NULL, CA_VariantShort(2),&plotHandle);
CW3DGraphLib_CWPlot3DSetMultiPlot (plotHandle, NULL, VFALSE);
ciao ciao
Adeline
07-13-2010 12:25 PM
I have the same problem, I used the following, but only the last drawing show up aftetr I finished. Do I need to add anything alse? Hope you can help me out.
CW3DGraphLib_CWPlots3DItem (plotsHandle, NULL, CA_VariantInt(1), &plotHandle);
CW3DGraphLib_CWPlot3DPlot3DSurface (plotHandle, NULL, xArray, yArray, dArray, CA_DEFAULT_VAL);
CW3DGraphLib_CWPlot3DSetMultiPlot (plotHandle, NULL, VTRUE);
for (i=0; i<k; i++)
{
j=i+2;
CA_VariantSet2DArray (&dArray, CAVT_DOUBLE, m, n, &cz[i]);
CA_VariantSet1DArray (&xArray, CAVT_DOUBLE, m, &cx[i]);
CA_VariantSet1DArray (&yArray, CAVT_DOUBLE, n, &cy[i]);
CW3DGraphLib_CWPlots3DItem (plotsHandle, NULL, CA_VariantInt(j),&plotHandle);
CW3DGraphLib_CWPlot3DPlot3DSurface (plotHandle, NULL, xArray, yArray, dArray, CA_DEFAULT_VAL);
CW3DGraphLib_CWPlot3DSetMultiPlot (plotHandle, NULL, VTRUE);
}
CW3DGraphLib_CWPlot3DSetMultiPlot (plotHandle, NULL, VFALSE);
07-16-2010 02:42 AM
hi!!
In fact, you draw graphs one by one...
I think you have to put that :
CW3DGraphLib_CWPlot3DSetMultiPlot (plotHandle, NULL, VFALSE);
for each graph you don't draw
and for the graph you want to draw :
CW3DGraphLib_CWPlot3DSetMultiPlot (plotHandle, NULL, VTRUE);
for example:
if you have 3 plots :
CW3DGraphLib_CWPlots3DItem (plotsHandle, NULL, CA_VariantInt(1), &plotHandle);
CW3DGraphLib_CWPlot3DSetMultiPlot (plotHandle, NULL, VFALSE);
CW3DGraphLib_CWPlots3DItem (plotsHandle, NULL, CA_VariantInt(2), &plotHandle);
CW3DGraphLib_CWPlot3DSetMultiPlot (plotHandle, NULL, VFALSE);
CW3DGraphLib_CWPlots3DItem (plotsHandle, NULL, CA_VariantInt(3), &plotHandle);
CW3DGraphLib_CWPlot3DSetMultiPlot (plotHandle, NULL, VTRUE);
CW3DGraphLib_CWPlot3DPlot3DSurface (plotHandle, NULL, xArray, yArray, dArray, CA_DEFAULT_VAL);
let me know if it works or not!!
bye
Adeline