Skip to content

Commit

Permalink
Merge pull request #110 from AnalyticalGraphicsInc/addPolylineArrow
Browse files Browse the repository at this point in the history
Add PolylineArrowMaterial.
  • Loading branch information
shunter committed Jun 8, 2016
2 parents 7586f55 + 2ef3553 commit 4c22108
Show file tree
Hide file tree
Showing 30 changed files with 1,369 additions and 112 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
using System;
using System.Diagnostics;

/// <summary>
/// Mark code to be excluded by the CSToJava Java conversion tool.
/// </summary>
[Conditional("CSTOJAVA")]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum |
AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property |
AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface |
AttributeTargets.Delegate)]
[CSToJavaExclude]
[CoverageExcludeAttribute]
internal sealed class CSToJavaExcludeAttribute : Attribute
{
public CSToJavaExcludeAttribute()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using System;
using System.Diagnostics;

/// <summary>
/// Indicate that a particular base class or interface implementation should be excluded by the
/// CSToJava Java conversion tool.
/// </summary>
[Conditional("CSTOJAVA")]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, AllowMultiple = true)]
[CSToJavaExclude]
[CoverageExcludeAttribute]
internal class CSToJavaExcludeBaseAttribute : Attribute
{
public CSToJavaExcludeBaseAttribute(string typeName)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using System;
using System.Diagnostics;

/// <summary>
/// Mark a value type as being immutable, and therefore not necessary to clone when making copies.
/// </summary>
[Conditional("CSTOJAVA")]
[AttributeUsage(AttributeTargets.Struct)]
[CSToJavaExclude]
[CoverageExcludeAttribute]
internal sealed class CSToJavaImmutableValueType : Attribute
{
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using System;
using System.Diagnostics;

/// <summary>
/// Mark code to be renamed by the CSToJava Java conversion tool.
/// </summary>
[Conditional("CSTOJAVA")]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum |
AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Interface)]
[CSToJavaExclude]
[CoverageExcludeAttribute]
internal sealed class CSToJavaRenameAttribute : Attribute
{
public CSToJavaRenameAttribute(string newName)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
using System;
using System.Diagnostics;

/// <summary>
/// Declare that the default value of a generic type, e.g. default(T), should be
/// treated as null instead of using TypeLiterals to produce correct values at
/// run-time.
/// </summary>
[Conditional("CSTOJAVA")]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum |
AttributeTargets.Constructor | AttributeTargets.Method |
AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface |
AttributeTargets.Delegate, AllowMultiple = true)]
[CSToJavaExclude]
[CoverageExcludeAttribute]
internal class CSToJavaUseNullForDefaultGenericTypeValueAttribute : Attribute
{
public CSToJavaUseNullForDefaultGenericTypeValueAttribute(string genericTypeName)
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion DotNet/CesiumLanguageWriter/CesiumLanguageWriter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
<Compile Include="Advanced\ICesiumValuePropertyWriter.cs" />
<Compile Include="Advanced\ICesiumWriterAdaptor.cs" />
<Compile Include="Advanced\PassThroughCesiumUriResolver.cs" />
<Compile Include="Attributes\CoverageExcludeAttribute.cs" />
<Compile Include="Attributes\CSToJavaExcludeAttribute.cs" />
<Compile Include="Attributes\CSToJavaExcludeBaseAttribute.cs" />
<Compile Include="Attributes\CSToJavaImmutableValueType.cs" />
Expand Down Expand Up @@ -120,6 +119,7 @@
<Compile Include="Generated\PixelOffsetCesiumWriter.cs" />
<Compile Include="Generated\PointCesiumWriter.cs" />
<Compile Include="Generated\PolygonCesiumWriter.cs" />
<Compile Include="Generated\PolylineArrowMaterialCesiumWriter.cs" />
<Compile Include="Generated\PolylineCesiumWriter.cs" />
<Compile Include="Generated\PolylineGlowMaterialCesiumWriter.cs" />
<Compile Include="Generated\PolylineMaterialCesiumWriter.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
// This file was generated automatically by GenerateFromSchema. Do NOT edit it.
// https://github.com/AnalyticalGraphicsInc/czml-writer

using CesiumLanguageWriter.Advanced;
using System;
using System.Drawing;
using System.Collections.Generic;

namespace CesiumLanguageWriter
{
/// <summary>
/// Writes a <code>PolylineArrowMaterial</code> to a <see cref="CesiumOutputStream" />. A <code>PolylineArrowMaterial</code> is a material that fills the surface of a line with an arrow.
/// </summary>
public class PolylineArrowMaterialCesiumWriter : CesiumPropertyWriter<PolylineArrowMaterialCesiumWriter>
{
/// <summary>
/// The name of the <code>color</code> property.
/// </summary>
public const string ColorPropertyName = "color";

private readonly Lazy<ColorCesiumWriter> m_color = new Lazy<ColorCesiumWriter>(() => new ColorCesiumWriter(ColorPropertyName), false);

/// <summary>
/// Initializes a new instance.
/// </summary>
public PolylineArrowMaterialCesiumWriter(string propertyName)
: base(propertyName)
{
}

/// <summary>
/// Initializes a new instance as a copy of an existing instance.
/// </summary>
/// <param name="existingInstance">The existing instance to copy.</param>
protected PolylineArrowMaterialCesiumWriter(PolylineArrowMaterialCesiumWriter existingInstance)
: base(existingInstance)
{
}

/// <inheritdoc />
public override PolylineArrowMaterialCesiumWriter Clone()
{
return new PolylineArrowMaterialCesiumWriter(this);
}

/// <summary>
/// Gets the writer for the <code>color</code> property. The returned instance must be opened by calling the <see cref="CesiumElementWriter.Open"/> method before it can be used for writing. The <code>color</code> property defines the color of the surface.
/// </summary>
public ColorCesiumWriter ColorWriter
{
get { return m_color.Value; }
}

/// <summary>
/// Opens and returns the writer for the <code>color</code> property. The <code>color</code> property defines the color of the surface.
/// </summary>
public ColorCesiumWriter OpenColorProperty()
{
OpenIntervalIfNecessary();
return OpenAndReturn(ColorWriter);
}

/// <summary>
/// Writes a value for the <code>color</code> property as a <code>rgba</code> value. The <code>color</code> property specifies the color of the surface.
/// </summary>
/// <param name="color">The color.</param>
public void WriteColorProperty(Color color)
{
using (var writer = OpenColorProperty())
{
writer.WriteRgba(color);
}
}

/// <summary>
/// Writes a value for the <code>color</code> property as a <code>rgba</code> value. The <code>color</code> property specifies the color of the surface.
/// </summary>
/// <param name="red">The red component in the range 0 to 255.</param>
/// <param name="green">The green component in the range 0 to 255.</param>
/// <param name="blue">The blue component in the range 0 to 255.</param>
/// <param name="alpha">The alpha component in the range 0 to 255.</param>
public void WriteColorProperty(int red, int green, int blue, int alpha)
{
using (var writer = OpenColorProperty())
{
writer.WriteRgba(red, green, blue, alpha);
}
}

/// <summary>
/// Writes a value for the <code>color</code> property as a <code>rgba</code> value. The <code>color</code> property specifies the color of the surface.
/// </summary>
/// <param name="dates">The dates at which the value is specified.</param>
/// <param name="colors">The color corresponding to each date.</param>
/// <param name="startIndex">The index of the first element to use in the `colors` collection.</param>
/// <param name="length">The number of elements to use from the `colors` collection.</param>
public void WriteColorProperty(IList<JulianDate> dates, IList<Color> colors, int startIndex, int length)
{
using (var writer = OpenColorProperty())
{
writer.WriteRgba(dates, colors, startIndex, length);
}
}

/// <summary>
/// Writes a value for the <code>color</code> property as a <code>rgbaf</code> value. The <code>color</code> property specifies the color of the surface.
/// </summary>
/// <param name="red">The red component in the range 0 to 1.0.</param>
/// <param name="green">The green component in the range 0 to 1.0.</param>
/// <param name="blue">The blue component in the range 0 to 1.0.</param>
/// <param name="alpha">The alpha component in the range 0 to 1.0.</param>
public void WriteColorPropertyRgbaf(float red, float green, float blue, float alpha)
{
using (var writer = OpenColorProperty())
{
writer.WriteRgbaf(red, green, blue, alpha);
}
}

/// <summary>
/// Writes a value for the <code>color</code> property as a <code>reference</code> value. The <code>color</code> property specifies the color of the surface.
/// </summary>
/// <param name="value">The reference.</param>
public void WriteColorPropertyReference(Reference value)
{
using (var writer = OpenColorProperty())
{
writer.WriteReference(value);
}
}

/// <summary>
/// Writes a value for the <code>color</code> property as a <code>reference</code> value. The <code>color</code> property specifies the color of the surface.
/// </summary>
/// <param name="value">The earliest date of the interval.</param>
public void WriteColorPropertyReference(string value)
{
using (var writer = OpenColorProperty())
{
writer.WriteReference(value);
}
}

/// <summary>
/// Writes a value for the <code>color</code> property as a <code>reference</code> value. The <code>color</code> property specifies the color of the surface.
/// </summary>
/// <param name="identifier">The identifier of the object which contains the referenced property.</param>
/// <param name="propertyName">The property on the referenced object.</param>
public void WriteColorPropertyReference(string identifier, string propertyName)
{
using (var writer = OpenColorProperty())
{
writer.WriteReference(identifier, propertyName);
}
}

/// <summary>
/// Writes a value for the <code>color</code> property as a <code>reference</code> value. The <code>color</code> property specifies the color of the surface.
/// </summary>
/// <param name="identifier">The identifier of the object which contains the referenced property.</param>
/// <param name="propertyNames">The hierarchy of properties to be indexed on the referenced object.</param>
public void WriteColorPropertyReference(string identifier, string[] propertyNames)
{
using (var writer = OpenColorProperty())
{
writer.WriteReference(identifier, propertyNames);
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ public class PolylineMaterialCesiumWriter : CesiumPropertyWriter<PolylineMateria
/// </summary>
public const string PolylineOutlinePropertyName = "polylineOutline";

/// <summary>
/// The name of the <code>polylineArrow</code> property.
/// </summary>
public const string PolylineArrowPropertyName = "polylineArrow";

/// <summary>
/// The name of the <code>polylineGlow</code> property.
/// </summary>
Expand All @@ -45,6 +50,7 @@ public class PolylineMaterialCesiumWriter : CesiumPropertyWriter<PolylineMateria

private readonly Lazy<SolidColorMaterialCesiumWriter> m_solidColor = new Lazy<SolidColorMaterialCesiumWriter>(() => new SolidColorMaterialCesiumWriter(SolidColorPropertyName), false);
private readonly Lazy<PolylineOutlineMaterialCesiumWriter> m_polylineOutline = new Lazy<PolylineOutlineMaterialCesiumWriter>(() => new PolylineOutlineMaterialCesiumWriter(PolylineOutlinePropertyName), false);
private readonly Lazy<PolylineArrowMaterialCesiumWriter> m_polylineArrow = new Lazy<PolylineArrowMaterialCesiumWriter>(() => new PolylineArrowMaterialCesiumWriter(PolylineArrowPropertyName), false);
private readonly Lazy<PolylineGlowMaterialCesiumWriter> m_polylineGlow = new Lazy<PolylineGlowMaterialCesiumWriter>(() => new PolylineGlowMaterialCesiumWriter(PolylineGlowPropertyName), false);
private readonly Lazy<ImageMaterialCesiumWriter> m_image = new Lazy<ImageMaterialCesiumWriter>(() => new ImageMaterialCesiumWriter(ImagePropertyName), false);
private readonly Lazy<GridMaterialCesiumWriter> m_grid = new Lazy<GridMaterialCesiumWriter>(() => new GridMaterialCesiumWriter(GridPropertyName), false);
Expand Down Expand Up @@ -107,6 +113,23 @@ public PolylineOutlineMaterialCesiumWriter OpenPolylineOutlineProperty()
return OpenAndReturn(PolylineOutlineWriter);
}

/// <summary>
/// Gets the writer for the <code>polylineArrow</code> property. The returned instance must be opened by calling the <see cref="CesiumElementWriter.Open"/> method before it can be used for writing. The <code>polylineArrow</code> property defines a material that fills the line with an arrow.
/// </summary>
public PolylineArrowMaterialCesiumWriter PolylineArrowWriter
{
get { return m_polylineArrow.Value; }
}

/// <summary>
/// Opens and returns the writer for the <code>polylineArrow</code> property. The <code>polylineArrow</code> property defines a material that fills the line with an arrow.
/// </summary>
public PolylineArrowMaterialCesiumWriter OpenPolylineArrowProperty()
{
OpenIntervalIfNecessary();
return OpenAndReturn(PolylineArrowWriter);
}

/// <summary>
/// Gets the writer for the <code>polylineGlow</code> property. The returned instance must be opened by calling the <see cref="CesiumElementWriter.Open"/> method before it can be used for writing. The <code>polylineGlow</code> property defines a material that fills the line with a glowing color.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@
<Compile Include="Advanced\TestCesiumWritingHelper.cs" />
<Compile Include="grisu\TestGrisu.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestBillboardCesiumWriter.cs" />
<Compile Include="TestBooleanCesiumWriter.cs" />
<Compile Include="TestCartesian3.cs" />
<Compile Include="TestCartographic.cs" />
<Compile Include="TestCesiumInterpolatablePropertyWriter.cs" />
<Compile Include="TestDoubleCesiumWriter.cs" />
<Compile Include="TestHorizontalOriginCesiumWriter.cs" />
<Compile Include="TestLabelStyleCesiumWriter.cs" />
<Compile Include="TestPacketCesiumWriter.cs" />
<Compile Include="TestCesiumPropertyWriter.cs" />
<Compile Include="TestCesiumStreamWriter.cs" />
Expand All @@ -66,10 +71,12 @@
<Compile Include="TestPositionCesiumWriter.cs" />
<Compile Include="TestPropertiesOfSimpleJsonTypes.cs" />
<Compile Include="TestReference.cs" />
<Compile Include="TestStringCesiumWriter.cs" />
<Compile Include="TestTimeInterval.cs" />
<Compile Include="TestUnitCartesian3.cs" />
<Compile Include="TestUnitQuaternion.cs" />
<Compile Include="TestUnitSpherical.cs" />
<Compile Include="TestVerticalOriginCesiumWriter.cs" />
<Compile Include="TestYearMonthDay.cs" />
</ItemGroup>
<ItemGroup>
Expand Down
15 changes: 15 additions & 0 deletions DotNet/CesiumLanguageWriterTests/TestBillboardCesiumWriter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using CesiumLanguageWriter;
using CesiumLanguageWriter.Advanced;
using NUnit.Framework;

namespace CesiumLanguageWriterTests
{
[TestFixture]
public class TestBillboardCesiumWriter : TestCesiumPropertyWriter<BillboardCesiumWriter>
{
protected override CesiumPropertyWriter<BillboardCesiumWriter> CreatePropertyWriter(string propertyName)
{
return new BillboardCesiumWriter(propertyName);
}
}
}
Loading

0 comments on commit 4c22108

Please sign in to comment.