//File: CadConnection.idl //CAD Services V1.1 #ifndef __CADCONNECTION_DEFINED #define __CADCONNECTION_DEFINED #include "CadMain.idl" #include "CadUtility.idl" #include "CadFoundation.idl" #include "CosPropertyService.idl" #pragma prefix "omg.org" module CadConnection { //forward references interface CadServer; interface CadSystem; interface CadUserInterface; enum ActivationMode { ACTIVE_READONLY, ACTIVE_CHECKOUT, ACTIVE_DETAILED }; // various exceptions exception CadConnectionFault { unsigned long error_code; string error_text; }; exception ValidationError { unsigned long error_code; string error_text; }; exception InvalidProperties { unsigned long error_code; string error_text; }; exception PermissionDenied { unsigned long error_code; string error_text; }; exception InvalidModel { unsigned long error_code; string error_text; }; exception BadCommand { unsigned long error_code; string error_text; }; exception ModelNotLoaded { unsigned long error_code; string error_text; }; exception BadParameters { CosPropertyService::Properties flawed_params; CadUtility::StringSeq reasons; }; struct OptionsStruct { boolean is_interactive; boolean is_persistent_id; boolean is_accurate; // for some calculated properties boolean is_parametric; // design feature support boolean is_extended_geometry; }; struct NativeCadAttributesStruct { string cad_sys_name; string vendor_name; string cad_version; OptionsStruct optional_properties; CosPropertyService::Properties other_properties; }; typedef sequence ModelList; interface CadServer { readonly attribute NativeCadAttributesStruct native_properties; // NativeCADSys contains CAD Vendor name, version, etc. readonly attribute CosPropertyService::Properties launch_properties; // This attribute contains all needed information to launch // the CAD system CadSystem connect( in CosPropertyService::Properties props) raises ( CadConnectionFault ); // secure connection CadSystem connect_with_password( in string user, in string password, in CosPropertyService::Properties props ) raises ( CadConnectionFault ); // open wire (unsecure connection) }; interface CadSystem { CadMain::Model open_model(in string model, in ActivationMode access) raises (InvalidModel, PermissionDenied, CadUtility::CadError); // CAD model related operations CadMain::Model create_model(in string new_name, in CadUtility::MassUnit m_unit,in CadUtility::LengthUnit l_unit, in CosPropertyService::Properties model_params) raises (PermissionDenied, BadParameters, CadUtility::CadError); // Creates and opens a new model in native CAD system CosPropertyService::Properties get_properties(); void set_properties( in CosPropertyService::Properties props ); // Allows reading and changing of CadSystem properties ModelList available_models(); // returns a list if model available to the active CAD System. CadMain::ModelSeq opened_models(); // returns a list of active models void execute_cad_command(in string command_string , inout any comm_out ) raises (BadCommand); // extensible Cad system command interface CadUserInterface get_gui() raises (CadFoundation::GuiUnsupported); // access to GUI interface void disconnect() raises ( CadConnectionFault ); // close system and clean-up }; // OPTIONAL interface supporting an interactive User Interface on native CAD system struct UiMessageStruct { unsigned long code; //recommended string note; }; interface CadUserInterface { CadFoundation::EntitySeq get_selected_entities() raises (CadUtility::CadError); // returns a sequence of entities selected in UI CadUtility::WarningStructSeq highlight_entities(in CadFoundation::EntitySeq marked); // highlight these entities in the UI. returns warning if all entities cannot be highlighted void set_entity_label_visibility (in CadFoundation::EntitySeq entities,in boolean visibility) raises (CadUtility::CadError); // Sets the visibility of entity labels. CadFoundation::EntitySeq select_entities (in UiMessageStruct prompt, out UiMessageStruct error_message) raises (CadUtility::CadError); //prompt explains the selection request UiMessageStruct prompt_for_string (in UiMessageStruct prompt) raises (CadUtility::CadError); // Prompts the user to input a value (in UI) which is returned as an // unsigned long (recommended) string. void createWindow ( in CadMain::Model model_gui) raises (CadUtility::CadError); // create window for model and place in foreground void deleteWindow ( in CadMain::Model model_gui) raises (CadUtility::CadError); // delete window associated with the model void hideWindow ( in CadMain::Model model_gui) raises (CadUtility::CadError); // places window in background void foregroundWindow ( in CadMain::Model model_gui) raises (CadUtility::CadError); // place window in foreground }; }; #endif