コード例 #1
0
ColumnDefinition::ColumnDefinition(const ColumnDefinition& coldef){
    if(coldef.__bool__())
    {
        Ilwis::ColumnDefinition* ilwDef = coldef.ptr().get();
        if(ilwDef->isValid())
            _ilwisColDef.reset(new Ilwis::ColumnDefinition(*ilwDef));
    }
}
コード例 #2
0
 PyObject* Table::columns() const{
     Ilwis::ITable tbl = this->ptr()->as<Ilwis::Table>();
     PyObject* list = newPyTuple(tbl->columnCount());
     for(int i = 0; i < tbl->columnCount(); i++){
         Ilwis::ColumnDefinition coldef = tbl->columndefinition(i);
         if (!setTupleItem(list, i, PyUnicodeFromString(coldef.name().toStdString().data())))
             throw Ilwis::ErrorObject(QString("internal conversion error while trying to add '%1' to list of columns").arg(tbl->columndefinition(i).name()));
     }
     return list;
 }
コード例 #3
0
 std::vector<std::string> Table::columns() const{
     Ilwis::ITable tbl = this->ptr()->as<Ilwis::Table>();
     std::vector<std::string> vector;
     for(int i = 0; i < tbl->columnCount(); i++){
         Ilwis::ColumnDefinition coldef = tbl->columndefinition(i);
         vector.push_back( coldef.name().toStdString() );
         //if (!setTupleItem(list, i, PyUnicodeFromString(coldef.name().toStdString().data())))
             //throw Ilwis::ErrorObject(QString("internal conversion error while trying to add '%1' to list of columns").arg(tbl->columndefinition(i).name()));
     }
     return vector;
 }
コード例 #4
0
AttributeModel::AttributeModel(const Ilwis::ColumnDefinition& def, QObject *parent, const Ilwis::IIlwisObject& obj) :
    QObject(parent),
    _coldefinition(def),
    _owner(obj)
{
    if ( def.isValid() && def.datadef().domain()->ilwisType() == itITEMDOMAIN && def.datadef().domain()->valueType() != itINDEXEDITEM) {
        if (!def.datadef().domain()->range().isNull()) {
            QString defset = def.datadef().domain()->range()->toString();
            defset = defset.mid(defset.indexOf(":") + 1);
            _attributeValuesDefaultRange = defset.split("|");
        }
        if (!def.datadef().range().isNull()) {
            QString defset = def.datadef().domain()->range()->toString();
            defset = defset.mid(defset.indexOf(":") + 1);
            _attributeValuesActualRange = defset.split("|");
        }
    }
}