//File: CadFoundation.idl #ifndef __CADFOUNDATION_DEFINED #define __CADFOUNDATION_DEFINED #include "CadUtility.idl" #pragma prefix "omg.org" module CadFoundation { // Encapsulates general elements and behavior that are shared by all model entities. // forward references interface Attributable; interface Entity; interface EntityGroup; interface Layer; typedef sequence EntitySeq; typedef sequence LayerSeq; typedef sequence EntityGroupSeq; // exceptions exception UidUnsupported {}; exception PidUnsupported {}; exception GuiUnsupported {}; exception UnBoundedEntity { string unbounded_name; }; exception NotIndependent{ string dependancy; }; exception ReadOnlyEntity{}; interface Attributable { // General interface allowing geometry tagging // The following operations should use DynAnys to extract attribute information any get_info() raises (CadUtility::CadError); void set_info(in any dyn_value) raises (CadUtility::CadError); }; struct EntityPropsStruct { // Properties of Entity in a struct boolean is_top_level; string native_label; string native_type; boolean is_committed; CadUtility::PresentationStruct presentation_info; long dimension; boolean is_native_valid; boolean is_visible; long unique_id; string persistent_id; CadUtility::PointStructSeq ref_positions; CadUtility::TransformationStruct global_position; }; interface Entity : Attributable { // Provides CAD functionality + properties to be inherited by geometry objects EntityPropsStruct get_entity_props() raises (CadUtility::CadError); // operation providing grouped access to Entity properties readonly attribute boolean is_top_level; // Top level entity? readonly attribute string native_label; // Provides a brief description of the entity using system-specific terminology. // Not guaranteed to be unique within a model. readonly attribute string native_type; // The system-specific type name of this entity. CadUtility::PresentationStruct get_presentation_info() raises (CadUtility::CadError); // Struct containing relevant presentation information. CadUtility::BoundingBox bounding_box () raises (UnBoundedEntity, CadUtility::CadError); // Returns an approximate BoundingBox around the entity. // Returns an error if the entity is unbounded in one or more directions. Object cad_model() raises (CadUtility::CadError); // Returns the CadMain::Model object that contains this entity. // Reference must be narrowed to CadMain::Model long euclidean_dimension () raises (CadUtility::CadError); // Returns the Euclidean dimension of the entity. boolean is_native_valid () raises (CadUtility::CadError); // Queries if the native entity is valid according to any internal checks // provided by the CAD system. boolean is_visible () raises (CadUtility::CadError); // Queries whether the entity is visible or not (blanked, no-showed, hidden). LayerSeq entity_layers () raises (CadUtility::CadError); // Returns a sequence of the Layers that contain this entity long get_unique_id() raises ( UidUnsupported, CadUtility::CadError ); // Identifier that is guaranteed to be unique across all entities in a Model. // This identifier is not persistent (i.e.valid only during CadServer Session). string get_persistent_id () raises (PidUnsupported, CadUtility::CadError); // Returns an identifier intended to identify this entity between interface sessions. CadUtility::PointStructSeq reference_position () raises (CadUtility::CadError); // Returns a sequence of reference coordinates on // the entity that are unique relative to neighboring entities. CadUtility::TransformationStruct global_location() raises (CadUtility::CadError); // Provides global coordinate location information void transform (in CadUtility::TransformationStruct transformation) raises (NotIndependent, ReadOnlyEntity, CadUtility::CadError); // Applies the specified transformation (rotations and translation) to the entity. // Throws an exception if the entity cannot be transformed. }; interface EntityGroup { // A generalized grouping of entities within a model that is not related to // layering. Provides a mechanism for grouping whose semantics lie outside the // standard, e.g. application-specific collections readonly attribute long count; // Number of entities in group. readonly attribute string entity_group_label; // a label for this entity group CadFoundation::EntitySeq entities () raises (CadUtility::CadError); // Returns a sequence of entities defined in this group. void add_entities (in CadFoundation::EntitySeq entities) raises (CadUtility::CadError); // Adds the specified entities to this group. void remove_entities (in CadFoundation::EntitySeq entities) raises (CadUtility::CadError); // Removes the specified entities from this group. // Does not delete the entity objects. }; interface Layer : EntityGroup { // An collection of entities that corresponds to the layers. readonly attribute string layer_identifier; // String identifier of layer. CadUtility::ColorStruct get_color() raises (CadUtility::CadError); boolean is_visible() raises (CadUtility::CadError); }; }; #endif