//File: CadUtility.idl //CAD Services V1.1 #ifndef __CADUTILITY_DEFINED #define __CADUTILITY_DEFINED #include #pragma prefix "omg.org" module CadUtility { // basic geometric structures struct PointStruct { // three dimensional location double x; double y; double z; }; struct BoundingBox { PointStruct point_min; PointStruct point_max; }; typedef sequence PointStructSeq; typedef sequence PointStructSeqSeq; struct VectorStruct { // Direction in 3D double i; double j; double k; }; typedef sequence VectorStructSeq; typedef sequence VectorStructSeqSeq; typedef sequence VectorStructSeqSeqSeq; struct TransformationStruct { PointStruct offset; VectorStruct i_ref_dir; VectorStruct k_dir; }; struct RayStruct { PointStruct origin; VectorStruct direction; }; typedef sequence RayStructSeq; struct UvStruct { double u; double v; }; typedef sequence UvStructSeq; // Global Cad Error exception CadError { unsigned long error_code; string error_text; }; // Sequences of basic types typedef sequence BooleanSeq; typedef sequence LongSeq; typedef sequence LongSeqSeq; typedef sequence DoubleSeq; typedef sequence StringSeq; typedef sequence DoubleSeqSeq; typedef sequence AnySeq; typedef sequence TypeCodeSeq; enum MassUnit { // mass unit options POUNDS, GRAMS, KILOGRAMS, UNKNOWN_MASS }; enum LengthUnit { // length unit options INCH, FEET, M, CM, MM, UNKNOWN_LENGTH }; // enum + union supporting parameters enum AttribTypes { LONG_TYPE, DOUBLE_TYPE, STRING_TYPE, BOOLEAN_TYPE }; union EntityAttrib switch(AttribTypes) { case LONG_TYPE: long l_value; case DOUBLE_TYPE: double d_value; case STRING_TYPE: string s_value; case BOOLEAN_TYPE: boolean b_value; }; struct ColorStruct { // basic color information in RGB form // Valid values range from 0.0 to 1.0 double red; double green; double blue; }; typedef sequence ColorStructSeq; struct PresentationStruct { // CAD system presentation data // Unsupported features will return a negative value // Valid values range from 0.0 to 1.0 ColorStruct object_color; ColorStruct specular_color; //light source color double diffuse_factor; double specular_factor; double ambient_factor; double roughness; double transparency; // 0. is opaque and 1. is transparent }; struct RangeStruct { // basic range information double high; double low; }; struct WarningStruct { // struct for warning messages long index; string message; }; typedef sequenceWarningStructSeq; // Nurbs data structures struct NurbsCurveStruct { boolean is_rational; // rational or polynomial? CadUtility::DoubleSeq knots; // A sequence of knot values. CadUtility::DoubleSeq weights; // A sequence of weight values. CadUtility::PointStructSeq control_points; // A sequence of control points in 3D CadUtility::LongSeq multiplicity; long degree; }; typedef sequence NurbsCurveStructSeq; struct NurbsSurfaceStruct { boolean is_rational; // rational or polynomial? CadUtility::DoubleSeq knots_u; CadUtility::DoubleSeq knots_v; // Sequence of knot values. CadUtility::DoubleSeqSeq weights; // A sequence of weight values. CadUtility::PointStructSeqSeq control_points; // A sequence of control points. // Each point is a sequence of a sequence of 3D points. CadUtility::LongSeq multiplicity_u; CadUtility::LongSeq multiplicity_v; long degree_u; long degree_v; }; typedef sequence NurbsSurfaceStructSeq; }; #endif