using System;
using System.Xml;
using System.Collections;
using System.Drawing;
using CDAColladaNET.Import.Attributes;
// Copyright (c) 2005 Accelerated Pictures, LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
namespace ColladaNET.Import{
public class Collada : ColladaNode
{
public static XmlNamespaceManager NS;
#region Common Profile
public static readonly string kCommon = "COMMON";
public static readonly string kCommon_Param_A = "A";
public static readonly string kCommon_Param_AMBIENT = "AMBIENT";
public static readonly string kCommon_Param_ANGLE = "ANGLE";
public static readonly string kCommon_Param_ATTENUATION = "ATTENUATION";
public static readonly string kCommon_Param_ATTENUATION_SCALE = "ATTENUATION_SCALE";
public static readonly string kCommon_Param_B = "B";
public static readonly string kCommon_Param_BOTTOM = "BOTTOM";
public static readonly string kCommon_Param_COLOR = "COLOR";
public static readonly string kCommon_Param_DIFFUSE = "DIFFUSE";
public static readonly string kCommon_Param_EMISSION = "EMISSION";
public static readonly string kCommon_Param_FALLOFF = "FALLOFF";
public static readonly string kCommon_Param_FALLOFF_SCALE = "FALLOFF_SCALE";
public static readonly string kCommon_Param_G = "G";
public static readonly string kCommon_Param_LEFT = "LEFT";
public static readonly string kCommon_Param_P = "P";
public static readonly string kCommon_Param_Q = "Q";
public static readonly string kCommon_Param_R = "R";
public static readonly string kCommon_Param_REFLECTIVE = "REFLECTIVE";
public static readonly string kCommon_Param_REFLECTIVITY = "REFLECTIVITY";
public static readonly string kCommon_Param_RIGHT = "RIGHT";
public static readonly string kCommon_Param_S = "S";
public static readonly string kCommon_Param_SHININESS = "SHININESS";
public static readonly string kCommon_Param_SPECULAR = "SPECULAR";
public static readonly string kCommon_Param_T = "T";
public static readonly string kCommon_Param_TIME = "TIME";
public static readonly string kCommon_Param_TOP = "TOP";
public static readonly string kCommon_Param_TRANSPARENCY = "TRANSPARENCY";
public static readonly string kCommon_Param_TRANSPARENT = "TRANSPARENT";
public static readonly string kCommon_Param_U = "U";
public static readonly string kCommon_Param_V = "V";
public static readonly string kCommon_Param_W = "W";
public static readonly string kCommon_Param_X = "X";
public static readonly string kCommon_Param_Y = "Y";
public static readonly string kCommon_Param_YFOV = "YFOV";
public static readonly string kCommon_Param_Z = "Z";
public static readonly string kCommon_Param_ZFAR = "ZFAR";
public static readonly string kCommon_Param_ZNEAR = "ZNEAR";
public static readonly Color kCommon_Param_AMBIENT_Default = Color.FromArgb( 51 , 51 , 51 ); // 0.2 , 0.2 , 0.2
public static readonly float kCommon_Param_ATTENUATION_SCALE_Default = 1.0f;
public static readonly Color kCommon_Param_COLOR_Default = Color.FromArgb( 255 , 255 , 255 );
public static readonly Color kCommon_Param_DIFFUSE_Default = Color.FromArgb( 204 , 204 , 204 ); // 0.8 , 0.8 , 0.8
public static readonly Color kCommon_Param_EMISSION_Default = Color.FromArgb( 0 , 0 , 0 );
public static readonly float kCommon_Param_FALLOFF_SCALE_Default = 1.0f;
public static readonly Color kCommon_Param_REFLECTIVE_Default = Color.FromArgb( 0 , 0 , 0 );
public static readonly float kCommon_Param_REFLECTIVITY_Default = 0.0f;
public static readonly float kCommon_Param_SHININESS_Default = 0.0f;
public static readonly Color kCommon_Param_SPECULAR_Default = Color.FromArgb( 0 , 0 , 0 );
public static readonly float kCommon_Param_TRANSPARENCY_Default = 0.0f;
public static readonly Color kCommon_Param_TRANSPARENT_Default = Color.FromArgb( 0 , 0 , 0 );
public static readonly string kCommon_Program_BEZIER = "BEZIER";
public static readonly string kCommon_Program_BSPLINE = "BSPLINE";
public static readonly string kCommon_Program_CARDINAL = "CARDINAL";
public static readonly string kCommon_Program_HERMITE = "HERMITE";
public static readonly string kCommon_Program_LAMBERT = "LAMBERT";
public static readonly string kCommon_Program_LINEAR = "LINEAR";
public static readonly string kCommon_Program_ORTHOGRAPHIC = "ORTHOGRAPHIC";
public static readonly string kCommon_Program_PERSPECTIVE = "PERSPECTIVE";
public static readonly string kCommon_Program_PHONG = "PHONG";
public static readonly string kCommon_Code_FRAGMENT_PROGRAM = "FRAGMENT_PROGRAM";
public static readonly string kCommon_Code_VERTEX_PROGRAM = "VERTEX_PROGRAM";
public static readonly string kCommon_Entry_FRAGMENT_PROGRAM = "FRAGMENT_PROGRAM";
public static readonly string kCommon_Entry_VERTEX_PROGRAM = "VERTEX_PROGRAM";
public static readonly string kCommon_Input_BIND_SHAPE_NORMAL = "BIND_SHAPE_NORMAL";
public static readonly string kCommon_Input_BIND_SHAPE_POSITION = "BIND_SHAPE_POSITION";
public static readonly string kCommon_Input_COLOR = "COLOR";
public static readonly string kCommon_Input_IMAGE = "IMAGE";
public static readonly string kCommon_Input_INPUT = "INPUT";
public static readonly string kCommon_Input_INV_BIND_MATRIX = "INV_BIND_MATRIX";
public static readonly string kCommon_Input_JOINT = "JOINT";
public static readonly string kCommon_Input_JOINTS_AND_WEIGHTS = "JOINTS_AND_WEIGHTS";
public static readonly string kCommon_Input_NORMAL = "NORMAL";
public static readonly string kCommon_Input_OUTPUT = "OUTPUT";
public static readonly string kCommon_Input_POSITION = "POSITION";
public static readonly string kCommon_Input_TANGENT = "TANGENT";
public static readonly string kCommon_Input_TEXCOORD = "TEXCOORD";
public static readonly string kCommon_Input_TEXTURE = "TEXTURE";
public static readonly string kCommon_Input_UV = "UV";
public static readonly string kCommon_Input_VERTEX = "VERTEX";
public static readonly string kCommon_Input_WEIGHT = "WEIGHT";
public static readonly string kCommon_Channel_A = "A";
public static readonly string kCommon_Channel_ANGLE = "ANGLE";
public static readonly string kCommon_Channel_B = "B";
public static readonly string kCommon_Channel_G = "G";
public static readonly string kCommon_Channel_P = "P";
public static readonly string kCommon_Channel_Q = "Q";
public static readonly string kCommon_Channel_R = "R";
public static readonly string kCommon_Channel_S = "S";
public static readonly string kCommon_Channel_T = "T";
public static readonly string kCommon_Channel_TIME = "TIME";
public static readonly string kCommon_Channel_U = "U";
public static readonly string kCommon_Channel_V = "V";
#endregion
#region Maya Profile
public static readonly string kMaya_Program_LAMBERT = "LAMBERT";
#endregion
#region Constants
private static readonly string kCollada = "/dae:COLLADA";
private static readonly string kLibraries = "dae:library";
private static readonly string kScene = "dae:scene";
private static readonly string kAsset = "dae:asset";
#endregion
#region Accessors
private CDA.AssetAttr mAsset;
public CDA.AssetAttr Asset { get { return mAsset; } }
private CDA.LibrariesAttr mLibraries;
public CDA.LibrariesAttr Libraries { get { return mLibraries; } }
private CDA.SceneAttr mScene;
public CDA.SceneAttr Scene { get { return mScene; } }
private CDA.ResolverAttr mResolver;
public CDA.ResolverAttr Resolver { get { return mResolver; } }
#endregion
#region Constructors
public Collada( XmlNode source ) : base( source )
{
mAsset = new CDA.AssetAttr( source , kAsset );
mLibraries = new CDA.LibrariesAttr( source , kLibraries );
mScene = new CDA.SceneAttr( source , kScene );
mResolver = new CDA.ResolverAttr();
//
// prepare to resolve library items
//
for( int libraryIndex = 0 ; libraryIndex < Libraries.Length ; libraryIndex++ )
{
Library library = Libraries[libraryIndex];
for( int childIndex = 0 ; childIndex < library.LibraryContents.Length ; childIndex++ )
{
INamedNode child = library.LibraryContents[childIndex];
Resolver.Add( child );
}
}
}
public Collada( XmlDocument xmlDoc ) : this( xmlDoc.SelectSingleNode( kCollada , Collada.NS ) )
{
}
#endregion
}
}
|