/src/openbabel/src/stereo/tetraplanar.cpp
Line | Count | Source |
1 | | /********************************************************************** |
2 | | tetraplanar.cpp - OBTetraPlanarStereo |
3 | | |
4 | | Copyright (C) 2009 by Tim Vandermeersch |
5 | | |
6 | | This file is part of the Open Babel project. |
7 | | For more information, see <http://openbabel.org/> |
8 | | |
9 | | This program is free software; you can redistribute it and/or modify |
10 | | it under the terms of the GNU General Public License as published by |
11 | | the Free Software Foundation; either version 2 of the License, or |
12 | | (at your option) any later version. |
13 | | |
14 | | This program is distributed in the hope that it will be useful, |
15 | | but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 | | GNU General Public License for more details. |
18 | | |
19 | | You should have received a copy of the GNU General Public License |
20 | | along with this program; if not, write to the Free Software |
21 | | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
22 | | 02110-1301, USA. |
23 | | **********************************************************************/ |
24 | | #include <openbabel/stereo/tetraplanar.h> |
25 | | #include <cassert> |
26 | | |
27 | | namespace OpenBabel { |
28 | | |
29 | 411k | OBTetraPlanarStereo::OBTetraPlanarStereo(OBMol *mol) : OBStereoBase(mol) |
30 | 411k | { |
31 | 411k | } |
32 | | |
33 | | OBTetraPlanarStereo::~OBTetraPlanarStereo() |
34 | 411k | { |
35 | 411k | } |
36 | | |
37 | | /* |
38 | | std::vector<unsigned long> OBTetraPlanarStereo::ToInternal(const std::vector<unsigned long> &refs, |
39 | | OBStereo::Shape shape) |
40 | | { |
41 | | assert( refs.size() == 4 ); |
42 | | std::vector<unsigned long> result(refs); |
43 | | |
44 | | switch (shape) { |
45 | | case OBStereo::ShapeU: |
46 | | // same as internal, just copy |
47 | | return result; |
48 | | case OBStereo::ShapeZ: |
49 | | // normalize to U shape |
50 | | result[1] = refs.at(2); |
51 | | result[2] = refs.at(3); |
52 | | result[3] = refs.at(1); |
53 | | return result; |
54 | | case OBStereo::Shape4: |
55 | | // normalize to U shape |
56 | | result[1] = refs.at(2); |
57 | | result[2] = refs.at(1); |
58 | | return result; |
59 | | } |
60 | | |
61 | | } |
62 | | |
63 | | std::vector<unsigned long> OBTetraPlanarStereo::ToShape(const std::vector<unsigned long> &refs, |
64 | | OBStereo::Shape shape) |
65 | | { |
66 | | assert( refs.size() == 4 ); |
67 | | std::vector<unsigned long> result(refs); |
68 | | |
69 | | switch (shape) { |
70 | | case OBStereo::ShapeU: |
71 | | // same as internal, just copy |
72 | | return result; |
73 | | case OBStereo::ShapeZ: |
74 | | // convert to U shape |
75 | | result[1] = refs.at(3); |
76 | | result[2] = refs.at(1); |
77 | | result[3] = refs.at(2); |
78 | | return result; |
79 | | case OBStereo::Shape4: |
80 | | // normalize to U shape |
81 | | result[1] = refs.at(2); |
82 | | result[2] = refs.at(1); |
83 | | return result; |
84 | | } |
85 | | |
86 | | } |
87 | | */ |
88 | | |
89 | | } |
90 | | |