1 // ******************************************************************************
2 //
3 // Title: Force Field X.
4 // Description: Force Field X - Software for Molecular Biophysics.
5 // Copyright: Copyright (c) Michael J. Schnieders 2001-2025.
6 //
7 // This file is part of Force Field X.
8 //
9 // Force Field X is free software; you can redistribute it and/or modify it
10 // under the terms of the GNU General Public License version 3 as published by
11 // the Free Software Foundation.
12 //
13 // Force Field X is distributed in the hope that it will be useful, but WITHOUT
14 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 // details.
17 //
18 // You should have received a copy of the GNU General Public License along with
19 // Force Field X; if not, write to the Free Software Foundation, Inc., 59 Temple
20 // Place, Suite 330, Boston, MA 02111-1307 USA
21 //
22 // Linking this library statically or dynamically with other modules is making a
23 // combined work based on this library. Thus, the terms and conditions of the
24 // GNU General Public License cover the whole combination.
25 //
26 // As a special exception, the copyright holders of this library give you
27 // permission to link this library with independent modules to produce an
28 // executable, regardless of the license terms of these independent modules, and
29 // to copy and distribute the resulting executable under terms of your choice,
30 // provided that you also meet, for each linked independent module, the terms
31 // and conditions of the license of that module. An independent module is a
32 // module which is not derived from or based on this library. If you modify this
33 // library, you may extend this exception to your version of the library, but
34 // you are not obligated to do so. If you do not wish to do so, delete this
35 // exception statement from your version.
36 //
37 // ******************************************************************************
38 package ffx.realspace;
39
40 /**
41 * RealSpaceRefinementData class.
42 *
43 * @author Timothy D. Fenn
44 * @since 1.0
45 */
46 public class RealSpaceRefinementData {
47
48 private final int[] origin;
49 private final int[] extent;
50 private final int[] ni;
51 private double[] data;
52 private double densityScore;
53 private boolean periodic;
54
55 /** Constructor for RealSpaceRefinementData. */
56 RealSpaceRefinementData() {
57 origin = new int[3];
58 extent = new int[3];
59 ni = new int[3];
60 periodic = false;
61 }
62
63 /**
64 * Getter for the field <code>data</code>.
65 *
66 * @return the data
67 */
68 public double[] getData() {
69 return data;
70 }
71
72 /**
73 * Setter for the field <code>data</code>.
74 *
75 * @param data the data to set
76 */
77 public void setData(double[] data) {
78 this.data = data;
79 }
80
81 /**
82 * Getter for the field <code>ni</code>.
83 *
84 * @return the ni
85 */
86 public int[] getNi() {
87 return ni;
88 }
89
90 /**
91 * Getter for the field <code>origin</code>.
92 *
93 * @return the origin
94 */
95 public int[] getOrigin() {
96 return origin;
97 }
98
99 /**
100 * Setter for the field <code>extent</code>.
101 *
102 * @param x a int.
103 * @param y a int.
104 * @param z a int.
105 */
106 public void setExtent(int x, int y, int z) {
107 extent[0] = x;
108 extent[1] = y;
109 extent[2] = z;
110 }
111
112 /**
113 * setNI.
114 *
115 * @param x a int.
116 * @param y a int.
117 * @param z a int.
118 */
119 public void setNI(int x, int y, int z) {
120 ni[0] = x;
121 ni[1] = y;
122 ni[2] = z;
123 }
124
125 /**
126 * Setter for the field <code>origin</code>.
127 *
128 * @param x a int.
129 * @param y a int.
130 * @param z a int.
131 */
132 public void setOrigin(int x, int y, int z) {
133 origin[0] = x;
134 origin[1] = y;
135 origin[2] = z;
136 }
137
138 /**
139 * getDataIndex
140 *
141 * @param x a int.
142 * @param y a int.
143 * @param z a int.
144 * @return a double.
145 */
146 double getDataIndex(int x, int y, int z) {
147 int index = x + extent[0] * (y + extent[1] * z);
148 return data[index];
149 }
150
151 /**
152 * Getter for the field <code>extent</code>.
153 *
154 * @return the extent
155 */
156 int[] getExtent() {
157 return extent;
158 }
159
160 /**
161 * Getter for the field <code>densityScore</code>.
162 *
163 * @return the densityScore
164 */
165 double getDensityScore() {
166 return densityScore;
167 }
168
169 /**
170 * Setter for the field <code>densityScore</code>.
171 *
172 * @param densityScore the densityScore to set
173 */
174 void setDensityScore(double densityScore) {
175 this.densityScore = densityScore;
176 }
177
178 /**
179 * isPeriodic.
180 *
181 * @return the periodic
182 */
183 boolean isPeriodic() {
184 return periodic;
185 }
186
187 /**
188 * Setter for the field <code>periodic</code>.
189 *
190 * @param periodic the periodic to set
191 */
192 void setPeriodic(boolean periodic) {
193 this.periodic = periodic;
194 }
195 }