bool operator== (const Layers& x, const Layers& y) { if (!(x.layer () == y.layer ())) return false; return true; }
bool System::getDateOfLastModification(osgTerrain::TerrainTile *source, Date &date) { typedef std::list<osgTerrain::Layer *> Layers; Layers layers; if (source->getElevationLayer()) { layers.push_back(source->getElevationLayer()); } for (unsigned int i = 0; i < source->getNumColorLayers(); ++i) { osgTerrain::Layer *layer = source->getColorLayer(i); if (layer) { layers.push_back(layer); } } typedef std::list<std::string> Filenames; Filenames filenames; for (Layers::iterator itr = layers.begin(); itr != layers.end(); ++itr) { osgTerrain::CompositeLayer *compositeLayer = dynamic_cast<osgTerrain::CompositeLayer *>(*itr); if (compositeLayer) { for (unsigned int i = 0; i < compositeLayer->getNumLayers(); ++i) { filenames.push_back(compositeLayer->getFileName(i)); } } else { filenames.push_back((*itr)->getFileName()); } } bool modified = false; for (Filenames::iterator itr = filenames.begin(); itr != filenames.end(); ++itr) { Date lastModification; if (lastModification.setWithDateOfLastModification(*itr)) { if (lastModification > date) { date = lastModification; modified = true; } } } return modified; }
int TupAnimationRenderer::Private::calculateTotalPhotograms(TupScene *scene) { Layers layers = scene->layers(); int total = 0; int totalLayers = layers.size(); for (int i = 0; i < totalLayers; i++) { TupLayer *layer = layers.at(i); if (layer) total = qMax(total, layer->frames().count()); } return total; }
void ViewStrip::onRender() { _pStripPainter->renderBegin(RGBA(30,30,30)); //--- Axis ---// this->DrawAxis(); //--- PRSMark 그리기. ---// this->DrawPRSMark(_stripinfo->GetOriginLocation()); //--- Device Layout ---// this->DrawDeviceLayout(); //Unit Layer Draw _layers.draw(); _ArrowLayers.draw(); //--- 선택 사각형 그리기 ---// onSelectionRect(); _pStripPainter->renderEnd(); }
void ViewStrip::onRegen() { ///유닛의 Center Point 를 계산. _stripinfo->CalUnitCenterPoint(); //Device Size 멤버 변수로 가져오기. _fdevice_size_x = _stripinfo->_fDeviceSizeX; _fdevice_size_y = _stripinfo->_fDeviceSizeY; ///기존 레이저 지움. _layers.clearLayers(); _ArrowLayers.clear(); //기본 색과 선택시 색 지정. RGBA default_unit_sheet_color(_stripinfo->GetDefaultUnitSheetColor(), 150); RGBA default_unit_outline_color(_stripinfo->GetDefaultUnitOutlineColor(), 150); _pStripPainter->setSelectFillColr(RGBA(_stripinfo->GetSelectUnitSheetColor(), 200)); _pStripPainter->setSelectLineColr(RGBA(_stripinfo->GetSelectUnitOutlineColor(), 200)); ///Unit 그리기 this->DrawUnits(default_unit_outline_color, default_unit_sheet_color); if(_stripinfo->GetProcessOrderVisible()) { ///ProcessOrder Text this->DrawProcessOrder(); } ///화살표들 그리기. this->DrawArrows(); //Unit layer regen _layers.regen(); for(INT32 i=0; i<_ArrowLayers.size(); i++) { _ArrowLayers.at(i)->regen(); } ///처음 시작시 화살표 안보이게 하기 위함. for(INT32 i=0; i<_ArrowLayers.size(); i++) { _ArrowLayers.at(i)->setVisible(FALSE); } }
void operator<< (::xercesc::DOMElement& e, const Layers& i) { e << static_cast< const ::xml_schema::Type& > (i); // layer // for (Layers::LayerConstIterator b (i.layer ().begin ()), n (i.layer ().end ()); b != n; ++b) { ::xercesc::DOMElement& s ( ::xsd::cxx::xml::dom::create_element ( "layer", "artofsequence.org/aosl/1.0", e)); s << *b; } }
VOID ViewStrip::inspectorItemSelected(TCHAR* itemName) { ///item 선택 초기화. for(INT32 i=0; i<_ArrowLayers.size(); i++) { _ArrowLayers.at(i)->setVisible(FALSE); } ///선택된 item 만 나오도록. for(INT32 i=0; i<_ArrowLayers.size(); i++) { TCHAR* name; name = _ArrowLayers.at(i)->getName(); if(_tcscmp(name, itemName) == 0) { _ArrowLayers.at(i)->setVisible(TRUE); } } }
VOID ViewStrip::DrawDoubleHeadedArrowY(POINTFLOAT start, POINTFLOAT end, TCHAR* layerName, BOOL bIndicateLine) { _pLayer = LayerFactory::createLayer(layerName); FLOAT fLineSize = _stripinfo->GetUnitYSize()/5; TColor lineColor = _stripinfo->GetIndicateLineColor(); if(start.y > end.y) { POINTFLOAT temp = end; end = start; start = temp; } if(bIndicateLine) { _pShape = ShapeFactory::createLine(_pStripPainter, RGBA(lineColor), start.x-fLineSize, start.y, _stripinfo->GetUnitCenterPoint(0, 0).x - _fdevice_size_x / 2.0f, start.y); _pLayer->insert(_pShape); _pShape = ShapeFactory::createLine(_pStripPainter, RGBA(lineColor), end.x-fLineSize, end.y, _stripinfo->GetUnitCenterPoint(0, 0).x - _fdevice_size_x / 2.0f, end.y); _pLayer->insert(_pShape); } _pShape = ShapeFactory::createLine(_pStripPainter, RGBA(lineColor), start.x-fLineSize, start.y, start.x+fLineSize, start.y); _pLayer->insert(_pShape); _pShape = ShapeFactory::createLine(_pStripPainter, RGBA(lineColor), start.x, start.y, start.x-fLineSize, start.y+fLineSize); _pLayer->insert(_pShape); _pShape = ShapeFactory::createLine(_pStripPainter, RGBA(lineColor), start.x-fLineSize, start.y+fLineSize, start.x+fLineSize, start.y+fLineSize); _pLayer->insert(_pShape); _pShape = ShapeFactory::createLine(_pStripPainter, RGBA(lineColor), start.x+fLineSize, start.y+fLineSize, start.x, start.y); _pLayer->insert(_pShape); _pShape = ShapeFactory::createLine(_pStripPainter, RGBA(lineColor), start.x, start.y, end.x, end.y); _pLayer->insert(_pShape); _pShape = ShapeFactory::createLine(_pStripPainter, RGBA(lineColor), end.x, end.y, end.x-fLineSize, end.y-fLineSize); _pLayer->insert(_pShape); _pShape = ShapeFactory::createLine(_pStripPainter, RGBA(lineColor), end.x-fLineSize, end.y-fLineSize, end.x+fLineSize, end.y-fLineSize); _pLayer->insert(_pShape); _pShape = ShapeFactory::createLine(_pStripPainter, RGBA(lineColor), end.x+fLineSize, end.y-fLineSize, end.x, end.y); _pLayer->insert(_pShape); _pShape = ShapeFactory::createLine(_pStripPainter, RGBA(lineColor), end.x-fLineSize, end.y, end.x+fLineSize, end.y); _pLayer->insert(_pShape); _ArrowLayers.insert(_pLayer); }
iterator begin() { return m_layers.begin(); }
void Shutdown() { s_layers.clear(); s_callbacks.clear(); }
bool LayerExists(LayerType layer) { return s_layers.find(layer) != s_layers.end(); }
void RemoveLayer(LayerType layer) { s_layers.erase(layer); InvokeConfigChangedCallbacks(); }
namespace Config { static Layers s_layers; static std::list<ConfigChangedCallback> s_callbacks; Layers* GetLayers() { return &s_layers; } void AddLayer(std::unique_ptr<Layer> layer) { s_layers[layer->GetLayer()] = std::move(layer); InvokeConfigChangedCallbacks(); } void AddLayer(std::unique_ptr<ConfigLayerLoader> loader) { AddLayer(std::make_unique<Layer>(std::move(loader))); } Layer* GetLayer(LayerType layer) { if (!LayerExists(layer)) return nullptr; return s_layers[layer].get(); } void RemoveLayer(LayerType layer) { s_layers.erase(layer); InvokeConfigChangedCallbacks(); } bool LayerExists(LayerType layer) { return s_layers.find(layer) != s_layers.end(); } void AddConfigChangedCallback(ConfigChangedCallback func) { s_callbacks.emplace_back(func); } void InvokeConfigChangedCallbacks() { for (const auto& callback : s_callbacks) callback(); } // Explicit load and save of layers void Load() { for (auto& layer : s_layers) layer.second->Load(); } void Save() { for (auto& layer : s_layers) layer.second->Save(); } void Init() { // These layers contain temporary values ClearCurrentRunLayer(); } void Shutdown() { s_layers.clear(); s_callbacks.clear(); } void ClearCurrentRunLayer() { s_layers[LayerType::CurrentRun] = std::make_unique<Layer>(LayerType::CurrentRun); } static const std::map<System, std::string> system_to_name = { {System::Main, "Dolphin"}, {System::GCPad, "GCPad"}, {System::WiiPad, "Wiimote"}, {System::GCKeyboard, "GCKeyboard"}, {System::GFX, "Graphics"}, {System::Logger, "Logger"}, {System::Debugger, "Debugger"}, {System::UI, "UI"}, {System::SYSCONF, "SYSCONF"}}; const std::string& GetSystemName(System system) { return system_to_name.at(system); } std::optional<System> GetSystemFromName(const std::string& name) { const auto system = std::find_if(system_to_name.begin(), system_to_name.end(), [&name](const auto& entry) { return entry.second == name; }); if (system != system_to_name.end()) return system->first; return {}; } const std::string& GetLayerName(LayerType layer) { static const std::map<LayerType, std::string> layer_to_name = { {LayerType::Base, "Base"}, {LayerType::GlobalGame, "Global GameINI"}, {LayerType::LocalGame, "Local GameINI"}, {LayerType::Netplay, "Netplay"}, {LayerType::Movie, "Movie"}, {LayerType::CommandLine, "Command Line"}, {LayerType::CurrentRun, "Current Run"}, }; return layer_to_name.at(layer); } LayerType GetActiveLayerForConfig(const ConfigLocation& config) { for (auto layer : SEARCH_ORDER) { if (!LayerExists(layer)) continue; if (GetLayer(layer)->Exists(config)) return layer; } // If config is not present in any layer, base layer is considered active. return LayerType::Base; } }
const_iterator end() const { return m_layers.end(); }
iterator end() { return m_layers.end(); }
const_iterator begin() const { return m_layers.begin(); }
namespace Config { static Layers s_layers; static std::list<ConfigChangedCallback> s_callbacks; void InvokeConfigChangedCallbacks(); Section* GetOrCreateSection(System system, const std::string& section_name) { return s_layers[LayerType::Meta]->GetOrCreateSection(system, section_name); } Layers* GetLayers() { return &s_layers; } void AddLayer(std::unique_ptr<Layer> layer) { s_layers[layer->GetLayer()] = std::move(layer); InvokeConfigChangedCallbacks(); } void AddLayer(std::unique_ptr<ConfigLayerLoader> loader) { AddLayer(std::make_unique<Layer>(std::move(loader))); } void AddLoadLayer(std::unique_ptr<Layer> layer) { layer->Load(); AddLayer(std::move(layer)); } void AddLoadLayer(std::unique_ptr<ConfigLayerLoader> loader) { AddLoadLayer(std::make_unique<Layer>(std::move(loader))); } Layer* GetLayer(LayerType layer) { if (!LayerExists(layer)) return nullptr; return s_layers[layer].get(); } void RemoveLayer(LayerType layer) { s_layers.erase(layer); InvokeConfigChangedCallbacks(); } bool LayerExists(LayerType layer) { return s_layers.find(layer) != s_layers.end(); } void AddConfigChangedCallback(ConfigChangedCallback func) { s_callbacks.emplace_back(func); } void InvokeConfigChangedCallbacks() { for (const auto& callback : s_callbacks) callback(); } // Explicit load and save of layers void Load() { for (auto& layer : s_layers) layer.second->Load(); } void Save() { for (auto& layer : s_layers) layer.second->Save(); } void Init() { // These layers contain temporary values ClearCurrentRunLayer(); // This layer always has to exist s_layers[LayerType::Meta] = std::make_unique<RecursiveLayer>(); } void Shutdown() { s_layers.clear(); s_callbacks.clear(); } void ClearCurrentRunLayer() { s_layers[LayerType::CurrentRun] = std::make_unique<Layer>(LayerType::CurrentRun); } static const std::map<System, std::string> system_to_name = { {System::Main, "Dolphin"}, {System::GCPad, "GCPad"}, {System::WiiPad, "Wiimote"}, {System::GCKeyboard, "GCKeyboard"}, {System::GFX, "Graphics"}, {System::Logger, "Logger"}, {System::Debugger, "Debugger"}, {System::UI, "UI"}, }; const std::string& GetSystemName(System system) { return system_to_name.at(system); } System GetSystemFromName(const std::string& name) { const auto system = std::find_if(system_to_name.begin(), system_to_name.end(), [&name](const auto& entry) { return entry.second == name; }); if (system != system_to_name.end()) return system->first; _assert_msg_(COMMON, false, "Programming error! Couldn't convert '%s' to system!", name.c_str()); return System::Main; } const std::string& GetLayerName(LayerType layer) { static const std::map<LayerType, std::string> layer_to_name = { {LayerType::Base, "Base"}, {LayerType::GlobalGame, "Global GameINI"}, {LayerType::LocalGame, "Local GameINI"}, {LayerType::Netplay, "Netplay"}, {LayerType::Movie, "Movie"}, {LayerType::CommandLine, "Command Line"}, {LayerType::CurrentRun, "Current Run"}, {LayerType::Meta, "Top"}, }; return layer_to_name.at(layer); } }
int size() const { return static_cast<int>(m_layers.size()); }
QStringList SmilExportPlugin::createImages(const QList<KTScene *> &scenes, const QDir &dir, float sx, float sy, const char *format) { QStringList paths; int nPhotogramsRenderized = 0; foreach(KTScene *scene, scenes ) { Layers layers = scene->layers(); bool m_isRendered = false; while ( ! m_isRendered ) { Layers::iterator layerIterator = layers.begin(); bool ok = true; QImage renderized = QImage(m_size.width(), m_size.height(), QImage::Format_RGB32); renderized.fill(qRgb(255, 255, 255)); QPainter painter(&renderized); painter.setRenderHint(QPainter::Antialiasing); while ( layerIterator != layers.end() ) { ok = ok && (nPhotogramsRenderized > (*layerIterator)->frames().count()); if ( *layerIterator && nPhotogramsRenderized < (*layerIterator)->frames().count() && (*layerIterator)->isVisible() ) { KTKeyFrame *frame = (*layerIterator)->frames()[nPhotogramsRenderized]; if ( frame ) { QList<AGraphicComponent *> componentList = frame->components(); if ( componentList.count() > 0 ) { QList<AGraphicComponent *>::iterator it = componentList.begin(); while ( it != componentList.end() ) { (*it)->draw( &painter); ++it; } } } } ++layerIterator; } QString file = ""; QString extension = QString::fromLocal8Bit(format).toLower(); if ( nPhotogramsRenderized < 10 ) { file = QString("000%1").arg(nPhotogramsRenderized); } else if ( nPhotogramsRenderized < 100 ) { file = QString("00%1").arg(nPhotogramsRenderized); } else if( nPhotogramsRenderized < 1000 ) { file = QString("0%1").arg(nPhotogramsRenderized); } else if( nPhotogramsRenderized < 10000 ) { file = QString("%1").arg(nPhotogramsRenderized); } if ( !renderized.isNull() ) { QString dest = dir.path()+"/data/"+m_baseName+file+"."+extension; renderized.save(dest, format); paths << dest; createPar( dest, 1.0f/(float)scene->fps() ); } if (ok ) { m_isRendered = true; } nPhotogramsRenderized++; } }