multipoint.cpp

来自「一个很好的vc底层代码」· C++ 代码 · 共 152 行

CPP
152
字号
/********************************************************************** * $Id: MultiPoint.cpp,v 1.25 2004/09/13 12:39:14 strk Exp $ * * GEOS - Geometry Engine Open Source * http://geos.refractions.net * * Copyright (C) 2001-2002 Vivid Solutions Inc. * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public Licence as published * by the Free Software Foundation.  * See the COPYING file for more information. * ********************************************************************** * $Log: MultiPoint.cpp,v $ * Revision 1.25  2004/09/13 12:39:14  strk * Made Point and MultiPoint subject to Validity tests. * * Revision 1.24  2004/09/12 03:51:27  pramsey * Casting changes to allow OS/X compilation. * * Revision 1.23  2004/07/22 08:45:50  strk * Documentation updates, memory leaks fixed. * * Revision 1.22  2004/07/08 19:34:49  strk * Mirrored JTS interface of CoordinateSequence, factory and * default implementations. * Added DefaultCoordinateSequenceFactory::instance() function. * * Revision 1.21  2004/07/06 17:58:22  strk * Removed deprecated Geometry constructors based on PrecisionModel and * SRID specification. Removed SimpleGeometryPrecisionReducer capability * of changing Geometry's factory. Reverted Geometry::factory member * to be a reference to external factory. * * Revision 1.20  2004/07/05 10:50:20  strk * deep-dopy construction taken out of Geometry and implemented only * in GeometryFactory. * Deep-copy geometry construction takes care of cleaning up copies * on exception. * Implemented clone() method for CoordinateSequence * Changed createMultiPoint(CoordinateSequence) signature to reflect * copy semantic (by-ref instead of by-pointer). * Cleaned up documentation. * * Revision 1.19  2004/07/02 13:28:26  strk * Fixed all #include lines to reflect headers layout change. * Added client application build tips in README. * * Revision 1.18  2004/07/01 14:12:44  strk * * Geometry constructors come now in two flavors: * 	- deep-copy args (pass-by-reference) * 	- take-ownership of args (pass-by-pointer) * Same functionality is available through GeometryFactory, * including buildGeometry(). * * Revision 1.17  2004/06/28 21:11:43  strk * Moved getGeometryTypeId() definitions from geom.h to each geometry module. * Added holes argument check in Polygon.cpp. * * Revision 1.16  2004/05/07 09:05:13  strk * Some const correctness added. Fixed bug in GeometryFactory::createMultiPoint * to handle NULL CoordinateSequence. * * Revision 1.15  2004/04/20 08:52:01  strk * GeometryFactory and Geometry const correctness. * Memory leaks removed from SimpleGeometryPrecisionReducer * and GeometryFactory. * * Revision 1.14  2004/04/01 10:44:33  ybychkov * All "geom" classes from JTS 1.3 upgraded to JTS 1.4 * * Revision 1.13  2004/03/31 07:50:37  ybychkov * "geom" partially upgraded to JTS 1.4 * * Revision 1.12  2003/11/07 01:23:42  pramsey * Add standard CVS headers licence notices and copyrights to all cpp and h * files. * * **********************************************************************/#include <geos/geom.h>#include <geos/operation.h>namespace geos {/*** Constructs a <code>MultiPoint</code>.** @param  newPoints*	the <code>Point</code>s for this <code>MultiPoint</code>,*	or <code>null</code> or an empty array to create the empty* 	geometry.*	Elements may be empty <code>Point</code>s,*	but not <code>null</code>s.**	Constructed object will take ownership of*	the vector and its elements.*/MultiPoint::MultiPoint(vector<Geometry *> *newPoints, const GeometryFactory *factory): GeometryCollection(newPoints,factory){}MultiPoint::~MultiPoint(){}int MultiPoint::getDimension() const {	return 0;}int MultiPoint::getBoundaryDimension() const {	return Dimension::False;}string MultiPoint::getGeometryType() const {	return "MultiPoint";}Geometry* MultiPoint::getBoundary() const {	return getFactory()->createGeometryCollection(NULL);}bool MultiPoint::isSimple() const {	IsSimpleOp iso;	Geometry *in = toInternalGeometry(this);	bool issimple = iso.isSimple((MultiPoint *)in);	if ( (MultiPoint *)in != this ) delete(in);	return issimple;}//bool MultiPoint::isValid() const { return true; }boolMultiPoint::equalsExact(const Geometry *other, double tolerance) const{    if (!isEquivalentClass(other)) {      return false;    }	return GeometryCollection::equalsExact(other,tolerance);  }const Coordinate* MultiPoint::getCoordinate(int n) const {	return ((Point *)(*geometries)[n])->getCoordinate();}GeometryTypeIdMultiPoint::getGeometryTypeId() const {	return GEOS_MULTIPOINT;}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?