本文整理汇总了C++中ttool::Application类的典型用法代码示例。如果您正苦于以下问题:C++ Application类的具体用法?C++ Application怎么用?C++ Application使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Application类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: multiAutocloseRegion
void multiAutocloseRegion(TStroke *stroke, const TMouseEvent &e) {
TTool::Application *app = TTool::getApplication();
if (m_firstStroke) {
multiApplyAutoclose(m_firstFrameId, getFrameId(), TRectD(), TRectD(),
m_firstStroke, stroke);
invalidate();
if (e.isShiftPressed()) {
delete m_firstStroke;
m_firstStroke = new TStroke(*stroke);
m_firstFrameId = getFrameId();
} else {
if (m_isXsheetCell) {
app->getCurrentColumn()->setColumnIndex(m_currCell.first);
app->getCurrentFrame()->setFrame(m_currCell.second);
} else
app->getCurrentFrame()->setFid(m_veryFirstFrameId);
resetMulti();
}
} else {
m_isXsheetCell = app->getCurrentFrame()->isEditingScene();
// if (m_isXsheetCell)
m_currCell = std::pair<int, int>(getColumnIndex(), getFrame());
m_firstStroke = new TStroke(*stroke);
}
return;
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:26,代码来源:rastertapetool.cpp
示例2: onActivate
void FullColorBrushTool::onActivate()
{
if (!m_notifier)
m_notifier = new FullColorBrushToolNotifier(this);
TTool::Application *app = getApplication();
if (app->getCurrentObject()->isSpline()) {
m_currentColor = TPixel32::Red;
return;
}
int styleIndex = app->getCurrentLevelStyleIndex();
TPalette *plt = app->getCurrentPalette()->getPalette();
if (plt) {
int style = app->getCurrentLevelStyleIndex();
TColorStyle *colorStyle = plt->getStyle(style);
m_currentColor = colorStyle->getMainColor();
}
if (m_firstTime) {
m_firstTime = false;
m_thickness.setValue(TIntPairProperty::Value(FullcolorBrushMinSize, FullcolorBrushMaxSize));
m_pressure.setValue(FullcolorPressureSensibility ? 1 : 0);
m_opacity.setValue(TDoublePairProperty::Value(FullcolorMinOpacity, FullcolorMaxOpacity));
m_hardness.setValue(FullcolorBrushHardness);
}
m_brushPad = ToolUtils::getBrushPad(m_thickness.getValue().second, m_hardness.getValue() * 0.01);
setWorkAndBackupImages();
}
开发者ID:ArseniyShestakov,项目名称:opentoonz,代码行数:31,代码来源:fullcolorbrushtool.cpp
示例3: pickRect
void RGBPickerTool::pickRect() {
TImageP image = TImageP(getImage(false));
TTool::Application *app = TTool::getApplication();
TPaletteHandle *ph = app->getPaletteController()->getCurrentPalette();
int styleId = ph->getStyleIndex();
TPalette *palette = ph->getPalette();
TRectD area = m_selectingRect;
if (!palette) return;
if (m_selectingRect.x0 > m_selectingRect.x1) {
area.x1 = m_selectingRect.x0;
area.x0 = m_selectingRect.x1;
}
if (m_selectingRect.y0 > m_selectingRect.y1) {
area.y1 = m_selectingRect.y0;
area.y0 = m_selectingRect.y1;
}
m_selectingRect.empty();
if (area.getLx() <= 1 || area.getLy() <= 1) return;
StylePicker picker(image, palette);
// iwsw commented out temporarily
// if (m_viewer->get3DLutUtil() &&
// Preferences::instance()->isDoColorCorrectionByUsing3DLutEnabled())
// m_viewer->get3DLutUtil()->bindFBO();
m_currentValue = picker.pickColor(area);
// iwsw commented out temporarily
// if (m_viewer->get3DLutUtil() &&
// Preferences::instance()->isDoColorCorrectionByUsing3DLutEnabled())
// m_viewer->get3DLutUtil()->releaseFBO();
}
开发者ID:walkerka,项目名称:opentoonz,代码行数:33,代码来源:rgbpickertool.cpp
示例4: leftButtonDown
void RGBPickerTool::leftButtonDown(const TPointD &pos, const TMouseEvent &e) {
TTool::Application *app = TTool::getApplication();
TPaletteHandle *pltHandle = app->getPaletteController()->getCurrentPalette();
m_currentStyleId = pltHandle->getStyleIndex();
if (m_currentStyleId == 0) return;
TColorStyle *colorStyle = pltHandle->getStyle();
if (colorStyle) m_oldValue = colorStyle->getMainColor();
if (m_pickType.getValue() == RECT_PICK) {
m_selectingRect.x0 = e.m_pos.x;
m_selectingRect.y0 = e.m_pos.y;
m_selectingRect.x1 = e.m_pos.x;
m_selectingRect.y1 = e.m_pos.y;
m_drawingRect.x0 = pos.x;
m_drawingRect.y0 = pos.y;
m_drawingRect.x1 = pos.x;
m_drawingRect.y1 = pos.y;
invalidate();
return;
} else if (m_pickType.getValue() == FREEHAND_PICK) {
startFreehand(pos, convert(e.m_pos));
return;
} else if (m_pickType.getValue() == POLYLINE_PICK) {
addPointPolyline(pos, convert(e.m_pos));
return;
} else {
pick(e.m_pos);
}
}
开发者ID:walkerka,项目名称:opentoonz,代码行数:31,代码来源:rgbpickertool.cpp
示例5: magicLink
void SkeletonTool::magicLink(int index)
{
if (index < 0 || index >= (int)m_magicLinks.size())
return;
HookData h0 = m_magicLinks[index].m_h0;
HookData h1 = m_magicLinks[index].m_h1;
TTool::Application *app = TTool::getApplication();
TXsheet *xsh = app->getCurrentXsheet()->getXsheet();
int columnIndex = app->getCurrentColumn()->getColumnIndex();
TStageObjectId id = TStageObjectId::ColumnId(columnIndex);
TStageObject *obj = xsh->getStageObject(id);
int parentColumnIndex = h1.m_columnIndex;
TStageObjectId parentId = TStageObjectId::ColumnId(parentColumnIndex);
std::string parentHandle = h1.getHandle();
std::string handle = "";
if (h0.m_columnIndex < 0) {
handle = obj->getHandle();
} else {
handle = h0.getHandle();
}
//TUndoManager *undoManager = TUndoManager::manager();
//undoManager->beginBlock();
TStageObjectCmd::setHandle(id, handle, app->getCurrentXsheet());
TStageObjectCmd::setParent(id, parentId, parentHandle, app->getCurrentXsheet());
//undoManager->endBlock();
}
开发者ID:titer1,项目名称:opentoonz,代码行数:29,代码来源:skeletontool.cpp
示例6: onImageChanged
void onImageChanged() override {
if (!m_multi.getValue()) return;
TTool::Application *app = TTool::getApplication();
TXshSimpleLevel *xshl = 0;
if (app->getCurrentLevel()->getLevel())
xshl = app->getCurrentLevel()->getSimpleLevel();
if (!xshl || m_level.getPointer() != xshl ||
(m_closeType.getValue() == RECT_CLOSE && m_selectingRect.isEmpty()) ||
((m_closeType.getValue() == FREEHAND_CLOSE ||
m_closeType.getValue() == POLYLINE_CLOSE) &&
!m_firstStroke))
resetMulti();
else if (m_firstFrameId == getFrameId())
m_firstFrameSelected = false; // nel caso sono passato allo stato 1 e
// torno all'immagine iniziale, torno allo
// stato iniziale
else { // cambio stato.
m_firstFrameSelected = true;
if (m_closeType.getValue() == RECT_CLOSE) {
assert(!m_selectingRect.isEmpty());
m_firstRect = m_selectingRect;
}
}
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:25,代码来源:rastertapetool.cpp
示例7: resetMulti
void resetMulti() {
m_firstFrameSelected = false;
m_firstRect.empty();
m_firstPoint = TPointD();
m_selectingRect.empty();
TTool::Application *app = TTool::getApplication();
m_level = app->getCurrentLevel()->getLevel()
? app->getCurrentLevel()->getSimpleLevel()
: 0;
m_firstFrameId = m_veryFirstFrameId = getFrameId();
m_firstStroke = 0;
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:12,代码来源:rastertapetool.cpp
示例8: leftButtonUp
void FullColorBrushTool::leftButtonUp(const TPointD &pos, const TMouseEvent &e)
{
m_brushPos = m_mousePos = pos;
TRasterImageP ri = (TRasterImageP)getImage(true);
if (!ri)
return;
if (m_points.size() != 1) {
double maxThickness = m_thickness.getValue().second;
double thickness = m_pressure.getValue() ? computeThickness(e.m_pressure, m_thickness) : maxThickness;
double opacity = (m_pressure.getValue() ? computeThickness(e.m_pressure, m_opacity) : m_opacity.getValue().second) * 0.01;
TPointD rasCenter = ri->getRaster()->getCenterD();
TThickPoint point(pos + rasCenter, thickness);
m_points.push_back(point);
int m = m_points.size();
vector<TThickPoint> points;
points.push_back(m_points[m - 3]);
points.push_back(m_points[m - 2]);
points.push_back(m_points[m - 1]);
TRect bbox = m_brush->getBoundFromPoints(points);
updateWorkAndBackupRasters(bbox);
m_tileSaver->save(bbox);
m_brush->addArc(points[0], points[1], points[2], m_oldOpacity, opacity);
m_brush->updateDrawing(ri->getRaster(), m_backUpRas, m_currentColor, bbox, m_opacity.getValue().second * 0.01);
TRectD invalidateRect = ToolUtils::getBounds(points, maxThickness);
invalidate(invalidateRect.enlarge(2) - rasCenter);
m_strokeRect += bbox;
m_lastRect.empty();
}
if (m_brush) {
delete m_brush;
m_brush = 0;
}
m_workRaster->unlock();
if (m_tileSet->getTileCount() > 0) {
delete m_tileSaver;
TTool::Application *app = TTool::getApplication();
TXshLevel *level = app->getCurrentLevel()->getLevel();
TXshSimpleLevelP simLevel = level->getSimpleLevel();
TFrameId frameId = getCurrentFid();
TRasterP ras = ri->getRaster()->extract(m_strokeRect)->clone();
TUndoManager::manager()->add(new FullColorBrushUndo(m_tileSet, simLevel.getPointer(), frameId,
m_isFrameCreated, ras, m_strokeRect.getP00()));
}
notifyImageChanged();
m_strokeRect.empty();
}
开发者ID:ArseniyShestakov,项目名称:opentoonz,代码行数:52,代码来源:fullcolorbrushtool.cpp
示例9: doesApply
bool SkeletonTool::doesApply() const
{
TTool::Application *app = TTool::getApplication();
TXsheet *xsh = app->getCurrentXsheet()->getXsheet();
assert(xsh);
TStageObjectId objId = app->getCurrentObject()->getObjectId();
if (objId.isColumn()) {
TXshColumn *column = xsh->getColumn(objId.getIndex());
if (column && column->getSoundColumn())
return false;
}
return true;
}
开发者ID:titer1,项目名称:opentoonz,代码行数:13,代码来源:skeletontool.cpp
示例10: connect
FullColorBrushToolNotifier::FullColorBrushToolNotifier(FullColorBrushTool *tool)
: m_tool(tool)
{
TTool::Application *app = m_tool->getApplication();
TXshLevelHandle *levelHandle;
if (app)
levelHandle = app->getCurrentLevel();
bool ret = false;
if (levelHandle) {
bool ret = connect(levelHandle, SIGNAL(xshCanvasSizeChanged()), this, SLOT(onCanvasSizeChanged()));
assert(ret);
}
}
开发者ID:ArseniyShestakov,项目名称:opentoonz,代码行数:13,代码来源:fullcolorbrushtool.cpp
示例11: onActivate
void SkeletonTool::onActivate()
{
TTool::Application *app = TTool::getApplication();
if (m_firstTime) {
m_globalKeyframes.setValue(SkeletonGlobalKeyFrame ? 1 : 0);
m_mode.setValue(BUILD_SKELETON);
// m_ikEnabled.setValue(SkeletonInverseKinematics ? 1 : 0);
m_firstTime = false;
}
TStageObjectId objId = app->getCurrentObject()->getObjectId();
if (objId == TStageObjectId::NoneId) {
int index = app->getCurrentColumn()->getColumnIndex();
objId = TStageObjectId::ColumnId(index);
}
// app->editStageObject(objId);
}
开发者ID:titer1,项目名称:opentoonz,代码行数:16,代码来源:skeletontool.cpp
示例12: leftButtonDown
void leftButtonDown(const TPointD &pos, const TMouseEvent &) override {
TToonzImageP ti = TToonzImageP(getImage(true));
if (!ti) return;
if (m_closeType.getValue() == RECT_CLOSE) {
m_selecting = true;
m_selectingRect.x0 = pos.x;
m_selectingRect.y0 = pos.y;
m_selectingRect.x1 = pos.x + 1;
m_selectingRect.y1 = pos.y + 1;
return;
} else if (m_closeType.getValue() == FREEHAND_CLOSE) {
startFreehand(pos);
return;
} else if (m_closeType.getValue() == POLYLINE_CLOSE) {
addPointPolyline(pos);
return;
} else if (m_closeType.getValue() == NORMAL_CLOSE) {
if (m_multi.getValue()) {
TTool::Application *app = TTool::getApplication();
if (m_firstFrameSelected) {
multiApplyAutoclose(m_firstFrameId, getFrameId());
invalidate();
if (m_isXsheetCell) {
app->getCurrentColumn()->setColumnIndex(m_currCell.first);
app->getCurrentFrame()->setFrame(m_currCell.second);
} else
app->getCurrentFrame()->setFid(m_veryFirstFrameId);
resetMulti();
} else {
m_isXsheetCell = app->getCurrentFrame()->isEditingScene();
// if (m_isXsheetCell)
m_currCell = std::pair<int, int>(getColumnIndex(), getFrame());
m_firstFrameSelected = true;
m_firstPoint = pos;
}
invalidate();
return;
}
m_selecting = false;
applyAutoclose(ti);
invalidate();
notifyImageChanged();
}
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:46,代码来源:rastertapetool.cpp
示例13: setCurrentColorWithUndo
void setCurrentColorWithUndo(const TPixel32 &color) {
TTool::Application *app = TTool::getApplication();
TPaletteHandle *ph = app->getPaletteController()->getCurrentPalette();
int styleId = ph->getStyleIndex();
TPalette *palette = ph->getPalette();
TXshSimpleLevel *level = app->getCurrentLevel()->getSimpleLevel();
if (palette)
TUndoManager::manager()->add(
new UndoPickRGBM(palette, styleId, color, level));
setCurrentColor(color);
if (level) {
std::vector<TFrameId> fids;
level->getFids(fids);
invalidateIcons(level, fids);
}
}
开发者ID:walkerka,项目名称:opentoonz,代码行数:18,代码来源:rgbpickertool.cpp
示例14: onImageChanged
void RGBPickerTool::onImageChanged() {
if (m_currentStyleId != 0 && m_makePick &&
(m_pickType.getValue() == POLYLINE_PICK ||
m_pickType.getValue() == RECT_PICK)) {
TTool::Application *app = TTool::getApplication();
TPaletteHandle *ph = app->getPaletteController()->getCurrentPalette();
int styleId = ph->getStyleIndex();
TPalette *palette = ph->getPalette();
TXshSimpleLevel *level = app->getCurrentLevel()->getSimpleLevel();
if (palette)
TUndoManager::manager()->add(
new UndoPickRGBM(palette, styleId, m_currentValue, level));
setCurrentColor(m_currentValue);
if (level) {
std::vector<TFrameId> fids;
level->getFids(fids);
invalidateIcons(level, fids);
}
}
m_makePick = false;
}
开发者ID:walkerka,项目名称:opentoonz,代码行数:21,代码来源:rgbpickertool.cpp
示例15: updateLevel
void updateLevel()
{
TTool::Application *app = TTool::getApplication();
if (!app->getCurrentLevel()->getLevel())
return;
TXshSimpleLevelP xl = app->getCurrentLevel()->getLevel()->getSimpleLevel();
if (app->getCurrentFrame()->getFrameType() != TFrameHandle::LevelFrame)
return;
TFrameId fid = app->getCurrentFrame()->getFid();
TVectorImageP src = xl->getFrame(fid, true);
int count = src->getStrokeCount();
for (int i = 1; i < 10; i++) {
++fid;
if (!xl->isFid(fid)) {
TVectorImageP vi = new TVectorImage();
xl->setFrame(fid, vi);
}
TVectorImageP vi = xl->getFrame(fid, true);
TVectorImageP dst = src->clone();
deform(dst.getPointer(), src.getPointer(), (double)i / (double)9);
count = dst->getStrokeCount();
vi->mergeImage(dst, TAffine());
app->getCurrentTool()->getTool()->notifyImageChanged(fid);
}
}
开发者ID:ArseniyShestakov,项目名称:opentoonz,代码行数:27,代码来源:morphtool.cpp
示例16: pick
void RGBPickerTool::pick(TPoint pos) {
TImageP image = TImageP(getImage(false));
TTool::Application *app = TTool::getApplication();
TPaletteHandle *ph = app->getPaletteController()->getCurrentPalette();
int styleId = ph->getStyleIndex();
TPalette *palette = ph->getPalette();
if (!palette) return;
TRectD area = TRectD(pos.x - 1, pos.y - 1, pos.x + 1, pos.y + 1);
StylePicker picker(image, palette);
// iwsw commented out temporarily
// if (m_viewer->get3DLutUtil() &&
// Preferences::instance()->isDoColorCorrectionByUsing3DLutEnabled())
// m_viewer->get3DLutUtil()->bindFBO();
m_currentValue = picker.pickColor(area);
// iwsw commented out temporarily
// if (m_viewer->get3DLutUtil() &&
// Preferences::instance()->isDoColorCorrectionByUsing3DLutEnabled())
// m_viewer->get3DLutUtil()->releaseFBO();
TXshSimpleLevel *level = app->getCurrentLevel()->getSimpleLevel();
UndoPickRGBM *cmd = new UndoPickRGBM(palette, styleId, m_currentValue, level);
TUndoManager::manager()->add(cmd);
cmd->redo();
/*
setCurrentColor(m_currentValue);
if(level)
{
vector<TFrameId> fids;
level->getFids(fids);
invalidateIcons(level,fids);
}
*/
}
开发者ID:walkerka,项目名称:opentoonz,代码行数:38,代码来源:rgbpickertool.cpp
示例17:
TAffine TTool::getCurrentObjectParentMatrix2() const {
TTool::Application *app = m_application;
TFrameHandle *fh = app->getCurrentFrame();
if (fh->isEditingLevel()) return TAffine();
int frame = fh->getFrame();
TXsheet *xsh = app->getCurrentXsheet()->getXsheet();
TStageObjectId id = app->getCurrentObject()->getObjectId();
double objZ = xsh->getZ(id, frame);
TStageObjectId parentId = xsh->getStageObjectParent(id);
if (parentId == TStageObjectId::NoneId) return TAffine();
id = parentId;
TAffine objPlacement = xsh->getPlacement(id, frame);
TStageObjectId cameraId = xsh->getStageObjectTree()->getCurrentCameraId();
TStageObject *camera = xsh->getStageObject(cameraId);
TAffine cameraPlacement = camera->getPlacement(frame);
double cameraZ = camera->getZ(frame);
TAffine placement;
TStageObject::perspective(placement, cameraPlacement, cameraZ, objPlacement,
objZ, 0);
return placement;
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:23,代码来源:tool.cpp
示例18: pickStroke
void RGBPickerTool::pickStroke() {
TImageP image = TImageP(getImage(false));
TTool::Application *app = TTool::getApplication();
TPaletteHandle *ph = app->getPaletteController()->getCurrentPalette();
int styleId = ph->getStyleIndex();
TPalette *palette = ph->getPalette();
if (!palette) return;
StylePicker picker(image, palette);
TStroke *stroke = new TStroke(*m_stroke);
// iwsw commented out temporarily
// if (m_viewer->get3DLutUtil() &&
// Preferences::instance()->isDoColorCorrectionByUsing3DLutEnabled())
// m_viewer->get3DLutUtil()->bindFBO();
m_currentValue = picker.pickColor(stroke);
// iwsw commented out temporarily
// if (m_viewer->get3DLutUtil() &&
// Preferences::instance()->isDoColorCorrectionByUsing3DLutEnabled())
// m_viewer->get3DLutUtil()->releaseFBO();
if (!(m_pickType.getValue() == POLYLINE_PICK)) {
TXshSimpleLevel *level = app->getCurrentLevel()->getSimpleLevel();
TUndoManager::manager()->add(
new UndoPickRGBM(palette, styleId, m_currentValue, level));
setCurrentColor(m_currentValue);
if (level) {
std::vector<TFrameId> fids;
level->getFids(fids);
invalidateIcons(level, fids);
}
}
}
开发者ID:walkerka,项目名称:opentoonz,代码行数:36,代码来源:rgbpickertool.cpp
示例19: draw
void SkeletonTool::draw()
{
// parent object reference system
//glColor3d(1,0,0);
//tglDrawRect(0,0,100,100);
if (m_label != "")
ToolUtils::drawBalloon(m_labelPos, m_label, TPixel32::Red, TPoint(20, -20), false);
bool ikEnabled = m_mode.getValue() == INVERSE_KINEMATICS;
assert(glGetError() == GL_NO_ERROR);
// l'xsheet, oggetto (e relativo placement), frame corrente
TTool::Application *app = TTool::getApplication();
TXsheet *xsh = getXsheet();
assert(xsh);
TStageObjectId objId = app->getCurrentObject()->getObjectId();
// se l'oggetto corrente non e' una colonna non disegno nulla
if (!objId.isColumn())
return;
TStageObject *pegbar = xsh->getStageObject(objId);
int col = objId.getIndex();
int frame = app->getCurrentFrame()->getFrame();
if (m_currentFrame != frame)
m_temporaryPinnedColumns.clear();
TAffine aff = getMatrix();
// puo' suggere che il placement degeneri (es.: c'e' uno h-scale = 0%)
if (fabs(aff.det()) < 0.00001)
return;
// m_unit = getPixelSize() * sqrt(fabs(aff.det()));
if (!ikEnabled)
drawLevelBoundingBox(frame, col);
glPushMatrix();
tglMultMatrix(aff.inv());
// camera stand reference system
//glColor3d(0,1,0);
//tglDrawRect(0,0,100,100);
bool changingParent = dynamic_cast<ParentChangeTool *>(m_dragTool) != 0;
// !changingParent &&
if (m_mode.getValue() == BUILD_SKELETON && !xsh->getStageObjectParent(objId).isColumn()) {
if (!changingParent)
drawHooks();
}
Skeleton skeleton;
buildSkeleton(skeleton, col);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
drawSkeleton(skeleton, frame);
glDisable(GL_BLEND);
TXshCell cell = xsh->getCell(frame, objId.getIndex());
Skeleton::Bone *rootBone = skeleton.getRootBone();
for (int i = 0; i < skeleton.getBoneCount(); i++) {
Skeleton::Bone *bone = skeleton.getBone(i);
TStageObjectId currentId = bone->getStageObject()->getId();
bool isCurrent = (currentId == objId);
TPointD pos = bone->getCenter();
if (isCurrent && m_mode.getValue() != BUILD_SKELETON) {
drawDrawingBrowser(cell, pos);
}
bool isActiveChain = bone->isSelected();
glColor3d(0, 1, 0);
if (ikEnabled) {
drawIKJoint(bone);
} else {
TPointD pos = bone->getCenter();
if (isCurrent && m_mode.getValue() == ANIMATE) {
drawMainGadget(pos);
}
}
}
m_currentFrame = frame;
if (m_dragTool)
m_dragTool->draw();
glPopMatrix();
}
开发者ID:titer1,项目名称:opentoonz,代码行数:90,代码来源:skeletontool.cpp
示例20: leftButtonUp
void leftButtonUp(const TPointD &pos, const TMouseEvent &e) override {
TToonzImageP ti = TToonzImageP(getImage(true));
if (!ti) return;
/*-- Rectの座標の向きを揃える --*/
if (m_selectingRect.x0 > m_selectingRect.x1)
tswap(m_selectingRect.x1, m_selectingRect.x0);
if (m_selectingRect.y0 > m_selectingRect.y1)
tswap(m_selectingRect.y1, m_selectingRect.y0);
TTool::Application *app = TTool::getApplication();
m_selecting = false;
TRasterCM32P ras;
if (m_closeType.getValue() == RECT_CLOSE) {
if (m_multi.getValue()) {
if (m_firstFrameSelected) {
multiApplyAutoclose(m_firstFrameId, getFrameId(), m_firstRect,
m_selectingRect);
invalidate(m_selectingRect.enlarge(2));
if (e.isShiftPressed()) {
m_firstRect = m_selectingRect;
m_firstFrameId = getFrameId();
} else {
if (m_isXsheetCell) {
app->getCurrentColumn()->setColumnIndex(m_currCell.first);
app->getCurrentFrame()->setFrame(m_currCell.second);
} else
app->getCurrentFrame()->setFid(m_veryFirstFrameId);
resetMulti();
}
} else {
m_isXsheetCell = app->getCurrentFrame()->isEditingScene();
// if (m_isXsheetCell)
m_currCell = std::pair<int, int>(getColumnIndex(), this->getFrame());
}
return;
}
/*-- AutoCloseが実行されたか判定する --*/
if (!applyAutoclose(ti, m_selectingRect)) {
if (m_stroke) {
delete m_stroke;
m_stroke = 0;
}
invalidate();
return;
}
invalidate();
notifyImageChanged();
} else if (m_closeType.getValue() == FREEHAND_CLOSE) {
closeFreehand(pos);
if (m_multi.getValue())
multiAutocloseRegion(m_stroke, e);
else
applyAutoclose(ti, TRectD(), m_stroke);
m_track.clear();
invalidate();
}
if (m_stroke) {
delete m_stroke;
m_stroke = 0;
}
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:65,代码来源:rastertapetool.cpp
注:本文中的ttool::Application类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论