45 #define OVM_PROPERTY_VISUALIZER_MAT3X3_CC 47 #include <ACG/Utils/ColorConversion.hh> 48 #include "OVMPropertyVisualizerMatrix3x3.hh" 49 #include "ACG/Scenegraph/DrawModes.hh" 50 #include "EntityPosition.hh" 53 static std::array<Color4f, 3> dim_color {
59 template <
typename MeshT>
63 if (PropertyVisualizer::widget)
delete PropertyVisualizer::widget;
65 PropertyVisualizer::widget = w;
73 this->connect(w->lineWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
74 [
this](
double value) {lineNode->set_line_width(value);});
77 template <
typename MeshT>
85 template <
typename MeshT>
91 template<
typename MeshT>
92 template<
typename EntityTag,
typename Property,
typename EntityIterator>
103 double scaleFactor = getMatWidget()->getScaleFactor();
105 for (EntityIterator e_it = e_begin; e_it != e_end; ++e_it) {
106 Matrix3x3d mat = prop[*e_it];
107 Vec3d center_pos = ep(*e_it);
108 for (
unsigned char dim = 0; dim < 3; ++dim) {
110 lineNode->add_line(center_pos - v, center_pos + v);
111 lineNode->add_color(dim_color[dim]);
116 template<
typename MeshT>
117 template<
typename EntityTag,
typename Property,
typename EntityIterator>
127 for (EntityIterator e_it = e_begin; e_it != e_end; ++e_it) {
128 const Matrix3x3d &mat = prop[*e_it];
129 Vec3d center_pos = ep(*e_it);
132 boxesNode->setScaleFactor(getMatWidget()->getScaleFactor());
135 template<
typename MeshT>
136 template<
typename EntityTag,
typename EntityIterator>
144 throw VizException(
"Getting PropHandle from mesh for selected property failed.");
146 if (getMatWidget()->as_crosses->isChecked()) {
147 visualizeAsCrossesForEntity<EntityTag>(prop, e_begin, e_end);
148 }
else if (getMatWidget()->as_boxes->isChecked()) {
149 visualizeAsBoxesForEntity<EntityTag>(prop, e_begin, e_end);
153 template <
typename MeshT>
157 visualizeForEntity<OpenVolumeMesh::Entity::Cell>(m.cells_begin(), m.cells_end());
160 template <
typename MeshT>
164 visualizeForEntity<OpenVolumeMesh::Entity::Face>(m.faces_begin(), m.faces_end());
168 template <
typename MeshT>
172 visualizeForEntity<OpenVolumeMesh::Entity::HalfFace>(m.halffaces_begin(), m.halffaces_end());
175 template <
typename MeshT>
179 visualizeForEntity<OpenVolumeMesh::Entity::Edge>(m.edges_begin(), m.edges_end());
182 template <
typename MeshT>
186 visualizeForEntity<OpenVolumeMesh::Entity::HalfEdge>(m.halfedges_begin(), m.halfedges_end());
189 template <
typename MeshT>
193 visualizeForEntity<OpenVolumeMesh::Entity::Vertex>(m.vertices_begin(), m.vertices_end());
196 template <
typename MeshT>
void push_back(const BoxElement &_v)
STL conformance.
virtual void clear()
Clears a property.
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.
void clear() override
Clears a property.
QtTranslationManipulatorNode * manipulatorNode()
Cellection of information about a property.
void duplicateProperty() override
Duplicates a property.
QString getPropertyText(unsigned int index) override
Returns the value of a property in text form.
VectorT< double, 3 > Vec3d