Difference between revisions of "AttachCopyToView Command"

From GeoGebra Manual
Jump to: navigation, search
m (typo)
Line 4: Line 4:
 
:If ''View = 0'', a copy of given object is created. For ''View =1'' or 2 this command creates a dependent copy of given object whose size in given [[Graphics View]] is constant.
 
:If ''View = 0'', a copy of given object is created. For ''View =1'' or 2 this command creates a dependent copy of given object whose size in given [[Graphics View]] is constant.
 
{{Note|Once the copy is created, three other arguments are added to the command definition.}}
 
{{Note|Once the copy is created, three other arguments are added to the command definition.}}
;AttachCopyToView[ <Object>, <View 0|1|2>, <Corner 1>, <Corner 3>, <Offset Point> ]
+
;AttachCopyToView[ <Object>, <View 0|1|2>, <Point 1>, <Point 2>, <Scren Point 1>, <Screen Point 2> ]
:If ''View = 0'', a copy of given object is created. For ''View =1'' or 2 this command creates a dependent copy of given object whose size in given [[Graphics View]] transformed using affine transform that works as follows:
+
:If ''View = 0'', a copy of given object is created. For ''View =1'' or 2 this command creates a dependent copy of given object whose size in given [[Graphics View]] transformed using affine transform that maps Point 1 to a point whose screen coordinates (in pixels) are equal to Screen Point 1 and Point 2 to a point with screen coordinates equal to Screen Point 2.
* lines x=x(Corner 1) and y=y(Corner 3) are mapped to left and upper edges of the view respectively
+
{{Example| If the first Graphics View is active, AttachToView[Polygon[(0,0),(1,0),(1,1),(0,1)],1,(0,0),(1,1),(0,0),(100,100)] creates a 100px x 100px square in the top left corner of the Graphics View.}}
* lines x=x(Corner 3) and y=y(Corner 1) are mapped to parallel lines through a point whose coordinates in pixels are equal to coordinates of ''Offset Point''.
 
{{Example| If the first Graphics View is active, AttachToView[Polygon[(0,0),(1,0),(1,1),(0,1)],1,(0,0),(1,1),(100,100)] creates a 100px x 100px square in the top left corner of the Graphics View.}}
 
When using this syntax, the resulting object is created in active View and you may have to adjust it's visibility in the other Graphics View using the [[Properties Dialog]].
 

Revision as of 16:42, 12 July 2012


AttachCopyToView[ <Object>, <View 0|1|2> ]
If View = 0, a copy of given object is created. For View =1 or 2 this command creates a dependent copy of given object whose size in given Graphics View is constant.
Note: Once the copy is created, three other arguments are added to the command definition.
AttachCopyToView[ <Object>, <View 0|1|2>, <Point 1>, <Point 2>, <Scren Point 1>, <Screen Point 2> ]
If View = 0, a copy of given object is created. For View =1 or 2 this command creates a dependent copy of given object whose size in given Graphics View transformed using affine transform that maps Point 1 to a point whose screen coordinates (in pixels) are equal to Screen Point 1 and Point 2 to a point with screen coordinates equal to Screen Point 2.
Example: If the first Graphics View is active, AttachToView[Polygon[(0,0),(1,0),(1,1),(0,1)],1,(0,0),(1,1),(0,0),(100,100)] creates a 100px x 100px square in the top left corner of the Graphics View.

Comments

Note: All parts of <object> are mapped, even if some parts of <object> lie outside the rectangle defined by Corner 1 and Corner 3.


© 2024 International GeoGebra Institute