コード例 #1
0
ファイル: OverlayOp.cs プロジェクト: xuchuansheng/GenXSource
		} // public Geometry GetResultGeometry( int funcCode )

		private void ComputeOverlay( int opCode )
		{
			// copy points from input Geometries.
			// This ensures that any Point geometries
			// in the input are considered for inclusion in the result set
			CopyPoints(0);
			CopyPoints(1);

			// node the input Geometries
			_arg[0].ComputeSelfNodes( _li );
			_arg[1].ComputeSelfNodes( _li );

			// compute intersections between edges of the two input geometries
			_arg[0].ComputeEdgeIntersections( _arg[1], _li, true );

			ArrayList baseSplitEdges = new ArrayList();
			_arg[0].ComputeSplitEdges( baseSplitEdges );
			_arg[1].ComputeSplitEdges( baseSplitEdges );
			ArrayList splitEdges = new ArrayList( baseSplitEdges );


			/* NO LONGER USED
			// if we are working in fixed precision, we must renode to ensure noding is complete
			if (makePrecise) {
			  List splitEdges1 = completeEdgeNoding(baseSplitEdges);
			  splitEdges = completeEdgeNoding(splitEdges1);
			} */

			// add the noded edges to this result graph
			InsertUniqueEdges( baseSplitEdges );

			ComputeLabelsFromDepths();
			ReplaceCollapsedEdges();

			//Trace.WriteLine( edgeList.ToString());

			_graph.AddEdges( _edgeList );
			ComputeLabelling();
			LabelIncompleteNodes();

			 // The ordering of building the result Geometries is important.
			 // Areas must be built before lines, which must be built before points.
			 // This is so that lines which are covered by areas are not included
			 // explicitly, and similarly for points.

			FindResultAreaEdges( opCode );
			CancelDuplicateResultEdges();
			PolygonBuilder polyBuilder = new PolygonBuilder( _geomFact, _cga );
			polyBuilder.Add( _graph );
			_resultPolyList = polyBuilder.GetPolygons();

			LineBuilder lineBuilder = new LineBuilder( this, _geomFact, _ptLocator );
			_resultLineList = lineBuilder.Build( opCode );

			PointBuilder pointBuilder = new PointBuilder( this, _geomFact, _ptLocator );
			_resultPointList = pointBuilder.Build( opCode );

			// gather the results from all calculations into a single Geometry for the result set
			_resultGeom = ComputeGeometry( _resultPointList, _resultLineList, _resultPolyList );
		} //private void ComputeOverlay( int opCode )
コード例 #2
0
        }         // public Geometry GetResultGeometry( int funcCode )

        private void ComputeOverlay(int opCode)
        {
            // copy points from input Geometries.
            // This ensures that any Point geometries
            // in the input are considered for inclusion in the result set
            CopyPoints(0);
            CopyPoints(1);

            // node the input Geometries
            _arg[0].ComputeSelfNodes(_li);
            _arg[1].ComputeSelfNodes(_li);

            // compute intersections between edges of the two input geometries
            _arg[0].ComputeEdgeIntersections(_arg[1], _li, true);

            ArrayList baseSplitEdges = new ArrayList();

            _arg[0].ComputeSplitEdges(baseSplitEdges);
            _arg[1].ComputeSplitEdges(baseSplitEdges);
            ArrayList splitEdges = new ArrayList(baseSplitEdges);


            /* NO LONGER USED
             * // if we are working in fixed precision, we must renode to ensure noding is complete
             * if (makePrecise) {
             * List splitEdges1 = completeEdgeNoding(baseSplitEdges);
             * splitEdges = completeEdgeNoding(splitEdges1);
             * } */

            // add the noded edges to this result graph
            InsertUniqueEdges(baseSplitEdges);

            ComputeLabelsFromDepths();
            ReplaceCollapsedEdges();

            //Trace.WriteLine( edgeList.ToString());

            _graph.AddEdges(_edgeList);
            ComputeLabelling();
            LabelIncompleteNodes();

            // The ordering of building the result Geometries is important.
            // Areas must be built before lines, which must be built before points.
            // This is so that lines which are covered by areas are not included
            // explicitly, and similarly for points.

            FindResultAreaEdges(opCode);
            CancelDuplicateResultEdges();
            PolygonBuilder polyBuilder = new PolygonBuilder(_geomFact, _cga);

            polyBuilder.Add(_graph);
            _resultPolyList = polyBuilder.GetPolygons();

            LineBuilder lineBuilder = new LineBuilder(this, _geomFact, _ptLocator);

            _resultLineList = lineBuilder.Build(opCode);

            PointBuilder pointBuilder = new PointBuilder(this, _geomFact, _ptLocator);

            _resultPointList = pointBuilder.Build(opCode);

            // gather the results from all calculations into a single Geometry for the result set
            _resultGeom = ComputeGeometry(_resultPointList, _resultLineList, _resultPolyList);
        }         //private void ComputeOverlay( int opCode )