Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Java 3D / May 2004

Tip: Looking for answers? Try searching our database.

Compiling error: no capability to get geometry

Thread view: 
chris - 03 May 2004 20:10 GMT
Need help!really

I want to implement a picking behavior (PickTool, PickCanvas) )in Java3D,
which returns the coordinates of the clicked area in the objekt.
I can?t remove this exception: Shape3D: no capability to get geometry.
and: Shape3D: no capability to intersect.

My object is a branchgroup and no casting-tries  to a shape3D-object were
accepted!
And for a branchgroup,  I found no capability like GEOMETRY_NOT_SHARED or
ALLOW_INTERSECT or ALLOW_GEOMETRY_READ.........seems to be only for
Shape3D-objects.

Does anybody have some idea to get it work?
Where exactly do I have to set this capability and is there a chance to cast
Shape3d and Branchgroups?

greets,
Chris
Andre Bialojahn - 04 May 2004 20:58 GMT
> Need help!really
>
> [...]
> My object is a branchgroup [...]

Can't be.
Your (visual) object(s) might /be contained in a BG/, but it surely
ain't a BG itself.
BGs don't make for visual objects, so they'll inherently be
unpickable, since you can only pick what you're able to see.

> [...] and no casting-tries  to a shape3D-object were accepted!

That's obvious.
Have a look at the API-Dox for BG and S3D and the hierarchies:
BG: jl.Object -> SGO -> Node -> Group -> BG
S3D: jl.Object -> SGO -> Node -> Leaf -> S3D

How should a cast from a Group to a Leaf be done?

> And for a branchgroup,  I found no capability like
> GEOMETRY_NOT_SHARED or ALLOW_INTERSECT or
> ALLOW_GEOMETRY_READ.........seems to be only for
> Shape3D-objects.

Exactly. BGs aren't Shape3D()s or even Geometry()s and don't
contain any displayable geometry information.
They are just containers for other items, such as TransformGroups,
Shape3D, Geometry, Behaviors, Bounds and so on.

> Does anybody have some idea to get it work?

Have a look at the demos PickTest and PickText3D to see how picking
can be done.
Maybe, you'll even want to have a look for the J3D-Tutorial that
comes in the seven pdfs named
"j3d_Tutorial_ch0.pdf" .. "j3d_Tutorial_ch7.pdf" and have a more
or less short glimpse at it to familiarize a little with J3D.

> Where exactly do I have to set this capability [...]

At the appropriate geometry node(s) that contain(s) the geometries
you want to pick.
Hint: if you surround the offending statement with a try-catch-clause,
you might be able to get additional information about *where* the
error lies in your catch-code.
Use the .setUserData() to assign unique IDs to your geometry nodes
and have this being print out when you are trying to perform your
picking.

try {
do_perform_pick();
}
catch (CapabilityNotSetException CNSE) {
System.out.println("CNSE: "+CNSE.getLocalizedMessage());
[retrieve and dump additional information]
}

This'll keep your code from crashing and enable you to examine any
object you want to. But it won't fix your problem - it might just
assist you in tracking it down.
Maybe, you'll also want to use a debugger, single-stepping and some
breakpoints. At this point IDEs like eclipse come in very handy.

> [...] and is there a chance to cast Shape3d and Branchgroups?

No. Why should there be such?

Regards,
André


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.