0024837: Visualization - revise design and implementation of connected Interactive...
[occt.git] / src / AIS / AIS.cdl
old mode 100755 (executable)
new mode 100644 (file)
index 59caa1d..3abdfc8
@@ -1,24 +1,18 @@
 -- Created on: 1996-12-11
 -- Created by: Robert COUBLANC
 -- Copyright (c) 1996-1999 Matra Datavision
--- Copyright (c) 1999-2012 OPEN CASCADE SAS
+-- Copyright (c) 1999-2014 OPEN CASCADE SAS
 --
--- The content of this file is subject to the Open CASCADE Technology Public
--- License Version 6.5 (the "License"). You may not use the content of this file
--- except in compliance with the License. Please obtain a copy of the License
--- at http://www.opencascade.org and read it completely before using this file.
+-- This file is part of Open CASCADE Technology software library.
 --
--- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
--- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+-- This library is free software; you can redistribute it and/or modify it under
+-- the terms of the GNU Lesser General Public License version 2.1 as published
+-- by the Free Software Foundation, with special exception defined in the file
+-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+-- distribution for complete text of the license and disclaimer of any warranty.
 --
--- The Original Code and all software distributed under the License is
--- distributed on an "AS IS" basis, without warranty of any kind, and the
--- Initial Developer hereby disclaims all such warranties, including without
--- limitation, any warranties of merchantability, fitness for a particular
--- purpose or non-infringement. Please see the License for the specific terms
--- and conditions governing the rights and limitations under the License.
-
-
+-- Alternatively, this file may be used under the terms of Open CASCADE
+-- commercial license or contractual agreement.
 
 package AIS 
 
@@ -152,7 +146,8 @@ uses
     StdSelect,
     DsgPrs,
     TopTools,
-    Poly
+    Poly,
+    Image
 
 is
     
@@ -189,7 +184,6 @@ is
     enumeration DisplayStatus is 
     DS_Displayed,  
     DS_Erased,     
-    DS_FullErased,
     DS_Temporary, 
     DS_None;     
         ---Purpose:
@@ -197,9 +191,7 @@ is
         -- This will be one of the following:
         -- -   DS_Displayed: the Interactive Object is
         --   displayed in the main viewer;
-        -- -   DS_Erased: the Interactive Object is erased in the collector;
-        -- -   DS_FullErased: the Interactive Object is erased
-        --   but not in the collector;
+        -- -   DS_Erased: the Interactive Object is hidden in main viewer;
         -- -   DS_Temporary: the Interactive Object is temporarily displayed;
         -- -   DS_None: the Interactive Object is nowhere displayed.
         
@@ -250,19 +242,23 @@ is
     KOI_Datum,
     KOI_Shape,
     KOI_Object,
-    KOI_Relation;
-        --- Purpose: Declares the type of Interactive Object. 
-        -- This is one of the following:
-        -- -   the Datum
-        -- -   the Object
-        -- -   the Relation
-        -- -   the None type.
-        --  The Datum is the construction element. These include
-        -- points, lines, axes and planes. The object brings
-        -- together topological shapes. The Relation includes
-        -- dimensions and constraints. When the object is of an
-        -- unknown type, the None type is declared.
-    
+    KOI_Relation,
+    KOI_Dimension;
+    --- Purpose: Declares the type of Interactive Object. 
+    -- This is one of the following:
+    -- -   the Datum
+    -- -   the Object
+    -- -   the Relation
+    -- -   the Dimension
+    -- -   the None type.
+    -- The Datum is the construction element. These include
+    -- points, lines, axes and planes. The object brings
+    -- together topological shapes. The Relation includes
+    -- dimensions and constraints. The Dimension includes
+    -- length, radius, diameter and angle dimensions.
+    -- When the object is of an unknown type, the None
+    -- type is declared.
+
     enumeration ClearMode is
     CM_All,
     CM_Interactive,
@@ -276,7 +272,7 @@ is
         -- for example, are only created for the selection
         -- process. By means of these enumerations, they can
         -- be cleared from local context.
-        
+
     enumeration KindOfUnit is 
     TOU_LENGTH,
     TOU_SURFACE,
@@ -286,19 +282,19 @@ is
     TOU_MASS,
     TOU_FORCE,
     TOU_TIME;
-        ---Purpose: Declares the type of Interactive Object unit.
-        
+    ---Purpose: Declares the type of Interactive Object unit.
+
     enumeration TypeOfAxis is TOAX_Unknown,TOAX_XAxis,TOAX_YAxis,TOAX_ZAxis;
-        ---Purpose: Declares the type of axis.
-        
+    ---Purpose: Declares the type of axis.
+
     enumeration TypeOfPlane is TOPL_Unknown,TOPL_XYPlane,TOPL_XZPlane,TOPL_YZPlane;
-        ---Purpose: Declares the type of plane.
+     ---Purpose: Declares the type of plane.
     enumeration TypeOfDist is TOD_Unknown,TOD_Horizontal,TOD_Vertical;
----Purpose: To declare the type of distance.
-    
+    ---Purpose: To declare the type of distance.
+
     enumeration TypeOfAttribute is 
     TOA_Line,
-    TOA_Angle,
+    TOA_Dimension,
     TOA_Wire,
     TOA_Plane,
     TOA_Vector,
@@ -312,19 +308,25 @@ is
     TOA_FirstAxis,
     TOA_SecondAxis,
     TOA_ThirdAxis;
-    
-    enumeration StandardDatum is SD_None,SD_Point,SD_Axis,SD_Trihedron,SD_PlaneTrihedron,SD_Line,SD_Circle,SD_Plane;
-       --- Purpose: Declares the type of standard datum of an Interactive Object. 
 
--- New ------------------------------------------------
+    enumeration StandardDatum is SD_None,SD_Point,SD_Axis,SD_Trihedron,SD_PlaneTrihedron,SD_Line,SD_Circle,SD_Plane;
+    --- Purpose: Declares the type of standard datum of an Interactive Object. 
 
     enumeration KindOfSurface is KOS_Plane, KOS_Cylinder, KOS_Cone, KOS_Sphere, KOS_Torus,
-               KOS_Revolution, KOS_Extrusion, KOS_OtherSurface;
--------------------------------------------------------    
-   
+                                 KOS_Revolution, KOS_Extrusion, KOS_OtherSurface;
+
+-- Enumerations for dimensions management --
+
+    enumeration DisplaySpecialSymbol is DSS_No, DSS_Before, DSS_After;
+    ---Purpose: Specifies dimension special symbol display options
+
+    enumeration DimensionSelectionMode is DSM_All, DSM_Line, DSM_Text;
+    ---Purpose: Specifies dimension selection modes.
+
     class Triangulation;
 
-    class TexturedShape;
+    imported ColoredShape;
+    imported TexturedShape;
 
     class Drawer;
     
@@ -358,9 +360,6 @@ is
     
     ---Category: Object of type Shape
     class Shape;                         --signature 0
-    class ConnectedShape;                --signature 1
-    class MultipleConnectedShape;        --signature 2        
-
 
 
     ---Category: General Objects
@@ -375,10 +374,10 @@ is
     deferred class EllipseRadiusDimension; 
     class MaxRadiusDimension; 
     class MinRadiusDimension; 
-    class LengthDimension;
-    class AngleDimension;
-    class RadiusDimension;
-    class DiameterDimension;
+    imported LengthDimension;
+    imported AngleDimension;
+    imported RadiusDimension;
+    imported DiameterDimension;
     class Chamf2dDimension;
     class Chamf3dDimension;
     class OffsetDimension;
@@ -462,29 +461,56 @@ is
         ---Purpose:
         -- Returns the nearest point in a shape. This is used by
         -- several classes in calculation of dimensions.
-    
+
+    Nearest (theLine : Lin from gp;
+             thePoint  : Pnt from gp)
+    returns Pnt from gp;
+    ---Purpose:
+    -- @return the nearest point on the line.
+
+    Nearest (theCurve        : Curve from Geom;
+             thePoint        : Pnt from gp;
+             theFirstPoint     : Pnt from gp;
+             theLastPoint      : Pnt from gp;
+             theNearestPoint : out Pnt from gp)
+    returns Boolean from Standard;
+    ---Purpose:
+    -- For the given point finds nearest point on the curve,
+    -- @return TRUE if found point is belongs to the curve
+    -- and FALSE otherwise.
+
     Farest( aShape : Shape from TopoDS;
             aPoint : Pnt from gp )
     returns Pnt from gp;
 
-    ComputeGeometry(anEdge   : Edge from TopoDS;
-                   aCurve   : out Curve from Geom;
-                   FirstPnt : out Pnt from gp;
-                   LastPnt  : out Pnt from gp)
+    ComputeGeometry (theEdge     : Edge from TopoDS;
+                     theCurve    : out Curve from Geom;
+                     theFirstPnt : out Pnt from gp;
+                     theLastPnt  : out Pnt from gp)
     ---Purpose: Used by 2d Relation only
     --          Computes the 3d geometry of <anEdge> in the current WorkingPlane
     --          and the extremities if any
-    --          Return TRUE if ok
+    --          Return TRUE if ok.
     returns Boolean  from Standard;
-    
-    ComputeGeometry(anEdge   : Edge from TopoDS;
-                   aCurve   : out Curve from Geom;
-                   FirstPnt : out Pnt from gp;
-                   LastPnt  : out Pnt from gp;
-                   extCurve : out Curve from Geom;
-                   isinfinite: out Boolean from Standard;
-                   isOnPlane : out Boolean from Standard;      
-                   aPlane   : Plane from Geom)
+
+    ComputeGeometry (theEdge       : Edge from TopoDS;
+                     theCurve      : out Curve from Geom;
+                     theFirstPnt   : out Pnt from gp;
+                     theLastPnt    : out Pnt from gp;
+                     theIsInfinite : out Boolean from Standard)
+    ---Purpose: Used by dimensions only.
+    --          Computes the 3d geometry of <anEdge>.
+    --          Return TRUE if ok.
+    returns Boolean  from Standard;
+
+    ComputeGeometry (theEdge       : Edge from TopoDS;
+                     theCurve      : out Curve from Geom;
+                     theFirstPnt   : out Pnt from gp;
+                     theLastPnt    : out Pnt from gp;
+                     theExtCurve   : out Curve from Geom;
+                     theIsInfinite : out Boolean from Standard;
+                     theIsOnPlane  : out Boolean from Standard;
+                     thePlane      : Plane from Geom)
     ---Purpose: Used by 2d Relation only
     --          Computes the 3d geometry of <anEdge> in the current WorkingPlane
     --          and the extremities if any.
@@ -492,39 +518,51 @@ is
     --          the not projected curve associated to <anEdge>.
     --          If <anEdge> is infinite, <isinfinite> = true and the 2
     --          parameters <FirstPnt> and <LastPnt> have no signification.
-    --          Return TRUE if ok
+    --          Return TRUE if ok.
     returns Boolean from Standard;
-    
-    ComputeGeometry     (anEdge1   : Edge from TopoDS;
-                        anEdge2   : Edge from TopoDS;
-                        aCurve1   : out Curve from Geom;
-                        aCurve2   : out Curve from Geom;
-                        FirstPnt1 : out Pnt from gp;
-                        LastPnt1  : out Pnt from gp;
-                        FirstPnt2 : out Pnt from gp;
-                        LastPnt2  : out Pnt from gp;
-                        aPlane    : Plane from Geom)
+
+    ComputeGeometry (theFirstEdge   : Edge from TopoDS;
+                     theSecondEdge  : Edge from TopoDS;
+                     theFirstCurve  : out Curve from Geom;
+                     theSecondCurve : out Curve from Geom;
+                     theFirstPnt1   : out Pnt from gp;
+                     theLastPnt1    : out Pnt from gp;
+                     theFirstPnt2   : out Pnt from gp;
+                     theLastPnt2    : out Pnt from gp;
+                     thePlane       : Plane from Geom)
     ---Purpose: Used by 2d Relation only
     --          Computes the 3d geometry of <anEdge> in the current WorkingPlane
     --          and the extremities if any
-    --          Return TRUE if ok
+    --          Return TRUE if ok.
     returns Boolean from Standard;
 
+    ComputeGeometry (theFirstEdge   : Edge from TopoDS;
+                     theSecondEdge  : Edge from TopoDS;
+                     theFirstCurve  : out Curve from Geom;
+                     theSecondCurve : out Curve from Geom;
+                     theFirstPnt1   : out Pnt from gp;
+                     theLastPnt1    : out Pnt from gp;
+                     theFirstPnt2   : out Pnt from gp;
+                     theLastPnt2    : out Pnt from gp;
+                     theIsinfinite1 : out Boolean from Standard;
+                     theIsinfinite2 : out Boolean from Standard)
+    ---Purpose: Used  by  dimensions  only.Computes  the  3d geometry
+    --          of<anEdge1> and <anEdge2> and checks if they are infinite.
+    returns Boolean from Standard;
 
-    ComputeGeometry    (anEdge1   : Edge from TopoDS;
-                       anEdge2   : Edge from TopoDS;
-                       indexExt  : out Integer from Standard;
-                       aCurve1   : out Curve from Geom;
-                       aCurve2   : out Curve from Geom;
-                       FirstPnt1 : out Pnt from gp;
-                       LastPnt1  : out Pnt from gp;
-                       FirstPnt2 : out Pnt from gp;
-                       LastPnt2  : out Pnt from gp;
-                       ExtCurve  : out Curve from Geom;
-                       isinfinite1 : out Boolean from Standard;
-                       isinfinite2 : out Boolean from Standard;                        
-                       aPlane    : Plane from Geom)
-                       
+    ComputeGeometry (theFirstEdge   : Edge from TopoDS;
+                     theSecondEdge  : Edge from TopoDS;
+                     theExtIndex    : out Integer from Standard;
+                     theFirstCurve  : out Curve from Geom;
+                     theSecondCurve : out Curve from Geom;
+                     theFirstPnt1   : out Pnt from gp;
+                     theLastPnt1    : out Pnt from gp;
+                     theFirstPnt2   : out Pnt from gp;
+                     theLastPnt2    : out Pnt from gp;
+                     theExtCurve    : out Curve from Geom;
+                     theIsinfinite1 : out Boolean from Standard;
+                     theIsinfinite2 : out Boolean from Standard;
+                     thePlane       : Plane from Geom)
     ---Purpose: Used  by  2d Relation  only Computes  the  3d geometry
     --          of<anEdge1> and <anEdge2> in the current Plane and the
     --          extremities if any.   Return in ExtCurve  the 3d curve
@@ -536,102 +574,78 @@ is
     --          significant.  Return TRUE if ok
     returns Boolean from Standard;
 
-    ComputeGeomCurve   (aCurve    : in out Curve from Geom;
-                       first1    : Real from Standard;
-                       last1     : Real from Standard;
-                       FirstPnt1 : out Pnt from gp;
-                       LastPnt1  : out Pnt from gp;
-                       aPlane    : Plane from Geom;
-                       isOnPlane: out Boolean from Standard)
-                       
+    ComputeGeomCurve (aCurve    : in out Curve from Geom;
+                      first1    : Real from Standard;
+                      last1     : Real from Standard;
+                      FirstPnt1 : out Pnt from gp;
+                      LastPnt1  : out Pnt from gp;
+                      aPlane    : Plane from Geom;
+                      isOnPlane: out Boolean from Standard)
     ---Purpose: Checks if aCurve belongs to aPlane; if not, projects aCurve in aPlane 
     --          and returns aCurve;
     --          Return TRUE if ok
     returns Boolean from Standard;
 
-    ComputeGeometry(aVertex  : Vertex      from TopoDS;
-                   point    : out Pnt     from gp;
-                   aPlane   : Plane       from Geom;
-                   isOnPlane: out Boolean from Standard)
+    ComputeGeometry (aVertex  : Vertex      from TopoDS;
+                     point    : out Pnt     from gp;
+                     aPlane   : Plane       from Geom;
+                     isOnPlane: out Boolean from Standard)
     returns Boolean from Standard;
-    
 
-    GetPlaneFromFace( aFace     : Face            from TopoDS;
-                     aPlane    : out Pln         from gp;
-                     aSurf     : out Surface     from Geom;
-                     aSurfType : out KindOfSurface from AIS;
-                     Offset    : out Real from Standard )
+    GetPlaneFromFace (aFace     : Face from TopoDS;
+                      aPlane    : out Pln         from gp;
+                      aSurf     : out Surface     from Geom;
+                      aSurfType : out KindOfSurface from AIS;
+                      Offset    : out Real from Standard)
     returns Boolean from Standard;
     ---Purpose: Tryes to get Plane from Face.  Returns Surface of Face
     --          in aSurf.  Returns Standard_True  and Plane of Face in
     --           aPlane in following  cases:
     --          Face is Plane, Offset of Plane,
     --                  Extrusion of Line  and Offset of  Extrusion of Line
-    --         Returns pure type of Surface which can be:
-    --         Plane, Cylinder, Cone, Sphere, Torus, 
-    --         SurfaceOfRevolution, SurfaceOfExtrusion
-
-    InitFaceLength(  aFace         :  Face                from  TopoDS; 
-                    aPlane        :  out  Pln            from  gp; 
-                    aSurface      :  out  Surface        from  Geom; 
-                    aSurfaceType  :  out  KindOfSurface  from  AIS; 
-                    anOffset      :  out  Real           from  Standard  ); 
-                    
-    ComputeLengthBetweenPlanarFaces( FirstFace     : Face        from TopoDS;
-                                    SecondFace    : Face        from TopoDS;
-                                    Plane1        : Pln         from gp;
-                                    Plane2        : Pln         from gp;
-                                    Value         : out Real    from Standard;
-                                    FirstAttach   : out Pnt     from gp ;
-                                    SecondAttach  : out Pnt     from gp ;
-                                    DirAttach     : out Dir     from gp ;
-                                    AutomaticPos  : Boolean     from Standard;
-                                    Position      : in out Pnt  from gp);
-    
-     ComputeLengthBetweenCurvilinearFaces( FirstFace      : Face from TopoDS;
-                                          SecondFace     : Face from TopoDS;
-                                          FirstSurf      : in out Surface from Geom;
-                                          SecondSurf     : in out Surface from Geom;
-                                          AutomaticPos   : Boolean from Standard; 
-                                          Value          : out Real from Standard;
-                                          Position       : out Pnt from gp;
-                                          FirstAttach    : out Pnt from gp;
-                                          SecondAttach   : out Pnt from gp;
-                                          DirAttach      : out Dir from gp );
-                                         
-     ComputeAngleBetweenPlanarFaces( FirstFace    : Face from TopoDS;
-                                    SecondFace   : Face from TopoDS;
-                                    Surf2        : Surface from Geom;
-                                    Axis         : Ax1 from gp;
-                                    Value        : Real from Standard;
-                                    AutomaticPos : Boolean from Standard; 
-                                    Position     : out Pnt from gp;
-                                    Center       : out Pnt from gp;
-                                    FirstAttach  : out Pnt from gp;
-                                    SecondAttach : out Pnt from gp;
-                                    FirstDir     : out Dir from gp;
-                                    SecondDir    : out Dir from gp);
-    ---Purpose: Computes geometric   parameters for planar   faces for
-    --          Angular dimensions
-     ComputeAngleBetweenCurvilinearFaces( FirstFace    : Face from TopoDS;
-                                         SecondFace   : Face from TopoDS;
-                                         FirstSurf    : Surface from Geom;
-                                         SecondSurf   : Surface from Geom;
-                                         FirstSurfType  : KindOfSurface from AIS;
-                                         SecondSurfType : KindOfSurface from AIS;
-                                         Axis         : Ax1 from gp;
-                                         Value        : Real from Standard;
-                                         AutomaticPos : Boolean from Standard; 
-                                         Position     : out Pnt from gp;
-                                         Center       : out Pnt from gp;
-                                         FirstAttach  : out Pnt from gp;
-                                         SecondAttach : out Pnt from gp;
-                                         FirstDir     : out Dir from gp;
-                                         SecondDir    : out Dir from gp;
-                                         Plane        : out Plane from Geom );
-    ---Purpose: Computes geometric   parameters for curvilinear   faces for
-    --          Angular dimensions
+    --          Returns pure type of Surface which can be:
+    --          Plane, Cylinder, Cone, Sphere, Torus, 
+    --          SurfaceOfRevolution, SurfaceOfExtrusion
+
+   InitFaceLength (aFace        : Face from TopoDS;
+                   aPlane       : out Pln from gp;
+                   aSurface     : out Surface from Geom;
+                   aSurfaceType : out KindOfSurface from AIS;
+                   anOffset     : out Real from Standard );
+
+     InitLengthBetweenCurvilinearFaces (theFirstFace    : Face from TopoDS;
+                                        theSecondFace   : Face from TopoDS;
+                                        theFirstSurf    : in out Surface from Geom;
+                                        theSecondSurf   : in out Surface from Geom;
+                                        theFirstAttach  : out Pnt from gp;
+                                        theSecondAttach : out Pnt from gp;
+                                        theDirOnPlane   : out Dir from gp);
+     ---Purpose: Finds attachment points on two curvilinear faces for length dimension.
+     -- @param thePlaneDir [in] the direction on the dimension plane to
+     -- compute the plane automatically. It will not be taken into account if
+     -- plane is defined by user.
+
+    InitAngleBetweenPlanarFaces (theFirstFace      : Face from TopoDS;
+                                 theSecondFace     : Face from TopoDS;
+                                 theCenter          : out Pnt from gp;
+                                 theFirstAttach     : out Pnt from gp;
+                                 theSecondAttach    : out Pnt from gp;
+                                 theIsFirstPointSet : Boolean from Standard = Standard_False)
+    returns Boolean from Standard;
+    ---Purpose: Finds three points for the angle dimension between
+    -- two planes.
+
+    InitAngleBetweenCurvilinearFaces (theFirstFace      : Face from TopoDS;
+                                      theSecondFace     : Face from TopoDS;
+                                      theFirstSurfType   : KindOfSurface from AIS;
+                                      theSecondSurfType  : KindOfSurface from AIS;
+                                      theCenter          : out Pnt from gp;
+                                      theFirstAttach     : out Pnt from gp;
+                                      theSecondAttach    : out Pnt from gp;
+                                      theIsFirstPointSet : Boolean from Standard = Standard_False)
+    returns Boolean from Standard;
+    ---Purpose: Finds three points for the angle dimension between
+    -- two curvilinear surfaces.
 
     ProjectPointOnPlane( aPoint : Pnt from gp; aPlane : Pln from gp )
     returns Pnt from gp;
@@ -665,8 +679,8 @@ is
     ---Purpose:  computes  length  of  ellipse  arc  in  parametric  units   
      
     
-    ComputeProjEdgePresentation(aPres    : mutable Presentation from Prs3d; 
-                               aDrawer  : mutable Drawer       from AIS;        
+    ComputeProjEdgePresentation(aPres    : Presentation from Prs3d; 
+                               aDrawer  : Drawer       from AIS;        
                                anEdge   : Edge                 from TopoDS;
                                ProjCurve: Curve                from Geom;
                                FirstP   : Pnt                  from gp;
@@ -676,8 +690,8 @@ is
                                aProjTOL : TypeOfLine           from Aspect   = Aspect_TOL_DASH;
                                aCallTOL : TypeOfLine           from Aspect   = Aspect_TOL_DOT);
     
-    ComputeProjVertexPresentation(aPres    : mutable Presentation from Prs3d; 
-                                 aDrawer  : mutable Drawer       from AIS;        
+    ComputeProjVertexPresentation(aPres    : Presentation from Prs3d; 
+                                 aDrawer  : Drawer       from AIS;        
                                  aVertex  : Vertex               from TopoDS;
                                  ProjPoint: Pnt                  from gp;
                                          aColor   : NameOfColor          from Quantity = Quantity_NOC_PURPLE;