summaryrefslogtreecommitdiff
path: root/src/Graphic2d/Graphic2d_ViewMapping.cdl
blob: 7b199b5ce0757b1c448ca970b9b4b081fd13d347 (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

-- File:	Graphic2d_ViewMapping.cdl
-- Created:	Tue Jul 13 09:19:31 1993
-- Author:	Jean Louis FRENKEL
--		<jlf@stylox>
---Copyright:	 Matra Datavision 1993

class ViewMapping from Graphic2d inherits TShared from MMgt

	---Version:

	---Purpose: A ViewMapping defines a square region of the model
	--	    space from an origin point and a size in meters.
	--	    This square region is called the "map from".

	---Keywords:
	---Warning:
	---References:

uses
	Length from Quantity,
	Factor from Quantity

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

	Create
	returns mutable ViewMapping from Graphic2d;
	---Level: Public
	---Purpose: Creates a view mapping with the following default
	--	    values :
	--		XCenter	= 0.
	--		YCenter	= 0.
	--		Size	= 1.
	---Category: Constructors

	---------------------------------------------------
	-- Category: Methods to modify the class definition
	---------------------------------------------------

	SetViewMapping (me: mutable;
		aXCenter, aYCenter: Length from Quantity;
		aSize: Length from Quantity)
	is static;
	---Level: Public
	---Purpose: Sets new values for the view mapping <me>.
	---Category: Methods to modify the class definition

	SetCenter (me: mutable;
		aXCenter, aYCenter: Length from Quantity)
	is static;
	---Level: Public
	---Purpose: Sets new values for the view mapping center.
	---Category: Methods to modify the class definition

	SetSize (me: mutable;
		aSize: Length from Quantity)
	is static;
	---Level: Public
	---Purpose: Sets new value for the view mapping size.

	SetViewMappingDefault (me: mutable)
	is static;
	---Level: Public
	---Purpose: Saves the current mapping which will be the
	--	    reference value for the reset of the mapping
	--	    done by the ViewmappingReset method.
	---Category: Methods to modify the class definition

	ViewMappingReset (me: mutable)
	is static;
	---Level: Public
	---Purpose: Sets the value of the mapping to be the same as
	--	    the mapping saved by the SetViewMappingDefault method.
	---Category: Methods to modify the class definition

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

	ViewMapping (me; XCenter, YCenter, Size: out Length from Quantity)
	is static;
	---Level: Public
	---Purpose: Returns the current mapping of the view <me>.
	---Category: Inquire methods

	Center (me; XCenter, YCenter: out Length from Quantity)
	is static;
	---Level: Public
	---Purpose: Returns the current center of the view <me>.
	---Category: Inquire methods

	ViewMappingDefault (me;
		XCenter, YCenter, Size: out Length from Quantity)
	is static;
	---Level: Public
	---Purpose: Returns the current reset mapping of the view <me>.
	---Category: Inquire methods

	Zoom (me)
	returns Factor from Quantity
	is static;
	---Level: Public
	---Purpose: Returns the zoom factor (CurrentSize/InitialSize).
	---Category: Inquire methods

fields
	myXCenter:	Length from Quantity;
	myYCenter:	Length from Quantity;
	mySize:		Length from Quantity;

	myInitialXCenter:	Length from Quantity;
	myInitialYCenter:	Length from Quantity;
	myInitialSize:		Length from Quantity;

end ViewMapping from Graphic2d;