OpenToonz changes as of 11-11-20 (#489)
* removed unused tcleanuppreprocessor.cpp and .h Signed-off-by: Jeremy Bullock <jcbullock@gmail.com> * removed unused directory lzodriver Signed-off-by: Jeremy Bullock <jcbullock@gmail.com> * OpenToonz changes as of 11-11-20 Co-authored-by: Sean Kuehl <teddscottfelt@gmail.com>
This commit is contained in:
parent
49d34403ac
commit
51daab8588
45 changed files with 275 additions and 310 deletions
|
@ -4,8 +4,6 @@
|
|||
#define _WIN32_WINNT 0x0400
|
||||
#include <windows.h>
|
||||
|
||||
using std::list<TThread *>;
|
||||
|
||||
class TThreadGroupImp;
|
||||
//---------------------------------------------------------------------------
|
||||
// TMutex & TMutexImp
|
||||
|
@ -24,7 +22,7 @@ public:
|
|||
//---------------------------------------------------------------------------
|
||||
|
||||
class TThreadGroupImp {
|
||||
list<TThread *> threads;
|
||||
std::list<TThread *> threads;
|
||||
|
||||
public:
|
||||
TThreadGroupImp();
|
||||
|
@ -274,7 +272,7 @@ void TThreadGroupImp::wait() {
|
|||
if (count == 0) return;
|
||||
HANDLE *hThreads = new HANDLE[count];
|
||||
int id = 0;
|
||||
for (list<TThread *>::iterator it = threads.begin(); it != threads.end();
|
||||
for (std::list<TThread *>::iterator it = threads.begin(); it != threads.end();
|
||||
it++, id++) {
|
||||
TThread *t = *it;
|
||||
if (t->m_imp->threadId == 0) t->start();
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
using std::for_each;
|
||||
|
||||
namespace {
|
||||
|
||||
void deleteUndo(const TUndo *undo) { delete undo; }
|
||||
|
@ -26,7 +24,7 @@ public:
|
|||
assert(m_undoing == false);
|
||||
assert(m_deleted == false);
|
||||
m_deleted = true;
|
||||
for_each(m_undos.begin(), m_undos.end(), deleteUndo);
|
||||
std::for_each(m_undos.begin(), m_undos.end(), deleteUndo);
|
||||
m_undos.clear();
|
||||
}
|
||||
|
||||
|
@ -49,7 +47,7 @@ public:
|
|||
assert(!m_undoing);
|
||||
m_undoing = true;
|
||||
// VERSIONE CORRETTA
|
||||
for_each(m_undos.rbegin(), m_undos.rend(), callUndo);
|
||||
std::for_each(m_undos.rbegin(), m_undos.rend(), callUndo);
|
||||
// VERSIONE SBAGLIATA
|
||||
// for_each(m_undos.begin(), m_undos.end(), callUndo);
|
||||
m_undoing = false;
|
||||
|
@ -57,7 +55,7 @@ public:
|
|||
void redo() const override {
|
||||
assert(!m_deleted);
|
||||
// VERSIONE CORRETTA
|
||||
for_each(m_undos.begin(), m_undos.end(), callRedo);
|
||||
std::for_each(m_undos.begin(), m_undos.end(), callRedo);
|
||||
// VERSIONE SBAGLIATA
|
||||
// for_each(m_undos.rbegin(), m_undos.rend(), callRedo);
|
||||
}
|
||||
|
@ -181,7 +179,7 @@ void TUndoManager::TUndoManagerImp::add(TUndo *undo) {
|
|||
|
||||
void TUndoManager::TUndoManagerImp::doAdd(TUndo *undo) {
|
||||
if (m_current != m_undoList.end()) {
|
||||
for_each(m_current, m_undoList.end(), deleteUndo);
|
||||
std::for_each(m_current, m_undoList.end(), deleteUndo);
|
||||
m_undoList.erase(m_current, m_undoList.end());
|
||||
}
|
||||
|
||||
|
@ -208,7 +206,7 @@ void TUndoManager::TUndoManagerImp::doAdd(TUndo *undo) {
|
|||
|
||||
void TUndoManager::beginBlock() {
|
||||
if (m_imp->m_current != m_imp->m_undoList.end()) {
|
||||
for_each(m_imp->m_current, m_imp->m_undoList.end(), deleteUndo);
|
||||
std::for_each(m_imp->m_current, m_imp->m_undoList.end(), deleteUndo);
|
||||
m_imp->m_undoList.erase(m_imp->m_current, m_imp->m_undoList.end());
|
||||
}
|
||||
|
||||
|
@ -315,7 +313,7 @@ void TUndoManager::reset() {
|
|||
assert(m_imp->m_blockStack.empty());
|
||||
m_imp->m_blockStack.clear();
|
||||
UndoList &lst = m_imp->m_undoList;
|
||||
for_each(lst.begin(), lst.end(), deleteUndo);
|
||||
std::for_each(lst.begin(), lst.end(), deleteUndo);
|
||||
lst.clear();
|
||||
m_imp->m_current = m_imp->m_undoList.end();
|
||||
Q_EMIT historyChanged();
|
||||
|
@ -380,7 +378,7 @@ void TUndoManager::popUndo(int n, bool forward) {
|
|||
i++;
|
||||
}
|
||||
}
|
||||
for_each(start, end, deleteUndo);
|
||||
std::for_each(start, end, deleteUndo);
|
||||
m_imp->m_undoList.erase(start, end);
|
||||
m_imp->m_current = m_imp->m_undoList.end();
|
||||
} else
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
#include <vector>
|
||||
#include <QTimer>
|
||||
|
||||
using std::endl;
|
||||
|
||||
class TLogger::Imp {
|
||||
public:
|
||||
std::vector<TLogger::Message> m_messages;
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
|
||||
#include <algorithm>
|
||||
|
||||
using std::min;
|
||||
using std::max;
|
||||
|
||||
// Identifies cells by frame and layer rather than row and column
|
||||
class CellPosition {
|
||||
int _frame; // a frame number. corresponds to row in vertical xsheet
|
||||
|
@ -46,8 +43,10 @@ class CellRange {
|
|||
public:
|
||||
CellRange() {}
|
||||
CellRange(const CellPosition &from, const CellPosition &to)
|
||||
: _from(min(from.frame(), to.frame()), min(from.layer(), to.layer()))
|
||||
, _to(max(from.frame(), to.frame()), max(from.layer(), to.layer())) {}
|
||||
: _from(std::min(from.frame(), to.frame()),
|
||||
std::min(from.layer(), to.layer()))
|
||||
, _to(std::max(from.frame(), to.frame()),
|
||||
std::max(from.layer(), to.layer())) {}
|
||||
|
||||
const CellPosition &from() const { return _from; }
|
||||
const CellPosition &to() const { return _to; }
|
||||
|
|
|
@ -23,9 +23,6 @@
|
|||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
using std::map;
|
||||
using std::vector;
|
||||
|
||||
// Defines timeline direction: top to bottom; left to right.
|
||||
// old (vertical timeline) = new (universal) = old (kept)
|
||||
// x = layer axis = column
|
||||
|
@ -38,7 +35,8 @@ class DVAPI NumberRange {
|
|||
NumberRange() : _from(0), _to(0) {}
|
||||
|
||||
public:
|
||||
NumberRange(int from, int to) : _from(min(from, to)), _to(max(from, to)) {}
|
||||
NumberRange(int from, int to)
|
||||
: _from(std::min(from, to)), _to(std::max(from, to)) {}
|
||||
|
||||
int from() const { return _from; }
|
||||
int to() const { return _to; }
|
||||
|
@ -209,13 +207,13 @@ enum class PredefinedFlag {
|
|||
// Knows everything about geometry of a particular orientation.
|
||||
class DVAPI Orientation {
|
||||
protected:
|
||||
map<PredefinedRect, QRect> _rects;
|
||||
map<PredefinedLine, QLine> _lines;
|
||||
map<PredefinedDimension, int> _dimensions;
|
||||
map<PredefinedPath, QPainterPath> _paths;
|
||||
map<PredefinedPoint, QPoint> _points;
|
||||
map<PredefinedRange, NumberRange> _ranges;
|
||||
map<PredefinedFlag, bool> _flags;
|
||||
std::map<PredefinedRect, QRect> _rects;
|
||||
std::map<PredefinedLine, QLine> _lines;
|
||||
std::map<PredefinedDimension, int> _dimensions;
|
||||
std::map<PredefinedPath, QPainterPath> _paths;
|
||||
std::map<PredefinedPoint, QPoint> _points;
|
||||
std::map<PredefinedRange, NumberRange> _ranges;
|
||||
std::map<PredefinedFlag, bool> _flags;
|
||||
|
||||
public:
|
||||
virtual ~Orientation(){};
|
||||
|
@ -288,7 +286,7 @@ protected:
|
|||
// Enumerates all orientations available in the system as global const objects.
|
||||
class DVAPI Orientations {
|
||||
const Orientation *_topToBottom, *_leftToRight;
|
||||
vector<const Orientation *> _all;
|
||||
std::vector<const Orientation *> _all;
|
||||
|
||||
Orientations();
|
||||
|
||||
|
@ -302,9 +300,9 @@ public:
|
|||
static const Orientation *topToBottom();
|
||||
static const Orientation *leftToRight();
|
||||
|
||||
static const vector<const Orientation *> &all();
|
||||
static const std::vector<const Orientation *> &all();
|
||||
|
||||
static const Orientation *byName(const QString &name);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -5,8 +5,6 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
using std::vector;
|
||||
|
||||
#include "tfarmtask.h"
|
||||
//#include "texception.h"
|
||||
#include "tconvert.h"
|
||||
|
@ -86,10 +84,11 @@ public:
|
|||
virtual void activateTask(const QString &id) = 0;
|
||||
virtual void restartTask(const QString &id) = 0;
|
||||
|
||||
virtual void getTasks(vector<QString> &tasks) = 0;
|
||||
virtual void getTasks(const QString &parentId, vector<QString> &tasks) = 0;
|
||||
virtual void getTasks(std::vector<QString> &tasks) = 0;
|
||||
virtual void getTasks(const QString &parentId,
|
||||
vector<TaskShortInfo> &tasks) = 0;
|
||||
std::vector<QString> &tasks) = 0;
|
||||
virtual void getTasks(const QString &parentId,
|
||||
std::vector<TaskShortInfo> &tasks) = 0;
|
||||
|
||||
virtual void queryTaskInfo(const QString &id, TFarmTask &task) = 0;
|
||||
|
||||
|
@ -115,7 +114,7 @@ public:
|
|||
virtual void taskCompleted(const QString &taskId, int exitCode) = 0;
|
||||
|
||||
// fills the servers vector with the identities of the servers
|
||||
virtual void getServers(vector<ServerIdentity> &servers) = 0;
|
||||
virtual void getServers(std::vector<ServerIdentity> &servers) = 0;
|
||||
|
||||
// returns the state of the server whose id has been specified
|
||||
virtual ServerState queryServerState2(const QString &id) = 0;
|
||||
|
|
|
@ -95,15 +95,14 @@ typedef TNotAnimatableParamObserver<TFilePath> TFilePathParamObserver;
|
|||
//-----------------------------------------------------------------------------
|
||||
// TNotAnimatableParam base class
|
||||
//-----------------------------------------------------------------------------
|
||||
using std::set;
|
||||
|
||||
template <class T>
|
||||
class DVAPI TNotAnimatableParam : public TParam {
|
||||
T m_defaultValue, m_value;
|
||||
|
||||
protected:
|
||||
set<TNotAnimatableParamObserver<T> *> m_observers;
|
||||
set<TParamObserver *> m_paramObservers;
|
||||
std::set<TNotAnimatableParamObserver<T> *> m_observers;
|
||||
std::set<TParamObserver *> m_paramObservers;
|
||||
|
||||
public:
|
||||
TNotAnimatableParam(T def = T())
|
||||
|
|
|
@ -111,7 +111,7 @@ Fill \b rect in raster with \b color.
|
|||
else if \b fillInks is false fill only paint delimited by ink;
|
||||
else fill ink and paint in rect.
|
||||
*/
|
||||
void rectFill(const TRect &rect, int color, bool onlyUnfilled,
|
||||
bool rectFill(const TRect &rect, int color, bool onlyUnfilled,
|
||||
bool fillPaints, bool fillInks);
|
||||
|
||||
/*!
|
||||
|
|
|
@ -166,7 +166,8 @@ class DVAPI HexagonalColorWheel final : public GLWidgetForHighDpi {
|
|||
QOpenGLFramebufferObject *m_fbo = NULL;
|
||||
LutCalibrator *m_lutCalibrator = NULL;
|
||||
|
||||
bool m_firstInitialized = true;
|
||||
bool m_firstInitialized = true;
|
||||
bool m_cuedCalibrationUpdate = false;
|
||||
|
||||
private:
|
||||
void drawCurrentColorMark();
|
||||
|
@ -183,6 +184,7 @@ public:
|
|||
QColor getBGColor() const { return m_bgColor; }
|
||||
|
||||
void updateColorCalibration();
|
||||
void cueCalibrationUpdate() { m_cuedCalibrationUpdate = true; }
|
||||
|
||||
protected:
|
||||
void initializeGL() override;
|
||||
|
@ -194,6 +196,8 @@ protected:
|
|||
void mouseMoveEvent(QMouseEvent *event) override;
|
||||
void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
|
||||
void showEvent(QShowEvent *) override;
|
||||
|
||||
signals:
|
||||
void colorChanged(const ColorModel &color, bool isDragging);
|
||||
|
||||
|
|
3
toonz/sources/lzodriver/.gitignore
vendored
3
toonz/sources/lzodriver/.gitignore
vendored
|
@ -1,3 +0,0 @@
|
|||
*
|
||||
# preserve this empty directory
|
||||
!.gitignore
|
|
@ -477,7 +477,7 @@ void StopMotion::lowerOpacity() {
|
|||
opacity *= 10;
|
||||
opacity -= 10;
|
||||
m_opacity = double(opacity) / 100.0 * 255.0;
|
||||
m_opacity = max(0, m_opacity);
|
||||
m_opacity = std::max(0, m_opacity);
|
||||
StopMotionOpacity = m_opacity;
|
||||
emit(opacityChanged(m_opacity));
|
||||
}
|
||||
|
@ -489,7 +489,7 @@ void StopMotion::raiseOpacity() {
|
|||
opacity *= 10;
|
||||
opacity += 10;
|
||||
m_opacity = double(opacity) / 100.0 * 255.0;
|
||||
m_opacity = min(255, m_opacity);
|
||||
m_opacity = std::min(255, m_opacity);
|
||||
StopMotionOpacity = m_opacity;
|
||||
emit(opacityChanged(m_opacity));
|
||||
}
|
||||
|
|
|
@ -998,10 +998,14 @@ void fillAreaWithUndo(const TImageP &img, const TRectD &area, TStroke *stroke,
|
|||
}
|
||||
|
||||
AreaFiller filler(tempRaster);
|
||||
if (!stroke)
|
||||
filler.rectFill(rasterFillArea, cs, onlyUnfilled, colorType != LINES,
|
||||
colorType != AREAS);
|
||||
else
|
||||
if (!stroke) {
|
||||
bool ret = filler.rectFill(rasterFillArea, cs, onlyUnfilled,
|
||||
colorType != LINES, colorType != AREAS);
|
||||
if (!ret) {
|
||||
delete tileSet;
|
||||
return;
|
||||
}
|
||||
} else
|
||||
filler.strokeFill(stroke, cs, onlyUnfilled, colorType != LINES,
|
||||
colorType != AREAS);
|
||||
|
||||
|
@ -1032,11 +1036,6 @@ void fillAreaWithUndo(const TImageP &img, const TRectD &area, TStroke *stroke,
|
|||
// !autopaintLines will temporary disable autopaint line feature
|
||||
if ((plt && !hasAutoInks(plt)) || !autopaintLines) plt = 0;
|
||||
|
||||
std::set<int> autoInks;
|
||||
autoInks.insert(3);
|
||||
autoInks.insert(4);
|
||||
autoInks.insert(5);
|
||||
|
||||
if (plt) {
|
||||
TRect rect = rasterFillArea;
|
||||
TRect bounds = ras->getBounds();
|
||||
|
@ -1542,6 +1541,7 @@ void AreaFillTool::leftButtonDoubleClick(const TPointD &pos,
|
|||
|
||||
if (m_polyline.size() <= 1) {
|
||||
resetMulti();
|
||||
m_isLeftButtonPressed = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1607,6 +1607,7 @@ void AreaFillTool::leftButtonDoubleClick(const TPointD &pos,
|
|||
}
|
||||
|
||||
void AreaFillTool::leftButtonDrag(const TPointD &pos, const TMouseEvent &e) {
|
||||
if (!m_isLeftButtonPressed) return;
|
||||
if (m_type == RECT) {
|
||||
m_selectingRect.x1 = pos.x;
|
||||
m_selectingRect.y1 = pos.y;
|
||||
|
|
|
@ -457,10 +457,9 @@ void StrokeSelection::removeEndpoints() {
|
|||
std::vector<std::pair<int, TStroke *>> undoData;
|
||||
|
||||
m_vi->findRegions();
|
||||
set<int>::iterator it = m_indexes.begin();
|
||||
for (; it != m_indexes.end(); ++it) {
|
||||
TStroke *s = m_vi->removeEndpoints(*it);
|
||||
if (s) undoData.push_back(std::pair<int, TStroke *>(*it, s));
|
||||
for (auto const &e : m_indexes) {
|
||||
TStroke *s = m_vi->removeEndpoints(e);
|
||||
if (s) undoData.push_back(std::pair<int, TStroke *>(e, s));
|
||||
}
|
||||
TTool *tool = TTool::getApplication()->getCurrentTool()->getTool();
|
||||
TXshSimpleLevel *level =
|
||||
|
|
|
@ -73,7 +73,7 @@ void mapToVector(const std::map<int, VIStroke *> &theMap,
|
|||
std::vector<int> &theVect) {
|
||||
assert(theMap.size() == theVect.size());
|
||||
std::map<int, VIStroke *>::const_iterator it = theMap.begin();
|
||||
UINT i = 0;
|
||||
UINT i = 0;
|
||||
for (; it != theMap.end(); ++it) {
|
||||
theVect[i++] = it->first;
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ public:
|
|||
image->removeStrokes(newStrokeIndex, true, false);
|
||||
|
||||
std::map<int, VIStroke *>::const_iterator it = m_originalStrokes.begin();
|
||||
UINT i = 0;
|
||||
UINT i = 0;
|
||||
VIStroke *s;
|
||||
for (; it != m_originalStrokes.end(); ++it) {
|
||||
s = cloneVIStroke(it->second);
|
||||
|
@ -208,7 +208,7 @@ public:
|
|||
image->removeStrokes(oldStrokeIndex, true, false);
|
||||
|
||||
std::map<int, VIStroke *>::const_iterator it = m_newStrokes.begin();
|
||||
UINT i = 0;
|
||||
UINT i = 0;
|
||||
VIStroke *s;
|
||||
for (; it != m_newStrokes.end(); ++it) {
|
||||
s = cloneVIStroke(it->second);
|
||||
|
@ -1321,21 +1321,21 @@ void EraserTool::eraseSegments(const TVectorImageP vi, TStroke *eraseStroke) {
|
|||
}
|
||||
|
||||
if (intersection.first < w) {
|
||||
lowerW = max(lowerW, intersection.first);
|
||||
lowerW = std::max(lowerW, intersection.first);
|
||||
} else {
|
||||
higherW = min(higherW, intersection.first);
|
||||
higherW = std::min(higherW, intersection.first);
|
||||
}
|
||||
|
||||
if (intersection.second < w) {
|
||||
lowerW = max(lowerW, intersection.second);
|
||||
lowerW = std::max(lowerW, intersection.second);
|
||||
} else {
|
||||
higherW = min(higherW, intersection.second);
|
||||
higherW = std::min(higherW, intersection.second);
|
||||
}
|
||||
|
||||
lowerW1 = max(lowerW1, intersection.first);
|
||||
higherW0 = min(higherW0, intersection.first);
|
||||
lowerW1 = max(lowerW1, intersection.second);
|
||||
higherW0 = min(higherW0, intersection.second);
|
||||
lowerW1 = std::max(lowerW1, intersection.first);
|
||||
higherW0 = std::min(higherW0, intersection.first);
|
||||
lowerW1 = std::max(lowerW1, intersection.second);
|
||||
higherW0 = std::min(higherW0, intersection.second);
|
||||
}
|
||||
|
||||
// then check intersection with other strokes
|
||||
|
@ -1348,12 +1348,12 @@ void EraserTool::eraseSegments(const TVectorImageP vi, TStroke *eraseStroke) {
|
|||
intersect(stroke, intersectedStroke, intersections, false);
|
||||
for (auto &intersection : intersections) {
|
||||
if (intersection.first < w) {
|
||||
lowerW = max(lowerW, intersection.first);
|
||||
lowerW = std::max(lowerW, intersection.first);
|
||||
} else {
|
||||
higherW = min(higherW, intersection.first);
|
||||
higherW = std::min(higherW, intersection.first);
|
||||
}
|
||||
lowerW1 = max(lowerW1, intersection.first);
|
||||
higherW0 = min(higherW0, intersection.first);
|
||||
lowerW1 = std::max(lowerW1, intersection.first);
|
||||
higherW0 = std::min(higherW0, intersection.first);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ bool SaveTaskListPopup::execute() {
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
QMutex TasksMutex;
|
||||
map<QString, QProcess *> RunningTasks;
|
||||
std::map<QString, QProcess *> RunningTasks;
|
||||
|
||||
class TaskRunner final : public TThread::Runnable {
|
||||
public:
|
||||
|
@ -288,9 +288,7 @@ void BatchesController::setTasksTree(TaskTreeModel *tree) {
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
inline bool isMovieType(string type) {
|
||||
return (type == "avi");
|
||||
}
|
||||
inline bool isMovieType(std::string type) { return (type == "avi"); }
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
@ -895,7 +893,7 @@ void BatchesController::doSave(const TFilePath &_fp) {
|
|||
|
||||
TOStream os(fp);
|
||||
|
||||
std::map<std::string, string> attr;
|
||||
std::map<std::string, std::string> attr;
|
||||
attr["version"] = "1.0";
|
||||
|
||||
os.openChild("tnzbatches", attr);
|
||||
|
@ -1039,7 +1037,7 @@ public:
|
|||
void activateTask(const QString &id) override;
|
||||
void restartTask(const QString &id) override;
|
||||
|
||||
void getTasks(vector<QString> &tasks) override;
|
||||
void getTasks(std::vector<QString> &tasks) override;
|
||||
void getTasks(const QString &parentId, std::vector<QString> &tasks) override;
|
||||
void getTasks(const QString &parentId,
|
||||
std::vector<TaskShortInfo> &tasks) override;
|
||||
|
@ -1068,7 +1066,9 @@ public:
|
|||
|
||||
void taskCompleted(const QString &taskId, int exitCode) override;
|
||||
|
||||
void getServers(vector<ServerIdentity> &servers) override { assert(false); }
|
||||
void getServers(std::vector<ServerIdentity> &servers) override {
|
||||
assert(false);
|
||||
}
|
||||
|
||||
ServerState queryServerState2(const QString &id) override {
|
||||
assert(false);
|
||||
|
@ -1126,7 +1126,7 @@ void MyLocalController::activateTask(const QString &id) { assert(false); }
|
|||
|
||||
void MyLocalController::restartTask(const QString &id) { assert(false); }
|
||||
|
||||
void MyLocalController::getTasks(vector<QString> &tasks) { assert(false); }
|
||||
void MyLocalController::getTasks(std::vector<QString> &tasks) { assert(false); }
|
||||
|
||||
void MyLocalController::getTasks(const QString &parentId,
|
||||
std::vector<QString> &tasks) {
|
||||
|
|
|
@ -12,9 +12,6 @@
|
|||
#include "tfilepath.h"
|
||||
#include "tthread.h"
|
||||
#include "filebrowserpopup.h"
|
||||
using std::map;
|
||||
using std::set;
|
||||
using std::vector;
|
||||
|
||||
class TFarmController;
|
||||
|
||||
|
@ -96,7 +93,7 @@ private:
|
|||
bool m_dirtyFlag;
|
||||
TFilePath m_filepath;
|
||||
std::map<QString, TFarmTask *> m_tasks;
|
||||
set<Observer *> m_observers;
|
||||
std::set<Observer *> m_observers;
|
||||
int m_localControllerPortNumber;
|
||||
TFarmController *m_controller;
|
||||
std::map<QString, QString> m_farmIdsTable;
|
||||
|
|
|
@ -855,11 +855,11 @@ public:
|
|||
//=============================================================================
|
||||
|
||||
void pasteDrawingsInCellWithoutUndo(TXsheet *xsh, TXshSimpleLevel *level,
|
||||
const set<TFrameId> &frameIds, int r0,
|
||||
const std::set<TFrameId> &frameIds, int r0,
|
||||
int c0) {
|
||||
int frameToInsert = frameIds.size();
|
||||
xsh->insertCells(r0, c0, frameToInsert);
|
||||
set<TFrameId>::const_iterator it;
|
||||
std::set<TFrameId>::const_iterator it;
|
||||
int r = r0;
|
||||
for (it = frameIds.begin(); it != frameIds.end(); it++, r++) {
|
||||
TXshCell cell(level, *it);
|
||||
|
@ -874,12 +874,12 @@ void pasteDrawingsInCellWithoutUndo(TXsheet *xsh, TXshSimpleLevel *level,
|
|||
class PasteDrawingsInCellUndo final : public TUndo {
|
||||
TXsheet *m_xsheet;
|
||||
int m_r0, m_c0;
|
||||
set<TFrameId> m_frameIds;
|
||||
std::set<TFrameId> m_frameIds;
|
||||
TXshSimpleLevelP m_level;
|
||||
|
||||
public:
|
||||
PasteDrawingsInCellUndo(TXshSimpleLevel *level, const set<TFrameId> &frameIds,
|
||||
int r0, int c0)
|
||||
PasteDrawingsInCellUndo(TXshSimpleLevel *level,
|
||||
const std::set<TFrameId> &frameIds, int r0, int c0)
|
||||
: TUndo(), m_level(level), m_frameIds(frameIds), m_r0(r0), m_c0(c0) {
|
||||
m_xsheet = TApp::instance()->getCurrentXsheet()->getXsheet();
|
||||
m_xsheet->addRef();
|
||||
|
@ -1851,7 +1851,7 @@ void TCellSelection::pasteCells() {
|
|||
if (isEmpty()) // Se la selezione delle celle e' vuota ritorno.
|
||||
return;
|
||||
|
||||
set<TFrameId> frameIds;
|
||||
std::set<TFrameId> frameIds;
|
||||
drawingData->getFrames(frameIds);
|
||||
TXshSimpleLevel *level = drawingData->getLevel();
|
||||
if (level && !frameIds.empty())
|
||||
|
@ -3144,11 +3144,11 @@ void TCellSelection::dPasteCells() {
|
|||
} else if (DYNAMIC_CAST(DrawingData, drawingData, mimeData)) {
|
||||
TXshSimpleLevel *level = drawingData->getLevel();
|
||||
if (level) {
|
||||
set<TFrameId> frameIds;
|
||||
std::set<TFrameId> frameIds;
|
||||
drawingData->getFrames(frameIds);
|
||||
int r = r0;
|
||||
for (set<TFrameId>::iterator it = frameIds.begin(); it != frameIds.end();
|
||||
++it)
|
||||
for (std::set<TFrameId>::iterator it = frameIds.begin();
|
||||
it != frameIds.end(); ++it)
|
||||
createNewDrawing(xsh, r++, c0, level->getType());
|
||||
}
|
||||
} else if (DYNAMIC_CAST(StrokesData, strokesData, mimeData)) {
|
||||
|
|
|
@ -2314,7 +2314,7 @@ int IoCmd::loadResources(LoadResourceArguments &args, bool updateRecentFile,
|
|||
LoadResourceArguments::IMPORT);
|
||||
}
|
||||
|
||||
vector<TFilePath> paths;
|
||||
std::vector<TFilePath> paths;
|
||||
int all = 0;
|
||||
|
||||
// Loop for all the resources to load
|
||||
|
|
|
@ -254,11 +254,9 @@ public:
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
void getFxConnections(QMap<TFx *, FxConnections> &fxConnetcions,
|
||||
const set<TFx *> &fxs, TXsheet *xsh) {
|
||||
const std::set<TFx *> &fxs, TXsheet *xsh) {
|
||||
TFxSet *terminalFxs = xsh->getFxDag()->getTerminalFxs();
|
||||
set<TFx *>::const_iterator it;
|
||||
for (it = fxs.begin(); it != fxs.end(); it++) {
|
||||
TFx *fx = (*it);
|
||||
for (auto const &fx : fxs) {
|
||||
FxConnections connections;
|
||||
connections.setIsTerminal(terminalFxs->containsFx(fx));
|
||||
int i;
|
||||
|
@ -621,7 +619,7 @@ void bringObjectOut(TStageObject *obj, TXsheet *xsh,
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
set<int> explodeStageObjects(
|
||||
std::set<int> explodeStageObjects(
|
||||
TXsheet *xsh, TXsheet *subXsh, int index, const TStageObjectId &parentId,
|
||||
const GroupData &objGroupData, const TPointD &subPos,
|
||||
const GroupData &fxGroupData, QList<TStageObject *> &pegObjects,
|
||||
|
@ -698,7 +696,7 @@ set<int> explodeStageObjects(
|
|||
FxDag *innerDag = subXsh->getFxDag();
|
||||
FxDag *outerDag = xsh->getFxDag();
|
||||
TStageObjectId tmpParentId = parentId;
|
||||
set<int> indexes;
|
||||
std::set<int> indexes;
|
||||
int i;
|
||||
for (i = 0; i < subXsh->getColumnCount(); i++) {
|
||||
TXshColumn *innerColumn = subXsh->getColumn(i);
|
||||
|
@ -929,18 +927,19 @@ void explodeFxs(TXsheet *xsh, TXsheet *subXsh, const GroupData &fxGroupData,
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
set<int> explode(TXsheet *xsh, TXsheet *subXsh, int index,
|
||||
const TStageObjectId &parentId, const GroupData &objGroupData,
|
||||
const TPointD &stageSubPos, const GroupData &fxGroupData,
|
||||
const TPointD &fxSubPos, QList<TStageObject *> &pegObjects,
|
||||
QMap<TStageObjectSpline *, TStageObjectSpline *> &splines,
|
||||
const std::vector<TFxPort *> &outPorts, bool onlyColumn,
|
||||
bool linkToXsheet) {
|
||||
std::set<int> explode(TXsheet *xsh, TXsheet *subXsh, int index,
|
||||
const TStageObjectId &parentId,
|
||||
const GroupData &objGroupData, const TPointD &stageSubPos,
|
||||
const GroupData &fxGroupData, const TPointD &fxSubPos,
|
||||
QList<TStageObject *> &pegObjects,
|
||||
QMap<TStageObjectSpline *, TStageObjectSpline *> &splines,
|
||||
const std::vector<TFxPort *> &outPorts, bool onlyColumn,
|
||||
bool linkToXsheet) {
|
||||
// innerFx->outerFxs
|
||||
QMap<TFx *, QPair<TFx *, int>> fxs;
|
||||
set<int> indexes = explodeStageObjects(xsh, subXsh, index, parentId,
|
||||
objGroupData, stageSubPos, fxGroupData,
|
||||
pegObjects, fxs, splines, onlyColumn);
|
||||
std::set<int> indexes = explodeStageObjects(
|
||||
xsh, subXsh, index, parentId, objGroupData, stageSubPos, fxGroupData,
|
||||
pegObjects, fxs, splines, onlyColumn);
|
||||
explodeFxs(xsh, subXsh, fxGroupData, fxs, fxSubPos, outPorts, linkToXsheet);
|
||||
return indexes;
|
||||
}
|
||||
|
@ -1624,7 +1623,7 @@ public:
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
class CollapseFxUndo final : public CollapseUndo {
|
||||
set<TFx *> m_fxs;
|
||||
std::set<TFx *> m_fxs;
|
||||
QMap<TFx *, FxConnections> m_fxConnections;
|
||||
|
||||
public:
|
||||
|
@ -1633,7 +1632,7 @@ public:
|
|||
const QMap<TFx *, QList<TFxPort *>> &columnOutputConnections,
|
||||
const QMap<TStageObjectId, QList<TStageObjectId>> children,
|
||||
const QMap<TStageObjectId, TStageObjectId> &parents,
|
||||
const set<TFx *> &fxs,
|
||||
const std::set<TFx *> &fxs,
|
||||
const QMap<TFx *, FxConnections> fxConnections)
|
||||
: CollapseUndo(indices, c0, data, newData, columnOutputConnections,
|
||||
children, parents)
|
||||
|
@ -1641,8 +1640,7 @@ public:
|
|||
, m_fxConnections(fxConnections) {}
|
||||
|
||||
~CollapseFxUndo() {
|
||||
set<TFx *>::const_iterator it;
|
||||
for (it = m_fxs.begin(); it != m_fxs.end(); it++) (*it)->release();
|
||||
for (auto const &e : m_fxs) e->release();
|
||||
}
|
||||
|
||||
void undo() const override {
|
||||
|
@ -1651,14 +1649,13 @@ public:
|
|||
TXsheet *xsh = app->getCurrentXsheet()->getXsheet();
|
||||
TFxSet *internalFxs = xsh->getFxDag()->getInternalFxs();
|
||||
TFxSet *terminalFxs = xsh->getFxDag()->getTerminalFxs();
|
||||
set<TFx *>::const_iterator it;
|
||||
for (it = m_fxs.begin(); it != m_fxs.end(); it++)
|
||||
if (!internalFxs->containsFx((*it))) {
|
||||
TOutputFx *outFx = dynamic_cast<TOutputFx *>(*it);
|
||||
for (auto const &e : m_fxs)
|
||||
if (!internalFxs->containsFx(e)) {
|
||||
TOutputFx *outFx = dynamic_cast<TOutputFx *>(e);
|
||||
if (outFx)
|
||||
xsh->getFxDag()->addOutputFx(outFx);
|
||||
else
|
||||
internalFxs->addFx((*it));
|
||||
internalFxs->addFx(e);
|
||||
}
|
||||
QMap<TFx *, FxConnections>::const_iterator it2;
|
||||
for (it2 = m_fxConnections.begin(); it2 != m_fxConnections.end(); it2++) {
|
||||
|
@ -1934,7 +1931,7 @@ public:
|
|||
for (i = 0; i < columnFx->getOutputConnectionCount(); i++)
|
||||
outPorts.push_back(columnFx->getOutputConnection(i));
|
||||
xsh->removeColumn(m_index);
|
||||
set<int> indexes = m_newIndexs;
|
||||
std::set<int> indexes = m_newIndexs;
|
||||
for (i = m_pegObjects.size() - 1; i >= 0; i--)
|
||||
xsh->getStageObjectTree()->insertStageObject(m_pegObjects[i]);
|
||||
QMap<TStageObjectSpline *, TStageObjectSpline *>::const_iterator it3;
|
||||
|
@ -2082,7 +2079,7 @@ public:
|
|||
TApp *app = TApp::instance();
|
||||
TXsheet *xsh = app->getCurrentXsheet()->getXsheet();
|
||||
|
||||
set<int> indexesToRemove = m_newIndexs;
|
||||
std::set<int> indexesToRemove = m_newIndexs;
|
||||
app->getCurrentXsheet()->blockSignals(true);
|
||||
app->getCurrentObject()->blockSignals(true);
|
||||
ColumnCmd::deleteColumns(indexesToRemove, false, true);
|
||||
|
@ -2091,7 +2088,7 @@ public:
|
|||
int i;
|
||||
for (i = m_pegObjects.size() - 1; i >= 0; i--)
|
||||
xsh->getStageObjectTree()->removeStageObject(m_pegObjects[i]->getId());
|
||||
set<int> indexes;
|
||||
std::set<int> indexes;
|
||||
indexes.insert(m_index);
|
||||
int to = m_to;
|
||||
int index = m_index;
|
||||
|
@ -2135,7 +2132,7 @@ public:
|
|||
TApp *app = TApp::instance();
|
||||
TXsheet *xsh = app->getCurrentXsheet()->getXsheet();
|
||||
xsh->clearCells(m_from, m_index, m_to - m_from + 1);
|
||||
set<int> indexes = m_newIndexs;
|
||||
std::set<int> indexes = m_newIndexs;
|
||||
int i;
|
||||
for (i = m_pegObjects.size() - 1; i >= 0; i--)
|
||||
xsh->getStageObjectTree()->insertStageObject(m_pegObjects[i]);
|
||||
|
@ -2158,9 +2155,8 @@ public:
|
|||
}
|
||||
// reinsert in groups
|
||||
if (!m_objGroupIds.empty()) {
|
||||
set<int>::iterator it;
|
||||
for (it = indexes.begin(); it != indexes.end(); it++) {
|
||||
TStageObject *obj = xsh->getStageObject(TStageObjectId::ColumnId(*it));
|
||||
for (auto const &e : indexes) {
|
||||
TStageObject *obj = xsh->getStageObject(TStageObjectId::ColumnId(e));
|
||||
TStageObjectId parentId = obj->getParent();
|
||||
TStageObject *parentObj = xsh->getStageObject(parentId);
|
||||
int i;
|
||||
|
@ -2222,8 +2218,7 @@ void SubsceneCmd::collapse(std::set<int> &indices) {
|
|||
QList<QString> list;
|
||||
list.append(QObject::tr(
|
||||
"Maintain parenting relationships in the sub-scene as well."));
|
||||
list.append(
|
||||
QObject::tr("Include only selected columns in the sub-scene."));
|
||||
list.append(QObject::tr("Include only selected columns in the sub-scene."));
|
||||
|
||||
int ret = DVGui::RadioButtonMsgBox(DVGui::WARNING, question, list);
|
||||
if (ret == 0) return;
|
||||
|
@ -2448,7 +2443,7 @@ void SubsceneCmd::explode(int index) {
|
|||
GroupData fxGroupData(fxGroupIds, fxGroupNames, fxEditingGroup);
|
||||
|
||||
/*- Explode前のOutputFxのリストを取得 (oldOutFxs) -*/
|
||||
set<TOutputFx *> oldOutFxs;
|
||||
std::set<TOutputFx *> oldOutFxs;
|
||||
int i, outFxCount = xsh->getFxDag()->getOutputFxCount();
|
||||
for (i = 0; i < outFxCount; i++)
|
||||
oldOutFxs.insert(xsh->getFxDag()->getOutputFx(i));
|
||||
|
@ -2503,7 +2498,7 @@ void SubsceneCmd::explode(int index) {
|
|||
parentId = TStageObjectId::ColumnId(parentId.getIndex() - 1);
|
||||
|
||||
// Explode
|
||||
set<int> newIndexes =
|
||||
std::set<int> newIndexes =
|
||||
::explode(xsh, childLevel->getXsheet(), index, parentId, objGroupData,
|
||||
stageSubPos, fxGroupData, fxSubPos, pegObjects, splines,
|
||||
outPorts, ret == 2, wasLinkedToXsheet);
|
||||
|
@ -2539,7 +2534,7 @@ void SubsceneCmd::explode(int index) {
|
|||
xsh->clearCells(from, index, to - from + 1);
|
||||
|
||||
// Explode
|
||||
set<int> newIndexes = ::explode(
|
||||
std::set<int> newIndexes = ::explode(
|
||||
xsh, childLevel->getXsheet(), index + 1, parentId, objGroupData,
|
||||
stageSubPos + TPointD(10, 10), fxGroupData, fxSubPos + TPointD(10, 10),
|
||||
pegObjects, splines, outPorts, ret == 2, true);
|
||||
|
|
|
@ -511,7 +511,7 @@ void SVNCommitDialog::onStatusRetrieved(const QString &xmlResponse) {
|
|||
|
||||
if (m_treeWidget->isVisible()) height += (filesToPutCount * 25);
|
||||
|
||||
setMinimumSize(350, min(height, 350));
|
||||
setMinimumSize(350, std::min(height, 350));
|
||||
|
||||
m_waitingLabel->hide();
|
||||
m_commentLabel->show();
|
||||
|
@ -538,7 +538,7 @@ void SVNCommitDialog::onStatusRetrieved(const QString &xmlResponse) {
|
|||
|
||||
if (m_treeWidget->isVisible()) height += (m_items.size() * 25);
|
||||
|
||||
setMinimumSize(350, min(height, 350));
|
||||
setMinimumSize(350, std::min(height, 350));
|
||||
|
||||
m_waitingLabel->hide();
|
||||
m_textLabel->hide();
|
||||
|
|
|
@ -175,7 +175,7 @@ void SVNDeleteDialog::showEvent(QShowEvent *e) {
|
|||
int height = 50;
|
||||
if (m_treeWidget->isVisible()) height += (m_files.size() * 50);
|
||||
|
||||
setMinimumSize(300, min(height, 350));
|
||||
setMinimumSize(300, std::min(height, 350));
|
||||
}
|
||||
QDialog::showEvent(e);
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ void SVNDeleteDialog::onDeleteServerButtonClicked() {
|
|||
|
||||
int height = 175;
|
||||
if (m_treeWidget->isVisible()) height += (m_files.size() * 50);
|
||||
setMinimumSize(300, min(height, 350));
|
||||
setMinimumSize(300, std::min(height, 350));
|
||||
|
||||
m_textLabel->setText(
|
||||
tr("You are deleting items also on repository. Are you sure ?"));
|
||||
|
|
|
@ -189,7 +189,7 @@ void SVNLockDialog::onStatusRetrieved(const QString &xmlResponse) {
|
|||
if (m_treeWidget->isVisible())
|
||||
height += (m_filesToEdit.size() * (m_lock ? 25 : 50));
|
||||
|
||||
setMinimumSize(300, min(height, 350));
|
||||
setMinimumSize(300, std::min(height, 350));
|
||||
|
||||
m_waitingLabel->hide();
|
||||
|
||||
|
|
|
@ -143,7 +143,7 @@ void SVNRevertDialog::onStatusRetrieved(const QString &xmlResponse) {
|
|||
} else {
|
||||
if (m_treeWidget->isVisible()) height += (m_filesToRevert.size() * 50);
|
||||
|
||||
setMinimumSize(300, min(height, 350));
|
||||
setMinimumSize(300, std::min(height, 350));
|
||||
|
||||
QString msg = QString(tr("%1 items to revert."))
|
||||
.arg(m_filesToRevert.size() == 1
|
||||
|
|
|
@ -125,7 +125,7 @@ void Toolbar::updateToolbar() {
|
|||
xsh->getCellRange(colIndex, r0, r1);
|
||||
if (0 <= r0 && r0 <= r1) {
|
||||
// level type depends on previous occupied cell
|
||||
for (int r = min(r1, rowIndex); r >= r0; r--) {
|
||||
for (int r = std::min(r1, rowIndex); r >= r0; r--) {
|
||||
TXshCell cell = xsh->getCell(r, colIndex);
|
||||
if (cell.isEmpty()) continue;
|
||||
levelType = cell.m_level->getType();
|
||||
|
|
|
@ -89,11 +89,10 @@ const QSet<TXshSimpleLevel *> getLevels(TXshColumn *column) {
|
|||
|
||||
bool containsRasterLevel(TColumnSelection *selection) {
|
||||
if (!selection || selection->isEmpty()) return false;
|
||||
set<int> indexes = selection->getIndices();
|
||||
TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
|
||||
set<int>::iterator it;
|
||||
for (it = indexes.begin(); it != indexes.end(); it++) {
|
||||
TXshColumn *col = xsh->getColumn(*it);
|
||||
std::set<int> indexes = selection->getIndices();
|
||||
TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
|
||||
for (auto const &e : indexes) {
|
||||
TXshColumn *col = xsh->getColumn(e);
|
||||
if (!col || col->getColumnType() != TXshColumn::eLevelType) continue;
|
||||
|
||||
TXshCellColumn *cellCol = col->getCellColumn();
|
||||
|
@ -696,7 +695,7 @@ ColumnArea::DrawHeader::DrawHeader(ColumnArea *nArea, QPainter &nP, int nCol)
|
|||
else
|
||||
isCurrent = m_viewer->getCurrentColumn() == col;
|
||||
|
||||
orig = m_viewer->positionToXY(CellPosition(0, max(col, -1)));
|
||||
orig = m_viewer->positionToXY(CellPosition(0, std::max(col, -1)));
|
||||
}
|
||||
|
||||
void ColumnArea::DrawHeader::prepare() const {
|
||||
|
@ -1616,7 +1615,7 @@ void ColumnArea::drawPaletteColumnHead(QPainter &p, int col) { // AREA
|
|||
TColumnSelection *selection = m_viewer->getColumnSelection();
|
||||
const Orientation *o = m_viewer->orientation();
|
||||
|
||||
QPoint orig = m_viewer->positionToXY(CellPosition(0, max(col, -1)));
|
||||
QPoint orig = m_viewer->positionToXY(CellPosition(0, std::max(col, -1)));
|
||||
|
||||
QString fontName = Preferences::instance()->getInterfaceFont();
|
||||
if (fontName == "") {
|
||||
|
@ -2918,11 +2917,10 @@ void ColumnArea::onSubSampling(QAction *action) {
|
|||
TColumnSelection *selection = m_viewer->getColumnSelection();
|
||||
TXsheet *xsh = m_viewer->getXsheet();
|
||||
assert(selection && xsh);
|
||||
const set<int> indexes = selection->getIndices();
|
||||
set<int>::const_iterator it;
|
||||
for (it = indexes.begin(); it != indexes.end(); it++) {
|
||||
if (*it < 0) continue; // Ignore camera column
|
||||
TXshColumn *column = xsh->getColumn(*it);
|
||||
const std::set<int> indexes = selection->getIndices();
|
||||
for (auto const &e : indexes) {
|
||||
if (e < 0) continue; // Ignore camera column
|
||||
TXshColumn *column = xsh->getColumn(e);
|
||||
TXshColumn::ColumnType type = column->getColumnType();
|
||||
if (type != TXshColumn::eLevelType) continue;
|
||||
const QSet<TXshSimpleLevel *> levels = getLevels(column);
|
||||
|
|
|
@ -863,10 +863,12 @@ CellRange XsheetViewer::xyRectToRange(const QRect &rect) const {
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
QRect XsheetViewer::rangeToXYRect(const CellRange &range) const {
|
||||
QPoint from = positionToXY(range.from());
|
||||
QPoint to = positionToXY(range.to());
|
||||
QPoint topLeft = QPoint(min(from.x(), to.x()), min(from.y(), to.y()));
|
||||
QPoint bottomRight = QPoint(max(from.x(), to.x()), max(from.y(), to.y()));
|
||||
QPoint from = positionToXY(range.from());
|
||||
QPoint to = positionToXY(range.to());
|
||||
QPoint topLeft =
|
||||
QPoint(std::min(from.x(), to.x()), std::min(from.y(), to.y()));
|
||||
QPoint bottomRight =
|
||||
QPoint(std::max(from.x(), to.x()), std::max(from.y(), to.y()));
|
||||
return QRect(topLeft, bottomRight);
|
||||
}
|
||||
|
||||
|
@ -1468,8 +1470,8 @@ void XsheetViewer::scrollToRow(int row) {
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
void XsheetViewer::scrollToVerticalRange(int y0, int y1) {
|
||||
int yMin = min(y0, y1);
|
||||
int yMax = max(y0, y1);
|
||||
int yMin = std::min(y0, y1);
|
||||
int yMax = std::max(y0, y1);
|
||||
QRect visibleRect = m_cellArea->visibleRegion().boundingRect();
|
||||
if (visibleRect.isEmpty()) return;
|
||||
int visibleTop = visibleRect.top();
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include "ttcpip.h"
|
||||
|
||||
#include <string>
|
||||
using std::string;
|
||||
|
||||
//==============================================================================
|
||||
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
#include "texception.h"
|
||||
|
||||
|
@ -34,7 +32,7 @@ public:
|
|||
virtual ~TFarmProxy() {}
|
||||
|
||||
QString sendToStub(const QString &data);
|
||||
static int extractArgs(const QString &s, vector<QString> &argv);
|
||||
static int extractArgs(const QString &s, std::vector<QString> &argv);
|
||||
|
||||
protected:
|
||||
QString m_hostName;
|
||||
|
|
|
@ -28,9 +28,10 @@ public:
|
|||
void activateTask(const QString &id) override;
|
||||
void restartTask(const QString &id) override;
|
||||
|
||||
void getTasks(vector<QString> &tasks) override;
|
||||
void getTasks(const QString &parentId, vector<QString> &tasks) override;
|
||||
void getTasks(const QString &parentId, vector<TaskShortInfo> &tasks) override;
|
||||
void getTasks(std::vector<QString> &tasks) override;
|
||||
void getTasks(const QString &parentId, std::vector<QString> &tasks) override;
|
||||
void getTasks(const QString &parentId,
|
||||
std::vector<TaskShortInfo> &tasks) override;
|
||||
|
||||
void queryTaskInfo(const QString &id, TFarmTask &task) override;
|
||||
|
||||
|
@ -51,7 +52,7 @@ public:
|
|||
void taskCompleted(const QString &taskId, int exitCode) override;
|
||||
|
||||
// fills the servers vector with the names of the servers
|
||||
void getServers(vector<ServerIdentity> &servers) override;
|
||||
void getServers(std::vector<ServerIdentity> &servers) override;
|
||||
|
||||
// returns the state of the server whose id has been specified
|
||||
ServerState queryServerState2(const QString &id) override;
|
||||
|
@ -166,30 +167,12 @@ void Controller::restartTask(const QString &id) {
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void Controller::getTasks(vector<QString> &tasks) {
|
||||
void Controller::getTasks(std::vector<QString> &tasks) {
|
||||
QString data("getTasks@vector");
|
||||
QString reply = sendToStub(data);
|
||||
|
||||
// la stringa restituita contiene le informazioni desiderate separate da ","
|
||||
vector<QString> argv;
|
||||
extractArgs(reply, argv);
|
||||
|
||||
tasks.clear();
|
||||
std::vector<QString>::iterator it = argv.begin();
|
||||
for (; it != argv.end(); ++it) tasks.push_back(*it);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void Controller::getTasks(const QString &parentId, vector<QString> &tasks) {
|
||||
QString data("getTasks@string@vector");
|
||||
data += ",";
|
||||
data += parentId;
|
||||
|
||||
QString reply = sendToStub(data);
|
||||
|
||||
// la stringa restituita contiene le informazioni deiderate separate da ","
|
||||
vector<QString> argv;
|
||||
std::vector<QString> argv;
|
||||
extractArgs(reply, argv);
|
||||
|
||||
tasks.clear();
|
||||
|
@ -200,7 +183,26 @@ void Controller::getTasks(const QString &parentId, vector<QString> &tasks) {
|
|||
//------------------------------------------------------------------------------
|
||||
|
||||
void Controller::getTasks(const QString &parentId,
|
||||
vector<TaskShortInfo> &tasks) {
|
||||
std::vector<QString> &tasks) {
|
||||
QString data("getTasks@string@vector");
|
||||
data += ",";
|
||||
data += parentId;
|
||||
|
||||
QString reply = sendToStub(data);
|
||||
|
||||
// la stringa restituita contiene le informazioni deiderate separate da ","
|
||||
std::vector<QString> argv;
|
||||
extractArgs(reply, argv);
|
||||
|
||||
tasks.clear();
|
||||
std::vector<QString>::iterator it = argv.begin();
|
||||
for (; it != argv.end(); ++it) tasks.push_back(*it);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void Controller::getTasks(const QString &parentId,
|
||||
std::vector<TaskShortInfo> &tasks) {
|
||||
QString data("getTasks@string@vector$TaskShortInfo");
|
||||
data += ",";
|
||||
data += parentId;
|
||||
|
@ -208,7 +210,7 @@ void Controller::getTasks(const QString &parentId,
|
|||
QString reply = sendToStub(data);
|
||||
|
||||
// la stringa restituita contiene le informazioni desiderate separate da ","
|
||||
vector<QString> argv;
|
||||
std::vector<QString> argv;
|
||||
extractArgs(reply, argv);
|
||||
|
||||
tasks.clear();
|
||||
|
@ -233,7 +235,7 @@ void Controller::queryTaskInfo(const QString &id, TFarmTask &task) {
|
|||
QString reply = sendToStub(data);
|
||||
|
||||
// la stringa restituita contiene le informazioni desiderate separate da ","
|
||||
vector<QString> argv;
|
||||
std::vector<QString> argv;
|
||||
int count = extractArgs(reply, argv);
|
||||
|
||||
if (reply == "") return;
|
||||
|
@ -283,7 +285,7 @@ void Controller::queryTaskShortInfo(const QString &id, QString &parentId,
|
|||
QString reply = sendToStub(data);
|
||||
|
||||
// la stringa restituita contiene le informazioni desiderate separate da ","
|
||||
vector<QString> argv;
|
||||
std::vector<QString> argv;
|
||||
extractArgs(reply, argv);
|
||||
|
||||
assert(argv.size() == 3);
|
||||
|
@ -368,12 +370,12 @@ void Controller::taskCompleted(const QString &taskId, int exitCode) {
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void Controller::getServers(vector<ServerIdentity> &servers) {
|
||||
void Controller::getServers(std::vector<ServerIdentity> &servers) {
|
||||
QString data("getServers");
|
||||
QString reply = sendToStub(data);
|
||||
|
||||
// la stringa restituita contiene le informazioni desiderate separate da ","
|
||||
vector<QString> argv;
|
||||
std::vector<QString> argv;
|
||||
extractArgs(reply, argv);
|
||||
|
||||
servers.clear();
|
||||
|
@ -405,7 +407,7 @@ void Controller::queryServerInfo(const QString &id, ServerInfo &info) {
|
|||
QString reply = sendToStub(data);
|
||||
if (reply != "") {
|
||||
// la stringa restituita contiene le informazioni desiderate separate da ","
|
||||
vector<QString> argv;
|
||||
std::vector<QString> argv;
|
||||
extractArgs(reply, argv);
|
||||
|
||||
info.m_name = argv[0];
|
||||
|
|
|
@ -29,7 +29,7 @@ QString TFarmProxy::sendToStub(const QString &data) {
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
int TFarmProxy::extractArgs(const QString &s, vector<QString> &argv) {
|
||||
int TFarmProxy::extractArgs(const QString &s, std::vector<QString> &argv) {
|
||||
argv.clear();
|
||||
if (s == "") return 0;
|
||||
|
||||
|
@ -43,7 +43,7 @@ int TFarmProxy::extractArgs(const QString &s, vector<QString> &argv) {
|
|||
//==============================================================================
|
||||
|
||||
TString CantConnectToStub::getMessage() const {
|
||||
string msg("Unable to connect to ");
|
||||
std::string msg("Unable to connect to ");
|
||||
msg += m_hostName.toStdString();
|
||||
msg += " on port ";
|
||||
msg += std::to_string(m_port);
|
||||
|
|
|
@ -17,7 +17,7 @@ public:
|
|||
// TFarmServer interface implementation
|
||||
int addTask(const QString &taskid, const QString &cmdline) override;
|
||||
int terminateTask(const QString &taskid) override;
|
||||
int getTasks(vector<QString> &tasks) override;
|
||||
int getTasks(std::vector<QString> &tasks) override;
|
||||
|
||||
void queryHwInfo(HwInfo &hwInfo) override;
|
||||
|
||||
|
@ -55,12 +55,12 @@ int FarmServerProxy::terminateTask(const QString &taskid) {
|
|||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
int FarmServerProxy::getTasks(vector<QString> &tasks) {
|
||||
int FarmServerProxy::getTasks(std::vector<QString> &tasks) {
|
||||
QString data("getTasks");
|
||||
QString reply = sendToStub(data);
|
||||
|
||||
// la stringa restituita contiene le informazioni desiderate separate da ","
|
||||
vector<QString> argv;
|
||||
std::vector<QString> argv;
|
||||
int count = extractArgs(reply, argv);
|
||||
|
||||
assert(count > 0);
|
||||
|
@ -81,7 +81,7 @@ void FarmServerProxy::queryHwInfo(HwInfo &hwInfo) {
|
|||
QString reply = sendToStub(data);
|
||||
|
||||
// la stringa restituita contiene le informazioni desiderate separate da ","
|
||||
vector<QString> argv;
|
||||
std::vector<QString> argv;
|
||||
extractArgs(reply, argv);
|
||||
|
||||
assert(argv.size() > 4);
|
||||
|
|
|
@ -199,7 +199,7 @@ public:
|
|||
void onStart(int argc, char *argv[]) override;
|
||||
void onStop() override;
|
||||
|
||||
void loadControllerData(QString &hostName, string &ipAddr, int &port);
|
||||
void loadControllerData(QString &hostName, std::string &ipAddr, int &port);
|
||||
#ifdef _WIN32
|
||||
void loadDiskMountingPoints(const TFilePath &fp);
|
||||
|
||||
|
@ -207,7 +207,7 @@ public:
|
|||
void unmountDisks();
|
||||
|
||||
std::map<std::string, std::string> m_disks;
|
||||
vector<std::string> m_disksMounted;
|
||||
std::vector<std::string> m_disksMounted;
|
||||
#endif
|
||||
|
||||
int m_port;
|
||||
|
@ -288,14 +288,14 @@ public:
|
|||
m_controller = controller;
|
||||
}
|
||||
TFarmController *getController() const { return m_controller.getPointer(); }
|
||||
void setAppPaths(const vector<TFilePath> &);
|
||||
void setAppPaths(const std::vector<TFilePath> &);
|
||||
|
||||
QString execute(const vector<QString> &argv) override;
|
||||
QString execute(const std::vector<QString> &argv) override;
|
||||
|
||||
// TFarmServer overrides
|
||||
int addTask(const QString &taskid, const QString &cmdline) override;
|
||||
int terminateTask(const QString &taskid) override;
|
||||
int getTasks(vector<QString> &tasks) override;
|
||||
int getTasks(std::vector<QString> &tasks) override;
|
||||
|
||||
void queryHwInfo(HwInfo &hwInfo) override;
|
||||
|
||||
|
@ -321,7 +321,7 @@ private:
|
|||
FarmControllerProxyP m_controller;
|
||||
|
||||
TThread::Mutex m_mux;
|
||||
vector<QString> m_tasks;
|
||||
std::vector<QString> m_tasks;
|
||||
|
||||
TUserLog *m_userLog;
|
||||
|
||||
|
@ -445,10 +445,7 @@ void Task::run() {
|
|||
|
||||
// cerco se il nome dell'applicazione e' tra quelle del file di
|
||||
// configurazione
|
||||
bool foundApp = false;
|
||||
vector<TFilePath>::iterator it = m_server->m_appPaths.begin();
|
||||
for (; it != m_server->m_appPaths.end(); ++it) {
|
||||
TFilePath appPath = *it;
|
||||
for (auto const &appPath : m_server->m_appPaths) {
|
||||
if (appPath.getName() == appName.toStdString()) {
|
||||
exename = QString::fromStdWString(appPath.getWideString());
|
||||
break;
|
||||
|
@ -512,7 +509,7 @@ FarmServer::FarmServer(int port, TUserLog *log)
|
|||
FarmServer::~FarmServer() { delete m_executor; }
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
QString FarmServer::execute(const vector<QString> &argv) {
|
||||
QString FarmServer::execute(const std::vector<QString> &argv) {
|
||||
if (argv.size() > 0) {
|
||||
if (argv[0] == "addTask" && argv.size() == 3) {
|
||||
// assert(!"Da fare");
|
||||
|
@ -522,15 +519,14 @@ QString FarmServer::execute(const vector<QString> &argv) {
|
|||
int ret = terminateTask(argv[1]);
|
||||
return QString::number(ret);
|
||||
} else if (argv[0] == "getTasks") {
|
||||
vector<QString> tasks;
|
||||
std::vector<QString> tasks;
|
||||
int ret = getTasks(tasks);
|
||||
|
||||
QString reply(QString::number(ret));
|
||||
reply += ",";
|
||||
|
||||
vector<QString>::iterator it = tasks.begin();
|
||||
for (; it != tasks.end(); ++it) {
|
||||
reply += *it;
|
||||
for (auto const &e : tasks) {
|
||||
reply += e;
|
||||
reply += ",";
|
||||
}
|
||||
|
||||
|
@ -632,7 +628,7 @@ int FarmServer::terminateTask(const QString &taskid) {
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
int FarmServer::getTasks(vector<QString> &tasks) {
|
||||
int FarmServer::getTasks(std::vector<QString> &tasks) {
|
||||
QMutexLocker sl(&m_mux);
|
||||
tasks = m_tasks;
|
||||
return m_tasks.size();
|
||||
|
@ -662,7 +658,7 @@ void FarmServer::queryHwInfo(HwInfo &hwInfo) {
|
|||
#ifdef __sgi
|
||||
hwInfo.m_type = Irix;
|
||||
#else
|
||||
hwInfo.m_type = Linux;
|
||||
hwInfo.m_type = Linux;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
@ -686,7 +682,7 @@ void FarmServer::detachController(const ControllerData &data) {
|
|||
|
||||
void FarmServer::removeTask(const QString &id) {
|
||||
QMutexLocker sl(&m_mux);
|
||||
vector<QString>::iterator it = find(m_tasks.begin(), m_tasks.end(), id);
|
||||
std::vector<QString>::iterator it = find(m_tasks.begin(), m_tasks.end(), id);
|
||||
if (it != m_tasks.end()) m_tasks.erase(it);
|
||||
}
|
||||
|
||||
|
@ -1011,7 +1007,7 @@ void FarmServerService::loadDiskMountingPoints(const TFilePath &fp) {
|
|||
while (*t) t++;
|
||||
while (t > s && isBlank(*(t - 1))) t--;
|
||||
if (t == s) continue; // non dovrebbe succedere mai: dst vuoto
|
||||
string dst(s, t - s);
|
||||
std::string dst(s, t - s);
|
||||
m_disks[from] = dst;
|
||||
}
|
||||
}
|
||||
|
@ -1070,10 +1066,7 @@ void FarmServerService::mountDisks() {
|
|||
//------------------------------------------------------------------------------
|
||||
|
||||
void FarmServerService::unmountDisks() {
|
||||
vector<std::string>::iterator it = m_disksMounted.begin();
|
||||
for (; it != m_disksMounted.end(); ++it) {
|
||||
std::string drive = *it;
|
||||
|
||||
for (auto const &drive : m_disksMounted) {
|
||||
DWORD res =
|
||||
WNetCancelConnection2(drive.c_str(), // resource name
|
||||
CONNECT_UPDATE_PROFILE, // connection type
|
||||
|
|
|
@ -107,9 +107,7 @@ const unsigned short TFileStatus::IfDir = _S_IFDIR;
|
|||
#define STAT _stat
|
||||
#define UTIME _utime
|
||||
#define FTIME _ftime
|
||||
using std::ifstream;
|
||||
using std::ofstream;
|
||||
using std::filebuf;
|
||||
|
||||
#else // these are common for IRIX & LINUX
|
||||
const int TSystem::MaxPathLen = MAXPATHLEN;
|
||||
const int TSystem::MaxHostNameLen = MAXHOSTNAMELEN;
|
||||
|
@ -744,7 +742,7 @@ void TSystem::touchFile(const TFilePath &path) {
|
|||
if (TFileStatus(path).doesExist()) {
|
||||
if (0 != UTIME(filename.c_str(), 0)) throw TSystemException(path, errno);
|
||||
} else {
|
||||
ofstream file(filename.c_str());
|
||||
std::ofstream file(filename.c_str());
|
||||
if (!file) {
|
||||
throw TSystemException(path, errno);
|
||||
}
|
||||
|
@ -789,8 +787,8 @@ void TSystem::copyFile(const TFilePath &dst, const TFilePath &src) {
|
|||
throw TSystemException(src, getFormattedMessage(GetLastError()));
|
||||
}
|
||||
#else
|
||||
ifstream fpin(src.getFullPath().c_str(), ios::in);
|
||||
ofstream fpout(dst.getFullPath().c_str(), ios::out);
|
||||
std::ifstream fpin(src.getFullPath().c_str(), ios::in);
|
||||
std::ofstream fpout(dst.getFullPath().c_str(), ios::out);
|
||||
if (!fpin || !fpout) throw TSystemException(src, "unable to copy file");
|
||||
int c = fpin.get();
|
||||
while (!fpin.eof()) {
|
||||
|
|
|
@ -159,7 +159,7 @@ void fillautoInks(TRasterCM32P &rin, TRect &rect, const TRasterCM32P &rbefore,
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void AreaFiller::rectFill(const TRect &rect, int color, bool onlyUnfilled,
|
||||
bool AreaFiller::rectFill(const TRect &rect, int color, bool onlyUnfilled,
|
||||
bool fillPaints, bool fillInks) {
|
||||
// Synopsis:
|
||||
// This gets the color of the pixes at the edge of the rect
|
||||
|
@ -178,7 +178,7 @@ void AreaFiller::rectFill(const TRect &rect, int color, bool onlyUnfilled,
|
|||
pix->setInk(color);
|
||||
}
|
||||
}
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
TRect r = m_bounds * rect;
|
||||
|
@ -186,7 +186,7 @@ void AreaFiller::rectFill(const TRect &rect, int color, bool onlyUnfilled,
|
|||
int dx = r.x1 - r.x0;
|
||||
int dy = (r.y1 - r.y0) * m_wrap;
|
||||
if (dx < 2 || dy < 2) // rect degenerate (null contained area), skip.
|
||||
return;
|
||||
return false;
|
||||
|
||||
std::vector<int> frameSeed(2 * (r.getLx() + r.getLy() - 2));
|
||||
|
||||
|
@ -200,7 +200,7 @@ void AreaFiller::rectFill(const TRect &rect, int color, bool onlyUnfilled,
|
|||
// all the pixels contained in the rectangle are pure paint, it must do
|
||||
// nothing!
|
||||
if (!rect.contains(m_bounds) && areRectPixelsPurePaint(m_pixels, r, m_wrap))
|
||||
return;
|
||||
return false;
|
||||
|
||||
// FrameSeed is filled with all the paints of the various areas of the
|
||||
// boundary rectangle.
|
||||
|
@ -283,6 +283,7 @@ void AreaFiller::rectFill(const TRect &rect, int color, bool onlyUnfilled,
|
|||
params.m_styleId = frameSeed[count1++];
|
||||
fill(m_ras, params);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -60,11 +60,11 @@ public:
|
|||
bool m_canceled;
|
||||
|
||||
int m_currentFx;
|
||||
set<double>::iterator m_currentFrame;
|
||||
std::set<double>::iterator m_currentFrame;
|
||||
TRenderer *m_currentTRenderer;
|
||||
|
||||
TFxSet m_fxsToRender;
|
||||
set<double> m_framesToRender;
|
||||
std::set<double> m_framesToRender;
|
||||
|
||||
QEventLoop m_eventLoop;
|
||||
|
||||
|
@ -357,10 +357,9 @@ void MultimediaRenderer::Imp::start() {
|
|||
std::wstring fpName =
|
||||
m_fp.getWideName() + L"_" + columnName +
|
||||
(columnId == columnName ? L"" : L"(" + columnId + L")") +
|
||||
(fxId.empty()
|
||||
? L""
|
||||
: L"_" + fxName +
|
||||
(fxId == fxNameNoSpaces ? L"" : L"(" + fxId + L")"));
|
||||
(fxId.empty() ? L"" : L"_" + fxName + (fxId == fxNameNoSpaces
|
||||
? L""
|
||||
: L"(" + fxId + L")"));
|
||||
TFilePath movieFp(m_fp.withName(fpName));
|
||||
|
||||
// Initialize a MovieRenderer with our infos
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
#include <math.h>
|
||||
#include <stdexcept>
|
||||
|
||||
using std::pair;
|
||||
|
||||
namespace {
|
||||
const int KEY_ICON_WIDTH = 11;
|
||||
const int KEY_ICON_HEIGHT = 11;
|
||||
|
@ -201,11 +199,11 @@ const Orientation *Orientations::topToBottom() {
|
|||
const Orientation *Orientations::leftToRight() {
|
||||
return instance()._leftToRight;
|
||||
}
|
||||
const vector<const Orientation *> &Orientations::all() {
|
||||
const std::vector<const Orientation *> &Orientations::all() {
|
||||
return instance()._all;
|
||||
}
|
||||
const Orientation *Orientations::byName(const QString &name) {
|
||||
vector<const Orientation *> m_all = all();
|
||||
std::vector<const Orientation *> m_all = all();
|
||||
for (auto it = m_all.begin(); it != m_all.end(); it++)
|
||||
if ((*it)->name() == name) return *it;
|
||||
throw std::runtime_error(
|
||||
|
@ -247,31 +245,31 @@ QLine Orientation::foldedRectangleLine(int layerAxis,
|
|||
|
||||
void Orientation::addRect(PredefinedRect which, const QRect &rect) {
|
||||
_rects.erase(which);
|
||||
_rects.insert(pair<PredefinedRect, QRect>(which, rect));
|
||||
_rects.emplace(which, rect);
|
||||
}
|
||||
void Orientation::addLine(PredefinedLine which, const QLine &line) {
|
||||
_lines.erase(which);
|
||||
_lines.insert(pair<PredefinedLine, QLine>(which, line));
|
||||
_lines.emplace(which, line);
|
||||
}
|
||||
void Orientation::addDimension(PredefinedDimension which, int dimension) {
|
||||
_dimensions.erase(which);
|
||||
_dimensions.insert(pair<PredefinedDimension, int>(which, dimension));
|
||||
_dimensions.emplace(which, dimension);
|
||||
}
|
||||
void Orientation::addPath(PredefinedPath which, const QPainterPath &path) {
|
||||
_paths.erase(which);
|
||||
_paths.insert(pair<PredefinedPath, QPainterPath>(which, path));
|
||||
_paths.emplace(which, path);
|
||||
}
|
||||
void Orientation::addPoint(PredefinedPoint which, const QPoint &point) {
|
||||
_points.erase(which);
|
||||
_points.insert(pair<PredefinedPoint, QPoint>(which, point));
|
||||
_points.emplace(which, point);
|
||||
}
|
||||
void Orientation::addRange(PredefinedRange which, const NumberRange &range) {
|
||||
_ranges.erase(which);
|
||||
_ranges.insert(pair<PredefinedRange, NumberRange>(which, range));
|
||||
_ranges.emplace(which, range);
|
||||
}
|
||||
void Orientation::addFlag(PredefinedFlag which, const bool &flag) {
|
||||
_flags.erase(which);
|
||||
_flags.insert(pair<PredefinedFlag, bool>(which, flag));
|
||||
_flags.emplace(which, flag);
|
||||
}
|
||||
/// -------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
|
||||
//===================================================================
|
||||
|
||||
void findPaletteLevels(set<TXshSimpleLevel *> &levels, int &rowIndex,
|
||||
void findPaletteLevels(std::set<TXshSimpleLevel *> &levels, int &rowIndex,
|
||||
int &columnIndex, TPalette *palette, TXsheet *xsheet) {
|
||||
rowIndex = columnIndex = -1;
|
||||
int columnCount = xsheet->getColumnCount();
|
||||
|
@ -136,7 +136,7 @@ bool isStyleUsed(const TImageP image, int styleId) {
|
|||
//===================================================================
|
||||
|
||||
/*! Return true if one style is used. */
|
||||
bool areStylesUsed(const set<TXshSimpleLevel *> levels,
|
||||
bool areStylesUsed(const std::set<TXshSimpleLevel *> levels,
|
||||
const std::vector<int> styleIds) {
|
||||
for (auto const level : levels) {
|
||||
std::vector<TFrameId> fids;
|
||||
|
@ -497,7 +497,7 @@ void PaletteCmd::addStyles(TPaletteHandle *paletteHandle, int pageIndex,
|
|||
|
||||
namespace {
|
||||
|
||||
void eraseStylesInLevels(const set<TXshSimpleLevel *> &levels,
|
||||
void eraseStylesInLevels(const std::set<TXshSimpleLevel *> &levels,
|
||||
const std::vector<int> styleIds) {
|
||||
for (auto const level : levels) {
|
||||
std::vector<TFrameId> fids;
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
|
||||
#include "tcleanuppreprocessor.h"
|
|
@ -1,10 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef TCLEANUP_PREPROCESSOR_H
|
||||
#define TCLEANUP_PREPROCESSOR_H
|
||||
|
||||
#include "traster.h"
|
||||
|
||||
void foobar(const TRaster32P &ras);
|
||||
|
||||
#endif
|
|
@ -289,7 +289,8 @@ static int getEnlargement(const std::vector<TRasterFxRenderDataP> &fxs,
|
|||
//-------------------------------------------------------------------
|
||||
|
||||
static void applyPaletteFilter(TPalette *&plt, bool keep,
|
||||
const set<int> &colors, const TPalette *srcPlt) {
|
||||
const std::set<int> &colors,
|
||||
const TPalette *srcPlt) {
|
||||
if (colors.empty()) return;
|
||||
|
||||
if (!plt) plt = srcPlt->clone();
|
||||
|
@ -414,7 +415,7 @@ static TImageP applyCmappedFx(TToonzImageP &ti,
|
|||
PaletteFilterData->m_type == eApplyToInksAndPaints) {
|
||||
bool keep = PaletteFilterData->m_keep;
|
||||
|
||||
set<int> colors;
|
||||
std::set<int> colors;
|
||||
colors.insert(PaletteFilterData->m_colors.begin(),
|
||||
PaletteFilterData->m_colors.end());
|
||||
|
||||
|
@ -450,7 +451,7 @@ static TImageP applyCmappedFx(TToonzImageP &ti,
|
|||
std::vector<int> indexes;
|
||||
indexes.resize(PaletteFilterData->m_colors.size());
|
||||
|
||||
set<int>::const_iterator jt = PaletteFilterData->m_colors.begin();
|
||||
std::set<int>::const_iterator jt = PaletteFilterData->m_colors.begin();
|
||||
for (int j = 0; j < (int)indexes.size(); ++j, ++jt) indexes[j] = *jt;
|
||||
|
||||
if (copyRas == TRasterCM32P())
|
||||
|
@ -468,10 +469,9 @@ static TImageP applyCmappedFx(TToonzImageP &ti,
|
|||
// sicuramente devo cancellare dei
|
||||
// paint
|
||||
TRop::eraseColors(
|
||||
copyRas,
|
||||
PaletteFilterData->m_type == eApplyToInksDeletingAllPaints
|
||||
? 0
|
||||
: &indexes,
|
||||
copyRas, PaletteFilterData->m_type == eApplyToInksDeletingAllPaints
|
||||
? 0
|
||||
: &indexes,
|
||||
false);
|
||||
|
||||
/*-- Inkの消去 --*/
|
||||
|
@ -481,10 +481,9 @@ static TImageP applyCmappedFx(TToonzImageP &ti,
|
|||
// sicuramente devo cancellare degli
|
||||
// ink
|
||||
TRop::eraseColors(
|
||||
copyRas,
|
||||
PaletteFilterData->m_type == eApplyToPaintsDeletingAllInks
|
||||
? 0
|
||||
: &indexes,
|
||||
copyRas, PaletteFilterData->m_type == eApplyToPaintsDeletingAllInks
|
||||
? 0
|
||||
: &indexes,
|
||||
true, PaletteFilterData->m_type == eApplyToInksAndPaints_NoGap);
|
||||
}
|
||||
}
|
||||
|
@ -680,7 +679,7 @@ static void applyCmappedFx(TVectorImageP &vi,
|
|||
TRasterP ras;
|
||||
bool keep = false;
|
||||
TPaletteP modPalette;
|
||||
set<int> colors;
|
||||
std::set<int> colors;
|
||||
std::vector<TRasterFxRenderDataP>::const_iterator it = fxs.begin();
|
||||
|
||||
// prima tutti gli effetti che agiscono sulla paletta....
|
||||
|
|
|
@ -202,10 +202,10 @@ TRectD ToonzImageUtils::convertRasterToWorld(const TRect area,
|
|||
|
||||
// overlaying inks, blend inks always "lose" on normal inks
|
||||
|
||||
static TRect fastAddInkStroke(const TToonzImageP &ti, TStroke *stroke,
|
||||
int inkId, bool selective, bool filled,
|
||||
TRectD clip, bool doAntialiasing = true,
|
||||
const set<int> &blendInks = set<int>()) {
|
||||
static TRect fastAddInkStroke(
|
||||
const TToonzImageP &ti, TStroke *stroke, int inkId, bool selective,
|
||||
bool filled, TRectD clip, bool doAntialiasing = true,
|
||||
const std::set<int> &blendInks = std::set<int>()) {
|
||||
TRasterCM32P ras = ti->getRaster();
|
||||
TOfflineGL *gl = 0;
|
||||
|
||||
|
@ -407,7 +407,7 @@ TToonzImageP ToonzImageUtils::vectorToToonzImage(
|
|||
// In such reference, the clip for rendering strokes is the output size
|
||||
TRectD clip(TDimensionD(outputSize.lx, outputSize.ly));
|
||||
|
||||
set<int> colors;
|
||||
std::set<int> colors;
|
||||
if (fxs) {
|
||||
for (i = 0; i < (int)fxs->size(); i++) {
|
||||
SandorFxRenderData *sandorData =
|
||||
|
|
|
@ -264,7 +264,7 @@ TRasterImageP TRasterImageUtils::vectorToFullColorImage(
|
|||
maxStyleId);
|
||||
}
|
||||
|
||||
set<int> colors;
|
||||
std::set<int> colors;
|
||||
if (fxs) {
|
||||
for (i = 0; i < (int)fxs->size(); i++) {
|
||||
SandorFxRenderData *sandorData =
|
||||
|
|
|
@ -148,7 +148,7 @@ void TXshSoundLevel::saveData(TOStream &os) {
|
|||
void TXshSoundLevel::computeValuesFor(const Orientation *o) {
|
||||
int frameHeight = o->dimension(PredefinedDimension::FRAME); // time axis
|
||||
int index = o->dimension(PredefinedDimension::INDEX);
|
||||
map<int, DoublePair> &values = m_values[index];
|
||||
std::map<int, DoublePair> &values = m_values[index];
|
||||
|
||||
if (frameHeight == 0) frameHeight = 1;
|
||||
values.clear();
|
||||
|
|
|
@ -342,7 +342,7 @@ TStageObjectId TColumnDataElement::restoreColumn(TXsheet *xsh, int index,
|
|||
TPointD dagPos = TConst::nowhere;
|
||||
if (column) {
|
||||
if (column->getFx())
|
||||
dagPos = column->getFx()->getAttributes()->getDagNodePos();
|
||||
dagPos = column->getFx()->getAttributes()->getDagNodePos();
|
||||
if (doClone) column = column->clone();
|
||||
xsh->insertColumn(index, column);
|
||||
} else
|
||||
|
@ -690,12 +690,10 @@ void StageObjectsData::storeObjects(const std::vector<TStageObjectId> &ids,
|
|||
}
|
||||
|
||||
// Insert terminal fxs
|
||||
set<TFx *>::iterator jt;
|
||||
for (jt = m_originalColumnFxs.begin(); jt != m_originalColumnFxs.end();
|
||||
++jt) {
|
||||
if (isColumnSelectionTerminalFx(*jt, xsh->getFxDag()->getTerminalFxs(),
|
||||
for (auto const &e : m_originalColumnFxs) {
|
||||
if (isColumnSelectionTerminalFx(e, xsh->getFxDag()->getTerminalFxs(),
|
||||
m_originalColumnFxs)) {
|
||||
TFx *fx = m_fxTable[*jt];
|
||||
TFx *fx = m_fxTable[e];
|
||||
|
||||
fx->addRef();
|
||||
m_terminalFxs.insert(fx);
|
||||
|
|
|
@ -667,20 +667,29 @@ HexagonalColorWheel::~HexagonalColorWheel() {
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
void HexagonalColorWheel::updateColorCalibration() {
|
||||
if (Preferences::instance()->isColorCalibrationEnabled()) {
|
||||
makeCurrent();
|
||||
if (!m_lutCalibrator)
|
||||
m_lutCalibrator = new LutCalibrator();
|
||||
else
|
||||
m_lutCalibrator->cleanup();
|
||||
m_lutCalibrator->initialize();
|
||||
connect(context(), SIGNAL(aboutToBeDestroyed()), this,
|
||||
if (Preferences::instance()->isColorCalibrationEnabled()) {
|
||||
makeCurrent();
|
||||
if (!m_lutCalibrator)
|
||||
m_lutCalibrator = new LutCalibrator();
|
||||
else
|
||||
m_lutCalibrator->cleanup();
|
||||
m_lutCalibrator->initialize();
|
||||
connect(context(), SIGNAL(aboutToBeDestroyed()), this,
|
||||
SLOT(onContextAboutToBeDestroyed()));
|
||||
if (m_lutCalibrator->isValid() && !m_fbo)
|
||||
m_fbo = new QOpenGLFramebufferObject(width(), height());
|
||||
doneCurrent();
|
||||
}
|
||||
update();
|
||||
if (m_lutCalibrator->isValid() && !m_fbo)
|
||||
m_fbo = new QOpenGLFramebufferObject(width(), height());
|
||||
doneCurrent();
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void HexagonalColorWheel::showEvent(QShowEvent *) {
|
||||
if (m_cuedCalibrationUpdate) {
|
||||
updateColorCalibration();
|
||||
m_cuedCalibrationUpdate = false;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -1818,7 +1827,10 @@ void PlainColorPage::setSplitterState(QByteArray state) {
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
void PlainColorPage::updateColorCalibration() {
|
||||
if (m_hexagonalColorWheel->isVisible())
|
||||
m_hexagonalColorWheel->updateColorCalibration();
|
||||
else
|
||||
m_hexagonalColorWheel->cueCalibrationUpdate();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -2037,8 +2049,7 @@ else return false;
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
CustomStyleManager *CustomStyleChooserPage::styleManager() {
|
||||
static const QString filters(
|
||||
"*.pli *.tif *.png *.tga *.tiff *.sgi *.rgb");
|
||||
static const QString filters("*.pli *.tif *.png *.tga *.tiff *.sgi *.rgb");
|
||||
static CustomStyleManager theManager(TFilePath("custom styles"), filters);
|
||||
return &theManager;
|
||||
}
|
||||
|
@ -4110,5 +4121,5 @@ void StyleEditor::load(QSettings &settings) {
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
void StyleEditor::updateColorCalibration() {
|
||||
m_plainColorPage->updateColorCalibration();
|
||||
m_plainColorPage->updateColorCalibration();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue