00001 #ifndef NANOSHAPERINTERFACE_H
00002 #define NANOSHAPERINTERFACE_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #include "ResizeArray.h"
00038
00040 struct NanoShaperCoord {
00041 float x[3];
00042 int operator==(const NanoShaperCoord& c) {
00043 return !memcmp(x, c.x, 3L*sizeof(float));
00044 }
00045 };
00046
00048 struct NanoShaperFace {
00049 int vertex[3];
00050
00051 int surface_type;
00052
00053
00054
00055 int anaface;
00056
00057
00058 int component;
00059
00060 int operator==(const NanoShaperFace &f) {
00061 return (!memcmp(vertex, f.vertex, 3L*sizeof(float)) &&
00062 surface_type==f.surface_type && anaface==f.anaface &&
00063 component==f.component);
00064 }
00065 };
00066
00069 class NanoShaperInterface {
00070 public:
00072 enum {BAD_RANGE = -2, NO_PORTS = -3, NO_CONNECTION = -4,
00073 NO_INITIALIZATION = -5, NANOSHAPER_DIED = -6, COMPUTED = 1};
00074
00075 enum {NS_SURF_SES = 0,
00076 NS_SURF_SKIN = 1,
00077 NS_SURF_BLOBBY = 2,
00078 NS_SURF_POCKETS = 3};
00079
00081 void clear();
00082
00083
00084 int compute_from_file(int surftype, float gspacing,
00085 float probe_radius, float skin_parm, float blob_parm,
00086 int n, int *ids, float *xyzr, int *flgs);
00087
00088 int err;
00089 NanoShaperInterface(void) { err = 0; }
00090 ResizeArray<int> atomids;
00091 ResizeArray<NanoShaperFace> faces;
00092 ResizeArray<NanoShaperCoord> coords;
00093 ResizeArray<NanoShaperCoord> norms;
00094 };
00095
00096 #endif
00097