connectedelementpointfilter.cpp

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

CPP
61
字号
/********************************************************************** * $Id: ConnectedElementPointFilter.cpp,v 1.8 2004/07/02 13:28:28 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: ConnectedElementPointFilter.cpp,v $ * Revision 1.8  2004/07/02 13:28:28  strk * Fixed all #include lines to reflect headers layout change. * Added client application build tips in README. * * Revision 1.7  2004/04/05 06:35:14  ybychkov * "operation/distance" upgraded to JTS 1.4 * * Revision 1.6  2003/11/07 01:23:42  pramsey * Add standard CVS headers licence notices and copyrights to all cpp and h * files. * * **********************************************************************/#include <geos/opDistance.h>#include <typeinfo>namespace geos {/*** Returns a list containing a Coordinate from each Polygon, LineString, and Point* found inside the specified geometry. Thus, if the specified geometry is* not a GeometryCollection, an empty list will be returned.*/vector<const Coordinate*>* ConnectedElementPointFilter::getCoordinates(const Geometry *geom) {	vector<const Coordinate*> *points=new vector<const Coordinate*>();	ConnectedElementPointFilter *c=new ConnectedElementPointFilter(points);	geom->apply_ro(c);	delete c;	return points;}ConnectedElementPointFilter::ConnectedElementPointFilter(vector<const Coordinate*> *newPts){	pts=newPts;}void ConnectedElementPointFilter::filter_ro(const Geometry *geom) {	if ((typeid(*geom)==typeid(Point)) ||		(typeid(*geom)==typeid(LineString)) ||		(typeid(*geom)==typeid(Polygon)))			pts->push_back(geom->getCoordinate());}}

⌨️ 快捷键说明

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