Use polygon as data source for intersection

- Use polygon as data source for intersection
- Add padlock icon
- Show padlock icon on read only polygons
- Add Fwk function appendMenuItems() to make it possible to define context menu content in a PdmObject
- Context menu "Create Polygon Intersection"
- Updates to make visualization consistent with object and object collection enabled state
This commit is contained in:
Magne Sjaastad
2024-02-25 09:21:48 +01:00
committed by GitHub
parent 09151ec6af
commit 28d281e1d6
45 changed files with 632 additions and 125 deletions

View File

@@ -44,11 +44,37 @@ RigPolyLinesData::~RigPolyLinesData()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const std::vector<std::vector<cvf::Vec3d>>& RigPolyLinesData::polyLines() const
const std::vector<std::vector<cvf::Vec3d>>& RigPolyLinesData::rawPolyLines() const
{
return m_polylines;
}
//--------------------------------------------------------------------------------------------------
/// Returns the polylines with the last point equal to the first point if the polyline is closed
//--------------------------------------------------------------------------------------------------
const std::vector<std::vector<cvf::Vec3d>> RigPolyLinesData::completePolyLines() const
{
if ( !m_closePolyline ) return m_polylines;
std::vector<std::vector<cvf::Vec3d>> completeLines;
for ( const auto& polyline : m_polylines )
{
auto completePolyline = polyline;
if ( !polyline.empty() )
{
const double epsilon = 1e-6;
if ( polyline.front().pointDistance( polyline.back() ) > epsilon )
{
completePolyline.push_back( polyline.front() );
}
}
completeLines.push_back( completePolyline );
}
return completeLines;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------