60 lines
1.1 KiB
C#
60 lines
1.1 KiB
C#
using StgSharp.Math;
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace StgSharp.Geometries
|
|
{
|
|
public abstract class ICoord
|
|
{
|
|
protected Matrix44 coordMat;
|
|
protected List<vec4d> pointBuffer;
|
|
|
|
public ICoord()
|
|
{
|
|
pointBuffer = new List<vec4d>();
|
|
}
|
|
|
|
public abstract Matrix44 GlobalCoordTransformation
|
|
{
|
|
get;
|
|
}
|
|
|
|
public abstract vec3d Origin
|
|
{
|
|
get;
|
|
}
|
|
|
|
public abstract vec3d X_axis
|
|
{
|
|
get;
|
|
}
|
|
|
|
public abstract vec3d Y_axis
|
|
{
|
|
get;
|
|
}
|
|
|
|
public abstract vec3d Z_axis
|
|
{
|
|
get;
|
|
}
|
|
|
|
public T BuildGeometry<T>(params vec4d[] defaultVertex) where T : IGeometry
|
|
{
|
|
T ret = Activator.CreateInstance<T>();
|
|
ret.GetVertexHandle(this, ret.VertexCount);
|
|
for (int i = 0; i < ret.VertexCount; i++)
|
|
{
|
|
ret[i] = defaultVertex[i];
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
|
|
}
|
|
}
|