本文整理汇总了C++中MapDocument::selectedSet方法的典型用法代码示例。如果您正苦于以下问题:C++ MapDocument::selectedSet方法的具体用法?C++ MapDocument::selectedSet怎么用?C++ MapDocument::selectedSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapDocument
的用法示例。
在下文中一共展示了MapDocument::selectedSet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void SceneObject::draw(ShaderStack *stack)
{
bool shaderOverridden = false;
if ( !geometry()->isEmpty() )
{
// If we have a shader override, push the override.
QString shaderOverrideName = geometry()->shaderOverride();
if ( !shaderOverrideName.isNull() )
{
ShaderProgram* program = resourceManager()->shader(shaderOverrideName);
if ( program )
{
shaderOverridden = true;
stack->shaderPush(program);
}
}
}
// Multiply the modelWorld matrix by our current one.
// This updates the shader uniform too.
// We do this even if the geometry is empty, so that the
// transformation will apply recursively.
// It is the caller's responsibility to manage pushing
// and popping of the m2w matrix.
stack->modelToWorldPostMultiply(localToParent());
if ( !geometry()->isEmpty() )
{
// Upload and bind the geometry.
geometry()->upload();
geometry()->bindVertices(true);
geometry()->bindIndices(true);
// Apply the data format.
geometry()->applyDataFormat(stack->shaderTop());
// If we're selected, set the global colour.
bool pushedColor = false;
MapDocument* doc = m_pScene->document();
if ( doc->selectedSet().contains(this) )
{
pushedColor = true;
stack->globalColorPush();
stack->globalColorSetTop(doc->selectedColor());
}
// Apply the texture.
QOpenGLTexture* tex = resourceManager()->texture(geometry()->texture(0));
tex->bind(0);
// Draw.
geometry()->draw();
if ( pushedColor )
{
stack->globalColorPop();
}
// Pop the shader if we pushed one earlier.
if ( shaderOverridden )
{
stack->shaderPop();
}
}
}