Debian Codegraph @

coot-utils/coot-shelx.hh

raw symbols SCIP
1 /* coot-utils/coot-shelx-ins.hh
2 *
3 * Copyright 2005, 2006, 2007 The University of York
4 * Author: Paul Emsley
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or (at
9 * your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 * 02110-1301, USA
20 */
21
22 #ifndef COOT_SHELX_HH
23 #define COOT_SHELX_HHcxx . . $ `coot-utils/coot-shelx.hh:23:9`!
24
25
26 #ifndef HAVE_STRINGcxx . . $ `utils/coot-fasta.hh:27:9`!
27 #include <string>
28 #define HAVE_STRING
29 #endif
30 #ifndef HAVE_VECTORcxx . . $ `utils/coot-fasta.hh:31:9`!
31 #include <vector>
32 #define HAVE_VECTOR
33 #endif
34
35 #include <map>
36
37
38 #include <mmdb2/mmdb_manager.h>
39 #include "clipper/core/cell.h"
40
41 namespace cootcxx . . $ coot/ {
42
43 class shelx_card_info_tcxx . . $ coot/shelx_card_info_t# {
44 public:
45 shelx_card_info_tcxx . . $ coot/shelx_card_info_t#shelx_card_info_t(49f6e7a06ebc5aa8).() {
46 spaced_startcxx . . $ coot/shelx_card_info_t#spaced_start. = 0;
47 }
48 stdcxx . . $ std/::stringcxx . . $ std/string# cardcxx . . $ coot/shelx_card_info_t#card.;
49 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> wordscxx . . $ coot/shelx_card_info_t#words.;
50 short int spaced_startcxx . . $ coot/shelx_card_info_t#spaced_start.;
51 bool last_word_is_equal_symbolcxx . . $ coot/shelx_card_info_t#last_word_is_equal_symbol(50ce9a9e25b4a850).() const;
52 void add_cardcxx . . $ coot/shelx_card_info_t#add_card(f0a0467a64ededf2).(const shelx_card_info_tcxx . . $ coot/shelx_card_info_t# &other) {
53
54 // only add_card if the first 4 characters of the line are not spaces
55 short int add_it = 0;
56 if (other.cardcxx . . $ coot/shelx_card_info_t#card..lengthcxx . . $ std/__cxx11/basic_string#length(7e80fff40d76986b).() > 3) {
57 if (other.cardcxx . . $ coot/shelx_card_info_t#card..substrcxx . . $ std/__cxx11/basic_string#substr(d59a03e0b0717fa0).(0,4) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). " ") {
58 add_it = 1; // it was a proper continuation line (according to GMS).
59 } else {
60 add_it = 0;
61 }
62 } else {
63 add_it = 0;
64 }
65 if (add_it == 1) {
66 cardcxx . . $ coot/shelx_card_info_t#card. +=cxx . . $ std/__cxx11/basic_string#`operator+=`(c0b47be1fddc0e75). other.cardcxx . . $ coot/shelx_card_info_t#card.;
67 if (wordscxx . . $ coot/shelx_card_info_t#words..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).() > 0) {
68 if (wordscxx . . $ coot/shelx_card_info_t#words..backcxx . . $ std/vector#back(6baabfa6fc7b3a8e).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "=")
69 wordscxx . . $ coot/shelx_card_info_t#words..resizecxx . . $ std/vector#resize(2c44cd906ae4e829).(wordscxx . . $ coot/shelx_card_info_t#words..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()-1);
70 }
71 for (unsigned int i=0; i<other.wordscxx . . $ coot/shelx_card_info_t#words..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); i++) {
72 wordscxx . . $ coot/shelx_card_info_t#words..push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(other.wordscxx . . $ coot/shelx_card_info_t#words.[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).i]);
73 }
74 }
75 }
76 // return -1 on no bang, else return the index of the ! (bang).
77 int bang_indexcxx . . $ coot/shelx_card_info_t#bang_index(455f465bc33b4cdf).() const;
78 void strip_post_bangcxx . . $ coot/shelx_card_info_t#strip_post_bang(49f6e7a06ebc5aa8).(); // removed commented lines
79 void empty_yorselfcxx . . $ coot/shelx_card_info_t#empty_yorself(49f6e7a06ebc5aa8).() {
80 cardcxx . . $ coot/shelx_card_info_t#card. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "";
81 wordscxx . . $ coot/shelx_card_info_t#words..clearcxx . . $ std/vector#clear(ced63f7c635d850d).();
82 }
83 };
84
85 // This is a class for handling symmetry for/from shelx.
86 //
87 // Shelx has it's symmetry in the for 1, -2, 3 where if positive,
88 // means centrosymmetric and negative means non-centrosymmetric.
89 //
90 // We need to make symm cards for centering operations
91 // (symm_cards_from_lat)
92 //
93 class symm_card_composition_tcxx . . $ coot/symm_card_composition_t# {
94 stdcxx . . $ std/::stringcxx . . $ std/string# fract_trans_to_strcxx . . $ coot/symm_card_composition_t#fract_trans_to_str(ffc0d510d034206b).(int itrans_frac) const;
95 public:
96 int x_elementcxx . . $ coot/symm_card_composition_t#x_element.[3], y_elementcxx . . $ coot/symm_card_composition_t#y_element.[3], z_elementcxx . . $ coot/symm_card_composition_t#z_element.[3];
97 int frac_transcxx . . $ coot/symm_card_composition_t#frac_trans.[3];
98 symm_card_composition_tcxx . . $ coot/symm_card_composition_t#symm_card_composition_t(49f6e7a06ebc5aa8).() {};
99 // e.g. "X,Y,Z-1/2"
100 explicit symm_card_composition_tcxx . . $ coot/symm_card_composition_t#symm_card_composition_t(9c546c94e5fcce4e).(const stdcxx . . $ std/::stringcxx . . $ std/string# &symm_card);
101 // e.g for F or I centering
102 void add_centering_fraccxx . . $ coot/symm_card_composition_t#add_centering_frac(b1146eedae1e1d0b).(int x_element_in,
103 int y_element_in,
104 int z_element_in);
105 void invertcxx . . $ coot/symm_card_composition_t#invert(49f6e7a06ebc5aa8).();
106 float trans_fraccxx . . $ coot/symm_card_composition_t#trans_frac(5b24f378accae0f5).(unsigned int index) const {
107 return frac_transcxx . . $ coot/symm_card_composition_t#frac_trans.[index]/12.0;
108 }
109 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> symm_cards_from_latcxx . . $ coot/symm_card_composition_t#symm_cards_from_lat(be026c7352d741ff).(int latt);
110 stdcxx . . $ std/::stringcxx . . $ std/string# symm_cardcxx . . $ coot/symm_card_composition_t#symm_card(219584694fe2b248).() const;
111 friend stdcxx . . $ std/::ostreamcxx . . $ std/ostream# & operatorcxx . . $ coot/`operator<<`(a657c0c751c78146).<<(stdcxx . . $ std/::ostreamcxx . . $ std/ostream# &s, const symm_card_composition_tcxx . . $ coot/symm_card_composition_t# &sc);
112 };
113 stdcxx . . $ std/::ostreamcxx . . $ std/ostream# & operatorcxx . . $ coot/`operator<<`(a657c0c751c78146).<<(stdcxx . . $ std/::ostreamcxx . . $ std/ostream# &s, const symm_card_composition_tcxx . . $ coot/symm_card_composition_t# &sc);
114
115 class shelx_rtab_chi_info_tcxx . . $ coot/shelx_rtab_chi_info_t# {
116 public:
117 int chicxx . . $ coot/shelx_rtab_chi_info_t#chi.;
118 stdcxx . . $ std/::stringcxx . . $ std/string# resnamecxx . . $ coot/shelx_rtab_chi_info_t#resname.;
119 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> chi_atomscxx . . $ coot/shelx_rtab_chi_info_t#chi_atoms.;
120 };
121
122 class shelx_sump_info_tcxx . . $ coot/shelx_sump_info_t# {
123 public:
124 int v1cxx . . $ coot/shelx_sump_info_t#v1.;
125 float v2cxx . . $ coot/shelx_sump_info_t#v2., v3cxx . . $ coot/shelx_sump_info_t#v3.;
126 int v4cxx . . $ coot/shelx_sump_info_t#v4.;
127 float v5cxx . . $ coot/shelx_sump_info_t#v5.;
128 int v6cxx . . $ coot/shelx_sump_info_t#v6.;
129 float v7cxx . . $ coot/shelx_sump_info_t#v7.;
130 int v8cxx . . $ coot/shelx_sump_info_t#v8.;
131 shelx_sump_info_tcxx . . $ coot/shelx_sump_info_t#shelx_sump_info_t(5dc6d18ba491dd1).(int v1_in,
132 float v2_in, float v3_in,
133 int v4_in,
134 float v5_in,
135 int v6_in,
136 float v7_in,
137 int v8_in) {
138 v1cxx . . $ coot/shelx_sump_info_t#v1. = v1_in;
139 v2cxx . . $ coot/shelx_sump_info_t#v2. = v2_in;
140 v3cxx . . $ coot/shelx_sump_info_t#v3. = v3_in;
141 v4cxx . . $ coot/shelx_sump_info_t#v4. = v4_in;
142 v5cxx . . $ coot/shelx_sump_info_t#v5. = v5_in;
143 v6cxx . . $ coot/shelx_sump_info_t#v6. = v6_in;
144 v7cxx . . $ coot/shelx_sump_info_t#v7. = v7_in;
145 v8cxx . . $ coot/shelx_sump_info_t#v8. = v8_in;
146 }
147 shelx_sump_info_tcxx . . $ coot/shelx_sump_info_t#shelx_sump_info_t(49f6e7a06ebc5aa8).() {
148 v1cxx . . $ coot/shelx_sump_info_t#v1. = 1;
149 v2cxx . . $ coot/shelx_sump_info_t#v2. = 0.01;
150 v3cxx . . $ coot/shelx_sump_info_t#v3. = 1.0;
151 v4cxx . . $ coot/shelx_sump_info_t#v4. = 14;
152 v5cxx . . $ coot/shelx_sump_info_t#v5. = 1.0;
153 v6cxx . . $ coot/shelx_sump_info_t#v6. = 15;
154 v7cxx . . $ coot/shelx_sump_info_t#v7. = 1.0;
155 v8cxx . . $ coot/shelx_sump_info_t#v8. = 16;
156 }
157 };
158
159 class shelx_read_file_info_tcxx . . $ coot/shelx_read_file_info_t# {
160 public:
161 int udd_afix_handlecxx . . $ coot/shelx_read_file_info_t#udd_afix_handle.;
162 int statuscxx . . $ coot/shelx_read_file_info_t#status.;
163 bool is_protein_flagcxx . . $ coot/shelx_read_file_info_t#is_protein_flag.;
164 mmdbcxx . . $ mmdb/::Managercxx . . $ mmdb/Manager# *molcxx . . $ coot/shelx_read_file_info_t#mol.;
165 shelx_read_file_info_tcxx . . $ coot/shelx_read_file_info_t#shelx_read_file_info_t(835b28c77aeedf71).(int a, int b, mmdbcxx . . $ mmdb/::Managercxx . . $ mmdb/Manager# *mol_in) {
166 statuscxx . . $ coot/shelx_read_file_info_t#status. = a;
167 udd_afix_handlecxx . . $ coot/shelx_read_file_info_t#udd_afix_handle. = b;
168 molcxx . . $ coot/shelx_read_file_info_t#mol. = mol_in;
169 is_protein_flagcxx . . $ coot/shelx_read_file_info_t#is_protein_flag. = 0;
170 }
171 };
172
173 // to capture ISOR and CONN info (we need to know the ranges of HETATMs)
174 //
175 class hetatom_rangecxx . . $ coot/hetatom_range# {
176 public:
177 mmdbcxx . . $ mmdb/::Atomcxx . . $ mmdb/Atom# *range_firstcxx . . $ coot/hetatom_range#range_first.;
178 mmdbcxx . . $ mmdb/::Atomcxx . . $ mmdb/Atom# *range_lastcxx . . $ coot/hetatom_range#range_last.;
179 int resno_offsetcxx . . $ coot/hetatom_range#resno_offset.;
180 hetatom_rangecxx . . $ coot/hetatom_range#hetatom_range(53b0eca2c22f0d1b).(mmdbcxx . . $ mmdb/::Atomcxx . . $ mmdb/Atom# *range_first_in, mmdbcxx . . $ mmdb/::Atomcxx . . $ mmdb/Atom# *range_last_in,
181 int resno_offset_in) {
182 range_firstcxx . . $ coot/hetatom_range#range_first. = range_first_in;
183 range_lastcxx . . $ coot/hetatom_range#range_last. = range_last_in;
184 resno_offsetcxx . . $ coot/hetatom_range#resno_offset. = resno_offset_in;
185 }
186 hetatom_rangecxx . . $ coot/hetatom_range#hetatom_range(49f6e7a06ebc5aa8).() {
187 range_firstcxx . . $ coot/hetatom_range#range_first. = 0;
188 range_lastcxx . . $ coot/hetatom_range#range_last. = 0;
189 resno_offsetcxx . . $ coot/hetatom_range#resno_offset. = 0;
190 }
191 };
192
193 class ShelxInscxx . . $ coot/ShelxIns# {
194 stdcxx . . $ std/::stringcxx . . $ std/string# titlecxx . . $ coot/ShelxIns#title.;
195 short int filled_flagcxx . . $ coot/ShelxIns#filled_flag.;
196 bool have_cell_flagcxx . . $ coot/ShelxIns#have_cell_flag.;
197 clippercxx . . $ clipper/::Cellcxx . . $ clipper/Cell# cellcxx . . $ coot/ShelxIns#cell.;
198 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> sfaccxx . . $ coot/ShelxIns#sfac.; // atom (types). RESI atom index into this vector
199 stdcxx . . $ std/::vectorcxx . . $ std/vector#<int> unitcxx . . $ coot/ShelxIns#unit.;
200 stdcxx . . $ std/::vectorcxx . . $ std/vector#<float> defscxx . . $ coot/ShelxIns#defs.;
201 stdcxx . . $ std/::vectorcxx . . $ std/vector#<int> cglscxx . . $ coot/ShelxIns#cgls.;
202 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> pre_atom_linescxx . . $ coot/ShelxIns#pre_atom_lines.;
203 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> post_atom_linescxx . . $ coot/ShelxIns#post_atom_lines.;
204 stdcxx . . $ std/::vectorcxx . . $ std/vector#<float> fvarscxx . . $ coot/ShelxIns#fvars.;
205 int shel_1cxx . . $ coot/ShelxIns#shel_1.;
206 float shel2cxx . . $ coot/ShelxIns#shel2.;
207 int fmapcxx . . $ coot/ShelxIns#fmap.;
208 int plan_1cxx . . $ coot/ShelxIns#plan_1.;
209 float plan_2cxx . . $ coot/ShelxIns#plan_2.;
210 int listcxx . . $ coot/ShelxIns#list.;
211 short int htab_flagcxx . . $ coot/ShelxIns#htab_flag.;
212 int wpdbcxx . . $ coot/ShelxIns#wpdb.;
213 stdcxx . . $ std/::vectorcxx . . $ std/vector#<shelx_rtab_chi_info_tcxx . . $ coot/shelx_rtab_chi_info_t#> rtab_chicxx . . $ coot/ShelxIns#rtab_chi.;
214 shelx_sump_info_tcxx . . $ coot/shelx_sump_info_t# sumpcxx . . $ coot/ShelxIns#sump.;
215 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> symm_cardscxx . . $ coot/ShelxIns#symm_cards.;
216 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> disp_cardscxx . . $ coot/ShelxIns#disp_cards.;
217 void initcxx . . $ coot/ShelxIns#init(49f6e7a06ebc5aa8).() { shel_1cxx . . $ coot/ShelxIns#shel_1. = -10; shel2cxx . . $ coot/ShelxIns#shel2. = -1.0;
218 fmapcxx . . $ coot/ShelxIns#fmap. = -1; plan_1cxx . . $ coot/ShelxIns#plan_1. = -1; plan_2cxx . . $ coot/ShelxIns#plan_2. = -1.0;
219 listcxx . . $ coot/ShelxIns#list. = -1;
220 htab_flagcxx . . $ coot/ShelxIns#htab_flag. = 0;
221 wpdbcxx . . $ coot/ShelxIns#wpdb. = -2;
222 have_cell_flagcxx . . $ coot/ShelxIns#have_cell_flag. = 0;
223 udd_afix_handlecxx . . $ coot/ShelxIns#udd_afix_handle. = -1;
224 filled_flagcxx . . $ coot/ShelxIns#filled_flag. = 0;
225 }
226
227 stdcxx . . $ std/::stringcxx . . $ std/string# make_atom_namecxx . . $ coot/ShelxIns#make_atom_name(84dffce9926326ff).(const stdcxx . . $ std/::stringcxx . . $ std/string# &atom_name_in,
228 const int &atomic_weight) const; // useless?
229 stdcxx . . $ std/::stringcxx . . $ std/string# make_atom_namecxx . . $ coot/ShelxIns#make_atom_name(ee8c6c2661a93592).(const stdcxx . . $ std/::stringcxx . . $ std/string# &atom_name_in,
230 const stdcxx . . $ std/::stringcxx . . $ std/string# &element) const; // used now (20051017)
231 stdcxx . . $ std/::stringcxx . . $ std/string# make_atom_elementcxx . . $ coot/ShelxIns#make_atom_element(84dffce9926326ff).(const stdcxx . . $ std/::stringcxx . . $ std/string# &atom_name_in,
232 const int &atomic_weight) const;
233 // return the success status of the assignment, 1 is OK, 0 is fail.
234 bool try_assign_cellcxx . . $ coot/ShelxIns#try_assign_cell(908cbfe7c4cfd7ac).(mmdbcxx . . $ mmdb/::Managercxx . . $ mmdb/Manager# *mol);
235
236 bool is_unit_linecxx . . $ coot/ShelxIns#is_unit_line(13a55b95a0133754).(const stdcxx . . $ std/::stringcxx . . $ std/string# &s) const {
237 bool r = 0;
238 if (s.lengthcxx . . $ std/__cxx11/basic_string#length(7e80fff40d76986b).() >= 4) {
239 if (s.substrcxx . . $ std/__cxx11/basic_string#substr(d59a03e0b0717fa0).(0, 4) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "UNIT") {
240 r = 1;
241 }
242 }
243 return r;
244 }
245 void write_sfac_linecxx . . $ coot/ShelxIns#write_sfac_line(490063bd7e6d8d5d).(stdcxx . . $ std/::ostreamcxx . . $ std/ostream# &f) const;
246 void write_disp_linescxx . . $ coot/ShelxIns#write_disp_lines(490063bd7e6d8d5d).(stdcxx . . $ std/::ostreamcxx . . $ std/ostream# &f) const;
247
248 shelx_card_info_tcxx . . $ coot/shelx_card_info_t# read_linecxx . . $ coot/ShelxIns#read_line(4f33d289021501a8).(stdcxx . . $ std/::ifstreamcxx . . $ std/ifstream# &f);
249 shelx_card_info_tcxx . . $ coot/shelx_card_info_t# read_cardcxx . . $ coot/ShelxIns#read_card(4f33d289021501a8).(stdcxx . . $ std/::ifstreamcxx . . $ std/ifstream# &f);
250 shelx_card_info_tcxx . . $ coot/shelx_card_info_t# read_card_extendedcxx . . $ coot/ShelxIns#read_card_extended(4f33d289021501a8).(stdcxx . . $ std/::ifstreamcxx . . $ std/ifstream# &f);
251 int get_sfac_indexcxx . . $ coot/ShelxIns#get_sfac_index(22cc3a531165f6b0).(const stdcxx . . $ std/::stringcxx . . $ std/string# &element) const; // -1 on not found
252 int altloc_to_part_nocxx . . $ coot/ShelxIns#altloc_to_part_no(22cc3a531165f6b0).(const stdcxx . . $ std/::stringcxx . . $ std/string# &altloc) const;
253
254 // As you add the atoms, check the residue name for being
255 // standard, and use that to decide if the atom is Het or not.
256 // And that means that the passed atom_vector needs to be a
257 // reference (or a pointer, but we don't do that here) and no
258 // longer const.
259 mmdbcxx . . $ mmdb/::Residuecxx . . $ mmdb/Residue# *add_shelx_residuecxx . . $ coot/ShelxIns#add_shelx_residue(2376ac4acd86a75a).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<mmdbcxx . . $ mmdb/::Atomcxx . . $ mmdb/Atom# *> &atom_vector,
260 const stdcxx . . $ std/::stringcxx . . $ std/string# &current_res_name,
261 int &current_res_no) const;
262 void save_fvarscxx . . $ coot/ShelxIns#save_fvars(f0a0467a64ededf2).(const shelx_card_info_tcxx . . $ coot/shelx_card_info_t# &card);
263 mmdbcxx . . $ mmdb/::Atomcxx . . $ mmdb/Atom# *make_atomcxx . . $ coot/ShelxIns#make_atom(ce93d976f80bb272).(const cootcxx . . $ coot/::shelx_card_info_tcxx . . $ coot/shelx_card_info_t# &card, const stdcxx . . $ std/::stringcxx . . $ std/string# &altconf,
264 int udd_afix_handle,
265 int udd_riding_atom_flag_handle,
266 int udd_riding_atom_negative_u_value_handle,
267 bool have_udd_atoms, int current_afix,
268 clippercxx . . $ clipper/::Cellcxx . . $ clipper/Cell# &cell, const stdcxx . . $ std/::vectorcxx . . $ std/vector#<mmdbcxx . . $ mmdb/::Atomcxx . . $ mmdb/Atom# *> &atom_vector) const;
269
270 // not const because we add atoms to sfac.
271 stdcxx . . $ std/::paircxx . . $ std/pair#<int, stdcxx . . $ std/::stringcxx . . $ std/string#> write_ins_file_internalcxx . . $ coot/ShelxIns#write_ins_file_internal(735828e21ac55b49).(mmdbcxx . . $ mmdb/::Managercxx . . $ mmdb/Manager# *mol_in,
272 const stdcxx . . $ std/::stringcxx . . $ std/string# &filename,
273 bool mol_is_from_shelx_ins=true);
274
275 void write_orthodox_pre_atom_linescxx . . $ coot/ShelxIns#write_orthodox_pre_atom_lines(a0c9e06b4e38d013).(stdcxx . . $ std/::ofstreamcxx . . $ std/ofstream# &f) const;
276
277 // not const because we add atoms to sfac.
278 void write_synthetic_pre_atom_linescxx . . $ coot/ShelxIns#write_synthetic_pre_atom_lines(d9873e789d0ec1b8).(mmdbcxx . . $ mmdb/::Managercxx . . $ mmdb/Manager# *mol, stdcxx . . $ std/::ofstreamcxx . . $ std/ofstream# &f);
279
280 mmdbcxx . . $ mmdb/::Atomcxx . . $ mmdb/Atom# *previous_non_riding_atomcxx . . $ coot/ShelxIns#previous_non_riding_atom(71d047228fb7d879).(const stdcxx . . $ std/::vectorcxx . . $ std/vector#<mmdbcxx . . $ mmdb/::Atomcxx . . $ mmdb/Atom# *> &atom_vector,
281 int udd_non_riding_atom_flag_handle) const {
282
283 if (atom_vector.sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()==0) {
284 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
285 } else {
286 for (int i=atom_vector.sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()-1; i>=0; i--) {
287 mmdbcxx . . $ mmdb/::Atomcxx . . $ mmdb/Atom# *at = atom_vector[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).i];
288 int ic = -1; // is riding atom flag
289 if (at->GetUDDatacxx . . $ mmdb/Atom#GetUDData(cd16dc99f8e6c2c2).(udd_non_riding_atom_flag_handle, ic) == mmdbcxx . . $ mmdb/::UDDATA_Okcxx . . $ mmdb/UDDATA_Ok.) {
290 if (ic==1)
291 return at;
292 } else {
293 // this can happen (currently) when udd_non_riding_atom_flag is not set to 1 in
294 // make_atom() (as happens when it is a riding atom)
295 // std::cout << "ooops UDData get failed" << std::endl;
296 }
297 }
298 // bad news if we get here.
299 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
300 }
301 }
302 stdcxx . . $ std/::stringcxx . . $ std/string# message_for_atomcxx . . $ coot/ShelxIns#message_for_atom(b7f1eec202fd4944).(const stdcxx . . $ std/::stringcxx . . $ std/string# &in_string, mmdbcxx . . $ mmdb/::Atomcxx . . $ mmdb/Atom# *at) const;
303 stdcxx . . $ std/::mapcxx . . $ std/map#<stdcxx . . $ std/::stringcxx . . $ std/string#, unsigned int> get_atomic_contentscxx . . $ coot/ShelxIns#get_atomic_contents(4ae6ff6f159d5edc).(mmdbcxx . . $ mmdb/::Managercxx . . $ mmdb/Manager# *mol) const;
304 bool mol_needs_shelx_transfercxx . . $ coot/ShelxIns#mol_needs_shelx_transfer(c97ade744ea18f36).(mmdbcxx . . $ mmdb/::Managercxx . . $ mmdb/Manager# *mol) const;
305
306 public:
307 ShelxInscxx . . $ coot/ShelxIns#ShelxIns(49f6e7a06ebc5aa8).() {initcxx . . $ coot/ShelxIns#init(49f6e7a06ebc5aa8).(); }
308 // pair: status (0: bad), udd_afix_handle (-1 bad)
309 shelx_read_file_info_tcxx . . $ coot/shelx_read_file_info_t# read_filecxx . . $ coot/ShelxIns#read_file(a2f67e308bd50c81).(const stdcxx . . $ std/::stringcxx . . $ std/string# &filename);
310 explicit ShelxInscxx . . $ coot/ShelxIns#ShelxIns(9c546c94e5fcce4e).(const stdcxx . . $ std/::stringcxx . . $ std/string# &filename);
311 // return status and message string
312 stdcxx . . $ std/::paircxx . . $ std/pair#<int, stdcxx . . $ std/::stringcxx . . $ std/string#> write_ins_filecxx . . $ coot/ShelxIns#write_ins_file(735828e21ac55b49).(mmdbcxx . . $ mmdb/::Managercxx . . $ mmdb/Manager# *mol,
313 const stdcxx . . $ std/::stringcxx . . $ std/string# &filename,
314 bool mol_is_from_shelx_ins=true);
315 // is this real shelx data or an empty holder?
316 short int is_filled_pcxx . . $ coot/ShelxIns#is_filled_p(524863554b4a534e).() const { return filled_flagcxx . . $ coot/ShelxIns#filled_flag.; }
317 int add_fvarcxx . . $ coot/ShelxIns#add_fvar(1bb0578f3efdc255).(float f); // return the shelx index FVAR number for this fvar
318 void set_fvarcxx . . $ coot/ShelxIns#set_fvar(43c79ee2f1b9aefe).(int fvar_no, float f); // set FVAR number fvar_no to value f
319 int udd_afix_handlecxx . . $ coot/ShelxIns#udd_afix_handle.;
320 int udd_riding_atom_negative_u_value_handlecxx . . $ coot/ShelxIns#udd_riding_atom_negative_u_value_handle.;
321 void debugcxx . . $ coot/ShelxIns#debug(83f5f38750778ac8).() const;
322 static int shelx_occ_to_fvarcxx . . $ coot/ShelxIns#shelx_occ_to_fvar(1bb0578f3efdc255).(float shelx_occ); // e.g. return 18 if shelx_occ 181.00,
323 // return -1 on a problem.
324 void add_pre_atoms_linecxx . . $ coot/ShelxIns#add_pre_atoms_line(9c546c94e5fcce4e).(const stdcxx . . $ std/::stringcxx . . $ std/string# &line) {
325 pre_atom_linescxx . . $ coot/ShelxIns#pre_atom_lines..push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(line);
326 }
327 int new_chain_offsetcxx . . $ coot/ShelxIns#new_chain_offset.;
328 void add_sfaccxx . . $ coot/ShelxIns#add_sfac(9c546c94e5fcce4e).(const stdcxx . . $ std/::stringcxx . . $ std/string# &ele); // do redundancy checking.
329 };
330
331 // Do lattice expansion and possible centro-symmetric expansion
332 // and add in X,Y,Z which shelx ins file does not require.
333 //
334 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> clipper_symm_stringscxx . . $ coot/clipper_symm_strings(d5c2d0a4e6999ddb).(const stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> &symm_vec,
335 int shelx_latt);
336
337 // return null on no conversion.
338 mmdbcxx . . $ mmdb/::Managercxx . . $ mmdb/Manager# *unshelxcxx . . $ coot/unshelx(944ee05653251b1a).(mmdbcxx . . $ mmdb/::Managercxx . . $ mmdb/Manager# *mol);
339 // return null on no conversion.
340 mmdbcxx . . $ mmdb/::Managercxx . . $ mmdb/Manager# *reshelxcxx . . $ coot/reshelx(944ee05653251b1a).(mmdbcxx . . $ mmdb/::Managercxx . . $ mmdb/Manager# *mol);
341
342 }
343
344 #endif // COOT_SHELX_HH