示例#1
0
int BachAssetItem::compare( const QModelIndex & a, const QModelIndex & b, int,  bool )
{
	//DEBG( "modelData: "+QString::number( a.row() ) + ":" + QString::number( b.row() ) + ": Tags: " + mBachAsset.tags() );
	unsigned int ka = modelData( a, Qt::UserRole ).toUInt();
	unsigned int kb = modelData( b, Qt::UserRole ).toUInt();
	return ka - kb;
}
AnimationPtr ModelActorFactory::BuildAnimation(
    Model& model,
    Actor& rootActor,
    size_t index,
    AlphaFunction alpha,
    float durationSeconds)
{
    AnimationPtr animation;
    Internal::ModelDataPtr modelData(model.GetModelData());

    if (modelData)
    {
        if (index >= modelData->NumberOfAnimationMaps())
        {
            DALI_LOG_ERROR("Invalid animation index\n");
        }
        else
        {
            const ModelAnimationMap* animationData(modelData->GetAnimationMap(index));
            if( animationData != NULL )
            {
                animation = CreateAnimation(rootActor, animationData, alpha, durationSeconds);
            }
        }
    }
    return animation;
}
示例#3
0
void PropLov::setTabName(const QModelIndex &index)
{
    QMdiSubWindow *subWindow = qobject_cast<QMdiSubWindow *> (this->parent());

    QString lovName = modelData(DBLOVXML::LOV, DBLOVXML::NAME,index).toString();
    QString id = this->dataId(index);

    this->setObjectName("PropLov::" + id);
    subWindow->setWindowIcon(qvariant_cast<QIcon>(index.data(Qt::DecorationRole)));
    subWindow->setWindowTitle(lovName);
}
ActorPtr ModelActorFactory::BuildActorTree(Dali::Model& model, const std::string& entityName)
{
    Dali::Entity entity;
    ActorPtr actorPtr;

    Internal::ModelDataPtr modelData(GetImplementation(model).GetModelData());

    if (modelData)
    {
        Dali::Entity root = modelData->GetRootEntity();
        if (entityName.empty())
        {
            entity = root;
        }
        else
        {
            entity = root.Find(entityName);
        }
    }

    if(entity)
    {
        actorPtr = RecurseNew(modelData, entity);
    }
    else
    {
        DALI_LOG_INFO(Debug::Filter::gModel, Debug::General, "Entity %s not found\n", entityName.c_str());
    }

    if(actorPtr)
    {
        Vector4 bounds(entity.GetUpperBounds() - entity.GetLowerBounds());
        Vector3 initialVolume(bounds.x, bounds.y, bounds.z);

        actorPtr->SetInitialVolume(initialVolume);
        actorPtr->SetTransmitGeometryScaling(true);

        BindBonesToMeshActors(actorPtr, actorPtr);
    }
    return actorPtr;
}
QVariant RubrosProveedoresModel::data(const QModelIndex &index, int role) const
{
    EntityBasePtr entity = _entities[_entityMappingByIdProveedor[_idProveedor].at(index.row())];
    return modelData(entity, index.column(), role);
}
示例#6
0
QString PropNumerator::dataId(const QModelIndex &index)
{
    return modelData(DBNUMERATORXML::NUMERATOR,
                     DBNUMERATORXML::ID,
                     index).toString();
}
示例#7
0
QString PropLov::dataId(const QModelIndex &index)
{
    return modelData(DBLOVXML::LOV, DBLOVXML::ID,index).toString();
}
const TModelObject *TAbstractModel::mdata() const
{
    return modelData() ? modelData() : data();
}