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); }
164 #ifdef ENABLE_SKELETON_SUPPORT 168 static inline bool strToBool (QString str) {
return (str.compare(QObject::tr(
"True"))==0); }
169 static inline double strToDouble(QString str) {
return str.toDouble() ; }
170 static inline int strToInt (QString str) {
return str.toInt(); }
171 static inline unsigned int strToUInt (QString str) {
return str.toUInt(); }
178 virtual std::unique_ptr<ACG::IColorCoder> buildColorCoder();
180 template<
typename PropType,
typename Iterable>
190 template<
typename PropType,
typename Iterable>
191 void PropertyVisualizer::showHistogramT(
195 const size_t max_bins = 50;
196 widget->setMinimumHeight(300);
197 widget->setColorCoder(buildColorCoder());
virtual ~PropertyVisualizer()
Destructor.
Logtype
Log types for Message Window.
const PropertyInfo & getPropertyInfo() const
Returns the PropertyInfo.
virtual QString getName()
Returns a beautiful name.
std::map< unsigned int, double > SkinWeights
Stores the joint weights per vertex.
This class vizualizes a property.
virtual QWidget * getWidget()
Returns the visualizer's widget.
PropertyVisualizer(const PropertyInfo &_propertyInfo)
Constructor.
Cellection of information about a property.