<div dir="ltr">This part of code in getVoronoiCellPolygon, :<div><br><div><div>QuadEdge startQE = qe; </div><div>    do {</div><div>//      Coordinate cc = circumcentre(qe);</div><div>        // use previously computed circumcentre</div>
<div>        Coordinate cc = qe.rot().orig().getCoordinate();</div><div>      cellPts.add(cc);</div><div>    </div><div>      // move to next triangle CW around vertex</div><div>      qe = qe.oPrev();</div><div>    } while (qe != startQE);</div>
</div><div><br></div><div style>The while condition is comparing two QuadEdge objects for not being equal. So i need to override the != operator. How do it do it?</div><div style><br></div><div style>Thanks,</div><div style>
Vishal</div><div style><br></div><div style><br></div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 12 July 2013 20:09, Sandro Santilli <span dir="ltr"><<a href="mailto:strk@keybit.net" target="_blank">strk@keybit.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, Jul 12, 2013 at 07:20:54PM +0530, vishal tiwari wrote:<br>
> The method quadedge::QuadEdgeSubdivision::getVoronoiCellPolygon, requires a<br>
> comparison between two QuadEdge objects for not being equal, that's y i<br>
> need a comparison operator. I think CompareTo is implemented in<br>
> Coordinate[1]. And the code is trying to compare the origin and destination<br>
> coordinates of two QuadEdge. Should i compare the origin and destination<br>
> coordinates to be same, in order to say the QuadEdges are the same?<br>
<br>
</div>You should strictly follow the JTS implementation, which is comparing<br>
Vertex objects, not QuadEdge nor Coordinates.<br>
It is getVertexUniqueEdges that you're talking about, right ?<br>
Vertex class has an `equals` method (with an override accepting a<br>
tolerance).<br>
<br>
--strk;<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> [1]<br>
> <a href="https://jts-topo-suite.svn.sourceforge.net/svnroot/jts-topo-suite/trunk/jts/java/src/com/vividsolutions/jts/geom/Coordinate.java" target="_blank">https://jts-topo-suite.svn.sourceforge.net/svnroot/jts-topo-suite/trunk/jts/java/src/com/vividsolutions/jts/geom/Coordinate.java</a><br>

><br>
> Thanks,<br>
> Vishal<br>
><br>
><br>
> On 12 July 2013 18:12, Sandro Santilli <<a href="mailto:strk@keybit.net">strk@keybit.net</a>> wrote:<br>
><br>
> > On Fri, Jul 12, 2013 at 05:45:14PM +0530, vishal tiwari wrote:<br>
> > > Hey,<br>
> > ><br>
> > > If i want to compare two QuadEdge objects, then i am comparing the<br>
> > elements<br>
> > > _rot , next , isAlive, data and vertex. As _rot and next are also<br>
> > > QuadEdges, it goes into a recursion, so i am using the break condition as<br>
> > > when both objects are NULL.<br>
> > ><br>
> > > I just want to know if this is the correct way to do it? I am asking this<br>
> > > because i am having troubles in overloading the != operator for QuadEdge.<br>
> ><br>
> > What do you need comparison operator for ?<br>
> > When needsd JTS implements a compareTo method, but I don't see any here:<br>
> ><br>
> > <a href="https://jts-topo-suite.svn.sourceforge.net/svnroot/jts-topo-suite/trunk/jts/java/src/com/vividsolutions/jts/triangulate/quadedge/QuadEdge.java" target="_blank">https://jts-topo-suite.svn.sourceforge.net/svnroot/jts-topo-suite/trunk/jts/java/src/com/vividsolutions/jts/triangulate/quadedge/QuadEdge.java</a><br>

> ><br>
> > --strk;<br>
_______________________________________________<br>
geos-devel mailing list<br>
<a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/geos-devel" target="_blank">http://lists.osgeo.org/mailman/listinfo/geos-devel</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Vishal Tiwari<div>Undergraduate</div><div>Computer Science and Engineering</div><div>Lab for Spatial Informatics</div><div>IIIT-Hyderabad</div>
</div>
</div>