0023663: Removing 2D viewer library
[occt.git] / src / Graphic2d / Graphic2d_ViewMapping.cdl
1 -- Created on: 1993-07-13
2 -- Created by: Jean Louis FRENKEL
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
10 --
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 --
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
20
21
22
23 class ViewMapping from Graphic2d inherits TShared from MMgt
24
25         ---Version:
26
27         ---Purpose: A ViewMapping defines a square region of the model
28         --          space from an origin point and a size in meters.
29         --          This square region is called the "map from".
30
31         ---Keywords:
32         ---Warning:
33         ---References:
34
35 uses
36         Length from Quantity,
37         Factor from Quantity
38
39 is
40         -------------------------
41         -- Category: Constructors
42         -------------------------
43
44         Create
45         returns mutable ViewMapping from Graphic2d;
46         ---Level: Public
47         ---Purpose: Creates a view mapping with the following default
48         --          values :
49         --              XCenter = 0.
50         --              YCenter = 0.
51         --              Size    = 1.
52         ---Category: Constructors
53
54         ---------------------------------------------------
55         -- Category: Methods to modify the class definition
56         ---------------------------------------------------
57
58         SetViewMapping (me: mutable;
59                 aXCenter, aYCenter: Length from Quantity;
60                 aSize: Length from Quantity)
61         is static;
62         ---Level: Public
63         ---Purpose: Sets new values for the view mapping <me>.
64         ---Category: Methods to modify the class definition
65
66         SetCenter (me: mutable;
67                 aXCenter, aYCenter: Length from Quantity)
68         is static;
69         ---Level: Public
70         ---Purpose: Sets new values for the view mapping center.
71         ---Category: Methods to modify the class definition
72
73         SetSize (me: mutable;
74                 aSize: Length from Quantity)
75         is static;
76         ---Level: Public
77         ---Purpose: Sets new value for the view mapping size.
78
79         SetViewMappingDefault (me: mutable)
80         is static;
81         ---Level: Public
82         ---Purpose: Saves the current mapping which will be the
83         --          reference value for the reset of the mapping
84         --          done by the ViewmappingReset method.
85         ---Category: Methods to modify the class definition
86
87         ViewMappingReset (me: mutable)
88         is static;
89         ---Level: Public
90         ---Purpose: Sets the value of the mapping to be the same as
91         --          the mapping saved by the SetViewMappingDefault method.
92         ---Category: Methods to modify the class definition
93
94         ----------------------------
95         -- Category: Inquire methods
96         ----------------------------
97
98         ViewMapping (me; XCenter, YCenter, Size: out Length from Quantity)
99         is static;
100         ---Level: Public
101         ---Purpose: Returns the current mapping of the view <me>.
102         ---Category: Inquire methods
103
104         Center (me; XCenter, YCenter: out Length from Quantity)
105         is static;
106         ---Level: Public
107         ---Purpose: Returns the current center of the view <me>.
108         ---Category: Inquire methods
109
110         ViewMappingDefault (me;
111                 XCenter, YCenter, Size: out Length from Quantity)
112         is static;
113         ---Level: Public
114         ---Purpose: Returns the current reset mapping of the view <me>.
115         ---Category: Inquire methods
116
117         Zoom (me)
118         returns Factor from Quantity
119         is static;
120         ---Level: Public
121         ---Purpose: Returns the zoom factor (CurrentSize/InitialSize).
122         ---Category: Inquire methods
123
124 fields
125         myXCenter:      Length from Quantity;
126         myYCenter:      Length from Quantity;
127         mySize:         Length from Quantity;
128
129         myInitialXCenter:       Length from Quantity;
130         myInitialYCenter:       Length from Quantity;
131         myInitialSize:          Length from Quantity;
132
133 end ViewMapping from Graphic2d;