| 1 | -- Created on: 1996-12-11 |
| 2 | -- Created by: Robert COUBLANC |
| 3 | -- Copyright (c) 1996-1999 Matra Datavision |
| 4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
| 5 | -- |
| 6 | -- This file is part of Open CASCADE Technology software library. |
| 7 | -- |
| 8 | -- This library is free software; you can redistribute it and/or modify it under |
| 9 | -- the terms of the GNU Lesser General Public License version 2.1 as published |
| 10 | -- by the Free Software Foundation, with special exception defined in the file |
| 11 | -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
| 12 | -- distribution for complete text of the license and disclaimer of any warranty. |
| 13 | -- |
| 14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
| 15 | -- commercial license or contractual agreement. |
| 16 | |
| 17 | package AIS |
| 18 | |
| 19 | ---Purpose: Application Interactive Services provide the means to |
| 20 | -- create links between an application GUI viewer and |
| 21 | -- the packages which are used to manage selection |
| 22 | -- and presentation. The tools AIS defined in order to |
| 23 | -- do this include different sorts of entities: both the |
| 24 | -- selectable viewable objects themselves and the |
| 25 | -- context and attribute managers to define their |
| 26 | -- selection and display. |
| 27 | -- To orient the user as he works in a modeling |
| 28 | -- environment, views and selections must be |
| 29 | -- comprehensible. There must be several different sorts |
| 30 | -- of selectable and viewable object defined. These must |
| 31 | -- also be interactive, that is, connecting graphic |
| 32 | -- representation and the underlying reference |
| 33 | -- geometry. These entities are called Interactive |
| 34 | -- Objects, and are divided into four types: |
| 35 | -- - the Datum |
| 36 | -- - the Relation |
| 37 | -- - the Object |
| 38 | -- - None. |
| 39 | -- The Datum groups together the construction elements |
| 40 | -- such as lines, circles, points, trihedra, plane trihedra, |
| 41 | -- planes and axes. |
| 42 | -- The Relation is made up of constraints on one or |
| 43 | -- more interactive shapes and the corresponding |
| 44 | -- reference geometry. For example, you might want to |
| 45 | -- constrain two edges in a parallel relation. This |
| 46 | -- contraint is considered as an object in its own right, |
| 47 | -- and is shown as a sensitive primitive. This takes the |
| 48 | -- graphic form of a perpendicular arrow marked with |
| 49 | -- the || symbol and lying between the two edges. |
| 50 | -- The Object type includes topological shapes, and |
| 51 | -- connections between shapes. |
| 52 | -- None, in order not to eliminate the object, tells the |
| 53 | -- application to look further until it finds an object |
| 54 | -- definition in its generation which is accepted. |
| 55 | -- Inside these categories, you have the possibility |
| 56 | -- of an additional characterization by means of a |
| 57 | -- signature. The signature provides an index to the |
| 58 | -- further characterization. By default, the Interactive |
| 59 | -- Object has a None type and a signature of 0 |
| 60 | -- (equivalent to None.) If you want to give a particular |
| 61 | -- type and signature to your interactive object, you must |
| 62 | -- redefine the two virtual methods: Type and Signature. |
| 63 | -- In the C++ inheritance structure of the package, each |
| 64 | -- class representing a specific Interactive Object |
| 65 | -- inherits AIS_InteractiveObject. Among these |
| 66 | -- inheriting classes, AIS_Relation functions as the |
| 67 | -- abstract mother class for tinheriting classes defining |
| 68 | -- display of specific relational constraints and types of |
| 69 | -- dimension. Some of these include: |
| 70 | -- - display of constraints based on relations of |
| 71 | -- symmetry, tangency, parallelism and concentricity |
| 72 | -- - display of dimensions for angles, offsets, |
| 73 | -- diameters, radii and chamfers. |
| 74 | -- No viewer can show everything at once with any |
| 75 | -- coherence or clarity. Views must be managed |
| 76 | -- carefully both sequentially and at any given instant. |
| 77 | -- Another function of the view is that of a context to |
| 78 | -- carry out design in. The design changes are applied |
| 79 | -- to the objects in the view and then extended to the |
| 80 | -- underlying reference geometry by a solver. To make |
| 81 | -- sense of this complicated visual data, several display |
| 82 | -- and selection tools are required. To facilitate |
| 83 | -- management, each object and each construction |
| 84 | -- element has a selection priority. There are also |
| 85 | -- means to modify the default priority. |
| 86 | -- To define an environment of dynamic detection, you |
| 87 | -- can use standard filter classes or create your own. A |
| 88 | -- filter questions the owner of the sensitive primitive in |
| 89 | -- local context to determine if it has the the desired |
| 90 | -- qualities. If it answers positively, it is kept. If not, it is rejected. |
| 91 | -- The standard filters supplied in AIS include: |
| 92 | -- AIS_AttributeFilter |
| 93 | -- AIS_SignatureFilter |
| 94 | -- AIS_TypeFilter. |
| 95 | -- Only the type filter can be used in the default |
| 96 | -- operating mode, the neutral point. The others can |
| 97 | -- only be used in open local contexts. |
| 98 | -- Neutral point and local context constitute the two |
| 99 | -- operating modes of the central entity which pilots |
| 100 | -- visualizations and selections, the Interactive Context. |
| 101 | -- It is linked to a main viewer and if you like, a trash bin |
| 102 | -- viewer as well. |
| 103 | -- The neutral point, which is the default mode, allows |
| 104 | -- you to easily visualize and select interactive objects |
| 105 | -- which have been loaded into the context. Opening |
| 106 | -- local contexts allows you to prepare and use a |
| 107 | -- temporary selection environment without disturbing |
| 108 | -- the neutral point. A set of functions allows you to |
| 109 | -- choose the interactive objects which you want to act |
| 110 | -- on, the selection modes which you want to activate, |
| 111 | -- and the temporary visualizations which you will |
| 112 | -- execute. When the operation is finished, you close the |
| 113 | -- current local context and return to the state in which |
| 114 | -- you were before opening it (neutral point or previous |
| 115 | -- local context). |
| 116 | -- An interactive object can have a certain number of |
| 117 | -- graphic attributes which are specific to it, such as |
| 118 | -- visualization mode, color, and material. By the same |
| 119 | -- token, the interactive context has a set of graphic |
| 120 | -- attributes, the Drawer which is valid by default for the |
| 121 | -- objects it controls. When an interactive object is |
| 122 | -- visualized, the required graphic attributes are first |
| 123 | -- taken from the object's own Drawer if one exists, or |
| 124 | -- from the context drawer for the others. |
| 125 | |
| 126 | |
| 127 | uses |
| 128 | TCollection, |
| 129 | MMgt, |
| 130 | Quantity, |
| 131 | TColgp, |
| 132 | TColStd, |
| 133 | TopLoc, |
| 134 | gp, |
| 135 | Geom, |
| 136 | Bnd, |
| 137 | Aspect, |
| 138 | Graphic3d, |
| 139 | V3d, |
| 140 | TopAbs, |
| 141 | TopoDS, |
| 142 | Prs3d, |
| 143 | PrsMgr, |
| 144 | Select3D, |
| 145 | SelectMgr, |
| 146 | StdSelect, |
| 147 | DsgPrs, |
| 148 | TopTools, |
| 149 | Poly, |
| 150 | Image |
| 151 | |
| 152 | is |
| 153 | |
| 154 | |
| 155 | enumeration DisplayMode is WireFrame, Shaded; |
| 156 | ---Purpose: |
| 157 | -- Sets display modes other than neutral point ones, |
| 158 | -- for interactive objects. The possibilities include: |
| 159 | -- - wireframe, |
| 160 | -- - shaded, |
| 161 | |
| 162 | enumeration ConnectStatus is |
| 163 | CS_None, |
| 164 | CS_Connection, |
| 165 | CS_Transform, |
| 166 | CS_Both; |
| 167 | ---Purpose: Gives the status of connection of an Interactive |
| 168 | -- Object. This will be one of the following: |
| 169 | -- - No connection |
| 170 | -- - Connection |
| 171 | -- - Transformation |
| 172 | -- - Both connection and transformation |
| 173 | -- This enumeration is used in |
| 174 | -- AIS_ConnectedInteractive. Transform indicates |
| 175 | -- that the Interactive Object reference geometry has |
| 176 | -- changed location relative to the reference geometry. |
| 177 | |
| 178 | enumeration TypeOfIso is |
| 179 | TOI_IsoU, |
| 180 | TOI_IsoV, |
| 181 | TOI_Both; |
| 182 | ---Purpose: Declares the type of isoparameter displayed. |
| 183 | |
| 184 | enumeration DisplayStatus is |
| 185 | DS_Displayed, |
| 186 | DS_Erased, |
| 187 | DS_Temporary, |
| 188 | DS_None; |
| 189 | ---Purpose: |
| 190 | -- To give the display status of an Interactive Object. |
| 191 | -- This will be one of the following: |
| 192 | -- - DS_Displayed: the Interactive Object is |
| 193 | -- displayed in the main viewer; |
| 194 | -- - DS_Erased: the Interactive Object is hidden in main viewer; |
| 195 | -- - DS_Temporary: the Interactive Object is temporarily displayed; |
| 196 | -- - DS_None: the Interactive Object is nowhere displayed. |
| 197 | |
| 198 | enumeration SelectStatus is |
| 199 | SS_Added, |
| 200 | SS_Removed, |
| 201 | SS_NotDone |
| 202 | end SelectStatus; |
| 203 | |
| 204 | enumeration StatusOfPick is |
| 205 | SOP_Error, |
| 206 | SOP_NothingSelected, |
| 207 | SOP_Removed, |
| 208 | SOP_OneSelected, |
| 209 | SOP_SeveralSelected |
| 210 | end StatusOfPick; |
| 211 | |
| 212 | enumeration StatusOfDetection is |
| 213 | SOD_Error, |
| 214 | SOD_Nothing, |
| 215 | SOD_AllBad, |
| 216 | SOD_Selected, |
| 217 | SOD_OnlyOneDetected, |
| 218 | SOD_OnlyOneGood, |
| 219 | SOD_SeveralGood |
| 220 | end StatusOfDetection; |
| 221 | |
| 222 | enumeration KindOfDimension is |
| 223 | KOD_NONE, |
| 224 | KOD_LENGTH, |
| 225 | KOD_PLANEANGLE, |
| 226 | KOD_SOLIDANGLE, |
| 227 | KOD_AREA, |
| 228 | KOD_VOLUME, |
| 229 | KOD_MASS, |
| 230 | KOD_TIME, |
| 231 | KOD_RADIUS, |
| 232 | KOD_DIAMETER, |
| 233 | KOD_CHAMF2D, |
| 234 | KOD_CHAMF3D, |
| 235 | KOD_OFFSET, |
| 236 | KOD_ELLIPSERADIUS; |
| 237 | ---Purpose: Declares the kinds of dimensions needed in the |
| 238 | -- display of Interactive Objects. |
| 239 | |
| 240 | enumeration KindOfInteractive is |
| 241 | KOI_None, |
| 242 | KOI_Datum, |
| 243 | KOI_Shape, |
| 244 | KOI_Object, |
| 245 | KOI_Relation, |
| 246 | KOI_Dimension; |
| 247 | --- Purpose: Declares the type of Interactive Object. |
| 248 | -- This is one of the following: |
| 249 | -- - the Datum |
| 250 | -- - the Object |
| 251 | -- - the Relation |
| 252 | -- - the Dimension |
| 253 | -- - the None type. |
| 254 | -- The Datum is the construction element. These include |
| 255 | -- points, lines, axes and planes. The object brings |
| 256 | -- together topological shapes. The Relation includes |
| 257 | -- dimensions and constraints. The Dimension includes |
| 258 | -- length, radius, diameter and angle dimensions. |
| 259 | -- When the object is of an unknown type, the None |
| 260 | -- type is declared. |
| 261 | |
| 262 | enumeration ClearMode is |
| 263 | CM_All, |
| 264 | CM_Interactive, |
| 265 | CM_Filters, |
| 266 | CM_StandardModes, |
| 267 | CM_TemporaryShapePrs |
| 268 | end ClearMode; |
| 269 | ---Purpose: Declares which entities in an opened local context |
| 270 | -- are to be cleared of mode settings. Temporary |
| 271 | -- graphic presentations such as those for sub-shapes, |
| 272 | -- for example, are only created for the selection |
| 273 | -- process. By means of these enumerations, they can |
| 274 | -- be cleared from local context. |
| 275 | |
| 276 | enumeration KindOfUnit is |
| 277 | TOU_LENGTH, |
| 278 | TOU_SURFACE, |
| 279 | TOU_VOLUME, |
| 280 | TOU_PLANE_ANGLE, |
| 281 | TOU_SOLID_ANGLE, |
| 282 | TOU_MASS, |
| 283 | TOU_FORCE, |
| 284 | TOU_TIME; |
| 285 | ---Purpose: Declares the type of Interactive Object unit. |
| 286 | |
| 287 | enumeration TypeOfAxis is TOAX_Unknown,TOAX_XAxis,TOAX_YAxis,TOAX_ZAxis; |
| 288 | ---Purpose: Declares the type of axis. |
| 289 | |
| 290 | enumeration TypeOfPlane is TOPL_Unknown,TOPL_XYPlane,TOPL_XZPlane,TOPL_YZPlane; |
| 291 | ---Purpose: Declares the type of plane. |
| 292 | enumeration TypeOfDist is TOD_Unknown,TOD_Horizontal,TOD_Vertical; |
| 293 | ---Purpose: To declare the type of distance. |
| 294 | |
| 295 | enumeration TypeOfAttribute is |
| 296 | TOA_Line, |
| 297 | TOA_Dimension, |
| 298 | TOA_Wire, |
| 299 | TOA_Plane, |
| 300 | TOA_Vector, |
| 301 | TOA_UIso, |
| 302 | TOA_VIso, |
| 303 | TOA_Free, |
| 304 | TOA_UnFree, |
| 305 | TOA_Section, |
| 306 | TOA_Hidden, |
| 307 | TOA_Seen, |
| 308 | TOA_FirstAxis, |
| 309 | TOA_SecondAxis, |
| 310 | TOA_ThirdAxis; |
| 311 | |
| 312 | enumeration StandardDatum is SD_None,SD_Point,SD_Axis,SD_Trihedron,SD_PlaneTrihedron,SD_Line,SD_Circle,SD_Plane; |
| 313 | --- Purpose: Declares the type of standard datum of an Interactive Object. |
| 314 | |
| 315 | enumeration KindOfSurface is KOS_Plane, KOS_Cylinder, KOS_Cone, KOS_Sphere, KOS_Torus, |
| 316 | KOS_Revolution, KOS_Extrusion, KOS_OtherSurface; |
| 317 | |
| 318 | -- Enumerations for dimensions management -- |
| 319 | |
| 320 | enumeration DisplaySpecialSymbol is DSS_No, DSS_Before, DSS_After; |
| 321 | ---Purpose: Specifies dimension special symbol display options |
| 322 | |
| 323 | enumeration DimensionSelectionMode is DSM_All, DSM_Line, DSM_Text; |
| 324 | ---Purpose: Specifies dimension selection modes. |
| 325 | |
| 326 | class Triangulation; |
| 327 | |
| 328 | imported ColoredShape; |
| 329 | imported TexturedShape; |
| 330 | |
| 331 | class InteractiveContext; |
| 332 | |
| 333 | class GraphicTool; |
| 334 | |
| 335 | class LocalContext; |
| 336 | |
| 337 | class LocalStatus; |
| 338 | |
| 339 | class GlobalStatus; |
| 340 | |
| 341 | deferred class InteractiveObject; |
| 342 | |
| 343 | ---Category: VARIOUS STANDARD INTERACTIVE OBJECTS |
| 344 | -- each type of Datum has a given signature. |
| 345 | -- the other interactive objects don't |
| 346 | -- implement this signature. |
| 347 | -- Mainly used for selection with Filters... |
| 348 | |
| 349 | ---Category: Datum |
| 350 | class Point; --signature 1 |
| 351 | class Axis; --signature 2 |
| 352 | class Trihedron; --signature 3 |
| 353 | class PlaneTrihedron; --signature 4 |
| 354 | class Line; --signature 5 |
| 355 | class Circle; --signature 6 |
| 356 | class Plane; --signature 7 |
| 357 | |
| 358 | |
| 359 | ---Category: Object of type Shape |
| 360 | class Shape; --signature 0 |
| 361 | |
| 362 | |
| 363 | ---Category: General Objects |
| 364 | class ConnectedInteractive; --signature 0 |
| 365 | class MultipleConnectedInteractive; --signature 1 |
| 366 | imported PointCloud; |
| 367 | |
| 368 | ---Category: DIMENSIONS AND RELATIONS |
| 369 | |
| 370 | class DimensionOwner; |
| 371 | |
| 372 | deferred class Relation; |
| 373 | deferred class EllipseRadiusDimension; |
| 374 | class MaxRadiusDimension; |
| 375 | class MinRadiusDimension; |
| 376 | imported LengthDimension; |
| 377 | imported AngleDimension; |
| 378 | imported RadiusDimension; |
| 379 | imported DiameterDimension; |
| 380 | class Chamf2dDimension; |
| 381 | class Chamf3dDimension; |
| 382 | class OffsetDimension; |
| 383 | class FixRelation; |
| 384 | class PerpendicularRelation; |
| 385 | class ParallelRelation; |
| 386 | class TangentRelation; |
| 387 | class ConcentricRelation; |
| 388 | class IdenticRelation; |
| 389 | class SymmetricRelation; -- axial symmetry |
| 390 | class MidPointRelation; -- equal distance from point |
| 391 | class EqualRadiusRelation; |
| 392 | class EqualDistanceRelation; |
| 393 | |
| 394 | |
| 395 | ---Category: FILTERS |
| 396 | |
| 397 | |
| 398 | class TypeFilter; |
| 399 | class SignatureFilter; |
| 400 | class ExclusionFilter; |
| 401 | class AttributeFilter; |
| 402 | class C0RegularityFilter; |
| 403 | class BadEdgeFilter; |
| 404 | |
| 405 | pointer PToContext to InteractiveContext from AIS; |
| 406 | |
| 407 | |
| 408 | |
| 409 | |
| 410 | class Selection; |
| 411 | |
| 412 | |
| 413 | ---Category: The Collections |
| 414 | |
| 415 | |
| 416 | imported ListOfInteractive; |
| 417 | |
| 418 | |
| 419 | imported ListIteratorOfListOfInteractive; |
| 420 | |
| 421 | imported SequenceOfInteractive; |
| 422 | |
| 423 | imported SequenceOfDimension; |
| 424 | |
| 425 | imported MapOfInteractive; |
| 426 | |
| 427 | imported MapIteratorOfMapOfInteractive; |
| 428 | |
| 429 | |
| 430 | imported DataMapofIntegerListOfinteractive; |
| 431 | |
| 432 | |
| 433 | imported DataMapIteratorOfDataMapofIntegerListOfinteractive; |
| 434 | -- for further management of layers |
| 435 | |
| 436 | imported DataMapOfIOStatus; |
| 437 | |
| 438 | imported DataMapIteratorOfDataMapOfIOStatus; |
| 439 | -- Management of interactiveObjects Status... |
| 440 | |
| 441 | imported IndexedDataMapOfOwnerPrs; |
| 442 | -- for dynamic selection management in local context... |
| 443 | |
| 444 | -- san: 18/04/2003 AIS_Selection class optimization |
| 445 | -- agv: 04/05/2003 Replace NCollection_List for CDL list |
| 446 | imported NListTransient; |
| 447 | imported NListIteratorOfListTransient; |
| 448 | imported NDataMapOfTransientIteratorOfListTransient; |
| 449 | -- service map for AIS_Selection class optimized logic |
| 450 | |
| 451 | imported DataMapOfILC; |
| 452 | |
| 453 | imported DataMapIteratorOfDataMapOfILC; |
| 454 | |
| 455 | imported DataMapOfSelStat; |
| 456 | |
| 457 | imported DataMapIteratorOfDataMapOfSelStat; |
| 458 | -- to tell if an object is sensitive to Standard Modes Of Selection.... |
| 459 | |
| 460 | -- Methods for dimensions |
| 461 | |
| 462 | Nearest( aShape : Shape from TopoDS; |
| 463 | aPoint : Pnt from gp ) |
| 464 | returns Pnt from gp; |
| 465 | ---Purpose: |
| 466 | -- Returns the nearest point in a shape. This is used by |
| 467 | -- several classes in calculation of dimensions. |
| 468 | |
| 469 | Nearest (theLine : Lin from gp; |
| 470 | thePoint : Pnt from gp) |
| 471 | returns Pnt from gp; |
| 472 | ---Purpose: |
| 473 | -- @return the nearest point on the line. |
| 474 | |
| 475 | Nearest (theCurve : Curve from Geom; |
| 476 | thePoint : Pnt from gp; |
| 477 | theFirstPoint : Pnt from gp; |
| 478 | theLastPoint : Pnt from gp; |
| 479 | theNearestPoint : out Pnt from gp) |
| 480 | returns Boolean from Standard; |
| 481 | ---Purpose: |
| 482 | -- For the given point finds nearest point on the curve, |
| 483 | -- @return TRUE if found point is belongs to the curve |
| 484 | -- and FALSE otherwise. |
| 485 | |
| 486 | Farest( aShape : Shape from TopoDS; |
| 487 | aPoint : Pnt from gp ) |
| 488 | returns Pnt from gp; |
| 489 | |
| 490 | ComputeGeometry (theEdge : Edge from TopoDS; |
| 491 | theCurve : out Curve from Geom; |
| 492 | theFirstPnt : out Pnt from gp; |
| 493 | theLastPnt : out Pnt from gp) |
| 494 | ---Purpose: Used by 2d Relation only |
| 495 | -- Computes the 3d geometry of <anEdge> in the current WorkingPlane |
| 496 | -- and the extremities if any |
| 497 | -- Return TRUE if ok. |
| 498 | returns Boolean from Standard; |
| 499 | |
| 500 | ComputeGeometry (theEdge : Edge from TopoDS; |
| 501 | theCurve : out Curve from Geom; |
| 502 | theFirstPnt : out Pnt from gp; |
| 503 | theLastPnt : out Pnt from gp; |
| 504 | theIsInfinite : out Boolean from Standard) |
| 505 | ---Purpose: Used by dimensions only. |
| 506 | -- Computes the 3d geometry of <anEdge>. |
| 507 | -- Return TRUE if ok. |
| 508 | returns Boolean from Standard; |
| 509 | |
| 510 | ComputeGeometry (theEdge : Edge from TopoDS; |
| 511 | theCurve : out Curve from Geom; |
| 512 | theFirstPnt : out Pnt from gp; |
| 513 | theLastPnt : out Pnt from gp; |
| 514 | theExtCurve : out Curve from Geom; |
| 515 | theIsInfinite : out Boolean from Standard; |
| 516 | theIsOnPlane : out Boolean from Standard; |
| 517 | thePlane : Plane from Geom) |
| 518 | ---Purpose: Used by 2d Relation only |
| 519 | -- Computes the 3d geometry of <anEdge> in the current WorkingPlane |
| 520 | -- and the extremities if any. |
| 521 | -- If <aCurve> is not in the current plane, <extCurve> contains |
| 522 | -- the not projected curve associated to <anEdge>. |
| 523 | -- If <anEdge> is infinite, <isinfinite> = true and the 2 |
| 524 | -- parameters <FirstPnt> and <LastPnt> have no signification. |
| 525 | -- Return TRUE if ok. |
| 526 | returns Boolean from Standard; |
| 527 | |
| 528 | ComputeGeometry (theFirstEdge : Edge from TopoDS; |
| 529 | theSecondEdge : Edge from TopoDS; |
| 530 | theFirstCurve : out Curve from Geom; |
| 531 | theSecondCurve : out Curve from Geom; |
| 532 | theFirstPnt1 : out Pnt from gp; |
| 533 | theLastPnt1 : out Pnt from gp; |
| 534 | theFirstPnt2 : out Pnt from gp; |
| 535 | theLastPnt2 : out Pnt from gp; |
| 536 | thePlane : Plane from Geom) |
| 537 | ---Purpose: Used by 2d Relation only |
| 538 | -- Computes the 3d geometry of <anEdge> in the current WorkingPlane |
| 539 | -- and the extremities if any |
| 540 | -- Return TRUE if ok. |
| 541 | returns Boolean from Standard; |
| 542 | |
| 543 | ComputeGeometry (theFirstEdge : Edge from TopoDS; |
| 544 | theSecondEdge : Edge from TopoDS; |
| 545 | theFirstCurve : out Curve from Geom; |
| 546 | theSecondCurve : out Curve from Geom; |
| 547 | theFirstPnt1 : out Pnt from gp; |
| 548 | theLastPnt1 : out Pnt from gp; |
| 549 | theFirstPnt2 : out Pnt from gp; |
| 550 | theLastPnt2 : out Pnt from gp; |
| 551 | theIsinfinite1 : out Boolean from Standard; |
| 552 | theIsinfinite2 : out Boolean from Standard) |
| 553 | ---Purpose: Used by dimensions only.Computes the 3d geometry |
| 554 | -- of<anEdge1> and <anEdge2> and checks if they are infinite. |
| 555 | returns Boolean from Standard; |
| 556 | |
| 557 | ComputeGeometry (theFirstEdge : Edge from TopoDS; |
| 558 | theSecondEdge : Edge from TopoDS; |
| 559 | theExtIndex : out Integer from Standard; |
| 560 | theFirstCurve : out Curve from Geom; |
| 561 | theSecondCurve : out Curve from Geom; |
| 562 | theFirstPnt1 : out Pnt from gp; |
| 563 | theLastPnt1 : out Pnt from gp; |
| 564 | theFirstPnt2 : out Pnt from gp; |
| 565 | theLastPnt2 : out Pnt from gp; |
| 566 | theExtCurve : out Curve from Geom; |
| 567 | theIsinfinite1 : out Boolean from Standard; |
| 568 | theIsinfinite2 : out Boolean from Standard; |
| 569 | thePlane : Plane from Geom) |
| 570 | ---Purpose: Used by 2d Relation only Computes the 3d geometry |
| 571 | -- of<anEdge1> and <anEdge2> in the current Plane and the |
| 572 | -- extremities if any. Return in ExtCurve the 3d curve |
| 573 | -- (not projected in the plane) of the first edge if |
| 574 | -- <indexExt> =1 or of the 2nd edge if <indexExt> = 2. If |
| 575 | -- <indexExt> = 0, ExtCurve is Null. if there is an edge |
| 576 | -- external to the plane, <isinfinite> is true if this |
| 577 | -- edge is infinite. So, the extremities of it are not |
| 578 | -- significant. Return TRUE if ok |
| 579 | returns Boolean from Standard; |
| 580 | |
| 581 | ComputeGeomCurve (aCurve : in out Curve from Geom; |
| 582 | first1 : Real from Standard; |
| 583 | last1 : Real from Standard; |
| 584 | FirstPnt1 : out Pnt from gp; |
| 585 | LastPnt1 : out Pnt from gp; |
| 586 | aPlane : Plane from Geom; |
| 587 | isOnPlane: out Boolean from Standard) |
| 588 | ---Purpose: Checks if aCurve belongs to aPlane; if not, projects aCurve in aPlane |
| 589 | -- and returns aCurve; |
| 590 | -- Return TRUE if ok |
| 591 | returns Boolean from Standard; |
| 592 | |
| 593 | ComputeGeometry (aVertex : Vertex from TopoDS; |
| 594 | point : out Pnt from gp; |
| 595 | aPlane : Plane from Geom; |
| 596 | isOnPlane: out Boolean from Standard) |
| 597 | returns Boolean from Standard; |
| 598 | |
| 599 | GetPlaneFromFace (aFace : Face from TopoDS; |
| 600 | aPlane : out Pln from gp; |
| 601 | aSurf : out Surface from Geom; |
| 602 | aSurfType : out KindOfSurface from AIS; |
| 603 | Offset : out Real from Standard) |
| 604 | returns Boolean from Standard; |
| 605 | ---Purpose: Tryes to get Plane from Face. Returns Surface of Face |
| 606 | -- in aSurf. Returns Standard_True and Plane of Face in |
| 607 | -- aPlane in following cases: |
| 608 | -- Face is Plane, Offset of Plane, |
| 609 | -- Extrusion of Line and Offset of Extrusion of Line |
| 610 | -- Returns pure type of Surface which can be: |
| 611 | -- Plane, Cylinder, Cone, Sphere, Torus, |
| 612 | -- SurfaceOfRevolution, SurfaceOfExtrusion |
| 613 | |
| 614 | InitFaceLength (aFace : Face from TopoDS; |
| 615 | aPlane : out Pln from gp; |
| 616 | aSurface : out Surface from Geom; |
| 617 | aSurfaceType : out KindOfSurface from AIS; |
| 618 | anOffset : out Real from Standard ); |
| 619 | |
| 620 | InitLengthBetweenCurvilinearFaces (theFirstFace : Face from TopoDS; |
| 621 | theSecondFace : Face from TopoDS; |
| 622 | theFirstSurf : in out Surface from Geom; |
| 623 | theSecondSurf : in out Surface from Geom; |
| 624 | theFirstAttach : out Pnt from gp; |
| 625 | theSecondAttach : out Pnt from gp; |
| 626 | theDirOnPlane : out Dir from gp); |
| 627 | ---Purpose: Finds attachment points on two curvilinear faces for length dimension. |
| 628 | -- @param thePlaneDir [in] the direction on the dimension plane to |
| 629 | -- compute the plane automatically. It will not be taken into account if |
| 630 | -- plane is defined by user. |
| 631 | |
| 632 | InitAngleBetweenPlanarFaces (theFirstFace : Face from TopoDS; |
| 633 | theSecondFace : Face from TopoDS; |
| 634 | theCenter : out Pnt from gp; |
| 635 | theFirstAttach : out Pnt from gp; |
| 636 | theSecondAttach : out Pnt from gp; |
| 637 | theIsFirstPointSet : Boolean from Standard = Standard_False) |
| 638 | returns Boolean from Standard; |
| 639 | ---Purpose: Finds three points for the angle dimension between |
| 640 | -- two planes. |
| 641 | |
| 642 | InitAngleBetweenCurvilinearFaces (theFirstFace : Face from TopoDS; |
| 643 | theSecondFace : Face from TopoDS; |
| 644 | theFirstSurfType : KindOfSurface from AIS; |
| 645 | theSecondSurfType : KindOfSurface from AIS; |
| 646 | theCenter : out Pnt from gp; |
| 647 | theFirstAttach : out Pnt from gp; |
| 648 | theSecondAttach : out Pnt from gp; |
| 649 | theIsFirstPointSet : Boolean from Standard = Standard_False) |
| 650 | returns Boolean from Standard; |
| 651 | ---Purpose: Finds three points for the angle dimension between |
| 652 | -- two curvilinear surfaces. |
| 653 | |
| 654 | ProjectPointOnPlane( aPoint : Pnt from gp; aPlane : Pln from gp ) |
| 655 | returns Pnt from gp; |
| 656 | |
| 657 | ProjectPointOnLine( aPoint : Pnt from gp; aLine : Lin from gp ) |
| 658 | returns Pnt from gp; |
| 659 | |
| 660 | TranslatePointToBound( aPoint : Pnt from gp; aDir : Dir from gp; aBndBox: Box from Bnd ) |
| 661 | returns Pnt from gp; |
| 662 | |
| 663 | InDomain( aFirstPar : Real from Standard; |
| 664 | aLastPar : Real from Standard; |
| 665 | anAttachPar : Real from Standard) |
| 666 | returns Boolean from Standard; |
| 667 | ---Purpose: returns True if point with anAttachPar is |
| 668 | -- in domain of arc |
| 669 | |
| 670 | NearestApex(elips : Elips from gp; |
| 671 | pApex : Pnt from gp; |
| 672 | nApex : Pnt from gp; |
| 673 | fpara : Real from Standard ; |
| 674 | lpara : Real from Standard ; |
| 675 | IsInDomain : out Boolean from Standard) |
| 676 | returns Pnt from gp; |
| 677 | ---Purpose: computes nearest to ellipse arc apex |
| 678 | |
| 679 | DistanceFromApex(elips : Elips from gp; |
| 680 | Apex : Pnt from gp; |
| 681 | par : Real from Standard ) |
| 682 | returns Real from Standard; |
| 683 | ---Purpose: computes length of ellipse arc in parametric units |
| 684 | |
| 685 | |
| 686 | ComputeProjEdgePresentation(aPres : Presentation from Prs3d; |
| 687 | aDrawer : Drawer from Prs3d; |
| 688 | anEdge : Edge from TopoDS; |
| 689 | ProjCurve: Curve from Geom; |
| 690 | FirstP : Pnt from gp; |
| 691 | LastP : Pnt from gp; |
| 692 | aColor : NameOfColor from Quantity = Quantity_NOC_PURPLE; |
| 693 | aWidth : Real from Standard = 2; |
| 694 | aProjTOL : TypeOfLine from Aspect = Aspect_TOL_DASH; |
| 695 | aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT); |
| 696 | |
| 697 | ComputeProjVertexPresentation(aPres : Presentation from Prs3d; |
| 698 | aDrawer : Drawer from Prs3d; |
| 699 | aVertex : Vertex from TopoDS; |
| 700 | ProjPoint: Pnt from gp; |
| 701 | aColor : NameOfColor from Quantity = Quantity_NOC_PURPLE; |
| 702 | aWidth : Real from Standard = 2; |
| 703 | aProjTOM : TypeOfMarker from Aspect = Aspect_TOM_PLUS; |
| 704 | aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT); |
| 705 | |
| 706 | end AIS; |