本文整理汇总了C++中DataNode::AsUnsignedCharArray方法的典型用法代码示例。如果您正苦于以下问题:C++ DataNode::AsUnsignedCharArray方法的具体用法?C++ DataNode::AsUnsignedCharArray怎么用?C++ DataNode::AsUnsignedCharArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataNode
的用法示例。
在下文中一共展示了DataNode::AsUnsignedCharArray方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: root
void
QvisAppearanceWidget::opacityChanged(int opacity, int index)
{
int MultiCurve = viewer->GetPlotIndex("MultiCurve");
AttributeSubject *atts = viewer->DelayedState()->GetPlotAttributes(MultiCurve);
if(atts != 0)
{
DataNode root("root");
atts->CreateNode(&root, true, false);
DataNode *multiCurveNode = root.GetNode("MultiCurveAttributes");
DataNode *multiColorNode = multiCurveNode->GetNode("multiColor");
DataNode *calNode = multiColorNode->GetNode("ColorAttributeList");
DataNode **children = calNode->GetChildren();
DataNode *colorNode = children[index]->GetNode("color");
const unsigned char *oldColor = colorNode->AsUnsignedCharArray();
unsigned char newColor[4];
newColor[0] = oldColor[0];
newColor[1] = oldColor[1];
newColor[2] = oldColor[2];
newColor[3] = (unsigned char)opacity;
colorNode->SetUnsignedCharArray(newColor, 4);
atts->SetFromNode(&root);
atts->Notify();
emit multiCurveChanged(atts);
}
}
示例2: SetColors
void
ColorControlPoint::SetFromNode(DataNode *parentNode)
{
//int i;
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("ColorControlPoint");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("colors")) != 0)
SetColors(node->AsUnsignedCharArray());
if((node = searchNode->GetNode("position")) != 0)
SetPosition(node->AsFloat());
}