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


C++ TreeNode::column方法代码示例

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


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

示例1: getNodeValue

    std::string getNodeValue(const std::string& nodeId, int column) const
    {
      TreeNode* node = getNode(nodeId);
      if (node == NULL || column >= node->width()) {
        return "#N/A";
      }

      return node->column(column).toString().toLocal8Bit().constData();
    }
开发者ID:FlavioFalcao,项目名称:DDS-1,代码行数:9,代码来源:RTDMonitor.cpp

示例2: if

void
Monitor::NodeGenerator::findConnections(TreeNode * t)
{
  if (t == 0) {
    return;
  }

  std::string key = t->column(0).toString().toLocal8Bit().constData();
  std::string val = t->column(1).toString().toLocal8Bit().constData();

  // store this writer-->reader connection info
  TreeNode *c;
  std::string tmp;
  std::string conn;

  if (key == "Reader" || key == "Writer") {
    for (int i = 0; i < t->size(); ++i) {
      c = t->operator[](i);
      tmp = c->column(0).toString().toLocal8Bit().constData();

      if (nodeOpt_.abbrGUIDs()) {
        conn = abbr(c->column(1).toString().toLocal8Bit().constData());
        val = abbr(t->column(1).toString().toLocal8Bit().constData());
      }
      else {
        conn = c->column(1).toString().toLocal8Bit().constData();
      }

      if (tmp == "Writer" && key == "Reader") {
        rMap_[t] = conn;
      }
      else if (tmp == "Reader" && key == "Writer") {
        wMap_[val] = t;
      }
    }
  }

  for (int i = 0; i < t->size(); ++i) {
    findConnections(t->operator[](i));
  }
}
开发者ID:AndroidDev77,项目名称:OpenDDS,代码行数:41,代码来源:NodeGenerator.cpp

示例3: abbr

bool
Monitor::NodeGenerator::isNodeValid(TreeNode *t, QString &text)
{
  bool ret = false;

  // draw this node ?
  if (t != root_ && t->width() >= 2) {
    if (!honorDisplayFlag_ || (honorDisplayFlag_ && t->display())) {
      std::string key = t->column(0).toString().toLocal8Bit().constData();
      std::string val = t->column(1).toString().toLocal8Bit().constData();

      // host and process nodes
      // TODO: this is terribly ugly
      if (
        (key == "Host" && !nodeOpt_.ignoreHosts()) ||
        (key == "Process" && !nodeOpt_.ignoreProcs()) ||
        (key == "DomainParticipant") ||
        (key == "Publisher" && !nodeOpt_.ignorePubs()) ||
        (key == "Subscriber" && !nodeOpt_.ignoreSubs()) ||
        (key == "Topic" && !nodeOpt_.hideTopics()) ||
        (key == "Transport" && !nodeOpt_.ignoreTransports()) ||
        (key == "Reader" || key == "Writer") ||
        (key == "Qos" && !nodeOpt_.ignoreQos())
        ) {

          ret = true;

          // check for ignoreBuiltInTopics
          if (key == "Topic" && !nodeOpt_.hideTopics() &&
              nodeOpt_.ignoreBuiltinTopics()) {

            ret = false;
            std::string tmp;
            TreeNode* c;

            for (int i = 0; i < t->size(); ++i) {
              c = t->operator[](i);
              tmp = c->column(0).toString().toLocal8Bit().constData();

              if (tmp == "Topic Name") {
                tmp = c->column(1).toString().toLocal8Bit().constData();
                if(tmp.substr(0, 4) != "DCPS") {
                  ret = true;
                }
              }
            }
          }

          if (ret) {
            // yes, draw this node!
            if (nodeOpt_.abbrGUIDs()) {
              val = abbr(val);
            }

            text = key.c_str();
            text += "\n";
            text += val.c_str();
          }
        }
    }
  }

  return ret;
}
开发者ID:AndroidDev77,项目名称:OpenDDS,代码行数:64,代码来源:NodeGenerator.cpp

示例4: Node

void
Monitor::NodeGenerator::generate(TreeNode *t, QGraphicsScene *nodeScene, int w, int h, Node* parent)
{
  static int xpos = 0;
  static int ypos = 0;

  if (t == 0) {
    return;
  }

  Node *node = 0;

  QString text;
  if (isNodeValid(t, text)) {

    xpos = w * 100;
    ypos += 50;

    node = new Node(text, xpos, ypos, t);
    node->setParent(parent);

    // populate tooltips with the children
    TreeNode *c;
    std::ostringstream ttip;
    for (int i = 0; i < t->size(); ++i) {
      c = t->operator[](i);
      std::string k = c->column(0).toString().toLocal8Bit().constData();
      std::string v = c->column(1).toString().toLocal8Bit().constData();

      ttip << k << " : " << v << std::endl;
    }

    node->setToolTip(ttip.str().c_str());

    // this takes ownership of the node so the nodeScene will
    // cleanup all nodes when it's destroyed
    // TODO: This make each nodes parent the nodeScene. change this
    // so parent is the actual parent node using setParent()
    nodeScene->addItem(node);

    // connect us to our parent with a dashed line
    // connect us to the parent
    if (parent  && !nodeOpt_.hideParentChild()) {
      // give edge an actual parent so that z-order works
      Edge *edge = new Edge(parent, node, false,  parent);
      nodeScene->addItem(edge);
      parent->addEdge(edge);
      node->addEdge(edge);
    }
    // store node
    if (parent && !nodeOpt_.hidePubSub()) {
      nMap_[t] = node;
    }
  }

  // draw the child nodes
  ++w;
  for (int i = 0; i < t->size(); ++i) {
    generate(t->operator[](i), nodeScene, w, ++h, node);
  }

}
开发者ID:AndroidDev77,项目名称:OpenDDS,代码行数:62,代码来源:NodeGenerator.cpp


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