LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

several 3D plots on the same graph

Solved!
Go to solution

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

 

0 Kudos
Message 1 of 13
(5,423 Views)

Hi,

 

according to this document mutliple plots are possible.

0 Kudos
Message 2 of 13
(5,417 Views)

thanks, I read it...

but I don't find how to do it...

 

 bye

 

Adeline

 

0 Kudos
Message 3 of 13
(5,386 Views)

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. 

0 Kudos
Message 4 of 13
(5,377 Views)

 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

0 Kudos
Message 5 of 13
(5,359 Views)

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?

0 Kudos
Message 6 of 13
(5,350 Views)

yes, I have looked at this sample... that's why I don't understand...

I do as they did....on the same example...

0 Kudos
Message 7 of 13
(5,345 Views)
Solution
Accepted by topic author adeline62

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

0 Kudos
Message 8 of 13
(5,338 Views)

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);

0 Kudos
Message 9 of 13
(5,156 Views)

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

 

0 Kudos
Message 10 of 13
(5,067 Views)