1 /*
2 A* -------------------------------------------------------------------
3 B* This file contains source code for the PyMOL computer program
4 C* copyright 1998-2000 by Warren Lyford Delano of DeLano Scientific.
5 D* -------------------------------------------------------------------
6 E* It is unlawful to modify or remove this copyright notice.
7 F* -------------------------------------------------------------------
8 G* Please see the accompanying LICENSE file for further information.
9 H* -------------------------------------------------------------------
10 I* Additional authors of this source file include:
11 -*
12 -*
13 -*
14 Z* -------------------------------------------------------------------
15 */
16 #ifndef _H_DistSet
17 #define _H_DistSet
18 
19 #include "Base.h"
20 #include "PyMOLObject.h"
21 #include "Rep.h"
22 #include "vla.h"
23 
24 #include <forward_list>
25 
26 struct ObjectDist;
27 
28 struct CMeasureInfo {
29   /* AtomInfoType.unique_id */
30   int id[4];
31   /* offset into this distance set's Coord list */
32   int offset;
33   /* save object state */
34   int state[4];
35   /* distance, angle, or dihedral */
36   int measureType;
37 };
38 
39 struct DistSet : CObjectState {
40   DistSet(PyMOLGlobals *);
41   ~DistSet();
42 
43   // methods
44   void update(int state);
45   void render(RenderInfo *);
46   void invalidateRep(int type, int level);
47 
48   ObjectDist *Obj = nullptr;
49 
50   pymol::vla<float> Coord;
51   int NIndex = 0;
52 
53   ::Rep* Rep[cRepCnt] = {nullptr}; /* an array of pointers to representations */
getNRepDistSet54   static int getNRep() { return cRepCnt; }
55 
56   pymol::vla<float> LabCoord;
57   pymol::vla<LabPosType> LabPos;
58   int NLabel = 0;
59 
60   pymol::vla<float> AngleCoord;
61   int NAngleIndex = 0;
62 
63   pymol::vla<float> DihedralCoord;
64   int NDihedralIndex = 0;
65 
66   std::forward_list<CMeasureInfo> MeasureInfo;
67 };
68 
69 #define DistSetNew(G) (new DistSet(G))
70 PyObject *DistSetAsPyList(DistSet * I);
71 int DistSetFromPyList(PyMOLGlobals * G, PyObject * list, DistSet ** cs);
72 int DistSetGetExtent(DistSet * I, float *mn, float *mx);
73 int DistSetMoveLabel(DistSet * I, int at, float *v, int mode);
74 int DistSetGetLabelVertex(DistSet * I, int at, float *v);
75 /* -- JV */
76 int DistSetMoveWithObject(DistSet* I, struct ObjectMolecule * O);
77 /* -- JV end */
78 
79 #endif
80