mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3775 Annotations. Use depth in GUI, not z, for used defined polylines as well
This commit is contained in:
@@ -56,13 +56,4 @@ bool RimPolylinesAnnotation::isActive()
|
|||||||
return m_isActive();
|
return m_isActive();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
caf::PdmFieldHandle* RimPolylinesAnnotation::objectToggleField()
|
|
||||||
{
|
|
||||||
return &m_isActive;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -44,9 +44,6 @@ public:
|
|||||||
virtual cvf::ref<RigPolyLinesData> polyLinesData() = 0;
|
virtual cvf::ref<RigPolyLinesData> polyLinesData() = 0;
|
||||||
virtual bool isEmpty() = 0;
|
virtual bool isEmpty() = 0;
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual caf::PdmFieldHandle* objectToggleField() override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<bool> m_isActive;
|
caf::PdmField<bool> m_isActive;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -23,6 +23,22 @@
|
|||||||
|
|
||||||
#include "RigPolyLinesData.h"
|
#include "RigPolyLinesData.h"
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
/// Internal function
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::vector<cvf::Vec3d> xydToXyzVector(const std::vector<cvf::Vec3d>& xyds)
|
||||||
|
{
|
||||||
|
std::vector<cvf::Vec3d> xyzs;
|
||||||
|
for (const auto& xyd : xyds)
|
||||||
|
{
|
||||||
|
auto xyz = xyd;
|
||||||
|
xyz.z() = -xyd.z();
|
||||||
|
xyzs.push_back(xyz);
|
||||||
|
}
|
||||||
|
return xyzs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RimUserDefinedPolylinesAnnotation, "UserDefinedPolylinesAnnotation");
|
CAF_PDM_SOURCE_INIT(RimUserDefinedPolylinesAnnotation, "UserDefinedPolylinesAnnotation");
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -32,7 +48,7 @@ RimUserDefinedPolylinesAnnotation::RimUserDefinedPolylinesAnnotation()
|
|||||||
{
|
{
|
||||||
CAF_PDM_InitObject("PolyLines Annotation", ":/WellCollection.png", "", "");
|
CAF_PDM_InitObject("PolyLines Annotation", ":/WellCollection.png", "", "");
|
||||||
|
|
||||||
CAF_PDM_InitField(&m_points, "Points", {}, "", "", "", "");
|
CAF_PDM_InitField(&m_pointsXyd, "PointsXyd", {}, "", "", "", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -50,7 +66,7 @@ cvf::ref<RigPolyLinesData> RimUserDefinedPolylinesAnnotation::polyLinesData()
|
|||||||
{
|
{
|
||||||
cvf::ref<RigPolyLinesData> pld = new RigPolyLinesData;
|
cvf::ref<RigPolyLinesData> pld = new RigPolyLinesData;
|
||||||
std::vector<std::vector<cvf::Vec3d> > lines;
|
std::vector<std::vector<cvf::Vec3d> > lines;
|
||||||
lines.push_back(m_points());
|
lines.push_back(xydToXyzVector(m_pointsXyd()));
|
||||||
pld->setPolyLines(lines);
|
pld->setPolyLines(lines);
|
||||||
|
|
||||||
return pld;
|
return pld;
|
||||||
@@ -61,7 +77,7 @@ cvf::ref<RigPolyLinesData> RimUserDefinedPolylinesAnnotation::polyLinesData()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimUserDefinedPolylinesAnnotation::isEmpty()
|
bool RimUserDefinedPolylinesAnnotation::isEmpty()
|
||||||
{
|
{
|
||||||
return m_points().empty();
|
return m_pointsXyd().empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -69,7 +85,7 @@ bool RimUserDefinedPolylinesAnnotation::isEmpty()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimUserDefinedPolylinesAnnotation::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
void RimUserDefinedPolylinesAnnotation::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||||
{
|
{
|
||||||
uiOrdering.add(&m_points);
|
uiOrdering.add(&m_pointsXyd);
|
||||||
|
|
||||||
auto appearanceGroup = uiOrdering.addNewGroup("Line Appearance");
|
auto appearanceGroup = uiOrdering.addNewGroup("Line Appearance");
|
||||||
appearance()->uiOrdering(uiConfigName, *appearanceGroup);
|
appearance()->uiOrdering(uiConfigName, *appearanceGroup);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ protected:
|
|||||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<std::vector<Vec3d>> m_points;
|
caf::PdmField<std::vector<Vec3d>> m_pointsXyd;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user