//File: CadConnection.idl //CAD Services V1.2 #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) }; struct Path { boolean is_dir; // Indicates whether Path represents a file or a directory string unique_path; // Canonical, absolute, and unique path representing a // file or a directory }; typedef sequence RootsList; typedef sequence PathList; 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 // v 1.2 additions for directory information // Creates a new folder in a given directory. // param parent_dir: The (canonical, absolute, and unique) path of the // directory, in which the folder will be created. This must be either // one of the root directories (see get_root_directories()) or a // directory that exists in one of the root directory's subdirectories // param folder_name: The name of the folder to be created. It must be a // valid and a not already existing name. // raises CadUtility::CadError: If there was an error in creating the // folder. void create_new_folder(in string parent_dir, in string folder_name) raises (CadUtility::CadError); // Returns a list of (canonical, absolute, and unique) pathnames repre- // senting the root directories. In a root directory or in any other // subdirectory, model files can be found. // return: List of pathnames representing root directories. RootsList get_root_directories(); // Returns a list of subdirectories and model files of a given directory. // param directory: (canonical, absolute, and unique) path of the // directory from which to get the list of subdirectories and model // files. This must be either one of the root directories or a subdirectory. // return: A list representing subdirectories and/or model files // of the given directory. // raises CadUtility::CadError If there was an error retrieving the list. PathList get_models_and_folders(in string directory) raises (CadUtility::CadError); // Returns the parent directory of a given directory. // param directory: (canonical, absolute, and unique) path of the // directory from which to get its parent directory. The given directory // should be a subdirectory of one of the root directories. // return: The path of the parent directory. // raises CadUtility::CadError If there was an error retrieving the // parent directory. string get_parent_directory(in string directory) raises (CadUtility::CadError); }; // 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