private void method_0(bool bool_0) { double width = this.ienvelope_0.Width; double height = this.ienvelope_0.Height; if (width == 0) { this.ienvelope_0.Width = 1; this.ienvelope_1.Width = 1; } if (height == 0) { this.ienvelope_0.Height = 1; this.ienvelope_1.Height = 1; } IAffineTransformation2D affineTransformation2DClass = new AffineTransformation2D() as IAffineTransformation2D; affineTransformation2DClass.DefineFromEnvelopes(this.ienvelope_0, this.ienvelope_1); ITransform2D ielement0 = this.ielement_0 as ITransform2D; if (!bool_0) { ielement0.Transform(esriTransformDirection.esriTransformReverse, affineTransformation2DClass); } else { ielement0.Transform(esriTransformDirection.esriTransformForward, affineTransformation2DClass); } }
private static void ProcessTerminalVertex(Mesh <WavefrontVertex, EdgeBase, WavefrontFace> wavefrontMesh, IDictionary <VertexBase, List <WavefrontVertex> > wavefrontVertices, TVertex figureVertex) { // 1. Create two wavefront vertices at ±135° from the incident figure edge // 1a. Locate the figure edge // 1b. Determine the direction of the figure edge away from the vertex Direction2D figureEdgeDirection = new Direction2D(3, 4); // TODO: Temporary - need direction from the terminal vertex along the edge Direction2D direction1 = AffineTransformation2D.Rotation(Angle.DegreesToRadians(+135.0)).Transform(figureEdgeDirection); Vector2D vector1 = new Vector2D(direction1, Constants.Sqrt2); WavefrontVertex wavefrontVertex1 = new WavefrontVertex(figureVertex, vector1); InsertWavefrontVertex(wavefrontMesh, wavefrontVertices, wavefrontVertex1); Direction2D direction2 = AffineTransformation2D.Rotation(Angle.DegreesToRadians(-135.0)).Transform(figureEdgeDirection); Vector2D vector2 = new Vector2D(direction2, Constants.Sqrt2); WavefrontVertex wavefrontVertex2 = new WavefrontVertex(figureVertex, vector2); InsertWavefrontVertex(wavefrontMesh, wavefrontVertices, wavefrontVertex2); // 2. Label the incoming figureEdge (wavefront precursors) with the two vertices at the correct end // 3. Label all of the incoming triangulation edge (spoke precursors) with the first wavefront vertex // 4. Create wavefront edge between the two wavefront vertices // 5. Identify the quadrilateral based by the edge created in step 4 // 6. Split this quadrilateral by inserting a new edge from the second // of the two wavefront vertices. throw new NotImplementedException(); }
public override void OnMouseUp(int int_0, int int_1, int int_2, int int_3) { IEnvelope envelope; IGeometry geometry; if (CmdSelectTopology.m_TopologyGraph != null) { this.bool_0 = false; if (this.idisplayFeedback_0 != null) { IPoint mapPoint = this._context.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(int_2, int_3); IWorkspaceEdit editWorkspace = Yutai.ArcGIS.Common.Editor.Editor.EditWorkspace; editWorkspace.StartEditOperation(); try { IAffineTransformation2D affineTransformation2DClass = new AffineTransformation2D() as IAffineTransformation2D; affineTransformation2DClass.Move(mapPoint.X - this.ipoint_0.X, mapPoint.Y - this.ipoint_0.Y); CmdSelectTopology.m_TopologyGraph.TransformSelection(esriTransformDirection.esriTransformForward, affineTransformation2DClass, false); CmdSelectTopology.m_TopologyGraph.Post(out envelope); this._context.ActiveView.Refresh(); } catch (Exception exception) { CErrorLog.writeErrorLog(this, exception, ""); } editWorkspace.StopEditOperation(); this.idisplayFeedback_0 = null; } else if (this.inewEnvelopeFeedback_0 != null) { geometry = this.inewEnvelopeFeedback_0.Stop(); CmdSelectTopology.m_TopologyGraph.SelectByGeometry(3, esriTopologySelectionResultEnum.esriTopologySelectionResultNew, geometry); this.inewEnvelopeFeedback_0 = null; } else { double searchTolerance = 3.5; if (this._context.Hook is IApplication) { searchTolerance = (double)(this._context.Hook as IApplication).SelectionEnvironment.SearchTolerance; } searchTolerance = Common.ConvertPixelsToMapUnits((IActiveView)this._context.FocusMap, searchTolerance); geometry = ((ITopologicalOperator)this.ipoint_0).Buffer(searchTolerance); CmdSelectTopology.m_TopologyGraph.SelectByGeometry(1, esriTopologySelectionResultEnum.esriTopologySelectionResultNew, geometry); if (CmdSelectTopology.m_TopologyGraph.NodeSelection.Count == 0) { CmdSelectTopology.m_TopologyGraph.SelectByGeometry(2, esriTopologySelectionResultEnum.esriTopologySelectionResultNew, geometry); } } this._context.ActiveView.Refresh(); } }