Main Page | Namespace List | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

CubitInterface.hpp

Go to the documentation of this file.
00001 // File: CubitInterface.hpp
00002 //
00003 // Description: wrappers that allow for cubit access. This code is 
00004 //              automatically wrapped by swig to create the python 
00005 //              command string.  This treats all of cubit as one 
00006 //              component. 
00007 //
00008 // Author: KGM, RGM, MR
00009 //
00010 // Date: 03/10/2003
00011 //
00012 
00013 #ifndef _CUBIT_WRAPPER_HPP_
00014 #define _CUBIT_WRAPPER_HPP_
00015 
00016 #ifdef WIN32
00017  #pragma warning ( 4 : 4786)
00018  #pragma warning ( 4 : 4099)
00019 #endif
00020 
00021 
00022 #ifdef SWIG
00023   #define CUBIEXPORT 
00024 #else
00025   #include "cubitidll.hpp"
00026 #endif
00027 
00028 #ifdef CAT
00029 #undef CUBIEXPORT 
00030 #define CUBIEXPORT 
00031 #endif
00032 
00033 #include <vector>
00034 #include <string>
00035 
00036 #if defined(CANT_USE_STD) || defined(NO_STDLIB)
00037 namespace std
00038 {
00039   using ::string;
00040   using ::vector;
00041 }
00042 #endif
00043 
00044 class RefEntity;
00045 class ProgressTool;
00046 class CUBIEXPORT CubitMessageHandler;
00047 class ExternalExitHandler;
00048 class ExternalPlaybackHandler;
00049 
00050 // Cubit access via c functions in a namespace
00051 
00052 // An interface to provide all query-only information needed by the
00053 // Claro GUI to properly display all Cubit-related information in the interface
00054 
00055 // In addition, this interface is intended to be constructed so that a
00056 // python interface can be automatically generated.  The python binding
00057 // will allow the use of all query commands in the python interpreter of Claro
00058 
00059 enum CUBIEXPORT GeomType {VERTEX,CURVE,SURFACE,VOLUME};
00060 
00078 namespace CubitInterface
00079 {
00080 
00082 
00083 const int CI_ERROR = -1;
00084 
00085 #ifdef SWIG
00086   CUBIEXPORT void init(std::vector<std::string> argv);
00087   CUBIEXPORT void destroy();
00088 #else
00089   // initialize the Cubit Component
00090   CUBIEXPORT void init(const std::vector<std::string>& argv);
00091   CUBIEXPORT void destroy();
00092   CUBIEXPORT void process_input_files();
00093   CUBIEXPORT bool prepare_next_script_line();
00094   CUBIEXPORT void copy_next_script_line(std::string &buffer);
00095   CUBIEXPORT void process_next_script_line();
00096   CUBIEXPORT void set_exit_handler(ExternalExitHandler *hdlr);
00097   CUBIEXPORT void set_playback_handler(ExternalPlaybackHandler *hdlr);
00098 
00099   // redirect the output from cubit.
00100   CUBIEXPORT void set_cubit_message_handler(CubitMessageHandler *hdlr);
00101   CUBIEXPORT void set_progress_tool(ProgressTool *progress);
00102 #endif
00103 
00104 
00106 
00107 
00108 
00109 
00110 
00111   CUBIEXPORT void set_cubit_interrupt(bool interrupt);
00112 
00118   CUBIEXPORT std::string get_version();
00119 
00125   CUBIEXPORT std::string get_revision_date();
00126 
00132   CUBIEXPORT std::string get_build_number();
00133 
00139   CUBIEXPORT std::string get_acis_version();
00140 
00146   CUBIEXPORT std::string get_exodus_version();
00147 
00153   CUBIEXPORT std::string get_graphics_version();
00154 
00157   CUBIEXPORT void print_cmd_options();
00158 
00164   CUBIEXPORT bool is_modified();
00165 
00170   CUBIEXPORT void set_modified(bool modified);
00171 
00177   CUBIEXPORT bool is_undo_save_needed();
00178 
00181   CUBIEXPORT void set_undo_saved();
00182 
00188   CUBIEXPORT bool is_command_echoed();
00189 
00195   CUBIEXPORT bool is_command_journaled();
00196 
00212   CUBIEXPORT void cmd(const char *input_string);
00213 
00230   CUBIEXPORT void silent_cmd(const char *input_string);
00231 
00248   CUBIEXPORT std::vector<int> parse_cubit_list(const std::string& type, 
00249                                                std::string int_list,
00250                                                bool include_sheet_bodies = false);
00260   CUBIEXPORT void print_raw_help(char *input_line, int order_dependent,
00261       int consecutive_dependent);
00262 
00267   CUBIEXPORT int get_error_count();
00268 
00270 
00271 
00273 
00274 
00280   CUBIEXPORT double get_view_distance();
00281 
00287   CUBIEXPORT std::vector<double> get_view_at();
00288 
00294   CUBIEXPORT std::vector<double> get_view_from();
00295 
00312   CUBIEXPORT void unselect_entity(const std::string& entity_type, int entity_id);
00313 
00319   CUBIEXPORT bool is_perspective_on();
00320 
00326   CUBIEXPORT bool is_scale_visibility_on();
00327 
00333   CUBIEXPORT int get_rendering_mode();
00334 
00340   CUBIEXPORT int get_pick_type();
00342 
00344 
00345 
00361   CUBIEXPORT double get_meshed_volume_or_area(const std::string& geom_type, int entity_id);
00362 
00378   CUBIEXPORT int get_mesh_intervals(const std::string& geom_type, int entity_id);
00379 
00395   CUBIEXPORT double get_mesh_size(const std::string& geom_type, int entity_id);
00396 
00397 #ifndef SWIG
00431   CUBIEXPORT void get_quality_stats(const std::string& entity_type,
00432                                     std::vector<int> id_list,
00433                                     const std::string& metric_name,
00434                                     double threshold,
00435                                     bool use_low_threshold,
00436                                     double& min_value,
00437                                     double& max_value,
00438                                     double& mean_value,
00439                                     double& std_value,
00440                                     std::vector<int>& mesh_list,
00441                                     std::string element_type,
00442                                     int& bad_group_id,
00443                                     bool make_group = false);
00444 #endif
00445 
00462   CUBIEXPORT std::string get_mesh_scheme(const std::string& geom_type, int entity_id);
00463 
00477   CUBIEXPORT bool is_meshed(const std::string& geom_type, int entity_id);
00478 
00492   CUBIEXPORT bool is_merged(const std::string& geom_type, int entity_id);
00493 
00510   CUBIEXPORT std::string get_smooth_scheme(const std::string& geom_type, int entity_id);
00511 
00517   CUBIEXPORT int get_hex_count();
00518 
00524   CUBIEXPORT int get_pyramid_count();
00525 
00531   CUBIEXPORT int get_tet_count();
00532 
00538   CUBIEXPORT int get_quad_count();
00539 
00545   CUBIEXPORT int get_tri_count();
00546 
00552   CUBIEXPORT int get_edge_count();
00553 
00559   CUBIEXPORT int get_node_count();
00560 
00566   CUBIEXPORT int get_volume_element_count(int volume_id);
00567 
00573   CUBIEXPORT int get_surface_element_count(int surface_id);
00574 
00582   CUBIEXPORT std::vector<int> get_hex_sheet(int node_id_1, int node_id_2);
00584 
00585 
00587 
00588 
00602   CUBIEXPORT bool is_visible(const std::string& geom_type, int entity_id);
00603 
00617   CUBIEXPORT bool is_virtual(const std::string& geom_type, int entity_id);
00618 
00626   CUBIEXPORT std::vector<int> get_source_surfaces(int volume_id);
00627 
00635   CUBIEXPORT std::vector<int> get_target_surfaces(int volume_id);
00636 
00646   CUBIEXPORT int get_common_curve_id(int surface_1_id, int surface_2_id);
00647 
00657   CUBIEXPORT int get_common_vertex_id(int curve_1_id, int curve_2_id);
00658 
00674   CUBIEXPORT std::string get_merge_setting(const std::string& geom_type, int entity_id);
00675 
00683   CUBIEXPORT std::string get_curve_type(int curve_id);
00684 
00692   CUBIEXPORT std::string get_surface_type(int surface_id);
00693 
00705   CUBIEXPORT void get_surface_normal(int surface_id, double &x, double &y, double &z);
00706 
00718   CUBIEXPORT void get_surface_centroid(int surface_id, double &x, double &y, double &z);
00719 
00736   CUBIEXPORT std::vector<std::string> get_entity_modeler_engine(const std::string& geom_type, int entity_id);
00737 
00755   CUBIEXPORT std::vector<double> get_bounding_box(const std::string& geom_type, int entity_id);
00756 
00774   CUBIEXPORT std::vector<double> get_total_bounding_box(const std::string& geom_type, 
00775                                                     std::vector<int> entity_list);
00776 
00784   CUBIEXPORT double get_total_volume(std::vector<int> volume_list);
00785 
00806   CUBIEXPORT std::string get_entity_name(const std::string& geom_type, int entity_id);
00807 
00823   CUBIEXPORT int get_entity_color_index(const std::string& entity_type, int entity_id);
00824 
00832   CUBIEXPORT bool is_multi_volume(int body_id);
00833 
00841   CUBIEXPORT bool is_interval_count_odd(int surface_id);
00842 
00858   CUBIEXPORT bool is_periodic(const std::string& geom_type, int entity_id);
00859 
00860 #ifndef SWIG
00878   CUBIEXPORT void get_periodic_data(const std::string& geom_type, int entity_id, 
00879     double &interval, std::string& firmness, int& lower_bound, std::string& upper_bound);
00880 #endif
00881 
00887   CUBIEXPORT bool get_node_constraint();
00888 
00912   CUBIEXPORT std::vector<int> get_relatives(const std::string& source_geom_type, int source_id,
00913                                  const std::string& target_geom_type);
00914 
00934   CUBIEXPORT std::vector<int> get_adjacent_surfaces(const std::string& geom_type, int entity_id);
00935 
00955   CUBIEXPORT std::vector<int> get_adjacent_volumes(const std::string& geom_type, int entity_id);
00956 
00977   CUBIEXPORT std::vector<int> get_entities(const std::string& geom_type,
00978                                            bool include_sheet_bodies = false);
00979 
00994   CUBIEXPORT std::vector<int> get_list_of_free_ref_entities(const std::string& geom_type);
00995 
01011   CUBIEXPORT int get_owning_body(const std::string& geom_type, int entity_id);
01012 
01028   CUBIEXPORT int get_owning_volume(const std::string& geom_type, int entity_id);
01029 
01043   CUBIEXPORT int get_owning_volume_by_name(const std::string& entity_name);
01044 
01052   CUBIEXPORT double get_curve_length(int curve_id);
01053 
01061   CUBIEXPORT double get_arc_length(int curve_id);
01062 
01076   CUBIEXPORT double get_distance_from_curve_start(double x, double y, double z, int curve_id);
01077 
01085   CUBIEXPORT double get_curve_radius(int curve_id);
01086 
01094   CUBIEXPORT double get_surface_area(int surface_id);
01095 
01103   CUBIEXPORT double get_volume_area(int volume_id);
01104 
01112   CUBIEXPORT double get_hydraulic_radius_surface_area(int surface_id);
01113 
01121   CUBIEXPORT double get_hydraulic_radius_volume_area(int volume_id);
01122 
01139   CUBIEXPORT std::vector<double> get_center_point(const std::string& entity_type, int entity_id); 
01140   
01146   CUBIEXPORT int get_valence(int vertex_id);
01147 
01150   CUBIEXPORT void print_surface_summary_stats();
01151 
01154   CUBIEXPORT void print_volume_summary_stats();
01155 
01156 #ifndef SWIG
01166   CUBIEXPORT void get_entity_info(RefEntity * source_entity, 
01167                                   std::string& geom_type, int &entity_id);
01168 #endif
01169 
01175   CUBIEXPORT int get_volume_count();
01176 
01182   CUBIEXPORT int get_surface_count();
01183 
01189   CUBIEXPORT int get_vertex_count();
01190 
01196   CUBIEXPORT int get_curve_count();
01197 
01203   CUBIEXPORT bool is_granite_engine_available();
01204 
01206 
01208 
01209 
01210 #ifndef SWIG
01230   CUBIEXPORT void get_small_surfaces_hydraulic_radius(std::vector<int> target_volume_ids,
01231                                                    double mesh_size, 
01232                                                    std::vector<int> & small_surfaces,
01233                                                    std::vector<double> & small_radius);
01234 
01254   CUBIEXPORT void get_small_volumes_hydraulic_radius(std::vector<int> target_volume_ids,
01255                                                      double mesh_size, 
01256                                                      std::vector<int> & small_volumes,
01257                                                      std::vector<double> & small_radius);
01258 #endif
01259 
01275   CUBIEXPORT std::vector<int> get_small_curves(std::vector<int> target_volume_ids, 
01276                                                double mesh_size);
01277 
01292   CUBIEXPORT std::vector<int> get_small_surfaces(std::vector<int> target_volume_ids, 
01293                                               double mesh_size);
01294 
01309   CUBIEXPORT std::vector<int> get_small_volumes(std::vector<int> target_volume_ids, 
01310                                                 double mesh_size);
01311 
01318   CUBIEXPORT std::vector<int> get_blend_surfaces(std::vector<int> target_volume_ids);
01319 
01334   CUBIEXPORT std::vector<int> get_small_loops(std::vector<int> target_volume_ids, 
01335                                               double mesh_size);
01336 
01352   CUBIEXPORT std::vector<int> get_tangential_intersections(std::vector<int> target_volume_ids,
01353                                                            double upper_bound, 
01354                                                            double lower_bound);
01355 #ifndef SWIG
01383   CUBIEXPORT void get_sharp_surface_angles(std::vector<int> target_volume_ids,
01384                                         std::vector<int> & large_surface_angles,
01385                                         std::vector<int> & small_surface_angles,
01386                                         std::vector<double> & large_angles,
01387                                         std::vector<double> & small_angles,
01388                                         double upper_bound,
01389                                         double lower_bound);
01390 
01418   CUBIEXPORT void get_sharp_curve_angles(std::vector<int> target_volume_ids,
01419                                          std::vector<int> & large_curve_angles,
01420                                          std::vector<int> & small_curve_angles,
01421                                          std::vector<double> & large_angles,
01422                                          std::vector<double> & small_angles,
01423                                          double upper_bound,
01424                                          double lower_bound);
01425 #endif
01426 
01443   CUBIEXPORT void get_bad_geometry(std::vector<int> target_volume_ids,
01444                                    std::vector<int> & body_list,
01445                                    std::vector<int> & volume_list,
01446                                    std::vector<int> & surface_list,
01447                                    std::vector<int> & curve_list);
01448                                    
01449 
01466   CUBIEXPORT void get_overlapping_surfaces(std::vector<int> target_volume_ids,
01467                                            std::vector<int> & surf_list_1,
01468                                            std::vector<int> & surf_list_2);
01469                                            
01470 
01484   CUBIEXPORT void get_overlapping_volumes(std::vector<int> target_volume_ids,
01485                                           std::vector<int> & volume_list);
01486 
01501   CUBIEXPORT void get_mergeable_entities(std::vector<int> target_volume_ids,
01502                                          std::vector<std::vector<int> > & surface_list,
01503                                          std::vector<std::vector<int> > & curve_list,
01504                                          std::vector<std::vector<int> > & vertex_list);
01505                                           
01507 
01509 
01510 
01527   CUBIEXPORT std::string get_exodus_entity_name(std::string entity_type, int entity_id);
01528 
01545   CUBIEXPORT std::string get_exodus_entity_description(std::string entity_type, int entity_id);
01546 
01554   CUBIEXPORT std::vector<double> get_all_exodus_times(const std::string& filename);
01555 
01571   CUBIEXPORT int get_block_id(std::string entity_type, int entity_id);
01572 
01580   CUBIEXPORT std::vector<int> get_block_ids(const std::string& mesh_geom_file_name);
01581 
01587   CUBIEXPORT std::vector<int> get_block_id_list();
01588 
01594   CUBIEXPORT std::vector<int> get_nodeset_id_list();
01595 
01601   CUBIEXPORT std::vector<int> get_sideset_id_list();
01602 
01608   CUBIEXPORT int get_next_sideset_id();
01609 
01615   CUBIEXPORT int get_next_nodeset_id();
01616 
01622   CUBIEXPORT int get_next_block_id();
01623 
01624 #ifndef SWIG
01657   CUBIEXPORT void get_block_children(int block_id,
01658                                      std::vector<int> & group_list,
01659                                      std::vector<int> & node_list,
01660                                      std::vector<int> & edge_list,
01661                                      std::vector<int> & tri_list,
01662                                      std::vector<int> & face_list,
01663                                      std::vector<int> & pyramid_list,
01664                                      std::vector<int> & tet_list,
01665                                      std::vector<int> & hex_list,
01666                                      std::vector<int> & volume_list,
01667                                      std::vector<int> & surface_list,
01668                                      std::vector<int> & curve_list,
01669                                      std::vector<int> & vertex_list);
01670 
01689   CUBIEXPORT void get_nodeset_children(int nodeset_id,
01690                                        std::vector<int> & node_list,
01691                                        std::vector<int> & volume_list,
01692                                        std::vector<int> & surface_list,
01693                                        std::vector<int> & curve_list,
01694                                        std::vector<int> & vertex_list);
01695 
01710   CUBIEXPORT void get_sideset_children(int sideset_id,
01711                                        std::vector<int> & face_list,
01712                                        std::vector<int> & surface_list,
01713                                        std::vector<int> & curve_list);
01714 #endif
01715 
01723   CUBIEXPORT std::vector<int> get_block_groups(int block_id);
01724 
01732   CUBIEXPORT std::vector<int> get_block_volumes(int block_id);
01733 
01741   CUBIEXPORT std::vector<int> get_block_surfaces(int block_id);
01742 
01750   CUBIEXPORT std::vector<int> get_block_curves(int block_id);
01751 
01759   CUBIEXPORT std::vector<int> get_block_vertices(int block_id);
01760 
01768   CUBIEXPORT std::vector<int> get_block_nodes(int block_id);
01769 
01777   CUBIEXPORT std::vector<int> get_block_edges(int block_id);
01778 
01786   CUBIEXPORT std::vector<int> get_block_tris(int block_id);
01787 
01795   CUBIEXPORT std::vector<int> get_block_faces(int block_id);
01796 
01804   CUBIEXPORT std::vector<int> get_block_pyramids(int block_id);
01805 
01813   CUBIEXPORT std::vector<int> get_block_tets(int block_id);
01814 
01822   CUBIEXPORT std::vector<int> get_block_hexes(int block_id);
01823 
01831   CUBIEXPORT std::vector<int> get_nodeset_volumes(int nodeset_id);
01832 
01840   CUBIEXPORT std::vector<int> get_nodeset_surfaces(int nodeset_id);
01841 
01849   CUBIEXPORT std::vector<int> get_nodeset_curves(int nodeset_id);
01850 
01858   CUBIEXPORT std::vector<int> get_nodeset_vertices(int nodeset_id);
01859 
01867   CUBIEXPORT std::vector<int> get_nodeset_nodes(int nodeset_id);
01868 
01876   CUBIEXPORT std::vector<int> get_sideset_curves(int sideset_id);
01877 
01889   CUBIEXPORT std::vector<int> get_sideset_surfaces(int sideset_id);
01890 
01903   CUBIEXPORT std::vector<int> get_sideset_quads(int sideset_id);
01904   
01912   CUBIEXPORT std::vector<int> get_surface_quads(int surface_id);
01913 
01932   CUBIEXPORT std::string get_entity_sense(std::string source_type, int source_id, 
01933                                           int sideset_id);
01934 
01953   CUBIEXPORT std::string get_wrt_entity(std::string source_type, int source_id, 
01954                                         int sideset_id);
01955 
01963   CUBIEXPORT bool is_using_shells(int sideset_id);
01964 
01981   CUBIEXPORT std::vector<std::string> get_geometric_owner(std::string mesh_entity_type, 
01982     std::string mesh_entity_list);
01983 
01985 
01987 
01988 
02005     CUBIEXPORT  int get_id_from_name(const std::string& name);
02006 
02007 
02008 #ifndef SWIG
02046   CUBIEXPORT void get_group_children(int group_id,
02047                                      std::vector<int> & group_list,
02048                                      std::vector<int> & body_list,
02049                                      std::vector<int> & volume_list,
02050                                      std::vector<int> & surface_list,
02051                                      std::vector<int> & curve_list,
02052                                      std::vector<int> & vertex_list,
02053                                      int& node_count,
02054                                      int& edge_count,
02055                                      int& hex_count,
02056                                      int& quad_count,
02057                                      int& tet_count,
02058                                      int& tri_count);
02059 #endif
02060 
02071 CUBIEXPORT  std::vector<int> get_group_groups(int group_id);
02072 
02083 CUBIEXPORT  std::vector<int> get_group_volumes(int group_id);
02084 
02095 CUBIEXPORT  std::vector<int> get_group_surfaces(int group_id);
02096 
02107 CUBIEXPORT  std::vector<int> get_group_curves(int group_id);
02108 
02119 CUBIEXPORT  std::vector<int> get_group_vertices(int group_id);
02120 
02131 CUBIEXPORT  std::vector<int> get_group_nodes(int group_id);
02132 
02143 CUBIEXPORT  std::vector<int> get_group_edges(int group_id);
02144 
02155 CUBIEXPORT  std::vector<int> get_group_quads(int group_id);
02156 
02167 CUBIEXPORT  std::vector<int> get_group_tris(int group_id);
02168 
02179 CUBIEXPORT  std::vector<int> get_group_tets(int group_id);
02180 
02191 CUBIEXPORT  std::vector<int> get_group_hexes(int group_id);
02192 
02193 
02196   CUBIEXPORT void delete_all_groups();
02197 
02203   CUBIEXPORT void delete_group(int group_id);
02204 
02224   CUBIEXPORT void remove_entity_from_group(int group_id, 
02225                                            int entity_id, 
02226                                            const std::string& entity_type);
02227 #ifndef SWIG
02228 
02237   CUBIEXPORT void group_list(std::vector<std::string>& name_list, 
02238                              std::vector<int>& id_list);
02239 
02240 #endif
02241 
02258   CUBIEXPORT std::vector<int> get_mesh_group_parent_ids(const std::string& element_type,
02259                                                         int element_id);
02260 
02276   CUBIEXPORT bool is_mesh_element_in_group(const std::string& element_type,
02277                                            int element_id);
02279 
02281 
02282 
02292   CUBIEXPORT bool is_part_of_list(int target_id, std::vector<int> id_list);
02293 
02307   CUBIEXPORT int get_last_id(const std::string& entity_type);
02308 
02310 
02312 
02313 
02325   CUBIEXPORT  std::string get_assembly_metadata(int volume_id, int data_type);
02326 
02334   CUBIEXPORT  bool is_assembly_metadata_attached(int volume_id);
02335 
02343   CUBIEXPORT std::string get_assembly_name(const std::string assembly_path);
02344 
02352   CUBIEXPORT std::string get_assembly_description(const std::string assembly_path);
02353 
02361   CUBIEXPORT int get_assembly_instance(const std::string assembly_path);
02362 
02370   CUBIEXPORT std::string get_assembly_file_format(const std::string assembly_path);
02371 
02379   CUBIEXPORT std::string get_assembly_units(const std::string assembly_path);
02380 
02388   CUBIEXPORT std::string get_assembly_material_description(const std::string assembly_path);
02389 
02397   CUBIEXPORT std::string get_assembly_material_specification(const std::string assembly_path);
02398 
02400 
02402 
02403 
02419   CUBIEXPORT int get_exodus_id(const std::string& entity_type, int entity_id);
02420 
02436   CUBIEXPORT std::string get_geometry_owner(const std::string& entity_type, int entity_id);
02437 
02454   CUBIEXPORT std::vector<int> get_connectivity(const std::string& entity_type, int entity_id);
02455 
02475   CUBIEXPORT std::vector<int> get_sub_elements(const std::string& entity_type, int entity_id, int dimension);
02476 
02484   CUBIEXPORT std::vector<double> get_nodal_coordinates(int node_id);
02485 
02493   CUBIEXPORT std::string get_block_element_type(int block_id);
02494 
02510   CUBIEXPORT int get_exodus_element_count(int entity_id, std::string entity_type);
02511 
02519   CUBIEXPORT int get_block_attribute_count(int block_id);
02520  
02530   CUBIEXPORT double get_block_attribute_value(int block_id, int index);
02531 
02539   CUBIEXPORT std::vector<std::string> get_valid_block_element_types(int block_id);
02540 
02548   CUBIEXPORT int get_nodeset_node_count(int nodeset_id);
02549 
02551 
02555   class CUBIEXPORT CIObserve
02556   {
02557     public:
02558       CIObserve();
02559       virtual ~CIObserve();
02560 
02561       void register_observer();
02562       void unregister_observer();
02563 
02564       virtual void notify_merge(std::string /*type*/, std::string /*new_name*/, int /*old_id*/, int /*new_id*/){}
02565       virtual void notify_body_created(int) {}
02566       virtual void notify_body_deleted(int) {}
02567       virtual void notify_body_updated(int) {}
02568       virtual void notify_volume_updated(int) {}
02569       virtual void notify_volume_created(int) {}
02570       virtual void notify_volume_deleted(int) {}
02571       virtual void notify_surface_created(int) {}
02572       virtual void notify_surface_deleted(int) {}
02573       virtual void notify_surface_updated(int) {}
02574       virtual void notify_curve_created(int) {}
02575       virtual void notify_curve_deleted(int) {}
02576       virtual void notify_vertex_created(int) {}
02577       virtual void notify_vertex_deleted(int) {}
02578       virtual void notify_free_vertex_created(int) {}
02579       virtual void notify_free_curve_created(int) {}
02580       virtual void notify_free_vertex_deleted(int) {}
02581       virtual void notify_free_curve_deleted(int) {}
02582       virtual void notify_free_surface_deleted(int) {}
02583       virtual void notify_free_surface_created(int) {}
02584       virtual void notify_sheet_body_created(int) {}
02585       virtual void notify_sheet_body_deleted(int) {}
02586 
02587       virtual void notify_entity_highlighted(std::string /*geom_type*/, int) {}
02588       virtual void notify_entity_pre_selected(std::string /*geom_type*/, bool) {}
02589       virtual void notify_entity_unhighlighted(std::string /*geom_type*/, int) {}
02590       virtual void notify_entity_name_changed(std::string /*geom_type*/, int) {}
02591 
02592       virtual void notify_group_created(int) {}
02593       virtual void notify_group_modified(int) {}
02594       virtual void notify_group_deleted(int) {}
02595 
02596       virtual void notify_assembly_tree_modified() {}
02597 
02598       // support for graphics mode change
02599       virtual void notify_graphics_mode_modified() {}
02600 
02601       // support for genesis entity modification messages
02602       virtual void notify_genesis_entity_modified(std::string /*type*/, int /*id*/, std::string /*action*/) {}
02603 
02604       // support for genesis entity modification messages
02605       virtual void notify_update_genesis_entity_display() {}
02606 
02607       // support for model reset messages
02608       virtual void notify_model_reset() {}
02609 
02610       // support for commands sent
02611       virtual void notify_command_complete() {}
02612 
02613       // support for visibility change event
02614       virtual void notify_entity_visibility_changed(std::string /*type*/, int /*id*/) {}
02615 
02616     private:
02617       void tokenize(const std::string& str,
02618                     std::vector<std::string>& tokens,
02619                     const std::string& delimiters = " ");
02620       void* mProxy;
02621   };
02622 
02625   class AssemblyItem
02626   {
02627   public:
02628 
02629     AssemblyItem() {}
02630     ~AssemblyItem() {}
02631 
02632     std::string get_name()   { return mAssemblyName; }
02633     std::string get_type()   { return mAssemblyType; }
02634     int get_level()          { return mAssemblyLevel; }
02635     int get_instance()       { return mAssemblyInstance; }
02636     std::string get_path()   { return mAssemblyPath; }
02637     int get_id()             { return mAssemblyID; }
02638 
02639     void set_level( int alevel)      { mAssemblyLevel = alevel; }
02640     void set_instance( int ainstance){ mAssemblyInstance = ainstance; }
02641     void set_type(std::string atype) { mAssemblyType = atype; }
02642     void set_name(std::string aname) { mAssemblyName = aname; }
02643     void set_path (std::string apath ) { mAssemblyPath = apath; }
02644     void set_id( int aid )            { mAssemblyID = aid; }
02645 
02646     std::vector<int> volume_id_list;    // list of volumes associated with a part  
02647 
02648   private:
02649     std::string mAssemblyName;
02650     std::string mAssemblyType;           // "assembly", "part"
02651     int mAssemblyLevel;                 // top level is 1
02652     int mAssemblyInstance;              // instance number
02653     std::string mAssemblyPath;          // path of the assembly item
02654     int mAssemblyID;                    // ID of the item
02655   };
02656 
02657   CUBIEXPORT std::vector<AssemblyItem*> get_assembly_items();
02658   CUBIEXPORT std::vector<int> get_volumes_for_node(std::string node_name, int node_instance);
02659 }
02660 
02661 #endif
02662 
02663 
02664 

Generated on Tue Nov 8 14:17:00 2005 for Cubit Interface by doxygen 1.3.6