File: ObjectGadgetRamp.h

package info (click to toggle)
pymol 3.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 74,084 kB
  • sloc: cpp: 482,660; python: 89,328; ansic: 29,512; javascript: 6,792; sh: 84; makefile: 25
file content (103 lines) | stat: -rw-r--r-- 3,463 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

/* 
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_ObjectGadgetRamp
#define _H_ObjectGadgetRamp

#include"os_python.h"

#include "ObjectGadget.h"

struct ObjectMap;
struct ObjectMolecule;

#define cRampNone 0
#define cRampMap 1
#define cRampMol 2

struct ObjectGadgetRamp : public ObjectGadget {
  int RampType = 0;

  int NLevel = 0;
  pymol::vla<float> Level;
  pymol::vla<float> LevelTmp;
  pymol::vla<float> Color;
  int var_index = 0;

  /* cRampMap */

  ObjectNameType SrcName;
  int SrcState;

  int CalcMode = 0;

  /* fields below are not saved in session */
  ObjectMap *Map = nullptr;
  ObjectMolecule *Mol = nullptr;

  float border = 0.018f;
  float width = 0.9f;
  float height = 0.06f;
  float bar_height = 0.03f;
  float text_raise = 0.003f;
  float text_border = 0.004f;
  float text_scale_h = 0.04f;
  float text_scale_v = 0.02f;
  float x = (1.0f - (width + 2 * border)) / 2.0f;
  float y = 0.12f;
  ObjectGadgetRamp(PyMOLGlobals* G);
  ~ObjectGadgetRamp();

  // virtual methods
  void update() override;
  void invalidate(cRep_t rep, cRepInv_t level, int state) override;
};

#define cRAMP_TRADITIONAL 1
#define cRAMP_SLUDGE 2
#define cRAMP_OCEAN 3
#define cRAMP_HOT 4
#define cRAMP_GRAYABLE 5
#define cRAMP_RAINBOW 6
#define cRAMP_AFMHOT 7
#define cRAMP_GRAYSCALE 8

ObjectGadgetRamp *ObjectGadgetRampMapNewAsDefined(PyMOLGlobals * G,
                                                  ObjectGadgetRamp *I,
                                                  ObjectMap * map,
                                                  pymol::vla<float>&& level_vla,
                                                  pymol::vla<float>&& color_vla,
                                                  int map_state, float *vert_vla,
                                                  float beyond, float within, float sigma,
                                                  int zero, int calc_mode);

ObjectGadgetRamp *ObjectGadgetRampMolNewAsDefined(PyMOLGlobals * G,
                                                  ObjectGadgetRamp *I,
                                                  ObjectMolecule * mol,
                                                  pymol::vla<float>&& level_vla,
                                                  pymol::vla<float>&& color_vla,
                                                  int mol_state, int calc_mode);

int ObjectGadgetRampInterpolate(ObjectGadgetRamp * I, float level, float *color);
int ObjectGadgetRampInterVertex(ObjectGadgetRamp * I, const float *pos, float *color,
                                int state);

PyObject *ObjectGadgetRampAsPyList(ObjectGadgetRamp * I);
int ObjectGadgetRampNewFromPyList(PyMOLGlobals * G, PyObject * list,
				      ObjectGadgetRamp ** result, int version);

void ObjectGadgetRampFree(ObjectGadgetRamp * I);
#endif