mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2607 Add vertical dragging to well targets
This commit is contained in:
@@ -322,14 +322,35 @@ void RicPointTangentManipulatorPartMgr::updateManipulatorFromRay(const cvf::Ray*
|
||||
{
|
||||
if (!isManipulatorActive()) return;
|
||||
|
||||
cvf::Plane plane;
|
||||
plane.setFromPointAndNormal(m_origin, cvf::Vec3d::Z_AXIS);
|
||||
cvf::Vec3d newIntersection;
|
||||
newMouseRay->planeIntersect(plane, &newIntersection);
|
||||
if ( m_handleIds[m_currentHandleIndex] == HORIZONTAL_PLANE )
|
||||
{
|
||||
cvf::Plane plane;
|
||||
plane.setFromPointAndNormal(m_origin, cvf::Vec3d::Z_AXIS);
|
||||
cvf::Vec3d newIntersection;
|
||||
newMouseRay->planeIntersect(plane, &newIntersection);
|
||||
|
||||
cvf::Vec3d newOrigin = m_originOnStartManipulation + (newIntersection - m_initialPickPoint);
|
||||
cvf::Vec3d newOrigin = m_originOnStartManipulation + (newIntersection - m_initialPickPoint);
|
||||
|
||||
m_origin = newOrigin;
|
||||
m_origin = newOrigin;
|
||||
}
|
||||
else if ( m_handleIds[m_currentHandleIndex] == VERTICAL_AXIS )
|
||||
{
|
||||
cvf::Plane plane;
|
||||
cvf::Vec3d planeNormal = (newMouseRay->direction() ^ cvf::Vec3d::Z_AXIS) ^ cvf::Vec3d::Z_AXIS;
|
||||
double length = planeNormal.length();
|
||||
|
||||
if (length < 1e-5) return;
|
||||
|
||||
planeNormal /= length;
|
||||
plane.setFromPointAndNormal(m_initialPickPoint, planeNormal );
|
||||
cvf::Vec3d newIntersection;
|
||||
newMouseRay->planeIntersect(plane, &newIntersection);
|
||||
|
||||
cvf::Vec3d newOrigin = m_originOnStartManipulation;
|
||||
newOrigin.z() += (newIntersection.z() - m_initialPickPoint.z());
|
||||
|
||||
m_origin = newOrigin;
|
||||
}
|
||||
//m_tangent = newTangent;
|
||||
|
||||
clearAllGeometryAndParts();
|
||||
|
||||
@@ -149,11 +149,11 @@ private:
|
||||
const cvf::Color4f& color,
|
||||
const cvf::String& partName);
|
||||
private:
|
||||
size_t m_currentHandleIndex;
|
||||
std::vector< HandleType > m_handleIds; // These arrays have the same length
|
||||
cvf::Collection<cvf::Part> m_handleParts; // These arrays have the same length
|
||||
cvf::Collection<cvf::Part> m_activeDragModeParts;
|
||||
|
||||
|
||||
cvf::Vec3d m_origin;
|
||||
cvf::Vec3d m_tangent;
|
||||
double m_handleSize;
|
||||
@@ -162,7 +162,6 @@ private:
|
||||
cvf::Vec3d m_tangentOnStartManipulation;
|
||||
cvf::Vec3d m_originOnStartManipulation;
|
||||
|
||||
size_t m_currentHandleIndex;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user