is a Local Context opened ?


Using AIS_InteractiveContext, I'm opening a local context and save its number.

After that , I'm doing a lot of operations on the contexts ( new ones , delete somes , delete all ).

Is there a way to know if the saved local context is already opened or if it has been closed ?



Michael Gandyra's picture

Hi Stephane! How are you ?

There is No Way !! At least not until you have access to the member myLocalContexts from AIS_InteractiveContext. If you had access, then you could query

if(!myLocalContexts.IsBound(YOURIndex)) {

// YOURIndex is already closed }

With regards, Michael

Sergey RUIN's picture

Hi Michael and Stephane!

In reality the only use of an index of LocalContext is to close it later, but even if that LocalContext has already been closed closing it by its index do nothing. Work with Local contexts is mostly concealed from user,so to me it isn't worth troubles to find out if the specified context is opend or closed but if you have other opinion please tell me

Best regards!


Stephane Routelous's picture

Hi Sergey,

The problem is if you want to use the local context as "layers" or if you want to hide the fonctionnality for the end-user.

In fact, when you are programming an application with a complex GUI, the user of your product should not be able to see that there is the concept of "local context" which should be open or not to be a sub-shape selection or temporary mode.

If the end user want to be in vertex selection mode, you cannot ask him to open a special mode in which the sub-shapes can be selected. The application should manage that automatically.

If your GUI is complex, you will have *a lot of* opened local contexts. And you will need the possibility to close one or to check if one is always active or not.

So, you will need a mecanism to manage the opened local contexts.

( BTW , reading the source code , I had seen that all the local contexts are stored in a map. It is perhaps good for the programmer to have access to this map).


Sergey RUIN's picture

Hello Stephane!

I'm not sure about the exact name of package, now it's named "AppTool", and it's being under test now so that name can be changed to more appropriate one, the goal of classes in that package is to create high level API tools to manage selection/display mechanisms. Concerning selection process, there is a class AppTool_LocalSelector which does exactly what you have described in your letter.

As I've said before that package is under test, so it is not included in PR3, but the package is to be in the final relase of OC.



Jean-Claude Demosthenidy's picture

Does anyone know something about this "AppTool"? Has it been released and documented?