50 #ifdef ENABLE_OPENVOLUMEMESH_SUPPORT
52 #define OVM_PROPERTY_VISUALIZER_BOOLEAN_CC
54 #include <ACG/Utils/ColorConversion.hh>
55 #include "OVMPropertyVisualizerBoolean.hh"
57 template <
typename MeshT>
58 OVMPropertyVisualizerBoolean<MeshT>::OVMPropertyVisualizerBoolean(MeshT* _mesh,
int objectID,
PropertyInfo _propertyInfo)
59 : OVMPropertyVisualizer<MeshT>(_mesh, objectID, _propertyInfo)
61 if (PropertyVisualizer::widget)
delete PropertyVisualizer::widget;
63 w->paramBool->setTitle(QString(
"Boolean Parameters of ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
64 PropertyVisualizer::widget = w;
68 template <
typename MeshT>
69 template <
typename PropType,
typename EntityIterator>
70 void OVMPropertyVisualizerBoolean<MeshT>::visualizeProp(PropType prop, EntityIterator e_begin, EntityIterator e_end)
78 colorTrue = ACG::to_Vec4f(booleanWidget->colorTrue->color());
79 colorFalse = ACG::to_Vec4f(booleanWidget->colorFalse->color());
84 for (EntityIterator e_it = e_begin ; e_it != e_end; ++e_it)
86 object->colors()[*e_it] = colorTrue;
88 object->colors()[*e_it] = colorFalse;
90 CALLS_TO_VISUALIZE_PROP(OVMPropertyVisualizerBoolean<MeshT>,
typename MeshT,
bool)
92 template <typename MeshT>
93 void OVMPropertyVisualizerBoolean<MeshT>::duplicateProperty()
95 OVMPropertyVisualizer<MeshT>::template duplicateProperty_stage1<bool>();
98 template <
typename MeshT>
99 void OVMPropertyVisualizerBoolean<MeshT>::setCellPropertyFromText(
unsigned int index, QString text)
101 MeshT* mesh = OVMPropertyVisualizer<MeshT>::mesh;
106 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
112 prop[ch] = this->strToBool(text);
115 template <
typename MeshT>
116 void OVMPropertyVisualizerBoolean<MeshT>::setFacePropertyFromText(
unsigned int index, QString text)
118 MeshT* mesh = OVMPropertyVisualizer<MeshT>::mesh;
123 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
129 prop[fh] = this->strToBool(text);
132 template <
typename MeshT>
133 void OVMPropertyVisualizerBoolean<MeshT>::setHalffacePropertyFromText(
unsigned int index, QString text)
135 MeshT* mesh = OVMPropertyVisualizer<MeshT>::mesh;
140 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
146 prop[hfh] = this->strToBool(text);
149 template <
typename MeshT>
150 void OVMPropertyVisualizerBoolean<MeshT>::setEdgePropertyFromText(
unsigned int index, QString text)
152 MeshT* mesh = OVMPropertyVisualizer<MeshT>::mesh;
157 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
163 prop[eh] = this->strToBool(text);
166 template <
typename MeshT>
167 void OVMPropertyVisualizerBoolean<MeshT>::setHalfedgePropertyFromText(
unsigned int index, QString text)
169 MeshT* mesh = OVMPropertyVisualizer<MeshT>::mesh;
174 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
180 prop[heh] = this->strToBool(text);
183 template <
typename MeshT>
184 void OVMPropertyVisualizerBoolean<MeshT>::setVertexPropertyFromText(
unsigned int index, QString text)
186 MeshT* mesh = OVMPropertyVisualizer<MeshT>::mesh;
191 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
197 prop[vh] = this->strToBool(text);
201 template <
typename MeshT>
202 QString OVMPropertyVisualizerBoolean<MeshT>::getPropertyText(
unsigned int index)
204 return OVMPropertyVisualizer<MeshT>::template getPropertyText_<bool>(index);
bool getObject(int _identifier, BSplineCurveObject *&_object)
Property classes for the different entity types.
Cellection of information about a property.