迁移命名空间
This commit is contained in:
parent
59ca1e5c79
commit
1d630cd41d
@ -1,13 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using System.Text;
|
||||
|
||||
using System.IO;
|
||||
|
||||
|
||||
namespace Duffer
|
||||
namespace IDTF.Net
|
||||
{
|
||||
public class Point3
|
||||
{
|
@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Duffer
|
||||
namespace IDTF.Net
|
||||
{
|
||||
public enum NodeType
|
||||
{
|
@ -1,10 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace Duffer
|
||||
namespace IDTF.Net
|
||||
{
|
||||
internal static class ExtensionMethods
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
namespace Duffer
|
||||
namespace IDTF.Net
|
||||
{
|
||||
public sealed class Format
|
||||
{
|
@ -1,10 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace Duffer
|
||||
namespace IDTF.Net
|
||||
{
|
||||
/* Modifiers
|
||||
* Possible modifier types: Animation, Shading, Bone weight, Clod, Subdiv, Glyph
|
@ -1,9 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
namespace Duffer
|
||||
using System.IO;
|
||||
|
||||
namespace IDTF.Net
|
||||
{
|
||||
// References:
|
||||
// http://jmol.svn.sourceforge.net/viewvc/jmol/trunk/Jmol/src/org/jmol/export/_IdtfExporter.java?revision=HEAD&view=markup
|
@ -1,30 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
|
||||
|
||||
namespace Duffer
|
||||
namespace IDTF.Net
|
||||
{
|
||||
/* Resource lists
|
||||
* Possible Resource_List types: View, Light, Model, Shader, Material, Texture, Motion
|
||||
* A IDTF file can only have one list of each type and has the following format:
|
||||
* RESOURCE_LIST <RESOURCE_TYPE> {
|
||||
* RESOURCE_COUNT <int>
|
||||
* RESOURCE 0 {
|
||||
* RESOURCE_NAME <string>
|
||||
* <RESOURCE_DATA>
|
||||
* <META_DATA>
|
||||
* }
|
||||
* etc.
|
||||
* }
|
||||
*
|
||||
* This file contains the Resource data for each of the resource list types.
|
||||
*/
|
||||
/* Resource lists
|
||||
* Possible Resource_List types: View, Light, Model, Shader, Material, Texture, Motion
|
||||
* A IDTF file can only have one list of each type and has the following format:
|
||||
* RESOURCE_LIST <RESOURCE_TYPE> {
|
||||
* RESOURCE_COUNT <int>
|
||||
* RESOURCE 0 {
|
||||
* RESOURCE_NAME <string>
|
||||
* <RESOURCE_DATA>
|
||||
* <META_DATA>
|
||||
* }
|
||||
* etc.
|
||||
* }
|
||||
*
|
||||
* This file contains the Resource data for each of the resource list types.
|
||||
*/
|
||||
|
||||
public abstract class Resource
|
||||
public abstract class Resource
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public abstract ResourceListType ResourceType {get; }
|
@ -1,10 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Duffer
|
||||
namespace IDTF.Net
|
||||
{
|
||||
/// <summary>
|
||||
/// The Scene is the root node in the IDTF file, all objects should be aded to the scene,
|
@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace Duffer
|
||||
namespace IDTF.Net
|
||||
{
|
||||
static class ListExtensions
|
||||
{
|
@ -1,10 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Duffer
|
||||
namespace IDTF.Net
|
||||
{
|
||||
public class MetaData
|
||||
{
|
@ -1,10 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Duffer
|
||||
namespace IDTF.Net
|
||||
{
|
||||
public abstract class MetaDataItem
|
||||
{
|
@ -1,9 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Duffer
|
||||
namespace IDTF.Net
|
||||
{
|
||||
public class Shader
|
||||
{
|
@ -1,10 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace Duffer
|
||||
namespace IDTF.Net
|
||||
{
|
||||
|
||||
public class Parent
|
@ -6,7 +6,7 @@ using System.IO;
|
||||
|
||||
using System.Drawing;
|
||||
|
||||
namespace Duffer
|
||||
namespace IDTF.Net
|
||||
{
|
||||
/* This file contains data descriptions for the resource_lists. */
|
||||
|
||||
@ -21,7 +21,7 @@ namespace Duffer
|
||||
{
|
||||
public ShadingDescription(int id = 0)
|
||||
{
|
||||
this.ShaderID = id;
|
||||
ShaderID = id;
|
||||
}
|
||||
|
||||
public int ShaderID { get; set; }
|
||||
@ -42,18 +42,18 @@ namespace Duffer
|
||||
|
||||
internal void Export(StreamWriter toStream)
|
||||
{
|
||||
toStream.WriteLine(String.Format("\t\t\t\t\tTEXTURE_LAYER_COUNT {0}", this.TextureCoordDimensionList.Count()));
|
||||
toStream.WriteLine(string.Format("\t\t\t\t\tTEXTURE_LAYER_COUNT {0}", TextureCoordDimensionList.Count()));
|
||||
if (_textureCoordDimList != null)
|
||||
{
|
||||
ListExtensions.ExportTextureCoordListToStream(_textureCoordDimList, toStream);
|
||||
}
|
||||
toStream.WriteLine(String.Format("\t\t\t\t\tSHADER_ID {0}", this.ShaderID));
|
||||
toStream.WriteLine(string.Format("\t\t\t\t\tSHADER_ID {0}", ShaderID));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class FaceTextureCoord
|
||||
{
|
||||
{
|
||||
|
||||
private List<Int3> _textureCoordDimList;
|
||||
public List<Int3> TextureCoordDimensionList
|
||||
@ -70,7 +70,7 @@ namespace Duffer
|
||||
}
|
||||
|
||||
internal void Export(StreamWriter toStream)
|
||||
{
|
||||
{
|
||||
if (_textureCoordDimList != null)
|
||||
{
|
||||
ListExtensions.ExportTextureCoordListToStream(_textureCoordDimList, toStream);
|
||||
@ -124,149 +124,149 @@ namespace Duffer
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._shadingDescriptionList == null) this._shadingDescriptionList = new List<ShadingDescription>();
|
||||
return this._shadingDescriptionList;
|
||||
if (_shadingDescriptionList == null) _shadingDescriptionList = new List<ShadingDescription>();
|
||||
return _shadingDescriptionList;
|
||||
}
|
||||
set { this._shadingDescriptionList = value; }
|
||||
set { _shadingDescriptionList = value; }
|
||||
}
|
||||
public List<Int3> MeshFacePositionList
|
||||
public List<Int3> MeshFacePositionList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._meshFacePositionList == null) this._meshFacePositionList = new List<Int3>();
|
||||
return this._meshFacePositionList;
|
||||
if (_meshFacePositionList == null) _meshFacePositionList = new List<Int3>();
|
||||
return _meshFacePositionList;
|
||||
}
|
||||
set { this._meshFacePositionList = value; }
|
||||
}
|
||||
set { _meshFacePositionList = value; }
|
||||
}
|
||||
public List<Int3> MeshFaceNormalList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._meshFaceNormalList == null) this._meshFaceNormalList = new List<Int3>();
|
||||
return this._meshFaceNormalList;
|
||||
if (_meshFaceNormalList == null) _meshFaceNormalList = new List<Int3>();
|
||||
return _meshFaceNormalList;
|
||||
}
|
||||
set { this._meshFaceNormalList = value; }
|
||||
set { _meshFaceNormalList = value; }
|
||||
}
|
||||
public List<int> MeshFaceShadingList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._meshFaceShadingList == null) this._meshFaceShadingList = new List<int>();
|
||||
return this._meshFaceShadingList;
|
||||
if (_meshFaceShadingList == null) _meshFaceShadingList = new List<int>();
|
||||
return _meshFaceShadingList;
|
||||
}
|
||||
set { this._meshFaceShadingList = value; }
|
||||
set { _meshFaceShadingList = value; }
|
||||
}
|
||||
public List<FaceTextureCoord> MeshFaceTextureCoordinateList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._meshFaceTextureCoordinateList == null) this._meshFaceTextureCoordinateList = new List<FaceTextureCoord>();
|
||||
return this._meshFaceTextureCoordinateList;
|
||||
if (_meshFaceTextureCoordinateList == null) _meshFaceTextureCoordinateList = new List<FaceTextureCoord>();
|
||||
return _meshFaceTextureCoordinateList;
|
||||
}
|
||||
set { this._meshFaceTextureCoordinateList = value; }
|
||||
set { _meshFaceTextureCoordinateList = value; }
|
||||
}
|
||||
public List<Int3> MeshFaceDiffuseColorList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._meshFaceDiffuseColorList == null) this._meshFaceDiffuseColorList = new List<Int3>();
|
||||
return this._meshFaceDiffuseColorList;
|
||||
if (_meshFaceDiffuseColorList == null) _meshFaceDiffuseColorList = new List<Int3>();
|
||||
return _meshFaceDiffuseColorList;
|
||||
}
|
||||
set { this._meshFaceDiffuseColorList = value; }
|
||||
set { _meshFaceDiffuseColorList = value; }
|
||||
}
|
||||
public List<Int3> MeshFaceSpecularColorList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._meshFaceSpecularColorList == null) this._meshFaceSpecularColorList = new List<Int3>();
|
||||
return this._meshFaceSpecularColorList;
|
||||
if (_meshFaceSpecularColorList == null) _meshFaceSpecularColorList = new List<Int3>();
|
||||
return _meshFaceSpecularColorList;
|
||||
}
|
||||
set { this._meshFaceSpecularColorList = value; }
|
||||
set { _meshFaceSpecularColorList = value; }
|
||||
}
|
||||
public List<Point3> ModelPositionList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._modelPositionList == null) this._modelPositionList = new List<Point3>();
|
||||
return this._modelPositionList;
|
||||
if (_modelPositionList == null) _modelPositionList = new List<Point3>();
|
||||
return _modelPositionList;
|
||||
}
|
||||
set { this._modelPositionList = value; }
|
||||
set { _modelPositionList = value; }
|
||||
}
|
||||
public List<Point3> ModelNormalList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._modelNormalList == null) this._modelNormalList = new List<Point3>();
|
||||
return this._modelNormalList;
|
||||
if (_modelNormalList == null) _modelNormalList = new List<Point3>();
|
||||
return _modelNormalList;
|
||||
}
|
||||
set { this._modelNormalList = value; }
|
||||
set { _modelNormalList = value; }
|
||||
}
|
||||
public List<Color> ModelDiffuseColorList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._modelDiffuseColorList == null) this._modelDiffuseColorList = new List<Color>();
|
||||
return this._modelDiffuseColorList;
|
||||
if (_modelDiffuseColorList == null) _modelDiffuseColorList = new List<Color>();
|
||||
return _modelDiffuseColorList;
|
||||
}
|
||||
set { this._modelDiffuseColorList = value; }
|
||||
set { _modelDiffuseColorList = value; }
|
||||
}
|
||||
public List<Color> ModelSpecularColorList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._modelSpecularColorList == null) this._modelSpecularColorList = new List<Color>();
|
||||
return this._modelSpecularColorList;
|
||||
if (_modelSpecularColorList == null) _modelSpecularColorList = new List<Color>();
|
||||
return _modelSpecularColorList;
|
||||
}
|
||||
set { this._modelSpecularColorList = value; }
|
||||
set { _modelSpecularColorList = value; }
|
||||
}
|
||||
public List<Vector4> ModelTextureCoordList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._modelTextureCoordList == null) this._modelTextureCoordList = new List<Vector4>();
|
||||
return this._modelTextureCoordList;
|
||||
if (_modelTextureCoordList == null) _modelTextureCoordList = new List<Vector4>();
|
||||
return _modelTextureCoordList;
|
||||
}
|
||||
set { this._modelTextureCoordList = value; }
|
||||
set { _modelTextureCoordList = value; }
|
||||
}
|
||||
public List<int> MeshBasePositionList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._meshBasePositionList == null) this._meshBasePositionList = new List<int>();
|
||||
return this._meshBasePositionList;
|
||||
if (_meshBasePositionList == null) _meshBasePositionList = new List<int>();
|
||||
return _meshBasePositionList;
|
||||
}
|
||||
set { this._meshBasePositionList = value; }
|
||||
set { _meshBasePositionList = value; }
|
||||
}
|
||||
|
||||
public void Export(StreamWriter toStream)
|
||||
public void Export(StreamWriter toStream)
|
||||
{
|
||||
toStream.WriteLine(String.Format("\t\tMESH {{"));
|
||||
toStream.WriteLine(String.Format("\t\t\tFACE_COUNT {0}", this.MeshFacePositionList.Count().ToString()));
|
||||
toStream.WriteLine(String.Format("\t\t\tMODEL_POSITION_COUNT {0}", this.ModelPositionList.Count().ToString()));
|
||||
toStream.WriteLine(string.Format("\t\tMESH {{"));
|
||||
toStream.WriteLine(string.Format("\t\t\tFACE_COUNT {0}", MeshFacePositionList.Count().ToString()));
|
||||
toStream.WriteLine(string.Format("\t\t\tMODEL_POSITION_COUNT {0}", ModelPositionList.Count().ToString()));
|
||||
// toStream.WriteLine(String.Format("\t\t\tMODEL_BASE_POSITION_COUNT {0} {{", this.MeshBasePositionList.Count().ToString()));
|
||||
toStream.WriteLine(String.Format("\t\t\tMODEL_NORMAL_COUNT {0}", this.ModelNormalList.Count().ToString()));
|
||||
toStream.WriteLine(String.Format("\t\t\tMODEL_DIFFUSE_COLOR_COUNT {0}", this.ModelDiffuseColorList.Count().ToString()));
|
||||
toStream.WriteLine(String.Format("\t\t\tMODEL_SPECULAR_COLOR_COUNT {0}", this.ModelSpecularColorList.Count().ToString()));
|
||||
toStream.WriteLine(String.Format("\t\t\tMODEL_TEXTURE_COORD_COUNT {0}", this.ModelTextureCoordList.Count().ToString()));
|
||||
toStream.WriteLine(String.Format("\t\t\tMODEL_BONE_COUNT {0}", 0)); //What does this count???
|
||||
toStream.WriteLine(String.Format("\t\t\tMODEL_SHADING_COUNT {0}", this.ShadingDescriptionList.Count().ToString()));
|
||||
toStream.WriteLine(string.Format("\t\t\tMODEL_NORMAL_COUNT {0}", ModelNormalList.Count().ToString()));
|
||||
toStream.WriteLine(string.Format("\t\t\tMODEL_DIFFUSE_COLOR_COUNT {0}", ModelDiffuseColorList.Count().ToString()));
|
||||
toStream.WriteLine(string.Format("\t\t\tMODEL_SPECULAR_COLOR_COUNT {0}", ModelSpecularColorList.Count().ToString()));
|
||||
toStream.WriteLine(string.Format("\t\t\tMODEL_TEXTURE_COORD_COUNT {0}", ModelTextureCoordList.Count().ToString()));
|
||||
toStream.WriteLine(string.Format("\t\t\tMODEL_BONE_COUNT {0}", 0)); //What does this count???
|
||||
toStream.WriteLine(string.Format("\t\t\tMODEL_SHADING_COUNT {0}", ShadingDescriptionList.Count().ToString()));
|
||||
|
||||
ListExtensions.ExportShadingListToStream(this.ShadingDescriptionList, toStream);
|
||||
ListExtensions.ExportInt3ListToStream(this.MeshFacePositionList, toStream, "MESH_FACE_POSITION_LIST");
|
||||
ListExtensions.ExportInt3ListToStream(this.MeshFaceNormalList, toStream, "MESH_FACE_NORMAL_LIST");
|
||||
ListExtensions.ExportIntListToStream(this.MeshFaceShadingList, toStream, "MESH_FACE_SHADING_LIST");
|
||||
ListExtensions.ExportMeshFaceTextureCoordListToStream(this.MeshFaceTextureCoordinateList, toStream);
|
||||
ListExtensions.ExportInt3ListToStream(this.MeshFaceDiffuseColorList, toStream, "MESH_FACE_DIFFUSE_COLOR_LIST");
|
||||
ListExtensions.ExportInt3ListToStream(this.MeshFaceSpecularColorList, toStream, "MESH_FACE_SPECULAR_COLOR_LIST");
|
||||
ListExtensions.ExportPoint3ListToStream(this.ModelPositionList, toStream, "MODEL_POSITION_LIST");
|
||||
ListExtensions.ExportPoint3ListToStream(this.ModelNormalList, toStream, "MODEL_NORMAL_LIST");
|
||||
ListExtensions.ExportColor4ListToStream(this.ModelDiffuseColorList, toStream, "MODEL_DIFFUSE_COLOR_LIST");
|
||||
ListExtensions.ExportColor4ListToStream(this.ModelSpecularColorList, toStream, "MODEL_NORMAL_LIST");
|
||||
ListExtensions.ExportVector4ListToStream(this.ModelTextureCoordList, toStream, "MODEL_TEXTURE_COORD_LIST");
|
||||
ListExtensions.ExportIntListToStream(this.MeshBasePositionList, toStream, "MESH_BASE_POSITION_LIST");
|
||||
ListExtensions.ExportShadingListToStream(ShadingDescriptionList, toStream);
|
||||
ListExtensions.ExportInt3ListToStream(MeshFacePositionList, toStream, "MESH_FACE_POSITION_LIST");
|
||||
ListExtensions.ExportInt3ListToStream(MeshFaceNormalList, toStream, "MESH_FACE_NORMAL_LIST");
|
||||
ListExtensions.ExportIntListToStream(MeshFaceShadingList, toStream, "MESH_FACE_SHADING_LIST");
|
||||
ListExtensions.ExportMeshFaceTextureCoordListToStream(MeshFaceTextureCoordinateList, toStream);
|
||||
ListExtensions.ExportInt3ListToStream(MeshFaceDiffuseColorList, toStream, "MESH_FACE_DIFFUSE_COLOR_LIST");
|
||||
ListExtensions.ExportInt3ListToStream(MeshFaceSpecularColorList, toStream, "MESH_FACE_SPECULAR_COLOR_LIST");
|
||||
ListExtensions.ExportPoint3ListToStream(ModelPositionList, toStream, "MODEL_POSITION_LIST");
|
||||
ListExtensions.ExportPoint3ListToStream(ModelNormalList, toStream, "MODEL_NORMAL_LIST");
|
||||
ListExtensions.ExportColor4ListToStream(ModelDiffuseColorList, toStream, "MODEL_DIFFUSE_COLOR_LIST");
|
||||
ListExtensions.ExportColor4ListToStream(ModelSpecularColorList, toStream, "MODEL_NORMAL_LIST");
|
||||
ListExtensions.ExportVector4ListToStream(ModelTextureCoordList, toStream, "MODEL_TEXTURE_COORD_LIST");
|
||||
ListExtensions.ExportIntListToStream(MeshBasePositionList, toStream, "MESH_BASE_POSITION_LIST");
|
||||
|
||||
|
||||
toStream.WriteLine(String.Format("\t\t}}"));
|
||||
toStream.WriteLine(string.Format("\t\t}}"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -292,7 +292,7 @@ namespace Duffer
|
||||
if (_shadingDescriptionList == null) _shadingDescriptionList = new List<ShadingDescription>();
|
||||
return _shadingDescriptionList;
|
||||
}
|
||||
set { this._shadingDescriptionList = value; }
|
||||
set { _shadingDescriptionList = value; }
|
||||
}
|
||||
public List<Int2> LinePositionList
|
||||
{
|
||||
@ -316,10 +316,10 @@ namespace Duffer
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._lineShadingList == null) this._lineShadingList = new List<int>();
|
||||
return this._lineShadingList;
|
||||
if (_lineShadingList == null) _lineShadingList = new List<int>();
|
||||
return _lineShadingList;
|
||||
}
|
||||
set { this._lineShadingList = value; }
|
||||
set { _lineShadingList = value; }
|
||||
}
|
||||
public List<LineTextureCoord> LineTextureCoordinateList
|
||||
{
|
||||
@ -334,10 +334,10 @@ namespace Duffer
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._lineDiffuseColorList == null) this._lineDiffuseColorList = new List<Int2>();
|
||||
return this._lineDiffuseColorList;
|
||||
if (_lineDiffuseColorList == null) _lineDiffuseColorList = new List<Int2>();
|
||||
return _lineDiffuseColorList;
|
||||
}
|
||||
set { this._lineDiffuseColorList = value; }
|
||||
set { _lineDiffuseColorList = value; }
|
||||
}
|
||||
public List<Int2> LineSpecularColorList
|
||||
{
|
||||
@ -352,60 +352,60 @@ namespace Duffer
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._modelPositionList == null) this._modelPositionList = new List<Point3>();
|
||||
return this._modelPositionList;
|
||||
if (_modelPositionList == null) _modelPositionList = new List<Point3>();
|
||||
return _modelPositionList;
|
||||
}
|
||||
set { this._modelPositionList = value; }
|
||||
set { _modelPositionList = value; }
|
||||
}
|
||||
public List<Point3> ModelNormalList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._modelNormalList == null) this._modelNormalList = new List<Point3>();
|
||||
return this._modelNormalList;
|
||||
if (_modelNormalList == null) _modelNormalList = new List<Point3>();
|
||||
return _modelNormalList;
|
||||
}
|
||||
set { this._modelNormalList = value; }
|
||||
set { _modelNormalList = value; }
|
||||
}
|
||||
public List<Color> ModelDiffuseColorList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._modelDiffuseColorList == null) this._modelDiffuseColorList = new List<Color>();
|
||||
return this._modelDiffuseColorList;
|
||||
if (_modelDiffuseColorList == null) _modelDiffuseColorList = new List<Color>();
|
||||
return _modelDiffuseColorList;
|
||||
}
|
||||
set { this._modelDiffuseColorList = value; }
|
||||
set { _modelDiffuseColorList = value; }
|
||||
}
|
||||
public List<Color> ModelSpecularColorList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._modelSpecularColorList == null) this._modelSpecularColorList = new List<Color>();
|
||||
return this._modelSpecularColorList;
|
||||
if (_modelSpecularColorList == null) _modelSpecularColorList = new List<Color>();
|
||||
return _modelSpecularColorList;
|
||||
}
|
||||
set { this._modelSpecularColorList = value; }
|
||||
set { _modelSpecularColorList = value; }
|
||||
}
|
||||
public List<Vector4> ModelTextureCoordList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._modelTextureCoordList == null) this._modelTextureCoordList = new List<Vector4>();
|
||||
return this._modelTextureCoordList;
|
||||
if (_modelTextureCoordList == null) _modelTextureCoordList = new List<Vector4>();
|
||||
return _modelTextureCoordList;
|
||||
}
|
||||
set { this._modelTextureCoordList = value; }
|
||||
set { _modelTextureCoordList = value; }
|
||||
}
|
||||
|
||||
|
||||
public void Export(StreamWriter toStream)
|
||||
|
||||
public void Export(StreamWriter toStream)
|
||||
{
|
||||
toStream.WriteLine(String.Format("\t\tLINE_SET {{"));
|
||||
toStream.WriteLine(string.Format("\t\tLINE_SET {{"));
|
||||
|
||||
toStream.WriteLine(String.Format("\t\t\tLINE_COUNT {0}", LinePositionList.Count().ToString()));
|
||||
toStream.WriteLine(String.Format("\t\t\tMODEL_POSITION_COUNT {0}", ModelPositionList.Count().ToString()));
|
||||
toStream.WriteLine(String.Format("\t\t\tMODEL_NORMAL_COUNT {0}", ModelNormalList.Count().ToString()));
|
||||
toStream.WriteLine(String.Format("\t\t\tMODEL_DIFFUSE_COLOR_COUNT {0}", ModelDiffuseColorList.Count().ToString()));
|
||||
toStream.WriteLine(String.Format("\t\t\tMODEL_SPECULAR_COLOR_COUNT {0}", ModelSpecularColorList.Count().ToString()));
|
||||
toStream.WriteLine(String.Format("\t\t\tMODEL_TEXTURE_COORD_COUNT {0}", ModelTextureCoordList.Count().ToString()));
|
||||
toStream.WriteLine(String.Format("\t\t\tMODEL_SHADING_COUNT {0}", ShadingDescriptionList.Count().ToString()));
|
||||
toStream.WriteLine(string.Format("\t\t\tLINE_COUNT {0}", LinePositionList.Count().ToString()));
|
||||
toStream.WriteLine(string.Format("\t\t\tMODEL_POSITION_COUNT {0}", ModelPositionList.Count().ToString()));
|
||||
toStream.WriteLine(string.Format("\t\t\tMODEL_NORMAL_COUNT {0}", ModelNormalList.Count().ToString()));
|
||||
toStream.WriteLine(string.Format("\t\t\tMODEL_DIFFUSE_COLOR_COUNT {0}", ModelDiffuseColorList.Count().ToString()));
|
||||
toStream.WriteLine(string.Format("\t\t\tMODEL_SPECULAR_COLOR_COUNT {0}", ModelSpecularColorList.Count().ToString()));
|
||||
toStream.WriteLine(string.Format("\t\t\tMODEL_TEXTURE_COORD_COUNT {0}", ModelTextureCoordList.Count().ToString()));
|
||||
toStream.WriteLine(string.Format("\t\t\tMODEL_SHADING_COUNT {0}", ShadingDescriptionList.Count().ToString()));
|
||||
|
||||
ListExtensions.ExportShadingListToStream(ShadingDescriptionList, toStream);
|
||||
ListExtensions.ExportInt2ListToStream(LinePositionList, toStream, "LINE_POSITION_LIST");
|
||||
@ -420,7 +420,7 @@ namespace Duffer
|
||||
ListExtensions.ExportColor4ListToStream(ModelSpecularColorList, toStream, "MODEL_NORMAL_LIST");
|
||||
ListExtensions.ExportVector4ListToStream(ModelTextureCoordList, toStream, "MODEL_TEXTURE_COORD_LIST");
|
||||
|
||||
toStream.WriteLine(String.Format("\t\t}}"));
|
||||
toStream.WriteLine(string.Format("\t\t}}"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -428,10 +428,10 @@ namespace Duffer
|
||||
{
|
||||
public void Export(StreamWriter toStream) { }
|
||||
}
|
||||
|
||||
|
||||
/* Resource data for the "SHADER RESOURCE_LIST" */
|
||||
|
||||
public class TextureLayer:IResourceData
|
||||
public class TextureLayer : IResourceData
|
||||
{
|
||||
public string TextureName { get; set; }
|
||||
|
||||
@ -445,25 +445,25 @@ namespace Duffer
|
||||
public void Export(StreamWriter toStream)
|
||||
{
|
||||
if (TextureLayerIntensity != null)
|
||||
toStream.WriteLine(String.Format("\t\t\t\tTEXTURE_LAYER_INTENSITY {0}", ((float)TextureLayerIntensity).ToString(Format.SixDecPlFormat)));
|
||||
toStream.WriteLine(string.Format("\t\t\t\tTEXTURE_LAYER_INTENSITY {0}", ((float)TextureLayerIntensity).ToString(Format.SixDecPlFormat)));
|
||||
if (TextureLayerBlendFunction != null)
|
||||
toStream.WriteLine(String.Format("\t\t\t\tTEXTURE_LAYER_BLEND_FUNCTION \"{0}\"", TextureLayerBlendFunction.ToString()));
|
||||
toStream.WriteLine(string.Format("\t\t\t\tTEXTURE_LAYER_BLEND_FUNCTION \"{0}\"", TextureLayerBlendFunction.ToString()));
|
||||
if (TextureLayerBlendSource != null)
|
||||
toStream.WriteLine(String.Format("\t\t\t\tTEXTURE_LAYER_BLEND_SOURCE \"{0}\"", TextureLayerBlendSource.ToString()));
|
||||
toStream.WriteLine(string.Format("\t\t\t\tTEXTURE_LAYER_BLEND_SOURCE \"{0}\"", TextureLayerBlendSource.ToString()));
|
||||
if (TextureLayerBlendConstant != null)
|
||||
toStream.WriteLine(String.Format("\t\t\t\tTEXTURE_LAYER_BLEND_CONSTANT {0}", ((float)TextureLayerBlendConstant).ToString(Format.SixDecPlFormat)));
|
||||
toStream.WriteLine(string.Format("\t\t\t\tTEXTURE_LAYER_BLEND_CONSTANT {0}", ((float)TextureLayerBlendConstant).ToString(Format.SixDecPlFormat)));
|
||||
if (TextureLayerMode != null)
|
||||
toStream.WriteLine(String.Format("\t\t\t\tTEXTURE_LAYER_MODE {0}", TextureLayerMode));
|
||||
toStream.WriteLine(string.Format("\t\t\t\tTEXTURE_LAYER_MODE {0}", TextureLayerMode));
|
||||
if (TextureLayerAlphaEnabled != null)
|
||||
toStream.WriteLine(String.Format("\t\t\t\tTEXTURE_LAYER_ALPHA_ENABLED \"{0}\"", TextureLayerAlphaEnabled.ToString().ToUpper()));
|
||||
toStream.WriteLine(string.Format("\t\t\t\tTEXTURE_LAYER_ALPHA_ENABLED \"{0}\"", TextureLayerAlphaEnabled.ToString().ToUpper()));
|
||||
|
||||
toStream.WriteLine(String.Format("\t\t\t\tTEXTURE_NAME \"{0}\"", TextureName));
|
||||
toStream.WriteLine(string.Format("\t\t\t\tTEXTURE_NAME \"{0}\"", TextureName));
|
||||
}
|
||||
}
|
||||
|
||||
/* Resource data for the "TEXTURE RESOURCE_LIST" */
|
||||
|
||||
public class TextureImageFormat: IResourceData
|
||||
public class TextureImageFormat : IResourceData
|
||||
{
|
||||
public CompressionType? Type { get; set; }
|
||||
public bool? AlphaChannel { get; set; }
|
||||
@ -489,22 +489,22 @@ namespace Duffer
|
||||
|
||||
public void Export(StreamWriter toStream)
|
||||
{
|
||||
if (this.Type != null)
|
||||
toStream.WriteLine(String.Format("\t\t\t\tCOMPRESSION_TYPE \"{0}\"", this.Type.ToString()));
|
||||
if (this.AlphaChannel != null)
|
||||
toStream.WriteLine(String.Format("\t\t\t\tALPHA_CHANNEL \"{0}\"", this.AlphaChannel.ToString().ToUpper()));
|
||||
if (this.BlueChannel != null)
|
||||
toStream.WriteLine(String.Format("\t\t\t\tBLUE_CHANNEL \"{0}\"", this.BlueChannel.ToString().ToUpper()));
|
||||
if (this.GreenChannel != null)
|
||||
toStream.WriteLine(String.Format("\t\t\t\tGREEN_CHANNEL \"{0}\"", this.GreenChannel.ToString().ToUpper()));
|
||||
if (this.RedChannel != null)
|
||||
toStream.WriteLine(String.Format("\t\t\t\tRED_CHANNEL \"{0}\"", this.RedChannel.ToString().ToUpper()));
|
||||
if (this.Luminance != null)
|
||||
toStream.WriteLine(String.Format("\t\t\t\tLUMINANCE \"{0}\"", this.Luminance.ToString().ToUpper()));
|
||||
if (this.ExternalReference != null)
|
||||
toStream.WriteLine(String.Format("\t\t\t\tEXERNAL_REFERENCE \"{0}\"", this.ExternalReference.ToString().ToUpper()));
|
||||
if (Type != null)
|
||||
toStream.WriteLine(string.Format("\t\t\t\tCOMPRESSION_TYPE \"{0}\"", Type.ToString()));
|
||||
if (AlphaChannel != null)
|
||||
toStream.WriteLine(string.Format("\t\t\t\tALPHA_CHANNEL \"{0}\"", AlphaChannel.ToString().ToUpper()));
|
||||
if (BlueChannel != null)
|
||||
toStream.WriteLine(string.Format("\t\t\t\tBLUE_CHANNEL \"{0}\"", BlueChannel.ToString().ToUpper()));
|
||||
if (GreenChannel != null)
|
||||
toStream.WriteLine(string.Format("\t\t\t\tGREEN_CHANNEL \"{0}\"", GreenChannel.ToString().ToUpper()));
|
||||
if (RedChannel != null)
|
||||
toStream.WriteLine(string.Format("\t\t\t\tRED_CHANNEL \"{0}\"", RedChannel.ToString().ToUpper()));
|
||||
if (Luminance != null)
|
||||
toStream.WriteLine(string.Format("\t\t\t\tLUMINANCE \"{0}\"", Luminance.ToString().ToUpper()));
|
||||
if (ExternalReference != null)
|
||||
toStream.WriteLine(string.Format("\t\t\t\tEXERNAL_REFERENCE \"{0}\"", ExternalReference.ToString().ToUpper()));
|
||||
|
||||
ListExtensions.ExportUrlListToStream(this.UrltList, toStream);
|
||||
ListExtensions.ExportUrlListToStream(UrltList, toStream);
|
||||
}
|
||||
}
|
||||
public class Url : IResourceData
|
@ -1,12 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
|
||||
|
||||
namespace Duffer
|
||||
namespace IDTF.Net
|
||||
{
|
||||
/// <summary>
|
||||
/// A geometric transform, in column/row format
|
@ -1,7 +1,6 @@
|
||||
using Autodesk.Revit.Attributes;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using Duffer;
|
||||
using iText.Kernel.Pdf;
|
||||
using iText.Kernel.Pdf.Annot;
|
||||
using System;
|
||||
|
@ -4,7 +4,9 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Autodesk.Revit.DB;
|
||||
using Duffer;
|
||||
using IDTF.Net;
|
||||
using Group = IDTF.Net.Group;
|
||||
|
||||
namespace PDF3D.Addin
|
||||
{
|
||||
internal class IDTFBuilder
|
||||
@ -13,8 +15,8 @@ namespace PDF3D.Addin
|
||||
private IDTFScene _scene;
|
||||
private Dictionary<string, int> _shaderIndex = new Dictionary<string, int>();
|
||||
|
||||
private Parent nullParent = new Duffer.Parent() { Name = "<NULL>", Transform = new Duffer.Transform4x4() };
|
||||
private ShadingDescription defaultShadingDesc = new Duffer.ShadingDescription() { TextureCoordDimensionList = new List<int>(), ShaderID = 0 };
|
||||
private Parent nullParent = new Parent() { Name = "<NULL>", Transform = new Transform4x4() };
|
||||
private ShadingDescription defaultShadingDesc = new ShadingDescription() { TextureCoordDimensionList = new List<int>(), ShaderID = 0 };
|
||||
|
||||
public IDTFBuilder(Autodesk.Revit.DB.Document document)
|
||||
{
|
||||
@ -24,7 +26,7 @@ namespace PDF3D.Addin
|
||||
}
|
||||
private void AddDefault()
|
||||
{
|
||||
var mat = new Duffer.MaterialResource()
|
||||
var mat = new MaterialResource()
|
||||
{
|
||||
Name = "default",
|
||||
AttributeDiffuseEnabled = true,
|
||||
@ -43,7 +45,7 @@ namespace PDF3D.Addin
|
||||
}
|
||||
else
|
||||
{
|
||||
var group = new Duffer.Group() { Name = name, Parents = new List<Duffer.Parent>() { _scene.Groups.Any(x => x.Name == patrent) ? new Parent(patrent) : nullParent } };
|
||||
var group = new Group() { Name = name, Parents = new List<Parent>() { _scene.Groups.Any(x => x.Name == patrent) ? new Parent(patrent) : nullParent } };
|
||||
this._scene.Groups.Add(group);
|
||||
return true;
|
||||
}
|
||||
@ -60,7 +62,7 @@ namespace PDF3D.Addin
|
||||
}
|
||||
else if (!this._scene.MaterialResources.ContainsKey(material.Name))
|
||||
{
|
||||
var mat = new Duffer.MaterialResource()
|
||||
var mat = new MaterialResource()
|
||||
{
|
||||
Name = material.Name,
|
||||
MaterialDiffuse = System.Drawing.Color.FromArgb(255, material.Color.Red, material.Color.Green, material.Color.Blue),
|
||||
@ -75,15 +77,15 @@ namespace PDF3D.Addin
|
||||
}
|
||||
public bool InsertElement(Element element)
|
||||
{
|
||||
Duffer.Parent parent;
|
||||
Parent parent;
|
||||
if (element is FamilyInstance fi)
|
||||
{
|
||||
this.InsertGroup(fi.Symbol.FamilyName, fi.Category.Name);
|
||||
parent = new Duffer.Parent(fi.Symbol.FamilyName);
|
||||
parent = new Parent(fi.Symbol.FamilyName);
|
||||
}
|
||||
else
|
||||
{
|
||||
parent = new Duffer.Parent(element.Category.Name);
|
||||
parent = new Parent(element.Category.Name);
|
||||
}
|
||||
|
||||
var option = new Options();
|
||||
@ -95,13 +97,13 @@ namespace PDF3D.Addin
|
||||
if (meshData != null && meshData.ModelPositionList.Any())
|
||||
{
|
||||
var name = element.Name + " " + element.Id.ToString();
|
||||
var model = new Duffer.Model
|
||||
var model = new Model
|
||||
{
|
||||
Name = name,
|
||||
Parents = new List<Duffer.Parent>() { parent },
|
||||
Parents = new List<Parent>() { parent },
|
||||
Visibility = ModelVisibility.BOTH
|
||||
};
|
||||
var modelRes = new Duffer.ModelResource(Duffer.ModelType.MESH) { Name = name };
|
||||
var modelRes = new ModelResource(ModelType.MESH) { Name = name };
|
||||
modelRes.Mesh = meshData;
|
||||
|
||||
model.Resource = modelRes;
|
||||
|
@ -7,7 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PDFGenerator", "PDFGenerato
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PDF3D.Addin", "PDF3D.Addin\PDF3D.Addin.csproj", "{CF96214C-74FB-419D-84FE-295FA107D367}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Duffer", "Duffer\Duffer.csproj", "{6EAA9D99-766E-4772-AA87-A219559089DB}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IDTF.Net", "IDTF.Net\IDTF.Net.csproj", "{6EAA9D99-766E-4772-AA87-A219559089DB}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -22,7 +22,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Duffer\Duffer.csproj" />
|
||||
<ProjectReference Include="..\IDTF.Net\IDTF.Net.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
Loading…
Reference in New Issue
Block a user