Click or drag to resize
XDL

XncwTheater Class

이 레이어는 네트워크 중심작전(NCW:Network Centric Warfare) 시뮬레이션을 지원하는 theater 공간을 구현한 것이다. 사용자는 theater에 장비(equipment) 객체를 이 레이어를 통해 추가할 수 있으며, 몇몇 정보를 확인해 볼 수 있다. Theater에는 사용자가 원하는만큼 장비를 추가할 수 있지만, 사용자의 하드웨어에 제한을 받을 수 있다.
Inheritance Hierarchy

Namespace:  Pixoneer.NXDL.NNCW
Assembly:  NXDLncw (in NXDLncw.dll) Version: 2.0.3.31
Syntax
C#
public class XncwTheater : NXRenderLayer

The XncwTheater type exposes the following members.

Constructors
  NameDescription
Public methodXncwTheater
XncwTheater 객체를 생성하고 데이터 멤버를 초기화한다. 기본 생성자.
Top
Properties
  NameDescription
Public propertyAutoDelete
객체를 자동적으로 삭제할지 여부를 확인하거나 설정한다.
Public propertyLayerCapture
레이어의 갈무리 여부를 확인하거나 설정한다. (기본값: true)
(Overrides NXRenderLayerLayerCapture.)
Public propertyLayerVisible
레이어의 도시여부를 확인하거나 설정한다. (기본값: true)
(Overrides NXRenderLayerLayerVisible.)
Top
Methods
  NameDescription
Public methodAddEquipment
Theater에 장비 객체를 추가한다.
Public methodCode exampleAttachTo
PlanetView에 레이어를 첨부한다.
Public methodFixObjectDrawSize
대상 뷰에 도시할 때 장비 크기를 고정한다. Algor : distance(eye,objPos) * scaleFactor * objectSize scaleFactor sample: 0.0002
Public methodFreeEquipment
Theater에서 ID에 따른 장비 객체를 해제한다.
Public methodGetEquipment
Theater에서 ID에 따른 장비(equipment) 객체를 가져온다.
Public methodGetLayerID
레이어 ID를 가져온다.
(Overrides NXRenderLayerGetLayerID.)
Public methodInitialize
내부 초기화 함수. NXPlanetEngine이 자동 호출한다.
(Overrides NXRenderLayerInitialize.)
Public methodPick
대상 장비 객체를 선택하도록 선택(pick) 명령을 보낸다.
Public methodShowAllObjects
대상 view에서 모든 장비 객체를 보이거나 숨기도록 한다.
Public methodUpdateVisibleArea
사용자에 의해 theater 구성이 변경되면 theater의 영역을 갱신할 수 있도록 호출한다.
Top
Events
  NameDescription
Public eventOnPicked
객체가 선택될 때 호출된다.
Top
Examples
예제 #1:
partial class FormMain
{
    public Pixoneer.NXDL.NNCW.XncwTheater xncwTheater;
    private void InitializeComponent()
    {
        this.xncwTheater = new Pixoneer.NXDL.NNCW.XncwTheater();
        this.xncwTheater.OnPicked += new Pixoneer.NXDL.NNCW.XncwTheaterPickEvent(this.OnPicked);
    }

    private void FormMain_Load(object sender, EventArgs e)
    {
        xncwTheater.AttachTo(nxPlanetView);

        XAircraft plane = new MyAircraft();
        plane.LoadModel("f15.3ds");
        plane.SetPosition(pos);
        plane.SetYawPitchRoll(att.yaw, att.pitch, att.roll);

        // Add aircraft to theater
        XEquipObj obj = plane;
        int nUUID = 1;
        xncwTheater.AddEquipment(nUUID, ref obj);
    }

    public void FreePlane(int uuid)
    {
        xncwTheater.FreeEquipment(uuid);
    }

    private bool OnPicked(object sender, Pixoneer.NXDL.NXPlanet.NXPlanetDrawArgs e, long nUUID)   
    {
        if (this.listBoxSelectedPlanes.InvokeRequired)
        {
            Pixoneer.NXDL.NNCW.XncwTheaterPickEvent d = new Pixoneer.NXDL.NNCW.XncwTheaterPickEvent(OnPicked);
            this.Invoke(d, new object[] { sender, e, nUUID });
        }
        else
        {
            for (int i = 0; i < this.listBoxSelectedPlanes.Items.Count; i++)
            {
                if (this.listBoxSelectedPlanes.Items[i].ToString() == nUUID.ToString())
                    return true;
            }
            this.listBoxSelectedPlanes.Items.Add(nUUID);
        }
        return true;
    }

    private void nxPlanetView_MouseClick(object sender, MouseEventArgs e)
    {
        xncwTheater.Pick(nxPlanetView.GetHandle(),new XVertex2d(e.X, e.Y));
    }
}
See Also