summaryrefslogtreecommitdiff
path: root/src/Graphic2d/Graphic2d_Marker.cdl
blob: 642a13376f4313da1becbfdd03aa47cba56838f9 (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120

-- File:	Graphic2d_Marker.cdl
-- Created:	Jeudi 26 Janvier 1995
-- Author:	CAL
-- Modified: TCL G002A, 28-11-00, new section "inquire methods"
-- SAV 04/07/02 : DrawVertex() redefined.

---Copyright:	Matra Datavision 1995

class Marker from Graphic2d inherits Line from Graphic2d

	---Version:

	---Purpose: The primitive Marker

	---Keywords: Primitive, Marker
	---Warning:
	---References:

uses
	Drawer		from Graphic2d,
	GraphicObject	from Graphic2d,
	Length		from Quantity,
	PlaneAngle	from Quantity, 
	FStream         from Aspect,
	IFStream	from Aspect


raises
	MarkerDefinitionError	from Graphic2d

is
	-------------------------
	-- Category: Constructors
	-------------------------

	Create (aGraphicObject: GraphicObject from Graphic2d;
		X, Y: Length from Quantity)
	returns mutable Marker from Graphic2d;
	---Level: Public
	---Purpose: Creates a pixel point marker at position <X>,<Y>
	---Category: Constructors

	Create (aGraphicObject: GraphicObject from Graphic2d;
		anIndex: Integer from Standard;
		X, Y: Length from Quantity;
		aWidth: Length from Quantity;
		anHeight: Length from Quantity;
		anAngle: PlaneAngle from Quantity = 0.0)
	returns mutable Marker from Graphic2d
	---Level: Public
	---Purpose: Creates the predefined marker index <anIndex> 
	--	    at position <X>,<Y> and size <aWidth>,<aHeight>.
	--	    Angle is measured counterclockwise with 0 radian
	--	    at 3 o'clock.
	---Category: Constructors
	---Trigger: Raises MarkerDefinitionError if the
	--	    marker index is <= 0 or undefined in the MarkMap,
	--          or the marker size <aWidth,anHeight> is null.
	raises MarkerDefinitionError from Graphic2d;

	--------------------------
	-- Category: Draw and Pick
	--------------------------

	Draw (me : mutable; aDrawer: Drawer from Graphic2d)
	is static protected;
	---Level: Internal
	---Purpose: Draws the marker <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 marker <me> is picked,
	--	    Standard_False if not.
	--  Warning: Checks only if the point <X>, <Y> is in the
	--	    boundary rectangle of <me>

	DrawVertex( me : mutable; aDrawer: Drawer from Graphic2d;
                    anIndex: Integer from Standard)
        is redefined protected;

     --------------------------------------
	-- Category: Inquire methods
	--------------------------------------

    Position( me; X, Y: out Length from Quantity );  
	---Level: Public
	---Purpose: returns the coordinates of the position of the marker
	
    Size( me; aW, aH: out Length from Quantity );  
	---Level: Public
	---Purpose: returns the width and height of the marker
	
	Index( me ) returns Integer from Standard;
	---Level: Public
	---Purpose: returns the index of marker in the map of markers
	
    Angle( me ) returns PlaneAngle from Quantity;
	---Level: Public
	---Purpose: returns the angle of the marker

	----------------------------------------------------------------------

	Save( me; aFStream: in out FStream from Aspect ) is virtual;
--	Retrieve( me; aIFStream: in out IFStream from AIS2D ) is virtual;

fields

	myMarkIndex: Integer from Standard;
	myX:		 ShortReal from Standard;
	myY:		 ShortReal from Standard;
	myWidth:	 ShortReal from Standard;
	myHeight:	 ShortReal from Standard;
	myAngle:	 ShortReal from Standard;

end Marker from Graphic2d;