Wednesday, April 29, 2009

Extrude work

Reviewed the Extrude, ExtrudeFunction, ExtrudeDependency, FacePickerPlane classes.

Improved the FacePickerPlane code so that it doesn't inform the user about the selected plane at every mouse move. It informs only when a new plane is selected. The highlighting disappears when the mouse goes out of the selected plane. Didn't solve the flickering caused by the change to Neutral Point to Local Context, studied and understood the problem will find a solution later.

Will continue with making an Extrude on the face of another Extrude.

5 comments:

entery said...

Hi,
Thanks for keeping up the good work!
Im using your wrapper in my application, and its work very well. Just missing out some export / import features. ;o)
Anyway I have one question:
I would like to name a shape, say that I have one box and one sphere. These I would like to call Box01 and "Sphere01". Im not interested in saving more data about the shape. Just the name. So when the user right click on the shape. The label shows in the popup menu.
What would be the best and easiest approach here?

Thanks for all help so far!

Regards!
-entery

bxtrx said...

Hi,

I think you need to make a Dictionary where to keep a reference between the shapes and their names.

If you need more complex info together with undo redo you can consider OCAF or the Tree classes that we implemented in Naro.

Mihai

entery said...

Thanks.. That was fast!

So what you mean is to use the auto generated id(Hashcode?) for the shape and map that with my custom ID together in a dictionary?

-entery

bxtrx said...

Sorry that my explanation wasn't detailed. No, I mean keep in a list or dictionary the InteractiveObject or the TopoDS_Shape mapped with the string representing its name.
I am not sure if you can check if two InteractiveObjects are the same but for sure the TopoDS_Shape has a method IsSame(). At each object selection, get the selected object Context.Current() (don't forget InitCurrent()) and search in the list if it is mapped to a string.

If you keep in the list TopoDS_Shape, casting from the InteractiveObject to TopoDS_Shape is made like this:
OCAIS_Shape shape;
selectedInteractive.DownCast(ref shape); OCTopoDS_Shape topoShape = shape.Shape();

entery said...

Thanks alot!
Will try it out.

Have a nice day!

-entery