summaryrefslogtreecommitdiff
path: root/src/Prs2d/Prs2d_Angle.cdl
blob: 3fd4f903aacb04860efdda0877ab234d040cd497 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
-- File     : Prs2d_Angle.cdl
-- Created  : February  2000
-- Author   : Tanya COOL
---Copyright: Matra Datavision 2000

class Angle from Prs2d inherits Dimension from Prs2d

 ---Purpose: Constructs the primitive Angle

uses

	Drawer		   from Graphic2d,
	GraphicObject	   from Graphic2d,
	Pnt2d              from gp,
	Length             from Quantity,
	ExtendedString     from TCollection,
	ArrowSide          from Prs2d,
	TypeOfArrow        from Prs2d,
        FStream            from Aspect 

raises

	CircleDefinitionError	from Graphic2d

is
	Create( aGraphicObject: GraphicObject  from Graphic2d;
	        anAttachPnt1  : Pnt2d          from gp;
		anAttachPnt2  : Pnt2d          from gp;
            	anAttachPnt3  : Pnt2d          from gp;
            	aRadius       : Length         from Quantity;
	        aText         : ExtendedString from TCollection;
	        aTxtScale     : Real           from Standard = 3.0;
	        anArrAngle    : Real           from Standard = 15.0;
	        anArrLength   : Real           from Standard = 10.0;
	        anArrType     : TypeOfArrow    from Prs2d = Prs2d_TOA_OPENED;
	        anArrow       : ArrowSide      from Prs2d = Prs2d_AS_BOTHAR;
	        IsReverseArrow: Boolean        from Standard = Standard_False )

	returns mutable Angle from Prs2d;

	---Purpose: create an angle:
    	--          between the line defined by the points
    	--          anAttachtPnt1 and anAttachPnt2 and
    	--          the line defined by the points
    	--          anAttachPnt1 and anAttachPnt3
    	--          Radius of this angle is the distance 
    	--          between <anAttachPnt1> and <anOffsetPoint> points.
    	--          <anArrAngle> in degree
   
        --------------------------------------
	-- Category: Inquire methods
	--------------------------------------
    
    Values( me; aPnt1, aPnt2, aPnt3: out Pnt2d from gp; 
            aRad: out Length from Quantity ); 
    	---Level: Internal
    	---Purpose: allows to get the properties of the angle
    
    CalcTxtPos(me:mutable; theFromAbs: Boolean 
    	        from Standard=Standard_False) 
	---C++: inline
	is redefined protected;
    
	--------------------------------------
	-- Category: Draw and Pick
	--------------------------------------

    Draw( me : mutable; aDrawer: Drawer from Graphic2d )
	is static protected;
	---Level: Internal
	---Purpose: Draws the angle <me>.

    DrawElement( me : mutable; aDrawer: Drawer from Graphic2d;
                 anIndex: Integer from Standard)
        is redefined protected;
    	---Level: Internal
    	---Purpose: Draws element <anIndex> of the angle <me>.

    DrawVertex( me : mutable; aDrawer: Drawer from Graphic2d;
                anIndex: Integer from Standard)
        is redefined protected;
    	---Level: Internal
    	---Purpose: Draws vertex <anIndex> of the angle <me>.

    Pick( me : mutable; X, Y: ShortReal from Standard;
	  aPrecision: ShortReal from Standard;
	  aDrawer: Drawer from Graphic2d)
	returns Boolean from Standard
	is static protected;
	---Level: Internal
	---Purpose: Returns Standard_True if the angle <me> is picked,
	--	    Standard_False if not.

    Save( me; aFStream: in out FStream from Aspect ) is virtual;
														
fields
 
	myCentX          : ShortReal         from Standard;
	myCentY          : ShortReal         from Standard;
	myRad            : ShortReal         from Standard;
        myFAngle         : ShortReal         from Standard;
    	mySAngle         : ShortReal         from Standard;
	
end Angle from Prs2d;