collision_linear_model.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2016, CITEC, Bielefeld University
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *********************************************************************/
34 
35 /* Author: Robert Haschke */
36 
37 #ifndef MOVEIT_ROS_MOVEIT_SETUP_ASSISTANT_WIDGETS_COLLISION_LINEAR_MODEL_H
38 #define MOVEIT_ROS_MOVEIT_SETUP_ASSISTANT_WIDGETS_COLLISION_LINEAR_MODEL_H
39 
40 #include <QAbstractProxyModel>
41 #include <QSortFilterProxyModel>
42 #include <QVector>
43 
44 #ifndef Q_MOC_RUN
46 #endif
47 
48 #include "collision_matrix_model.h"
49 
50 class CollisionLinearModel : public QAbstractProxyModel
51 {
52  Q_OBJECT
53 
54 public:
57 
58  // reimplement to return the model index in the proxy model that to the sourceIndex from the source model
59  QModelIndex mapFromSource(const QModelIndex& sourceIndex) const;
60  // Reimplement this function to return the model index in the source model that corresponds to the proxyIndex in the
61  // proxy model
62  QModelIndex mapToSource(const QModelIndex& proxyIndex) const;
63 
64  int rowCount(const QModelIndex& parent) const;
65  int columnCount(const QModelIndex& parent) const;
66 
67  QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const;
68  QModelIndex parent(const QModelIndex& child) const;
69  QVariant data(const QModelIndex& index, int role) const;
71 
72  bool setData(const QModelIndex& index, const QVariant& value, int role);
73  void setEnabled(const QItemSelection& selection, bool value);
74 
75  Qt::ItemFlags flags(const QModelIndex& index) const;
76  QVariant headerData(int section, Qt::Orientation orientation, int role) const;
77 };
78 
80 class SortFilterProxyModel : public QSortFilterProxyModel
81 {
82  Q_OBJECT
83 
84 public:
85  SortFilterProxyModel(QObject* parent = 0);
86  QVariant headerData(int section, Qt::Orientation orientation, int role) const;
87  void sort(int column, Qt::SortOrder order);
88  void setShowAll(bool show_all);
89  void setEnabled(const QItemSelection& selection, bool value);
90 
91 protected:
92  bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const;
93  bool lessThan(const QModelIndex& src_left, const QModelIndex& src_right) const;
94 
95 private Q_SLOTS:
96  void initSorting();
97 
98 private:
99  bool show_all_;
100  QVector<int> sort_columns_; // sorting history
101  QVector<int> sort_orders_; // corresponding sort orders
102 };
103 
104 #endif // MOVEIT_ROS_MOVEIT_SETUP_ASSISTANT_WIDGETS_COLLISION_LINEAR_MODEL_H
#define NULL
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
QModelIndex mapToSource(const QModelIndex &proxyIndex) const
CollisionLinearModel(CollisionMatrixModel *src, QObject *parent=NULL)
QModelIndex mapFromSource(const QModelIndex &sourceIndex) const
src
moveit_setup_assistant::DisabledReason reason(int row) const
void setEnabled(const QItemSelection &selection, bool value)
QModelIndex parent(const QModelIndex &child) const
int columnCount(const QModelIndex &parent) const
QVariant data(const QModelIndex &index, int role) const
DisabledReason
Reasons for disabling link pairs. Append "in collision" for understanding. NOT_DISABLED means the lin...
int rowCount(const QModelIndex &parent) const
bool setData(const QModelIndex &index, const QVariant &value, int role)
int value
QVariant headerData(int section, Qt::Orientation orientation, int role) const
Qt::ItemFlags flags(const QModelIndex &index) const


moveit_setup_assistant
Author(s): Dave Coleman
autogenerated on Sun Oct 18 2020 13:19:28