本文整理汇总了C++中Style::dirty方法的典型用法代码示例。如果您正苦于以下问题:C++ Style::dirty方法的具体用法?C++ Style::dirty怎么用?C++ Style::dirty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Style
的用法示例。
在下文中一共展示了Style::dirty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handle
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter&)
{
switch(ea.getEventType())
{
case(osgGA::GUIEventAdapter::KEYUP):
{
if (ea.getKey() == 'i') {
if (_popupContext.valid()) {
for (int i = 0; i < _popupContext->_widgetList.size(); ++i) {
if (_state) {
_popupContext->_widgetList[i]->setDisappear();
} else {
_popupContext->_widgetList[i]->setAppear();
}
}
if (_state)
_state = 0;
else
_state = 1;
}
return true;
} else if (ea.getKey() == 'q') {
osgEarth::Symbology::Style* style = _styles[0].get();
PolygonSymbol* p = style->getSymbol<PolygonSymbol>();
if (p)
{
osg::Vec4 color = p->fill()->color();
color[0] = fmod(color[0]+0.5, 1.0);
color[2] = fmod(1 + color[0]-0.3, 1.0);
p->fill()->color() = color;
style->dirty();
}
return true;
} else if (ea.getKey() == 'a') {
Style* style = _styles[1].get();
PolygonPointSizeSymbol* p = style->getSymbol<PolygonPointSizeSymbol>();
if (p)
{
osg::Vec4 color = p->fill()->color();
color[0] = fmod(color[0]+0.5, 1.0);
color[2] = fmod(1 + color[0]-0.3, 1.0);
p->fill()->color() = color;
p->size() = 0.1 + color[2] * 10;
style->dirty();
}
return true;
} else if (ea.getKey() == 'z') {
Style* style = _styles[2].get();
ExtrudedLineSymbol* l = style->getSymbol<ExtrudedLineSymbol>();
if (l)
{
osg::Vec4 color = l->stroke()->color();
color[0] = fmod(color[0]+0.5, 1.0);
color[2] = fmod(1 + color[0]-0.3, 1.0);
l->stroke()->color() = color;
l->extrude()->height() = l->extrude()->height() + 200;
}
ExtrudedPolygonSymbol* p = style->getSymbol<ExtrudedPolygonSymbol>();
if (p)
{
osg::Vec4 color = p->fill()->color();
color[0] = fmod(color[0]+0.5, 1.0);
color[2] = fmod(1 + color[0]-0.3, 1.0);
p->fill()->color() = color;
p->extrude()->height() = p->extrude()->height() + 50;
}
style->dirty();
return true;
} else if (ea.getKey() == 'x') {
Style* style = _styles[3].get();
MarkerLineSymbol* l = style->getSymbol<MarkerLineSymbol>();
if (l)
{
if (l->interval().value() < 10)
l->interval() = 15;
else
l->interval() = 5;
}
MarkerPolygonSymbol* p = style->getSymbol<MarkerPolygonSymbol>();
if (p)
{
if (p->interval().value() < 10) {
p->interval() = 15;
p->randomRatio() = 0.1;
} else {
p->interval() = 5;
p->randomRatio() = 0.9;
}
}
style->dirty();
return true;
}
}
break;
}
return false;
}