//File: CadBrep.idl //CAD Services V1.1 #ifndef __CADBREP_DEFINED #define __CADBREP_DEFINED #include "CadUtility.idl" #include "CadFoundation.idl" #include "CadFeature.idl" #include "CadGeometry.idl" #pragma prefix "omg.org" module CadBrep { // forward references interface BrepEntity; interface Shell; interface OrientedShell; interface OrientedFace; interface Vertex; interface VertexLoop; interface Edge; interface EdgeLoop; interface Face; interface OrientedEdge; interface OrientedEdgeLoop; interface Body; typedef sequence OrientedEdgeSeq; typedef sequence OrientedShellSeq; typedef sequence OrientedFaceSeq; typedef sequence ShellSeq; typedef sequenceVertexLoopSeq; typedef sequence EdgeSeq; typedef sequence VertexSeq; typedef sequence EdgeLoopSeq; typedef sequence OrientedEdgeLoopSeq; typedef sequence FaceSeq; typedef sequence BodySeq; exception MultipleFaces { FaceSeq multiples; }; struct PropertyStruct { double surface_area; double volume; double mass; double solid_density; // Solid density is provide as a reference value CadUtility::VectorStruct centroid; CadUtility::VectorStruct inertial_moments; CadUtility::VectorStruct inertial_products; CadUtility::VectorStruct principle_x_axis; CadUtility::VectorStruct principle_y_axis; CadUtility::VectorStruct principle_z_axis; CadUtility::VectorStruct gyration_radii; // Items relative to the frame CadUtility::VectorStruct inertial_moments_centroidal; CadUtility::VectorStruct inertial_products_centroidal; CadUtility::VectorStruct principle_moments_centroidal; CadUtility::VectorStruct gyration_radii_centroidal; // Items relative to the centroid double surface_area_error; double volume_error; double mass_error; // Error Values }; interface BrepEntity : CadFoundation::Entity { CadFeature::DesignFeatureSeq design_features () raises (CadUtility::CadError); // Sequence of the design features directly involved with the // creation of this entity. boolean is_manifold() raises (CadUtility::CadError); }; typedef sequence BrepEntitySeq; interface Body : BrepEntity { // A collection of Brep entities defining a closed volume, aka solid. PropertyStruct property_info( inout double accuracy) raises (CadUtility::CadError); // Returns a structure with property info OrientedShellSeq oriented_shells () raises (CadUtility::CadError); // Returns a sequence of the associated oriented shells. The first oriented // shell in the list defines the external or outside boundary of the body. FaceSeq unique_faces() raises (CadUtility::CadError); // Returns a sequence of the unique faces composing this body EdgeSeq unique_edges() raises (CadUtility::CadError); // returns a sequence of the unique edges in this body VertexSeq unique_vertices() raises (CadUtility::CadError); // returns a sequence of unique vertices in this body CadGeometry::ConnectedFaceTessellationStruct tessellate ( in CadGeometry::TessType t_type, inout CadGeometry::TessParametersStruct params, out boolean t_flag) raises (CadUtility::CadError); // Tessellates the surface to the specified TessParameters // If Flag is true the TessParameters were changed }; interface OrientedShell : BrepEntity { // An oriented use of a shell. // An oriented shell must always be used by at least one body Body get_body () raises (CadUtility::CadError); // Returns the body that uses this oriented shell. boolean sense () raises (CadUtility::CadError); // Queries whether the direction of the oriented shell agrees with the //direction of the underlying shell. Shell get_shell () raises (CadUtility::CadError); // Returns the shell associated with this oriented entity. }; interface Shell : BrepEntity { // An collection of oriented faces. // An independent, open shell can represent a skin or quilt. double area( inout double accuracy) raises (CadUtility::CadError); // shell area - accuracy is implementation defined boolean is_closed() raises (CadUtility::CadError); OrientedFaceSeq oriented_faces () raises (CadUtility::CadError); // Returns a sequence of the oriented faces in this shell. //The ordering of the oriented faces in this sequence has no significance. OrientedShellSeq oriented_shells () raises (CadUtility::CadError); // Returns a sequence of the oriented shells that use this shell. //Returns an empty sequence if this shell is independent. CadGeometry::FaceTessellationStructSeq tessellate (in CadGeometry::TessType t_type, inout CadGeometry::TessParametersStruct params, out boolean t_flag) raises (CadUtility::CadError); // Tessellates the surface to the specified TessParameters // If Flag is true the TessParameters were changed }; interface Vertex : BrepEntity { // A topological point. EdgeSeq get_edges () raises (CadUtility::CadError); // Returns a sequence of the edges that use this vertex. // Returns an empty sequence if this vertex is independent. CadUtility::PointStruct location() raises (CadUtility::CadError); // Returns the 3D coordinates. VertexLoopSeq vertex_loops() raises (CadUtility::CadError); // Returns a sequence of the vertex loops that use this vertex. }; interface VertexLoop : BrepEntity { // A topological pole or point location used to define the boundary of a face. // Examples include the pole of a sphere or a cone. // A vertex loop must always be used by a face (never independent). Vertex loop_vertex () raises (CadUtility::CadError); // Returns the vertex that defines the 3D location of this vertex loop. Face get_face () raises (CadUtility::CadError); // Returns the face that uses this vertex loop. // Since vertex loops cannot be independent, this object must be used to // construct an edge loop before it is considered valid. }; interface EdgeLoop : BrepEntity { OrientedEdgeLoopSeq oriented_edge_loops() raises (CadUtility::CadError); // oriented edge loops that reference this edge loop OrientedEdgeSeq oriented_edges() raises (CadUtility::CadError); // oriented edges that compose the edge loop }; interface OrientedEdgeLoop : BrepEntity { boolean sense() raises (CadUtility::CadError); // true indicates agreement with the underlying edge loop Face get_face() raises (CadUtility::CadError); EdgeLoop get_edge_loop() raises (CadUtility::CadError); }; interface OrientedFace : BrepEntity { // An oriented use of a face. Face get_face () raises (CadUtility::CadError); // Returns the face associated with this oriented entity. boolean sense () raises (CadUtility::CadError); // Queries whether the direction of the oriented face agrees with the // direction of the underlying face. Shell get_shell () raises (CadUtility::CadError); // Returns the shell that uses this oriented face. }; enum Location { // Location enumeration INSIDE, ON_BOUNDARY, OUTSIDE }; interface Face : BrepEntity { readonly attribute CadUtility::RangeStruct range_u; readonly attribute CadUtility::RangeStruct range_v; // bounds of the active region of the face as defined by the inner and outer loops. double area( inout double accuracy) raises (CadUtility::CadError); // Evaluates area to a specified accuracy. // Accuracy is implementation defined. boolean intersect_ray ( in CadUtility::RayStruct 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 face. // The tolerance defines how close the ray must come to the face to be considered // an intersection. Returns TRUE if any intersections were found, FALSE if not. // Any intersections are returned in two sequences: one of 3D points and one of // corresponding 2D parameter values on the face's surface. Location is_location_inside (in CadUtility::UvStruct location) raises (CadUtility::CadError); // Queries if a location (defined by uv parameter values) is in the active region // of the face as defined by the inner and outer loops. OrientedEdgeLoopSeq oriented_edge_loops () raises (CadUtility::CadError); // Returns a list of the associated Brep.OrientedEdgeLoop entities. // The first oriented edge loop in the list defines the outside boundary of the face. OrientedFaceSeq oriented_faces () raises (CadUtility::CadError); // Returns a list of the associated CadBrep::OrientedFace entities. //Returns an empty list if this face is independent, e.g. a trimmed surface. boolean sense () raises (CadUtility::CadError); // Queries whether the direction of the face agrees with the parametric (normal) // direction of the underlying surface. // Critical for determining the "outside" of a face in a body, for example. CadGeometry::Surface surface () raises (CadUtility::CadError); // Returns the CadGeometry::Surface entity that defines the shape of this face. CadGeometry::FaceTessellationStruct tessellate (in CadGeometry::TessType t_type, inout CadGeometry::TessParametersStruct params, out boolean t_flag) raises (CadUtility::CadError); // Tessellates the surface to the specified TessParameters // If Flag is true the TessParameters were changed VertexLoopSeq vertex_loops () raises (CadUtility::CadError); // Returns a sequence of any vertex loops defined on this face. }; interface OrientedEdge : BrepEntity { // An oriented use of an edge. Edge get_edge () raises (CadUtility::CadError); // Returns the edge associated with this oriented entity. EdgeLoop edge_loop () raises (CadUtility::CadError); // Returns the edge loop that uses this oriented edge. Vertex start_vertex () raises (CadUtility::CadError); // Returns the vertex that defines the start of this oriented edge. Vertex end_vertex () raises (CadUtility::CadError); // Returns the vertex that defines the end of this oriented edge. // Takes into account any sense differences. OrientedFace oriented_face () raises (MultipleFaces, CadUtility::CadError); // Returns the oriented face that uses this oriented edge. // Returns NULL if the oriented edge is in an independent edge loop or // bounds an independent face. // Raises an exception if more than one oriented face uses this oriented edge. Face get_face() raises (MultipleFaces, CadUtility::CadError); boolean sense () raises (CadUtility::CadError); // Queries whether the direction of the oriented edge (from start to // end vertices) agrees with the direction of the underlying edge. }; interface Edge : BrepEntity { // A trimmed portion of a curve.An edge that uses the same vertex for both start and // end vertices must be defined as a closed edge on a closed curve starting and ending // at this vertex. An independent edge can be used to represent a trimmed curve. CadGeometry::Curve curve() raises (CadUtility::CadError); // Returns the curve that defines the shape of this edge in model space. double length ( inout double accuracy ) raises (CadUtility::CadError); // Evaluates the length of the edge to a specified accuracy. // The accuracy is implementation defined. CadUtility::NurbsCurveStruct nurbs_representation ( inout double tolerance ) raises (CadUtility::CadError); // Returns a NURBS curve that approximates this edge within the specified tolerance. OrientedEdgeSeq oriented_edges () raises (CadUtility::CadError); // Returns a sequence of the oriented edges that use this edge // Returns an empty sequence if this edge is independent. boolean sense () raises (CadUtility::CadError); // Queries whether the direction of the edge (from start to end vertices) // agrees with the parametric direction of the underlying curve. double start_parameter () raises (CadUtility::CadError); // Returns the curve parameter corresponding to the start vertex. double end_parameter () raises (CadUtility::CadError); // Returns the curve parameter corresponding to the end vertex. Vertex start_vertex () raises (CadUtility::CadError); // Returns the vertex that defines the start of this edge. Vertex end_vertex () raises (CadUtility::CadError); // Returns the final vertex that defines this edge. CadGeometry::EdgeTessellationStruct tessellate ( in double tolerance) raises (CadUtility::CadError); // Tessellates the edge to a specified chordal deviation tolerance. CadUtility::VectorStruct unit_tangent (in double parameter,in boolean sense) raises (CadUtility::CadError); // Evaluates the unit tangent vector of the edge at the specified parameter and sense. // If the sense is TRUE, the tangent vector is oriented with the edge. // If the sense is FALSE, the tangent vector is oriented in the opposite direction. VertexSeq unique_vertices () raises (CadUtility::CadError); // Returns a sequence of unique vertices used by this edge. }; }; #endif