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
a8e7b3b6
Commit
a8e7b3b6
authored
Jan 20, 2011
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ge Move dynamic, different move and scale factors for x and y direction
parent
495a1a23
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
52 deletions
+81
-52
java/jpwr/jop/src/GeDynMove.java
java/jpwr/jop/src/GeDynMove.java
+14
-9
xtt/lib/ge/src/ge_dyn.cpp
xtt/lib/ge/src/ge_dyn.cpp
+55
-36
xtt/lib/ge/src/ge_dyn.h
xtt/lib/ge/src/ge_dyn.h
+12
-7
No files found.
java/jpwr/jop/src/GeDynMove.java
View file @
a8e7b3b6
...
...
@@ -29,8 +29,10 @@ public String moveYAttribute;
String
scaleYAttribute
;
double
xOffset
;
double
yOffset
;
double
factor
;
double
scaleFactor
;
double
xFactor
;
double
yFactor
;
double
scaleXFactor
;
double
scaleYFactor
;
boolean
attrMoveXFound
;
boolean
attrMoveYFound
;
...
...
@@ -61,7 +63,8 @@ public String moveYAttribute;
public
GeDynMove
(
GeDyn
dyn
,
String
moveXAttribute
,
String
moveYAttribute
,
String
scaleXAttribute
,
String
scaleYAttribute
,
double
xOffset
,
double
yOffset
,
double
factor
,
double
scaleFactor
)
{
xOffset
,
double
yOffset
,
double
xFactor
,
double
yFactor
,
double
scaleXFactor
,
double
scaleYFactor
)
{
super
(
dyn
,
GeDyn
.
mDynType_Move
,
GeDyn
.
mActionType_No
);
this
.
moveXAttribute
=
moveXAttribute
;
this
.
moveYAttribute
=
moveYAttribute
;
...
...
@@ -69,8 +72,10 @@ public String moveYAttribute;
this
.
scaleYAttribute
=
scaleYAttribute
;
this
.
xOffset
=
xOffset
;
this
.
yOffset
=
yOffset
;
this
.
factor
=
factor
;
this
.
scaleFactor
=
scaleFactor
;
this
.
xFactor
=
xFactor
;
this
.
yFactor
=
yFactor
;
this
.
scaleXFactor
=
scaleXFactor
;
this
.
scaleYFactor
=
scaleYFactor
;
}
public
void
connect
()
{
String
attrName
=
dyn
.
getAttrName
(
moveXAttribute
);
...
...
@@ -169,11 +174,11 @@ public String moveYAttribute;
if
(
repaintNow
)
{
if
(
attrMoveXFound
){
double
xRatio
=
wRoot
/
wRootOrig
;
loc
.
x
=
(
int
)
((
xOrig
+
(
valueMoveX
-
xOffset
)
*
f
actor
)
*
xRatio
);
loc
.
x
=
(
int
)
((
xOrig
+
(
valueMoveX
-
xOffset
)
*
xF
actor
)
*
xRatio
);
}
if
(
attrMoveYFound
){
double
yRatio
=
wRoot
/
wRootOrig
;
loc
.
y
=
(
int
)
((
yOrig
+
(
valueMoveY
-
yOffset
)
*
f
actor
)
*
yRatio
);
loc
.
y
=
(
int
)
((
yOrig
+
(
valueMoveY
-
yOffset
)
*
yF
actor
)
*
yRatio
);
}
((
JComponent
)
dyn
.
comp
).
setLocation
(
loc
);
}
...
...
@@ -188,14 +193,14 @@ public String moveYAttribute;
float
valueScaleY
=
0
;
if
(
attrScaleXFound
)
{
valueScaleX
=
(
float
)
(
dyn
.
en
.
gdh
.
getObjectRefInfoFloat
(
scaleXp
)
*
scaleFactor
);
valueScaleX
=
(
float
)
(
dyn
.
en
.
gdh
.
getObjectRefInfoFloat
(
scaleXp
)
*
scale
X
Factor
);
if
(
valueScaleX
!=
scaleXOldValue
||
firstScan
||
wRoot
!=
wRootOld
)
{
repaintNow
=
true
;
scaleXOldValue
=
valueScaleX
;
}
}
if
(
attrScaleYFound
)
{
valueScaleY
=
(
float
)
(
dyn
.
en
.
gdh
.
getObjectRefInfoFloat
(
scaleYp
)
*
scaleFactor
);
valueScaleY
=
(
float
)
(
dyn
.
en
.
gdh
.
getObjectRefInfoFloat
(
scaleYp
)
*
scale
Y
Factor
);
if
(
valueScaleY
!=
scaleYOldValue
||
firstScan
||
wRoot
!=
wRootOld
)
{
repaintNow
=
true
;
scaleYOldValue
=
valueScaleY
;
...
...
xtt/lib/ge/src/ge_dyn.cpp
View file @
a8e7b3b6
...
...
@@ -5262,10 +5262,15 @@ void GeMove::get_attributes( attr_sItem *attrinfo, int *item_count)
attrinfo
[
i
].
type
=
glow_eType_Double
;
attrinfo
[
i
++
].
size
=
sizeof
(
y_offset
);
strcpy
(
attrinfo
[
i
].
name
,
"Move.Factor"
);
attrinfo
[
i
].
value
=
&
factor
;
strcpy
(
attrinfo
[
i
].
name
,
"Move.
X
Factor"
);
attrinfo
[
i
].
value
=
&
x_
factor
;
attrinfo
[
i
].
type
=
glow_eType_Double
;
attrinfo
[
i
++
].
size
=
sizeof
(
factor
);
attrinfo
[
i
++
].
size
=
sizeof
(
x_factor
);
strcpy
(
attrinfo
[
i
].
name
,
"Move.YFactor"
);
attrinfo
[
i
].
value
=
&
y_factor
;
attrinfo
[
i
].
type
=
glow_eType_Double
;
attrinfo
[
i
++
].
size
=
sizeof
(
y_factor
);
strcpy
(
attrinfo
[
i
].
name
,
"Move.ScaleXAttribute"
);
attrinfo
[
i
].
value
=
scale_x_attribute
;
...
...
@@ -5277,10 +5282,15 @@ void GeMove::get_attributes( attr_sItem *attrinfo, int *item_count)
attrinfo
[
i
].
type
=
glow_eType_String
;
attrinfo
[
i
++
].
size
=
sizeof
(
scale_y_attribute
);
strcpy
(
attrinfo
[
i
].
name
,
"Move.ScaleFactor"
);
attrinfo
[
i
].
value
=
&
scale_factor
;
strcpy
(
attrinfo
[
i
].
name
,
"Move.ScaleXFactor"
);
attrinfo
[
i
].
value
=
&
scale_x_factor
;
attrinfo
[
i
].
type
=
glow_eType_Double
;
attrinfo
[
i
++
].
size
=
sizeof
(
scale_x_factor
);
strcpy
(
attrinfo
[
i
].
name
,
"Move.ScaleYFactor"
);
attrinfo
[
i
].
value
=
&
scale_y_factor
;
attrinfo
[
i
].
type
=
glow_eType_Double
;
attrinfo
[
i
++
].
size
=
sizeof
(
scale_factor
);
attrinfo
[
i
++
].
size
=
sizeof
(
scale_
x_
factor
);
strcpy
(
attrinfo
[
i
].
name
,
"Move.ScaleType"
);
attrinfo
[
i
].
value
=
&
scale_type
;
...
...
@@ -5327,8 +5337,10 @@ void GeMove::save( ofstream& fp)
fp
<<
int
(
ge_eSave_Move_scale_y_attribute
)
<<
FSPACE
<<
scale_y_attribute
<<
endl
;
fp
<<
int
(
ge_eSave_Move_x_offset
)
<<
FSPACE
<<
x_offset
<<
endl
;
fp
<<
int
(
ge_eSave_Move_y_offset
)
<<
FSPACE
<<
y_offset
<<
endl
;
fp
<<
int
(
ge_eSave_Move_factor
)
<<
FSPACE
<<
factor
<<
endl
;
fp
<<
int
(
ge_eSave_Move_scale_factor
)
<<
FSPACE
<<
scale_factor
<<
endl
;
fp
<<
int
(
ge_eSave_Move_x_factor
)
<<
FSPACE
<<
x_factor
<<
endl
;
fp
<<
int
(
ge_eSave_Move_y_factor
)
<<
FSPACE
<<
y_factor
<<
endl
;
fp
<<
int
(
ge_eSave_Move_scale_x_factor
)
<<
FSPACE
<<
scale_x_factor
<<
endl
;
fp
<<
int
(
ge_eSave_Move_scale_y_factor
)
<<
FSPACE
<<
scale_y_factor
<<
endl
;
fp
<<
int
(
ge_eSave_Move_scale_type
)
<<
FSPACE
<<
scale_type
<<
endl
;
fp
<<
int
(
ge_eSave_End
)
<<
endl
;
}
...
...
@@ -5370,8 +5382,10 @@ void GeMove::open( ifstream& fp)
break
;
case
ge_eSave_Move_x_offset
:
fp
>>
x_offset
;
break
;
case
ge_eSave_Move_y_offset
:
fp
>>
y_offset
;
break
;
case
ge_eSave_Move_factor
:
fp
>>
factor
;
break
;
case
ge_eSave_Move_scale_factor
:
fp
>>
scale_factor
;
break
;
case
ge_eSave_Move_x_factor
:
fp
>>
x_factor
;
break
;
case
ge_eSave_Move_y_factor
:
fp
>>
y_factor
;
break
;
case
ge_eSave_Move_scale_x_factor
:
fp
>>
scale_x_factor
;
break
;
case
ge_eSave_Move_scale_y_factor
:
fp
>>
scale_y_factor
;
break
;
case
ge_eSave_Move_scale_type
:
fp
>>
tmp
;
scale_type
=
(
glow_eScaleType
)
tmp
;
break
;
case
ge_eSave_End
:
end_found
=
1
;
break
;
default:
...
...
@@ -5381,6 +5395,10 @@ void GeMove::open( ifstream& fp)
if
(
end_found
)
break
;
}
if
(
y_factor
==
0
)
y_factor
=
x_factor
;
if
(
scale_y_factor
==
0
)
scale_y_factor
=
scale_x_factor
;
}
int
GeMove
::
connect
(
grow_tObject
object
,
glow_sTraceData
*
trace_data
)
...
...
@@ -5480,10 +5498,10 @@ int GeMove::scan( grow_tObject object)
if
(
scale_x_p
||
scale_y_p
)
{
if
(
scale_x_p
)
{
switch
(
scale_x_type
)
{
case
pwr_eType_Float32
:
scale_x
=
*
scale_x_p
*
scale_factor
;
break
;
case
pwr_eType_Float64
:
scale_x
=
*
(
pwr_tFloat64
*
)
scale_x_p
*
scale_factor
;
break
;
case
pwr_eType_Int32
:
scale_x
=
*
(
pwr_tInt32
*
)
scale_x_p
*
scale_factor
;
break
;
case
pwr_eType_UInt32
:
scale_x
=
*
(
pwr_tUInt32
*
)
scale_x_p
*
scale_factor
;
break
;
case
pwr_eType_Float32
:
scale_x
=
*
scale_x_p
*
scale_
x_
factor
;
break
;
case
pwr_eType_Float64
:
scale_x
=
*
(
pwr_tFloat64
*
)
scale_x_p
*
scale_
x_
factor
;
break
;
case
pwr_eType_Int32
:
scale_x
=
*
(
pwr_tInt32
*
)
scale_x_p
*
scale_
x_
factor
;
break
;
case
pwr_eType_UInt32
:
scale_x
=
*
(
pwr_tUInt32
*
)
scale_x_p
*
scale_
x_
factor
;
break
;
default:
scale_x
=
1
;
}
}
...
...
@@ -5492,10 +5510,10 @@ int GeMove::scan( grow_tObject object)
if
(
scale_y_p
)
{
switch
(
scale_y_type
)
{
case
pwr_eType_Float32
:
scale_y
=
*
scale_y_p
*
scale_factor
;
break
;
case
pwr_eType_Float64
:
scale_y
=
*
(
pwr_tFloat64
*
)
scale_y_p
*
scale_factor
;
break
;
case
pwr_eType_Int32
:
scale_y
=
*
(
pwr_tInt32
*
)
scale_y_p
*
scale_factor
;
break
;
case
pwr_eType_UInt32
:
scale_y
=
*
(
pwr_tUInt32
*
)
scale_y_p
*
scale_factor
;
break
;
case
pwr_eType_Float32
:
scale_y
=
*
scale_y_p
*
scale_
y_
factor
;
break
;
case
pwr_eType_Float64
:
scale_y
=
*
(
pwr_tFloat64
*
)
scale_y_p
*
scale_
y_
factor
;
break
;
case
pwr_eType_Int32
:
scale_y
=
*
(
pwr_tInt32
*
)
scale_y_p
*
scale_
y_
factor
;
break
;
case
pwr_eType_UInt32
:
scale_y
=
*
(
pwr_tUInt32
*
)
scale_y_p
*
scale_
y_
factor
;
break
;
default:
scale_y
=
1
;
}
}
...
...
@@ -5527,10 +5545,10 @@ int GeMove::scan( grow_tObject object)
default:
;
}
switch
(
move_x_type
)
{
case
pwr_eType_Float32
:
move_x
=
x_orig
+
scale_offs
+
(
*
move_x_p
-
x_offset
)
*
factor
;
break
;
case
pwr_eType_Float64
:
move_x
=
x_orig
+
scale_offs
+
(
*
(
pwr_tFloat64
*
)
move_x_p
-
x_offset
)
*
factor
;
break
;
case
pwr_eType_Int32
:
move_x
=
x_orig
+
scale_offs
+
(
*
(
pwr_tInt32
*
)
move_x_p
-
x_offset
)
*
factor
;
break
;
case
pwr_eType_UInt32
:
move_x
=
x_orig
+
scale_offs
+
(
*
(
pwr_tUInt32
*
)
move_x_p
-
x_offset
)
*
factor
;
break
;
case
pwr_eType_Float32
:
move_x
=
x_orig
+
scale_offs
+
(
*
move_x_p
-
x_offset
)
*
x_
factor
;
break
;
case
pwr_eType_Float64
:
move_x
=
x_orig
+
scale_offs
+
(
*
(
pwr_tFloat64
*
)
move_x_p
-
x_offset
)
*
x_
factor
;
break
;
case
pwr_eType_Int32
:
move_x
=
x_orig
+
scale_offs
+
(
*
(
pwr_tInt32
*
)
move_x_p
-
x_offset
)
*
x_
factor
;
break
;
case
pwr_eType_UInt32
:
move_x
=
x_orig
+
scale_offs
+
(
*
(
pwr_tUInt32
*
)
move_x_p
-
x_offset
)
*
x_
factor
;
break
;
default:
move_x
=
x_orig
+
scale_offs
;
}
}
...
...
@@ -5552,10 +5570,10 @@ int GeMove::scan( grow_tObject object)
}
switch
(
move_y_type
)
{
case
pwr_eType_Float32
:
move_y
=
y_orig
+
scale_offs
+
(
*
move_y_p
-
y_offset
)
*
factor
;
break
;
case
pwr_eType_Float64
:
move_y
=
y_orig
+
scale_offs
+
(
*
(
pwr_tFloat64
*
)
move_y_p
-
y_offset
)
*
factor
;
break
;
case
pwr_eType_Int32
:
move_y
=
y_orig
+
scale_offs
+
(
*
(
pwr_tInt32
*
)
move_y_p
-
y_offset
)
*
factor
;
break
;
case
pwr_eType_UInt32
:
move_y
=
y_orig
+
scale_offs
+
(
*
(
pwr_tUInt32
*
)
move_y_p
-
y_offset
)
*
factor
;
break
;
case
pwr_eType_Float32
:
move_y
=
y_orig
+
scale_offs
+
(
*
move_y_p
-
y_offset
)
*
y_
factor
;
break
;
case
pwr_eType_Float64
:
move_y
=
y_orig
+
scale_offs
+
(
*
(
pwr_tFloat64
*
)
move_y_p
-
y_offset
)
*
y_
factor
;
break
;
case
pwr_eType_Int32
:
move_y
=
y_orig
+
scale_offs
+
(
*
(
pwr_tInt32
*
)
move_y_p
-
y_offset
)
*
y_
factor
;
break
;
case
pwr_eType_UInt32
:
move_y
=
y_orig
+
scale_offs
+
(
*
(
pwr_tUInt32
*
)
move_y_p
-
y_offset
)
*
y_
factor
;
break
;
default:
move_y
=
y_orig
+
scale_offs
;
}
}
...
...
@@ -5579,10 +5597,10 @@ int GeMove::scan( grow_tObject object)
else
{
if
(
move_x_p
)
{
switch
(
move_x_type
)
{
case
pwr_eType_Float32
:
move_x
=
(
*
move_x_p
-
x_offset
)
*
factor
;
break
;
case
pwr_eType_Float64
:
move_x
=
(
*
(
pwr_tFloat64
*
)
move_x_p
-
x_offset
)
*
factor
;
break
;
case
pwr_eType_Int32
:
move_x
=
(
*
(
pwr_tInt32
*
)
move_x_p
-
x_offset
)
*
factor
;
break
;
case
pwr_eType_UInt32
:
move_x
=
(
*
(
pwr_tUInt32
*
)
move_x_p
-
x_offset
)
*
factor
;
break
;
case
pwr_eType_Float32
:
move_x
=
(
*
move_x_p
-
x_offset
)
*
x_
factor
;
break
;
case
pwr_eType_Float64
:
move_x
=
(
*
(
pwr_tFloat64
*
)
move_x_p
-
x_offset
)
*
x_
factor
;
break
;
case
pwr_eType_Int32
:
move_x
=
(
*
(
pwr_tInt32
*
)
move_x_p
-
x_offset
)
*
x_
factor
;
break
;
case
pwr_eType_UInt32
:
move_x
=
(
*
(
pwr_tUInt32
*
)
move_x_p
-
x_offset
)
*
x_
factor
;
break
;
default:
move_x
=
0
;
}
}
...
...
@@ -5591,10 +5609,10 @@ int GeMove::scan( grow_tObject object)
if
(
move_y_p
)
{
switch
(
move_y_type
)
{
case
pwr_eType_Float32
:
move_y
=
(
*
move_y_p
-
y_offset
)
*
factor
;
break
;
case
pwr_eType_Float64
:
move_y
=
(
*
(
pwr_tFloat64
*
)
move_y_p
-
y_offset
)
*
factor
;
break
;
case
pwr_eType_Int32
:
move_y
=
(
*
(
pwr_tInt32
*
)
move_y_p
-
y_offset
)
*
factor
;
break
;
case
pwr_eType_UInt32
:
move_y
=
(
*
(
pwr_tUInt32
*
)
move_y_p
-
y_offset
)
*
factor
;
break
;
case
pwr_eType_Float32
:
move_y
=
(
*
move_y_p
-
y_offset
)
*
y_
factor
;
break
;
case
pwr_eType_Float64
:
move_y
=
(
*
(
pwr_tFloat64
*
)
move_y_p
-
y_offset
)
*
y_
factor
;
break
;
case
pwr_eType_Int32
:
move_y
=
(
*
(
pwr_tInt32
*
)
move_y_p
-
y_offset
)
*
y_
factor
;
break
;
case
pwr_eType_UInt32
:
move_y
=
(
*
(
pwr_tUInt32
*
)
move_y_p
-
y_offset
)
*
y_
factor
;
break
;
default:
move_y
=
0
;
}
}
...
...
@@ -5624,8 +5642,9 @@ int GeMove::export_java( grow_tObject object, ofstream& fp, bool first, char *va
fp
<<
"new GeDynMove("
<<
var_name
<<
".dd,
\"
"
<<
move_x_attribute
<<
"
\"
,
\"
"
<<
move_y_attribute
<<
"
\"
,
\"
"
<<
scale_x_attribute
<<
"
\"
,
\"
"
<<
scale_y_attribute
<<
"
\"
,"
<<
x_offset
<<
","
<<
y_offset
<<
","
<<
factor
*
zoom_factor
<<
","
<<
scale_factor
<<
")"
<<
endl
;
<<
x_offset
<<
","
<<
y_offset
<<
","
<<
x_factor
*
zoom_factor
<<
","
<<
y_factor
*
zoom_factor
<<
","
<<
scale_x_factor
<<
","
<<
scale_y_factor
<<
")"
<<
endl
;
return
1
;
}
...
...
xtt/lib/ge/src/ge_dyn.h
View file @
a8e7b3b6
...
...
@@ -350,11 +350,13 @@
ge_eSave_Move_move_y_attribute
=
1501
,
ge_eSave_Move_x_offset
=
1502
,
ge_eSave_Move_y_offset
=
1503
,
ge_eSave_Move_factor
=
1504
,
ge_eSave_Move_
x_
factor
=
1504
,
ge_eSave_Move_scale_x_attribute
=
1505
,
ge_eSave_Move_scale_y_attribute
=
1506
,
ge_eSave_Move_scale_factor
=
1507
,
ge_eSave_Move_scale_
x_
factor
=
1507
,
ge_eSave_Move_scale_type
=
1508
,
ge_eSave_Move_y_factor
=
1509
,
ge_eSave_Move_scale_y_factor
=
1510
,
ge_eSave_AnalogShift_attribute
=
1700
,
ge_eSave_DigShift_attribute
=
1800
,
ge_eSave_Animation_attribute
=
1900
,
...
...
@@ -1309,8 +1311,10 @@ class GeMove : public GeDynElem {
pwr_tAName
scale_y_attribute
;
double
x_offset
;
double
y_offset
;
double
factor
;
double
scale_factor
;
double
x_factor
;
double
y_factor
;
double
scale_x_factor
;
double
scale_y_factor
;
glow_eScaleType
scale_type
;
pwr_tFloat32
*
move_x_p
;
...
...
@@ -1345,8 +1349,8 @@ class GeMove : public GeDynElem {
GeMove
(
GeDyn
*
e_dyn
)
:
GeDynElem
(
e_dyn
,
ge_mDynType_Move
,
(
ge_mActionType
)
0
,
ge_eDynPrio_Move
),
x_offset
(
0
),
y_offset
(
0
),
factor
(
1
),
scale
_factor
(
1
),
scale_type
(
glow_eScaleType_LowerLeft
)
x_offset
(
0
),
y_offset
(
0
),
x_factor
(
1
),
y_factor
(
0
),
scale_x
_factor
(
1
),
scale_
y_factor
(
0
),
scale_
type
(
glow_eScaleType_LowerLeft
)
{
strcpy
(
move_x_attribute
,
""
);
strcpy
(
move_y_attribute
,
""
);
...
...
@@ -1355,7 +1359,8 @@ class GeMove : public GeDynElem {
}
GeMove
(
const
GeMove
&
x
)
:
GeDynElem
(
x
.
dyn
,
x
.
dyn_type
,
x
.
action_type
,
x
.
prio
),
x_offset
(
x
.
x_offset
),
y_offset
(
x
.
y_offset
),
factor
(
x
.
factor
),
scale_factor
(
x
.
scale_factor
),
y_offset
(
x
.
y_offset
),
x_factor
(
x
.
x_factor
),
y_factor
(
x
.
y_factor
),
scale_x_factor
(
x
.
scale_x_factor
),
scale_y_factor
(
x
.
scale_y_factor
),
scale_type
(
x
.
scale_type
)
{
strcpy
(
move_x_attribute
,
x
.
move_x_attribute
);
...
...
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