File: surface.rst

package info (click to toggle)
openstructure 2.9.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 205,228 kB
  • sloc: cpp: 188,129; python: 35,361; ansic: 34,298; fortran: 3,275; sh: 286; xml: 146; makefile: 29
file content (144 lines) | stat: -rw-r--r-- 3,520 bytes parent folder | download | duplicates (4)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
Surfaces
================================================================================

.. currentmodule:: ost.mol

.. class:: SurfaceHandle

  TODO

  .. method:: Attach(entity, cutoff)
    
    Attach an :class:`EntityHandle` or :class:`EntityView` to a molecular
    surface. For each vertex of the surface, the atom which is closest to this
    vertex and within the cutoff distance is attached. Like this, the atom and
    its properties can be retrieved efficiently, which is e.g. used for coloring
    a surface according to the underlying entity (see
    :meth:`gfx.Surface.ColorBy`).
    
    Be aware that increasing the cutoff distance will significantly increase the
    time needed to attach an entity to the surface.
    
    :param entity: entity to be attached to the surface
    :type  entity: :class:`EntityHandle`, :class:`EntityView`
    :param cutoff: distance cutoff
    :type  cutoff: float
    :rtype: None

  .. method:: FindWithin(position, cutoff)

    Returns all :class:`surface vertices<SurfaceVertex>` within a certain cutoff 
    distance of a specified position.
     
    :param position: position
    :type  position: :class:`~ost.geom.Vec3`
    :param cutoff:   distance cutoff
    :type  cutoff:   float
    :rtype:          :class:`SurfaceVertexList`

  .. method:: GetTriIDList()
  
    Returns a list containing all IDs of all triangles of a surface.

    :rtype: list of ints

  .. method:: GetVertex(id)

    Returns a :class:`SurfaceVertex` with the specified ID.

    :param id: vertex id
    :type  id: int
    :rtype: :class:`SurfaceVertex`

  .. method:: GetVertexIDList()

    Returns a list containing all IDs of all vertices of a surface.
    
    :rtype: list of ints

  .. method:: Invert()

    Does an in place inversion of all vertex normal vectors.
     
    :rtype: None

.. class:: SurfaceVertex

  TODO
  
  .. method:: SurfaceVertex()
              SurfaceVertex(pos, norm, type, atom)
              
    Creates a new SurfaceVertex.
              
    :param pos:  vertex position
    :type  pos:  :class:`geom.Vec3`
    :param norm: vertex normal vector
    :type  norm: :class:`geom.Vec3`
    :param type: vertex type
    :type  type: int
    :param atom: attached atom
    :type  atom: :class:`AtomHandle` 
              
  .. attribute:: Atom
    
    :class:`AtomHandle` attached to the surface vertex.
    
    The AtomHandle is invalid, if no :class:`~ost.mol.EntityHandle` has been
    attached or if no atom was found within the cutoff distance.
    
    See :meth:`SurfaceHandle.Attach` for further details.
    
    :type: :class:`AtomHandle`
  
  .. attribute:: Normal
    
    Normal vector of the surface vertex.
  
    :type: :class:`~ost.geom.Vec3`
  
  .. attribute:: Position
  
    Spatial position of the surface vertex.
  
    :type: :class:`~ost.geom.Vec3`

.. class:: SurfaceVertexList

  .. method:: append(vertex)

    Add a single surface vertex.

    :param vertex: surface vertex
    :type  vertex: :class:`SurfaceVertex`
    :rtype: None

  .. method:: extend(list)
  
    Add a list of surface vertices.

    :param list: list of surface vertices
    :type  list: :class:`SurfaceVertexList`
    :rtype: None

.. class:: SurfaceTriIDList

  .. method:: append(id)
  
    Add a single triangle ID.

    :param id: trinangle vertex id
    :type  id: int
    :rtype: None

  .. method:: extend(list)

    Add a list of triangle IDs.

    :param list: list of triangle vertex ids
    :type  list: list of ints
    :rtype: None