00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00023
00024 #ifndef BTK_CONCEPTS_ATOM_CONCEPT_HPP
00025 #define BTK_CONCEPTS_ATOM_CONCEPT_HPP
00026
00050
00229
00230 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00231
00232 #include <string>
00233 #include <iostream>
00234
00235 #include <boost/concept_check.hpp>
00236
00237 #include <btk/core/concepts/chemically_typed_concept.hpp>
00238 #include <btk/core/math/btk_vector.hpp>
00239
00240 namespace BTK {
00241 namespace CONCEPTS {
00242
00243 template <class T>
00244 struct AtomConcept
00245 {
00246 typedef typename T::atom_id_type at;
00247 typedef typename T::element_id_type et;
00248 typedef typename T::chemical_type_system cts_t;
00249
00250 void constraints() {
00251 boost::function_requires<boost::DefaultConstructibleConcept<T> >();
00252 boost::function_requires<boost::CopyConstructibleConcept<T> >();
00253 boost::function_requires<boost::EqualityComparableConcept<T> >();
00254 boost::function_requires<boost::AssignableConcept<T> >();
00255 boost::function_requires<ChemicallyTypedConcept<T> >();
00256
00257
00258 T atom2(pos,atom_type,element_type,atom_num,cts);
00259
00260 atom.set_element_type(element_type);
00261 atom.set_position(pos);
00262 atom.set_number(atom_num);
00263
00264 const_constraints(atom);
00265 }
00266
00267 void const_constraints(T const & atom) {
00268 element_type = atom.element_type();
00269 pos = atom.position();
00270 atom_num = atom.number();
00271
00272 s = atom.selected();
00273 atom.select(s);
00274
00275 std::cout << atom.print(std::cout);
00276 std::cout << atom.print(std::cout,
00277 atom_num,
00278 group_num,
00279 chain_id,
00280 group_name);
00281 }
00282
00283 T atom;
00284 BTK::MATH::BTKVector pos;
00285 at atom_type;
00286 et element_type;
00287 bool s;
00288 int atom_num, group_num;
00289 std::string atom_name, group_name;
00290 char chain_id;
00291 cts_t cts;
00292 };
00293
00294 }
00295 }
00296
00297 #endif // DOXYGEN_SHOULD_SKIP_THIS
00298
00299 #endif // BTK_CONCEPTS_ATOM_CONCEPT_HPP