45 #define OVM_PROPERTY_VISZUALIZTER_VECTOR_FIELD_DIFFERENCE_CC 47 #include "OVMPropertyVisualizerVectorFieldDifference.hh" 49 template <
typename MeshT>
52 propertyInfo2(_propertyInfo2)
54 if (PropertyVisualizer::widget)
delete PropertyVisualizer::widget;
56 w->paramVectorFieldDifference->setTitle(QString(
"3D Vector Field Difference Parameters of ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
57 PropertyVisualizer::widget = w;
62 template <
typename MeshT>
64 return (a - b).norm();
67 template <
typename MeshT>
69 return std::fabs(a.
norm() - b.
norm());
72 template <
typename MeshT>
74 double alpha = std::acos((a|b) / a.
norm() / b.
norm());
75 alpha -= std::floor((alpha + M_PI_4) / M_PI_2) * M_PI_2;
76 return std::fabs(alpha);
80 template<
typename Prop1,
typename Prop2,
float (*ScalarFn)(const
typename Prop1::value_type &, const
typename Prop2::value_type &)>
84 prop1(prop1), prop2(prop2) { }
86 template<
typename Handle>
87 float operator() (
const Handle &handle)
const {
88 return ScalarFn(prop1[handle], prop2[handle]);
96 template<
typename MeshT,
typename IteratorT,
typename PropHandle,
float (*ScalarFn)(const ACG::Vec3d &, const ACG::Vec3d &)>
97 void colorElements(
int objectID,
100 IteratorT primitivesBegin,
101 IteratorT primitivesEnd)
104 std::vector<float> scalars;
105 std::transform(primitivesBegin, primitivesEnd, std::back_inserter(scalars),
108 const float min = *std::min_element(scalars.begin(), scalars.end());
109 const float max = *std::max_element(scalars.begin(), scalars.end());
115 for (std::vector<float>::iterator i = scalars.begin(); i != scalars.end(); ++i)
116 object->colors()[*(primitivesBegin++)] = colCod(*i);
122 template <
typename MeshT>
132 if (w->vecFieldDiff_4symm_rb->isChecked())
134 if (w->vecFieldDiff_diff_norm_rb->isChecked())
136 if (w->vecFieldDiff_norm_diff_rb->isChecked())
146 template <
typename MeshT>
156 if (w->vecFieldDiff_4symm_rb->isChecked())
158 if (w->vecFieldDiff_diff_norm_rb->isChecked())
160 if (w->vecFieldDiff_norm_diff_rb->isChecked())
170 template <
typename MeshT>
180 if (w->vecFieldDiff_4symm_rb->isChecked())
182 if (w->vecFieldDiff_diff_norm_rb->isChecked())
184 if (w->vecFieldDiff_norm_diff_rb->isChecked())
194 template <
typename MeshT>
204 if (w->vecFieldDiff_4symm_rb->isChecked())
206 if (w->vecFieldDiff_diff_norm_rb->isChecked())
208 if (w->vecFieldDiff_norm_diff_rb->isChecked())
218 template <
typename MeshT>
228 if (w->vecFieldDiff_4symm_rb->isChecked())
230 if (w->vecFieldDiff_diff_norm_rb->isChecked())
232 if (w->vecFieldDiff_norm_diff_rb->isChecked())
242 template <
typename MeshT>
252 if (w->vecFieldDiff_4symm_rb->isChecked())
254 if (w->vecFieldDiff_diff_norm_rb->isChecked())
256 if (w->vecFieldDiff_norm_diff_rb->isChecked())
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.
Cellection of information about a property.
auto norm() const -> decltype(std::sqrt(std::declval< VectorT< S, DIM >>().sqrnorm()))
compute euclidean norm
Class for generating nice colors for doubles.