Help Selecting/Editing simple objects

Hello All,

I've been working off and on with my first Open Cascade project and have hit a snag I can't seem to figure out. Simply put, I want to be able to create simple objects(vertices, lines, etc), then be able to select and edit(or delete) them. I've gone through the manual and samples, and tried everything I thought would work, but still can't get it working. Anyone with a simple example they can forward me or with some advice. My application is in Java, with JNI calls to the C++ function, but someone working completely in C++ should be able to help as well. Here's what I've done and what it seems should work:

I've created my view and am able to render a point - I created it as an AIS_Point.

I can select the object, and have written the mouse event to handle a double-click to select and call a custom function. This is where I'd like to simply get the coordinates of the point, edit them, then redraw the point, but I can't get it to work properly.

Should I be using TopoDS shapes instead or do I simply convert from the AIS object to a Topo shape?

Do I need to render a local context, or can I do it from the neutral point?

I could go on with a bunch of scenarios I've tried, but figure it's best to see what kind of response I get from the rest of you.

Thanks in advance for any help you can give me.


Francois Lauzon's picture

Hello Jon, There is a bunch of samples applications you can download from the website, you can see how to dynamicly select ais objects and get their attributes. In the example you can change color, transparency and redraw the object, but you can easily get the coordinates of your selected AIS_Point and modify it.

The visualization reference manual should also help you to understand how it's all design.

Good Luck. Francois.

farges's picture

i have the same problem.
I create 4 AIS_Point and i'd like to get there coordinate when i select one of them.
Could you help me please?

thanks in advance