本文整理汇总了C++中LayerList类的典型用法代码示例。如果您正苦于以下问题:C++ LayerList类的具体用法?C++ LayerList怎么用?C++ LayerList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LayerList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DispatchUpdate
void Controller::DispatchUpdate(DeltaTime &delta)
{
if (!mScene) {
return;
}
LayerList *layers = &mScene->GetLayers();
LayerIter liter = layers->begin();
mScene->Update(delta);
while (liter != layers->end()) {
(*liter)->UpdateSelfAndChildren(delta);
liter++;
}
}
示例2: assignToLayers
void Node::assignToLayers(const LayerList& newLayers)
{
if (!newLayers.empty())
{
_layers = newLayers;
}
}
示例3: initialize
bool GeocoordLinkFunctor::initialize()
{
if (mInitialized)
{
return true;
}
if (mpSrcView != NULL)
{
LayerList* pSrcLayerList = mpSrcView->getLayerList();
if (pSrcLayerList == NULL)
{
return false;
}
mpSrcGeo = pSrcLayerList->getPrimaryRasterElement();
if (mpSrcGeo == NULL || !mpSrcGeo->isGeoreferenced())
{
return false;
}
mpSrcLayer = pSrcLayerList->getLayer(RASTER, mpSrcGeo);
if (mpSrcLayer == NULL)
{
return false;
}
LocationType srcWorldCenter(mpSrcView->getVisibleCenter());
LocationType srcScreenCenter;
mpSrcView->translateWorldToScreen(srcWorldCenter.mX, srcWorldCenter.mY,
srcScreenCenter.mX, srcScreenCenter.mY);
mSrcScreenCenter = complex<double>(srcScreenCenter.mX, srcScreenCenter.mY);
LocationType srcDataCenter;
mpSrcLayer->translateWorldToData(srcWorldCenter.mX, srcWorldCenter.mY,
srcDataCenter.mX, srcDataCenter.mY);
mCenterGeocoord = mpSrcGeo->convertPixelToGeocoord(srcDataCenter);
mTightness = findResolution(mpSrcGeo, mpSrcLayer, mCenterGeocoord) * LINK_TIGHTNESS;
mInitialized = true;
return true;
}
return false;
}
示例4: listIndexOfItem
/// <summary>
/// Returns what index the specified item would be if the entire scene was
/// represented in a linear list.
/// </summary>
int Scene::listIndexOfItem(SceneItem *item) const
{
int index = 0;
for(int i = 0; i < m_groups.count(); i++) {
const GroupInfo &group = m_groups.at(i);
if(item == group.sceneItem)
return index;
index++;
LayerList layers = group.group->getLayers();
for(int j = 0; j < layers.count(); j++) {
if(item == itemForLayer(layers.at(j)))
return index;
index++;
}
}
return -1; // Not found
}
示例5: ASSERT
void LayerRendererChromium::paintLayerContents(const LayerList& renderSurfaceLayerList)
{
for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0 ; --surfaceIndex) {
CCLayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex].get();
RenderSurfaceChromium* renderSurface = renderSurfaceLayer->renderSurface();
ASSERT(renderSurface);
// Make sure any renderSurfaceLayer is associated with this layerRenderer.
// This is a defensive assignment in case the owner of this layer hasn't
// set the layerRenderer on this layer already.
renderSurfaceLayer->setLayerRenderer(this);
// Render surfaces whose drawable area has zero width or height
// will have no layers associated with them and should be skipped.
if (!renderSurface->m_layerList.size())
continue;
LayerList& layerList = renderSurface->m_layerList;
ASSERT(layerList.size());
for (unsigned layerIndex = 0; layerIndex < layerList.size(); ++layerIndex) {
CCLayerImpl* ccLayerImpl = layerList[layerIndex].get();
// Layers that start a new render surface will be painted when the render
// surface's list is processed.
if (ccLayerImpl->renderSurface() && ccLayerImpl->renderSurface() != renderSurface)
continue;
LayerChromium* layer = ccLayerImpl->owner();
layer->setLayerRenderer(this);
if (layer->maskLayer())
layer->maskLayer()->setLayerRenderer(this);
if (layer->replicaLayer()) {
layer->replicaLayer()->setLayerRenderer(this);
if (layer->replicaLayer()->maskLayer())
layer->replicaLayer()->maskLayer()->setLayerRenderer(this);
}
if (layer->bounds().isEmpty())
continue;
IntRect targetSurfaceRect = ccLayerImpl->targetRenderSurface() ? ccLayerImpl->targetRenderSurface()->contentRect() : m_defaultRenderSurface->contentRect();
IntRect scissorRect = layer->ccLayerImpl()->scissorRect();
if (!scissorRect.isEmpty())
targetSurfaceRect.intersect(scissorRect);
if (layer->drawsContent())
layer->paintContentsIfDirty(targetSurfaceRect);
if (layer->maskLayer() && layer->maskLayer()->drawsContent())
layer->maskLayer()->paintContentsIfDirty(targetSurfaceRect);
if (layer->replicaLayer() && layer->replicaLayer()->drawsContent())
layer->replicaLayer()->paintContentsIfDirty(targetSurfaceRect);
if (layer->replicaLayer() && layer->replicaLayer()->maskLayer() && layer->replicaLayer()->maskLayer()->drawsContent())
layer->replicaLayer()->maskLayer()->paintContentsIfDirty(targetSurfaceRect);
}
}
}
示例6: itemForLayer
/// <summary>
/// Returns the item at the specified index if the entire scene was represented
/// in a linear list.
/// </summary>
SceneItem *Scene::itemAtListIndex(int index) const
{
int item = 0;
for(int i = 0; i < m_groups.count(); i++) {
const GroupInfo &group = m_groups.at(i);
if(item == index)
return group.sceneItem;
item++;
LayerList layers = group.group->getLayers();
for(int j = 0; j < layers.count(); j++) {
Layer *layer = layers.at(j);
if(item == index)
return itemForLayer(layer);
item++;
}
}
return NULL; // Not found
}
示例7: layerListDeleted
void FusionLayersSelectPage::layerListDeleted(Subject& subject, const string& signal, const boost::any& v)
{
LayerList* pLayerList = dynamic_cast<LayerList*>(&subject);
if (pLayerList != NULL)
{
vector<Layer*> pLayers;
pLayerList->getLayers(pLayers);
for (vector<Layer*>::iterator it = pLayers.begin(); it != pLayers.end(); ++it)
{
Layer* pLayer = *it;
if (pLayer != NULL)
{
pLayer->detach(SIGNAL_NAME(Subject, Deleted), Slot(this, &FusionLayersSelectPage::layerDeleted));
pLayer->detach(SIGNAL_NAME(Subject, Modified), Slot(this, &FusionLayersSelectPage::layerModified));
}
}
}
}
示例8: layerListModified
void FusionLayersSelectPage::layerListModified(Subject& subject, const string& signal, const boost::any& v)
{
LayerList* pLayerList = dynamic_cast<LayerList*>(&subject);
if (pLayerList != NULL)
{
vector<Layer*> layerListLayers;
pLayerList->getLayers(layerListLayers);
// for each layer list layer, check map. If not there, add it.
for (vector<Layer*>::iterator it = layerListLayers.begin(); it != layerListLayers.end(); ++it)
{
LayerMap::iterator found = mLayers.find(*it);
if (found == mLayers.end())
{
addLayerToGui(*it);
}
}
}
}
示例9: needsRedraw
// Reports whether the passed in layers have visible damage or are otherwise
// dirty because render properties changed.
// Assumes that layers in the list belong to same composition. ie. damage to
// one layer affects the others. A warning is logged if the assumption is wrong.
bool GLXGraphicsystem::needsRedraw(LayerList layers)
{
// TODO: Ignore damage from completely obscured surfaces
for (LayerListConstIterator layer = layers.begin(); layer != layers.end(); layer++)
{
if ((*layer)->getLayerType() == Hardware && layers.size() > 1)
{
// Damage in a hardware layer should not imply a redraw in other layers
LOG_WARNING("GLXGraphicsystem", "needsRedraw() called with layers not in the same composition");
}
if (needsRedraw(*layer))
{
return true;
}
}
return false;
}
示例10: move_or_copy_cels
static void move_or_copy_cels(
DocApi& api, Op op,
const LayerList& srcLayers,
const LayerList& dstLayers,
const SelectedFrames& srcFrames,
const SelectedFrames& dstFrames)
{
ASSERT(srcLayers.size() == dstLayers.size());
for (layer_t i=0; i<srcLayers.size(); ++i) {
auto srcFrame = srcFrames.begin();
auto dstFrame = dstFrames.begin();
auto srcFrameEnd = srcFrames.end();
auto dstFrameEnd = dstFrames.end();
for (; srcFrame != srcFrameEnd &&
dstFrame != dstFrameEnd; ++srcFrame, ++dstFrame) {
if (i >= 0 && i < srcLayers.size() && srcLayers[i]->isImage()) {
LayerImage* srcLayer = static_cast<LayerImage*>(srcLayers[i]);
if (i < dstLayers.size() && dstLayers[i]->isImage()) {
LayerImage* srcLayer = static_cast<LayerImage*>(srcLayers[i]);
LayerImage* dstLayer = static_cast<LayerImage*>(dstLayers[i]);
#ifdef TRACE_RANGE_OPS
std::clog << (op == Move ? "Moving": "Copying")
<< " cel " << srcLayer->name() << "[" << *srcFrame << "]"
<< " into " << dstLayer->name() << "[" << *dstFrame << "]\n";
#endif
switch (op) {
case Move: api.moveCel(srcLayer, *srcFrame, dstLayer, *dstFrame); break;
case Copy: api.copyCel(srcLayer, *srcFrame, dstLayer, *dstFrame); break;
}
}
else if (op == Move) {
api.clearCel(srcLayer, *srcFrame);
}
}
}
}
}
示例11: VERIFYNRV
void OverviewWindow::updateView(const vector<LocationType>& selectionArea)
{
if ((mpView == NULL) || (selectionArea.size() != 4))
{
return;
}
LayerList* pLayerList = mpView->getLayerList();
VERIFYNRV(pLayerList != NULL);
Layer* pLayer = pLayerList->getLayer(RASTER, pLayerList->getPrimaryRasterElement());
VERIFYNRV(pLayer != NULL);
LocationType worldLl;
LocationType worldUr;
pLayer->translateDataToWorld(selectionArea[0].mX, selectionArea[0].mY, worldLl.mX, worldLl.mY);
pLayer->translateDataToWorld(selectionArea[2].mX, selectionArea[2].mY, worldUr.mX, worldUr.mY);
// Update the view
mpView->zoomToBox(worldLl, worldUr);
mpView->repaint();
}
示例12: clearBackground
void GLXGraphicsystem::renderSWLayers(LayerList layers, bool clear)
{
// This is a stub.
//
// TODO: render in a more optimal way
// 1. Turn off blending for first surface rendered
// 2. Don't clear when it's legal to avoid it
// eg. a fullscreen opaque surface exists
// 3. Render multiple surfaces at time via multi-texturing
// 4. Remove fully obscured layers/surfaces
if (clear)
{
clearBackground();
}
for (LayerListConstIterator layer = layers.begin(); layer != layers.end(); layer++)
{
renderSWLayer(*layer, false); // Don't clear
}
}
示例13: get_num_layers
/**
* Get the number of layers in a window.
*
* @param[in] WINDOW @opt
* The name of the window. Defaults to the active window.
* @return The number of layers in the window.
* @usage num_layers = get_num_layers()
* @endusage
*/
IDL_VPTR get_num_layers(int argc, IDL_VPTR pArgv[], char* pArgk)
{
typedef struct
{
IDL_KW_RESULT_FIRST_FIELD;
int windowExists;
IDL_STRING windowName;
} KW_RESULT;
//IDL_KW_FAST_SCAN is the type of scan we are using, following it is the
//name of the keyword, followed by the type, the mask(which should be 1),
//flags, a boolean whether the value was populated and finally the value itself
static IDL_KW_PAR kw_pars[] = {
IDL_KW_FAST_SCAN,
{"WINDOW", IDL_TYP_STRING, 1, 0, reinterpret_cast<int*>(IDL_KW_OFFSETOF(windowExists)),
reinterpret_cast<char*>(IDL_KW_OFFSETOF(windowName))},
{NULL}
};
IdlFunctions::IdlKwResource<KW_RESULT> kw(argc, pArgv, pArgk, kw_pars, 0, 1);
std::string windowName;
int layers = 0;
if (kw->windowExists)
{
windowName = IDL_STRING_STR(&kw->windowName);
}
SpatialDataView* pView = dynamic_cast<SpatialDataView*>(IdlFunctions::getViewByWindowName(windowName));
if (pView != NULL)
{
LayerList* pList = pView->getLayerList();
if (pList != NULL)
{
layers = pList->getNumLayers();
}
}
return IDL_GettmpInt(layers);
}
示例14: getPrimaryView
void FusionLayersSelectPage::setViews(SpatialDataView* pPrimary, SpatialDataView* pSecondary)
{
vector<Layer*> layers;
vector<Layer*>::iterator it;
SpatialDataView* pOldPrimaryView = getPrimaryView();
if (pOldPrimaryView != NULL)
{
LayerList* pLayerList = pOldPrimaryView->getLayerList();
if (pLayerList != NULL)
{
pLayerList->detach(SIGNAL_NAME(Subject, Deleted), Slot(this, &FusionLayersSelectPage::layerListDeleted));
pLayerList->detach(SIGNAL_NAME(Subject, Modified), Slot(this, &FusionLayersSelectPage::layerListModified));
}
}
FusionPage::setViews(pPrimary, pSecondary);
if (pPrimary != NULL)
{
LayerList* pLayerList = pPrimary->getLayerList();
if (pLayerList != NULL)
{
pLayerList->attach(SIGNAL_NAME(Subject, Deleted), Slot(this, &FusionLayersSelectPage::layerListDeleted));
pLayerList->attach(SIGNAL_NAME(Subject, Modified), Slot(this, &FusionLayersSelectPage::layerListModified));
}
}
}
示例15: createChipView
SpatialDataView* ChippingWindow::createChipView() const
{
if (mpView == NULL)
{
return NULL;
}
SpatialDataView* pChipView = dynamic_cast<SpatialDataView*>(mpView->copy());
if (pChipView != NULL)
{
vector<std::pair<View*, LinkType> > linkedViews;
pChipView->getLinkedViews(linkedViews);
for (unsigned int i = 0; i < linkedViews.size(); ++i)
{
if (linkedViews[i].second == NO_LINK)
{
continue;
}
pChipView->unlinkView(linkedViews[i].first);
}
LayerList* pLayerList = pChipView->getLayerList();
if (pLayerList != NULL)
{
vector<Layer*> layers;
pLayerList->getLayers(layers);
for (unsigned int i = 0; i < layers.size(); i++)
{
Layer* pLayer = layers.at(i);
if (dynamic_cast<RasterLayer*>(pLayer) == NULL)
{
pChipView->deleteLayer(pLayer);
}
}
}
}
return pChipView;
}