本文整理汇总了C++中Expression::SetOperatorName方法的典型用法代码示例。如果您正苦于以下问题:C++ Expression::SetOperatorName方法的具体用法?C++ Expression::SetOperatorName怎么用?C++ Expression::SetOperatorName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Expression
的用法示例。
在下文中一共展示了Expression::SetOperatorName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Expression
// ****************************************************************************
// Method: ModelFitCommonPluginInfo::GetCreatedExpressions
//
// Purpose:
// Get the expressions this operator can generate.
//
// Arguments:
// md the metadata to create our expressions around
//
// Programmer: Rob Sisneros
// Creation: omitted
//
// Modifications:
// Jeremy Meredith, Thu Jan 12 13:28:49 EST 2012
// Some files, like curves, don't have expressions. Don't assume
// we have any meshes in our file.
//
// ****************************************************************************
ExpressionList *
ModelFitCommonPluginInfo::GetCreatedExpressions(const avtDatabaseMetaData *md)
{
int i;
int numMeshes = md->GetNumMeshes();
if (numMeshes == 0)
return NULL;
Expression *e = new Expression();
char mesh[1024];
strcpy(mesh, md->GetMesh(0)->name.c_str());
std::string varname = "operators/ModelFit/model"; //(";
//varname += mesh;
//varname += ")";
e->SetName(varname);
char defn[1024];
sprintf(defn, "point_constant(%s, 0)", mesh);
e->SetDefinition(defn);
e->SetMeshName(std::string(mesh));
e->SetType(Expression::ScalarMeshVar);
e->SetFromOperator(true);
e->SetOperatorName("ModelFit");
ExpressionList *expressions = new ExpressionList;
expressions->AddExpressions(*e);
delete e;
e = new Expression();
varname = "operators/ModelFit/distance"; //(";
//varname += mesh;
//varname += ")";
e->SetName(varname);
sprintf(defn, "point_constant(%s, 0)", mesh);
e->SetDefinition(defn);
e->SetMeshName(std::string(mesh));
e->SetType(Expression::ScalarMeshVar);
e->SetFromOperator(true);
e->SetOperatorName("ModelFit");
expressions->AddExpressions(*e);
return expressions;
}
示例2: sprintf
ExpressionList *
ExtractPointFunction2DCommonPluginInfo::GetCreatedExpressions(const avtDatabaseMetaData *md)
{
char name[1024];
char defn[1024];
ExpressionList *el = new ExpressionList;
for (int i = 0 ; i < md->GetNumArrays() ; i++)
{
const char *array = md->GetArrays(i).name.c_str();
const char *mesh = md->GetArrays(i).meshName.c_str();
Expression e;
sprintf(name, "operators/ExtractPointFunction2D/%s", array);
e.SetName(name);
e.SetType(Expression::ScalarMeshVar);
e.SetFromOperator(true);
e.SetOperatorName("ExtractPointFunction2D");
sprintf(defn, "cell_constant(<%s>, 0)", mesh);
e.SetDefinition(defn);
el->AddExpressions(e);
}
const ExpressionList &oldEL = md->GetExprList();
for (int i = 0 ; i < oldEL.GetNumExpressions() ; i++)
{
const Expression &e = oldEL.GetExpressions(i);
if (e.GetType() == Expression::ArrayMeshVar)
{
{
if (e.GetFromOperator())
continue; // weird ordering behavior otherwise
Expression e2;
sprintf(name, "operators/ExtractPointFunction2D/%s", e.GetName().c_str());
e2.SetName(name);
e2.SetType(Expression::ScalarMeshVar);
e2.SetFromOperator(true);
e2.SetOperatorName("ExtractPointFunction2D");
sprintf(defn, "cell_constant(<%s>, 0.)", e.GetName().c_str());
e2.SetDefinition(defn);
el->AddExpressions(e2);
}
}
}
return el;
}