本文整理汇总了C++中TupScene::layer方法的典型用法代码示例。如果您正苦于以下问题:C++ TupScene::layer方法的具体用法?C++ TupScene::layer怎么用?C++ TupScene::layer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TupScene
的用法示例。
在下文中一共展示了TupScene::layer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeSymbolFromFrame
bool TupCommandExecutor::removeSymbolFromFrame(TupLibraryResponse *response)
{
#ifdef K_DEBUG
T_FUNCINFO;
#endif
if (m_project->scenesTotal() > 0) {
if (m_project->removeSymbolFromFrame(response->arg().toString(), response->symbolType())) {
TupScene *scene = m_project->scene(response->sceneIndex());
if (scene) {
TupLayer *layer = scene->layer(response->layerIndex());
if (layer) {
TupFrame *frame = layer->frame(response->frameIndex());
if (frame)
response->setFrameState(frame->isEmpty());
}
}
emit responsed(response);
return true;
} else {
#ifdef K_DEBUG
tError() << "TupCommandExecutor::removeSymbolFromFrame() - Error: Symbol can't be removed from project!";
#endif
}
} else {
#ifdef K_DEBUG
tError() << "TupCommandExecutor::removeSymbolFromFrame() - No scenes available!";
#endif
}
return false;
}
示例2: insertSymbolIntoFrame
bool TupCommandExecutor::insertSymbolIntoFrame(TupLibraryResponse *response)
{
#ifdef K_DEBUG
tFatal() << "TupCommandExecutor::insertSymbolIntoFrame() - Adding symbol to project: " << response->arg().toString();
#endif
if (m_project->scenesTotal() > 0) {
if (m_project->insertSymbolIntoFrame(response->spaceMode(), response->arg().toString(),
response->sceneIndex(), response->layerIndex(), response->frameIndex())) {
TupScene *scene = m_project->scene(response->sceneIndex());
if (scene) {
TupLayer *layer = scene->layer(response->layerIndex());
if (layer) {
TupFrame *frame = layer->frame(response->frameIndex());
if (frame)
response->setFrameState(frame->isEmpty());
}
}
emit responsed(response);
return true;
}
} else {
#ifdef K_DEBUG
tError() << "TupCommandExecutor::insertSymbolIntoFrame() - No scenes available!";
#endif
}
return false;
}
示例3: setFrameVisibility
bool TupCommandExecutor::setFrameVisibility(TupFrameResponse *response)
{
int scenePos = response->sceneIndex();
int layerPos = response->layerIndex();
int position = response->frameIndex();
bool view = response->arg().toBool();
TupScene *scene = m_project->scene(scenePos);
if (!scene)
return false;
TupLayer *layer = scene->layer(layerPos);
if (layer) {
TupFrame *frame = layer->frame(position);
if (! frame)
return false;
frame->setVisible(view);
emit responsed(response);
return true;
}
return false;
}
示例4: removeLayer
bool TupCommandExecutor::removeLayer(TupLayerResponse *response)
{
#ifdef K_DEBUG
T_FUNCINFO;
#endif
int scenePos = response->sceneIndex();
int position = response->layerIndex();
TupScene *scene = m_project->scene(scenePos);
if (scene) {
TupLayer *layer = scene->layer(position);
if (layer) {
QDomDocument document;
document.appendChild(layer->toXml(document));
response->setState(document.toString());
response->setArg(layer->layerName());
if (scene->removeLayer(position)) {
emit responsed(response);
return true;
}
}
}
return false;
}
示例5: renameLayer
bool TupCommandExecutor::renameLayer(TupLayerResponse *response)
{
int scenePos = response->sceneIndex();
int position = response->layerIndex();
QString newName = response->arg().toString();
#ifdef K_DEBUG
tWarning() << "Renamed layer: " << newName;
#endif
QString oldName;
TupScene *scene = m_project->scene(scenePos);
if (!scene)
return false;
TupLayer *layer = scene->layer(position);
if (layer) {
QString current = layer->layerName();
layer->setLayerName(newName);
emit responsed(response);
response->setArg(current);
return true;
}
return false;
}
示例6: createFrame
bool TupCommandExecutor::createFrame(TupFrameResponse *response)
{
#ifdef K_DEBUG
#ifdef Q_OS_WIN32
qDebug() << "[TupCommandExecutor::createFrame()]";
#else
T_FUNCINFO;
#endif
#endif
int scenePosition = response->sceneIndex();
int layerPosition = response->layerIndex();
int position = response->frameIndex();
QString name = response->arg().toString();
// QString state = response->state();
TupScene *scene = m_project->scene(scenePosition);
if (!scene)
return false;
scene->insertStoryBoardScene(position);
TupLayer *layer = scene->layer(layerPosition);
if (layer) {
TupFrame *frame = layer->createFrame(name, position);
if (!frame)
return false;
/*
if (!name.isEmpty()) {
#ifdef K_DEBUG
tDebug("items") << name;
#endif
frame->setFrameName(name);
} else {
response->setArg(frame->frameName());
}
*/
response->setArg(frame->frameName());
response->setFrameIndex(layer->visualIndexOf(frame));
emit responsed(response);
/* SQA: Check if this code is really necessary
if (!state.isEmpty()) {
frame->fromXml(state);
response->setArg(frame->frameName());
}
*/
return true;
}
return false;
}
示例7: exchangeFrame
bool TupCommandExecutor::exchangeFrame(TupFrameResponse *response)
{
int scenePos = response->sceneIndex();
int layerPos = response->layerIndex();
int position = response->frameIndex();
int newPosition = response->arg().toInt();
TupScene *scene = m_project->scene(scenePos);
if (!scene)
return false;
scene->moveStoryBoardScene(position, newPosition);
TupLayer *layer = scene->layer(layerPos);
if (layer) {
if (layer->exchangeFrame(position, newPosition)) {
emit responsed(response);
return true;
} else {
#ifdef K_DEBUG
QString msg = "TupCommandExecutor::exchangeFrame() - Error while exchanging frames";
#ifdef Q_OS_WIN32
qDebug() << msg;
#else
tError() << msg;
#endif
#endif
return false;
}
}
return false;
}
示例8: resetFrame
bool TupCommandExecutor::resetFrame(TupFrameResponse *response)
{
int scenePos = response->sceneIndex();
int layerPos = response->layerIndex();
int position = response->frameIndex();
TupScene *scene = m_project->scene(scenePos);
if (scene) {
scene->resetStoryBoardScene(position);
TupLayer *layer = scene->layer(layerPos);
if (layer) {
TupFrame *frame = layer->frame(position);
if (frame) {
/*
QDomDocument doc;
doc.appendChild(frame->toXml(doc));
response->setArg(frame->frameName());
*/
if (layer->resetFrame(position)) {
//response->setState(doc.toString(0));
emit responsed(response);
return true;
}
}
}
}
return false;
}
示例9: addLipSync
bool TupCommandExecutor::addLipSync(TupLayerResponse *response)
{
#ifdef K_DEBUG
QString msg = "TupCommandExecutor::addLipSync() - Adding lipsync...";
#ifdef Q_OS_WIN32
qWarning() << msg;
#else
tWarning() << msg;
#endif
#endif
int scenePos = response->sceneIndex();
int position = response->layerIndex();
QString xml = response->arg().toString();
TupScene *scene = m_project->scene(scenePos);
if (!scene)
return false;
TupLayer *layer = scene->layer(position);
if (layer) {
TupLipSync *lipsync = new TupLipSync();
lipsync->fromXml(xml);
layer->addLipSync(lipsync);
emit responsed(response);
return true;
}
return false;
}
示例10: selectFrame
bool TupCommandExecutor::selectFrame(TupFrameResponse *response)
{
#ifdef K_DEBUG
#ifdef Q_OS_WIN32
qDebug() << "[TupCommandExecutor::selectFrame()]";
#else
T_FUNCINFO;
#endif
#endif
int scenePos = response->sceneIndex();
int layerPos = response->layerIndex();
int position = response->frameIndex();
// bool prioritary = response->arg().toBool();
TupScene *scene = m_project->scene(scenePos);
if (!scene || scenePos < 0 || position < 0)
return false;
TupLayer *layer = scene->layer(layerPos);
if (layer) {
if (position < layer->framesTotal()) {
TupFrame *frame = layer->frame(position);
if (! frame)
return false;
emit responsed(response);
return true;
} else {
#ifdef K_DEBUG
QString msg = "TupCommandExecutor::selectFrame() - Invalid frame index -> " + QString::number(position);
#ifdef Q_OS_WIN32
qDebug() << msg;
#else
tError() << msg;
#endif
#endif
return false;
}
}
return false;
}
示例11: renameFrame
bool TupCommandExecutor::renameFrame(TupFrameResponse *response)
{
#ifdef K_DEBUG
#ifdef Q_OS_WIN32
qDebug() << "[TupCommandExecutor::renameFrame()]";
#else
T_FUNCINFO;
#endif
#endif
int scenePos = response->sceneIndex();
int layerPos = response->layerIndex();
int position = response->frameIndex();
QString newName= response->arg().toString();
QString oldName;
TupScene *scene = m_project->scene(scenePos);
if (!scene)
return false;
TupLayer *layer = scene->layer(layerPos);
if (layer) {
TupFrame *frame = layer->frame(position);
if (! frame)
return false;
oldName = frame->frameName();
if (oldName.compare(newName) != 0)
frame->setFrameName(newName);
emit responsed(response);
return true;
}
return false;
}
示例12: lockLayer
bool TupCommandExecutor::lockLayer(TupLayerResponse *response)
{
int scenePos = response->sceneIndex();
int position = response->layerIndex();
bool lock = response->arg().toBool();
TupScene *scene = m_project->scene(scenePos);
if (!scene)
return false;
TupLayer *layer = scene->layer(position);
if (layer) {
layer->setLocked(lock);
emit responsed(response);
return true;
}
return false;
}
示例13: pasteFrame
bool TupCommandExecutor::pasteFrame(TupFrameResponse *response)
{
#ifdef K_DEBUG
#ifdef Q_OS_WIN32
qDebug() << "[TupCommandExecutor::pasteFrame()]";
#else
T_FUNCINFO;
#endif
#endif
int scenePos = response->sceneIndex();
int layerPos = response->layerIndex();
int position = response->frameIndex();
QString copyFrame = response->arg().toString();
TupScene *scene = m_project->scene(scenePos);
if (scene) {
TupLayer *layer = scene->layer(layerPos);
if (layer) {
TupFrame *frame = layer->frame(position);
if (frame) {
QString name = frame->frameName();
QDomDocument doc;
doc.appendChild(frame->toXml(doc));
response->setArg(doc.toString(0));
frame->clear();
frame->fromXml(copyFrame);
frame->setFrameName(name);
response->setFrameState(frame->isEmpty());
emit responsed(response);
return true;
}
}
}
return false;
}
示例14: setLayerVisibility
bool TupCommandExecutor::setLayerVisibility(TupLayerResponse *response)
{
int scenePos = response->sceneIndex();
int position = response->layerIndex();
bool view = response->arg().toBool();
TupScene *scene = m_project->scene(scenePos);
if (!scene)
return false;
TupLayer *layer = scene->layer(position);
if (layer) {
layer->setVisible(view);
responsed(response);
return true;
}
return false;
}
示例15: expandFrame
bool TupCommandExecutor::expandFrame(TupFrameResponse *response)
{
int scenePos = response->sceneIndex();
int layerPos = response->layerIndex();
int position = response->frameIndex();
int times = response->arg().toInt();
TupScene *scene = m_project->scene(scenePos);
if (!scene)
return false;
TupLayer *layer = scene->layer(layerPos);
if (layer) {
if (layer->expandFrame(position, times)) {
emit responsed(response);
return true;
}
}
return false;
}