当前位置: 首页>>代码示例>>C++>>正文


C++ DataNode::GetOpacity方法代码示例

本文整理汇总了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 );
  }
}
开发者ID:GHfangxin,项目名称:MITK,代码行数:43,代码来源:mitkSurfaceGLMapper2D.cpp

示例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]);
}
开发者ID:liu3xing3long,项目名称:MITK,代码行数:14,代码来源:mitkVtkMapper.cpp


注:本文中的DataNode::GetOpacity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。