FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Examples/Java/VTK/sphere.java at master · ishida66/Examples · GitHub
ishida66
/
Examples
Public
forked from
daviddoria/Examples
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
Examples
/
Java
/
VTK
/
sphere.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
47 lines (46 loc) · 1.53 KB
Breadcrumbs
Examples
/
Java
/
VTK
/
sphere.java
Copy path
File metadata and controls
47 lines (46 loc) · 1.53 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//package HelloVtkMain;
import
vtk
.*;
public
class
sphere
{
// in the static contructor we load in the native code
// The libraries must be in your path to work
static
{
System
.
loadLibrary
(
"vtkCommonJava"
);
System
.
loadLibrary
(
"vtkFilteringJava"
);
System
.
loadLibrary
(
"vtkIOJava"
);
System
.
loadLibrary
(
"vtkImagingJava"
);
System
.
loadLibrary
(
"vtkGraphicsJava"
);
System
.
loadLibrary
(
"vtkRenderingJava"
);
}
// the main function
public
static
void
main
(
String
[]
args
)
{
// create sphere geometry
vtkSphereSource
sphere
=
new
vtkSphereSource
();
sphere
.
SetRadius
(
1.0
);
sphere
.
SetThetaResolution
(
18
);
sphere
.
SetPhiResolution
(
18
);
// map to graphics objects
vtkPolyDataMapper
map
=
new
vtkPolyDataMapper
();
map
.
SetInput
(
sphere
.
GetOutput
());
// actor coordinates geometry, properties, transformation
vtkActor
aSphere
=
new
vtkActor
();
aSphere
.
SetMapper
(
map
);
aSphere
.
GetProperty
().
SetColor
(
0
,
0
,
1
);
// color blue
// a renderer for the data
vtkRenderer
ren1
=
new
vtkRenderer
();
ren1
.
AddActor
(
aSphere
);
ren1
.
SetBackground
(
1
,
1
,
1
);
// background color white
// a render window to display the contents
vtkRenderWindow
renWin
=
new
vtkRenderWindow
();
renWin
.
AddRenderer
(
ren1
);
renWin
.
SetSize
(
300
,
300
);
// an interactor to allow control of the objects
vtkRenderWindowInteractor
iren
=
new
vtkRenderWindowInteractor
();
iren
.
SetRenderWindow
(
renWin
);
// trigger the rendering and start the interaction
renWin
.
Render
();
iren
.
Start
();
}
}
Back
|
FazBrowse Home
|
New Git URL