Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
37173fd7
Commit
37173fd7
authored
Sep 21, 2011
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ge commands move, scale and rotate for selected object added, and move with absolute coordinates
parent
3c7a9b89
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
256 additions
and
117 deletions
+256
-117
src/doc/man/en_us/man_geref.dat
src/doc/man/en_us/man_geref.dat
+55
-2
src/doc/man/sv_se/man_geref.dat
src/doc/man/sv_se/man_geref.dat
+50
-1
xtt/lib/ge/src/ge_graph_command.cpp
xtt/lib/ge/src/ge_graph_command.cpp
+151
-114
No files found.
src/doc/man/en_us/man_geref.dat
View file @
37173fd7
...
...
@@ -3496,6 +3496,7 @@ create <link>gecmd_create
group <link>gecmd_group
move <link>gecmd_move
<t>move currentobject <link>gecmd_move_currentobject
<t>move selectedobject <link>gecmd_move_selectedobject
new <link>gecmd_new
select <link>gecmd_select
<t>select currentobject <link>gecmd_select_currentobject
...
...
@@ -3533,14 +3534,16 @@ set <link>gecmd_set
<t>set graphattributes <link>gecmd_set_graphattributes
rotate <link>gecmd_rotate
<t>rotate currentobject <link>gecmd_rotate_current
<t>rotate selectedobject <link>gecmd_rotate_selected
scale <link>gecmd_scale
<t>scale currentobject <link>gecmd_scale_current
<t>scale selectedobject <link>gecmd_scale_selected
save <link>gecmd_save
exit <link>gecmd_exit
quit <link>gecmd_quit
open <link>gecmd_open
show <link>gecmd_show
<t>s
cale
version <link>gecmd_show_version
<t>s
how
version <link>gecmd_show_version
</topic>
<headerlevel>
...
...
@@ -3686,14 +3689,37 @@ move
<topic>gecmd_move_currentobject
move currentobject
Move the current object.
Move the current object. The movement can be specified with relative coordinates
(x and y) or absolute coordinates (absx and absy) or combinations.
<b>Syntax
<c>ge> move currentobject /x= /y=
<c>ge> move currentobject /absx= /absy=
/x <t>Relative movement in x direction.
/y <t>Relative movement in y direction.
/absx <t>Movement to absolute coordinate in x direction.
/absy <t>Movement to absolute coordinate in y direction.
</topic>
<topic>gecmd_move_selectedobject
move selectedobject
Move the selected object. The movement can be specified with relative coordinates
(x and y) or absolute coordinates (absx and absy) or combinations.
Only one object can be selected.
<b>Syntax
<c>ge> move selectedobject /x= /y=
<c>ge> move selectedobject /absx= /absy=
/x <t>Relative movement in x direction.
/y <t>Relative movement in y direction.
/absx <t>Movement to absolute coordinate in x direction.
/absy <t>Movement to absolute coordinate in y direction.
</topic>
<topic>gecmd_new <style>function
...
...
@@ -4096,6 +4122,18 @@ Rotates the current object around the center of the object.
/angle <t>Angle in degrees that the object is rotated.
</topic>
<topic>gecmd_rotate_selected
rotate selectedobject
Rotates the selected object around the center of the object.
<b>Syntax
<c>ge> rotate selectedobject /angle=
/angle <t>Angle in degrees that the object is rotated.
</topic>
<topic>gecmd_scale
scale
</topic>
...
...
@@ -4115,6 +4153,21 @@ Scale the current object.
/y <t>y coordinate for the reference point of the scaling.
</topic>
<topic>gecmd_scale_selected
scale selectedobject
Scale the selected object.
<b>Syntax
<c>ge> scale selectedobject /scalex= /scaley= [/x= /y=]
/scalex <t>Scalefactor in x direction.
/scaley <t>Scalefactor in y direction.
/x <t>x coordinate for the reference point of the scaling.
/y <t>y coordinate for the reference point of the scaling.
</topic>
<topic>gecmd_save
save
...
...
src/doc/man/sv_se/man_geref.dat
View file @
37173fd7
...
...
@@ -3479,6 +3479,7 @@ create <link>gecmd_create
group <link>gecmd_group
move <link>gecmd_move
<t>move currentobject <link>gecmd_move_currentobject
<t>move selectedobject <link>gecmd_move_selectedobject
new <link>gecmd_new
select <link>gecmd_select
<t>select currentobject <link>gecmd_select_currentobject
...
...
@@ -3516,14 +3517,16 @@ set <link>gecmd_set
<t>set graphattributes <link>gecmd_set_graphattributes
rotate <link>gecmd_rotate
<t>rotate currentobject <link>gecmd_rotate_current
<t>rotate selectedobject <link>gecmd_rotate_selected
scale <link>gecmd_scale
<t>scale currentobject <link>gecmd_scale_current
<t>scale selectedobject <link>gecmd_scale_selected
save <link>gecmd_save
exit <link>gecmd_exit
quit <link>gecmd_quit
open <link>gecmd_open
show <link>gecmd_show
<t>s
cale
version <link>gecmd_show_version
<t>s
how
version <link>gecmd_show_version
</topic>
<headerlevel>
...
...
@@ -3672,9 +3675,28 @@ Flyttar senast skapade objekt.
<b>Syntax
<c>ge> move currentobject /x= /y=
<c>ge> move currentobject /absx= /absy=
/x <t>Förflyttning i x-led relativt tidigare position.
/y <t>Förflyttning i y-led relativt tidigare position.
/absx <t>Förflyttning i x-led till absolut position.
/absy <t>Förflyttning i y-led till absolut position.
</topic>
<topic>gecmd_move_selectedobject
move selectedobject
Flyttar utvalt objekt.
<b>Syntax
<c>ge> move selectedobject /x= /y=
<c>ge> move selectedobject /absx= /absy=
/x <t>Förflyttning i x-led relativt tidigare position.
/y <t>Förflyttning i y-led relativt tidigare position.
/absx <t>Förflyttning i x-led till absolut position.
/absy <t>Förflyttning i y-led till absolut position.
</topic>
<topic>gecmd_new <style>function
...
...
@@ -4077,6 +4099,18 @@ Roterar senast skapade objekt runt objektets mittpunkt.
/angle <t>Vinkel i grader som objektet ska roteras.
</topic>
<topic>gecmd_rotate_selected
rotate selectedobject
Roterar utvalt objekt runt objektets mittpunkt.
<b>Syntax
<c>ge> rotate selectedobject /angle=
/angle <t>Vinkel i grader som objektet ska roteras.
</topic>
<topic>gecmd_scale
scale
</topic>
...
...
@@ -4096,6 +4130,21 @@ Skalar om senast skapade objekt.
/y <t>y-koordinat för skalningens referenspunkt.
</topic>
<topic>gecmd_scale_selected
scale selectedobject
Skalar om utvalt objekt.
<b>Syntax
<c>ge> scale selectedobject /scalex= /scaley= [/x= /y=]
/scalex <t>Skalfaktor i x-led
/scaley <t>Skalfaktor i y-led.
/x <t>x-koordinat för skalningens referenspunkt.
/y <t>y-koordinat för skalningens referenspunkt.
</topic>
<topic>gecmd_save
save
...
...
xtt/lib/ge/src/ge_graph_command.cpp
View file @
37173fd7
...
...
@@ -173,7 +173,7 @@ dcli_tCmdTable graph_command_table[] = {
{
"MOVE"
,
&
graph_move_func
,
{
"dcli_arg1"
,
"/X"
,
"/Y"
,
{
"dcli_arg1"
,
"/X"
,
"/Y"
,
"/ABSX"
,
"/ABSY"
,
""
}
},
{
...
...
@@ -1457,29 +1457,41 @@ static int graph_rotate_func( void *client_data,
char
arg1_str
[
80
];
int
arg1_sts
;
arg1_sts
=
dcli_get_qualifier
(
"dcli_arg1"
,
arg1_str
,
sizeof
(
arg1_str
));
if
(
cdh_NoCaseStrncmp
(
arg1_str
,
"CURRENTOBJECT"
,
strlen
(
arg1_str
))
==
0
)
{
char
str
[
80
];
int
sts
;
float
value
;
double
angle
;
if
(
!
graph
->
current_cmd_object
)
{
arg1_sts
=
dcli_get_qualifier
(
"dcli_arg1"
,
arg1_str
,
sizeof
(
arg1_str
));
if
(
cdh_NoCaseStrncmp
(
arg1_str
,
"CURRENTOBJECT"
,
strlen
(
arg1_str
))
==
0
)
{
if
(
!
graph
->
current_cmd_object
)
{
graph
->
message
(
'E'
,
"No current object"
);
return
GE__NOCURRENT
;
}
if
(
EVEN
(
dcli_get_qualifier
(
"/ANGLE"
,
str
,
sizeof
(
str
))))
{
}
else
if
(
cdh_NoCaseStrncmp
(
arg1_str
,
"SELECTEDOBJECT"
,
strlen
(
arg1_str
))
==
0
)
{
grow_tObject
*
sel_list
;
int
sel_count
;
grow_GetSelectList
(
graph
->
grow
->
ctx
,
&
sel_list
,
&
sel_count
);
if
(
sel_count
!=
1
)
{
graph
->
message
(
'E'
,
"Select one object"
);
return
GE__SYNTAX
;
}
graph
->
current_cmd_object
=
sel_list
[
0
];
}
else
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
if
(
EVEN
(
dcli_get_qualifier
(
"/ANGLE"
,
str
,
sizeof
(
str
))))
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
sts
=
sscanf
(
str
,
"%f"
,
&
value
);
if
(
sts
!=
1
)
{
if
(
sts
!=
1
)
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
...
...
@@ -1489,12 +1501,7 @@ static int graph_rotate_func( void *client_data,
grow_SetObjectRotation
(
graph
->
current_cmd_object
,
angle
,
0
,
0
,
glow_eRotationPoint_Center
);
grow_SetModified
(
graph
->
grow
->
ctx
,
1
);
}
else
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
return
GE__SUCCESS
;
}
...
...
@@ -1727,11 +1734,6 @@ static int graph_scale_func( void *client_data,
char
arg1_str
[
80
];
int
arg1_sts
;
arg1_sts
=
dcli_get_qualifier
(
"dcli_arg1"
,
arg1_str
,
sizeof
(
arg1_str
));
if
(
cdh_NoCaseStrncmp
(
arg1_str
,
"CURRENTOBJECT"
,
strlen
(
arg1_str
))
==
0
)
{
char
str
[
80
];
int
sts
;
float
value
;
...
...
@@ -1739,32 +1741,47 @@ static int graph_scale_func( void *client_data,
glow_eScaleType
scale_type
;
double
x0
,
y0
;
if
(
!
graph
->
current_cmd_object
)
{
arg1_sts
=
dcli_get_qualifier
(
"dcli_arg1"
,
arg1_str
,
sizeof
(
arg1_str
));
if
(
cdh_NoCaseStrncmp
(
arg1_str
,
"CURRENTOBJECT"
,
strlen
(
arg1_str
))
==
0
)
{
if
(
!
graph
->
current_cmd_object
)
{
graph
->
message
(
'E'
,
"No current object"
);
return
GE__NOCURRENT
;
}
if
(
EVEN
(
dcli_get_qualifier
(
"/SCALEX"
,
str
,
sizeof
(
str
))))
{
}
else
if
(
cdh_NoCaseStrncmp
(
arg1_str
,
"SELECTEDOBJECT"
,
strlen
(
arg1_str
))
==
0
)
{
grow_tObject
*
sel_list
;
int
sel_count
;
grow_GetSelectList
(
graph
->
grow
->
ctx
,
&
sel_list
,
&
sel_count
);
if
(
sel_count
!=
1
)
{
graph
->
message
(
'E'
,
"Select one object"
);
return
GE__SYNTAX
;
}
graph
->
current_cmd_object
=
sel_list
[
0
];
}
else
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
if
(
EVEN
(
dcli_get_qualifier
(
"/SCALEX"
,
str
,
sizeof
(
str
))))
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
sts
=
sscanf
(
str
,
"%f"
,
&
value
);
if
(
sts
!=
1
)
{
if
(
sts
!=
1
)
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
scalex
=
double
(
value
);
if
(
EVEN
(
dcli_get_qualifier
(
"/SCALEY"
,
str
,
sizeof
(
str
))))
{
if
(
EVEN
(
dcli_get_qualifier
(
"/SCALEY"
,
str
,
sizeof
(
str
))))
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
sts
=
sscanf
(
str
,
"%f"
,
&
value
);
if
(
sts
!=
1
)
{
if
(
sts
!=
1
)
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
...
...
@@ -1774,11 +1791,9 @@ static int graph_scale_func( void *client_data,
x0
=
0
;
y0
=
0
;
if
(
ODD
(
dcli_get_qualifier
(
"/X"
,
str
,
sizeof
(
str
))))
{
if
(
ODD
(
dcli_get_qualifier
(
"/X"
,
str
,
sizeof
(
str
))))
{
sts
=
sscanf
(
str
,
"%f"
,
&
value
);
if
(
sts
!=
1
)
{
if
(
sts
!=
1
)
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
...
...
@@ -1786,11 +1801,9 @@ static int graph_scale_func( void *client_data,
scale_type
=
glow_eScaleType_FixPoint
;
}
if
(
ODD
(
dcli_get_qualifier
(
"/Y"
,
str
,
sizeof
(
str
))))
{
if
(
ODD
(
dcli_get_qualifier
(
"/Y"
,
str
,
sizeof
(
str
))))
{
sts
=
sscanf
(
str
,
"%f"
,
&
value
);
if
(
sts
!=
1
)
{
if
(
sts
!=
1
)
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
...
...
@@ -1802,12 +1815,7 @@ static int graph_scale_func( void *client_data,
grow_SetObjectScale
(
graph
->
current_cmd_object
,
scalex
,
scaley
,
x0
,
y0
,
scale_type
);
grow_SetModified
(
graph
->
grow
->
ctx
,
1
);
}
else
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
return
GE__SUCCESS
;
}
...
...
@@ -1818,56 +1826,85 @@ static int graph_move_func( void *client_data,
char
arg1_str
[
80
];
int
arg1_sts
;
arg1_sts
=
dcli_get_qualifier
(
"dcli_arg1"
,
arg1_str
,
sizeof
(
arg1_str
));
if
(
cdh_NoCaseStrncmp
(
arg1_str
,
"CURRENTOBJECT"
,
strlen
(
arg1_str
))
==
0
)
{
char
str
[
80
];
int
sts
;
float
value
;
double
x0
,
y0
;
double
ll_x
,
ll_y
,
ur_x
,
ur_y
;
if
(
!
graph
->
current_cmd_object
)
{
arg1_sts
=
dcli_get_qualifier
(
"dcli_arg1"
,
arg1_str
,
sizeof
(
arg1_str
));
if
(
cdh_NoCaseStrncmp
(
arg1_str
,
"CURRENTOBJECT"
,
strlen
(
arg1_str
))
==
0
)
{
if
(
!
graph
->
current_cmd_object
)
{
graph
->
message
(
'E'
,
"No current object"
);
return
GE__NOCURRENT
;
}
if
(
EVEN
(
dcli_get_qualifier
(
"/X"
,
str
,
sizeof
(
str
))))
{
}
else
if
(
cdh_NoCaseStrncmp
(
arg1_str
,
"SELECTEDOBJECT"
,
strlen
(
arg1_str
))
==
0
)
{
grow_tObject
*
sel_list
;
int
sel_count
;
grow_GetSelectList
(
graph
->
grow
->
ctx
,
&
sel_list
,
&
sel_count
);
if
(
sel_count
!=
1
)
{
graph
->
message
(
'E'
,
"Select one object"
);
return
GE__SYNTAX
;
}
graph
->
current_cmd_object
=
sel_list
[
0
];
}
else
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
if
(
ODD
(
dcli_get_qualifier
(
"/X"
,
str
,
sizeof
(
str
))))
{
sts
=
sscanf
(
str
,
"%f"
,
&
value
);
if
(
sts
!=
1
)
{
if
(
sts
!=
1
)
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
x0
=
double
(
value
);
if
(
EVEN
(
dcli_get_qualifier
(
"/Y"
,
str
,
sizeof
(
str
))))
{
}
else
if
(
ODD
(
dcli_get_qualifier
(
"/ABSX"
,
str
,
sizeof
(
str
))))
{
sts
=
sscanf
(
str
,
"%f"
,
&
value
);
if
(
sts
!=
1
)
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
grow_MeasureNode
(
graph
->
current_cmd_object
,
&
ll_x
,
&
ll_y
,
&
ur_x
,
&
ur_y
);
x0
=
double
(
value
)
-
ll_x
;
}
else
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
if
(
ODD
(
dcli_get_qualifier
(
"/Y"
,
str
,
sizeof
(
str
))))
{
sts
=
sscanf
(
str
,
"%f"
,
&
value
);
if
(
sts
!=
1
)
{
if
(
sts
!=
1
)
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
y0
=
double
(
value
);
grow_StoreTransform
(
graph
->
current_cmd_object
);
grow_SetObjectPosition
(
graph
->
current_cmd_object
,
x0
,
y0
);
grow_SetModified
(
graph
->
grow
->
ctx
,
1
);
}
else
{
else
if
(
ODD
(
dcli_get_qualifier
(
"/ABSy"
,
str
,
sizeof
(
str
))))
{
sts
=
sscanf
(
str
,
"%f"
,
&
value
);
if
(
sts
!=
1
)
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
grow_MeasureNode
(
graph
->
current_cmd_object
,
&
ll_x
,
&
ll_y
,
&
ur_x
,
&
ur_y
);
y0
=
double
(
value
)
-
ll_y
;
}
else
{
graph
->
message
(
'E'
,
"Syntax error"
);
return
GE__SYNTAX
;
}
grow_StoreTransform
(
graph
->
current_cmd_object
);
grow_SetObjectPosition
(
graph
->
current_cmd_object
,
x0
,
y0
);
grow_SetModified
(
graph
->
grow
->
ctx
,
1
);
return
GE__SUCCESS
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment