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
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.
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.
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.
23 class ViewMapping from Graphic2d inherits TShared from MMgt
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".
40 -------------------------
41 -- Category: Constructors
42 -------------------------
45 returns mutable ViewMapping from Graphic2d;
47 ---Purpose: Creates a view mapping with the following default
52 ---Category: Constructors
54 ---------------------------------------------------
55 -- Category: Methods to modify the class definition
56 ---------------------------------------------------
58 SetViewMapping (me: mutable;
59 aXCenter, aYCenter: Length from Quantity;
60 aSize: Length from Quantity)
63 ---Purpose: Sets new values for the view mapping <me>.
64 ---Category: Methods to modify the class definition
66 SetCenter (me: mutable;
67 aXCenter, aYCenter: Length from Quantity)
70 ---Purpose: Sets new values for the view mapping center.
71 ---Category: Methods to modify the class definition
74 aSize: Length from Quantity)
77 ---Purpose: Sets new value for the view mapping size.
79 SetViewMappingDefault (me: mutable)
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
87 ViewMappingReset (me: mutable)
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
94 ----------------------------
95 -- Category: Inquire methods
96 ----------------------------
98 ViewMapping (me; XCenter, YCenter, Size: out Length from Quantity)
101 ---Purpose: Returns the current mapping of the view <me>.
102 ---Category: Inquire methods
104 Center (me; XCenter, YCenter: out Length from Quantity)
107 ---Purpose: Returns the current center of the view <me>.
108 ---Category: Inquire methods
110 ViewMappingDefault (me;
111 XCenter, YCenter, Size: out Length from Quantity)
114 ---Purpose: Returns the current reset mapping of the view <me>.
115 ---Category: Inquire methods
118 returns Factor from Quantity
121 ---Purpose: Returns the zoom factor (CurrentSize/InitialSize).
122 ---Category: Inquire methods
125 myXCenter: Length from Quantity;
126 myYCenter: Length from Quantity;
127 mySize: Length from Quantity;
129 myInitialXCenter: Length from Quantity;
130 myInitialYCenter: Length from Quantity;
131 myInitialSize: Length from Quantity;
133 end ViewMapping from Graphic2d;