Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
12e00c83
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
12e00c83
编写于
3月 25, 2011
作者:
M
mrkam
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7027686: /applets/MoleculeViewer demo needs to be improved
Reviewed-by: alexp
上级
eae7f2e0
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
266 addition
and
209 deletion
+266
-209
src/share/demo/applets/MoleculeViewer/Matrix3D.java
src/share/demo/applets/MoleculeViewer/Matrix3D.java
+19
-9
src/share/demo/applets/MoleculeViewer/XYZApp.java
src/share/demo/applets/MoleculeViewer/XYZApp.java
+241
-194
src/share/demo/applets/MoleculeViewer/example1.html
src/share/demo/applets/MoleculeViewer/example1.html
+1
-1
src/share/demo/applets/MoleculeViewer/example2.html
src/share/demo/applets/MoleculeViewer/example2.html
+1
-1
src/share/demo/applets/MoleculeViewer/example3.html
src/share/demo/applets/MoleculeViewer/example3.html
+4
-4
未找到文件。
src/share/demo/applets/MoleculeViewer/Matrix3D.java
浏览文件 @
12e00c83
/*
* Copyright (c) 1995, 20
06
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 20
11
, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
...
...
@@ -29,22 +29,23 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
*/
/** A fairly conventional 3D matrix object that can transform sets of
3D points and perform a variety of manipulations on the transform */
3D points and perform a variety of manipulations on the transform */
class
Matrix3D
{
float
xx
,
xy
,
xz
,
xo
;
float
yx
,
yy
,
yz
,
yo
;
float
zx
,
zy
,
zz
,
zo
;
static
final
double
pi
=
3.14159265
;
/** Create a new unit matrix */
Matrix3D
()
{
Matrix3D
()
{
xx
=
1.0f
;
yy
=
1.0f
;
zz
=
1.0f
;
}
/** Scale by f in all dimensions */
void
scale
(
float
f
)
{
xx
*=
f
;
...
...
@@ -60,6 +61,7 @@ class Matrix3D {
zz
*=
f
;
zo
*=
f
;
}
/** Scale along each axis independently */
void
scale
(
float
xf
,
float
yf
,
float
zf
)
{
xx
*=
xf
;
...
...
@@ -75,12 +77,14 @@ class Matrix3D {
zz
*=
zf
;
zo
*=
zf
;
}
/** Translate the origin */
void
translate
(
float
x
,
float
y
,
float
z
)
{
xo
+=
x
;
yo
+=
y
;
zo
+=
z
;
}
/** rotate theta degrees about the y axis */
void
yrot
(
double
theta
)
{
theta
*=
(
pi
/
180
);
...
...
@@ -106,6 +110,7 @@ class Matrix3D {
zy
=
Nzy
;
zz
=
Nzz
;
}
/** rotate theta degrees about the x axis */
void
xrot
(
double
theta
)
{
theta
*=
(
pi
/
180
);
...
...
@@ -131,6 +136,7 @@ class Matrix3D {
zy
=
Nzy
;
zz
=
Nzz
;
}
/** rotate theta degrees about the z axis */
void
zrot
(
double
theta
)
{
theta
*=
(
pi
/
180
);
...
...
@@ -156,6 +162,7 @@ class Matrix3D {
xy
=
Nxy
;
xz
=
Nxz
;
}
/** Multiply this matrix by a second: M = M*R */
void
mult
(
Matrix3D
rhs
)
{
float
lxx
=
xx
*
rhs
.
xx
+
yx
*
rhs
.
xy
+
zx
*
rhs
.
xz
;
...
...
@@ -204,10 +211,11 @@ class Matrix3D {
zy
=
0
;
zz
=
1
;
}
/** Transform nvert points from v into tv. v contains the input
coordinates in floating point. Three successive entries in
the array constitute a point. tv ends up holding the transformed
points as integers; three successive entries per point */
coordinates in floating point. Three successive entries in
the array constitute a point. tv ends up holding the transformed
points as integers; three successive entries per point */
void
transform
(
float
v
[],
int
tv
[],
int
nvert
)
{
float
lxx
=
xx
,
lxy
=
xy
,
lxz
=
xz
,
lxo
=
xo
;
float
lyx
=
yx
,
lyy
=
yy
,
lyz
=
yz
,
lyo
=
yo
;
...
...
@@ -216,11 +224,13 @@ class Matrix3D {
float
x
=
v
[
i
];
float
y
=
v
[
i
+
1
];
float
z
=
v
[
i
+
2
];
tv
[
i
]
=
(
int
)
(
x
*
lxx
+
y
*
lxy
+
z
*
lxz
+
lxo
);
tv
[
i
]
=
(
int
)
(
x
*
lxx
+
y
*
lxy
+
z
*
lxz
+
lxo
);
tv
[
i
+
1
]
=
(
int
)
(
x
*
lyx
+
y
*
lyy
+
z
*
lyz
+
lyo
);
tv
[
i
+
2
]
=
(
int
)
(
x
*
lzx
+
y
*
lzy
+
z
*
lzz
+
lzo
);
}
}
@Override
public
String
toString
()
{
return
(
"["
+
xo
+
","
+
xx
+
","
+
xy
+
","
+
xz
+
";"
+
yo
+
","
+
yx
+
","
+
yy
+
","
+
yz
+
";"
...
...
src/share/demo/applets/MoleculeViewer/XYZApp.java
浏览文件 @
12e00c83
此差异已折叠。
点击以展开。
src/share/demo/applets/MoleculeViewer/example1.html
浏览文件 @
12e00c83
...
...
@@ -6,7 +6,7 @@
<h1>
MoleculeViewer (example 1)
</h1>
<hr>
<applet
code=
XYZApp.class
width=
300
height=
300
>
<param
name=
model
value=
models/HyaluronicAcid.xyz
>
<param
name=
model
value=
"models/HyaluronicAcid.xyz"
>
alt="Your browser understands the
<
APPLET
>
tag but isn't running the applet, for some reason."
Your browser is completely ignoring the
<
APPLET
>
tag!
</applet>
...
...
src/share/demo/applets/MoleculeViewer/example2.html
浏览文件 @
12e00c83
...
...
@@ -6,7 +6,7 @@
<h1>
MoleculeViewer (example 2)
</h1>
<hr>
<applet
code=
XYZApp.class
width=
300
height=
300
>
<param
name=
model
value=
models/buckminsterfullerine.xyz
>
<param
name=
model
value=
"models/buckminsterfullerine.xyz"
>
alt="Your browser understands the
<
APPLET
>
tag but isn't running the applet, for some reason."
Your browser is completely ignoring the
<
APPLET
>
tag!
</applet>
...
...
src/share/demo/applets/MoleculeViewer/example3.html
浏览文件 @
12e00c83
...
...
@@ -6,25 +6,25 @@
<h1>
MoleculeViewer (example 3)
</h1>
<hr>
<applet
code=
XYZApp.class
width=
100
height=
100
>
<param
name=
model
value=
models/water.xyz
>
<param
name=
model
value=
"models/water.xyz"
>
alt="Your browser understands the
<
APPLET
>
tag but isn't running the applet, for some reason."
Your browser is completely ignoring the
<
APPLET
>
tag!
</applet>
<p>
<applet
code=
XYZApp.class
width=
100
height=
100
>
<param
name=
model
value=
models/benzene.xyz
>
<param
name=
model
value=
"models/benzene.xyz"
>
alt="Your browser understands the
<
APPLET
>
tag but isn't running the applet, for some reason."
Your browser is completely ignoring the
<
APPLET
>
tag!
</applet>
<p>
<applet
code=
XYZApp.class
width=
100
height=
100
>
<param
name=
model
value=
models/ethane.xyz
>
<param
name=
model
value=
"models/ethane.xyz"
>
alt="Your browser understands the
<
APPLET
>
tag but isn't running the applet, for some reason."
Your browser is completely ignoring the
<
APPLET
>
tag!
</applet>
<p>
<applet
code=
XYZApp.class
width=
100
height=
100
>
<param
name=
model
value=
models/cyclohexane.xyz
>
<param
name=
model
value=
"models/cyclohexane.xyz"
>
alt="Your browser understands the
<
APPLET
>
tag but isn't running the applet, for some reason."
Your browser is completely ignoring the
<
APPLET
>
tag!
</applet>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录