Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add model articulations. #167

Merged
merged 1 commit into from
Jun 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions DotNet/CesiumLanguageWriter.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Schema", "Schema", "{04E49F
ProjectSection(SolutionItems) = preProject
..\Schema\AlignedAxis.json = ..\Schema\AlignedAxis.json
..\Schema\ArcType.json = ..\Schema\ArcType.json
..\Schema\Articulation.json = ..\Schema\Articulation.json
..\Schema\Articulations.json = ..\Schema\Articulations.json
..\Schema\BackgroundPadding.json = ..\Schema\BackgroundPadding.json
..\Schema\Billboard.json = ..\Schema\Billboard.json
..\Schema\Boolean.json = ..\Schema\Boolean.json
Expand Down Expand Up @@ -107,6 +109,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{5E
..\Schema\Examples\DistanceDisplayConditionValue.json = ..\Schema\Examples\DistanceDisplayConditionValue.json
..\Schema\Examples\DistanceDisplayConditionValueSamples.json = ..\Schema\Examples\DistanceDisplayConditionValueSamples.json
..\Schema\Examples\DocumentPacket.json = ..\Schema\Examples\DocumentPacket.json
..\Schema\Examples\Articulations.json = ..\Schema\Examples\Articulations.json
..\Schema\Examples\ModelArticulations.json = ..\Schema\Examples\ModelArticulations.json
..\Schema\Examples\ModelNodeTransformations.json = ..\Schema\Examples\ModelNodeTransformations.json
..\Schema\Examples\NearFarScalarValue.json = ..\Schema\Examples\NearFarScalarValue.json
..\Schema\Examples\NearFarScalarValueSamples.json = ..\Schema\Examples\NearFarScalarValueSamples.json
Expand Down
2 changes: 2 additions & 0 deletions DotNet/CesiumLanguageWriter/CesiumLanguageWriter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="Generated\ArcTypeCesiumWriter.cs" />
<Compile Include="Generated\ArticulationCesiumWriter.cs" />
<Compile Include="Generated\ArticulationsCesiumWriter.cs" />
<Compile Include="Generated\BackgroundPaddingCesiumWriter.cs" />
<Compile Include="Generated\BillboardCesiumWriter.cs">
<SubType>Code</SubType>
Expand Down
207 changes: 207 additions & 0 deletions DotNet/CesiumLanguageWriter/Generated/ArticulationCesiumWriter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
// <auto-generated>
// This file was generated automatically by GenerateFromSchema. Do NOT edit it.
// https://github.com/AnalyticalGraphicsInc/czml-writer
// </auto-generated>

using CesiumLanguageWriter.Advanced;
using System;
using JetBrains.Annotations;
using System.Collections.Generic;

namespace CesiumLanguageWriter
{
/// <summary>
/// Writes a <c>Articulation</c> to a <see cref="CesiumOutputStream"/>. A <c>Articulation</c> is an articulation value.
/// </summary>
public class ArticulationCesiumWriter : CesiumInterpolatablePropertyWriter<ArticulationCesiumWriter>, ICesiumDeletablePropertyWriter, ICesiumDoubleValuePropertyWriter, ICesiumReferenceValuePropertyWriter
{
/// <summary>
/// The name of the <c>number</c> property.
/// </summary>
public const string NumberPropertyName = "number";

/// <summary>
/// The name of the <c>reference</c> property.
/// </summary>
public const string ReferencePropertyName = "reference";

/// <summary>
/// The name of the <c>delete</c> property.
/// </summary>
public const string DeletePropertyName = "delete";

private readonly Lazy<CesiumDoubleValuePropertyAdaptor<ArticulationCesiumWriter>> m_asNumber;
private readonly Lazy<CesiumReferenceValuePropertyAdaptor<ArticulationCesiumWriter>> m_asReference;

/// <summary>
/// Initializes a new instance.
/// </summary>
/// <param name="propertyName">The name of the property.</param>
public ArticulationCesiumWriter([NotNull] string propertyName)
: base(propertyName)
{
m_asNumber = CreateAsNumber();
m_asReference = CreateAsReference();
}

/// <summary>
/// Initializes a new instance as a copy of an existing instance.
/// </summary>
/// <param name="existingInstance">The existing instance to copy.</param>
protected ArticulationCesiumWriter([NotNull] ArticulationCesiumWriter existingInstance)
: base(existingInstance)
{
m_asNumber = CreateAsNumber();
m_asReference = CreateAsReference();
}

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

/// <summary>
/// Writes the value expressed as a <c>number</c>, which is the articulation value.
/// </summary>
/// <param name="value">The value.</param>
public void WriteNumber(double value)
{
const string PropertyName = NumberPropertyName;
if (ForceInterval)
{
OpenIntervalIfNecessary();
}
if (IsInterval)
{
Output.WritePropertyName(PropertyName);
}
Output.WriteValue(value);
}

/// <summary>
/// Writes the value expressed as a <c>number</c>, which is the articulation value.
/// </summary>
/// <param name="dates">The dates at which the value is specified.</param>
/// <param name="values">The values corresponding to each date.</param>
public void WriteNumber(IList<JulianDate> dates, IList<double> values)
{
WriteNumber(dates, values, 0, dates.Count);
}

/// <summary>
/// Writes the value expressed as a <c>number</c>, which is the articulation value.
/// </summary>
/// <param name="dates">The dates at which the value is specified.</param>
/// <param name="values">The value corresponding to each date.</param>
/// <param name="startIndex">The index of the first element to write.</param>
/// <param name="length">The number of elements to write.</param>
public void WriteNumber(IList<JulianDate> dates, IList<double> values, int startIndex, int length)
{
const string PropertyName = NumberPropertyName;
OpenIntervalIfNecessary();
CesiumWritingHelper.WriteDouble(Output, PropertyName, dates, values, startIndex, length);
}

/// <summary>
/// Writes the value expressed as a <c>reference</c>, which is the articulation value specified as a reference to another property.
/// </summary>
/// <param name="value">The reference.</param>
public void WriteReference(Reference value)
{
const string PropertyName = ReferencePropertyName;
OpenIntervalIfNecessary();
Output.WritePropertyName(PropertyName);
CesiumWritingHelper.WriteReference(Output, value);
}

/// <summary>
/// Writes the value expressed as a <c>reference</c>, which is the articulation value specified as a reference to another property.
/// </summary>
/// <param name="value">The reference.</param>
public void WriteReference(string value)
{
const string PropertyName = ReferencePropertyName;
OpenIntervalIfNecessary();
Output.WritePropertyName(PropertyName);
CesiumWritingHelper.WriteReference(Output, value);
}

/// <summary>
/// Writes the value expressed as a <c>reference</c>, which is the articulation value specified as a reference to another property.
/// </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 WriteReference(string identifier, string propertyName)
{
const string PropertyName = ReferencePropertyName;
OpenIntervalIfNecessary();
Output.WritePropertyName(PropertyName);
CesiumWritingHelper.WriteReference(Output, identifier, propertyName);
}

/// <summary>
/// Writes the value expressed as a <c>reference</c>, which is the articulation value specified as a reference to another property.
/// </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 WriteReference(string identifier, string[] propertyNames)
{
const string PropertyName = ReferencePropertyName;
OpenIntervalIfNecessary();
Output.WritePropertyName(PropertyName);
CesiumWritingHelper.WriteReference(Output, identifier, propertyNames);
}

/// <summary>
/// Writes the value expressed as a <c>delete</c>, which is whether the client should delete existing samples or interval data for this property. Data will be deleted for the containing interval, or if there is no containing interval, then all data. If true, all other properties in this property will be ignored.
/// </summary>
/// <param name="value">The value.</param>
public void WriteDelete(bool value)
{
const string PropertyName = DeletePropertyName;
OpenIntervalIfNecessary();
Output.WritePropertyName(PropertyName);
Output.WriteValue(value);
}

/// <summary>
/// Returns a wrapper for this instance that implements <see cref="ICesiumDoubleValuePropertyWriter"/>. Because the returned instance is a wrapper for this instance, you may call <see cref="ICesiumElementWriter.Close"/> on either this instance or the wrapper, but you must not call it on both.
/// </summary>
/// <returns>The wrapper.</returns>
public CesiumDoubleValuePropertyAdaptor<ArticulationCesiumWriter> AsNumber()
{
return m_asNumber.Value;
}

private Lazy<CesiumDoubleValuePropertyAdaptor<ArticulationCesiumWriter>> CreateAsNumber()
{
return new Lazy<CesiumDoubleValuePropertyAdaptor<ArticulationCesiumWriter>>(CreateDouble, false);
}

private CesiumDoubleValuePropertyAdaptor<ArticulationCesiumWriter> CreateDouble()
{
return CesiumValuePropertyAdaptors.CreateDouble(this);
}

/// <summary>
/// Returns a wrapper for this instance that implements <see cref="ICesiumReferenceValuePropertyWriter"/>. Because the returned instance is a wrapper for this instance, you may call <see cref="ICesiumElementWriter.Close"/> on either this instance or the wrapper, but you must not call it on both.
/// </summary>
/// <returns>The wrapper.</returns>
public CesiumReferenceValuePropertyAdaptor<ArticulationCesiumWriter> AsReference()
{
return m_asReference.Value;
}

private Lazy<CesiumReferenceValuePropertyAdaptor<ArticulationCesiumWriter>> CreateAsReference()
{
return new Lazy<CesiumReferenceValuePropertyAdaptor<ArticulationCesiumWriter>>(CreateReference, false);
}

private CesiumReferenceValuePropertyAdaptor<ArticulationCesiumWriter> CreateReference()
{
return CesiumValuePropertyAdaptors.CreateReference(this);
}

}
}
60 changes: 60 additions & 0 deletions DotNet/CesiumLanguageWriter/Generated/ArticulationsCesiumWriter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// <auto-generated>
// This file was generated automatically by GenerateFromSchema. Do NOT edit it.
// https://github.com/AnalyticalGraphicsInc/czml-writer
// </auto-generated>

using CesiumLanguageWriter.Advanced;
using System;
using JetBrains.Annotations;

namespace CesiumLanguageWriter
{
/// <summary>
/// Writes a <c>Articulations</c> to a <see cref="CesiumOutputStream"/>. A <c>Articulations</c> is a mapping of keys to articulation values, where the keys are the name of the articulation, a single space, and the name of the stage.
/// </summary>
public class ArticulationsCesiumWriter : CesiumPropertyWriter<ArticulationsCesiumWriter>
{
/// <summary>
/// Initializes a new instance.
/// </summary>
/// <param name="propertyName">The name of the property.</param>
public ArticulationsCesiumWriter([NotNull] 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 ArticulationsCesiumWriter([NotNull] ArticulationsCesiumWriter existingInstance)
: base(existingInstance)
{
}

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

/// <summary>
/// Gets a new writer for a <c>Articulation</c> property. The returned instance must be opened by calling the <see cref="CesiumElementWriter.Open"/> method before it can be used for writing. A <c>Articulation</c> property defines articulation values to apply to a 3D model.
/// </summary>
public ArticulationCesiumWriter GetArticulationWriter(string name)
{
return new ArticulationCesiumWriter(name);
}

/// <summary>
/// Opens and returns a new writer for a <c>Articulation</c> property. A <c>Articulation</c> property defines articulation values to apply to a 3D model.
/// </summary>
/// <param name="name">The name of the new property writer.</param>
public ArticulationCesiumWriter OpenArticulationProperty(string name)
{
OpenIntervalIfNecessary();
return OpenAndReturn(new ArticulationCesiumWriter(name));
}

}
}
25 changes: 25 additions & 0 deletions DotNet/CesiumLanguageWriter/Generated/ModelCesiumWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ public class ModelCesiumWriter : CesiumPropertyWriter<ModelCesiumWriter>
/// </summary>
public const string NodeTransformationsPropertyName = "nodeTransformations";

/// <summary>
/// The name of the <c>articulations</c> property.
/// </summary>
public const string ArticulationsPropertyName = "articulations";

private readonly Lazy<BooleanCesiumWriter> m_show = new Lazy<BooleanCesiumWriter>(() => new BooleanCesiumWriter(ShowPropertyName), false);
private readonly Lazy<UriCesiumWriter> m_gltf = new Lazy<UriCesiumWriter>(() => new UriCesiumWriter(GltfPropertyName), false);
private readonly Lazy<DoubleCesiumWriter> m_scale = new Lazy<DoubleCesiumWriter>(() => new DoubleCesiumWriter(ScalePropertyName), false);
Expand All @@ -112,6 +117,7 @@ public class ModelCesiumWriter : CesiumPropertyWriter<ModelCesiumWriter>
private readonly Lazy<DoubleCesiumWriter> m_colorBlendAmount = new Lazy<DoubleCesiumWriter>(() => new DoubleCesiumWriter(ColorBlendAmountPropertyName), false);
private readonly Lazy<DistanceDisplayConditionCesiumWriter> m_distanceDisplayCondition = new Lazy<DistanceDisplayConditionCesiumWriter>(() => new DistanceDisplayConditionCesiumWriter(DistanceDisplayConditionPropertyName), false);
private readonly Lazy<NodeTransformationsCesiumWriter> m_nodeTransformations = new Lazy<NodeTransformationsCesiumWriter>(() => new NodeTransformationsCesiumWriter(NodeTransformationsPropertyName), false);
private readonly Lazy<ArticulationsCesiumWriter> m_articulations = new Lazy<ArticulationsCesiumWriter>(() => new ArticulationsCesiumWriter(ArticulationsPropertyName), false);

/// <summary>
/// Initializes a new instance.
Expand Down Expand Up @@ -1825,5 +1831,24 @@ public NodeTransformationsCesiumWriter OpenNodeTransformationsProperty()
return OpenAndReturn(NodeTransformationsWriter);
}

/// <summary>
/// Gets the writer for the <c>articulations</c> property. The returned instance must be opened by calling the <see cref="CesiumElementWriter.Open"/> method before it can be used for writing. The <c>articulations</c> property defines a mapping of keys to articulation values, where the keys are the name of the articulation, a single space, and the name of the stage.
/// </summary>
[NotNull]
public ArticulationsCesiumWriter ArticulationsWriter
{
get { return m_articulations.Value; }
}

/// <summary>
/// Opens and returns the writer for the <c>articulations</c> property. The <c>articulations</c> property defines a mapping of keys to articulation values, where the keys are the name of the articulation, a single space, and the name of the stage.
/// </summary>
[NotNull]
public ArticulationsCesiumWriter OpenArticulationsProperty()
{
OpenIntervalIfNecessary();
return OpenAndReturn(ArticulationsWriter);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
<Compile Include="grisu\TestGrisu.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Sandbox.cs" />
<Compile Include="TestArticulationsCesiumWriter.cs" />
<Compile Include="TestBillboardCesiumWriter.cs" />
<Compile Include="TestBooleanCesiumWriter.cs" />
<Compile Include="TestBoundingRectangle.cs" />
Expand Down
Loading