本文整理汇总了C++中TApp::getCurrentColumn方法的典型用法代码示例。如果您正苦于以下问题:C++ TApp::getCurrentColumn方法的具体用法?C++ TApp::getCurrentColumn怎么用?C++ TApp::getCurrentColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TApp
的用法示例。
在下文中一共展示了TApp::getCurrentColumn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onCurrentButtonToggled
void PaletteViewerPanel::onCurrentButtonToggled(bool isCurrent) {
if (isActive() == isCurrent) return;
TApp *app = TApp::instance();
TPaletteHandle *ph = app->getPaletteController()->getCurrentLevelPalette();
// Se sono sulla palette del livello corrente e le palette e' vuota non
// consento di bloccare il pannello.
if (isActive() && !ph->getPalette()) {
m_isCurrentButton->setPressed(true);
return;
}
setActive(isCurrent);
m_paletteViewer->enableSaveAction(isCurrent);
// Cambio il livello corrente
if (isCurrent) {
std::set<TXshSimpleLevel *> levels;
TXsheet *xsheet = app->getCurrentXsheet()->getXsheet();
int row, column;
findPaletteLevels(levels, row, column, m_paletteHandle->getPalette(),
xsheet);
// Se non trovo livelli riferiti alla palette setto il palette viewer alla
// palette del livello corrente.
if (levels.empty()) {
m_paletteViewer->setPaletteHandle(ph);
update();
return;
}
TXshSimpleLevel *level = *levels.begin();
// Se sto editando l'xsheet devo settare come corrente anche la colonna e il
// frame.
if (app->getCurrentFrame()->isEditingScene()) {
int currentColumn = app->getCurrentColumn()->getColumnIndex();
if (currentColumn != column)
app->getCurrentColumn()->setColumnIndex(column);
int currentRow = app->getCurrentFrame()->getFrameIndex();
TXshCell cell = xsheet->getCell(currentRow, column);
if (cell.isEmpty() || cell.getSimpleLevel() != level)
app->getCurrentFrame()->setFrameIndex(row);
TCellSelection *selection = dynamic_cast<TCellSelection *>(
app->getCurrentSelection()->getSelection());
if (selection) selection->selectNone();
}
app->getCurrentLevel()->setLevel(level);
m_paletteViewer->setPaletteHandle(ph);
} else {
m_paletteHandle->setPalette(ph->getPalette());
m_paletteViewer->setPaletteHandle(m_paletteHandle);
}
update();
}
示例2: changeFrameSkippingHolds
bool changeFrameSkippingHolds(QKeyEvent *e) {
if ((e->modifiers() & Qt::ShiftModifier) == 0 ||
e->key() != Qt::Key_Down && e->key() != Qt::Key_Up)
return false;
TApp *app = TApp::instance();
TFrameHandle *fh = app->getCurrentFrame();
if (!fh->isEditingScene()) return false;
int row = fh->getFrame();
int col = app->getCurrentColumn()->getColumnIndex();
TXsheet *xsh = app->getCurrentXsheet()->getXsheet();
TXshCell cell = xsh->getCell(row, col);
if (e->key() == Qt::Key_Down) {
if (cell.isEmpty()) {
int r0, r1;
if (xsh->getCellRange(col, r0, r1)) {
while (row <= r1 && xsh->getCell(row, col).isEmpty()) row++;
if (xsh->getCell(row, col).isEmpty()) return false;
} else
return false;
} else {
while (xsh->getCell(row, col) == cell) row++;
}
} else {
// Key_Up
while (row >= 0 && xsh->getCell(row, col) == cell) row--;
if (row < 0) return false;
cell = xsh->getCell(row, col);
while (row > 0 && xsh->getCell(row - 1, col) == cell) row--;
}
fh->setFrame(row);
return true;
}
示例3: onFrameSwitched
void FilmstripFrames::onFrameSwitched() {
// no. interferische con lo shift-click per la selezione.
// m_selection->selectNone();
TApp *app = TApp::instance();
TFrameHandle *fh = app->getCurrentFrame();
TFrameId fid;
if (fh->isEditingLevel())
fid = fh->getFid();
else {
TXsheet *xsh = app->getCurrentXsheet()->getXsheet();
int col = app->getCurrentColumn()->getColumnIndex();
int row = fh->getFrame();
if (row < 0 || col < 0) return;
TXshCell cell = xsh->getCell(row, col);
if (cell.isEmpty()) return;
fid = cell.getFrameId();
}
int index = fid2index(fid);
if (index >= 0) {
exponeFrame(index);
// clear selection and select only the destination frame
select(index, ONLY_SELECT);
}
update();
}
示例4: hideEvent
void BinarizePopup::hideEvent(QHideEvent *e)
{
TApp *app = TApp::instance();
bool ret = true;
ret = ret && disconnect(app->getCurrentFrame(), 0, this, 0);
ret = ret && disconnect(app->getCurrentColumn(), 0, this, 0);
ret = ret && disconnect(app->getCurrentLevel(), 0, this, 0);
assert(ret);
}
示例5: showEvent
void AntialiasPopup::showEvent(QShowEvent *se)
{
TApp *app = TApp::instance();
bool ret = true;
ret = ret && connect(app->getCurrentFrame(), SIGNAL(frameTypeChanged()), this, SLOT(setCurrentSampleRaster()));
ret = ret && connect(app->getCurrentFrame(), SIGNAL(frameSwitched()), this, SLOT(setCurrentSampleRaster()));
ret = ret && connect(app->getCurrentColumn(), SIGNAL(columnIndexSwitched()), this, SLOT(setCurrentSampleRaster()));
assert(ret);
setCurrentSampleRaster();
}
示例6: attachHandles
void FunctionViewerPanel::attachHandles() {
TApp *app = TApp::instance();
m_functionViewer->setXsheetHandle(app->getCurrentXsheet());
m_functionViewer->setFrameHandle(app->getCurrentFrame());
m_functionViewer->setObjectHandle(app->getCurrentObject());
m_functionViewer->setFxHandle(app->getCurrentFx());
m_functionViewer->setColumnHandle(app->getCurrentColumn());
m_functionViewer->setSceneHandle(app->getCurrentScene());
}
示例7: hideEvent
void LinesFadePopup::hideEvent(QHideEvent *he)
{
TApp *app = TApp::instance();
disconnect(app->getCurrentFrame(), SIGNAL(frameTypeChanged()), this, SLOT(setCurrentSampleRaster()));
disconnect(app->getCurrentFrame(), SIGNAL(frameSwitched()), this, SLOT(setCurrentSampleRaster()));
disconnect(app->getCurrentColumn(), SIGNAL(columnIndexSwitched()), this, SLOT(setCurrentSampleRaster()));
Dialog::hideEvent(he);
m_viewer->raster() = TRasterP();
m_startRas = TRaster32P();
}
示例8: onSetCurrent
void SceneViewerContextMenu::onSetCurrent() {
TStageObjectId id;
id.setCode(qobject_cast<QAction *>(sender())->data().toUInt());
TApp *app = TApp::instance();
if (id.isColumn()) {
app->getCurrentColumn()->setColumnIndex(id.getIndex());
app->getCurrentObject()->setObjectId(id);
} else {
app->getCurrentObject()->setObjectId(id);
app->getCurrentTool()->setTool(T_Edit);
}
}
示例9: onAdd
void InsertFxPopup::onAdd()
{
TFx *fx = createFx();
if (fx) {
TApp *app = TApp::instance();
TXsheetHandle *xshHandle = app->getCurrentXsheet();
QList<TFxP> fxs;
FxSelection *selection = dynamic_cast<FxSelection *>(app->getCurrentSelection()->getSelection());
if (selection)
fxs = selection->getFxs();
TFxCommand::addFx(fx, fxs, app,
app->getCurrentColumn()->getColumnIndex(),
app->getCurrentFrame()->getFrameIndex());
xshHandle->notifyXsheetChanged();
}
}
示例10: showEvent
void BinarizePopup::showEvent(QShowEvent *e)
{
TApp *app = TApp::instance();
TPixel32 col1, col2;
Preferences::instance()->getChessboardColors(col1, col2);
m_viewer->setBgColor(col1, col2);
bool ret = true;
ret = ret && connect(app->getCurrentFrame(), SIGNAL(frameTypeChanged()), this, SLOT(fetchSample()));
ret = ret && connect(app->getCurrentFrame(), SIGNAL(frameSwitched()), this, SLOT(fetchSample()));
ret = ret && connect(app->getCurrentColumn(), SIGNAL(columnIndexSwitched()), this, SLOT(fetchSample()));
ret = ret && connect(app->getCurrentLevel(), SIGNAL(xshLevelSwitched(TXshLevel *)), this, SLOT(onLevelSwitched(TXshLevel *)));
ret = ret && connect(app->getCurrentLevel(), SIGNAL(xshLevelChanged()), this, SLOT(fetchSample()));
assert(ret);
m_previewChk->setChecked(false);
fetchSample();
}
示例11: onDrawFrame
void ComboViewerPanel::onDrawFrame(
int frame, const ImagePainter::VisualSettings &settings) {
TApp *app = TApp::instance();
m_sceneViewer->setVisual(settings);
TFrameHandle *frameHandle = app->getCurrentFrame();
if (m_sceneViewer->isPreviewEnabled()) {
class Previewer *pr = Previewer::instance(m_sceneViewer->getPreviewMode() ==
SceneViewer::SUBCAMERA_PREVIEW);
pr->getRaster(frame - 1); // the 'getRaster' starts the render of the frame
// is not already started
int curFrame = frame;
if (frameHandle->isPlaying() &&
!pr->isFrameReady(
frame - 1)) // stops on last rendered frame until current is ready!
{
while (frame > 0 && !pr->isFrameReady(frame - 1)) frame--;
if (frame == 0)
frame = curFrame; // if no frame is ready, I stay on current...no use
// to rewind
m_flipConsole->setCurrentFrame(frame);
}
}
assert(frame >= 0);
if (frame != frameHandle->getFrameIndex() + 1) {
if (frameHandle->isEditingScene()) {
TXshColumn *column = app->getCurrentXsheet()->getXsheet()->getColumn(
app->getCurrentColumn()->getColumnIndex());
if (column) {
TXshSoundColumn *soundColumn = column->getSoundColumn();
if (soundColumn && !soundColumn->isPlaying())
app->getCurrentFrame()->scrubColumn(frame, frame, soundColumn);
}
}
frameHandle->setCurrentFrame(frame);
}
else if (settings.m_blankColor != TPixel::Transparent)
m_sceneViewer->update();
}
示例12: setCurrentSampleRaster
void AntialiasPopup::setCurrentSampleRaster()
{
TRasterP sampleRas;
m_startRas = TRasterP();
TSelection *selection = TApp::instance()->getCurrentSelection()->getSelection();
TCellSelection *cellSelection = dynamic_cast<TCellSelection *>(selection);
TFilmstripSelection *filmstripSelection = dynamic_cast<TFilmstripSelection *>(selection);
TImageP image;
if (cellSelection) {
TApp *app = TApp::instance();
TXsheet *xsh = app->getCurrentXsheet()->getXsheet();
TXshCell cell = xsh->getCell(app->getCurrentFrame()->getFrameIndex(), app->getCurrentColumn()->getColumnIndex());
TImageP aux = cell.getImage(true);
if (aux)
image = aux->cloneImage();
} else if (filmstripSelection) {
TApp *app = TApp::instance();
TXshSimpleLevel *simpleLevel = app->getCurrentLevel()->getSimpleLevel();
if (simpleLevel) {
TImageP imageAux = simpleLevel->getFrame(app->getCurrentFrame()->getFid(), true);
if (imageAux)
image = imageAux->cloneImage();
}
}
if (!image || !(sampleRas = image->raster())) {
m_viewer->setImage(TImageP());
m_viewer->update();
m_okBtn->setEnabled(false);
return;
}
m_okBtn->setEnabled(true);
m_startRas = sampleRas->clone();
onChange(m_startRas, sampleRas, m_thresholdField->getValue(), m_softnessField->getValue());
m_viewer->setImage(image);
m_viewer->update();
}
示例13: acquireRaster
void AdjustLevelsPopup::acquireRaster()
{
//Retrieve current selection
TApp *app = TApp::instance();
TSelection *selection = app->getCurrentSelection()->getSelection();
TCellSelection *cellSelection = dynamic_cast<TCellSelection *>(selection);
TFilmstripSelection *filmstripSelection = dynamic_cast<TFilmstripSelection *>(selection);
//Retrieve the input raster
m_inputRas = TRasterP();
if (cellSelection) {
TXsheet *xsh = app->getCurrentXsheet()->getXsheet();
TXshCell cell = xsh->getCell(app->getCurrentFrame()->getFrameIndex(), app->getCurrentColumn()->getColumnIndex());
TRasterImageP rasImage = cell.getImage(true);
if (rasImage && rasImage->getRaster())
m_inputRas = rasImage->getRaster();
} else if (filmstripSelection) {
TXshSimpleLevel *simpleLevel = app->getCurrentLevel()->getSimpleLevel();
if (simpleLevel) {
TRasterImageP rasImage = (TRasterImageP)simpleLevel->getFrame(app->getCurrentFrame()->getFid(), true);
if (rasImage && rasImage->getRaster())
m_inputRas = rasImage->getRaster();
}
}
if (m_inputRas) {
m_threshold = m_inputRas->getLx() * m_inputRas->getLy() * m_thresholdD;
m_okBtn->setEnabled(true);
} else {
m_inputRas = TRasterP();
m_okBtn->setEnabled(false);
}
//Build histograms
m_histogram->setRaster(m_inputRas);
//Update the corresponding processed image in the viewer
updateProcessedImage();
}
示例14: fetchSample
void BinarizePopup::fetchSample()
{
TApp *app = TApp::instance();
TImageP img;
if (app->getCurrentFrame()->isEditingLevel()) {
TXshLevel *xshLevel = app->getCurrentLevel()->getLevel();
if (xshLevel && xshLevel->getSimpleLevel()) {
TXshSimpleLevel *sl = xshLevel->getSimpleLevel();
img = sl->getFrame(app->getCurrentFrame()->getFid(), false);
}
} else {
TXsheet *xsh = app->getCurrentScene()->getScene()->getXsheet();
TXshCell cell = xsh->getCell(app->getCurrentFrame()->getFrame(), app->getCurrentColumn()->getColumnIndex());
img = cell.getImage(false);
}
TRasterImageP ri = img;
if (ri) {
setSample(ri->getRaster());
} else {
setSample(TRasterP());
}
}
示例15: setCurrentSampleRaster
void BrightnessAndContrastPopup::setCurrentSampleRaster()
{
TRasterP sampleRas;
m_startRas = TRasterP();
TSelection *selection = TApp::instance()->getCurrentSelection()->getSelection();
TCellSelection *cellSelection = dynamic_cast<TCellSelection *>(selection);
TFilmstripSelection *filmstripSelection = dynamic_cast<TFilmstripSelection *>(selection);
if (cellSelection) {
TApp *app = TApp::instance();
TXsheet *xsh = app->getCurrentXsheet()->getXsheet();
TXshCell cell = xsh->getCell(app->getCurrentFrame()->getFrameIndex(), app->getCurrentColumn()->getColumnIndex());
TRasterImageP rasImage = cell.getImage(true);
if (rasImage && rasImage->getRaster())
sampleRas = rasImage->getRaster()->clone();
} else if (filmstripSelection) {
TApp *app = TApp::instance();
TXshSimpleLevel *simpleLevel = app->getCurrentLevel()->getSimpleLevel();
if (simpleLevel) {
TRasterImageP rasImage = (TRasterImageP)simpleLevel->getFrame(app->getCurrentFrame()->getFid(), true);
if (rasImage && rasImage->getRaster())
sampleRas = rasImage->getRaster()->clone();
}
}
if (!sampleRas) {
m_viewer->raster() = TRasterP();
m_viewer->update();
m_okBtn->setEnabled(false);
return;
}
m_okBtn->setEnabled(true);
m_startRas = sampleRas->clone();
onChange(m_startRas, sampleRas, m_contrastField->getValue(), m_brightnessField->getValue());
m_viewer->raster() = sampleRas;
m_viewer->update();
}