本文整理汇总了C++中Layers类的典型用法代码示例。如果您正苦于以下问题:C++ Layers类的具体用法?C++ Layers怎么用?C++ Layers使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Layers类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool
operator== (const Layers& x, const Layers& y)
{
if (!(x.layer () == y.layer ()))
return false;
return true;
}
示例2: getDateOfLastModification
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;
}
示例3: qMax
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;
}
示例4: onRender
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();
}
示例5: default_unit_sheet_color
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);
}
}
示例6: b
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;
}
}
示例7:
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);
}
}
}
示例8: RGBA
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);
}
示例9: GetLayers
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)
//.........这里部分代码省略.........
示例10: InvokeConfigChangedCallbacks
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 = {
//.........这里部分代码省略.........
示例11: foreach
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++;
}
}
示例12: begin
iterator begin() { return m_layers.begin(); }
示例13: Shutdown
void Shutdown()
{
s_layers.clear();
s_callbacks.clear();
}
示例14: LayerExists
bool LayerExists(LayerType layer)
{
return s_layers.find(layer) != s_layers.end();
}
示例15: RemoveLayer
void RemoveLayer(LayerType layer)
{
s_layers.erase(layer);
InvokeConfigChangedCallbacks();
}