Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenFlipper-Free
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
23
Issues
23
List
Boards
Labels
Service Desk
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenFlipper-Free
OpenFlipper-Free
Commits
58449a05
Commit
58449a05
authored
Nov 10, 2016
by
Martin Heistermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Propvis histograms: use unique_ptr where possible.
parent
a5db50e5
Pipeline
#3612
canceled with stage
in 11 minutes
Changes
14
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
47 additions
and
65 deletions
+47
-65
ACG/QtWidgets/QtHistogramWidget.cc
ACG/QtWidgets/QtHistogramWidget.cc
+5
-11
ACG/QtWidgets/QtHistogramWidget.hh
ACG/QtWidgets/QtHistogramWidget.hh
+6
-15
Plugin-InfoMeshObject/ValenceHistogramDialog.cc
Plugin-InfoMeshObject/ValenceHistogramDialog.cc
+3
-2
Plugin-PropertyVis/OpenMesh/OMPropertyVisualizerDouble.hh
Plugin-PropertyVis/OpenMesh/OMPropertyVisualizerDouble.hh
+2
-3
Plugin-PropertyVis/OpenMesh/OMPropertyVisualizerDoubleT.cc
Plugin-PropertyVis/OpenMesh/OMPropertyVisualizerDoubleT.cc
+5
-7
Plugin-PropertyVis/OpenMesh/OMPropertyVisualizerIntegerT.cc
Plugin-PropertyVis/OpenMesh/OMPropertyVisualizerIntegerT.cc
+4
-5
Plugin-PropertyVis/OpenVolumeMesh/OVMPropertyVisualizerDouble.hh
...PropertyVis/OpenVolumeMesh/OVMPropertyVisualizerDouble.hh
+2
-1
Plugin-PropertyVis/OpenVolumeMesh/OVMPropertyVisualizerDoubleT.cc
...ropertyVis/OpenVolumeMesh/OVMPropertyVisualizerDoubleT.cc
+2
-3
Plugin-PropertyVis/OpenVolumeMesh/OVMPropertyVisualizerInteger.hh
...ropertyVis/OpenVolumeMesh/OVMPropertyVisualizerInteger.hh
+2
-1
Plugin-PropertyVis/OpenVolumeMesh/OVMPropertyVisualizerIntegerT.cc
...opertyVis/OpenVolumeMesh/OVMPropertyVisualizerIntegerT.cc
+2
-3
Plugin-PropertyVis/PropertyVisualizer.cc
Plugin-PropertyVis/PropertyVisualizer.cc
+1
-1
Plugin-PropertyVis/PropertyVisualizer.hh
Plugin-PropertyVis/PropertyVisualizer.hh
+3
-3
Plugin-PropertyVis/Widgets/DoubleWidget.hh
Plugin-PropertyVis/Widgets/DoubleWidget.hh
+5
-5
Plugin-PropertyVis/Widgets/IntegerWidget.hh
Plugin-PropertyVis/Widgets/IntegerWidget.hh
+5
-5
No files found.
ACG/QtWidgets/QtHistogramWidget.cc
View file @
58449a05
...
...
@@ -53,21 +53,15 @@ QtHistogramWidget::QtHistogramWidget(QWidget *parent)
color_
(
QColor
::
fromRgbF
(
0.518
,
0.573
,
0.643
,
1.0
))
{}
QtHistogramWidget
::~
QtHistogramWidget
()
{
delete
histogram_
;
delete
color_coder_
;
}
QtHistogramWidget
::~
QtHistogramWidget
()
=
default
;
void
QtHistogramWidget
::
setHistogram
(
Histogram
*
histogram
)
{
delete
histogram_
;
histogram_
=
histogram
;
void
QtHistogramWidget
::
setHistogram
(
std
::
unique_ptr
<
Histogram
>
histogram
)
{
histogram_
=
std
::
move
(
histogram
);
this
->
update
();
}
void
QtHistogramWidget
::
setColorCoder
(
IColorCoder
*
color_coder
)
{
delete
color_coder_
;
color_coder_
=
color_coder
;
void
QtHistogramWidget
::
setColorCoder
(
std
::
unique_ptr
<
IColorCoder
>
color_coder
)
{
color_coder_
=
std
::
move
(
color_coder
);
this
->
update
();
}
...
...
ACG/QtWidgets/QtHistogramWidget.hh
View file @
58449a05
...
...
@@ -44,6 +44,8 @@
// Based on ValenceHistogramWidget by hc
#include <memory>
#include <QWidget>
#include "../Config/ACGDefines.hh"
#include "../Utils/Histogram.hh"
...
...
@@ -62,29 +64,18 @@ class ACGDLLEXPORT QtHistogramWidget : public QWidget {
QtHistogramWidget
(
const
QtHistogramWidget
&
other
)
=
delete
;
QtHistogramWidget
&
operator
=
(
const
QtHistogramWidget
&
other
)
=
delete
;
/**
* @brief setHistogram
* @param histogram: This widget takes ownership of the Histogram
* and deletes it.
*/
void
setHistogram
(
Histogram
*
histogram
);
/**
* @brief setColorCoder
* @param color_coder: This widget takes ownership of the IColorCoder
* and deletes it.
*/
void
setColorCoder
(
IColorCoder
*
color_coder
);
void
setHistogram
(
std
::
unique_ptr
<
Histogram
>
histogram
);
void
setColorCoder
(
std
::
unique_ptr
<
IColorCoder
>
color_coder
);
protected:
void
paintEvent
(
QPaintEvent
*
event
);
QColor
getColor
(
double
val
);
// val in [0..1]
Histogram
*
histogram_
=
0
;
std
::
unique_ptr
<
Histogram
>
histogram_
=
nullptr
;
double
label_distance_
=
100
;
QColor
color_
;
// ignored if we have a color coder
IColorCoder
*
color_coder_
=
0
;
std
::
unique_ptr
<
IColorCoder
>
color_coder_
=
nullptr
;
};
...
...
Plugin-InfoMeshObject/ValenceHistogramDialog.cc
View file @
58449a05
...
...
@@ -7,6 +7,7 @@
#include "ValenceHistogramDialog.hh"
#include <ACG/Utils/SmartPointer.hh>
ValenceHistogramDialog
::
ValenceHistogramDialog
(
TriMesh
&
mesh
,
QWidget
*
parent
)
:
QDialog
(
parent
)
{
...
...
@@ -105,7 +106,7 @@ void ValenceHistogramDialog::init(MeshT &mesh) {
}
vertex_valence_hist
[
valence
]
+=
1
;
}
vertexValenceChart_wdgt
->
setHistogram
(
new
ValenceHistogram
(
vertex_valence_hist
));
vertexValenceChart_wdgt
->
setHistogram
(
ptr
::
make_unique
<
ValenceHistogram
>
(
vertex_valence_hist
));
fillHistogramTable
(
vertex_valence_hist
,
*
vertexValence_tw
);
/*
...
...
@@ -122,6 +123,6 @@ void ValenceHistogramDialog::init(MeshT &mesh) {
face_valence_hist
[
valence
]
+=
1
;
}
faceValenceChart_wdgt
->
setHistogram
(
new
ValenceHistogram
(
face_valence_hist
));
faceValenceChart_wdgt
->
setHistogram
(
ptr
::
make_unique
<
ValenceHistogram
>
(
face_valence_hist
));
fillHistogramTable
(
face_valence_hist
,
*
faceValence_tw
);
}
Plugin-PropertyVis/OpenMesh/OMPropertyVisualizerDouble.hh
View file @
58449a05
...
...
@@ -58,8 +58,7 @@
#include <ACG/Utils/ColorCoder.hh>
#include <memory>
#include <iostream>
template
<
typename
MeshT
>
...
...
@@ -85,7 +84,7 @@ protected:
virtual
void
setHalfedgePropertyFromText
(
unsigned
int
index
,
QString
text
);
virtual
void
setVertexPropertyFromText
(
unsigned
int
index
,
QString
text
);
ACG
::
IColorCoder
*
buildColorCoder
()
override
;
std
::
unique_ptr
<
ACG
::
IColorCoder
>
buildColorCoder
()
override
;
};
...
...
Plugin-PropertyVis/OpenMesh/OMPropertyVisualizerDoubleT.cc
View file @
58449a05
...
...
@@ -73,7 +73,7 @@ void OMPropertyVisualizerDouble<MeshT>::visualizeFaceProp(bool _setDrawMode)
typename
MeshT
::
Color
colorMin
=
ACG
::
to_Vec4f
(
doubleWidget
->
doubleMin
->
color
());
// color coder in [0,1]
ACG
::
IColorCoder
*
cc
=
doubleWidget
->
buildColorCoder
();
auto
cc
=
doubleWidget
->
buildColorCoder
();
OpenMesh
::
FPropHandleT
<
double
>
prop
;
...
...
@@ -140,7 +140,6 @@ void OMPropertyVisualizerDouble<MeshT>::visualizeFaceProp(bool _setDrawMode)
OMPropertyVisualizer
<
MeshT
>::
mesh
->
set_color
(
*
f_it
,
color
);
}
}
delete
cc
;
if
(
_setDrawMode
)
PluginFunctions
::
setDrawMode
(
ACG
::
SceneGraph
::
DrawModes
::
SOLID_FACES_COLORED
);
...
...
@@ -155,7 +154,7 @@ void OMPropertyVisualizerDouble<MeshT>::visualizeEdgeProp(bool _setDrawMode)
colorMin
=
ACG
::
to_Vec4f
(
doubleWidget
->
doubleMin
->
color
());
// color coder in [0,1]
ACG
::
IColorCoder
*
cc
=
doubleWidget
->
buildColorCoder
();
auto
cc
=
doubleWidget
->
buildColorCoder
();
//TODO check if this also works if the property is Vec3d
OpenMesh
::
EPropHandleT
<
double
>
prop
;
...
...
@@ -224,7 +223,6 @@ void OMPropertyVisualizerDouble<MeshT>::visualizeEdgeProp(bool _setDrawMode)
OMPropertyVisualizer
<
MeshT
>::
mesh
->
set_color
(
*
e_it
,
color
);
}
}
delete
cc
;
if
(
_setDrawMode
)
PluginFunctions
::
setDrawMode
(
ACG
::
SceneGraph
::
DrawModes
::
EDGES_COLORED
);
...
...
@@ -239,7 +237,7 @@ void OMPropertyVisualizerDouble<MeshT>::visualizeHalfedgeProp(bool _setDrawMode)
typename
MeshT
::
Color
colorMin
=
ACG
::
to_Vec4f
(
doubleWidget
->
doubleMin
->
color
());
// color coder in [0,1]
ACG
::
IColorCoder
*
cc
=
doubleWidget
->
buildColorCoder
();
auto
cc
=
doubleWidget
->
buildColorCoder
();
//TODO check if this also works if the property is Vec3d
OpenMesh
::
HPropHandleT
<
double
>
prop
;
...
...
@@ -319,7 +317,7 @@ void OMPropertyVisualizerDouble<MeshT>::visualizeVertexProp(bool _setDrawMode)
typename
MeshT
::
Color
colorMin
=
ACG
::
to_Vec4f
(
doubleWidget
->
doubleMin
->
color
());
// color coder in [0,1]
ACG
::
IColorCoder
*
cc
=
doubleWidget
->
buildColorCoder
();
auto
cc
=
doubleWidget
->
buildColorCoder
();
//TODO check if this also works if the property is Vec3d
OpenMesh
::
VPropHandleT
<
double
>
prop
;
...
...
@@ -453,7 +451,7 @@ void OMPropertyVisualizerDouble<MeshT>::setVertexPropertyFromText(unsigned int i
}
template
<
typename
MeshT
>
ACG
::
IColorCoder
*
OMPropertyVisualizerDouble
<
MeshT
>::
buildColorCoder
()
std
::
unique_ptr
<
ACG
::
IColorCoder
>
OMPropertyVisualizerDouble
<
MeshT
>::
buildColorCoder
()
{
DoubleWidget
*
doubleWidget
=
static_cast
<
DoubleWidget
*>
(
PropertyVisualizer
::
widget
);
return
doubleWidget
->
buildColorCoder
();
...
...
Plugin-PropertyVis/OpenMesh/OMPropertyVisualizerIntegerT.cc
View file @
58449a05
...
...
@@ -81,7 +81,7 @@ void OMPropertyVisualizerInteger<MeshT, T>::visualizeFaceProp(bool _setDrawMode)
IntegerWidget
*
integerWidget
=
static_cast
<
IntegerWidget
*>
(
PropertyVisualizer
::
widget
);
typename
MeshT
::
Color
colorMin
=
ACG
::
to_Vec4f
(
integerWidget
->
intMin
->
color
());
ACG
::
IColorCoder
*
cc
=
integerWidget
->
buildColorCoder
();
// color coder in [0,1]
auto
cc
=
integerWidget
->
buildColorCoder
();
// color coder in [0,1]
std
::
map
<
int
,
typename
MeshT
::
Color
>
randomColor
;
...
...
@@ -146,7 +146,6 @@ void OMPropertyVisualizerInteger<MeshT, T>::visualizeFaceProp(bool _setDrawMode)
OMPropertyVisualizer
<
MeshT
>::
mesh
->
set_color
(
*
f_it
,
color
);
}
}
delete
cc
;
if
(
_setDrawMode
)
PluginFunctions
::
setDrawMode
(
ACG
::
SceneGraph
::
DrawModes
::
SOLID_FACES_COLORED
);
...
...
@@ -158,7 +157,7 @@ void OMPropertyVisualizerInteger<MeshT, T>::visualizeEdgeProp(bool _setDrawMode)
IntegerWidget
*
integerWidget
=
static_cast
<
IntegerWidget
*>
(
PropertyVisualizer
::
widget
);
typename
MeshT
::
Color
colorMin
=
ACG
::
to_Vec4f
(
integerWidget
->
intMin
->
color
());
ACG
::
IColorCoder
*
cc
=
integerWidget
->
buildColorCoder
();
// color coder in [0,1]
auto
cc
=
integerWidget
->
buildColorCoder
();
// color coder in [0,1]
std
::
map
<
int
,
typename
MeshT
::
Color
>
randomColor
;
...
...
@@ -235,7 +234,7 @@ void OMPropertyVisualizerInteger<MeshT, T>::visualizeHalfedgeProp(bool _setDrawM
IntegerWidget
*
integerWidget
=
static_cast
<
IntegerWidget
*>
(
PropertyVisualizer
::
widget
);
typename
MeshT
::
Color
colorMin
=
ACG
::
to_Vec4f
(
integerWidget
->
intMin
->
color
());
ACG
::
IColorCoder
*
cc
=
integerWidget
->
buildColorCoder
();
// color coder in [0,1]
auto
cc
=
integerWidget
->
buildColorCoder
();
// color coder in [0,1]
std
::
map
<
int
,
typename
MeshT
::
Color
>
randomColor
;
...
...
@@ -311,7 +310,7 @@ void OMPropertyVisualizerInteger<MeshT, T>::visualizeVertexProp(bool _setDrawMod
IntegerWidget
*
integerWidget
=
static_cast
<
IntegerWidget
*>
(
PropertyVisualizer
::
widget
);
typename
MeshT
::
Color
colorMin
=
ACG
::
to_Vec4f
(
integerWidget
->
intMin
->
color
());
ACG
::
IColorCoder
*
cc
=
integerWidget
->
buildColorCoder
();
// color coder in [0,1]
auto
cc
=
integerWidget
->
buildColorCoder
();
// color coder in [0,1]
std
::
map
<
int
,
typename
MeshT
::
Color
>
randomColor
;
...
...
Plugin-PropertyVis/OpenVolumeMesh/OVMPropertyVisualizerDouble.hh
View file @
58449a05
...
...
@@ -60,6 +60,7 @@
#include <ACG/Utils/IColorCoder.hh>
#include <memory>
#include <iostream>
template
<
typename
MeshT
>
...
...
@@ -90,7 +91,7 @@ protected:
virtual
void
setHalfedgePropertyFromText
(
unsigned
int
index
,
QString
text
);
virtual
void
setVertexPropertyFromText
(
unsigned
int
index
,
QString
text
);
ACG
::
IColorCoder
*
buildColorCoder
()
override
;
std
::
unique_ptr
<
ACG
::
IColorCoder
>
buildColorCoder
()
override
;
};
#if defined(INCLUDE_TEMPLATES) && !defined(OVM_PROPERTY_VISUALIZER_DOUBLE_CC)
...
...
Plugin-PropertyVis/OpenVolumeMesh/OVMPropertyVisualizerDoubleT.cc
View file @
58449a05
...
...
@@ -82,7 +82,7 @@ void OVMPropertyVisualizerDouble<MeshT>::visualizeProp(PropType prop, EntityIter
DoubleWidget
*
doubleWidget
=
static_cast
<
DoubleWidget
*>
(
PropertyVisualizer
::
widget
);
ACG
::
Vec4f
colorMin
=
ACG
::
to_Vec4f
(
doubleWidget
->
doubleMin
->
color
());
ACG
::
IColorCoder
*
cc
=
doubleWidget
->
buildColorCoder
();
auto
cc
=
doubleWidget
->
buildColorCoder
();
double
min
,
max
;
if
(
doubleWidget
->
doubleAbsolute
->
isChecked
()
){
...
...
@@ -149,7 +149,6 @@ void OVMPropertyVisualizerDouble<MeshT>::visualizeProp(PropType prop, EntityIter
object
->
colors
()[
*
e_it
]
=
color
;
}
}
delete
cc
;
}
CALLS_TO_VISUALIZE_PROP
(
OVMPropertyVisualizerDouble
<
MeshT
>
,
typename
MeshT
,
double
)
...
...
@@ -268,7 +267,7 @@ void OVMPropertyVisualizerDouble<MeshT>::setVertexPropertyFromText(unsigned int
}
template
<
typename
MeshT
>
ACG
::
IColorCoder
*
OVMPropertyVisualizerDouble
<
MeshT
>::
buildColorCoder
()
std
::
unique_ptr
<
ACG
::
IColorCoder
>
OVMPropertyVisualizerDouble
<
MeshT
>::
buildColorCoder
()
{
DoubleWidget
*
doubleWidget
=
static_cast
<
DoubleWidget
*>
(
PropertyVisualizer
::
widget
);
return
doubleWidget
->
buildColorCoder
();
...
...
Plugin-PropertyVis/OpenVolumeMesh/OVMPropertyVisualizerInteger.hh
View file @
58449a05
...
...
@@ -59,6 +59,7 @@
#include <ACG/Utils/HuePartitioningColors.hh>
#include <iostream>
#include <memory>
template
<
typename
MeshT
,
typename
T
>
class
OVMPropertyVisualizerInteger
:
public
OVMPropertyVisualizer
<
MeshT
>
{
...
...
@@ -88,7 +89,7 @@ protected:
virtual
void
setHalfedgePropertyFromText
(
unsigned
int
index
,
QString
text
);
virtual
void
setVertexPropertyFromText
(
unsigned
int
index
,
QString
text
);
ACG
::
IColorCoder
*
buildColorCoder
()
override
;
std
::
unique_ptr
<
ACG
::
IColorCoder
>
buildColorCoder
()
override
;
T
mNumericLimitMax
;
T
mNumericLimitMin
;
...
...
Plugin-PropertyVis/OpenVolumeMesh/OVMPropertyVisualizerIntegerT.cc
View file @
58449a05
...
...
@@ -112,7 +112,7 @@ void OVMPropertyVisualizerInteger<MeshT, T>::visualizeProp(PropType prop, Entity
integerWidget
->
intFixedRangeMax
->
setValue
(
max
);
}
ACG
::
IColorCoder
*
cc
=
integerWidget
->
buildColorCoder
();
auto
cc
=
integerWidget
->
buildColorCoder
();
unsigned
int
range
=
max
-
min
;
VolumeMeshObject
<
MeshT
>*
object
;
...
...
@@ -145,7 +145,6 @@ void OVMPropertyVisualizerInteger<MeshT, T>::visualizeProp(PropType prop, Entity
object
->
colors
()[
*
e_it
]
=
color
;
}
}
delete
cc
;
}
#define KOMMA ,
CALLS_TO_VISUALIZE_PROP
(
OVMPropertyVisualizerInteger
<
MeshT
KOMMA
T
>
,
typename
MeshT
KOMMA
typename
T
,
T
)
...
...
@@ -266,7 +265,7 @@ void OVMPropertyVisualizerInteger<MeshT, T>::setVertexPropertyFromText(unsigned
}
template
<
typename
MeshT
,
typename
T
>
ACG
::
IColorCoder
*
OVMPropertyVisualizerInteger
<
MeshT
,
T
>::
buildColorCoder
()
std
::
unique_ptr
<
ACG
::
IColorCoder
>
OVMPropertyVisualizerInteger
<
MeshT
,
T
>::
buildColorCoder
()
{
IntegerWidget
*
integerWidget
=
static_cast
<
IntegerWidget
*>
(
PropertyVisualizer
::
widget
);
return
integerWidget
->
buildColorCoder
();
...
...
Plugin-PropertyVis/PropertyVisualizer.cc
View file @
58449a05
...
...
@@ -156,7 +156,7 @@ OpenMesh::Vec2f PropertyVisualizer::strToVec2f (QString str)
return
OpenMesh
::
Vec2f
(
strList
[
0
].
toFloat
(),
strList
[
1
].
toFloat
());
}
ACG
::
IColorCoder
*
PropertyVisualizer
::
buildColorCoder
()
std
::
unique_ptr
<
ACG
::
IColorCoder
>
PropertyVisualizer
::
buildColorCoder
()
{
throw
std
::
runtime_error
(
"Requested color coder on a Propvis that does not implement it"
);
}
Plugin-PropertyVis/PropertyVisualizer.hh
View file @
58449a05
...
...
@@ -56,6 +56,7 @@
#include <OpenFlipper/BasePlugin/LoggingInterface.hh>
#include <ACG/QtWidgets/QtHistogramWidget.hh>
#include <ACG/Utils/IColorCoder.hh>
#include <ACG/Utils/SmartPointer.hh>
#include "OpenMesh/Core/Geometry/VectorT.hh"
...
...
@@ -180,7 +181,7 @@ public:
protected:
virtual
ACG
::
IColorCoder
*
buildColorCoder
();
virtual
std
::
unique_ptr
<
ACG
::
IColorCoder
>
buildColorCoder
();
template
<
typename
PropType
,
typename
Iterable
>
void
showHistogramT
(
ACG
::
QtWidgets
::
QtHistogramWidget
*
widget
,
...
...
@@ -200,8 +201,7 @@ void PropertyVisualizer::showHistogramT(
const
size_t
max_bins
=
50
;
// TODO: expose in GUI?
widget
->
setMinimumHeight
(
300
);
widget
->
setColorCoder
(
buildColorCoder
());
ACG
::
Histogram
*
hist
=
new
ACG
::
HistogramT
<
PropType
>
(
data
.
begin
(),
data
.
end
(),
max_bins
);
widget
->
setHistogram
(
hist
);
widget
->
setHistogram
(
ptr
::
make_unique
<
ACG
::
HistogramT
<
PropType
>>
(
data
.
begin
(),
data
.
end
(),
max_bins
));
}
#endif
/* PROPERTY_VISUALIZER_HH */
Plugin-PropertyVis/Widgets/DoubleWidget.hh
View file @
58449a05
...
...
@@ -55,6 +55,7 @@
#include "ACG/Utils/IColorCoder.hh"
#include "ACG/Utils/LinearTwoColorCoder.hh"
#include <ACG/Utils/ColorConversion.hh>
#include <ACG/Utils/SmartPointer.hh>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
...
...
@@ -76,15 +77,14 @@ public:
/**
* @brief Builds a color coder according to UI settings
* @return Pointer to an IColorCoder for parameters in [0..1]
* @note Caller is responsible for deleting the returned object.
* @return unique_ptr to an IColorCoder for parameters in [0..1]
*/
ACG
::
IColorCoder
*
buildColorCoder
()
std
::
unique_ptr
<
ACG
::
IColorCoder
>
buildColorCoder
()
{
if
(
doubleColorCoder
->
isChecked
())
{
return
new
ACG
::
ColorCoder
();
return
ptr
::
make_unique
<
ACG
::
ColorCoder
>
();
}
else
{
return
new
ACG
::
LinearTwoColorCoder
(
return
ptr
::
make_unique
<
ACG
::
LinearTwoColorCoder
>
(
ACG
::
to_Vec4f
(
doubleMin
->
color
()),
ACG
::
to_Vec4f
(
doubleMax
->
color
()));
}
...
...
Plugin-PropertyVis/Widgets/IntegerWidget.hh
View file @
58449a05
...
...
@@ -56,6 +56,7 @@
#include "ACG/Utils/ColorCoder.hh"
#include "ACG/Utils/LinearTwoColorCoder.hh"
#include <ACG/Utils/ColorConversion.hh>
#include <ACG/Utils/SmartPointer.hh>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
...
...
@@ -77,15 +78,14 @@ public:
/**
* @brief Builds a color coder according to UI settings
* @return Pointer to an IColorCoder for parameters in [0..1]
* @note Caller is responsible for deleting the returned object.
* @return unique_ptr to an IColorCoder for parameters in [0..1]
*/
ACG
::
IColorCoder
*
buildColorCoder
()
std
::
unique_ptr
<
ACG
::
IColorCoder
>
buildColorCoder
()
{
if
(
intColorCoder
->
isChecked
())
{
return
new
ACG
::
ColorCoder
();
return
ptr
::
make_unique
<
ACG
::
ColorCoder
>
();
}
else
{
return
new
ACG
::
LinearTwoColorCoder
(
return
ptr
::
make_unique
<
ACG
::
LinearTwoColorCoder
>
(
ACG
::
to_Vec4f
(
intMin
->
color
()),
ACG
::
to_Vec4f
(
intMax
->
color
()));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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