using System;
using System.Xml;
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 BoundingBox : SidNode
{
#region Constants
private static readonly string kMin = "/dae:min";
private static readonly string kMax = "/dae:max";
#endregion
#region Accessors
#region Min
private float [] mMin;
private bool mbMin = false;
public float [] Min
{
get
{
if ( mbMin == false )
{
string innerText = XmlSource.SelectSingleNode( kMin ).InnerText;
string [] tokens = innerText.Split( kWhitespace );
mMin = new float[3];
int axisIndex = 0;
for( int tokenIndex = 0 ; (tokenIndex < tokens.Length)&&( axisIndex < 3 ) ; tokenIndex++ )
{
mMin[axisIndex] = float.Parse( tokens[tokenIndex] );
}
mbMin = true;
}
return mMin;
}
}
#endregion
#region Max
private float [] mMax;
private bool mbMax = false;
public float [] Max
{
get
{
if ( mbMax == false )
{
string innerText = XmlSource.SelectSingleNode( kMax ).InnerText;
string [] tokens = innerText.Split( kWhitespace );
mMax = new float[3];
int axisIndex = 0;
for( int tokenIndex = 0 ; (tokenIndex < tokens.Length)&&( axisIndex < 3 ) ; tokenIndex++ )
{
mMax[axisIndex] = float.Parse( tokens[tokenIndex] );
}
mbMax = true;
}
return mMax;
}
}
#endregion
#endregion
#region Constructors
public BoundingBox( XmlNode source ) : base( source )
{
}
#endregion
}
}
|