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
a9a0e559
Commit
a9a0e559
authored
Oct 04, 2016
by
Martin Heistermann
Browse files
Introduce ACG::to_Vec4f for color conversions to replace duplicated versions in Propvis.
parent
42750e34
Changes
9
Hide whitespace changes
Inline
Side-by-side
OpenMesh/OMPropertyVisualizerBooleanT.cc
View file @
a9a0e559
...
...
@@ -50,6 +50,7 @@
#define OM_PROPERTY_VISUALIZER_BOOLEAN_CC
#include
"OMPropertyVisualizerBoolean.hh"
#include
<ACG/Utils/ColorConversion.hh>
template
<
typename
MeshT
>
OMPropertyVisualizerBoolean
<
MeshT
>::
OMPropertyVisualizerBoolean
(
MeshT
*
_mesh
,
PropertyInfo
_propertyInfo
)
...
...
@@ -74,8 +75,8 @@ void OMPropertyVisualizerBoolean<MeshT>::visualizeFaceProp(bool _setDrawMode)
MeshT
*
mesh
=
OMPropertyVisualizer
<
MeshT
>::
mesh
;
typename
MeshT
::
Color
colorTrue
,
colorFalse
;
colorTrue
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
booleanWidget
->
colorTrue
->
color
());
colorFalse
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
booleanWidget
->
colorFalse
->
color
());
colorTrue
=
ACG
::
to_Vec4f
(
booleanWidget
->
colorTrue
->
color
());
colorFalse
=
ACG
::
to_Vec4f
(
booleanWidget
->
colorFalse
->
color
());
OpenMesh
::
FPropHandleT
<
bool
>
prop
;
...
...
@@ -103,8 +104,8 @@ void OMPropertyVisualizerBoolean<MeshT>::visualizeEdgeProp(bool _setDrawMode)
MeshT
*
mesh
=
OMPropertyVisualizer
<
MeshT
>::
mesh
;
typename
MeshT
::
Color
colorTrue
,
colorFalse
;
colorTrue
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
booleanWidget
->
colorTrue
->
color
());
colorFalse
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
booleanWidget
->
colorFalse
->
color
());
colorTrue
=
ACG
::
to_Vec4f
(
booleanWidget
->
colorTrue
->
color
());
colorFalse
=
ACG
::
to_Vec4f
(
booleanWidget
->
colorFalse
->
color
());
OpenMesh
::
EPropHandleT
<
bool
>
prop
;
...
...
@@ -131,8 +132,8 @@ void OMPropertyVisualizerBoolean<MeshT>::visualizeHalfedgeProp(bool _setDrawMode
MeshT
*
mesh
=
OMPropertyVisualizer
<
MeshT
>::
mesh
;
typename
MeshT
::
Color
colorTrue
,
colorFalse
;
colorTrue
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
booleanWidget
->
colorTrue
->
color
());
colorFalse
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
booleanWidget
->
colorFalse
->
color
());
colorTrue
=
ACG
::
to_Vec4f
(
booleanWidget
->
colorTrue
->
color
());
colorFalse
=
ACG
::
to_Vec4f
(
booleanWidget
->
colorFalse
->
color
());
OpenMesh
::
HPropHandleT
<
bool
>
prop
;
...
...
@@ -160,8 +161,8 @@ void OMPropertyVisualizerBoolean<MeshT>::visualizeVertexProp(bool _setDrawMode)
MeshT
*
mesh
=
OMPropertyVisualizer
<
MeshT
>::
mesh
;
typename
MeshT
::
Color
colorTrue
,
colorFalse
;
colorTrue
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
booleanWidget
->
colorTrue
->
color
());
colorFalse
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
booleanWidget
->
colorFalse
->
color
());
colorTrue
=
ACG
::
to_Vec4f
(
booleanWidget
->
colorTrue
->
color
());
colorFalse
=
ACG
::
to_Vec4f
(
booleanWidget
->
colorFalse
->
color
());
OpenMesh
::
VPropHandleT
<
bool
>
prop
;
...
...
OpenMesh/OMPropertyVisualizerDoubleT.cc
View file @
a9a0e559
...
...
@@ -49,6 +49,7 @@
#define OM_PROPERTY_VISUALIZER_DOUBLE_CC
#include
<ACG/Utils/ColorConversion.hh>
#include
"OMPropertyVisualizerDouble.hh"
template
<
typename
MeshT
>
...
...
OpenMesh/OMPropertyVisualizerIntegerT.cc
View file @
a9a0e559
...
...
@@ -49,6 +49,7 @@
#define OM_PROPERTY_VISUALIZER_INTEGER_CC
#include
<ACG/Utils/ColorConversion.hh>
#include
"OMPropertyVisualizerInteger.hh"
template
<
typename
MeshT
,
typename
T
>
...
...
@@ -79,8 +80,8 @@ void OMPropertyVisualizerInteger<MeshT, T>::visualizeFaceProp(bool _setDrawMode)
IntegerWidget
*
integerWidget
=
static_cast
<
IntegerWidget
*>
(
PropertyVisualizer
::
widget
);
typename
MeshT
::
Color
colorMin
,
colorMax
;
colorMin
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
integerWidget
->
intMin
->
color
());
colorMax
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
integerWidget
->
intMax
->
color
());
colorMin
=
ACG
::
to_Vec4f
(
integerWidget
->
intMin
->
color
());
colorMax
=
ACG
::
to_Vec4f
(
integerWidget
->
intMax
->
color
());
// color coder in [0,1]
ACG
::
ColorCoder
cc
;
...
...
@@ -169,8 +170,8 @@ void OMPropertyVisualizerInteger<MeshT, T>::visualizeEdgeProp(bool _setDrawMode)
IntegerWidget
*
integerWidget
=
static_cast
<
IntegerWidget
*>
(
PropertyVisualizer
::
widget
);
typename
MeshT
::
Color
colorMin
,
colorMax
;
colorMin
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
integerWidget
->
intMin
->
color
());
colorMax
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
integerWidget
->
intMax
->
color
());
colorMin
=
ACG
::
to_Vec4f
(
integerWidget
->
intMin
->
color
());
colorMax
=
ACG
::
to_Vec4f
(
integerWidget
->
intMax
->
color
());
// color coder in [0,1]
ACG
::
ColorCoder
cc
;
...
...
@@ -260,8 +261,8 @@ void OMPropertyVisualizerInteger<MeshT, T>::visualizeHalfedgeProp(bool _setDrawM
IntegerWidget
*
integerWidget
=
static_cast
<
IntegerWidget
*>
(
PropertyVisualizer
::
widget
);
typename
MeshT
::
Color
colorMin
,
colorMax
;
colorMin
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
integerWidget
->
intMin
->
color
());
colorMax
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
integerWidget
->
intMax
->
color
());
colorMin
=
ACG
::
to_Vec4f
(
integerWidget
->
intMin
->
color
());
colorMax
=
ACG
::
to_Vec4f
(
integerWidget
->
intMax
->
color
());
// color coder in [0,1]
ACG
::
ColorCoder
cc
;
...
...
@@ -350,8 +351,8 @@ void OMPropertyVisualizerInteger<MeshT, T>::visualizeVertexProp(bool _setDrawMod
IntegerWidget
*
integerWidget
=
static_cast
<
IntegerWidget
*>
(
PropertyVisualizer
::
widget
);
typename
MeshT
::
Color
colorMin
,
colorMax
;
colorMin
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
integerWidget
->
intMin
->
color
());
colorMax
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
integerWidget
->
intMax
->
color
());
colorMin
=
ACG
::
to_Vec4f
(
integerWidget
->
intMin
->
color
());
colorMax
=
ACG
::
to_Vec4f
(
integerWidget
->
intMax
->
color
());
// color coder in [0,1]
ACG
::
ColorCoder
cc
;
...
...
OpenMesh/OMPropertyVisualizerVector2T.cc
View file @
a9a0e559
...
...
@@ -51,6 +51,7 @@
#include
"OMPropertyVisualizerVector2.hh"
#include
<OpenMesh/Core/Utils/Property.hh>
#include
<ACG/Utils/ColorConversion.hh>
template
<
typename
MeshT
,
typename
VectorType
>
OMPropertyVisualizerVector2
<
MeshT
,
VectorType
>::
OMPropertyVisualizerVector2
(
MeshT
*
_mesh
,
PropertyInfo
_propertyInfo
)
...
...
@@ -314,7 +315,7 @@ void OMPropertyVisualizerVector2<MeshT, VectorType>::visualizeFacePropAsStrokes(
lineNode
->
clear
();
typename
MeshT
::
Color
color
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
vectorWidget
->
lineColor
->
color
());
typename
MeshT
::
Color
color
=
ACG
::
to_Vec4f
(
vectorWidget
->
lineColor
->
color
());
OpenMesh
::
FPropHandleT
<
VectorType
>
prop
;
...
...
@@ -354,7 +355,7 @@ void OMPropertyVisualizerVector2<MeshT, VectorType>::visualizeEdgePropAsStrokes(
lineNode
->
clear
();
typename
MeshT
::
Color
color
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
vectorWidget
->
lineColor
->
color
());
typename
MeshT
::
Color
color
=
ACG
::
to_Vec4f
(
vectorWidget
->
lineColor
->
color
());
//TODO check if this also works if the property is Vec3f
OpenMesh
::
EPropHandleT
<
VectorType
>
prop
;
...
...
@@ -391,7 +392,7 @@ void OMPropertyVisualizerVector2<MeshT, VectorType>::visualizeHalfedgePropAsStro
lineNode
->
clear
();
typename
MeshT
::
Color
color
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
vectorWidget
->
lineColor
->
color
());
typename
MeshT
::
Color
color
=
ACG
::
to_Vec4f
(
vectorWidget
->
lineColor
->
color
());
//TODO check if this also works if the property is Vec3f
OpenMesh
::
HPropHandleT
<
VectorType
>
prop
;
...
...
@@ -426,7 +427,7 @@ void OMPropertyVisualizerVector2<MeshT, VectorType>::visualizeVertexPropAsStroke
lineNode
->
clear
();
typename
MeshT
::
Color
color
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
vectorWidget
->
lineColor
->
color
());
typename
MeshT
::
Color
color
=
ACG
::
to_Vec4f
(
vectorWidget
->
lineColor
->
color
());
//TODO check if this also works if the property is Vec3f
OpenMesh
::
VPropHandleT
<
VectorType
>
prop
;
...
...
OpenMesh/OMPropertyVisualizerVectorT.cc
View file @
a9a0e559
...
...
@@ -50,6 +50,7 @@
#define OM_PROPERTY_VISUALIZER_VECTOR_CC
#include
"OMPropertyVisualizerVector.hh"
#include
<ACG/Utils/ColorConversion.hh>
template
<
typename
MeshT
>
OMPropertyVisualizerVector
<
MeshT
>::
OMPropertyVisualizerVector
(
MeshT
*
_mesh
,
PropertyInfo
_propertyInfo
)
...
...
@@ -305,7 +306,7 @@ template <typename MeshT>
lineNode
->
clear
();
typename
MeshT
::
Color
color
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
vectorWidget
->
lineColor
->
color
());
typename
MeshT
::
Color
color
=
ACG
::
to_Vec4f
(
vectorWidget
->
lineColor
->
color
());
OpenMesh
::
FPropHandleT
<
typename
MeshT
::
Point
>
prop
;
...
...
@@ -344,7 +345,7 @@ void OMPropertyVisualizerVector<MeshT>::visualizeEdgePropAsStrokes()
lineNode
->
clear
();
typename
MeshT
::
Color
color
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
vectorWidget
->
lineColor
->
color
());
typename
MeshT
::
Color
color
=
ACG
::
to_Vec4f
(
vectorWidget
->
lineColor
->
color
());
//TODO check if this also works if the property is Vec3f
OpenMesh
::
EPropHandleT
<
typename
MeshT
::
Point
>
prop
;
...
...
@@ -380,7 +381,7 @@ void OMPropertyVisualizerVector<MeshT>::visualizeHalfedgePropAsStrokes()
lineNode
->
clear
();
typename
MeshT
::
Color
color
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
vectorWidget
->
lineColor
->
color
());
typename
MeshT
::
Color
color
=
ACG
::
to_Vec4f
(
vectorWidget
->
lineColor
->
color
());
//TODO check if this also works if the property is Vec3f
OpenMesh
::
HPropHandleT
<
typename
MeshT
::
Point
>
prop
;
...
...
@@ -414,7 +415,7 @@ void OMPropertyVisualizerVector<MeshT>::visualizeVertexPropAsStrokes()
lineNode
->
clear
();
typename
MeshT
::
Color
color
=
OMPropertyVisualizer
<
MeshT
>::
convertColor
(
vectorWidget
->
lineColor
->
color
());
typename
MeshT
::
Color
color
=
ACG
::
to_Vec4f
(
vectorWidget
->
lineColor
->
color
());
//TODO check if this also works if the property is Vec3f
OpenMesh
::
VPropHandleT
<
typename
MeshT
::
Point
>
prop
;
...
...
OpenVolumeMesh/OVMPropertyVisualizerBooleanT.cc
View file @
a9a0e559
...
...
@@ -51,6 +51,7 @@
#define OVM_PROPERTY_VISUALIZER_BOOLEAN_CC
#include
<ACG/Utils/ColorConversion.hh>
#include
"OVMPropertyVisualizerBoolean.hh"
template
<
typename
MeshT
>
...
...
@@ -74,8 +75,8 @@ void OVMPropertyVisualizerBoolean<MeshT>::visualizeProp(PropType prop, EntityIte
BooleanWidget
*
booleanWidget
=
static_cast
<
BooleanWidget
*>
(
PropertyVisualizer
::
widget
);
ACG
::
Vec4f
colorTrue
,
colorFalse
;
colorTrue
=
OVMPropertyVisualizer
<
MeshT
>::
convertColor
(
booleanWidget
->
colorTrue
->
color
());
colorFalse
=
OVMPropertyVisualizer
<
MeshT
>::
convertColor
(
booleanWidget
->
colorFalse
->
color
());
colorTrue
=
ACG
::
to_Vec4f
(
booleanWidget
->
colorTrue
->
color
());
colorFalse
=
ACG
::
to_Vec4f
(
booleanWidget
->
colorFalse
->
color
());
VolumeMeshObject
<
MeshT
>*
object
;
PluginFunctions
::
getObject
(
OVMPropertyVisualizer
<
MeshT
>::
mObjectID
,
object
);
...
...
OpenVolumeMesh/OVMPropertyVisualizerDoubleT.cc
View file @
a9a0e559
...
...
@@ -53,6 +53,12 @@
#include
"OVMPropertyVisualizerDouble.hh"
#include
<ACG/Utils/IColorCoder.hh>
#include
<ACG/Utils/LinearTwoColorCoder.hh>
#include
<ACG/Utils/ColorConversion.hh>
#include
<QObject>
template
<
typename
MeshT
>
OVMPropertyVisualizerDouble
<
MeshT
>::
OVMPropertyVisualizerDouble
(
MeshT
*
_mesh
,
int
objectID
,
PropertyInfo
_propertyInfo
)
:
OVMPropertyVisualizer
<
MeshT
>
(
_mesh
,
objectID
,
_propertyInfo
)
...
...
@@ -70,10 +76,8 @@ void OVMPropertyVisualizerDouble<MeshT>::visualizeProp(PropType prop, EntityIter
if
(
!
prop
)
return
;
DoubleWidget
*
doubleWidget
=
static_cast
<
DoubleWidget
*>
(
PropertyVisualizer
::
widget
);
ACG
::
Vec4f
colorMin
,
colorMax
;
colorMin
=
OVMPropertyVisualizer
<
MeshT
>::
convertColor
(
doubleWidget
->
doubleMin
->
color
());
colorMax
=
OVMPropertyVisualizer
<
MeshT
>::
convertColor
(
doubleWidget
->
doubleMax
->
color
());
ACG
::
Vec4f
colorMin
=
ACG
::
to_Vec4f
(
doubleWidget
->
doubleMin
->
color
());
ACG
::
Vec4f
colorMax
=
ACG
::
to_Vec4f
(
doubleWidget
->
doubleMax
->
color
());
// color coder in [0,1]
ACG
::
ColorCoder
cc
;
...
...
OpenVolumeMesh/OVMPropertyVisualizerIntegerT.cc
View file @
a9a0e559
...
...
@@ -52,6 +52,7 @@
#define OVM_PROPERTY_VISUALIZER_ITEGER_CC
#include
"OVMPropertyVisualizerInteger.hh"
#include
<ACG/Utils/ColorConversion.hh>
template
<
typename
MeshT
,
typename
T
>
OVMPropertyVisualizerInteger
<
MeshT
,
T
>::
OVMPropertyVisualizerInteger
(
MeshT
*
_mesh
,
int
objectID
,
PropertyInfo
_propertyInfo
,
bool
isUnsigned
)
...
...
@@ -83,8 +84,8 @@ void OVMPropertyVisualizerInteger<MeshT, T>::visualizeProp(PropType prop, Entity
IntegerWidget
*
integerWidget
=
static_cast
<
IntegerWidget
*>
(
PropertyVisualizer
::
widget
);
ACG
::
Vec4f
colorMin
,
colorMax
;
colorMin
=
OVMPropertyVisualizer
<
MeshT
>::
convertColor
(
integerWidget
->
intMin
->
color
());
colorMax
=
OVMPropertyVisualizer
<
MeshT
>::
convertColor
(
integerWidget
->
intMax
->
color
());
colorMin
=
ACG
::
to_Vec4f
(
integerWidget
->
intMin
->
color
());
colorMax
=
ACG
::
to_Vec4f
(
integerWidget
->
intMax
->
color
());
std
::
map
<
int
,
ACG
::
Vec4f
>
randomColor
;
...
...
OpenVolumeMesh/OVMPropertyVisualizerVectorT.cc
View file @
a9a0e559
...
...
@@ -51,6 +51,7 @@
#define OVM_PROPERTY_VISUALIZER_VECTOR_CC
#include
<ACG/Utils/ColorConversion.hh>
#include
"OVMPropertyVisualizerVector.hh"
...
...
@@ -222,7 +223,7 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeFacePropAsStrokes()
lineNode
->
clear
();
ACG
::
Vec4f
color
=
OVMPropertyVisualizer
<
MeshT
>::
convertColor
(
vectorWidget
->
lineColor
->
color
());
ACG
::
Vec4f
color
=
ACG
::
to_Vec4f
(
vectorWidget
->
lineColor
->
color
());
OpenVolumeMesh
::
FacePropertyT
<
ACG
::
Vec3d
>
prop
=
OVMPropertyVisualizer
<
MeshT
>::
mesh
->
template
request_face_property
<
ACG
::
Vec3d
>(
PropertyVisualizer
::
propertyInfo
.
propName
());
...
...
@@ -263,7 +264,7 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeEdgePropAsStrokes()
lineNode
->
clear
();
ACG
::
Vec4f
color
=
OVMPropertyVisualizer
<
MeshT
>::
convertColor
(
vectorWidget
->
lineColor
->
color
());
ACG
::
Vec4f
color
=
ACG
::
to_Vec4f
(
vectorWidget
->
lineColor
->
color
());
OpenVolumeMesh
::
EdgePropertyT
<
ACG
::
Vec3d
>
prop
=
OVMPropertyVisualizer
<
MeshT
>::
mesh
->
template
request_edge_property
<
ACG
::
Vec3d
>(
OVMPropertyVisualizer
<
MeshT
>::
propertyInfo
.
propName
());
if
(
!
prop
)
...
...
@@ -299,7 +300,7 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeHalfedgePropAsStrokes()
lineNode
->
clear
();
ACG
::
Vec4f
color
=
OVMPropertyVisualizer
<
MeshT
>::
convertColor
(
vectorWidget
->
lineColor
->
color
());
ACG
::
Vec4f
color
=
ACG
::
to_Vec4f
(
vectorWidget
->
lineColor
->
color
());
OpenVolumeMesh
::
HalfEdgePropertyT
<
ACG
::
Vec3d
>
prop
=
OVMPropertyVisualizer
<
MeshT
>::
mesh
->
template
request_halfedge_property
<
ACG
::
Vec3d
>(
OVMPropertyVisualizer
<
MeshT
>::
propertyInfo
.
propName
());
if
(
!
prop
)
...
...
@@ -334,7 +335,7 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeVertexPropAsStrokes()
lineNode
->
clear
();
ACG
::
Vec4f
color
=
OVMPropertyVisualizer
<
MeshT
>::
convertColor
(
vectorWidget
->
lineColor
->
color
());
ACG
::
Vec4f
color
=
ACG
::
to_Vec4f
(
vectorWidget
->
lineColor
->
color
());
OpenVolumeMesh
::
VertexPropertyT
<
ACG
::
Vec3d
>
prop
=
OVMPropertyVisualizer
<
MeshT
>::
mesh
->
template
request_vertex_property
<
ACG
::
Vec3d
>(
OVMPropertyVisualizer
<
MeshT
>::
propertyInfo
.
propName
());
if
(
!
prop
)
...
...
@@ -365,7 +366,7 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeCellPropAsStrokes()
lineNode
->
clear
();
ACG
::
Vec4f
color
=
OVMPropertyVisualizer
<
MeshT
>::
convertColor
(
vectorWidget
->
lineColor
->
color
());
ACG
::
Vec4f
color
=
ACG
::
to_Vec4f
(
vectorWidget
->
lineColor
->
color
());
OpenVolumeMesh
::
CellPropertyT
<
ACG
::
Vec3d
>
prop
=
OVMPropertyVisualizer
<
MeshT
>::
mesh
->
template
request_cell_property
<
ACG
::
Vec3d
>(
PropertyVisualizer
::
propertyInfo
.
propName
());
...
...
@@ -402,7 +403,7 @@ void OVMPropertyVisualizerVector<MeshT>::visualizeHalffacePropAsStrokes()
lineNode
->
clear
();
ACG
::
Vec4f
color
=
OVMPropertyVisualizer
<
MeshT
>::
convertColor
(
vectorWidget
->
lineColor
->
color
());
ACG
::
Vec4f
color
=
ACG
::
to_Vec4f
(
vectorWidget
->
lineColor
->
color
());
OpenVolumeMesh
::
HalfFacePropertyT
<
ACG
::
Vec3d
>
prop
=
OVMPropertyVisualizer
<
MeshT
>::
mesh
->
template
request_halfface_property
<
ACG
::
Vec3d
>(
PropertyVisualizer
::
propertyInfo
.
propName
());
...
...
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