File: View.h

package info (click to toggle)
pymol 2.5.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 42,288 kB
  • sloc: cpp: 476,472; python: 76,538; ansic: 29,510; javascript: 6,792; sh: 47; makefile: 24
file content (110 lines) | stat: -rw-r--r-- 3,554 bytes parent folder | download | duplicates (2)
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

/* 
A* -------------------------------------------------------------------
B* This file contains source code for the PyMOL computer program
C* copyright 1998-2000 by Warren Lyford Delano of DeLano Scientific. 
D* -------------------------------------------------------------------
E* It is unlawful to modify or remove this copyright notice.
F* -------------------------------------------------------------------
G* Please see the accompanying LICENSE file for further information. 
H* -------------------------------------------------------------------
I* Additional authors of this source file include:
-* 
-* 
-*
Z* -------------------------------------------------------------------
*/
#ifndef _H_View
#define _H_View

#include"os_python.h"
#include "os_gl.h"

#include"Ray.h"
#include"Block.h"

typedef struct CViewElem {

  int matrix_flag;              /* homogenous transformation, column-major for OpenGL compatibility */
  double matrix[16];

  int pre_flag;                 /* pre-tranformation translation */
  double pre[3];

  int post_flag;                /* post-transformation translation */
  double post[3];

  int clip_flag;                /* clip planes (only useful for top-level views...
                                   only applied through Scene) */
  float front, back;

  int ortho_flag;
  float ortho;

  int state_flag;               /* only applies to object views */
  int state;

  int view_mode;                /* 0 = relative/subordinate, 1 = absolute/top-level */

  int specification_level;

  int timing_flag;
  double timing;

  int scene_flag;               /* only applies to main movie view */
  int scene_name;               /* lexicon key */

  int power_flag;
  float power;

  int bias_flag;
  float bias;

} CViewElem;

PyObject *ViewElemAsPyList(PyMOLGlobals * G, const CViewElem * view);
int ViewElemFromPyList(PyMOLGlobals * G, PyObject * list, CViewElem * view);

int ViewElemVLAFromPyList(PyMOLGlobals * G, PyObject * list, CViewElem ** vla,
                          int nFrame);
PyObject *ViewElemVLAAsPyList(PyMOLGlobals * G, const CViewElem * vla, int nFrame);

void ViewElemArrayPurge(PyMOLGlobals * G, CViewElem * view, int nFrame);
void ViewElemCopy(PyMOLGlobals * G, const CViewElem * src, CViewElem * dst);

typedef struct CView {
  PyMOLGlobals *G;
  int NView;
  CViewElem *View;

} CView;

typedef int CViewIterator;

CView *ViewNew(PyMOLGlobals * G);
void ViewFree(CView * I);

CViewIterator ViewGetIterator(CView * I);
int ViewIterate(CView * I, CViewIterator * iter, CRay * ray, int at_least_once);
int ViewElemSmooth(CViewElem * first, CViewElem * last, int window, int loop);

int ViewElemInterpolate(PyMOLGlobals * G, CViewElem * first, CViewElem * last,
                        float power, float bias,
                        int simple, float linearity, int hand, float cut);
void ViewElemDraw(PyMOLGlobals *G,
    const CViewElem * src,
    const BlockRect *rect, int frames, const char *title, CGO *orthoCGO);

#define cViewElemModifyInsert 1
#define cViewElemModifyDelete -1
#define cViewElemModifyMove    2
#define cViewElemModifyCopy    3

int ViewElemModify(PyMOLGlobals *G, CViewElem **handle, int action, int index, int count, int target);
int ViewElemXtoFrame(BlockRect *rect, int frames, int x, int nearest);
void ViewElemDrawBox(PyMOLGlobals *G, BlockRect *rect,int first, int last,
                     int frames, float *color4, int fill, CGO *orthoCGO);
void ViewElemDrawLabel(
    PyMOLGlobals* G, const char* label, const BlockRect* rect, CGO* orthoCGO);

#endif