SAGA API  v9.5
CSG_Shape_Polygon_Part Class Reference

#include <shapes.h>

Inheritance diagram for CSG_Shape_Polygon_Part:
CSG_Shape_Part

Public Member Functions

bool is_Clockwise (void)
 
double Get_Perimeter (void)
 
double Get_Area (void)
 
const TSG_PointGet_Centroid (void)
 
TSG_Polygon_Point_Relation Get_Point_Relation (const CSG_Point &p)
 
TSG_Polygon_Point_Relation Get_Point_Relation (double x, double y)
 
bool is_OnEdge (const CSG_Point &p)
 
bool is_OnEdge (double x, double y)
 
bool Contains (const CSG_Point &p)
 
bool Contains (double x, double y)
 
bool is_Neighbour (CSG_Shape_Polygon_Part *pPart, bool bSimpleCheck=true)
 
CSG_Lines Get_Shared_Edges (CSG_Shape_Polygon_Part *pPart, bool bVertexCheck, double Epsilon=0.)
 
double Get_Shared_Length (CSG_Shape_Polygon_Part *pPart, bool bVertexCheck, double Epsilon=0.)
 
double Get_Distance (TSG_Point Point, TSG_Point &Next)
 
- Public Member Functions inherited from CSG_Shape_Part
class CSG_Shape_PointsGet_Owner (void)
 
virtual bool Destroy (void)
 
virtual bool Assign (CSG_Shape_Part *pPart)
 
const CSG_RectGet_Extent (void)
 
int Get_Count (void) const
 
TSG_Point Get_Point (int iPoint, bool bAscending=true) const
 
int Add_Point (double x, double y)
 
int Add_Point (const CSG_Point &p)
 
int Add_Point (const CSG_Point_3D &p)
 
int Add_Point (const CSG_Point_4D &p)
 
int Ins_Point (double x, double y, int iPoint)
 
int Ins_Point (const CSG_Point &p, int iPoint)
 
int Ins_Point (const CSG_Point_3D &p, int iPoint)
 
int Ins_Point (const CSG_Point_4D &p, int iPoint)
 
int Set_Point (double x, double y, int iPoint)
 
int Set_Point (const CSG_Point &p, int iPoint)
 
int Set_Point (const CSG_Point_3D &p, int iPoint)
 
int Set_Point (const CSG_Point_4D &p, int iPoint)
 
int Del_Point (int iPoint)
 
void Set_Z (double z, int iPoint)
 
double Get_Z (int iPoint, bool bAscending=true) const
 
double Get_ZMin (void)
 
double Get_ZMax (void)
 
TSG_Point_3D Get_Point_Z (int iPoint, bool bAscending=true) const
 
void Set_M (double m, int iPoint)
 
double Get_M (int iPoint, bool bAscending=true) const
 
double Get_MMin (void)
 
double Get_MMax (void)
 
TSG_Point_4D Get_Point_ZM (int iPoint, bool bAscending=true) const
 
bool Add_Points (CSG_Shape_Part *pPoints, bool bAscending=true)
 
bool Revert_Points (void)
 

Protected Member Functions

 CSG_Shape_Polygon_Part (class CSG_Shape_Points *pOwner)
 
virtual ~CSG_Shape_Polygon_Part (void)
 
virtual void _Invalidate (void)
 
void _Update_Area (void)
 
void _Add_Edge_Points (CSG_Shape_Polygon_Part *pPart, const CSG_Point &P0, const CSG_Point &P1, CSG_Points &Part, double Epsilon)
 
bool _is_OnEdge (CSG_Shape_Polygon_Part *pPart, const CSG_Point &P, bool bVertex, double Epsilon)
 
- Protected Member Functions inherited from CSG_Shape_Part
 CSG_Shape_Part (class CSG_Shape_Points *pOwner)
 
virtual ~CSG_Shape_Part (void)
 
virtual bool _Alloc_Memory (int nPoints)
 
virtual void _Update_Extent (void)
 

Protected Attributes

int m_bClockwise
 
int m_bLake
 
double m_Area
 
double m_Perimeter
 
TSG_Point m_Centroid
 
- Protected Attributes inherited from CSG_Shape_Part
bool m_bUpdate
 
int m_nPoints
 
int m_nBuffer
 
double * m_Z
 
double m_ZMin
 
double m_ZMax
 
double * m_M
 
double m_MMin
 
double m_MMax
 
TSG_Pointm_Points
 
CSG_Rect m_Extent
 
class CSG_Shape_Pointsm_pOwner
 

Friends

class CSG_Shape_Polygon
 

Detailed Description

Definition at line 646 of file shapes.h.

Constructor & Destructor Documentation

◆ CSG_Shape_Polygon_Part()

CSG_Shape_Polygon_Part::CSG_Shape_Polygon_Part ( class CSG_Shape_Points pOwner)
protected

Definition at line 75 of file shape_polygon.cpp.

References BOOL3_NOTSET, m_bClockwise, and m_bLake.

◆ ~CSG_Shape_Polygon_Part()

CSG_Shape_Polygon_Part::~CSG_Shape_Polygon_Part ( void  )
protectedvirtual

Definition at line 83 of file shape_polygon.cpp.

Member Function Documentation

◆ _Add_Edge_Points()

void CSG_Shape_Polygon_Part::_Add_Edge_Points ( CSG_Shape_Polygon_Part pPart,
const CSG_Point P0,
const CSG_Point P1,
CSG_Points Part,
double  Epsilon 
)
protected

◆ _Invalidate()

void CSG_Shape_Polygon_Part::_Invalidate ( void  )
protectedvirtual

Reimplemented from CSG_Shape_Part.

Definition at line 92 of file shape_polygon.cpp.

References CSG_Shape_Part::_Invalidate(), BOOL3_NOTSET, m_bClockwise, and m_bLake.

◆ _is_OnEdge()

bool CSG_Shape_Polygon_Part::_is_OnEdge ( CSG_Shape_Polygon_Part pPart,
const CSG_Point P,
bool  bVertex,
double  Epsilon 
)
protected

◆ _Update_Area()

◆ Contains() [1/2]

bool CSG_Shape_Polygon_Part::Contains ( const CSG_Point p)

◆ Contains() [2/2]

◆ Get_Area()

double CSG_Shape_Polygon_Part::Get_Area ( void  )
inline

Definition at line 656 of file shapes.h.

Referenced by CSG_Shape_Polygon::Get_Area().

◆ Get_Centroid()

const TSG_Point& CSG_Shape_Polygon_Part::Get_Centroid ( void  )
inline

Definition at line 658 of file shapes.h.

Referenced by CSG_Shape_Polygon::Get_Centroid().

◆ Get_Distance()

double CSG_Shape_Polygon_Part::Get_Distance ( TSG_Point  Point,
TSG_Point Next 
)

◆ Get_Perimeter()

double CSG_Shape_Polygon_Part::Get_Perimeter ( void  )
inline

Definition at line 654 of file shapes.h.

Referenced by CSG_Shape_Polygon::Get_Perimeter().

◆ Get_Point_Relation() [1/2]

TSG_Polygon_Point_Relation CSG_Shape_Polygon_Part::Get_Point_Relation ( const CSG_Point p)

◆ Get_Point_Relation() [2/2]

◆ Get_Shared_Edges()

CSG_Lines CSG_Shape_Polygon_Part::Get_Shared_Edges ( CSG_Shape_Polygon_Part pPart,
bool  bVertexCheck,
double  Epsilon = 0. 
)

Returns all edge segments shared by this polygon part and the one provide by pPart argument as CSG_Lines object. If bVertexCheck is true vertices lying on edged segments of the other polygon part will be recognized. If not only vertices are taken into respect that are shared by both polygon parts. Due to precision issues the tolerance factor specified with Epsilon should be slightly greater than zero when using the bVertexCheck option.

Definition at line 479 of file shape_polygon.cpp.

References _Add_Edge_Points(), _is_OnEdge(), CSG_Points::Add(), CSG_Lines::Add(), CSG_Points::Get_Count(), CSG_Lines::Get_Count(), CSG_Shape_Part::Get_Count(), CSG_Shape_Part::Get_Extent(), CSG_Shape_Part::Get_Point(), is_OnEdge(), SSG_Point::x, and SSG_Point::y.

Referenced by CSG_Shape_Polygon::Get_Shared_Edges(), and Get_Shared_Length().

◆ Get_Shared_Length()

double CSG_Shape_Polygon_Part::Get_Shared_Length ( CSG_Shape_Polygon_Part pPart,
bool  bVertexCheck,
double  Epsilon = 0. 
)

This function requests the edges shared by this polygon part and the one provided by the pPart argument and returns the total length. See Get_Shared_Edges() for more details.

Definition at line 586 of file shape_polygon.cpp.

References CSG_Lines::Get_Length(), and Get_Shared_Edges().

◆ is_Clockwise()

bool CSG_Shape_Polygon_Part::is_Clockwise ( void  )
inline

Definition at line 652 of file shapes.h.

Referenced by CSG_Shape_Polygon::is_Clockwise().

◆ is_Neighbour()

bool CSG_Shape_Polygon_Part::is_Neighbour ( CSG_Shape_Polygon_Part pPart,
bool  bSimpleCheck = true 
)

Returns true if this polygon part touches that defined by pPart, i.e. the polygons share vertices or have vertices placed on the edge of the other. If bSimpleCheck is true the check is only performed until one shared vertex is found, which is sufficient if it can be expected that the polygons do not overlap.

Definition at line 357 of file shape_polygon.cpp.

References CSG_Shape_Part::Get_Count(), CSG_Shape_Part::Get_Extent(), CSG_Shape_Part::Get_Point(), Get_Point_Relation(), SG_POLYGON_POINT_Edge, SG_POLYGON_POINT_Interior, SG_POLYGON_POINT_Outside, and SG_POLYGON_POINT_Vertex.

◆ is_OnEdge() [1/2]

bool CSG_Shape_Polygon_Part::is_OnEdge ( const CSG_Point p)

Definition at line 268 of file shape_polygon.cpp.

References SSG_Point::x, and SSG_Point::y.

Referenced by Get_Shared_Edges(), and CSG_Shape_Polygon::is_OnEdge().

◆ is_OnEdge() [2/2]

bool CSG_Shape_Polygon_Part::is_OnEdge ( double  x,
double  y 
)

Friends And Related Function Documentation

◆ CSG_Shape_Polygon

friend class CSG_Shape_Polygon
friend

Definition at line 648 of file shapes.h.

Member Data Documentation

◆ m_Area

double CSG_Shape_Polygon_Part::m_Area
protected

Definition at line 685 of file shapes.h.

Referenced by _Update_Area().

◆ m_bClockwise

int CSG_Shape_Polygon_Part::m_bClockwise
protected

Definition at line 683 of file shapes.h.

Referenced by _Invalidate(), _Update_Area(), and CSG_Shape_Polygon_Part().

◆ m_bLake

int CSG_Shape_Polygon_Part::m_bLake
protected

◆ m_Centroid

TSG_Point CSG_Shape_Polygon_Part::m_Centroid
protected

Definition at line 687 of file shapes.h.

Referenced by _Update_Area().

◆ m_Perimeter

double CSG_Shape_Polygon_Part::m_Perimeter
protected

Definition at line 685 of file shapes.h.

Referenced by _Update_Area().


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