📄 gispoint.cpp
字号:
///////////////////////////////////////////////////////////////////////////////
// This is a part of the CityStar Gis Foundation Classes C++ library.
// Copyright (C) 1996-1997 BeiDaSanQin Corporation
// All rights reserved.
//
// Create : WangQiang
// Update : Tian Yuan , 1997-02-20
// operator CPoint()
///////////////////////////////////////////////////////////////////////////////
// gispoint.cpp : implementation of the CGisPoint class
#include "stdafx.h"
#include "math.h"
#include "GisPoint.h"
///////////////////////////////////////////////////////////////////////////////
// Constructors:
///////////////////////////////////////////////////////////////////////////////
// Function Name : CGisPoint
// Function Code : None
// Function : Default constructor of the CGisPoint
// It constructs ( 0.0, 0.0 ) point.
// Input Parameters : None
// Output Parameters : None
// Type of Return Value : None
// Call : None
// Called By : None
// Globals : None
// Typical Usage:
// ......
// CGisPoint ptA;
// ......
CGisPoint::CGisPoint()
{
x=0.0;
y=0.0;
m_dwTag = 0;
}
///////////////////////////////////////////////////////////////////////////////
// Function Name : CGisPoint
// Function Code : None
// Function : Constructor of the CGisPoint class
// It constructs a point with a given coordinate
// Input Parameters : dInitX Specifies the abscissa
// dInitY Specifies the ordinate
// Output Parameters : None
// Type of Return Value : None
// Call : None
// Called By : None
// Globals : None
// Typical Usage:
// ......
// CGisPoint ptA( 100.0, 200.0 );
// ......
CGisPoint::CGisPoint( const double dInitX, const double dInitY )
{
x = dInitX;
y = dInitY;
m_dwTag = 0;
}
///////////////////////////////////////////////////////////////////////////////
// Function Name : CGisPoint
// Function Code : None
// Function : Constructor of the CGisPoint class
// It constructs a point with copying a given point.
// Input Parameters : point Specifies the given point
// Output Parameters : None
// Type of Return Value : None
// Call : None
// Called By : None
// Globals : None
// Typical Usage:
// ......
// POINT ptAnother;
// ......
// CGisPoint ptA( ptAnother );
// ......
CGisPoint::CGisPoint( const POINT& ptInitiation )
{
x = ( double )( ptInitiation.x );
y = ( double )( ptInitiation.y );
m_dwTag = 0;
}
///////////////////////////////////////////////////////////////////////////////
// Function Name : CGisPoint
// Function Code : None
// Function : Constructor of the CGisPoint class
// It constructs a point by copying a given point.
// Input Parameters : pInitiation Specifies the given point
// Output Parameters : None
// Type of Return Value : None
// Call : None
// Called By : None
// Globals : None
// Typical Usage:
// ......
// POINT *pptAnother;
// ......
// CGisPoint ptA( pptAnother );
// ......
CGisPoint::CGisPoint(const POINT *pInitiation )
{
x = ( double )( pInitiation->x );
y = ( double )( pInitiation->y );
m_dwTag = 0;
}
///////////////////////////////////////////////////////////////////////////////
// Function Name : CGisPoint
// Function Code : None
// Function : Constructor of the CGisPoint class
// It constructs a point with copying a given point.
// Input Parameters : ptIntiation Specifies the given point
// Output Parameters : None
// Type of Return Value : None
// Call : None
// Called By : None
// Globals : None
// Typical Usage:
// ......
// CPoint ptAnother;
// ......
// CGisPoint ptA( ptAnother );
// ......
//
CGisPoint::CGisPoint( const CPoint& ptInitiation )
{
x = ( double )( ptInitiation.x );
y = ( double )( ptInitiation.y );
m_dwTag = 0;
}
///////////////////////////////////////////////////////////////////////////////
// Function Name : CGisPoint
// Function Code : None
// Function : Constructor of the CGisPoint class
// It constructs a point with copying a given point.
// Input Parameters : pInitiation Specifies the given point
// Output Parameters : None
// Type of Return Value : None
// Call : None
// Called By : None
// Globals : None
// Typical Usage:
// ......
// CPoint *pptAnother;
// ......
// CGisPoint ptA( pptAnother );
// ......
CGisPoint::CGisPoint( const CPoint *pInitiation )
{
x = ( double )( pInitiation->x );
y = ( double )( pInitiation->y );
m_dwTag = 0;
}
///////////////////////////////////////////////////////////////////////////////
// Function Name : CGisPoint
// Function Code : None
// Function : Constructor of the CGisPoint class
// It constructs a point with copying a given point.
// Input Parameters : ptInitiation Specifies the given point
// Output Parameters : None
// Type of Return Value : None
// Call : None
// Called By : None
// Globals : None
// Typical Usage:
// ......
// CGisPoint ptA;
// ......
// CGisPoint ptB( ptA );
// ......
CGisPoint::CGisPoint( const CGisPoint& ptInitiation )
{
x = ptInitiation.x;
y = ptInitiation.y;
m_dwTag = ptInitiation.m_dwTag;
}
///////////////////////////////////////////////////////////////////////////////
// Function Name : CGisPoint
// Function Code : None
// Function : Constructor of the CGisPoint class
// It constructs a point with copying a given point.
// Input Parameters : pInitiation Specifies the given point
// Output Parameters : None
// Type of Return Value : None
// Call : None
// Called By : None
// Globals : None
// Typical Usage:
// ......
// CGisPoint *pptAnother;
// ......
// CGisPoint ptA( pptAnother );
// ......
CGisPoint::CGisPoint( const CGisPoint *pInitiation )
{
x = pInitiation->x;
y = pInitiation->y;
m_dwTag = pInitiation->m_dwTag;
}
///////////////////////////////////////////////////////////////////////////////
// Destructor:
///////////////////////////////////////////////////////////////////////////////
// Function Name : ~CGisPoint
// Function Code : None
// Function : Destructor of the CGisPoint class
// Input Parameters : None
// Output Parameters : None
// Type of Return Value : None
// Call : None
// Called By : None
// Globals : None
// Typical Usage : None
CGisPoint::~CGisPoint()
{
}
///////////////////////////////////////////////////////////////////////////////
// Attributes:
///////////////////////////////////////////////////////////////////////////////
// Function Name : GetX
// Function Code : None
// Function : Get the abscissa of a point
// Input Parameters : None
// Output Parameters : None
// Type of Return Value : double
// Call : None
// Called By : None
// Globals : None
// Typical Usage:
// ......
// CGisPoint ptA;
// double dX;
// ......
// dX = ptA.GetX();
// ......
double CGisPoint::GetX( ) const
{
return x;
}
///////////////////////////////////////////////////////////////////////////////
// Function Name : GetY
// Function Code : None
// Function : Get the ordinate of a point
// Input Parameters : None
// Output Parameters : None
// Type of Return Value : double
// Call : None
// Called By : None
// Globals : None
// Typical Usage:
// ......
// CGisPoint ptA;
// double dY;
// ......
// dY = ptA.GetY();
// ......
double CGisPoint::GetY( ) const
{
return y;
}
///////////////////////////////////////////////////////////////////////////////
// Function Name : SetPoint
// Function Code : None
// Function : Set a point with a given coordinate
// Input Parameters : dPointX Specifies the abscissa
// dPointY Specifies the ordinate
// Output Parameters : None
// Type of Return Value : void
// Call : None
// Called By : None
// Globals : None
// Typical Usage:
// .....
// CGisPoint ptA;
// ptA.SetPoint( 150.10, 320.60 );
// ......
void CGisPoint::SetPoint( const double dX, const double dY )
{
x = dX;
y = dY;
return;
}
///////////////////////////////////////////////////////////////////////////////
// Function Name : SetPoint
// Function Code : None
// Function : Set a point with a given point
// Input Parameters : ptAnother Specifies the given point
// Output Parameters : None
// Type of Return Value : void
// Call : None
// Called By : None
// Globals : None
// Typical Usage:
// ......
// POINT ptAnother;
// CGisPoint ptA;
// ......
// ptA.SetPoint( ptAnother );
// ......
void CGisPoint::SetPoint( const POINT& ptAnother )
{
x = ( double )( ptAnother.x );
y = ( double )( ptAnother.y );
return;
}
///////////////////////////////////////////////////////////////////////////////
// Function Name : SetPoint
// Function Code : None
// Function : Set a point with a given point
// Input Parameters : Point Specifies the given point
// Output Parameters : None
// Type of Return Value : void
// Call : None
// Called By : None
// Globals : None
// Typical Usage:
// ......
// CPoint ptAnother;
// CGisPoint ptA;
// ......
// ptA.SetPoint( ptAnother );
// ......
void CGisPoint::SetPoint( const CPoint& ptAnother )
{
x = ( double )( ptAnother.x );
y = ( double )( ptAnother.y );
return;
}
///////////////////////////////////////////////////////////////////////////////
// Function Name : SetPoint
// Function Code : None
// Function : Set a point with a given point
// Input Parameters : ptAnother
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -