Click or drag to resize
XDL

NXPlanetLayer Class

Planet 레이어 컨트롤의 렌더 레이어 사용자는 이 레이어를 이용하여 사용자 정의 도시요소를 구현할 수 있다.
Inheritance Hierarchy

Namespace:  Pixoneer.NXDL.NXPlanet
Assembly:  NXPlanet (in NXPlanet.dll) Version: 2.0.3.30
Syntax
C#
public class NXPlanetLayer : NXRenderLayer

The NXPlanetLayer type exposes the following members.

Constructors
  NameDescription
Public methodNXPlanetLayer
NXPlanetLayer 객체를 생성하고 데이터 멤버를 초기화한다. 기본 생성자.
Top
Properties
  NameDescription
Public propertyLayerCapture
레이어의 갈무리 여부를 확인하거나 설정한다. (기본값: true)
(Overrides NXRenderLayerLayerCapture.)
Public propertyLayerVisible
레이어의 도시여부를 확인하거나 설정한다. (기본값: true)
(Overrides NXRenderLayerLayerVisible.)
Top
Methods
  NameDescription
Public methodGetLayerID
레이어의 고유 ID를 가져온다.
(Overrides NXRenderLayerGetLayerID.)
Public methodInitialize
내부 초기화 함수이다. 이것은 NXPlanetEngine에 의해 오직 한번 호출 된다.
(Overrides NXRenderLayerInitialize.)
Public methodProcessScreenToWorldConvLevel
사용자가 ScreenToWorld 함수를 호출할 때 처리 수준을 제어하는 고급 함수이다.
Public methodScreenToWorld(Int32, XVertex2d, Int32)
스크린 좌표를 세계 좌표로 변환하며, 한 점을 입력으로 한다.
Public methodScreenToWorld(Int32, ArrayList, Int32)
스크린 좌표를 세계 좌표로 변환하며, 여러 점을 입력으로 한다.
Top
Events
  NameDescription
Public eventOnClear
레이어가 삭제 될 때 발생한다.
Public eventOnOrthoRender
Planet 레어이가 렌더링 하는 경우에 발생된다 사용자가 이 곳에 그리는 코드를 작성할 수 있다. 좌표계는 스크린 좌표계를 사용해야 한다.
Public eventOnRender
Planet 레어이가 렌더링 하는 경우에 발생된다 사용자가 이 곳에 그리는 코드를 작성할 수 있다. 좌표계는 세계 좌표계를 사용해야 한다.
Public eventOnWndProc
윈도우 메세지가 전달 될 때 발생한다.
Top
Examples
This is example #1:
partial class FormMain
{
    private Pixoneer.NXDL.NXPlanet.NXPlanetLayer nxPlanetLayer2D;

    private void InitializeComponent()
    {
        this.nxPlanetLayer2D = new Pixoneer.NXDL.NXPlanet.NXPlanetLayer();
        this.nxPlanetView2D.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
        this.nxPlanetView2D.Brightness = 1F;
        this.nxPlanetView2D.Contrast = 1F;
        this.nxPlanetView2D.Dock = System.Windows.Forms.DockStyle.Fill;
        this.nxPlanetView2D.EarthMode = Pixoneer.NXDL.NXPlanet.NXPlanetView.eEarthMode.Planet2D;
        this.nxPlanetView2D.LayoutMode = Pixoneer.NXDL.NXPlanet.NXPlanetView.eLayoutMode.Windows;
        this.nxPlanetView2D.Location = new System.Drawing.Point(0, 0);
        this.nxPlanetView2D.Name = "nxPlanetView2D";
        this.nxPlanetView2D.RelativeHeight = 1D;
        this.nxPlanetView2D.RelativeLeft = 0D;
        this.nxPlanetView2D.RelativeTop = 0D;
        this.nxPlanetView2D.RelativeWidth = 1D;
        this.nxPlanetView2D.Rotatable = true;
        this.nxPlanetView2D.Saturation = 1F;
        this.nxPlanetView2D.ShowGrid = true;
        this.nxPlanetView2D.ShowStatusInfo = false;
        this.nxPlanetView2D.Size = new System.Drawing.Size(406, 577);
        this.nxPlanetView2D.TabIndex = 0;
        this.nxPlanetView2D.ToolboxAreaUnit = Pixoneer.NXDL.NXPlanet.NXPlanetView.eToolboxAreaUnit.SquareMeter;
        this.nxPlanetView2D.ToolboxDistUnit = Pixoneer.NXDL.NXPlanet.NXPlanetView.eToolboxDistUnit.Meter;
        this.nxPlanetView2D.ToolboxMode = Pixoneer.NXDL.NXPlanet.NXPlanetView.eToolboxMode.None;
        this.nxPlanetView2D.ViewAreaID = -1;

        this.nxPlanetLayer2D.OnOrthoRender += new Pixoneer.NXDL.NXPlanet.NXPlanetLayerRenderEvent(this.nxPlanetLayer2D_OnOrthoRender);
        this.nxPlanetLayer2D.OnRender += new Pixoneer.NXDL.NXPlanet.NXPlanetLayerRenderEvent(this.nxPlanetLayer2D_OnRender);
    }

    private void FormMain_Load(object sender, EventArgs e)
    {
        nxPlanetView2D.AddRenderLayer(ref nxPlanetLayer2D);
    }

    private bool nxPlanetLayer2D_OnRender(object sender, Pixoneer.NXDL.NXPlanet.NXPlanetDrawArgs e)
    {
        XVertex3d pt1 = e.ViewArea.GeographicToWorld(XGeoPoint.FromDegree(37.0, 127.0, 0));
        XVertex3d pt2 = e.ViewArea.GeographicToWorld(XGeoPoint.FromDegree(38.0, 127.0, 0));

        e.Graphics.glDisable(Pixoneer.NXDL.NGR.XGraphics.GL_DEPTH_TEST);

        e.Graphics.glPushMatrix();
        e.Graphics.glTranslated(-e.WOS.x, -e.WOS.y, -e.WOS.z);

        e.Graphics.glColor3f(1.0f, 0.0f, 0.0f);
        e.Graphics.glBegin(Pixoneer.NXDL.NGR.XGraphics.GL_LINES);
        e.Graphics.glVertex3d(pt1.x, pt1.y, pt1.z);
        e.Graphics.glVertex3d(pt2.x, pt2.y, pt2.z);
        e.Graphics.glEnd();
        e.Graphics.glColor3f(1.0f, 1.0f, 1.0f);
        return default(bool);
    }

    private bool nxPlanetLayer2D_OnOrthoRender(object sender, Pixoneer.NXDL.NXPlanet.NXPlanetDrawArgs e)
    {
        e.Graphics.glBegin(Pixoneer.NXDL.NGR.XGraphics.GL_TRIANGLES);
        e.Graphics.glColor3f(0.9f, 0.0f, 0.0f);
        e.Graphics.glVertex3d(m_RButtonDownPos.x, m_RButtonDownPos.y, 0);
        e.Graphics.glColor3f(0.5f, 0.0f, 0.0f);
        e.Graphics.glVertex3d(m_RButtonDownPos.x + 10, m_RButtonDownPos.y - 20, 0);
        e.Graphics.glVertex3d(m_RButtonDownPos.x - 10, m_RButtonDownPos.y - 20, 0);
        e.Graphics.glEnd();
        return default(bool);
    }
}
See Also