//File: CadGeometry.idl #ifndef __CADGEOMETRY_DEFINED #define __CADGEOMETRY_DEFINED #include "CadUtility.idl" #include "CadFoundation.idl" #pragma prefix "omg.org" module CadGeometry { // Fundamental Geomety defintitions //forward references interface Curve; interface Surface; typedef sequence CurveSeq; typedef sequence SurfaceSeq; enum TessType { // an enumeration of possible types of tessellations WIREFRAME, VISUALIZATION }; struct TessParametersStruct { // parameters used with the Tessellation creation double max_chord; // maximum deviation between triangle center and surface double max_size; double angle; // deviation between normals of facets - in degrees }; struct IndexStruct { // struct supporting triangle specification // i1 connects to i2, i2 to i3, and i3 to i1 long i1; long i2; long i3; }; typedef sequence IndexSeq; struct EdgeTessellationStruct { // edge tessellation Object obj_ref; // Object reference to underlying topology CadUtility::PointStructSeq epts; // sequence of pts defining edge tessellation (first struct is the starting pt) CadUtility::LongSeq vertex_number; // index numbering for all points - relating to epts above CadUtility::DoubleSeq t_values; //sequence of doubles for t parameters }; typedef sequence EdgeTessellationStructSeq; struct TessellationStruct { // basic tessellation structure, please see JCAD submission for indexing Object obj_ref; // Object reference to underlying topology TessType t_type; // Application specific type for this tessellation CadUtility::PointStructSeq xyz; // sequence of 3D pts defining triangles on the Face(length = npts) CadUtility::LongSeq face_pts; // index numbering for all points - relating to xyz above CadUtility::VectorStructSeq normals; // sequence of normals at vertices CadUtility::UvStructSeq uv; // uv parameters associated with the pts (length = npts) IndexSeq index_list; // Index list is a set of 3 values (i1,i2,i3) as pointers into the // points/normals/uv values to define a triangle. To allow pt // sharing accross faces the vertex_number sequence is consistent // with face_pts. Please see Appendix B. }; struct FaceTessellationStruct { EdgeTessellationStructSeq edges; // sequence of edge tessellations TessellationStruct face_tessellation; // Face - specific tessellation data }; typedef sequence FaceTessellationStructSeq; struct ConnectedFaceTessellationStruct { Object obj_ref; // Object reference to underlying topology long max_vertex_number; // total vertices used for tessellation (all faces) FaceTessellationStructSeq all_faces; // all face tessellations supoorting this body }; struct CurvePropsStruct { // Properties of a Curve boolean is_bounded; boolean is_closed; CadUtility::RangeStruct range; }; interface Curve : CadFoundation::Entity { CurvePropsStruct get_curve_props() raises (CadUtility::CadError); // recommended access operation for curve properties readonly attribute boolean is_bounded; readonly attribute boolean is_closed; double length(inout double accuracy) raises (CadUtility::CadError); // Accuracy request is implementation defined. CadUtility::RangeStruct range() raises (CadUtility::CadError); CadUtility::PointStructSeq evaluate_points ( in CadUtility::DoubleSeq parameters, in boolean direction_sense, in long derivative_count, out CadUtility::VectorStructSeqSeq derivatives) raises (CadUtility::CadError); // Evaluates a curve at the specified parameters. CadUtility::DoubleSeq evaluate_curvatures (in CadUtility::DoubleSeq parameters, in boolean direction_sense) raises (CadUtility::CadError); // Evaluates the curvature of a curve at the specified parameters. CadUtility::VectorStructSeq evaluate_normals ( in CadUtility::DoubleSeq parameters, in boolean direction_sense) raises (CadUtility::CadError); // Evaluates the normal of a curve at the specified parameters. boolean intersect_ray (in CadUtility::RayStruct i_ray, in double tolerance, out CadUtility::PointStructSeq intersection_points, out CadUtility::DoubleSeq intersection_parameters) raises (CadUtility::CadError); // Evaluates the intersections between the specified ray and the curve. boolean is_planar (out CadUtility::RayStruct ray) raises (CadUtility::CadError); // Queries if the curve is planar. //If so, the returned ray defines a point and direction for this plane. CadUtility::NurbsCurveStruct nurbs_representation (inout double tolerance, in double t_min,in double t_max) raises (CadUtility::CadError); // Returns a NURBS curve that represents this curve within the specified tolerance. // If the representation is exact tolerance will be returned as a negative value boolean project_points_to_nearest (in CadUtility::PointStructSeq points, out CadUtility::DoubleSeq params, out CadUtility::PointStructSeq projected_points, out CadUtility::WarningStructSeq warnings) raises (CadUtility::CadError); // Projects each specified point to the nearest point on the curve. boolean project_point_to_nearest (in CadUtility::PointStruct point, out double param, out CadUtility::PointStruct projected_point, out string warning_string) raises (CadUtility::CadError); // Projects a single point (not recommended for points) CadGeometry::EdgeTessellationStruct tessellate ( in double tolerance) raises (CadUtility::CadError); // Tessellates the curve to a specified chordal deviation tolerance. }; struct SurfacePropsStruct { // surface properties boolean is_bounded_u; boolean is_bounded_v; CadUtility::RangeStruct range_u; CadUtility::RangeStruct range_v; boolean is_closed_u; boolean is_closed_v; }; struct SurfaceCurvatureStruct { double min_curvature; double max_curvature; CadUtility::VectorStruct min_princ_direction; CadUtility::VectorStruct max_princ_direction; }; typedef sequence SurfaceCurvatureStructSeq; interface Surface : CadFoundation::Entity { SurfacePropsStruct get_surface_props() raises (CadUtility::CadError); // recommended access operation for surface properties readonly attribute boolean is_bounded_u; readonly attribute boolean is_bounded_v; CadUtility::RangeStruct range_u() raises (CadUtility::CadError); CadUtility::RangeStruct range_v() raises (CadUtility::CadError); boolean is_closed_u() raises (CadUtility::CadError); boolean is_closed_v() raises (CadUtility::CadError); double area (inout double accuracy) raises (CadUtility::CadError); // Evaluates the area to a specified accuracy. // Accuracy is implementation defined. CadUtility::PointStructSeq evaluate_points ( in CadUtility::UvStructSeq uv_parameters, in boolean direction_sense_u,in boolean direction_sense_v, in long derivative_count, out CadUtility::VectorStructSeqSeqSeq derivatives) raises (CadUtility::CadError); // Evaluates a surface at the specified parameters. CadUtility::PointStruct evaluate_point (in CadUtility::UvStruct uv_point, in boolean direction_sense_u,in boolean direction_sense_v, in long derivative_count, out CadUtility::VectorStructSeqSeq derivatives) raises (CadUtility::CadError); // Single point operation (not recommended). SurfaceCurvatureStructSeq evaluate_curvatures (in CadUtility::UvStructSeq uv_parameters, in boolean direction_sense_u,in boolean direction_sense_v) raises (CadUtility::CadError); // Evaluates the curvature of a surface at the specified parameters. CadUtility::VectorStructSeq evaluate_normals (in CadUtility::UvStructSeq uv_parameters, in boolean direction_sense_u,in boolean direction_sense_v) raises (CadUtility::CadError); // Evaluates the normal of a surface at the specified parameters. CadUtility::NurbsSurfaceStruct nurbs_representation (inout double tolerance, in double low_bound_u, in double high_bound_u, in double low_bound_v,in double high_bound_v) raises (CadUtility::CadError); // Returns a NURBS surface that represents this surface. // If nurbs representation is exact, tolerance will be returned as a negative CadGeometry::TessellationStruct tessellate (in TessType t_type, inout TessParametersStruct params, out boolean t_flag) raises (CadUtility::CadError); // Tessellates the surface to the specified TessParameters. // If Flag is true the TessParameters were changed (original values could not be achieved) boolean project_points_to_nearest (in CadUtility::PointStructSeq points, out CadUtility::UvStructSeq params, out CadUtility::PointStructSeq projected_points, out CadUtility::WarningStructSeq warnings) raises (CadUtility::CadError); // Projects each specified point to the nearest point on the surface. boolean project_point_to_nearest (in CadUtility::PointStruct point, out CadUtility::UvStruct param, out CadUtility::PointStruct projected_point, out string warning_string) raises (CadUtility::CadError); // Projects a single point - NOT recommended boolean intersect_ray (in CadUtility::RayStruct i_ray, in double tolerance, out CadUtility::PointStructSeq intersection_points, out CadUtility::UvStructSeq intersection_parameters) raises (CadUtility::CadError); // Evaluates the intersections between the specified ray and // the surface. boolean is_planar (out CadUtility::RayStruct ray) raises (CadUtility::CadError); // Queries if the surface is planar. // If so, the returned ray defines a point and direction for // this plane. }; }; #endif