00001 /* BurrTools 00002 * 00003 * BurrTools is the legal property of its developers, whose 00004 * names are listed in the COPYRIGHT file, which is included 00005 * within the source distribution. 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License 00009 * as published by the Free Software Foundation; either version 2 00010 * of the License, or (at your option) any later version. 00011 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00020 */ 00021 #ifndef __SYMMETRIES_H__ 00022 #define __SYMMETRIES_H__ 00023 00024 #include <inttypes.h> 00025 00026 // this modules contains just some helper functions for transformations and symmetry handling 00027 00029 #define TND (unsigned char)(-1) 00030 00061 typedef uint8_t symmetries_t; 00062 00063 /* some macros for the symmeties_t type */ 00064 00068 #define unSymmetric(s) ((s) == 0) 00069 00074 #define symmetryInvalid() (0xFF) 00075 00079 #define isSymmetryInvalid(s) ((s) == 0xFF) 00080 00081 class voxel_c; 00082 00090 class symmetries_c { 00091 00092 public: 00093 00094 symmetries_c(void) {} 00095 virtual ~symmetries_c(void) {} 00096 00101 virtual unsigned int getNumTransformations(void) const = 0; 00102 00108 virtual unsigned int getNumTransformationsMirror(void) const = 0; 00109 00116 virtual bool symmetrieContainsTransformation(symmetries_t s, unsigned int t) const = 0; 00117 00123 virtual bool isTransformationUnique(symmetries_t s, unsigned int t) const = 0; 00124 00131 virtual unsigned char transAdd(unsigned char t1, unsigned char t2) const = 0; 00132 00146 virtual unsigned char minimizeTransformation(symmetries_t s, unsigned char trans) const = 0; 00147 00152 virtual unsigned int countSymmetryIntersection(symmetries_t resultSym, symmetries_t s2) const = 0; 00153 00158 virtual bool symmetriesLeft(symmetries_t resultSym, symmetries_t s2) const = 0; 00159 00164 virtual bool symmetryContainsMirror(symmetries_t sym) const = 0; 00165 00167 virtual symmetries_t calculateSymmetry(const voxel_c * pp) const = 0; 00168 00175 virtual bool symmetryKnown(const voxel_c * pp) const = 0; 00176 00177 private: 00178 00179 // no copying and assigning 00180 symmetries_c(const symmetries_c&); 00181 void operator=(const symmetries_c&); 00182 }; 00183 00184 #endif