mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user