コード例 #1
0
// ******************************************************************************************
// Called from Double List widget to highlight joints
// ******************************************************************************************
void ROSControllersWidget::previewSelectedJoints(std::vector<std::string> joints)
{
  // Unhighlight all links
  Q_EMIT unhighlightAll();

  for (const std::string& joint : joints)
  {
    const robot_model::JointModel* joint_model = config_data_->getRobotModel()->getJointModel(joint);

    // Check that a joint model was found
    if (!joint_model)
    {
      continue;
    }

    // Get the name of the link
    const std::string link = joint_model->getChildLinkModel()->getName();

    if (link.empty())
    {
      continue;
    }

    // Highlight link
    Q_EMIT highlightLink(link, QColor(255, 0, 0));
  }
}
コード例 #2
0
// ******************************************************************************************
// Preview whatever element is selected
// ******************************************************************************************
void DefaultCollisionsWidget::previewClicked( int row, int column )
{
  // Get list of all selected items
  QList<QTableWidgetItem*> selected = collision_table_->selectedItems();

  // Check that an element was selected
  if( !selected.size() )
    return;

  // Unhighlight all links
  Q_EMIT unhighlightAll();

  // Highlight link
  Q_EMIT highlightLink( selected[0]->text().toStdString() );
  Q_EMIT highlightLink( selected[1]->text().toStdString() );
}
コード例 #3
0
// ******************************************************************************************
// Called from Double List widget to highlight joints
// ******************************************************************************************
void PassiveJointsWidget::previewSelectedJoints( std::vector<std::string> joints )
{
  // Unhighlight all links
  Q_EMIT unhighlightAll();

  for(int i = 0; i < joints.size(); ++i)
  {

    const robot_model::JointModel *joint_model = config_data_->getRobotModel()->getJointModel( joints[i] );

    // Check that a joint model was found
    if( !joint_model )
    {
      continue;
    }

    // Get the name of the link
    const std::string link = joint_model->getChildLinkModel()->getName();

    if( link.empty() )
    {
      continue;
    }

    // Highlight link
    Q_EMIT highlightLink( link );
  }
}
コード例 #4
0
// ******************************************************************************************
// Highlight the currently selected link
// ******************************************************************************************
void KinematicChainWidget::itemSelected()
{
  QTreeWidgetItem* item = link_tree_->currentItem();
  if (item != nullptr)
  {
    Q_EMIT unhighlightAll();

    std::string name = item->text(0).toStdString();

    // Don't try to highlight empty links!
    if (name.empty())
      return;

    // Check that item is not empty
    Q_EMIT highlightLink(item->text(0).toStdString(), QColor(255, 0, 0));
  }
}