using System;
using System.Collections.Generic;
using System.Text;
using gr2lib.core.interfaces;
using System.Diagnostics;
using System.ComponentModel;
using gr2lib.core.ui.typeeditors;
using System.Drawing.Design;
namespace gr2lib.core.coretypes.implementation
{
#region public class ArtToolInfoVersion
///
/// ArtToolInfoVersion class
///
[Browsable(true)]
[TypeConverter(typeof(ExpandableObjectConverter))]
public class ArtToolInfoVersion : IArtToolInfoVersion
{
///
/// default constructor
///
public ArtToolInfoVersion()
{
this.Major = 0;
this.Minor = 0;
}
///
/// default constructor - specify: Major, Minor
///
public ArtToolInfoVersion(int Major, int Minor)
{
this.Major = Major;
this.Minor = Minor;
}
private int _Major;
///
/// Get/set the major
///
[RefreshPropertiesAttribute(RefreshProperties.All)]
[Browsable(true)]
public int Major
{
get { return _Major; }
set { _Major = value; }
}
private int _Minor;
///
/// Get/set the minor
///
[RefreshPropertiesAttribute(RefreshProperties.All)]
[Browsable(true)]
public int Minor
{
get { return _Minor; }
set { _Minor = value; }
}
///
/// string representation
///
///
public override string ToString()
{
return string.Format("{0}.{1}", Major, Minor);
}
}
#endregion
#region public class ArtToolInfoVector
///
/// ArtToolInfoVector class
///
[Browsable(true)]
[TypeConverter(typeof(ExpandableObjectConverter))]
public class ArtToolInfoVector : IArtToolInfoVector
{
private Vector3 _Origin;
private Vector3 _Right;
private Vector3 _Up;
private Vector3 _Back;
///
/// default constructor
///
public ArtToolInfoVector()
{
this.Origin = new Vector3();
this.Right = new Vector3();
this.Up = new Vector3();
this.Back = new Vector3();
}
///
/// default constructor - specify: Origin, Right, Up, Back
///
public ArtToolInfoVector(Vector3 Origin, Vector3 Right, Vector3 Up, Vector3 Back)
{
this.Origin = Origin;
this.Right = Right;
this.Up = Up;
this.Back = Back;
}
///
/// Get/set the Origin
///
[RefreshPropertiesAttribute(RefreshProperties.All)]
public Vector3 Origin { get { return _Origin; } set { _Origin = value; } }
///
/// Get/set the Right
///
[RefreshPropertiesAttribute(RefreshProperties.All)]
public Vector3 Right { get { return _Right; } set { _Right = value; } }
///
/// Get/set the Up
///
[RefreshPropertiesAttribute(RefreshProperties.All)]
public Vector3 Up { get { return _Up; } set { _Up = value; } }
///
/// Get/set the Back
///
[RefreshPropertiesAttribute(RefreshProperties.All)]
public Vector3 Back { get { return _Back; } set { _Back = value; } }
///
/// get string representation
///
///
public override string ToString()
{
string format = "0.00";
string origin = "{" + string.Format("{0:" + format + "},{1:" + format + "},{2:" + format + "}", Origin.x, Origin.y, Origin.z) + "}";
string right = "{" + string.Format("{0:" + format + "},{1:" + format + "},{2:" + format + "}", Right.x, Right.y, Right.z) + "}";
string up = "{" + string.Format("{0:" + format + "},{1:" + format + "},{2:" + format + "}", Up.x, Up.y, Up.z) + "}";
string back = "{" + string.Format("{0:" + format + "},{1:" + format + "},{2:" + format + "}", Back.x, Back.y, Back.z) + "}";
return string.Format("{0} ; {1} ; {2} ; {3}", origin, right, up, back);
}
}
#endregion
///
/// ArtToolInfo class
///
//[Category("Art Tool Info")]
[Browsable(true)]
[TypeConverter(typeof(ExpandableObjectConverter))]
public class ArtToolInfo : IArtToolInfo
{
private string _fromArtToolName;
private float _unitsPerMeter;
///
/// default constructor
///
public ArtToolInfo()
{
this.FromArtToolName = "{NULL}";
this.ToolVersion = new ArtToolInfoVersion();
this.UnitsPerMeter = 1;
this.Vector = new ArtToolInfoVector();
this.ExtendedData = new GrannyExtendedData();
}
public override string ToString()
{
//return string.Format("v{0}", this.ToolVersion.ToString());
return this.FromArtToolName;
}
#region IArtToolInfo Members
///
/// Get/set ArtTool Name
///
[RefreshPropertiesAttribute(RefreshProperties.All)]
[CategoryAttribute("Art Tool Info")]
public string FromArtToolName { get { return _fromArtToolName; } set { _fromArtToolName = value; } }
private ArtToolInfoVersion _ToolVersion;
///
/// Get/set ArtTool Version
///
[RefreshPropertiesAttribute(RefreshProperties.All)]
[CategoryAttribute("Art Tool Info")]
[Browsable(true)]
public ArtToolInfoVersion ToolVersion { get { return _ToolVersion; } set { _ToolVersion = value; } }
///
///Get/set ArtTool UnitsPerMeter
///
[RefreshPropertiesAttribute(RefreshProperties.All)]
//[Editor(typeof(UINumericEditor,float>), typeof(UITypeEditor))]
[CategoryAttribute("Art Tool Info")]
public float UnitsPerMeter { get { return _unitsPerMeter; } set { _unitsPerMeter = value; } }
private ArtToolInfoVector _Vector;
///
///Get/set ArtTool Vector
///
[RefreshPropertiesAttribute(RefreshProperties.All)]
[CategoryAttribute("Art Tool Info")]
[Browsable(true)]
public ArtToolInfoVector Vector
{
get { return _Vector; }
set { _Vector = value; }
}
#endregion
#region IExtendedData Members
private GrannyExtendedData _ExtendedData;
///
/// When used in a derived class, gets the ExtendedData pointer for this instance
///
public GrannyExtendedData ExtendedData { get { return _ExtendedData; } set { _ExtendedData = value; } }
#endregion
}
}