00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <math.h>
00023 #include <stdlib.h>
00024 #include <stdio.h>
00025
00026 #include "DrawMolItem.h"
00027 #include "BaseMolecule.h"
00028 #include "Inform.h"
00029 #include "Isosurface.h"
00030 #include "MoleculeList.h"
00031 #include "Scene.h"
00032 #include "VolumetricData.h"
00033 #include "VMDApp.h"
00034 #include "utilities.h"
00035 #include "WKFUtils.h"
00036 #include "Measure.h"
00037
00038 #define MYSGN(a) (((a) > 0) ? 1 : -1)
00039
00040 void DrawMolItem::draw_quicksurf(float *pos, int quality, float radscale, float isovalue, float gridspacing) {
00041 const int *colidx = NULL;
00042 const float *cmap = NULL;
00043
00044 if (atomSel->selected < 1)
00045 return;
00046
00047 if (!mol->numframes() || gridspacing <= 0.0f)
00048 return;
00049
00050 #if 0
00051
00052
00053 int frame = mol->frame();
00054 const Timestep *ts = mol->get_frame(frame);
00055 #endif
00056 const float *radii = mol->radius();
00057
00058 int usecolor = draw_volume_get_colorid();
00059
00060
00061
00062 if ((atomColor->method() != AtomColor::COLORID) &&
00063 (atomColor->method() != AtomColor::MOLECULE)) {
00064 colidx = atomColor->color;
00065 cmap = scene->color_value(0);
00066 } else {
00067 cmap = scene->color_value(usecolor);
00068 }
00069
00070
00071 sprintf(commentBuffer, "Mol[%d] Rep[%d] QuickSurf", mol->id(), repNumber);
00072 cmdCommentX.putdata(commentBuffer, cmdList);
00073 append(DMATERIALON);
00074 cmdColorIndex.putdata(usecolor, cmdList);
00075
00076
00077 mol->app->qsurf->calc_surf(atomSel, mol, pos, radii, quality, radscale,
00078 gridspacing, isovalue, colidx, cmap, cmdList);
00079 }
00080