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


C++ Pointer::GetProperty方法代码示例

本文整理汇总了C++中image::Pointer::GetProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::GetProperty方法的具体用法?C++ Pointer::GetProperty怎么用?C++ Pointer::GetProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在image::Pointer的用法示例。


在下文中一共展示了Pointer::GetProperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ThreadedUpdateSuccessful

  void ShowSegmentationAsSurface::ThreadedUpdateSuccessful()
  {
    m_Node = DataNode::New();

    bool wireframe(false);
    GetParameter("Wireframe", wireframe);
    if (wireframe)
    {
      VtkRepresentationProperty *np =
        dynamic_cast<VtkRepresentationProperty *>(m_Node->GetProperty("material.representation"));
      if (np)
        np->SetRepresentationToWireframe();
    }

    m_Node->SetProperty("opacity", FloatProperty::New(0.3));
    m_Node->SetProperty("line width", IntProperty::New(1));
    m_Node->SetProperty("scalar visibility", BoolProperty::New(false));

    std::string groupNodesName("surface");

    DataNode *groupNode = GetGroupNode();
    if (groupNode)
    {
      groupNode->GetName(groupNodesName);
      // if parameter smooth is set add extension to node name
      bool smooth(true);
      GetParameter("Smooth", smooth);
      if (smooth)
        groupNodesName.append("_smoothed");
    }
    m_Node->SetProperty("name", StringProperty::New(groupNodesName));

    // synchronize this object's color with the parent's color
    // surfaceNode->SetProperty( "color", parentNode->GetProperty( "color" ) );
    // surfaceNode->SetProperty( "visible", parentNode->GetProperty( "visible" ) );

    m_Node->SetData(m_Surface);

    BaseProperty *colorProp = groupNode->GetProperty("color");
    if (colorProp)
      m_Node->ReplaceProperty("color", colorProp->Clone());
    else
      m_Node->SetProperty("color", ColorProperty::New(1.0, 1.0, 0.0));

    bool showResult(true);
    GetParameter("Show result", showResult);

    bool syncVisibility(false);
    GetParameter("Sync visibility", syncVisibility);

    Image::Pointer image;
    GetPointerParameter("Input", image);

    BaseProperty *organTypeProp = image->GetProperty("organ type");
    if (organTypeProp)
      m_Surface->SetProperty("organ type", organTypeProp);

    BaseProperty *visibleProp = groupNode->GetProperty("visible");
    if (visibleProp && syncVisibility)
      m_Node->ReplaceProperty("visible", visibleProp->Clone());
    else
      m_Node->SetProperty("visible", BoolProperty::New(showResult));

    InsertBelowGroupNode(m_Node);

    Superclass::ThreadedUpdateSuccessful();
  }
开发者ID:pollen-metrology,项目名称:MITK,代码行数:67,代码来源:mitkShowSegmentationAsSurface.cpp

示例2: ThreadedUpdateSuccessful

void ShowSegmentationAsSmoothedSurface::ThreadedUpdateSuccessful()
{
  DataNode::Pointer node = DataNode::New();

  bool wireframe = false;
  GetParameter("Wireframe", wireframe);

  if (wireframe)
  {
    VtkRepresentationProperty *representation = dynamic_cast<VtkRepresentationProperty *>(
      node->GetProperty("material.representation"));

    if (representation != nullptr)
      representation->SetRepresentationToWireframe();
  }

  node->SetProperty("opacity", FloatProperty::New(1.0));
  node->SetProperty("line width", IntProperty::New(1));
  node->SetProperty("scalar visibility", BoolProperty::New(false));

  std::string groupNodeName = "surface";
  DataNode *groupNode = GetGroupNode();

  if (groupNode != nullptr)
    groupNode->GetName(groupNodeName);

  node->SetProperty("name", StringProperty::New(groupNodeName));
  node->SetData(m_Surface);

  BaseProperty *colorProperty = groupNode->GetProperty("color");

  if (colorProperty != nullptr)
    node->ReplaceProperty("color", colorProperty->Clone());
  else
    node->SetProperty("color", ColorProperty::New(1.0f, 0.0f, 0.0f));

  bool showResult = true;
  GetParameter("Show result", showResult);

  bool syncVisibility = false;
  GetParameter("Sync visibility", syncVisibility);

  Image::Pointer image;
  GetPointerParameter("Input", image);

  BaseProperty *organTypeProperty = image->GetProperty("organ type");

  if (organTypeProperty != nullptr)
    m_Surface->SetProperty("organ type", organTypeProperty);

  BaseProperty *visibleProperty = groupNode->GetProperty("visible");

  if (visibleProperty != nullptr && syncVisibility)
    node->ReplaceProperty("visible", visibleProperty->Clone());
  else
    node->SetProperty("visible", BoolProperty::New(showResult));

  InsertBelowGroupNode(node);

  Superclass::ThreadedUpdateSuccessful();
}
开发者ID:151706061,项目名称:MITK,代码行数:61,代码来源:mitkShowSegmentationAsSmoothedSurface.cpp

示例3: ThreadedUpdateSuccessful

void ShowSegmentationAsSmoothedSurface::ThreadedUpdateSuccessful()
{
  DataNode::Pointer node = LookForPointerTargetBelowGroupNode("Surface representation");
  bool addToTree = node.IsNull();

  if (addToTree)
  {
    node = DataNode::New();

    bool wireframe = false;
    GetParameter("Wireframe", wireframe);

    if (wireframe)
    {
      VtkRepresentationProperty *representation = dynamic_cast<VtkRepresentationProperty *>(
        node->GetProperty("material.representation"));

      if (representation != NULL)
        representation->SetRepresentationToWireframe();
    }

    node->SetProperty("opacity", FloatProperty::New(1.0));
    node->SetProperty("line width", IntProperty::New(1));
    node->SetProperty("scalar visibility", BoolProperty::New(false));

    UIDGenerator uidGenerator("Surface_");
    node->SetProperty("FILENAME", StringProperty::New(uidGenerator.GetUID() + ".vtk"));

    std::string groupNodeName = "surface";
    DataNode *groupNode = GetGroupNode();

    if (groupNode != NULL)
      groupNode->GetName(groupNodeName);

    node->SetProperty("name", StringProperty::New(groupNodeName));
  }

  node->SetData(m_Surface);

  if (addToTree)
  {
    DataNode* groupNode = GetGroupNode();

    if (groupNode != NULL)
    {
      groupNode->SetProperty("Surface representation", SmartPointerProperty::New(node));

      BaseProperty *colorProperty = groupNode->GetProperty("color");

      if (colorProperty != NULL)
        node->ReplaceProperty("color", colorProperty);
      else
        node->SetProperty("color", ColorProperty::New(1.0f, 0.0f, 0.0f));

      bool showResult = true;
      GetParameter("Show result", showResult);

      bool syncVisibility = false;
      GetParameter("Sync visibility", syncVisibility);

      Image::Pointer image;
      GetPointerParameter("Input", image);

      BaseProperty *organTypeProperty = image->GetProperty("organ type");

      if (organTypeProperty != NULL)
        m_Surface->SetProperty("organ type", organTypeProperty);

      BaseProperty *visibleProperty = groupNode->GetProperty("visible");

      if (visibleProperty != NULL && syncVisibility)
        node->ReplaceProperty("visible", visibleProperty);
      else
        node->SetProperty("visible", BoolProperty::New(showResult));
    }

    InsertBelowGroupNode(node);
  }

  Superclass::ThreadedUpdateSuccessful();
}
开发者ID:zomboir,项目名称:MITK,代码行数:81,代码来源:mitkShowSegmentationAsSmoothedSurface.cpp


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