diff --git a/Duffer/BasicTypes.cs b/IDTF.Net/BasicTypes.cs similarity index 94% rename from Duffer/BasicTypes.cs rename to IDTF.Net/BasicTypes.cs index 7cb2046..e86f65f 100644 --- a/Duffer/BasicTypes.cs +++ b/IDTF.Net/BasicTypes.cs @@ -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 { diff --git a/Duffer/Enums.cs b/IDTF.Net/Enums.cs similarity index 94% rename from Duffer/Enums.cs rename to IDTF.Net/Enums.cs index 22ac51e..7b455a2 100644 --- a/Duffer/Enums.cs +++ b/IDTF.Net/Enums.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Duffer +namespace IDTF.Net { public enum NodeType { diff --git a/Duffer/ExtensionMethods.cs b/IDTF.Net/ExtensionMethods.cs similarity index 96% rename from Duffer/ExtensionMethods.cs rename to IDTF.Net/ExtensionMethods.cs index 4f4e45c..33b455f 100644 --- a/Duffer/ExtensionMethods.cs +++ b/IDTF.Net/ExtensionMethods.cs @@ -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 { diff --git a/Duffer/Format.cs b/IDTF.Net/Format.cs similarity index 82% rename from Duffer/Format.cs rename to IDTF.Net/Format.cs index 4a35f72..1b41174 100644 --- a/Duffer/Format.cs +++ b/IDTF.Net/Format.cs @@ -1,4 +1,4 @@ -namespace Duffer +namespace IDTF.Net { public sealed class Format { diff --git a/Duffer/Duffer.csproj b/IDTF.Net/IDTF.Net.csproj similarity index 100% rename from Duffer/Duffer.csproj rename to IDTF.Net/IDTF.Net.csproj diff --git a/Duffer/IDTFModifiers.cs b/IDTF.Net/IDTFModifiers.cs similarity index 96% rename from Duffer/IDTFModifiers.cs rename to IDTF.Net/IDTFModifiers.cs index 4fe19ad..3ac7446 100644 --- a/Duffer/IDTFModifiers.cs +++ b/IDTF.Net/IDTFModifiers.cs @@ -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 diff --git a/Duffer/IDTFNodes.cs b/IDTF.Net/IDTFNodes.cs similarity index 98% rename from Duffer/IDTFNodes.cs rename to IDTF.Net/IDTFNodes.cs index 6ecc218..ec4fe5b 100644 --- a/Duffer/IDTFNodes.cs +++ b/IDTF.Net/IDTFNodes.cs @@ -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 diff --git a/Duffer/IDTFResources.cs b/IDTF.Net/IDTFResources.cs similarity index 94% rename from Duffer/IDTFResources.cs rename to IDTF.Net/IDTFResources.cs index e423274..7203dbe 100644 --- a/Duffer/IDTFResources.cs +++ b/IDTF.Net/IDTFResources.cs @@ -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_COUNT - * RESOURCE 0 { - * RESOURCE_NAME - * - * - * } - * 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_COUNT + * RESOURCE 0 { + * RESOURCE_NAME + * + * + * } + * 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; } diff --git a/Duffer/IDTFScene.cs b/IDTF.Net/IDTFScene.cs similarity index 99% rename from Duffer/IDTFScene.cs rename to IDTF.Net/IDTFScene.cs index bbc57eb..344ace2 100644 --- a/Duffer/IDTFScene.cs +++ b/IDTF.Net/IDTFScene.cs @@ -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 { /// /// The Scene is the root node in the IDTF file, all objects should be aded to the scene, diff --git a/Duffer/ListExtensions.cs b/IDTF.Net/ListExtensions.cs similarity index 99% rename from Duffer/ListExtensions.cs rename to IDTF.Net/ListExtensions.cs index 7e5b9fe..ecb0afc 100644 --- a/Duffer/ListExtensions.cs +++ b/IDTF.Net/ListExtensions.cs @@ -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 { diff --git a/Duffer/MetaData.cs b/IDTF.Net/MetaData.cs similarity index 97% rename from Duffer/MetaData.cs rename to IDTF.Net/MetaData.cs index be9886e..93d6f90 100644 --- a/Duffer/MetaData.cs +++ b/IDTF.Net/MetaData.cs @@ -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 { diff --git a/Duffer/MetaDataItem.cs b/IDTF.Net/MetaDataItem.cs similarity index 94% rename from Duffer/MetaDataItem.cs rename to IDTF.Net/MetaDataItem.cs index d77d1aa..bd16e13 100644 --- a/Duffer/MetaDataItem.cs +++ b/IDTF.Net/MetaDataItem.cs @@ -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 { diff --git a/Duffer/ModifierDataDescriptions.cs b/IDTF.Net/ModifierDataDescriptions.cs similarity index 78% rename from Duffer/ModifierDataDescriptions.cs rename to IDTF.Net/ModifierDataDescriptions.cs index a6c8225..0cab42f 100644 --- a/Duffer/ModifierDataDescriptions.cs +++ b/IDTF.Net/ModifierDataDescriptions.cs @@ -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 { diff --git a/Duffer/Parent.cs b/IDTF.Net/Parent.cs similarity index 88% rename from Duffer/Parent.cs rename to IDTF.Net/Parent.cs index d6c63a3..4cd0379 100644 --- a/Duffer/Parent.cs +++ b/IDTF.Net/Parent.cs @@ -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 diff --git a/Duffer/ResourceDataDescriptions.cs b/IDTF.Net/ResourceDataDescriptions.cs similarity index 55% rename from Duffer/ResourceDataDescriptions.cs rename to IDTF.Net/ResourceDataDescriptions.cs index 0138171..7a23fb7 100644 --- a/Duffer/ResourceDataDescriptions.cs +++ b/IDTF.Net/ResourceDataDescriptions.cs @@ -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 _textureCoordDimList; public List 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(); - return this._shadingDescriptionList; + if (_shadingDescriptionList == null) _shadingDescriptionList = new List(); + return _shadingDescriptionList; } - set { this._shadingDescriptionList = value; } + set { _shadingDescriptionList = value; } } - public List MeshFacePositionList + public List MeshFacePositionList { get { - if (this._meshFacePositionList == null) this._meshFacePositionList = new List(); - return this._meshFacePositionList; + if (_meshFacePositionList == null) _meshFacePositionList = new List(); + return _meshFacePositionList; } - set { this._meshFacePositionList = value; } - } + set { _meshFacePositionList = value; } + } public List MeshFaceNormalList { get { - if (this._meshFaceNormalList == null) this._meshFaceNormalList = new List(); - return this._meshFaceNormalList; + if (_meshFaceNormalList == null) _meshFaceNormalList = new List(); + return _meshFaceNormalList; } - set { this._meshFaceNormalList = value; } + set { _meshFaceNormalList = value; } } public List MeshFaceShadingList { get { - if (this._meshFaceShadingList == null) this._meshFaceShadingList = new List(); - return this._meshFaceShadingList; + if (_meshFaceShadingList == null) _meshFaceShadingList = new List(); + return _meshFaceShadingList; } - set { this._meshFaceShadingList = value; } + set { _meshFaceShadingList = value; } } public List MeshFaceTextureCoordinateList { get { - if (this._meshFaceTextureCoordinateList == null) this._meshFaceTextureCoordinateList = new List(); - return this._meshFaceTextureCoordinateList; + if (_meshFaceTextureCoordinateList == null) _meshFaceTextureCoordinateList = new List(); + return _meshFaceTextureCoordinateList; } - set { this._meshFaceTextureCoordinateList = value; } + set { _meshFaceTextureCoordinateList = value; } } public List MeshFaceDiffuseColorList { get { - if (this._meshFaceDiffuseColorList == null) this._meshFaceDiffuseColorList = new List(); - return this._meshFaceDiffuseColorList; + if (_meshFaceDiffuseColorList == null) _meshFaceDiffuseColorList = new List(); + return _meshFaceDiffuseColorList; } - set { this._meshFaceDiffuseColorList = value; } + set { _meshFaceDiffuseColorList = value; } } public List MeshFaceSpecularColorList { get { - if (this._meshFaceSpecularColorList == null) this._meshFaceSpecularColorList = new List(); - return this._meshFaceSpecularColorList; + if (_meshFaceSpecularColorList == null) _meshFaceSpecularColorList = new List(); + return _meshFaceSpecularColorList; } - set { this._meshFaceSpecularColorList = value; } + set { _meshFaceSpecularColorList = value; } } public List ModelPositionList { get { - if (this._modelPositionList == null) this._modelPositionList = new List(); - return this._modelPositionList; + if (_modelPositionList == null) _modelPositionList = new List(); + return _modelPositionList; } - set { this._modelPositionList = value; } + set { _modelPositionList = value; } } public List ModelNormalList { get { - if (this._modelNormalList == null) this._modelNormalList = new List(); - return this._modelNormalList; + if (_modelNormalList == null) _modelNormalList = new List(); + return _modelNormalList; } - set { this._modelNormalList = value; } + set { _modelNormalList = value; } } public List ModelDiffuseColorList { get { - if (this._modelDiffuseColorList == null) this._modelDiffuseColorList = new List(); - return this._modelDiffuseColorList; + if (_modelDiffuseColorList == null) _modelDiffuseColorList = new List(); + return _modelDiffuseColorList; } - set { this._modelDiffuseColorList = value; } + set { _modelDiffuseColorList = value; } } public List ModelSpecularColorList { get { - if (this._modelSpecularColorList == null) this._modelSpecularColorList = new List(); - return this._modelSpecularColorList; + if (_modelSpecularColorList == null) _modelSpecularColorList = new List(); + return _modelSpecularColorList; } - set { this._modelSpecularColorList = value; } + set { _modelSpecularColorList = value; } } public List ModelTextureCoordList { get { - if (this._modelTextureCoordList == null) this._modelTextureCoordList = new List(); - return this._modelTextureCoordList; + if (_modelTextureCoordList == null) _modelTextureCoordList = new List(); + return _modelTextureCoordList; } - set { this._modelTextureCoordList = value; } + set { _modelTextureCoordList = value; } } public List MeshBasePositionList { get { - if (this._meshBasePositionList == null) this._meshBasePositionList = new List(); - return this._meshBasePositionList; + if (_meshBasePositionList == null) _meshBasePositionList = new List(); + 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(); return _shadingDescriptionList; } - set { this._shadingDescriptionList = value; } + set { _shadingDescriptionList = value; } } public List LinePositionList { @@ -316,10 +316,10 @@ namespace Duffer { get { - if (this._lineShadingList == null) this._lineShadingList = new List(); - return this._lineShadingList; + if (_lineShadingList == null) _lineShadingList = new List(); + return _lineShadingList; } - set { this._lineShadingList = value; } + set { _lineShadingList = value; } } public List LineTextureCoordinateList { @@ -334,10 +334,10 @@ namespace Duffer { get { - if (this._lineDiffuseColorList == null) this._lineDiffuseColorList = new List(); - return this._lineDiffuseColorList; + if (_lineDiffuseColorList == null) _lineDiffuseColorList = new List(); + return _lineDiffuseColorList; } - set { this._lineDiffuseColorList = value; } + set { _lineDiffuseColorList = value; } } public List LineSpecularColorList { @@ -352,60 +352,60 @@ namespace Duffer { get { - if (this._modelPositionList == null) this._modelPositionList = new List(); - return this._modelPositionList; + if (_modelPositionList == null) _modelPositionList = new List(); + return _modelPositionList; } - set { this._modelPositionList = value; } + set { _modelPositionList = value; } } public List ModelNormalList { get { - if (this._modelNormalList == null) this._modelNormalList = new List(); - return this._modelNormalList; + if (_modelNormalList == null) _modelNormalList = new List(); + return _modelNormalList; } - set { this._modelNormalList = value; } + set { _modelNormalList = value; } } public List ModelDiffuseColorList { get { - if (this._modelDiffuseColorList == null) this._modelDiffuseColorList = new List(); - return this._modelDiffuseColorList; + if (_modelDiffuseColorList == null) _modelDiffuseColorList = new List(); + return _modelDiffuseColorList; } - set { this._modelDiffuseColorList = value; } + set { _modelDiffuseColorList = value; } } public List ModelSpecularColorList { get { - if (this._modelSpecularColorList == null) this._modelSpecularColorList = new List(); - return this._modelSpecularColorList; + if (_modelSpecularColorList == null) _modelSpecularColorList = new List(); + return _modelSpecularColorList; } - set { this._modelSpecularColorList = value; } + set { _modelSpecularColorList = value; } } public List ModelTextureCoordList { get { - if (this._modelTextureCoordList == null) this._modelTextureCoordList = new List(); - return this._modelTextureCoordList; + if (_modelTextureCoordList == null) _modelTextureCoordList = new List(); + 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 diff --git a/Duffer/Transform4x4.cs b/IDTF.Net/Transform4x4.cs similarity index 96% rename from Duffer/Transform4x4.cs rename to IDTF.Net/Transform4x4.cs index 82759c2..efd61ed 100644 --- a/Duffer/Transform4x4.cs +++ b/IDTF.Net/Transform4x4.cs @@ -1,12 +1,7 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; - - -namespace Duffer +namespace IDTF.Net { /// /// A geometric transform, in column/row format diff --git a/PDF3D.Addin/ExportCmd.cs b/PDF3D.Addin/ExportCmd.cs index 557b740..39a1a59 100644 --- a/PDF3D.Addin/ExportCmd.cs +++ b/PDF3D.Addin/ExportCmd.cs @@ -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; diff --git a/PDF3D.Addin/IDTFBuilder.cs b/PDF3D.Addin/IDTFBuilder.cs index 129a520..4d667ca 100644 --- a/PDF3D.Addin/IDTFBuilder.cs +++ b/PDF3D.Addin/IDTFBuilder.cs @@ -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 _shaderIndex = new Dictionary(); - private Parent nullParent = new Duffer.Parent() { Name = "", Transform = new Duffer.Transform4x4() }; - private ShadingDescription defaultShadingDesc = new Duffer.ShadingDescription() { TextureCoordDimensionList = new List(), ShaderID = 0 }; + private Parent nullParent = new Parent() { Name = "", Transform = new Transform4x4() }; + private ShadingDescription defaultShadingDesc = new ShadingDescription() { TextureCoordDimensionList = new List(), 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() { _scene.Groups.Any(x => x.Name == patrent) ? new Parent(patrent) : nullParent } }; + var group = new Group() { Name = name, Parents = new List() { _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() { parent }, + Parents = new List() { 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; diff --git a/PDF3D.sln b/PDF3D.sln index 9084bea..5924ce9 100644 --- a/PDF3D.sln +++ b/PDF3D.sln @@ -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 diff --git a/PDFGenerator/PDFGenerator.csproj b/PDFGenerator/PDFGenerator.csproj index 5442ce3..2505433 100644 --- a/PDFGenerator/PDFGenerator.csproj +++ b/PDFGenerator/PDFGenerator.csproj @@ -22,7 +22,7 @@ - +