Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

situsplugin.C File Reference

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include "molfile_plugin.h"

Go to the source code of this file.

Compounds

struct  situs_t

Defines

#define MIN(X, Y)   (((X)<(Y))? (X) : (Y))
#define MAX(X, Y)   (((X)>(Y))? (X) : (Y))
#define TOLERANCE   1e-4

Functions

void * open_situs_read (const char *filepath, const char *filetype, int *natoms)
int read_situs_metadata (void *v, int *nsets, molfile_volumetric_t **metadata)
int read_situs_data (void *v, int set, float *datablock, float *colorblock)
void close_situs_read (void *v)
void * open_situs_write (const char *filepath, const char *filetype, int natoms)
void close_situs_write (void *v)
float situs_voxel_value_safe (int x, int y, int z, const int xsize, const int ysize, const int zsize, const float *data)
 return voxel, after safely clamping index to valid range. More...

float situs_voxel_value_interpolate (float xv, float yv, float zv, const int xsize, const int ysize, const int zsize, const float *data)
 return interpolated value from 8 nearest neighbor voxels. More...

float situs_voxel_value_interpolate_from_coord (float xpos, float ypos, float zpos, const float *origin, const float *xdelta, const float *ydelta, const float *zdelta, const int xsize, const int ysize, const int zsize, float *data)
 return interpolated value of voxel, based on atomic coords. XXX need to account for non-orthog. cells. More...

int write_situs_data (void *v, molfile_volumetric_t *metadata, float *datablock, float *colorblock)
VMDPLUGIN_API int VMDPLUGIN_init (void)
VMDPLUGIN_API int VMDPLUGIN_register (void *v, vmdplugin_register_cb cb)
VMDPLUGIN_API int VMDPLUGIN_fini (void)

Variables

const float NAN = sqrtf(-1.f)
molfile_plugin_t plugin


Define Documentation

#define MAX X,
     (((X)>(Y))? (X) : (Y))
 

Definition at line 40 of file situsplugin.C.

#define MIN X,
     (((X)<(Y))? (X) : (Y))
 

Definition at line 39 of file situsplugin.C.

#define TOLERANCE   1e-4
 

Definition at line 42 of file situsplugin.C.

Referenced by write_situs_data.


Function Documentation

void close_situs_read void *    v [static]
 

Definition at line 150 of file situsplugin.C.

References situs_t::fd, and situs_t::vol.

Referenced by VMDPLUGIN_init.

void close_situs_write void *    v [static]
 

Definition at line 169 of file situsplugin.C.

Referenced by VMDPLUGIN_init.

void* open_situs_read const char *    filepath,
const char *    filetype,
int *    natoms
[static]
 

Definition at line 57 of file situsplugin.C.

References molfile_volumetric_t::dataname, situs_t::fd, molfile_volumetric_t::has_color, MOLFILE_NUMATOMS_NONE, situs_t::nsets, molfile_volumetric_t::origin, situs_t::vol, molfile_volumetric_t::xaxis, molfile_volumetric_t::xsize, molfile_volumetric_t::yaxis, molfile_volumetric_t::ysize, molfile_volumetric_t::zaxis, and molfile_volumetric_t::zsize.

Referenced by VMDPLUGIN_init.

void* open_situs_write const char *    filepath,
const char *    filetype,
int    natoms
[static]
 

Definition at line 159 of file situsplugin.C.

Referenced by VMDPLUGIN_init.

int read_situs_data void *    v,
int    set,
float *    datablock,
float *    colorblock
[static]
 

Definition at line 127 of file situsplugin.C.

References situs_t::fd, MOLFILE_ERROR, situs_t::vol, molfile_volumetric_t::xsize, molfile_volumetric_t::ysize, and molfile_volumetric_t::zsize.

Referenced by VMDPLUGIN_init.

int read_situs_metadata void *    v,
int *    nsets,
molfile_volumetric_t **    metadata
[static]
 

Definition at line 118 of file situsplugin.C.

References situs_t::nsets, and situs_t::vol.

Referenced by VMDPLUGIN_init.

float situs_voxel_value_interpolate float    xv,
float    yv,
float    zv,
const int    xsize,
const int    ysize,
const int    zsize,
const float *    data
 

return interpolated value from 8 nearest neighbor voxels.

Definition at line 191 of file situsplugin.C.

References situs_voxel_value_safe.

Referenced by situs_voxel_value_interpolate_from_coord.

float situs_voxel_value_interpolate_from_coord float    xpos,
float    ypos,
float    zpos,
const float *    origin,
const float *    xdelta,
const float *    ydelta,
const float *    zdelta,
const int    xsize,
const int    ysize,
const int    zsize,
float *    data
 

return interpolated value of voxel, based on atomic coords. XXX need to account for non-orthog. cells.

Definition at line 223 of file situsplugin.C.

References NAN, and situs_voxel_value_interpolate.

Referenced by write_situs_data.

float situs_voxel_value_safe int    x,
int    y,
int    z,
const int    xsize,
const int    ysize,
const int    zsize,
const float *    data
 

return voxel, after safely clamping index to valid range.

Definition at line 181 of file situsplugin.C.

Referenced by situs_voxel_value_interpolate.

VMDPLUGIN_API int VMDPLUGIN_fini void   
 

Definition at line 378 of file situsplugin.C.

References VMDPLUGIN_API, and VMDPLUGIN_SUCCESS.

VMDPLUGIN_API int VMDPLUGIN_init void   
 

Definition at line 350 of file situsplugin.C.

References molfile_plugin_t::close_file_read, molfile_plugin_t::close_file_write, close_situs_read, close_situs_write, molfile_plugin_t::filename_extension, MOLFILE_PLUGIN_TYPE, molfile_plugin_t::open_file_read, molfile_plugin_t::open_file_write, open_situs_read, open_situs_write, read_situs_data, read_situs_metadata, molfile_plugin_t::read_volumetric_data, molfile_plugin_t::read_volumetric_metadata, vmdplugin_ABIVERSION, VMDPLUGIN_API, VMDPLUGIN_SUCCESS, VMDPLUGIN_THREADSAFE, write_situs_data, and molfile_plugin_t::write_volumetric_data.

VMDPLUGIN_API int VMDPLUGIN_register void *    v,
vmdplugin_register_cb    cb
 

Definition at line 373 of file situsplugin.C.

References VMDPLUGIN_API, vmdplugin_register_cb, and VMDPLUGIN_SUCCESS.

int write_situs_data void *    v,
molfile_volumetric_t   metadata,
float *    datablock,
float *    colorblock
[static]
 

Definition at line 238 of file situsplugin.C.

References MIN, MOLFILE_ERROR, molfile_volumetric_t::origin, situs_voxel_value_interpolate_from_coord, TOLERANCE, molfile_volumetric_t::xaxis, molfile_volumetric_t::xsize, molfile_volumetric_t::yaxis, molfile_volumetric_t::ysize, molfile_volumetric_t::zaxis, and molfile_volumetric_t::zsize.

Referenced by VMDPLUGIN_init.


Variable Documentation

const float NAN = sqrtf(-1.f)
 

Definition at line 45 of file situsplugin.C.

Referenced by situs_voxel_value_interpolate_from_coord.

molfile_plugin_t plugin [static]
 

Definition at line 348 of file situsplugin.C.


Generated on Fri Jan 24 02:56:38 2020 for VMD Plugins (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002