Structure of CAD application

Dear forum,

I have a question that is not directly related to OpenCascade, but I hope to find people here who know CAD and do understand my question...

I want to know how to structure the user interactions in a CAD application. So far I always created programs that used dialogs to get information from the user. Normally these dialogs are blocking the main window until the user finished the dialog.

All CAD application I know are different. After the user started a function the application waits for the required information: input of text or selection of geometry. In the meantime all of the application remains active, you can work with the geometry area, select a different command, open a menu function and so on. How do I realize this behavior without using dialogs?

I want to use QT but I dont think this is important. I just want to know whether there are special techniques to wait for user interaction without blocking the whole application (and without using dialogs).

Hope someone can help...

nandy's picture


Sharjith Naramparambath's picture

Having a dialog active on the application main window and still being able to interact (send events) to the main window could be possible through modless dialogs. Modless (Non-Modal) dialogs do not force the user to close (accept/reject) the dialog before being able to interact with the main window. The other things like having the application wait for the user to make inputs via the application screen like selecting a curve and a direction or axis for creating an extruded or a revolved surface can be achieved by using Finite State Machines in a Command pattern. This will essentially have a command that goes into an state->transition->state loop with events associated to each state and actions triggered on transitions from one state to other. A command can be a complex one with child and parent commands associated with it (nested commands) which allows user to transition from a main command to a sub command and back in order to create inputs required by the main command on the fly. Your choice of Qt makes good sense as it supports many features required to handle such complex patterns out of the box. Qt has a robust command structure with state machine support which is very suitable for applications requiring complex interactions. Qt also has a very strong object interaction mechanism which can be leveraged to accomplish complex interaction tasks. Hope this information helps you!