本文整理汇总了C++中DataNode::GetOpacity方法的典型用法代码示例。如果您正苦于以下问题:C++ DataNode::GetOpacity方法的具体用法?C++ DataNode::GetOpacity怎么用?C++ DataNode::GetOpacity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataNode
的用法示例。
在下文中一共展示了DataNode::GetOpacity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: invertNormals
void mitk::SurfaceGLMapper2D::ApplyAllProperties(mitk::BaseRenderer* renderer)
{
ApplyColorAndOpacityProperties(renderer);
DataNode * node = GetDataNode();
if(node == NULL)
{
return;
}
node->GetBoolProperty("draw normals 2D", m_DrawNormals, renderer);
// check for color and opacity properties, use it for rendering if they exists
node->GetColor(m_LineColor, renderer, "color");
node->GetOpacity(m_LineColor[3], renderer, "opacity");
bool invertNormals(false);
node->GetBoolProperty("invert normals", invertNormals, renderer);
if (!invertNormals)
{
node->GetColor(m_FrontSideColor, renderer, "front color");
node->GetOpacity(m_FrontSideColor[3], renderer, "opacity");
node->GetColor(m_BackSideColor, renderer, "back color");
node->GetOpacity(m_BackSideColor[3], renderer, "opacity");
node->GetFloatProperty( "front normal lenth (px)", m_FrontNormalLengthInPixels, renderer );
node->GetFloatProperty( "back normal lenth (px)", m_BackNormalLengthInPixels, renderer );
}
else
{
node->GetColor(m_FrontSideColor, renderer, "back color");
node->GetOpacity(m_FrontSideColor[3], renderer, "opacity");
node->GetColor(m_BackSideColor, renderer, "front color");
node->GetOpacity(m_BackSideColor[3], renderer, "opacity");
node->GetFloatProperty( "back normal lenth (px)", m_FrontNormalLengthInPixels, renderer );
node->GetFloatProperty( "front normal lenth (px)", m_BackNormalLengthInPixels, renderer );
}
}
示例2: GetDataNode
void mitk::VtkMapper::ApplyColorAndOpacityProperties(BaseRenderer *renderer, vtkActor *actor)
{
float rgba[4] = {1.0f, 1.0f, 1.0f, 1.0f};
DataNode *node = GetDataNode();
// check for color prop and use it for rendering if it exists
node->GetColor(rgba, renderer, "color");
// check for opacity prop and use it for rendering if it exists
node->GetOpacity(rgba[3], renderer, "opacity");
double drgba[4] = {rgba[0], rgba[1], rgba[2], rgba[3]};
actor->GetProperty()->SetColor(drgba);
actor->GetProperty()->SetOpacity(drgba[3]);
}