|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include "toonz/fxdag.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// TnzLib includes
|
|
Toshihiro Shimizu |
890ddd |
#include "toonz/tcolumnfxset.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "toonz/tcolumnfx.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tw/stringtable.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// TnzBase includes
|
|
Toshihiro Shimizu |
890ddd |
#include "tmacrofx.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tfxattributes.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// TnzCore includes
|
|
Toshihiro Shimizu |
890ddd |
#include "tstream.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// tcg includes
|
|
Toshihiro Shimizu |
890ddd |
#include "tcg/function_types.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// STD includes
|
|
Toshihiro Shimizu |
890ddd |
//#include <cwctypes></cwctypes>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//===================================================================
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
FxDag::FxDag()
|
|
Shinya Kitaoka |
120a6e |
: m_internalFxs(new TFxSet())
|
|
Shinya Kitaoka |
120a6e |
, m_terminalFxs(new TFxSet())
|
|
Shinya Kitaoka |
120a6e |
, m_groupIdCount(0)
|
|
Shinya Kitaoka |
120a6e |
, m_dagGridDimension(eSmall) {
|
|
Shinya Kitaoka |
120a6e |
TXsheetFx *xsheetFx = new TXsheetFx;
|
|
Shinya Kitaoka |
120a6e |
xsheetFx->setFxDag(this);
|
|
Shinya Kitaoka |
120a6e |
m_xsheetFx = xsheetFx;
|
|
Shinya Kitaoka |
120a6e |
m_xsheetFx->addRef();
|
|
Shinya Kitaoka |
120a6e |
m_xsheetFx->setNewIdentifier();
|
|
Shinya Kitaoka |
120a6e |
addOutputFx();
|
|
Shinya Kitaoka |
120a6e |
m_outputFxs[0]->getInputPort(0)->setFx(m_xsheetFx);
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
FxDag::~FxDag() {
|
|
Shinya Kitaoka |
120a6e |
delete m_internalFxs;
|
|
Shinya Kitaoka |
120a6e |
delete m_terminalFxs;
|
|
Shinya Kitaoka |
120a6e |
m_xsheetFx->release();
|
|
Shinya Kitaoka |
120a6e |
int i;
|
|
Shinya Kitaoka |
120a6e |
for (i = 0; i < (int)m_outputFxs.size(); i++) m_outputFxs[i]->release();
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
TOutputFx *FxDag::addOutputFx(TOutputFx *outputFx) {
|
|
Shinya Kitaoka |
120a6e |
if (!outputFx) outputFx = new TOutputFx();
|
|
Shinya Kitaoka |
120a6e |
outputFx->addRef();
|
|
Shinya Kitaoka |
120a6e |
m_xsheetFx->setNewIdentifier();
|
|
Shinya Kitaoka |
120a6e |
assert(outputFx->getInputPortCount() == 1);
|
|
Shinya Kitaoka |
120a6e |
m_outputFxs.push_back(outputFx);
|
|
Shinya Kitaoka |
120a6e |
return outputFx;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void FxDag::removeOutputFx(TOutputFx *fx) {
|
|
Shinya Kitaoka |
120a6e |
assert(fx);
|
|
Shinya Kitaoka |
120a6e |
if (m_outputFxs.size() == 1) return;
|
|
Shinya Kitaoka |
120a6e |
if (std::find(m_outputFxs.begin(), m_outputFxs.end(), fx) ==
|
|
Shinya Kitaoka |
120a6e |
m_outputFxs.end())
|
|
Shinya Kitaoka |
120a6e |
return;
|
|
Shinya Kitaoka |
120a6e |
m_outputFxs.erase(std::remove(m_outputFxs.begin(), m_outputFxs.end(), fx),
|
|
Shinya Kitaoka |
120a6e |
m_outputFxs.end());
|
|
Shinya Kitaoka |
120a6e |
fx->release();
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
TFxSet *FxDag::getInternalFxs() const { return m_internalFxs; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void FxDag::setCurrentOutputFx(TOutputFx *fx) {
|
|
Shinya Kitaoka |
120a6e |
std::vector<toutputfx *="">::iterator it;</toutputfx>
|
|
Shinya Kitaoka |
120a6e |
it = std::find(m_outputFxs.begin(), m_outputFxs.end(), fx);
|
|
Shinya Kitaoka |
120a6e |
if (it == m_outputFxs.end()) return;
|
|
Shinya Kitaoka |
120a6e |
if (it == m_outputFxs.begin()) return;
|
|
Shinya Kitaoka |
120a6e |
std::swap(*it, *m_outputFxs.begin());
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
TOutputFx *FxDag::getCurrentOutputFx() const {
|
|
Shinya Kitaoka |
120a6e |
assert(!m_outputFxs.empty());
|
|
Shinya Kitaoka |
120a6e |
return m_outputFxs[0];
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
bool FxDag::checkLoop(TFx *inputFx, TFx *fx) {
|
|
Shinya Kitaoka |
120a6e |
if (inputFx == fx) return true;
|
|
Shinya Kitaoka |
120a6e |
if (dynamic_cast<txsheetfx *="">(inputFx)) {</txsheetfx>
|
|
Shinya Kitaoka |
120a6e |
TFxSet *terminals = getTerminalFxs();
|
|
Shinya Kitaoka |
120a6e |
for (int i = 0; i < terminals->getFxCount(); i++) {
|
|
Shinya Kitaoka |
120a6e |
TFx *tfx = terminals->getFx(i);
|
|
Shinya Kitaoka |
120a6e |
if (tfx && checkLoop(tfx, fx)) return true;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
} else {
|
|
Shinya Kitaoka |
120a6e |
if (TZeraryColumnFx *zerary = dynamic_cast<tzerarycolumnfx *="">(inputFx))</tzerarycolumnfx>
|
|
Shinya Kitaoka |
120a6e |
inputFx = zerary->getZeraryFx();
|
|
Shinya Kitaoka |
120a6e |
for (int i = 0; i < inputFx->getInputPortCount(); i++) {
|
|
Shinya Kitaoka |
120a6e |
TFx *ifx = inputFx->getInputPort(i)->getFx();
|
|
Shinya Kitaoka |
120a6e |
if (ifx && checkLoop(ifx, fx)) return true;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
return false;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
TFxSet *FxDag::getTerminalFxs() const { return m_terminalFxs; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void FxDag::addToXsheet(TFx *fx) { m_terminalFxs->addFx(fx); }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void FxDag::removeFromXsheet(TFx *fx) { m_terminalFxs->removeFx(fx); }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
namespace {
|
|
Toshihiro Shimizu |
890ddd |
struct NotAlnum {
|
|
Shinya Kitaoka |
120a6e |
bool operator()(wint_t val) const { return !iswalnum(val); }
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Shinya Kitaoka |
120a6e |
} // namespace
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void FxDag::assignUniqueId(TFx *fx) {
|
|
Shinya Kitaoka |
120a6e |
struct locals {
|
|
Shinya Kitaoka |
120a6e |
static void eraseNonAlnums(std::wstring &str) {
|
|
Shinya Kitaoka |
120a6e |
str.erase(std::remove_if(str.begin(), str.end(), NotAlnum()), str.end());
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
}; // locals
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
std::string type = fx->getFxType();
|
|
Shinya Kitaoka |
120a6e |
int count = ++m_typeTable[type];
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
fx->getAttributes()->setId(count);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
std::wstring name = TStringTable::translate(type);
|
|
Shinya Kitaoka |
120a6e |
locals::eraseNonAlnums(
|
|
Shinya Kitaoka |
120a6e |
name); // fx ids are used as XML tag names - thus, we'll restrict
|
|
Shinya Kitaoka |
120a6e |
// the char set to alnums. Specifically, '/' must be ruled out.
|
|
Shinya Kitaoka |
120a6e |
// E.g.: "Erode/Dilate 1" must become "ErodeDilate1"
|
|
Shinya Kitaoka |
120a6e |
name = name + QString::number(count).rightJustified(2, '0').toStdWString();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
if (fx->getName() == L"") fx->setName(name);
|
|
Shinya Kitaoka |
120a6e |
fx->setFxId(name);
|
|
Shinya Kitaoka |
120a6e |
m_idTable[toLower(name)] = fx;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
TFx *FxDag::getFxById(std::wstring id) const {
|
|
Shinya Kitaoka |
120a6e |
std::map<std::wstring, *="" tfx="">::const_iterator it = m_idTable.find(id);</std::wstring,>
|
|
Shinya Kitaoka |
120a6e |
if (it == m_idTable.end())
|
|
Shinya Kitaoka |
120a6e |
return 0;
|
|
Shinya Kitaoka |
120a6e |
else
|
|
Shinya Kitaoka |
120a6e |
return it->second;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void FxDag::updateFxTypeTable(TFx *fx, int value) {
|
|
Shinya Kitaoka |
120a6e |
std::string type = fx->getFxType();
|
|
Shinya Kitaoka |
120a6e |
m_typeTable[type] = value;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void FxDag::updateFxIdTable(TFx *fx) { m_idTable[toLower(fx->getFxId())] = fx; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
int FxDag::getFxTypeCount(TFx *fx) {
|
|
Shinya Kitaoka |
120a6e |
std::string type = fx->getFxType();
|
|
Shinya Kitaoka |
120a6e |
std::map<std::string, int="">::iterator it = m_typeTable.find(type);</std::string,>
|
|
Shinya Kitaoka |
120a6e |
if (it == m_typeTable.end()) return 0;
|
|
Shinya Kitaoka |
120a6e |
return it->second;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void FxDag::getFxs(std::vector<tfx *=""> &fxs) const {</tfx>
|
|
Shinya Kitaoka |
120a6e |
std::set<tfx *=""> fxSet;</tfx>
|
|
Shinya Kitaoka |
120a6e |
getInternalFxs()->getFxs(fxSet);
|
|
Shinya Kitaoka |
120a6e |
fxs.insert(fxs.end(), fxSet.begin(), fxSet.end());
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
bool FxDag::isRendered(TFx *fx) const {
|
|
Shinya Kitaoka |
120a6e |
if (m_terminalFxs->containsFx(fx)) return true;
|
|
Shinya Kitaoka |
120a6e |
if (dynamic_cast<toutputfx *="">(fx)) return true;</toutputfx>
|
|
Shinya Kitaoka |
120a6e |
int i;
|
|
Shinya Kitaoka |
120a6e |
for (i = 0; i < fx->getOutputConnectionCount(); i++) {
|
|
Shinya Kitaoka |
120a6e |
TFx *outFx = fx->getOutputConnection(i)->getOwnerFx();
|
|
Shinya Kitaoka |
120a6e |
if (outFx && isRendered(outFx)) return true;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
return false;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
bool FxDag::isControl(TFx *fx) const {
|
|
Shinya Kitaoka |
120a6e |
if (m_terminalFxs->containsFx(fx)) return false;
|
|
Shinya Kitaoka |
120a6e |
if (dynamic_cast<toutputfx *="">(fx)) return false;</toutputfx>
|
|
Shinya Kitaoka |
120a6e |
int i;
|
|
Shinya Kitaoka |
120a6e |
for (i = 0; i < fx->getOutputConnectionCount(); i++) {
|
|
Shinya Kitaoka |
120a6e |
TFxPort *port = fx->getOutputConnection(i);
|
|
Shinya Kitaoka |
120a6e |
TFx *outFx = port->getOwnerFx();
|
|
Shinya Kitaoka |
120a6e |
if (outFx) {
|
|
Shinya Kitaoka |
120a6e |
if (outFx->getInputPort(0) != port) return true;
|
|
Shinya Kitaoka |
120a6e |
if (isControl(outFx)) return true;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
return false;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
namespace {
|
|
Shinya Kitaoka |
120a6e |
TFx *search(const std::map<tfx *="" *,="" tfx=""> &table, TFx *fx) {</tfx>
|
|
Shinya Kitaoka |
120a6e |
std::map<tfx *="" *,="" tfx="">::const_iterator it = table.find(fx);</tfx>
|
|
Shinya Kitaoka |
120a6e |
return it == table.end() ? 0 : it->second;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void FxDag::saveData(TOStream &os, int occupiedColumnCount) {
|
|
Shinya Kitaoka |
120a6e |
if (getInternalFxs()->getFxCount() > 0) {
|
|
Shinya Kitaoka |
120a6e |
os.openChild("internal");
|
|
Shinya Kitaoka |
120a6e |
getInternalFxs()->saveData(os, occupiedColumnCount);
|
|
Shinya Kitaoka |
120a6e |
os.closeChild();
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
if (getTerminalFxs()->getFxCount() > 0) {
|
|
Shinya Kitaoka |
120a6e |
os.openChild("terminal");
|
|
Shinya Kitaoka |
120a6e |
getTerminalFxs()->saveData(os, occupiedColumnCount);
|
|
Shinya Kitaoka |
120a6e |
os.closeChild();
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
os.child("xsheet") << m_xsheetFx;
|
|
Shinya Kitaoka |
120a6e |
int k;
|
|
Shinya Kitaoka |
120a6e |
for (k = 0; k < (int)m_outputFxs.size(); k++)
|
|
Shinya Kitaoka |
120a6e |
os.child("output") << m_outputFxs[k];
|
|
Shinya Kitaoka |
120a6e |
os.child("grid_dimension") << (int)m_dagGridDimension;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void FxDag::loadData(TIStream &is) {
|
|
Shinya Kitaoka |
120a6e |
VersionNumber tnzVersion = is.getVersion();
|
|
Shinya Kitaoka |
120a6e |
int k;
|
|
Shinya Kitaoka |
120a6e |
for (k = 0; k < (int)m_outputFxs.size(); k++) m_outputFxs[k]->release();
|
|
Shinya Kitaoka |
120a6e |
m_outputFxs.clear();
|
|
Shinya Kitaoka |
120a6e |
std::string tagName;
|
|
Shinya Kitaoka |
120a6e |
while (is.openChild(tagName)) {
|
|
Shinya Kitaoka |
120a6e |
if (tagName == "terminal") {
|
|
Shinya Kitaoka |
120a6e |
TFxSet *fxSet = getTerminalFxs();
|
|
Shinya Kitaoka |
120a6e |
fxSet->loadData(is);
|
|
Shinya Kitaoka |
120a6e |
int i;
|
|
Shinya Kitaoka |
120a6e |
for (i = 0; i < fxSet->getFxCount(); i++) {
|
|
Shinya Kitaoka |
120a6e |
TFx *fx = fxSet->getFx(i);
|
|
Shinya Kitaoka |
120a6e |
if (fx->getAttributes()->isGrouped() &&
|
|
Shinya Kitaoka |
120a6e |
m_groupIdCount < fx->getAttributes()->getGroupId())
|
|
Shinya Kitaoka |
120a6e |
m_groupIdCount = fx->getAttributes()->getGroupId();
|
|
Shinya Kitaoka |
120a6e |
if (TZeraryColumnFx *zfx = dynamic_cast<tzerarycolumnfx *="">(fx))</tzerarycolumnfx>
|
|
Shinya Kitaoka |
120a6e |
fx = zfx->getZeraryFx();
|
|
Shinya Kitaoka |
120a6e |
if (tnzVersion < VersionNumber(1, 16)) {
|
|
Shinya Kitaoka |
120a6e |
std::wstring app = fx->getName();
|
|
Shinya Kitaoka |
120a6e |
assignUniqueId(fx);
|
|
Shinya Kitaoka |
120a6e |
fx->setName(app);
|
|
Shinya Kitaoka |
120a6e |
continue;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
int fxTypeCount = getFxTypeCount(fx);
|
|
Shinya Kitaoka |
120a6e |
int maxFxTypeId = std::max(fxTypeCount, fx->getAttributes()->getId());
|
|
Shinya Kitaoka |
120a6e |
updateFxTypeTable(fx, maxFxTypeId);
|
|
Shinya Kitaoka |
120a6e |
TMacroFx *macroFx = dynamic_cast<tmacrofx *="">(fx);</tmacrofx>
|
|
Shinya Kitaoka |
120a6e |
if (macroFx) {
|
|
Shinya Kitaoka |
120a6e |
std::vector<tfxp> fxs = macroFx->getFxs();</tfxp>
|
|
Shinya Kitaoka |
120a6e |
int j;
|
|
Shinya Kitaoka |
120a6e |
for (j = 0; j < (int)fxs.size(); j++) {
|
|
Shinya Kitaoka |
120a6e |
TFxP inMacroFx = fxs[j];
|
|
Shinya Kitaoka |
120a6e |
fxTypeCount = getFxTypeCount(inMacroFx.getPointer());
|
|
Shinya Kitaoka |
120a6e |
maxFxTypeId =
|
|
Shinya Kitaoka |
120a6e |
std::max(fxTypeCount, inMacroFx->getAttributes()->getId());
|
|
Shinya Kitaoka |
120a6e |
updateFxTypeTable(inMacroFx.getPointer(), maxFxTypeId);
|
|
Shinya Kitaoka |
120a6e |
m_idTable[toLower(inMacroFx->getFxId())] = inMacroFx.getPointer();
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
} else if (tagName == "internal") {
|
|
Shinya Kitaoka |
120a6e |
TFxSet *fxSet = getInternalFxs();
|
|
Shinya Kitaoka |
120a6e |
fxSet->loadData(is);
|
|
Shinya Kitaoka |
120a6e |
int i;
|
|
Shinya Kitaoka |
120a6e |
for (i = 0; i < fxSet->getFxCount(); i++) {
|
|
Shinya Kitaoka |
120a6e |
TFx *fx = fxSet->getFx(i);
|
|
Shinya Kitaoka |
120a6e |
if (fx->getAttributes()->isGrouped() &&
|
|
Shinya Kitaoka |
120a6e |
m_groupIdCount < fx->getAttributes()->getGroupId())
|
|
Shinya Kitaoka |
120a6e |
m_groupIdCount = fx->getAttributes()->getGroupId();
|
|
Shinya Kitaoka |
120a6e |
if (TZeraryColumnFx *zfx = dynamic_cast<tzerarycolumnfx *="">(fx))</tzerarycolumnfx>
|
|
Shinya Kitaoka |
120a6e |
fx = zfx->getZeraryFx();
|
|
Shinya Kitaoka |
120a6e |
if (tnzVersion < VersionNumber(1, 16)) {
|
|
Shinya Kitaoka |
120a6e |
std::wstring app = fx->getName();
|
|
Shinya Kitaoka |
120a6e |
assignUniqueId(fx);
|
|
Shinya Kitaoka |
120a6e |
fx->setName(app);
|
|
Shinya Kitaoka |
120a6e |
continue;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
int fxTypeCount = getFxTypeCount(fx);
|
|
Shinya Kitaoka |
120a6e |
int maxFxTypeId = std::max(fxTypeCount, fx->getAttributes()->getId());
|
|
Shinya Kitaoka |
120a6e |
updateFxTypeTable(fx, maxFxTypeId);
|
|
Shinya Kitaoka |
120a6e |
m_idTable[toLower(fx->getFxId())] = fx;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
} else if (tagName == "xsheet" || tagName == "output") {
|
|
Shinya Kitaoka |
120a6e |
TPersist *p = 0;
|
|
Shinya Kitaoka |
120a6e |
is >> p;
|
|
Shinya Kitaoka |
120a6e |
TFx *fx = dynamic_cast<tfx *="">(p);</tfx>
|
|
Shinya Kitaoka |
120a6e |
if (!fx) throw TException("FxDag. unexpeced Fx");
|
|
Shinya Kitaoka |
120a6e |
fx->addRef();
|
|
Shinya Kitaoka |
120a6e |
fx->setNewIdentifier();
|
|
Shinya Kitaoka |
120a6e |
if (tagName == "xsheet") {
|
|
Shinya Kitaoka |
120a6e |
m_xsheetFx->release();
|
|
Shinya Kitaoka |
120a6e |
m_xsheetFx = fx;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
TXsheetFx *xsheetFx = dynamic_cast<txsheetfx *="">(fx);</txsheetfx>
|
|
Shinya Kitaoka |
120a6e |
if (xsheetFx) xsheetFx->setFxDag(this);
|
|
Shinya Kitaoka |
120a6e |
} else {
|
|
Shinya Kitaoka |
120a6e |
TOutputFx *outputFx = dynamic_cast<toutputfx *="">(fx);</toutputfx>
|
|
Shinya Kitaoka |
120a6e |
if (outputFx) m_outputFxs.push_back(outputFx);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
} else if (tagName == "grid_dimension") {
|
|
Shinya Kitaoka |
120a6e |
is >> m_dagGridDimension;
|
|
Shinya Kitaoka |
120a6e |
} else
|
|
Shinya Kitaoka |
120a6e |
throw TException("FxDag. unexpeced tag: " + tagName);
|
|
Shinya Kitaoka |
120a6e |
is.closeChild();
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
}
|