/*!\fn void FieldAnimation::setAnimatedMultiField(FieldContainerUnrecPtr TheContainer, const std::string& FieldName, UInt32 Index)
 *
 * \brief Attach to the Index of a MultiField of a #OSG::FieldContainer.
 *
 * If TheContainer is NULL, or there is no MultiField by the
 * given name on the container, or the Index is out of bounds, then no
 * changes are made.
 *
 * \param TheContainer The container to attach to.
 * \param FieldName The name of the field on the given container to attach
 * to.
 * \param Index The index of the MultiField to attach to.
 */
void FieldAnimation::setAnimatedMultiField(FieldContainerUnrecPtr TheContainer, const std::string& FieldName, UInt32 Index)
{
    setFieldName( FieldName );
    setContainer( TheContainer );
    setIndex( Index );
    commitChanges();
}
FieldDefinition::FieldDefinition(int type, int size, int key, string name)
{
    fieldType = (type == 0 || type == 1)?type:0;
    fieldSize = (type == 1)?size:4;
    is_Key = key;
    setFieldName(name);
}
const TableSortField& TableSortField::operator=(const TableSortField& obj)
{
    if (this != &obj)
    {
        *m_comparer = *obj.m_comparer;
        setFieldIndex(obj.fieldIndex());
        setCase(obj.caseSensitivity());
        setSortOrder(obj.sortOrder());
        setFieldName(obj.fieldName());
        setFieldType(obj.fieldType());
    }
    return *this;
}
PointEEdit::PointEEdit(QWidget *parent)
    : FieldEdit(FieldEdit::Electric, parent)
{
    setFieldName(QString::fromUtf8("ЭП точечного заряда"));
    _E = new LaplasField(4.8e-10, Vector(0.0, 0.0, 0.0));
    QVBoxLayout *v = new QVBoxLayout(centralWidget());
    q_edit = new ScalarEdit(this);
    q_edit->setName("q");
    q_edit->setUnits(QString::fromUtf8("ед. СГС"));
    q_edit->setValue(_E->c());
    v->addWidget(q_edit);
    r0_edit = new VectorEdit(this);
    r0_edit->setName("<b>r<sub><font style=\"font-weight:normal;\">0</font></sub></b>");
    r0_edit->setUnits(QString::fromUtf8("см"));
    r0_edit->setValue(_E->r0());
    v->addWidget(r0_edit);
}
/*!\fn void FieldAnimation::setAnimatedField(FieldContainerUnrecPtr TheContainer, const std::string& FieldName)
 *
 * \brief Attach to the SingleField of a #OSG::FieldContainer.
 *
 * If TheContainer is NULL or there is no SingleField by the
 * given name on the container, then no changes are made.
 *
 * \param TheContainer The container to attach to.
 * \param FieldName The name of the field on the given container to attach
 * to.
 */
void FieldAnimation::setAnimatedField(FieldContainerUnrecPtr TheContainer, const std::string& FieldName)
{
    setFieldName( FieldName );
    setContainer( TheContainer );
    commitChanges();
}