File: Map.h

package info (click to toggle)
pymol 1.8.4.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 42,248 kB
  • ctags: 24,095
  • sloc: cpp: 474,635; python: 75,034; ansic: 22,888; sh: 236; makefile: 78; csh: 21
file content (95 lines) | stat: -rw-r--r-- 2,928 bytes parent folder | download | duplicates (3)
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


/* 
A* -------------------------------------------------------------------
B* This file contains source code for the PyMOL computer program
C* Copyright (c) Schrodinger, LLC. 
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_Map
#define _H_Map


/* Map - a 3-D hash object for optimizing neighbor searches */

#include"Vector.h"
#include"PyMOLGlobals.h"

typedef struct {
  PyMOLGlobals *G;
  float Div;
  float recipDiv;
  Vector3i Dim;
  int D1D2;
  Vector3i iMin, iMax;
  int *Head, *Link;
  int *EHead, *EList, *EMask;
  int NVert;
  int NEElem;
  Vector3f Max, Min;
  int group_id;
  int block_base;
} MapType;

typedef struct {
  PyMOLGlobals *G;
  int *Cache, *CacheLink, CacheStart;
  int block_base;

} MapCache;

#define MapBorder 2

MapType *MapNew(PyMOLGlobals * G, float range, float *vert, int nVert, float *extent);
MapType *MapNewCached(PyMOLGlobals * G, float range, float *vert, int nVert,
                      float *extent, int group_id, int block_id);

MapType *MapNewFlagged(PyMOLGlobals * G, float range, float *vert, int nVert,
                       float *extent, int *flag);
int MapSetupExpress(MapType * I);
int MapSetupExpressPerp(MapType * I, float *vert, float front, int nVertHint,
			int negative_start, int *spanner);

void MapFree(MapType * I);

#define MapFirst(m,a,b,c) (m->Head + ((a) * m->D1D2) + ((b)*m->Dim[2]) + (c))

#define MapEStart(m,a,b,c) (m->EHead + ((a) * m->D1D2) + ((b)*m->Dim[2]) + (c))

#define MapNext(m,a) (*(m->Link+(a)))
void MapLocus(MapType * map, const float *v, int *a, int *b, int *c);
int *MapLocusEStart(MapType * map, const float *v);

int MapExclLocus(MapType * map, const float *v, int *a, int *b, int *c);

#define MapCache(m,a) {(m)->Cache[a]=1;(m)->CacheLink[a]=(m)->CacheStart;(m)->CacheStart=a;}
#define MapCached(m,a) ((m)->Cache[a])

int MapCacheInit(MapCache * M, MapType * I, int group_id, int block_base);
void MapCacheReset(MapCache * M);
void MapCacheFree(MapCache * M, int group_id, int block_base);

float MapGetSeparation(PyMOLGlobals * G, float range, const float *mx, const float *mn,
                       float *diagonal);
float MapGetDiv(MapType * I);


/* special routines for raytracing */

int MapInside(MapType * I, const float *v, int *a, int *b, int *c);

int MapInsideXY(MapType * I, const float *v, int *a, int *b, int *c);
int MapSetupExpressXY(MapType * I, int n_vert, int negative_start);

int MapSetupExpressXYVert(MapType * I, float *vert, int n_vert, int negative_start);

#endif