1 
2 /*
3 A* -------------------------------------------------------------------
4 B* This file contains source code for the PyMOL computer program
5 C* copyright 1998-2000 by Warren Lyford Delano of DeLano Scientific.
6 D* -------------------------------------------------------------------
7 E* It is unlawful to modify or remove this copyright notice.
8 F* -------------------------------------------------------------------
9 G* Please see the accompanying LICENSE file for further information.
10 H* -------------------------------------------------------------------
11 I* Additional authors of this source file include:
12 -*
13 -*
14 -*
15 Z* -------------------------------------------------------------------
16 */
17 #ifndef _H_View
18 #define _H_View
19 
20 #include"os_python.h"
21 #include "os_gl.h"
22 
23 #include"Ray.h"
24 #include"Block.h"
25 
26 typedef struct CViewElem {
27 
28   int matrix_flag;              /* homogenous transformation, column-major for OpenGL compatibility */
29   double matrix[16];
30 
31   int pre_flag;                 /* pre-tranformation translation */
32   double pre[3];
33 
34   int post_flag;                /* post-transformation translation */
35   double post[3];
36 
37   int clip_flag;                /* clip planes (only useful for top-level views...
38                                    only applied through Scene) */
39   float front, back;
40 
41   int ortho_flag;
42   float ortho;
43 
44   int state_flag;               /* only applies to object views */
45   int state;
46 
47   int view_mode;                /* 0 = relative/subordinate, 1 = absolute/top-level */
48 
49   int specification_level;
50 
51   int timing_flag;
52   double timing;
53 
54   int scene_flag;               /* only applies to main movie view */
55   int scene_name;               /* lexicon key */
56 
57   int power_flag;
58   float power;
59 
60   int bias_flag;
61   float bias;
62 
63 } CViewElem;
64 
65 PyObject *ViewElemAsPyList(PyMOLGlobals * G, const CViewElem * view);
66 int ViewElemFromPyList(PyMOLGlobals * G, PyObject * list, CViewElem * view);
67 
68 int ViewElemVLAFromPyList(PyMOLGlobals * G, PyObject * list, CViewElem ** vla,
69                           int nFrame);
70 PyObject *ViewElemVLAAsPyList(PyMOLGlobals * G, const CViewElem * vla, int nFrame);
71 
72 void ViewElemArrayPurge(PyMOLGlobals * G, CViewElem * view, int nFrame);
73 void ViewElemCopy(PyMOLGlobals * G, const CViewElem * src, CViewElem * dst);
74 
75 typedef struct CView {
76   PyMOLGlobals *G;
77   int NView;
78   CViewElem *View;
79 
80 } CView;
81 
82 typedef int CViewIterator;
83 
84 CView *ViewNew(PyMOLGlobals * G);
85 void ViewFree(CView * I);
86 
87 CViewIterator ViewGetIterator(CView * I);
88 int ViewIterate(CView * I, CViewIterator * iter, CRay * ray, int at_least_once);
89 int ViewElemSmooth(CViewElem * first, CViewElem * last, int window, int loop);
90 
91 int ViewElemInterpolate(PyMOLGlobals * G, CViewElem * first, CViewElem * last,
92                         float power, float bias,
93                         int simple, float linearity, int hand, float cut);
94 void ViewElemDraw(PyMOLGlobals *G,
95     const CViewElem * src,
96     const BlockRect *rect, int frames, const char *title, CGO *orthoCGO);
97 
98 #define cViewElemModifyInsert 1
99 #define cViewElemModifyDelete -1
100 #define cViewElemModifyMove    2
101 #define cViewElemModifyCopy    3
102 
103 int ViewElemModify(PyMOLGlobals *G, CViewElem **handle, int action, int index, int count, int target);
104 int ViewElemXtoFrame(BlockRect *rect, int frames, int x, int nearest);
105 void ViewElemDrawBox(PyMOLGlobals *G, BlockRect *rect,int first, int last,
106                      int frames, float *color4, int fill, CGO *orthoCGO);
107 void ViewElemDrawLabel(
108     PyMOLGlobals* G, const char* label, const BlockRect* rect, CGO* orthoCGO);
109 
110 #endif
111