//File: CadMain.idl //CAD Services V1.2 #ifndef __CADMAIN_DEFINED #define __CADMAIN_DEFINED #include "CadUtility.idl" #include "CadBrep.idl" #include "CadFeature.idl" #pragma prefix "omg.org" module CadMain { // forward references interface ModelInstance; interface Model; // exceptions exception RegenerationException { string reason; any support; }; exception ReturnToValidFail { string reason; }; exception UnboundedEntity {}; exception NotValidCadType { CadUtility::TypeCodeSeq bad_types; }; exception NotValidUid { CadUtility::LongSeq bad_ids; }; exception SaveFault { string error_text; }; exception SaveAsFault{ string error_text; }; exception CloseFault{ string error_text; }; exception IncorrectIndex{ CadUtility::LongSeq bad_indices; CadUtility::StringSeq message; }; exception EntityOutOfModel{}; enum PidStatus { UNMODIFIED, MODIFIED, DELETED, UNDEFINED }; struct TransientIdsStatusStruct { // data structures supporting EntityFactory commit output mapping long transient_id; boolean success; string warning; }; struct TransientIdsEntityStruct { long transient_id; CadFoundation::Entity valid_entity; }; typedef sequence TransientIdsStatusStructSeq; typedef sequence TransientIdsEntityStructSeq; typedef sequence PidStatusSeq; typedef sequence ModelInstanceSeq; typedef sequence ModelSeq; interface ModelInstance : CadFoundation:: Entity { CadUtility::TransformationStruct location() raises (CadUtility::CadError); // returns location information Model component_model() raises (CadUtility::CadError); // Returns the Model that defines this instance. // minor change for V 1.2 - component becomes component_model }; interface EntityFactory { void cleanup() raises (CadUtility::CadError); //clean-up any expensive book-keeping following multiple index_xxxx(), create() cycles CadUtility::LongSeq index_nurbs_curves(in CadUtility::NurbsCurveStructSeq nurbs) raises (CadUtility::CadError); CadUtility::LongSeq index_edges (in CadUtility::LongSeq start_vertices, in CadUtility::LongSeq end_vertices, in CadUtility::LongSeq curve, in CadUtility::BooleanSeq sense) raises (IncorrectIndex, CadUtility::CadError); CadUtility::LongSeq index_vertices(in CadUtility::PointStructSeq pts) raises (CadUtility::CadError); CadUtility::LongSeq index_faces(in CadUtility::LongSeqSeq oriented_eloops, in CadUtility::LongSeqSeq vertex_loops, in CadUtility::LongSeq surfaces) raises (IncorrectIndex, CadUtility::CadError); CadUtility::LongSeq index_edge_loops(in CadUtility::LongSeqSeq oriented_edges) raises (IncorrectIndex, CadUtility::CadError); CadUtility::LongSeq index_shells (in CadUtility::LongSeqSeq oriented_faces) raises (IncorrectIndex, CadUtility::CadError); CadUtility::LongSeq index_bodies (in CadUtility::LongSeqSeq oriented_shells) raises (IncorrectIndex, CadUtility::CadError); CadUtility::LongSeq index_vertex_loops (in CadUtility::LongSeq vertices) raises (IncorrectIndex, CadUtility::CadError); CadUtility::LongSeq index_oriented_edges(in CadUtility::LongSeq edges, in CadUtility::BooleanSeq sense) raises (IncorrectIndex, CadUtility::CadError); CadUtility::LongSeq index_oriented_faces(in CadUtility::LongSeq faces, in CadUtility::BooleanSeq sense) raises (IncorrectIndex, CadUtility::CadError); CadUtility::LongSeq index_oriented_edgeloops(in CadUtility::LongSeq edgeloops, in CadUtility::BooleanSeq sense) raises (IncorrectIndex, CadUtility::CadError); CadUtility::LongSeq index_oriented_shells(in CadUtility::LongSeq shells, in CadUtility::BooleanSeq sense) raises (IncorrectIndex, CadUtility::CadError); CadUtility::LongSeq index_surfaces( in CadUtility::NurbsSurfaceStructSeq nurbs) raises (CadUtility::CadError); void create (out TransientIdsStatusStructSeq status_flags, out TransientIdsEntityStructSeq final_entities) raises (CadUtility::CadError); // final creation step }; interface ModelInstanceFactory { CadMain::ModelInstance new_model_instance (in CadUtility::TransformationStruct global_location) raises (CadUtility::CadError); // Creates a new ModelInstance with initial transformation according the global coordinate system }; interface Model : CadFoundation:: Entity { // An aggregation of all entities and high-level behaviors that represent // a single CAD model. Includes product structure, boundary representations, // geometric entities, features, text entities, and datums. All entities within // a CAD model are arcwise connected unless related to each other through an instance. readonly attribute CadUtility::MassUnit mass_unit; readonly attribute CadUtility::LengthUnit length_unit; // Defines units used in the Model. Angles use degrees CadUtility::BoundingBox model_bounding_box (in CadUtility::TypeCodeSeq entity_types) raises (UnboundedEntity, NotValidCadType, CadUtility::CadError); // Returns an approximate BoundingBox around all entities of the specified type(s) // in the model. CadFeature::ParameterSeq get_parameter_set() raises (CadUtility::CadError); // Returns a sequence of parammeters for this model. ModelInstanceSeq model_children() raises (CadUtility::CadError); // Returns a sequence of any ModelInstances contained in this model. ModelInstanceSeq model_parents() raises (CadUtility::CadError); // Returns a sequence of parent models. CadFoundation::EntitySeq top_level_entities ( in CadUtility::TypeCodeSeq entity_types) raises (NotValidCadType, CadUtility::CadError); // Returns a sequence of the top level entities of the specified // type(s). string file_name () raises (CadUtility::CadError); // Returns the complete name, including absolute path (if possible), // of the physical file that stores this model. // Returns an empty string if the model is not defined in a file. boolean is_embedded(); // indicates if Model is an embedded part (e.g. CATIA Dittos, // ACAD blocks, etc) or a non-embedded part (e.g. parts in a ProE assembly). boolean is_modified () raises (CadUtility::CadError); // Queries if the model has been modified since last saved. boolean is_read_only () raises (CadUtility::CadError); // Queries whether the model can be modified. boolean is_update_pending () raises (CadUtility::CadError); // Queries if the model is being updated (regenerated). CadFoundation::LayerSeq model_layers () raises (CadUtility::CadError); // Returns a sequence of the Layers defined in this model. CadFoundation::EntityGroupSeq model_entity_groups (out CadUtility::StringSeq group_names) raises (CadUtility::CadError); // Returns a sequence of the EntityGroups defined in this model. string modification_date () raises (CadUtility::CadError); // Returns the date and time the model was last modified. string model_name () raises (CadUtility::CadError); // Returns the user-interpretable name of this model. CadUtility::StringSeq new_persistent_ids (in CadUtility::StringSeq persistent_ids) raises (CadFoundation::PidUnsupported, CadUtility::CadError); // Returns a sequence of new persistent ID's for any entities not referenced in // the specified sequence of persistent ID's (e.g. new or modified IDs). PidStatusSeq persistent_ids_status (in CadUtility::StringSeq persistent_ids) raises (CadFoundation::PidUnsupported, CadUtility::CadError); // Returns whether the entities a sequence of persistent IDs reference are // unmodified, modified, deleted. The returned sequence of status enumerations are in // the same order as the input sequence of persistent IDs. CadFoundation::EntitySeq persistent_ids_to_entities ( in CadUtility::StringSeq persistent_ids) raises (CadFoundation::PidUnsupported, CadUtility::CadError); // Returns a sequence of entity objects corresponding to a sequence of persistent IDs. // The returned sequence of entity objects is in the same order as the input sequence // of persistent IDs. A NULL item in this sequence means an entity was not available // for the corresponding persistent ID. void regenerate () raises (RegenerationException, CadUtility::CadError); // If any DesignFeatures exist and have been modified, forces a complete regeneration // of modified Entities in the model. Otherwise this operation does nothing. // Throws an exception if the regeneration process is unsuccessful. void return_to_last_valid_state () raises (ReturnToValidFail, CadUtility::CadError); // Returns the model and all entities it contains to their state just after the last // successful regeneration or after initially opening the model. // Throws an exception if unable to return to a valid state. CadFoundation::EntitySeq unique_entities ( in CadUtility::TypeCodeSeq entity_types) raises (NotValidCadType, CadUtility::CadError); // Returns a sequence of the unique entities of the specified // type(s). unsigned long unique_entities_count (in CadUtility::TypeCodeSeq entity_types) raises (NotValidCadType, CadUtility::CadError); // Returns the count of entities of the specified type(s) in this model. CadFoundation::EntitySeq unique_ids_to_entities (in CadUtility::LongSeq unique_ids) raises (NotValidUid, CadUtility::CadError); // Returns (in sequental order) a sequence of entities corresponding to an input sequence // of unique IDs. void save_model() raises (SaveFault); void save_model_as(in string new_name) raises (SaveAsFault); void close_model() raises ( CloseFault ); // operations for saving and terminating an active session EntityFactory new_entity_factory () raises (CadUtility::CadError); // Entity creation factory interface - called to create new CAD entities in current model ModelInstanceFactory new_model_instance_factory () raises (CadUtility::CadError); //Creates the ModelInstanceFactory, which is used to add ModelInstances void add_child(in ModelInstance child_model) raises (CadUtility::CadError); void remove_child(in ModelInstance child_model) raises (CadUtility::CadError); void delete_uid_entity(in long uid) raises (EntityOutOfModel, CadUtility::CadError); // Removes ModelInstance, BrepEntity, Curve or Surface from the model void delete_entity(in CadUtility::LongSeq entities_uids) raises (EntityOutOfModel, CadUtility::CadError); // Removes model entities from the model // v1.2 change from EntitySeq to LongSeq - simplifies mapping }; }; #endif