The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 3D-Layers
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

rlewis

Canada
253 Posts

Posted - 08/18/2004 :  4:44:06 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Is there an OriginC method for determining whether an Origin Graph is Three dimensional other than something like


GraphPage gPG=Project.Pages(-1);
GraphLayer Lay=gPG.Layers(-1);
bool Flag;
if(gPG.IsValid())
{
Flag=LabTalk.Layer.Is3D;
}


//

I found the constant EXIST_PLOT_3D in the OC_const.h file but I do not know which functions(s) use it ....

Mike Buess

USA
3037 Posts

Posted - 08/19/2004 :  10:40:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
EXIST_PLOT_3D is used by PageBase::GetType

PageBase pb;
pb = Project.Pages();
if( pb.GetType() == EXIST_PLOT_3D )
printf("%s is a 3D plot.\n",pb.GetName());

Is it possible to have a multi-layer graph page with a mixture of 2D and 3D plots? That might be a problem here.

Mike Buess
Origin WebRing Member
Go to Top of Page

rlewis

Canada
253 Posts

Posted - 08/19/2004 :  11:20:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Using Mike Buess's test code, I find that the pb.GetType() call returns EXIST_PLOT with all types of GraphPages. The value returned by pb.GetType() did not depend upon the type of GraphLayer (i.e. whether 2D or 3D) or combination of GraphLayers present on the GraphPage.
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 08/19/2004 :  11:34:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Until we provide a solution to this in Origin 8, use the following for now,

 
void test()
{
GraphLayer gl = Project.ActiveLayer();
if(gl)
{
Tree tr;
bool bIsXYZ = true;
try {
tr = gl.ZAxis.Scale;
}
catch(int nErr)
{
bIsXYZ = false;
}
if(bIsXYZ)
out_str("Is XYZ layer");
else
out_str("No Z axis found");
}
}




CP


Edited by - cpyang on 08/19/2004 11:40:48 AM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000