Collada.cs :  » Game » RealmForge » ColladaNET » Import » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Game » RealmForge 
RealmForge » ColladaNET » Import » Collada.cs
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
  }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.