9#include <istd/TRange.h>
12#include <imt3dgui/CShape3dBase.h>
13#include <imt3d/IMesh3d.h>
30 void SetColor(
const QVector3D& color);
31 void SetPointSelection(
const QPoint& selectionPoint,
bool clearPreviousSelection);
32 void SetBoxSelection(
const QRect& selectionRect,
bool clearPreviousSelection);
33 void SetCircleSelection(
const QRect& selectionRect,
bool clearPreviousSelection);
34 void ClearSelection();
36 void InvertSelection();
37 void DeleteSelection();
38 void SetInfoBoxEnabled(
bool isEnabled =
true);
42 virtual void UpdateShapeGeometry(
const istd::IChangeable::ChangeSet& changeSet)
override;
43 virtual void DrawShapeGl(QOpenGLShaderProgram& program, QOpenGLFunctions& functions)
override;
46 virtual void Draw(QPainter& painter)
override;
49 virtual QVector3D GetColor()
const override;
52 typedef std::set<int> Indices;
54 void SetRectSelection(
const QRect& selectionRect,
bool isCircle,
bool clearPreviousSelection);
55 template <
typename Po
intType>
void DeleteSelectionHelper(
imt3d::IMesh3d& mesh);
56 static bool IsPointWithin(
const QPoint& point,
const QRect& rect,
bool isCircle);
57 bool GetFacePointIntersection(
const QPoint& point, Indices& intersectedIndicies)
const;
58 bool GetFaceRectIntersections(
const QRect& rect,
bool isCircle, Indices& intersectedIndicies)
const;
59 static bool IsFaceRayIntersection(
60 const QVector3D& rayOrigin,
61 const QVector3D& rayDirection,
62 const QVector3D& trianglePoint1,
63 const QVector3D& trianglePoint2,
64 const QVector3D& trianglePoint3,
65 float& distanceToTriangle,
66 QVector3D& intersectionPoint);
67 void SelectVertices(Indices& intersectedIndicies,
bool clearPreviousSelection);
71 Indices m_selectedIndicies;
72 bool m_isInfoBoxEnabled;
74 static const QVector3D s_selectionColor;