File: PyMOLObject.h

package info (click to toggle)
pymol 1.2r2-1.1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 38,716 kB
  • ctags: 23,006
  • sloc: ansic: 480,417; python: 70,953; cpp: 12,928; sh: 10,266; makefile: 530; csh: 21
file content (143 lines) | stat: -rw-r--r-- 5,537 bytes parent folder | download
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

/* 
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_PyMOLObject
#define _H_PyMOLObject


/* literally a 3-D object...also an object object */

#include"Base.h"
#include"Ray.h"
#include"Rep.h"
#include"Setting.h"
#include"PyMOLGlobals.h"
#include"View.h"
#include"Word.h"

typedef char ObjectNameType[WordLength];

#define cObjectMolecule     1
#define cObjectMap          2
#define cObjectMesh         3

/* cObjectDist now cObjectMeasurement */
#define cObjectMeasurement  4
#define cObjectCallback     5
#define cObjectCGO          6
#define cObjectSurface      7
#define cObjectGadget       8
#define cObjectCalculator   9
#define cObjectSlice        10
#define cObjectAlignment    11
#define cObjectGroup        12


/* 
   the object base class is in the process of being converted to support
   states explicitly (an unfortunate early omission), which will allow
   for simplified implementation of future multi-state objects.
 */

typedef struct CObjectState {
  PyMOLGlobals *G;
  double *Matrix;
} CObjectState;

#ifndef CObject_DEFINED
typedef struct _CObject CObject;
#define CObject_DEFINED
#endif

struct _CObject {
  PyMOLGlobals *G;
  void (*fUpdate) (CObject * I);        /* update representations */
  void (*fRender) (CObject * I, RenderInfo * info);
  void (*fFree) (CObject * I);
  int (*fGetNFrame) (CObject * I);
  void (*fDescribeElement) (CObject * I, int index, char *buffer);
  void (*fInvalidate) (CObject * I, int rep, int level, int state);
  CSetting **(*fGetSettingHandle) (CObject * I, int state);
  char *(*fGetCaption) (CObject * I);
  CObjectState *(*fGetObjectState) (CObject * I, int state);
  int type;
  ObjectNameType Name;
  int Color;
  int RepVis[cRepCnt];
  float ExtentMin[3], ExtentMax[3];
  int ExtentFlag, TTTFlag;
  float TTT[16];                /* translate, transform, translate matrix (to apply when rendering) */
  CSetting *Setting;
  int Enabled;                  /* read-only... maintained by Scene */
  int Context;                  /* 0 = Camera, 1 = Unit Window, 2 = Scaled Window */
  CViewElem *ViewElem;          /* for animating objects via the TTT */

  /* not pickled */
  int grid_slot;
  int Grabbed;
};

void ObjectInit(PyMOLGlobals * G, CObject * I);
int ObjectCopyHeader(CObject * I, CObject * src);
void ObjectPurge(CObject * I);
void ObjectSetName(CObject * I, char *name);
void ObjectMakeValidName(char *name);
void ObjectPurgeSettings(CObject * I);
void ObjectFree(CObject * I);
void ObjectUseColor(CObject * I);
void ObjectSetRepVis(CObject * I, int rep, int state);
void ObjectToggleRepVis(CObject * I, int rep);
void ObjectPrepareContext(CObject * I, CRay * ray);
void ObjectSetTTT(CObject * I, float *ttt, int state,int store);
int ObjectGetTTT(CObject * I, float **ttt, int state);
int ObjectGetTotalMatrix(CObject * I, int state, int history, double *matrix);
void ObjectCombineTTT(CObject * I, float *ttt, int reverse_order, int store);
void ObjectTranslateTTT(CObject * T, float *v,int store);
void ObjectSetTTTOrigin(CObject * I, float *origin);
void ObjectResetTTT(CObject * I,int store);
PyObject *ObjectAsPyList(CObject * I);
int ObjectFromPyList(PyMOLGlobals * G, PyObject * list, CObject * I);
int ObjectGetCurrentState(CObject * I, int ignore_all_states);
void ObjectAdjustStateRebuildRange(CObject * I, int *start, int *stop);
int ObjectMotion(CObject * I, int action, int first,
                 int last, float power, float bias,
                 int simple, float linear, int wrap,
                 int hand, int window, int cycles, int state, int quiet);
int ObjectGetSpecLevel(CObject * I, int frame);
void ObjectMotionTrim(CObject *I, int n_frame);
void ObjectMotionExtend(CObject *I, int n_frame);
void ObjectDrawViewElem(CObject *I, BlockRect *rect, int frames);
void ObjectStateInit(PyMOLGlobals * G, CObjectState * I);
void ObjectStateCopy(CObjectState * dst, CObjectState * src);
void ObjectStatePurge(CObjectState * I);
void ObjectStateSetMatrix(CObjectState * I, double *matrix);
double *ObjectStateGetMatrix(CObjectState * I);
void ObjectStateTransformMatrix(CObjectState * I, double *matrix);
void ObjectStateResetMatrix(CObjectState * I);
PyObject *ObjectStateAsPyList(CObjectState * I);
int ObjectStateFromPyList(PyMOLGlobals * G, PyObject * list, CObjectState * I);
int ObjectStatePushAndApplyMatrix(CObjectState * I, RenderInfo * info);
void ObjectStatePopMatrix(CObjectState * I, RenderInfo * info);
void ObjectStateRightCombineMatrixR44d(CObjectState * I, double *matrix);
void ObjectStateLeftCombineMatrixR44d(CObjectState * I, double *matrix);
void ObjectStateCombineMatrixTTT(CObjectState * I, float *matrix);
int ObjectMotionModify(CObject *I,int action, int index, int count,int target, int freeze, int localize);
void ObjectMotionReinterpolate(CObject *I);
int ObjectMotionGetLength(CObject *I);

typedef struct _CObjectUpdateThreadInfo CObjectUpdateThreadInfo;

#endif