Commit c6945dc2 authored by whitlocb's avatar whitlocb

Fixes for libsim: VisItAddOperator. Improvements to VisItSetPlotOptions, VisItSetOperatorOptions

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@25603 18c085ea-50e0-402c-830e-de6fd14e8384
parent 049dcad9
......@@ -123,20 +123,28 @@ class STATE_API AttributeGroup
public:
enum FieldType {
FieldType_unknown,
FieldType_bool,
FieldType_boolVector,
FieldType_char,
FieldType_charArray,
FieldType_charVector,
FieldType_uchar,
FieldType_ucharArray,
FieldType_ucharVector,
FieldType_int,
FieldType_intArray,
FieldType_intVector,
FieldType_bool,
FieldType_boolVector,
FieldType_long,
FieldType_longArray,
FieldType_longVector,
FieldType_float,
FieldType_floatArray,
FieldType_floatVector,
FieldType_double,
FieldType_doubleArray,
FieldType_doubleVector,
FieldType_uchar,
FieldType_ucharArray,
FieldType_ucharVector,
FieldType_string,
FieldType_stringArray,
FieldType_stringVector,
FieldType_colortable,
FieldType_color,
......
This diff is collapsed.
......@@ -14,39 +14,42 @@ int VisItAddPlot(const char *plotType, const char *var);
int VisItAddOperator(const char *operatorType, int applyToAll);
int VisItDrawPlots(void);
int VisItDeleteActivePlots(void);
int VisItSetActivePlots(const int *ids, int nids);
/* Maybe having 1 function is better...*/
int VisItSetPlotOptionsC(int id,const char*n,char v);
int VisItSetPlotOptionsUC(int id,const char*n,unsigned char v);
int VisItSetPlotOptionsI(int id,const char*n,int v);
int VisItSetPlotOptionsL(int id,const char*n,long v);
int VisItSetPlotOptionsF(int id,const char*n,float v);
int VisItSetPlotOptionsD(int id,const char*n,double v);
int VisItSetPlotOptionsS(int id,const char*n,const char *v);
/* Set values for the current plot */
int VisItSetPlotOptionsC(const char *name,char v);
int VisItSetPlotOptionsUC(const char *name,unsigned char v);
int VisItSetPlotOptionsB(const char *name,int v);
int VisItSetPlotOptionsI(const char *name,int v);
int VisItSetPlotOptionsL(const char *name,long v);
int VisItSetPlotOptionsF(const char *name,float v);
int VisItSetPlotOptionsD(const char *name,double v);
int VisItSetPlotOptionsS(const char *name,const char *v);
int VisItSetPlotOptionsCv(int id,const char*n,const char *v,int L);
int VisItSetPlotOptionsUCv(int id,const char*n,const unsigned char *v,int L);
int VisItSetPlotOptionsIv(int id,const char*n,const int *v,int L);
int VisItSetPlotOptionsLv(int id,const char*n,const long *v,int L);
int VisItSetPlotOptionsFv(int id,const char*n,const float *v,int L);
int VisItSetPlotOptionsDv(int id,const char*n,const double *v,int L);
int VisItSetPlotOptionsSv(int id,const char*n,const char **v,int L);
int VisItSetPlotOptionsCv(const char *name,const char *v,int L);
int VisItSetPlotOptionsUCv(const char *name,const unsigned char *v,int L);
int VisItSetPlotOptionsIv(const char *name,const int *v,int L);
int VisItSetPlotOptionsLv(const char *name,const long *v,int L);
int VisItSetPlotOptionsFv(const char *name,const float *v,int L);
int VisItSetPlotOptionsDv(const char *name,const double *v,int L);
int VisItSetPlotOptionsSv(const char *name,const char **v,int L);
/* Maybe having 1 function is better...*/
int VisItSetOperatorOptionsC(int pid, int oid,const char*n,char v);
int VisItSetOperatorOptionsUC(int pid, int oid,const char*n,unsigned char v);
int VisItSetOperatorOptionsI(int pid, int oid,const char*n,int v);
int VisItSetOperatorOptionsL(int pid, int oid,const char*n,long v);
int VisItSetOperatorOptionsF(int pid, int oid,const char*n,float v);
int VisItSetOperatorOptionsD(int pid, int oid,const char*n,double v);
int VisItSetOperatorOptionsS(int pid, int oid,const char*n,const char *v);
/* Set values for the current operator */
int VisItSetOperatorOptionsC(const char *name,char v);
int VisItSetOperatorOptionsUC(const char *name,unsigned char v);
int VisItSetOperatorOptionsB(const char *name,int v);
int VisItSetOperatorOptionsI(const char *name,int v);
int VisItSetOperatorOptionsL(const char *name,long v);
int VisItSetOperatorOptionsF(const char *name,float v);
int VisItSetOperatorOptionsD(const char *name,double v);
int VisItSetOperatorOptionsS(const char *name,const char *v);
int VisItSetOperatorOptionsCv(int pid, int oid,const char*n,const char *v,int L);
int VisItSetOperatorOptionsUCv(int pid, int oid,const char*n,const unsigned char *v,int L);
int VisItSetOperatorOptionsIv(int pid, int oid,const char*n,const int *v,int L);
int VisItSetOperatorOptionsLv(int pid, int oid,const char*n,const long *v,int L);
int VisItSetOperatorOptionsFv(int pid, int oid,const char*n,const float *v,int L);
int VisItSetOperatorOptionsDv(int pid, int oid,const char*n,const double *v,int L);
int VisItSetOperatorOptionsSv(int pid, int oid,const char*n,const char **v,int L);
int VisItSetOperatorOptionsCv(const char *name,const char *v,int L);
int VisItSetOperatorOptionsUCv(const char *name,const unsigned char *v,int L);
int VisItSetOperatorOptionsIv(const char *name,const int *v,int L);
int VisItSetOperatorOptionsLv(const char *name,const long *v,int L);
int VisItSetOperatorOptionsFv(const char *name,const float *v,int L);
int VisItSetOperatorOptionsDv(const char *name,const double *v,int L);
int VisItSetOperatorOptionsSv(const char *name,const char **v,int L);
#endif
This diff is collapsed.
......@@ -489,6 +489,10 @@
external visitdeleteactiveplots
integer visitdeleteactiveplots
! visitsetactiveplots(int ids, int nids)
external visitdeleteactiveplots
integer visitdeleteactiveplots
! visitexportdatabase(string filename, int lfilename,
! string format, int lformat,
! visit_handle vars)
......@@ -499,6 +503,125 @@
external visitrestoresession
integer visitrestoresession
!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
! Prototype plot attribute setting functions
!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
! visitsetplotoptionsc(string name, int lname, char val)
external visitsetplotoptionsc
integer visitsetplotoptionsc
! visitsetplotoptionsuc(string name, int lname, uchar val)
external visitsetplotoptionsuc
integer visitsetplotoptionsuc
! visitsetplotoptionsi(string name, int lname, int val)
external visitsetplotoptionsi
integer visitsetplotoptionsi
! visitsetplotoptionsl(string name, int lname, long val)
external visitsetplotoptionsl
integer visitsetplotoptionsl
! visitsetplotoptionsf(string name, int lname, float val)
external visitsetplotoptionsf
integer visitsetplotoptionsf
! visitsetplotoptionsd(string name, int lname, double val)
external visitsetplotoptionsd
integer visitsetplotoptionsd
! visitsetplotoptionss(string name, int lname, string val, int lval)
external visitsetplotoptionss
integer visitsetplotoptionss
! visitsetplotoptionscv(string name, int lname, char val, int nval)
external visitsetplotoptionscv
integer visitsetplotoptionscv
! visitsetplotoptionsucv(string name, int lname, uchar val, int nval)
external visitsetplotoptionsucv
integer visitsetplotoptionsucv
! visitsetplotoptionsiv(string name, int lname, int val, int nval)
external visitsetplotoptionsiv
integer visitsetplotoptionsiv
! visitsetplotoptionslv(string name, int lname, long val, int nval)
external visitsetplotoptionslv
integer visitsetplotoptionslv
! visitsetplotoptionsfv(string name, int lname, float val, int nval)
external visitsetplotoptionsfv
integer visitsetplotoptionsfv
! visitsetplotoptionsdv(string name, int lname, double val, int nval)
external visitsetplotoptionsdv
integer visitsetplotoptionsdv
! visitsetplotoptionssv(string name, int lname, string val, int nval,
! int stringWidth)
external visitsetplotoptionssv
integer visitsetplotoptionssv
!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
! Prototype operator attribute setting functions
!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
! visitsetoperatoroptionsc(string name, int lname, char val)
external visitsetoperatoroptionsc
integer visitsetoperatoroptionsc
! visitsetoperatoroptionsuc(string name, int lname, uchar val)
external visitsetoperatoroptionsuc
integer visitsetoperatoroptionsuc
! visitsetoperatoroptionsi(string name, int lname, int val)
external visitsetoperatoroptionsi
integer visitsetoperatoroptionsi
! visitsetoperatoroptionsl(string name, int lname, long val)
external visitsetoperatoroptionsl
integer visitsetoperatoroptionsl
! visitsetoperatoroptionsf(string name, int lname, float val)
external visitsetoperatoroptionsf
integer visitsetoperatoroptionsf
! visitsetoperatoroptionsd(string name, int lname, double val)
external visitsetoperatoroptionsd
integer visitsetoperatoroptionsd
! visitsetoperatoroptionss(string name, int lname, string val, int lval)
external visitsetoperatoroptionss
integer visitsetoperatoroptionss
! visitsetoperatoroptionscv(string name, int lname, char val, int nval)
external visitsetoperatoroptionscv
integer visitsetoperatoroptionscv
! visitsetoperatoroptionsucv(string name, int lname, uchar val, int nval)
external visitsetoperatoroptionsucv
integer visitsetoperatoroptionsucv
! visitsetoperatoroptionsiv(string name, int lname, int val, int nval)
external visitsetoperatoroptionsiv
integer visitsetoperatoroptionsiv
! visitsetoperatoroptionslv(string name, int lname, long val, int nval)
external visitsetoperatoroptionslv
integer visitsetoperatoroptionslv
! visitsetoperatoroptionsfv(string name, int lname, float val, int nval)
external visitsetoperatoroptionsfv
integer visitsetoperatoroptionsfv
! visitsetoperatoroptionsdv(string name, int lname, double val, int nval)
external visitsetoperatoroptionsdv
integer visitsetoperatoroptionsdv
! visitsetoperatoroptionssv(string name, int lname, string val,
! int nval, int stringWidth)
external visitsetoperatoroptionssv
integer visitsetoperatoroptionssv
!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
! Metric functions
......
This diff is collapsed.
......@@ -92,6 +92,11 @@ public:
bool AddOperator(const std::string &operatorType, bool applyToAll);
bool DrawPlots();
bool DeleteActivePlots();
bool SetActivePlots(const int *ids, int nids);
bool SetPlotOptions(const std::string &fieldName,
int fieldType, void *fieldVal, int fieldLen);
bool SetOperatorOptions(const std::string &fieldName,
int fieldType, void *fieldVal, int fieldLen);
private:
virtual void CreatePluginManagers();
......
......@@ -770,7 +770,8 @@ SimEngineManager::Execute(const EngineKey &/*ek*/, avtDataObjectReader_p &rdr,
&currentNetworkGlobalCellCount);
// Read the data object string that we harvested in WriteCallback.
ReadDataObjectString(rdr, dos);
if(success)
ReadDataObjectString(rdr, dos);
}
CATCH(VisItException)
{
......
......@@ -684,216 +684,97 @@ simv2_delete_active_plots(void *e)
return engine->DeleteActivePlots() ? VISIT_OKAY : VISIT_ERROR;
}
#if 0
// We don't need this stuff just yet...
// ****************************************************************************
// Method: simv2_set_active_plots
//
// Purpose:
// SimV2 function to set the active plots.
//
// Arguments:
// e : The engine pointer.
// ids : The list of plot ids.
// nids : The number of plot ids.
//
// Returns: OKAY on success, FALSE on failure.
//
// Note:
//
// Programmer: Brad Whitlock
// Creation: Mon Feb 2 13:57:29 PST 2015
//
// Modifications:
//
// ****************************************************************************
template <class T>
static std::vector<T> makevector(const T *val, int nval)
int
simv2_set_active_plots(void *e, const int *ids, int nids)
{
std::vector<T> vec;
vec.reserve(nval);
for(int i = 0; i < nval; ++i)
vec.push_back(val[i]);
return vec;
SimEngine *engine = (SimEngine*)(e);
return engine->SetActivePlots(ids, nids) ? VISIT_OKAY : VISIT_ERROR;
}
static int
SetAttributeSubjectValues(AttributeSubject *atts,
const std::string &name, int fieldType, void *fieldVal, int fieldLen)
{
int status = VISIT_OKAY;
int fIndex = atts->FieldNameToIndex(name);
if(fIndex < 0)
return VISIT_ERROR;
AttributeGroup::FieldType ft = atts->GetFieldType(fIndex);
if(fieldType == VISIT_FIELDTYPE_CHAR)
{
const char *val = (const char *)fieldVal;
if(ft == AttributeGroup::FieldType_bool)
atts->SetValue(name, *val > 0);
else
atts->SetValue(name, *val);
}
else if(fieldType == VISIT_FIELDTYPE_UNSIGNED_CHAR)
{
const unsigned char *val = (const unsigned char *)fieldVal;
if(ft == AttributeGroup::FieldType_uchar)
atts->SetValue(name, *val);
else if(ft == AttributeGroup::FieldType_bool)
atts->SetValue(name, *val > 0);
else
status = VISIT_ERROR;
}
else if(fieldType == VISIT_FIELDTYPE_INT)
{
const int *val = (const int *)fieldVal;
if(ft == AttributeGroup::FieldType_bool)
atts->SetValue(name, *val > 0);
// else if(ft == AttributeGroup::FieldType_long)
// atts->SetValue(name, long(*val));
else if(ft == AttributeGroup::FieldType_float)
atts->SetValue(name, float(*val));
else if(ft == AttributeGroup::FieldType_double)
atts->SetValue(name, double(*val));
else
atts->SetValue(name, *val);
}
else if(fieldType == VISIT_FIELDTYPE_LONG)
{
const long *val = (const long *)fieldVal;
if(ft == AttributeGroup::FieldType_bool)
atts->SetValue(name, *val > 0);
else if(ft == AttributeGroup::FieldType_int)
atts->SetValue(name, int(*val));
else if(ft == AttributeGroup::FieldType_float)
atts->SetValue(name, float(*val));
else if(ft == AttributeGroup::FieldType_double)
atts->SetValue(name, double(*val));
else
atts->SetValue(name, *val);
}
else if(fieldType == VISIT_FIELDTYPE_FLOAT)
{
const float *val = (const float *)fieldVal;
if(ft == AttributeGroup::FieldType_bool)
atts->SetValue(name, *val > 0);
else if(ft == AttributeGroup::FieldType_int)
atts->SetValue(name, int(*val));
// else if(ft == AttributeGroup::FieldType_long)
// atts->SetValue(name, long(*val));
else if(ft == AttributeGroup::FieldType_double)
atts->SetValue(name, double(*val));
else
atts->SetValue(name, *val);
}
else if(fieldType == VISIT_FIELDTYPE_LONG)
{
const double *val = (const double *)fieldVal;
if(ft == AttributeGroup::FieldType_bool)
atts->SetValue(name, *val > 0);
else if(ft == AttributeGroup::FieldType_int)
atts->SetValue(name, int(*val));
else if(ft == AttributeGroup::FieldType_float)
atts->SetValue(name, float(*val));
else if(ft == AttributeGroup::FieldType_double)
atts->SetValue(name, *val);
else
atts->SetValue(name, long(*val));
}
else if(fieldType == VISIT_FIELDTYPE_STRING)
{
std::string val((const char *)fieldVal);
atts->SetValue(name, val);
}
// Array and vector
if(fieldType == VISIT_FIELDTYPE_CHAR_ARRAY)
{
const char *val = (const char *)fieldVal;
atts->SetValue(name, val, fieldLen);
}
else if(fieldType == VISIT_FIELDTYPE_UNSIGNED_CHAR_ARRAY)
{
const unsigned char *val = (const unsigned char *)fieldVal;
if(ft == AttributeGroup::FieldType_ucharVector)
atts->SetValue(name, makevector(val, fieldLen));
else
atts->SetValue(name, val, fieldLen);
}
else if(fieldType == VISIT_FIELDTYPE_INT_ARRAY)
{
const int *val = (const int *)fieldVal;
if(ft == AttributeGroup::FieldType_intVector)
atts->SetValue(name, makevector(val, fieldLen));
else
atts->SetValue(name, val, fieldLen);
}
else if(fieldType == VISIT_FIELDTYPE_LONG_ARRAY)
{
const long *val = (const long *)fieldVal;
// if(ft == AttributeGroup::FieldType_longVector)
// atts->SetValue(name, makevector(val, fieldLen));
// else
atts->SetValue(name, val, fieldLen);
}
else if(fieldType == VISIT_FIELDTYPE_FLOAT_ARRAY)
{
const float *val = (const float *)fieldVal;
// if(ft == AttributeGroup::FieldType_floatVector)
// atts->SetValue(name, makevector(val, fieldLen));
// else
atts->SetValue(name, val, fieldLen);
}
else if(fieldType == VISIT_FIELDTYPE_DOUBLE_ARRAY)
{
const double *val = (const double *)fieldVal;
if(ft == AttributeGroup::FieldType_doubleVector)
atts->SetValue(name, makevector(val, fieldLen));
else
atts->SetValue(name, val, fieldLen);
}
else if(fieldType == VISIT_FIELDTYPE_STRING_ARRAY)
{
const char **val = (const char **)fieldVal;
stringVector s;
s.resize(fieldLen);
for(int i = 0; i < fieldLen; ++i)
s[i] = std::string(val[i]);
atts->SetValue(name, &s[0], fieldLen);
}
else
status = VISIT_ERROR;
return status;
}
#endif
// ****************************************************************************
// Method: simv2_set_plot_options
//
// Purpose:
// SimV2 function to set plot options.
//
// Arguments:
// e : The engine pointer.
// fieldName : The name of the field to set.
// fieldType : The type of the data we're passing in.
// fieldVal : A pointer to the field data we're passing in.
// fieldLen : The length of the field data (if it is an array).
//
// Returns: OKAY on success, FALSE on failure.
//
// Note:
//
// Programmer: Brad Whitlock
// Creation: Mon Feb 2 14:07:11 PST 2015
//
// Modifications:
//
// ****************************************************************************
int
simv2_set_plot_options(void * /*e*/, int plotID, const char *fieldName,
simv2_set_plot_options(void *e, const char *fieldName,
int fieldType, void *fieldVal, int fieldLen)
{
int status = VISIT_ERROR;
#if 0
TRY
{
std::map<int, PlotInformation>::iterator it = GetPlotInformation()->find(plotID);
if(it != GetPlotInformation()->end() && fieldVal != NULL)
{
status = SetAttributeSubjectValues(it->second.atts, std::string(fieldName), fieldType, fieldVal, fieldLen);
}
}
CATCHALL
{
}
ENDTRY
#endif
return status;
SimEngine *engine = (SimEngine*)(e);
return engine->SetPlotOptions(fieldName, fieldType, fieldVal, fieldLen) ? VISIT_OKAY : VISIT_ERROR;
}
// ****************************************************************************
// Method: simv2_set_operator_options
//
// Purpose:
// SimV2 function to set operator options.
//
// Arguments:
// e : The engine pointer.
// fieldName : The name of the field to set.
// fieldType : The type of the data we're passing in.
// fieldVal : A pointer to the field data we're passing in.
// fieldLen : The length of the field data (if it is an array).
//
// Returns: OKAY on success, FALSE on failure.
//
// Note:
//
// Programmer: Brad Whitlock
// Creation: Mon Feb 2 14:07:11 PST 2015
//
// Modifications:
//
// ****************************************************************************
int
simv2_set_operator_options(void * /*e*/, int plotID, int operatorID, const char *fieldName,
int fieldType, void *fieldVal, int fieldLen)
simv2_set_operator_options(void *e,
const char *fieldName, int fieldType, void *fieldVal, int fieldLen)
{
int status = VISIT_ERROR;
#if 0
TRY
{
std::map<int, PlotInformation>::iterator it = GetPlotInformation()->find(plotID);
if(it != GetPlotInformation()->end() && fieldVal != NULL)
{
if(operatorID >= 0 && operatorID < static_cast<int>(it->second.operators.size()))
{
status = SetAttributeSubjectValues(it->second.operators[operatorID].atts,
std::string(fieldName), fieldType, fieldVal, fieldLen);
}
}
}
CATCHALL
{
}
ENDTRY
#endif
return status;
SimEngine *engine = (SimEngine*)(e);
return engine->SetOperatorOptions(fieldName, fieldType, fieldVal, fieldLen) ? VISIT_OKAY : VISIT_ERROR;
}
// ****************************************************************************
......
......@@ -61,6 +61,9 @@ extern "C" {
// Brad Whitlock, Thu Sep 18 16:16:29 PDT 2014
// I added simv2_initialize_batch, simv2_exportdatabase, simv2_restoresession.
//
// Brad Whitlock, Mon Feb 2 13:58:45 PST 2015
// Added simv2_set_active_plots, changed set_plot_options, set_operator_options.
//
// ****************************************************************************
SIMV2_API void *simv2_get_engine();
......@@ -82,8 +85,10 @@ SIMV2_API int simv2_add_plot(void *, const char *, const char *);
SIMV2_API int simv2_add_operator(void *, const char *, int);
SIMV2_API int simv2_draw_plots(void *);
SIMV2_API int simv2_delete_active_plots(void *);
SIMV2_API int simv2_set_plot_options(void *, int, const char *, int, void *, int);
SIMV2_API int simv2_set_operator_options(void *, int, int, const char *, int, void *, int);
SIMV2_API int simv2_set_active_plots(void *, const int *, int);
SIMV2_API int simv2_set_plot_options(void *, const char *, int, void *, int);
SIMV2_API int simv2_set_operator_options(void *, const char *, int, void *, int);
SIMV2_API int simv2_exportdatabase(void *, const char *, const char *, visit_handle);
SIMV2_API int simv2_restoresession(void *, const char *);
......
This diff is collapsed.
#include <VisItControlInterface_V2.h>
#include <VisItDataInterface_V2.h>
#include <stdlib.h>
#include <math.h>
static const char *exportFormat = "FieldViewXDB_1.0";
static int export_visit(const char *filebase, const char **extractvars)
{
int retval = -1;
const char *var = NULL;
visit_handle vars = VISIT_INVALID_HANDLE;
if(VisIt_NameList_alloc(&vars))
{
VisIt_NameList_addName(vars, "default");
while((var = *extractvars++) != NULL)
VisIt_NameList_addName(vars, var);
if(VisItExportDatabase(filebase, exportFormat, vars) == VISIT_OKAY)
retval = 0;
else
retval = -2;
}
VisIt_NameList_free(vars);
return retval;
}
int extract_slice_3v(const char *filebase,
const double *v0, const double *v1, const double *v2,
const char **extractvars)
{
double origin[3], normal[3], vec1[3], vec2[3], mag;
origin[0] = v0[0];
origin[1] = v0[1];
origin[2] = v0[2];
vec1[0] = v1[0] - v0[0];
vec1[1] = v1[1] - v0[1];
vec1[2] = v1[2] - v0[2];
mag = sqrt(vec1[0]*vec1[0] + vec1[1]*vec1[1] + vec1[2]*vec1[2]);
if(mag > 0.)
{
vec1[0] /= mag;
vec1[1] /= mag;
vec1[2] /= mag;
}
vec2[0] = v2[0] - v0[0];
vec2[1] = v2[1] - v0[1];
vec2[2] = v2[2] - v0[2];
mag = sqrt(vec2[0]*vec2[0] + vec2[1]*vec2[1] + vec2[2]*vec2[2]);
if(mag > 0.)
{
vec2[0] /= mag;
vec2[1] /= mag;
vec2[2] /= mag;
}
normal[0] = vec1[1]*vec2[2] - vec1[2]*vec2[1];
normal[1] = vec1[2]*vec2[0] - vec1[0]*vec2[2];
normal[2] = vec1[0]*vec2[1] - vec1[1]*vec2[0];
return extract_slice_origin_normal(filebase, origin, normal, extractvars);
}
int extract_slice_origin_normal(const char *filebase,
const double *origin,
const double *normal,
const char **extractvars)
{
int retval = -1;
if(filebase == NULL || origin == NULL || normal == NULL || extractvars == NULL)
return retval;
if(VisItAddPlot("Pseudocolor", extractvars[0]) == VISIT_OKAY)
{
if(VisItAddOperator("Slice", 0) == VISIT_OKAY)
{
VisItSetOperatorOptionsI("originType", 0); // point intercept
VisItSetOperatorOptionsDv("originPoint", origin, 3);
VisItSetOperatorOptionsDv("normal", normal, 3);
VisItSetOperatorOptionsB("project2d", 0);
if(VisItDrawPlots() == VISIT_OKAY)
{
retval = export_visit(filebase, extractvars);
}
}
VisItDeleteActivePlots();
}
return retval;
}
int extract_slice(const char *filebase, int axis, double intercept,
const char **extractvars)
{
in