Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenFlipper-Free
Plugin-PropertyVis
Commits
f86cb9ea
Commit
f86cb9ea
authored
Feb 10, 2020
by
Martin Heistermann
Browse files
Use new ACG::Histogram API, implement support for integral properties
parent
ceb6e7fe
Changes
4
Hide whitespace changes
Inline
Side-by-side
OpenVolumeMesh/OVMPropertyVisualizerIntegerT_impl.hh
View file @
f86cb9ea
...
...
@@ -66,6 +66,9 @@ OVMPropertyVisualizerInteger<MeshT,T>::OVMPropertyVisualizerInteger(MeshT* _mesh
mNumericLimitMax
=
std
::
numeric_limits
<
T
>::
max
();
mNumericLimitMin
=
std
::
numeric_limits
<
T
>::
min
();
this
->
connect
(
w
->
computeHistogramButton
,
&
QPushButton
::
clicked
,
[
this
,
w
](){
this
->
template
showHistogram
<
T
>(
w
->
histogram
);});
}
template
<
typename
MeshT
,
typename
T
>
...
...
OpenVolumeMesh/OVMPropertyVisualizerT_impl.hh
View file @
f86cb9ea
...
...
@@ -403,7 +403,8 @@ void OVMPropertyVisualizer<MeshT>::setVertexPropertyFromText(unsigned int /*inde
template
<
typename
MeshT
>
template
<
typename
Type
>
void
OVMPropertyVisualizer
<
MeshT
>::
showHistogram
(
ACG
::
QtWidgets
::
QtHistogramWidget
*
histogramWidget
)
{
void
OVMPropertyVisualizer
<
MeshT
>::
showHistogram
(
ACG
::
QtWidgets
::
QtHistogramWidget
*
histogramWidget
)
{
using
PV
=
OVMPropertyVisualizer
<
MeshT
>
;
const
std
::
string
&
prop_name
=
PV
::
propertyInfo
.
propName
();
...
...
PropertyVisualizer/PropertyVisualizer.hh
View file @
f86cb9ea
...
...
@@ -193,10 +193,9 @@ void PropertyVisualizer::showHistogramT(
ACG
::
QtWidgets
::
QtHistogramWidget
*
widget
,
Iterable
data
)
{
const
size_t
max_bins
=
50
;
// TODO: expose in GUI?
widget
->
setMinimumHeight
(
300
);
widget
->
setColorCoder
(
buildColorCoder
());
widget
->
setHistogram
(
ptr
::
make_unique
<
ACG
::
HistogramT
<
PropType
>>
(
data
.
begin
(),
data
.
end
(),
max_bins
));
widget
->
setHistogram
(
ACG
::
create_histogram_auto
(
data
));
}
#endif
/* PROPERTY_VISUALIZER_HH */
Widgets/IntegerWidget.ui
View file @
f86cb9ea
...
...
@@ -6,8 +6,8 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
387
</width>
<height>
243
</height>
<width>
443
</width>
<height>
566
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
...
...
@@ -17,7 +17,16 @@
<property
name=
"spacing"
>
<number>
0
</number>
</property>
<property
name=
"margin"
>
<property
name=
"leftMargin"
>
<number>
0
</number>
</property>
<property
name=
"topMargin"
>
<number>
0
</number>
</property>
<property
name=
"rightMargin"
>
<number>
0
</number>
</property>
<property
name=
"bottomMargin"
>
<number>
0
</number>
</property>
<item>
...
...
@@ -164,6 +173,35 @@
</item>
</layout>
</item>
<item>
<widget
class=
"QGroupBox"
name=
"histogramGroupbox"
>
<property
name=
"title"
>
<string>
Histogram
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<widget
class=
"QPushButton"
name=
"computeHistogramButton"
>
<property
name=
"text"
>
<string>
Compute Histogram
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"ACG::QtWidgets::QtHistogramWidget"
name=
"histogram"
native=
"true"
>
<property
name=
"enabled"
>
<bool>
false
</bool>
</property>
<property
name=
"minimumSize"
>
<size>
<width>
0
</width>
<height>
0
</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
...
...
@@ -175,6 +213,12 @@
<extends>
QPushButton
</extends>
<header>
ACG/QtWidgets/QtColorChooserButton.hh
</header>
</customwidget>
<customwidget>
<class>
ACG::QtWidgets::QtHistogramWidget
</class>
<extends>
QWidget
</extends>
<header>
ACG/QtWidgets/QtHistogramWidget.hh
</header>
<container>
1
</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>
intFixedRange
</tabstop>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment