CoastalME (Coastal Modelling Environment)
Simulates the long-term behaviour of complex coastlines
Loading...
Searching...
No Matches
CGeomMultiLine Class Reference

Geometry class used to represent co-incident lines (for profiles/polygon-to-polygon boundaries) More...

#include <multi_line.h>

Inherits CGeomLine.

Inherited by CGeomProfile.

Public Member Functions

 CGeomMultiLine (void)
 Constructor, no parameters.
 
 ~CGeomMultiLine (void) override
 Destructor.
 
void AppendLineSegment (void)
 Appends a new empty line segment.
 
void AppendLineSegment (vector< pair< int, int > > *)
 Appends a line segment which is supplied as a parameter.
 
int nGetNumLineSegments (void) const
 Appends a line segment which then inherits from the preceding line segments.
 
void TruncateLineSegments (int const)
 Cuts short the number of line segments.
 
void InsertLineSegment (int const)
 Inserts a line segment, inheriting from preceding line segments.
 
vector< vector< pair< int, int > > > prVVGetAllLineSegAfter (int const)
 Returns a vector of the line segments which succeed the specified line segment number.
 
void RemoveLineSegment (int const)
 Removes a line segment.
 
void AppendCoincidentProfileToLineSegments (pair< int, int > const)
 Appends a coincident profile pair to the CGeomMultiLine object's final line segment.
 
void AddCoincidentProfileToExistingLineSegment (int const, int const, int const)
 Adds a coincident profile to a pre-existing line segment of the CGeomMultiLine object.
 
vector< pair< int, int > > * pprVGetPairedCoincidentProfilesForLineSegment (int const)
 Returns a vector of pairs (a line segment)
 
int nGetCoincidentProfileForLineSegment (int const, int const) const
 Returns the numbers of coincident profiles.
 
int nGetNumCoincidentProfilesInLineSegment (int const)
 Returns the count of coincident profiles in a specified line segment.
 
bool bFindProfileInCoincidentProfilesOfLastLineSegment (int const)
 Returns true if the given profile number is amongst the coincident profiles of the CGeomMultiLine object's final line segment.
 
bool bFindProfileInCoincidentProfiles (int const)
 Returns true if the given profile number is one of the coincident profiles of the a specified line segment.
 
void GetMostCoastwardSharedLineSegment (int const, int &, int &)
 Finds the number of the most coastward line segment for which the two profiles are coincident, or -1 if they are not coincident. If they are coincident, also finds the line segment of the other profile.
 
int nGetProf (int const, int const) const
 Returns the profile number, given a line segment and the index of the co-incident profile for that line segment.
 
int nGetProfsLineSeg (int const, int const) const
 Returns the profile's own line segment, given a line segment and the index of the co-incident profile for that line segment.
 
void SetProfsLineSeg (int const, int const, int const)
 Sets a profile's own line segment number, given a line segment and the index of the co-incident profile for that line segment.
 
- Public Member Functions inherited from CGeomLine
 CGeomLine (void)
 Constructor.
 
 CGeomLine (CGeom2DPoint const *, CGeom2DPoint const *)
 Overloaded constructor with two points as parameters.
 
 CGeomLine (int const)
 Overloaded constructor with one parameter, this creates a given number of uninitialized points.
 
 ~CGeomLine (void) override
 Destructor.
 
double dGetXAt (int const)
 Returns the X value at a given place in the line.
 
double dGetYAt (int const)
 Returns the Y value at a given place in the line.
 
CGeom2DPointpPtGetAt (int const)
 Returns the point at a given place in the line.
 
- Public Member Functions inherited from CA2DShape
void Reverse (void)
 Reverses the sequence of points in the vector which represents this 2D polygon.
 
int nGetSize (void) const
 
void Resize (int const)
 Resizes the vector which represents this 2D shape.
 
void Append (CGeom2DPoint const *)
 Appends a point to this 2D shape.
 
void Append (double const, double const)
 Appends a point to this 2D shape.
 
void AppendIfNotAlready (double const, double const)
 Appends a point to this 2D shape only if it isn't already in the shape vector.
 
CGeom2DPointpPtBack (void)
 Returns the last element of this 2D shape.
 
CGeom2DPointoperator[] (int const)
 Operator to return one point of this 2D shape.
 
vector< CGeom2DPoint > * pPtVGetPoints (void)
 Returns the address of the vector which represents this 2D shape.
 

Private Attributes

vector< vector< pair< int, int > > > m_prVVLineSegment
 A vector of line segments, each element is a vector of pairs. The first of the pair is a co-incident profile number, the second is that profile's 'own' line segment number.
 

Additional Inherited Members

- Protected Member Functions inherited from CGeomLine
void Display (void) override
 Instantiates the pure virtual function in the abstract parent class, so that CGeomLine is not an abstract class.
 
- Protected Member Functions inherited from CA2DShape
 CA2DShape (void)
 Constructor.
 
virtual ~CA2DShape (void)
 Destructor.
 
void Clear (void)
 Clears this 2D shape.
 
- Protected Attributes inherited from CA2DShape
vector< CGeom2DPointm_VPoints
 The points which comprise the float-coordinate 2D shape.
 

Detailed Description

Geometry class used to represent co-incident lines (for profiles/polygon-to-polygon boundaries)

TODO 001 This is a more detailed description of the CGeomMultiLine class.

Author
David Favis-Mortlock
Andres Payo
Date
2025

Definition at line 34 of file multi_line.h.

Constructor & Destructor Documentation

◆ CGeomMultiLine()

CGeomMultiLine::CGeomMultiLine ( void )

Constructor, no parameters.

Definition at line 30 of file multi_line.cpp.

◆ ~CGeomMultiLine()

CGeomMultiLine::~CGeomMultiLine ( void )
override

Destructor.

Definition at line 35 of file multi_line.cpp.

Member Function Documentation

◆ AddCoincidentProfileToExistingLineSegment()

void CGeomMultiLine::AddCoincidentProfileToExistingLineSegment ( int const nSegment,
int const nProfile,
int const nLineSeg )

Adds a coincident profile to a pre-existing line segment of the CGeomMultiLine object.

Definition at line 141 of file multi_line.cpp.

Referenced by CSimulation::nInsertPointIntoProfilesIfNeededThenUpdate().

◆ AppendCoincidentProfileToLineSegments()

void CGeomMultiLine::AppendCoincidentProfileToLineSegments ( pair< int, int > const prIn)

Appends a coincident profile pair to the CGeomMultiLine object's final line segment.

Definition at line 133 of file multi_line.cpp.

Referenced by CSimulation::MergeProfilesAtFinalLineSegments(), CSimulation::nCreateProfile(), and CSimulation::nLocateAndCreateGridEdgeProfile().

◆ AppendLineSegment() [1/2]

void CGeomMultiLine::AppendLineSegment ( vector< pair< int, int > > * pprVIn)

Appends a line segment which is supplied as a parameter.

Definition at line 46 of file multi_line.cpp.

◆ AppendLineSegment() [2/2]

void CGeomMultiLine::AppendLineSegment ( void )

◆ bFindProfileInCoincidentProfiles()

bool CGeomMultiLine::bFindProfileInCoincidentProfiles ( int const nProfile)

Returns true if the given profile number is one of the coincident profiles of the a specified line segment.

Returns true if the given profile number is a coincident profile of any line segment of the CGeomMultiLine object

Definition at line 205 of file multi_line.cpp.

Referenced by CSimulation::nCreateAllPolygons().

◆ bFindProfileInCoincidentProfilesOfLastLineSegment()

bool CGeomMultiLine::bFindProfileInCoincidentProfilesOfLastLineSegment ( int const nProfile)

Returns true if the given profile number is amongst the coincident profiles of the CGeomMultiLine object's final line segment.

Definition at line 175 of file multi_line.cpp.

Referenced by CSimulation::CheckForIntersectingProfiles().

◆ GetMostCoastwardSharedLineSegment()

void CGeomMultiLine::GetMostCoastwardSharedLineSegment ( int const nOtherProfile,
int & nThisLineSegment,
int & nOtherLineSegment )

Finds the number of the most coastward line segment for which the two profiles are coincident, or -1 if they are not coincident. If they are coincident, also finds the line segment of the other profile.

Definition at line 224 of file multi_line.cpp.

Referenced by CSimulation::nCreateAllPolygons().

◆ InsertLineSegment()

void CGeomMultiLine::InsertLineSegment ( int const nSegment)

Inserts a line segment, inheriting from preceding line segments.

Definition at line 85 of file multi_line.cpp.

Referenced by CGeomProfile::bInsertIntersection().

◆ nGetCoincidentProfileForLineSegment()

int CGeomMultiLine::nGetCoincidentProfileForLineSegment ( int const nSegment,
int const nCoinc ) const

Returns the numbers of coincident profiles.

Definition at line 155 of file multi_line.cpp.

Referenced by CSimulation::nDoPolygonSharedBoundaries().

◆ nGetNumCoincidentProfilesInLineSegment()

int CGeomMultiLine::nGetNumCoincidentProfilesInLineSegment ( int const nSegment)

Returns the count of coincident profiles in a specified line segment.

Definition at line 169 of file multi_line.cpp.

Referenced by CSimulation::CreateRasterizedProfile(), CSimulation::nDoPolygonSharedBoundaries(), and CSimulation::TruncateProfileAndAppendNew().

◆ nGetNumLineSegments()

int CGeomMultiLine::nGetNumLineSegments ( void ) const

◆ nGetProf()

int CGeomMultiLine::nGetProf ( int const nSegment,
int const nCoinc ) const

Returns the profile number, given a line segment and the index of the co-incident profile for that line segment.

Definition at line 249 of file multi_line.cpp.

Referenced by CSimulation::TruncateProfileAndAppendNew().

◆ nGetProfsLineSeg()

int CGeomMultiLine::nGetProfsLineSeg ( int const nSegment,
int const nCoinc ) const

Returns the profile's own line segment, given a line segment and the index of the co-incident profile for that line segment.

Definition at line 255 of file multi_line.cpp.

Referenced by CSimulation::TruncateProfileAndAppendNew().

◆ pprVGetPairedCoincidentProfilesForLineSegment()

vector< pair< int, int > > * CGeomMultiLine::pprVGetPairedCoincidentProfilesForLineSegment ( int const nSegment)

◆ prVVGetAllLineSegAfter()

vector< vector< pair< int, int > > > CGeomMultiLine::prVVGetAllLineSegAfter ( int const nSegment)

Returns a vector of the line segments which succeed the specified line segment number.

Definition at line 117 of file multi_line.cpp.

Referenced by CSimulation::TruncateOneProfileRetainOtherProfile().

◆ RemoveLineSegment()

void CGeomMultiLine::RemoveLineSegment ( int const nSegment)

Removes a line segment.

Definition at line 127 of file multi_line.cpp.

◆ SetProfsLineSeg()

void CGeomMultiLine::SetProfsLineSeg ( int const nSegment,
int const nCoinc,
int const nLineSeg )

Sets a profile's own line segment number, given a line segment and the index of the co-incident profile for that line segment.

Definition at line 261 of file multi_line.cpp.

Referenced by CSimulation::TruncateProfileAndAppendNew().

◆ TruncateLineSegments()

void CGeomMultiLine::TruncateLineSegments ( int const nSize)

Cuts short the number of line segments.

Definition at line 79 of file multi_line.cpp.

Referenced by CSimulation::CreateRasterizedProfile(), and CSimulation::TruncateProfileAndAppendNew().

Field Documentation

◆ m_prVVLineSegment


The documentation for this class was generated from the following files: