44 #ifndef PROPERTY_VISUALIZER_HH 45 #define PROPERTY_VISUALIZER_HH 51 #include <ACG/QtWidgets/QtHistogramWidget.hh> 52 #include <ACG/Utils/IColorCoder.hh> 53 #include <ACG/Utils/SmartPointer.hh> 55 #include "OpenMesh/Core/Geometry/VectorT.hh" 57 #ifdef ENABLE_SKELETON_SUPPORT 58 #include <ObjectTypes/Skeleton/BaseSkin.hh> 65 explicit VizException(
const std::string &msg) : std::logic_error(msg) {}
82 void log(
Logtype _type, QString _message);
83 void log(QString _message);
93 propertyInfo(_propertyInfo),
102 virtual void visualize(
bool _setDrawMode, QWidget* _widget);
105 virtual void removeProperty();
108 virtual void duplicateProperty();
111 virtual void clear();
119 virtual QString
getName() {
return propertyInfo.toString(); }
136 virtual QString getPropertyText(
unsigned int i) = 0;
148 virtual void setPropertyFromText(
unsigned int index, QString text) = 0;
151 virtual int getEntityCount() = 0;
154 virtual QString getHeader() = 0;
156 static inline QString toStr(
bool b) {
return b ? QObject::tr(
"True") : QObject::tr(
"False"); }
157 static inline QString toStr(
double d) {
return QObject::tr(
"%1").arg(d); }
158 static inline QString toStr(
int i) {
return QObject::tr(
"%1").arg(i); }
159 static inline QString toStr(uint8_t i) {
return QObject::tr(
"%1").arg(i); }
160 static inline QString toStr(
unsigned int i) {
return QObject::tr(
"%1").arg(i); }
165 #ifdef ENABLE_SKELETON_SUPPORT 169 static inline bool strToBool (QString str) {
return (str.compare(QObject::tr(
"True"))==0); }
170 static inline double strToDouble(QString str) {
return str.toDouble() ; }
171 static inline int strToInt (QString str) {
return str.toInt(); }
172 static inline unsigned int strToUInt (QString str) {
return str.toUInt(); }
179 virtual std::unique_ptr<ACG::IColorCoder> buildColorCoder();
181 template<
typename PropType,
typename Iterable>
191 template<
typename PropType,
typename Iterable>
192 void PropertyVisualizer::showHistogramT(
196 const size_t max_bins = 50;
197 widget->setMinimumHeight(300);
198 widget->setColorCoder(buildColorCoder());
PropertyVisualizer(const PropertyInfo &_propertyInfo)
Constructor.
virtual QWidget * getWidget()
Returns the visualizer's widget.
virtual ~PropertyVisualizer()
Destructor.
Logtype
Log types for Message Window.
std::map< unsigned int, double > SkinWeights
Stores the joint weights per vertex.
virtual QString getName()
Returns a beautiful name.
const PropertyInfo & getPropertyInfo() const
Returns the PropertyInfo.
Cellection of information about a property.
This class vizualizes a property.