Jump to content

Loading Geometry File


Recommended Posts

Hi....

I am writing an external application that reads a geo/bgeo file.

But I am getting problem in loading a geometry file.

My code is like :

GU_Detail* sopGdp = new GU_Detail;

const UT_Options *options = new UT_Options;

sopGdp->load((const char*)fullFileName ,options);

In H9 the geometry loading procedure is somewhat changed.

Now the syntax is

load(const char *, const UT_Options *options);

It now takes UT_Options* . Somebody told me that insted of UT_Options

NULL also works. I tried that also. But no help.

My Code compiles properly. But when I run it, "load" method returns -1.

That is operation unsuccessful. My "fullFileName" is correct, and it is

the full path to my geo/bgeo file on disk.

If UT_Options has to be set properly , what is the procedure for that?

Plz Help....

Link to comment
Share on other sites

load(const char *, const UT_Options *options);

It now takes UT_Options* . Somebody told me that insted of UT_Options

NULL also works. I tried that also. But no help.

This works for me:

#include <stdio.h>
#include <GU/GU_Detail.h>

int
main(int argc, char *argv[])
{
	GU_Detail	gdp;

	if (gdp.load(argv[1], 0) >= 0)
	{
	fprintf(stderr, "Ok: %d points\n", gdp.points().entries());
	}
	else
	fprintf(stderr, "Fail\n");
	return 0;
}

Try:

% testapp defgeo.bgeo
Ok: 80 points

Cheers.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...