Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120141024
DelaunayLinesObject.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Jul 2, 05:32
Size
1 KB
Mime Type
text/x-python
Expires
Fri, Jul 4, 05:32 (2 d)
Engine
blob
Format
Raw Data
Handle
27146434
Attached To
rGLUPS glups
DelaunayLinesObject.py
View Options
from
OpenGL.GL
import
*
from
OpenGL.GLU
import
*
from
OpenGL.GLUT
import
*
from
GLObject
import
*
from
ParameterList
import
*
from
numpy
import
*
import
libgl
import
delaunay
class
DelaunayLinesObject
(
GLObject
):
def
__init__
(
self
,
pos
,
DelaunayFile
,
ID
=
'DelaunayLines'
):
self
.
ID
=
ID
self
.
ListID
=
None
self
.
pos
=
pos
self
.
DelaunayFile
=
DelaunayFile
# init parameters
self
.
param
=
ParametersList
(
self
.
ID
)
self
.
param
[
"Color_r"
]
=
1.0
self
.
param
[
"Color_g"
]
=
0.5
self
.
param
[
"Color_b"
]
=
0.5
self
.
param
[
"Color_a"
]
=
1.0
self
.
param
[
"show"
]
=
1
self
.
param
[
"PosX"
]
=
0.0
self
.
param
[
"PosY"
]
=
0.0
self
.
param
[
"PosZ"
]
=
0.0
self
.
param
[
"SizeX"
]
=
1.0
self
.
param
[
"SizeY"
]
=
1.0
self
.
param
[
"SizeZ"
]
=
1.0
self
.
param
[
"RotX"
]
=
0.0
self
.
param
[
"RotY"
]
=
0.0
self
.
param
[
"RotZ"
]
=
0.0
self
.
param
[
"RotationFactor"
]
=
0.1
self
.
param
[
"SizeFactor"
]
=
0.1
self
.
GenList
()
def
GenList
(
self
):
if
self
.
ListID
==
None
:
self
.
ListID
=
glGenLists
(
1
)
glNewList
(
self
.
ListID
,
GL_COMPILE
)
glBegin
(
GL_LINES
)
delaunay
.
FromDelaunayGenerateLinesList
(
self
.
pos
,
DelaunayFile
=
self
.
DelaunayFile
)
glEnd
()
glEndList
()
def
Display
(
self
,
color
=
None
):
'''
display the object
'''
if
(
self
.
param
[
'show'
]):
if
color
==
None
:
glColor4d
(
self
.
param
[
"Color_r"
],
self
.
param
[
"Color_g"
],
self
.
param
[
"Color_b"
],
self
.
param
[
"Color_a"
])
else
:
glColor4d
(
color
[
0
],
color
[
1
],
color
[
2
],
self
.
param
[
"Color_a"
])
glCallList
(
self
.
ListID
)
Event Timeline
Log In to Comment