本文整理汇总了C++中TXshLevel::getType方法的典型用法代码示例。如果您正苦于以下问题:C++ TXshLevel::getType方法的具体用法?C++ TXshLevel::getType怎么用?C++ TXshLevel::getType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TXshLevel
的用法示例。
在下文中一共展示了TXshLevel::getType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: startOrganizePalette
bool StylePickerTool::startOrganizePalette() {
/* Check if the organizing operation is available */
TXshLevel *level = getApplication()->getCurrentLevel()->getLevel();
if (!level) {
DVGui::error(tr("No current level."));
return false;
}
if (level->getType() != PLI_XSHLEVEL && level->getType() != TZP_XSHLEVEL &&
level->getType() != PLT_XSHLEVEL) {
DVGui::error(tr("Current level has no available palette."));
return false;
}
/* palette should have more than one page to organize */
TPalette *pal = NULL;
if (level->getType() == PLT_XSHLEVEL)
pal = level->getPaletteLevel()->getPalette();
else
pal = level->getSimpleLevel()->getPalette();
if (!pal || pal->getPageCount() < 2) {
DVGui::error(
tr("Palette must have more than one palette to be organized."));
return false;
}
m_paletteToBeOrganized = pal;
std::cout << "Start Organize Palette" << std::endl;
return true;
}
示例2: setCell
bool TXsheet::setCell(int row, int col, const TXshCell &cell) {
if (row < 0 || col < 0) return false;
bool wasColumnEmpty = isColumnEmpty(col);
TXshCellColumn *cellColumn;
if (!cell.isEmpty()) {
TXshLevel *level = cell.m_level.getPointer();
assert(level);
int levelType = level->getType();
TXshColumn::ColumnType type = TXshColumn::eLevelType;
if (levelType == SND_XSHLEVEL)
type = TXshColumn::eSoundType;
else if (levelType == SND_TXT_XSHLEVEL)
type = TXshColumn::eSoundTextType;
else if (levelType == PLT_XSHLEVEL)
type = TXshColumn::ePaletteType;
else if (levelType == ZERARYFX_XSHLEVEL)
type = TXshColumn::eZeraryFxType;
else if (levelType == MESH_XSHLEVEL)
type = TXshColumn::eMeshType;
cellColumn = touchColumn(col, type)->getCellColumn();
} else {
TXshColumn *column = getColumn(col);
cellColumn = column ? column->getCellColumn() : 0;
}
if (!cellColumn || cellColumn->isLocked()) return false;
cellColumn->setXsheet(this);
if (!cellColumn->setCell(row, cell)) {
if (wasColumnEmpty) {
removeColumn(col);
insertColumn(col);
}
return false;
}
TFx *fx = cellColumn->getFx();
if (wasColumnEmpty && fx && fx->getOutputConnectionCount() == 0 &&
cellColumn->getPaletteColumn() == 0)
getFxDag()->addToXsheet(fx);
if (cell.isEmpty())
updateFrameCount();
else if (row >= m_imp->m_frameCount)
m_imp->m_frameCount = row + 1;
TNotifier::instance()->notify(TXsheetChange());
return true;
}
示例3: onCellSwitched
void MeshifyPopup::onCellSwitched()
{
// In case current cell level is not of the suitable type, disable the
// rasterization parameter
{
TXshLevel *level = ::levelToMeshify();
int type = level ? level->getType() : UNKNOWN_XSHLEVEL;
m_rasterizationDpi->setEnabled(type == PLI_XSHLEVEL || type == CHILD_XSHLEVEL);
}
acquirePreview();
}
示例4: updateXshLevel
void TApp::updateXshLevel() {
TXshLevel *xl = 0;
if (m_currentFrame->isEditingScene()) {
int frame = m_currentFrame->getFrame();
int column = m_currentColumn->getColumnIndex();
TXsheet *xsheet = m_currentXsheet->getXsheet();
if (xsheet && column >= 0 && frame >= 0 && !xsheet->isColumnEmpty(column)) {
TXshCell cell = xsheet->getCell(frame, column);
xl = cell.m_level.getPointer();
// Se sono su una cella vuota successiva a celle di un certo livello
// prendo questo come livello corrente.
if (!xl && frame > 0) {
TXshCell cell = xsheet->getCell(frame - 1, column);
xl = cell.m_level.getPointer();
}
}
m_currentLevel->setLevel(xl);
// level could be the same, but palette could have changed
if (xl && xl->getSimpleLevel()) {
TPalette *currentPalette =
m_paletteController->getCurrentPalette()->getPalette();
int styleIndex =
m_paletteController->getCurrentLevelPalette()->getStyleIndex();
m_paletteController->getCurrentLevelPalette()->setPalette(
xl->getSimpleLevel()->getPalette(), styleIndex);
// Se il nuovo livello selezionato e' un ovl,
// la paletta corrente e' una cleanup palette
// => setto come handle corrente quello della paletta di cleanup.
if (xl->getType() == OVL_XSHLEVEL && currentPalette &&
currentPalette->isCleanupPalette())
m_paletteController->editCleanupPalette();
} else if (xl && xl->getPaletteLevel()) {
int styleIndex =
m_paletteController->getCurrentLevelPalette()->getStyleIndex();
m_paletteController->getCurrentLevelPalette()->setPalette(
xl->getPaletteLevel()->getPalette(), styleIndex);
} else
m_paletteController->getCurrentLevelPalette()->setPalette(0);
}
}
示例5: onImageChanged
/*
If the working palette is changed, then deactivate the "organize palette"
toggle.
*/
void StylePickerTool::onImageChanged() {
std::cout << "StylePickerTool::onImageChanged" << std::endl;
if (!m_organizePalette.getValue() || !m_paletteToBeOrganized) return;
TXshLevel *level = getApplication()->getCurrentLevel()->getLevel();
if (!level) {
m_organizePalette.setValue(false);
getApplication()->getCurrentTool()->notifyToolChanged();
return;
}
TPalette *pal = NULL;
if (level->getType() == PLT_XSHLEVEL)
pal = level->getPaletteLevel()->getPalette();
else if (level->getSimpleLevel()) {
pal = level->getSimpleLevel()->getPalette();
}
if (!pal || pal != m_paletteToBeOrganized) {
m_organizePalette.setValue(false);
getApplication()->getCurrentTool()->notifyToolChanged();
return;
}
}
示例6: setCells
bool TXsheet::setCells(int row, int col, int rowCount, const TXshCell cells[]) {
static const TXshCell emptyCell;
int i = 0;
while (i < rowCount && cells[i].isEmpty()) i++;
// inserito da Elisa verso novembre 2009.
// cosi' ha il difetto che se assegno celle vuote non fa nulla
// per ora lo commento. bisogna indagare se questo rompe qualcosa
// ho modificato il seguito per gestire il caso in cui i>=rowCount
// => niente livelli dentro cells
// if(i>=rowCount)
// return false;
TXshColumn::ColumnType type = TXshColumn::eLevelType;
if (i < rowCount) {
TXshLevel *level = cells[i].m_level.getPointer();
int levelType = level->getType();
if (levelType == SND_XSHLEVEL)
type = TXshColumn::eSoundType;
else if (levelType == SND_TXT_XSHLEVEL)
type = TXshColumn::eSoundTextType;
else if (levelType == PLT_XSHLEVEL)
type = TXshColumn::ePaletteType;
else if (levelType == ZERARYFX_XSHLEVEL)
type = TXshColumn::eZeraryFxType;
else if (levelType == MESH_XSHLEVEL)
type = TXshColumn::eMeshType;
}
bool wasColumnEmpty = isColumnEmpty(col);
TXshCellColumn *column = touchColumn(col, type)->getCellColumn();
if (!column) return false;
int oldColRowCount = column->getMaxFrame() + 1;
bool ret = column->setCells(row, rowCount, cells);
if (!ret || column->isLocked()) {
if (wasColumnEmpty) {
removeColumn(col);
insertColumn(col);
}
return false;
}
int newColRowCount = column->getMaxFrame() + 1;
TFx *fx = column->getFx();
if (wasColumnEmpty && fx && fx->getOutputConnectionCount() == 0)
getFxDag()->addToXsheet(fx);
column->setXsheet(this);
if (newColRowCount > m_imp->m_frameCount)
m_imp->m_frameCount = newColRowCount;
else {
if (oldColRowCount == m_imp->m_frameCount &&
newColRowCount < m_imp->m_frameCount)
updateFrameCount();
}
return true;
}