00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef IMPALGEBRA_MACROS_H
00010 #define IMPALGEBRA_MACROS_H
00011
00012 #ifdef IMP_DOXYGEN
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #define IMP_VOLUME_GEOMETRY_METHODS(Name, area, volume, bounding_box)
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #define IMP_VOLUME_GEOMETRY_METHODS_D(Name, area, volume, bounding_box)
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #define IMP_LINEAR_GEOMETRY_METHODS(Name, bounding_box)
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 #define IMP_AREA_GEOMETRY_METHODS(Name, area, bounding_box)
00059
00060 #else
00061 #define IMP_VOLUME_GEOMETRY_METHODS(Name, area, volume, bounding_box) \
00062 inline double get_surface_area(const Name &g) { \
00063 area; \
00064 } \
00065 inline double get_volume(const Name &g) { \
00066 volume; \
00067 } \
00068 inline BoundingBoxD<3> get_bounding_box(const Name &g) { \
00069 bounding_box; \
00070 } \
00071 IMP_OUTPUT_OPERATOR(Name) \
00072 typedef std::vector<Name> Name##s
00073
00074 #define IMP_VOLUME_GEOMETRY_METHODS_D(Name, area, volume, bounding_box) \
00075 inline double get_surface_area(const Name##D<3> &g) { \
00076 area; \
00077 } \
00078 inline double get_volume(const Name##D<3> &g) { \
00079 volume; \
00080 } \
00081 template <unsigned int D> \
00082 inline BoundingBoxD<D> get_bounding_box(const Name##D<D> &g) { \
00083 bounding_box; \
00084 } \
00085 IMP_OUTPUT_OPERATOR_D(Name##D) \
00086 IMPALGEBRA_EXPORT_TEMPLATE(Name##D<3>); \
00087 IMP_NO_SWIG(typedef Name##D<2> Name##2D); \
00088 IMP_NO_SWIG(typedef std::vector<Name##2D> Name##2Ds); \
00089 IMP_NO_SWIG(typedef Name##D<3> Name##3D); \
00090 IMP_NO_SWIG(typedef std::vector<Name##3D> Name##3Ds); \
00091 IMP_NO_SWIG(typedef Name##D<4> Name##4D); \
00092 IMP_NO_SWIG(typedef std::vector<Name##4D> Name##4Ds)
00093
00094
00095 #define IMP_LINEAR_GEOMETRY_METHODS(Name, bounding_box) \
00096 inline BoundingBoxD<3> get_bounding_box(const Name &g) { \
00097 bounding_box; \
00098 } \
00099 IMP_OUTPUT_OPERATOR(Name) \
00100 typedef std::vector<Name> Name##s
00101
00102 #define IMP_AREA_GEOMETRY_METHODS(Name, area, bounding_box) \
00103 inline double get_area(const Name &g) { \
00104 area; \
00105 } \
00106 inline BoundingBoxD<3> get_bounding_box(const Name &g) { \
00107 bounding_box; \
00108 } \
00109 IMP_OUTPUT_OPERATOR(Name) \
00110 typedef std::vector<Name> Name##s
00111
00112 #endif
00113
00114 #endif