////////////////////////////////////////////////////////////
//
//ファイル名:   feature.js
//機能		:	地物管理
//依存		:	main.js
//バージョン:　 2.0.0.1
//更新日時	:　 2006.08.01
//更新者	:	kawame
//
////////////////////////////////////////////////////////////


function FeatureManager(gis)
{
	var gisMain 		= gis;
	
	// データ型定義
	this.dataTypeDefinition		= new DataType();

	// 空間属性定義
	this.primitiveDefinition	= new Primitive();
	
	// 編集対象地物の型のリスト

	this.editTypes				= new Array();

	// 選択候補の地物のリスト

	this.candidateFeatures		= new Array();

	// 選択地物のリスト

	this.selectedFeatures		= new Array();
	
	// 検索
	// TODO パラメータの定義
	this.getFeature = function()
	{
		return null;
	}
	
	// 地物追加
	this.addFeature = function(feature)
	{
		return null;
	}
	
	// 地物削除
	this.deleteFeature = function(feature)
	{
		return false;
	}
	
	// 地物更新
	this.updateFeature = function(feature)
	{
		return false;
	}
}

//
//	地物の型情報
//
function FeatureType()
{
	// 名前
	this.name		= "";
	
	// 表示用タイトル
	this.title		= "";
	
	// 属性項目定義情報
	this.attributes	= new Array();
	
	// 空間属性種別（複数可）

	this.primitives	= new Array();
}

//
//	地物の属性定義情報
//
function FeatureAttributeType()
{
	// 名前
	this.name		= "";
	
	// 表示用タイトル
	this.title		= "";
	
	// データ型

	this.dataType	= "";
}

//
//	データ型

//
function DataType()
{
	// 整数型

	this.INT		= "int";
	
	// 浮動小数点数型

	this.DOUBLE		= "double";
	
	// 数値型（汎用）

	this.NUMBER		= "number";
	
	// 文字型
	this.STRING		= "string";
	
	// 日時型
	this.DATETIME	= "datetime";
}

//
//	地物インスタンス
//
function Feature()
{
	// 地物型

	this.type		= null;
	
	// 地物ID
	this.instanceId	= "";
	
	// 属性
	this.attributes	= new Array();
	
	// 空間属性種別
	this.primitive	= "";
	
	// 空間属性
	this.spatialInfo	= null;
}

//
//	地物インスタンス属性
//
function FeatureAttribute()
{
	// 属性定義情報
	this.type		= null;

	// 属性値
	this.value		= "";
}

//
//	空間属性種別
//
function Primitive()
{
	// 点
	this.POINT		= "point";
	
	// 線

	this.CURVE		= "curve";
	
	// 面
	this.SURFACE	= "surface";
	
	// テキスト

	this.TEXT		= "text";
}
