Commit 50391db3 authored by whitlocb's avatar whitlocb

Added code generation support for floatVector. Add window generation support for stringVector.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@27452 18c085ea-50e0-402c-830e-de6fd14e8384
parent 0ece4928
...@@ -648,6 +648,10 @@ AttributeGroup::EqualTo(const AttributeGroup *atts) const ...@@ -648,6 +648,10 @@ AttributeGroup::EqualTo(const AttributeGroup *atts) const
if (!(EqualVal<float>::EqualArray(addr1,addr2,length))) if (!(EqualVal<float>::EqualArray(addr1,addr2,length)))
return false; return false;
break; break;
case FieldType_floatVector:
if (!(EqualVal<double>::EqualVector(addr1,addr2)))
return false;
break;
case FieldType_double: case FieldType_double:
if (!(EqualVal<double>::EqualScalar(addr1,addr2))) if (!(EqualVal<double>::EqualScalar(addr1,addr2)))
return false; return false;
......
...@@ -1030,6 +1030,19 @@ GUIBase::FloatsToQString(const float *vals, int nvals, int precision) ...@@ -1030,6 +1030,19 @@ GUIBase::FloatsToQString(const float *vals, int nvals, int precision)
return s; return s;
} }
QString
GUIBase::FloatsToQString(const floatVector &vals, int precision)
{
QString s;
for(size_t i = 0; i < vals.size(); ++i)
{
s += QString().setNum(vals[i], 'g', precision);
if(i < vals.size()-1)
s += " ";
}
return s;
}
// **************************************************************************** // ****************************************************************************
// Method: GUIBase::FloatToQString // Method: GUIBase::FloatToQString
// //
...@@ -1268,6 +1281,12 @@ GUIBase::LineEditGetFloats(QLineEdit *lineEdit, float *vals, int maxVals) ...@@ -1268,6 +1281,12 @@ GUIBase::LineEditGetFloats(QLineEdit *lineEdit, float *vals, int maxVals)
return QStringToFloats(lineEdit->displayText().trimmed(), vals, maxVals); return QStringToFloats(lineEdit->displayText().trimmed(), vals, maxVals);
} }
bool
GUIBase::LineEditGetFloats(QLineEdit *lineEdit, floatVector &vals, int maxVals)
{
return QStringToFloats(lineEdit->displayText().trimmed(), vals, maxVals);
}
// **************************************************************************** // ****************************************************************************
// Method: GUIBase::LineEditGetFloat // Method: GUIBase::LineEditGetFloat
// //
...@@ -1514,6 +1533,28 @@ GUIBase::QStringToFloats(const QString &str, float *vals, int maxVals) ...@@ -1514,6 +1533,28 @@ GUIBase::QStringToFloats(const QString &str, float *vals, int maxVals)
return retval; return retval;
} }
bool
GUIBase::QStringToFloats(const QString &str, floatVector &vals, int maxVals)
{
bool retval = false;
if(!str.isEmpty())
{
bool okay = true;
QStringList s = str.split(" ", QString::SkipEmptyParts);
for(int i = 0; i < s.size() && okay; ++i)
{
if(maxVals == -1 || i < maxVals)
vals.push_back(s[i].toFloat(&okay));
else
vals.push_back(0.);
}
retval = okay;
}
return retval;
}
// **************************************************************************** // ****************************************************************************
// Method: GUIBase::QStringToInts // Method: GUIBase::QStringToInts
// //
......
...@@ -128,6 +128,7 @@ public: ...@@ -128,6 +128,7 @@ public:
// Helpers for converting between values and qstrings // Helpers for converting between values and qstrings
static QString FloatsToQString(const float *, int, int precision=7); static QString FloatsToQString(const float *, int, int precision=7);
static QString FloatsToQString(const floatVector &, int precision=7);
static QString FloatToQString(float, int precision=7); static QString FloatToQString(float, int precision=7);
static QString DoublesToQString(const double *, int, int precision=16); static QString DoublesToQString(const double *, int, int precision=16);
static QString DoublesToQString(const doubleVector &, int precision=16); static QString DoublesToQString(const doubleVector &, int precision=16);
...@@ -137,6 +138,7 @@ public: ...@@ -137,6 +138,7 @@ public:
static QString IntToQString(int); static QString IntToQString(int);
static bool QStringToFloats(const QString &str, float *vals, int maxVals); static bool QStringToFloats(const QString &str, float *vals, int maxVals);
static bool QStringToFloats(const QString &str, floatVector &vals, int maxVals=-1);
static bool QStringToDoubles(const QString &str, double *vals, int maxVals); static bool QStringToDoubles(const QString &str, double *vals, int maxVals);
static bool QStringToDoubles(const QString &str, doubleVector &vals, int maxVal=-1); static bool QStringToDoubles(const QString &str, doubleVector &vals, int maxVal=-1);
static bool QStringToInts(const QString &str, int *vals, int maxVals); static bool QStringToInts(const QString &str, int *vals, int maxVals);
...@@ -145,6 +147,7 @@ public: ...@@ -145,6 +147,7 @@ public:
static bool LineEditGetDoubles(QLineEdit *lineEdit, double *vals, int maxVals); static bool LineEditGetDoubles(QLineEdit *lineEdit, double *vals, int maxVals);
static bool LineEditGetDoubles(QLineEdit *lineEdit, doubleVector &vals, int maxVals=-1); static bool LineEditGetDoubles(QLineEdit *lineEdit, doubleVector &vals, int maxVals=-1);
static bool LineEditGetFloats(QLineEdit *lineEdit, float *vals, int maxVals); static bool LineEditGetFloats(QLineEdit *lineEdit, float *vals, int maxVals);
static bool LineEditGetFloats(QLineEdit *lineEdit, floatVector &vals, int maxVals=-1);
static bool LineEditGetInts(QLineEdit *lineEdit, int *vals, int maxVals); static bool LineEditGetInts(QLineEdit *lineEdit, int *vals, int maxVals);
static bool LineEditGetInts(QLineEdit *lineEdit, intVector &vals, int maxVals=-1); static bool LineEditGetInts(QLineEdit *lineEdit, intVector &vals, int maxVals=-1);
......
...@@ -662,6 +662,53 @@ class FloatArray : public virtual Field ...@@ -662,6 +662,53 @@ class FloatArray : public virtual Field
}; };
//
// ------------------------------- FloatVector -------------------------------
//
class FloatVector : public virtual Field
{
public:
std::vector<float> val;
public:
FloatVector(const QString &n, const QString &l) : Field("floatVector",n,l) { }
virtual QString GetCPPName(bool, const QString &)
{
return "floatVector";
}
virtual void ClearValues()
{
val.clear();
}
virtual void SetValue(const QString &s, int = 0)
{
// can't use toFloat -- some versions of Qt disallow exponents beyond
// single precision range.
//val.push_back(s.toFloat());
val.push_back(atof(s.toStdString().c_str()));
valueSet = true;
}
virtual void Print(QTextStream &out)
{
Field::Print(out);
if (valueSet)
{
out << " value: ";
for (size_t i=0; i<val.size(); i++)
out << val[i] << " ";
out << endl;
}
}
virtual std::vector<QString> GetValueAsText()
{
std::vector<QString> retval;
if (valueSet)
for (size_t i=0; i<val.size(); i++)
retval.push_back(QString().sprintf("%f", val[i]));
return retval;
}
};
// //
// ---------------------------------- Double ---------------------------------- // ---------------------------------- Double ----------------------------------
// //
...@@ -1806,6 +1853,7 @@ class FieldFactory ...@@ -1806,6 +1853,7 @@ class FieldFactory
else if (type == "bool") f = new Bool(name,label); else if (type == "bool") f = new Bool(name,label);
else if (type == "float") f = new Float(name,label); else if (type == "float") f = new Float(name,label);
else if (type == "floatArray") f = new FloatArray(length,name,label); else if (type == "floatArray") f = new FloatArray(length,name,label);
else if (type == "floatVector") f = new FloatVector(name,label);
else if (type == "double") f = new Double(name,label); else if (type == "double") f = new Double(name,label);
else if (type == "doubleArray") f = new DoubleArray(length,name,label); else if (type == "doubleArray") f = new DoubleArray(length,name,label);
else if (type == "doubleVector") f = new DoubleVector(name,label); else if (type == "doubleVector") f = new DoubleVector(name,label);
......
...@@ -642,6 +642,31 @@ class AttsGeneratorFloatArray : public virtual FloatArray , public virtual AttsG ...@@ -642,6 +642,31 @@ class AttsGeneratorFloatArray : public virtual FloatArray , public virtual AttsG
}; };
//
// ------------------------------- FloatVector -------------------------------
//
class AttsGeneratorFloatVector : public virtual FloatVector , public virtual AttsGeneratorField
{
public:
AttsGeneratorFloatVector(const QString &n, const QString &l)
: Field("floatVector",n,l), FloatVector(n,l), AttsGeneratorField("floatVector",n,l) { }
virtual bool CanHaveConst() { return true; }
virtual QString GetAttributeGroupID()
{
return "f*";
}
virtual QString DataNodeConversion()
{
return "AsFloatVector";
}
virtual void WriteSourceSetDefault(QTextStream &c)
{
for (size_t i=0; i < val.size(); i++)
c << " " << name << ".push_back(" << val[i] << ");" << Endl;
}
};
// //
// ---------------------------------- Double ---------------------------------- // ---------------------------------- Double ----------------------------------
// //
...@@ -1582,6 +1607,7 @@ class AttsFieldFactory ...@@ -1582,6 +1607,7 @@ class AttsFieldFactory
else if (type == "bool") f = new AttsGeneratorBool(name,label); else if (type == "bool") f = new AttsGeneratorBool(name,label);
else if (type == "float") f = new AttsGeneratorFloat(name,label); else if (type == "float") f = new AttsGeneratorFloat(name,label);
else if (type == "floatArray") f = new AttsGeneratorFloatArray(length,name,label); else if (type == "floatArray") f = new AttsGeneratorFloatArray(length,name,label);
else if (type == "floatVector") f = new AttsGeneratorFloatVector(name,label);
else if (type == "double") f = new AttsGeneratorDouble(name,label); else if (type == "double") f = new AttsGeneratorDouble(name,label);
else if (type == "doubleArray") f = new AttsGeneratorDoubleArray(length,name,label); else if (type == "doubleArray") f = new AttsGeneratorDoubleArray(length,name,label);
else if (type == "doubleVector") f = new AttsGeneratorDoubleVector(name,label); else if (type == "doubleVector") f = new AttsGeneratorDoubleVector(name,label);
......
...@@ -603,6 +603,69 @@ class JavaGeneratorFloatArray : public virtual FloatArray , public virtual JavaG ...@@ -603,6 +603,69 @@ class JavaGeneratorFloatArray : public virtual FloatArray , public virtual JavaG
} }
}; };
//
// ------------------------------- FloatVector -------------------------------
//
class JavaGeneratorFloatVector : public virtual FloatVector , public virtual JavaGeneratorField
{
public:
JavaGeneratorFloatVector(const QString &n, const QString &l)
: Field("floatVector",n,l), FloatVector(n,l), JavaGeneratorField("floatVector",n,l) { }
virtual void AddImports(UniqueStringList &sl)
{
sl.AddString("import java.lang.Float;\n");
sl.AddString("import java.util.Vector;\n");
}
virtual QString GetCPPName(bool, const QString &)
{
return "Vector";
}
virtual void WriteSourceAttribute(QTextStream &h, int w)
{
h << " private " << GetCPPNameW(w) << " " << name << "; // vector of Float objects" << endl;
}
virtual void WriteSourceSetDefault(QTextStream &c)
{
c << " " << name << " = new Vector();" << endl;
for (size_t i = 0; i < val.size(); ++i)
c << " " << name << ".addElement(new Float(" << val[i] << "));" << endl;
}
virtual void WriteSourceCopyCode(QTextStream &c)
{
c << " " << name << " = new Vector(obj." << name << ".size());" << endl;
c << " for(i = 0; i < obj." << name << ".size(); ++i)" << endl;
c << " {" << endl;
c << " Float dv = (Float)obj." << name << ".elementAt(i);" << endl;
c << " " << name << ".addElement(new Float(dv.floatValue()));" << endl;
c << " }" << endl;
c << endl;
}
virtual void WriteSourceWriteAtts(QTextStream &c, const QString &indent)
{
c << indent << " buf.WriteFloatVector(" << name << ");" << endl;
}
virtual bool WriteSourceReadAtts(QTextStream &c, const QString &indent)
{
c << indent << "Set" << Name << "(buf.ReadFloatVector());" << endl;
return true;
}
virtual void WriteToString(QTextStream &c, const QString &indent)
{
c << indent << "str = str + floatVectorToString(\"" << name << "\", " << name << ", indent) + \"\\n\";" << endl;
}
virtual QString GetVectorStorageName() const
{
return "Float";
}
};
// //
// ---------------------------------- Double ---------------------------------- // ---------------------------------- Double ----------------------------------
...@@ -1675,6 +1738,7 @@ class JavaFieldFactory ...@@ -1675,6 +1738,7 @@ class JavaFieldFactory
else if (type == "bool") f = new JavaGeneratorBool(name,label); else if (type == "bool") f = new JavaGeneratorBool(name,label);
else if (type == "float") f = new JavaGeneratorFloat(name,label); else if (type == "float") f = new JavaGeneratorFloat(name,label);
else if (type == "floatArray") f = new JavaGeneratorFloatArray(length,name,label); else if (type == "floatArray") f = new JavaGeneratorFloatArray(length,name,label);
else if (type == "floatVector") f = new JavaGeneratorFloatVector(name,label);
else if (type == "double") f = new JavaGeneratorDouble(name,label); else if (type == "double") f = new JavaGeneratorDouble(name,label);
else if (type == "doubleArray") f = new JavaGeneratorDoubleArray(length,name,label); else if (type == "doubleArray") f = new JavaGeneratorDoubleArray(length,name,label);
else if (type == "doubleVector") f = new JavaGeneratorDoubleVector(name,label); else if (type == "doubleVector") f = new JavaGeneratorDoubleVector(name,label);
......
...@@ -780,6 +780,107 @@ class AttsGeneratorFloatArray : public virtual FloatArray , public virtual Pytho ...@@ -780,6 +780,107 @@ class AttsGeneratorFloatArray : public virtual FloatArray , public virtual Pytho
} }
}; };
//
// ------------------------------- FloatVector -------------------------------
//
class AttsGeneratorFloatVector : public virtual FloatVector , public virtual PythonGeneratorField
{
public:
AttsGeneratorFloatVector(const QString &n, const QString &l)
: Field("floatVector",n,l), FloatVector(n,l), PythonGeneratorField("floatVector",n,l) { }
virtual void WriteSetMethodBody(QTextStream &c, const QString &className)
{
c << " floatVector &vec = obj->data->";
if(accessType == Field::AccessPublic)
c << name;
else
c << MethodNameGet() << "()";
c << ";" << Endl;
c << " PyObject *tuple;" << Endl;
c << " if(!PyArg_ParseTuple(args, \"O\", &tuple))" << Endl;
c << " return NULL;" << Endl;
c << Endl;
c << " if(PyTuple_Check(tuple))" << Endl;
c << " {" << Endl;
c << " vec.resize(PyTuple_Size(tuple));" << Endl;
c << " for(int i = 0; i < PyTuple_Size(tuple); ++i)" << Endl;
c << " {" << Endl;
c << " PyObject *item = PyTuple_GET_ITEM(tuple, i);" << Endl;
c << " if(PyFloat_Check(item))" << Endl;
c << " vec[i] = float(PyFloat_AS_DOUBLE(item));" << Endl;
c << " else if(PyInt_Check(item))" << Endl;
c << " vec[i] = float(PyInt_AS_LONG(item));" << Endl;
c << " else if(PyLong_Check(item))" << Endl;
c << " vec[i] = float(PyLong_AsDouble(item));" << Endl;
c << " else" << Endl;
c << " vec[i] = 0.f;" << Endl;
c << " }" << Endl;
c << " }" << Endl;
c << " else if(PyFloat_Check(tuple))" << Endl;
c << " {" << Endl;
c << " vec.resize(1);" << Endl;
c << " vec[0] = float(PyFloat_AS_DOUBLE(tuple));" << Endl;
c << " }" << Endl;
c << " else if(PyInt_Check(tuple))" << Endl;
c << " {" << Endl;
c << " vec.resize(1);" << Endl;
c << " vec[0] = float(PyInt_AS_LONG(tuple));" << Endl;
c << " }" << Endl;
c << " else if(PyLong_Check(tuple))" << Endl;
c << " {" << Endl;
c << " vec.resize(1);" << Endl;
c << " vec[0] = float(PyLong_AsDouble(tuple));" << Endl;
c << " }" << Endl;
c << " else" << Endl;
c << " return NULL;" << Endl;
c << Endl;
c << " // Mark the "<<name<<" in the object as modified." << Endl;
if(accessType == Field::AccessPublic)
c << " obj->data->SelectAll();" << Endl;
else
c << " obj->data->Select"<<Name<<"();" << Endl;
}
virtual void WriteGetMethodBody(QTextStream &c, const QString &className)
{
c << " // Allocate a tuple the with enough entries to hold the " << name << "." << Endl;
c << " const floatVector &" << name << " = obj->data->";
if(accessType == Field::AccessPublic)
c << name;
else
c <<MethodNameGet()<<"()";
c << ";" << Endl;
c << " PyObject *retval = PyTuple_New(" << name << ".size());" << Endl;
c << " for(size_t i = 0; i < "<<name<<".size(); ++i)" << Endl;
c << " PyTuple_SET_ITEM(retval, i, PyFloat_FromDouble(" << name << "[i]));" << Endl;
}
virtual void StringRepresentation(QTextStream &c, const QString &classname)
{
c << " { const floatVector &" << name << " = atts->";
if(accessType == Field::AccessPublic)
c << name;
else
c << MethodNameGet() << "()";
c << ";" << Endl;
c << " SNPRINTF(tmpStr, 1000, \"%s" << name << " = (\", prefix);" << Endl;
c << " str += tmpStr;" << Endl;
c << " for(size_t i = 0; i < " << name << ".size(); ++i)" << Endl;
c << " {" << Endl;
c << " SNPRINTF(tmpStr, 1000, \"%f\", " << name << "[i]);" << Endl;
c << " str += tmpStr;" << Endl;
c << " if(i < " << name << ".size() - 1)" << Endl;
c << " {" << Endl;
c << " SNPRINTF(tmpStr, 1000, \", \");" << Endl;
c << " str += tmpStr;" << Endl;
c << " }" << Endl;
c << " }" << Endl;
c << " SNPRINTF(tmpStr, 1000, \")\\n\");" << Endl;
c << " str += tmpStr;" << Endl;
c << " }" << Endl;
}
};
// //
// ---------------------------------- Double ---------------------------------- // ---------------------------------- Double ----------------------------------
...@@ -2737,6 +2838,7 @@ class PythonFieldFactory ...@@ -2737,6 +2838,7 @@ class PythonFieldFactory
else if (type == "bool") f = new AttsGeneratorBool(name,label); else if (type == "bool") f = new AttsGeneratorBool(name,label);
else if (type == "float") f = new AttsGeneratorFloat(name,label); else if (type == "float") f = new AttsGeneratorFloat(name,label);
else if (type == "floatArray") f = new AttsGeneratorFloatArray(length,name,label); else if (type == "floatArray") f = new AttsGeneratorFloatArray(length,name,label);
else if (type == "floatVector") f = new AttsGeneratorFloatVector(name,label);
else if (type == "double") f = new AttsGeneratorDouble(name,label); else if (type == "double") f = new AttsGeneratorDouble(name,label);
else if (type == "doubleArray") f = new AttsGeneratorDoubleArray(length,name,label); else if (type == "doubleArray") f = new AttsGeneratorDoubleArray(length,name,label);
else if (type == "doubleVector") f = new AttsGeneratorDoubleVector(name,label); else if (type == "doubleVector") f = new AttsGeneratorDoubleVector(name,label);
......
...@@ -570,6 +570,59 @@ class WindowGeneratorFloatArray : public virtual FloatArray , public virtual Win ...@@ -570,6 +570,59 @@ class WindowGeneratorFloatArray : public virtual FloatArray , public virtual Win
}; };
//
// -------------------------------- FloatVector ------------------------------
//
class WindowGeneratorFloatVector : public virtual FloatVector , public virtual WindowGeneratorField
{
public:
WindowGeneratorFloatVector(const QString &n, const QString &l)
: Field("floatVector",n,l), FloatVector(n,l), WindowGeneratorField("floatVector",n,l) { }
virtual void writeHeaderCallback(QTextStream &h)
{
h << " void "<<name<<"ProcessText();" << endl;
}
virtual void writeHeaderData(QTextStream &h)
{
h << " QLineEdit *"<<name<<";" << endl;
}
virtual void writeSourceCreate(QTextStream &c)
{
writeSourceCreateLabel(c);
c << " "<<name<<" = new QLineEdit(central);" << endl;
c << " connect("<<name<<", SIGNAL(returnPressed())," << endl
<< " this, SLOT("<<name<<"ProcessText()));" << endl;
c << " mainLayout->addWidget("<<name<<", "<<index<<",1);" << endl;
}
virtual bool providesSourceGetCurrent() const { return true; }
virtual void writeSourceGetCurrent(QTextStream &c)
{
c << " floatVector val;"<<endl;
c << " if(LineEditGetFloats("<<name<<", val))" <<endl;
c << " atts->Set"<<Name<<"(val);" << endl;
c << " else" << endl;
c << " {" << endl;
QString msgLabel = (label.length()>0) ? label : name;
c << " ResettingError(tr(\""<<msgLabel<<"\")," << endl;
c << " FloatsToQString(atts->Get"<<Name<<"()));" << endl;
c << " atts->Set"<<Name<<"(atts->Get"<<Name<<"());" << endl;
c << " }" << endl;
}
virtual void writeSourceUpdateWindow(QTextStream &c)
{
c << " "<<name<<"->setText(FloatsToQString(atts->Get"<<Name<<"()));" << endl;
}
virtual void writeSourceCallback(QString &classname, QString &windowname, QTextStream &c, bool isEnabler)
{
c << "void" << endl;
c << windowname<<"::"<<name<<"ProcessText()" << endl;
c << "{" << endl;
c << " GetCurrentValues("<<classname << "::ID_" << name<<");" << endl;
c << " Apply();" << endl;
c << "}" << endl;
}
};
// //
// ---------------------------------- Double ---------------------------------- // ---------------------------------- Double ----------------------------------
// //
...@@ -826,6 +879,61 @@ class WindowGeneratorStringVector : public virtual StringVector , public virtual ...@@ -826,6 +879,61 @@ class WindowGeneratorStringVector : public virtual StringVector , public virtual
public: public:
WindowGeneratorStringVector(const QString &n, const QString &l) WindowGeneratorStringVector(const QString &n, const QString &l)
: Field("stringVector",n,l), StringVector(n,l), WindowGeneratorField("stringVector",n,l) { } : Field("stringVector",n,l), StringVector(n,l), WindowGeneratorField("stringVector",n,l) { }
virtual void writeHeaderCallback(QTextStream &h)
{
h << " void "<<name<<"ProcessText();" << endl;
}
virtual void writeHeaderData(QTextStream &h)
{
h << " QLineEdit *"<<name<<";" << endl;
}
virtual void writeSourceCreate(QTextStream &c)
{
writeSourceCreateLabel(c);
c << " "<<name<<" = new QLineEdit(central);" << endl;
c << " connect("<<name<<", SIGNAL(returnPressed())," << endl
<< " this, SLOT("<<name<<"ProcessText()));" << endl;
c << " mainLayout->addWidget("<<name<<", "<<index<<",1);" << endl;
}
virtual bool providesSourceGetCurrent() const { return true; }
virtual void writeSourceGetCurrent(QTextStream &c)
{
c << " QString temp = "<<name<<"->displayText();" << endl;
c << " if(!temp.isEmpty())" << endl;
c << " {" << endl;
c << " QStringList s = temp.split(\" \", QString::SkipEmptyParts);" << endl;
c << " stringVector sv;" << endl;
c << " for(int i = 0; i < s.size(); ++i)" << endl;
c << " sv.push_back(s[i].toStdString());" << endl;
c << " atts->Set"<<Name<<"(sv);" << endl;
c << " }" << endl;
c << " else" << endl;
c << " {" << endl;
c << " atts->Set"<<Name<<"(atts->Get"<<Name<<"());" << endl;
c << " }" << endl;
}
virtual void writeSourceUpdateWindow(QTextStream &c)
{
c << " {" << endl;
c << " QString stmp;" << endl;
c << " for(size_t idx = 0; idx < atts->Get"<<Name<<"().size(); ++idx)" << endl;
c << " {" << endl;
c << " stmp.append(QString(atts->Get"<<Name<<"()[idx].c_str()));" << endl;
c << " if(idx < atts->Get"<<Name<<"().size()-1)" << endl;
c << " stmp.append(\" \");" << endl;
c << " }" << endl;
c << " "<<name<<"->setText(stmp);" << endl;
c << " }" << endl;
}
virtual void writeSourceCallback(QString &classname, QString &windowname, QTextStream &c, bool isEnabler)
{
c << "void" << endl;
c << windowname<<"::"<<name<<"ProcessText()" << endl;
c << "{" << endl;
c << " GetCurrentValues("<<classname << "::ID_" << name<<");" << endl;
c << " Apply();" << endl;
c << "}" << endl;
}
}; };
...@@ -1345,6 +1453,7 @@ class WindowFieldFactory ...@@ -1345,6 +1453,7 @@ class WindowFieldFactory
else if (type == "bool") f = new WindowGeneratorBool(name,label); else if (type == "bool") f = new WindowGeneratorBool(name,label);
else if (type == "float") f = new WindowGeneratorFloat(name,label); else if (type == "float") f = new WindowGeneratorFloat(name,label);
else if (type == "floatArray") f = new WindowGeneratorFloatArray(length,name,label); else if (type == "floatArray") f = new WindowGeneratorFloatArray(length,name,label);
else if (type == "floatVector") f = new WindowGeneratorFloatVector(name,label);
else if (type == "double") f = new WindowGeneratorDouble(name,label); else if (type == "double") f = new WindowGeneratorDouble(name,label);
else if (type == "doubleArray") f = new WindowGeneratorDoubleArray(length,name,label); else if (type == "doubleArray") f = new WindowGeneratorDoubleArray(length,name,label);
else if (type == "doubleVector") f = new WindowGeneratorDoubleVector(name,label); else if (type == "doubleVector") f = new WindowGeneratorDoubleVector(name,label);
......
...@@ -588,6 +588,7 @@ XMLEditFields::UpdateTypeList() ...@@ -588,6 +588,7 @@ XMLEditFields::UpdateTypeList()
type->addItem("bool"); type->addItem("bool");
type->addItem("float"); type->addItem("float");
type->addItem("floatArray"); type->addItem("floatArray");
type->addItem("floatVector");
type->addItem("double"); type->addItem("double");
type->addItem("doubleArray"); type->addItem("doubleArray");
type->addItem("doubleVector"); type->addItem("doubleVector");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment