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 velocityReference orientation support. #142

Merged
merged 1 commit into from
Sep 27, 2017
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
72 changes: 72 additions & 0 deletions DotNet/CesiumLanguageWriter/Generated/OrientationCesiumWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ public class OrientationCesiumWriter : CesiumInterpolatablePropertyWriter<Orient
/// </summary>
public const string ReferencePropertyName = "reference";

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

private readonly Lazy<ICesiumInterpolatableValuePropertyWriter<UnitQuaternion>> m_asUnitQuaternion;
private readonly Lazy<ICesiumValuePropertyWriter<Reference>> m_asReference;
private readonly Lazy<ICesiumValuePropertyWriter<Reference>> m_asVelocityReference;

/// <summary>
/// Initializes a new instance.
Expand All @@ -33,6 +39,7 @@ public OrientationCesiumWriter(string propertyName)
{
m_asUnitQuaternion = new Lazy<ICesiumInterpolatableValuePropertyWriter<UnitQuaternion>>(CreateUnitQuaternionAdaptor, false);
m_asReference = new Lazy<ICesiumValuePropertyWriter<Reference>>(CreateReferenceAdaptor, false);
m_asVelocityReference = new Lazy<ICesiumValuePropertyWriter<Reference>>(CreateVelocityReferenceAdaptor, false);
}

/// <summary>
Expand All @@ -44,6 +51,7 @@ protected OrientationCesiumWriter(OrientationCesiumWriter existingInstance)
{
m_asUnitQuaternion = new Lazy<ICesiumInterpolatableValuePropertyWriter<UnitQuaternion>>(CreateUnitQuaternionAdaptor, false);
m_asReference = new Lazy<ICesiumValuePropertyWriter<Reference>>(CreateReferenceAdaptor, false);
m_asVelocityReference = new Lazy<ICesiumValuePropertyWriter<Reference>>(CreateVelocityReferenceAdaptor, false);
}

/// <inheritdoc />
Expand Down Expand Up @@ -138,6 +146,56 @@ public void WriteReference(string identifier, string[] propertyNames)
CesiumWritingHelper.WriteReference(Output, identifier, propertyNames);
}

/// <summary>
/// Writes the value expressed as a <c>velocityReference</c>, which is the orientation specified as the normalized velocity vector of a position property. The reference must be to a <c>position</c> property.
/// </summary>
/// <param name="value">The reference.</param>
public void WriteVelocityReference(Reference value)
{
const string PropertyName = VelocityReferencePropertyName;
OpenIntervalIfNecessary();
Output.WritePropertyName(PropertyName);
CesiumWritingHelper.WriteReference(Output, value);
}

/// <summary>
/// Writes the value expressed as a <c>velocityReference</c>, which is the orientation specified as the normalized velocity vector of a position property. The reference must be to a <c>position</c> property.
/// </summary>
/// <param name="value">The earliest date of the interval.</param>
public void WriteVelocityReference(string value)
{
const string PropertyName = VelocityReferencePropertyName;
OpenIntervalIfNecessary();
Output.WritePropertyName(PropertyName);
CesiumWritingHelper.WriteReference(Output, value);
}

/// <summary>
/// Writes the value expressed as a <c>velocityReference</c>, which is the orientation specified as the normalized velocity vector of a position property. The reference must be to a <c>position</c> 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 WriteVelocityReference(string identifier, string propertyName)
{
const string PropertyName = VelocityReferencePropertyName;
OpenIntervalIfNecessary();
Output.WritePropertyName(PropertyName);
CesiumWritingHelper.WriteReference(Output, identifier, propertyName);
}

/// <summary>
/// Writes the value expressed as a <c>velocityReference</c>, which is the orientation specified as the normalized velocity vector of a position property. The reference must be to a <c>position</c> 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 WriteVelocityReference(string identifier, string[] propertyNames)
{
const string PropertyName = VelocityReferencePropertyName;
OpenIntervalIfNecessary();
Output.WritePropertyName(PropertyName);
CesiumWritingHelper.WriteReference(Output, identifier, propertyNames);
}

/// <summary>
/// Returns a wrapper for this instance that implements <see cref="ICesiumInterpolatableValuePropertyWriter{T}" /> to write a value in <c>UnitQuaternion</c> format. 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>
Expand Down Expand Up @@ -166,5 +224,19 @@ private ICesiumValuePropertyWriter<Reference> CreateReferenceAdaptor()
return new CesiumWriterAdaptor<OrientationCesiumWriter, Reference>(this, (me, value) => me.WriteReference(value));
}

/// <summary>
/// Returns a wrapper for this instance that implements <see cref="ICesiumValuePropertyWriter{T}" /> to write a value in <c>VelocityReference</c> format. 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 ICesiumValuePropertyWriter<Reference> AsVelocityReference()
{
return m_asVelocityReference.Value;
}

private ICesiumValuePropertyWriter<Reference> CreateVelocityReferenceAdaptor()
{
return new CesiumWriterAdaptor<OrientationCesiumWriter, Reference>(this, (me, value) => me.WriteVelocityReference(value));
}

}
}
50 changes: 50 additions & 0 deletions DotNet/CesiumLanguageWriter/Generated/PacketCesiumWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,56 @@ public void WriteOrientationPropertyReference(string identifier, string[] proper
}
}

/// <summary>
/// Writes a value for the <c>orientation</c> property as a <c>velocityReference</c> value. The <c>orientation</c> property specifies the orientation of the object in the world. The orientation has no direct visual representation, but it is used to orient models, cones, pyramids, and other graphical items attached to the object.
/// </summary>
/// <param name="value">The reference.</param>
public void WriteOrientationPropertyVelocityReference(Reference value)
{
using (var writer = OpenOrientationProperty())
{
writer.WriteVelocityReference(value);
}
}

/// <summary>
/// Writes a value for the <c>orientation</c> property as a <c>velocityReference</c> value. The <c>orientation</c> property specifies the orientation of the object in the world. The orientation has no direct visual representation, but it is used to orient models, cones, pyramids, and other graphical items attached to the object.
/// </summary>
/// <param name="value">The earliest date of the interval.</param>
public void WriteOrientationPropertyVelocityReference(string value)
{
using (var writer = OpenOrientationProperty())
{
writer.WriteVelocityReference(value);
}
}

/// <summary>
/// Writes a value for the <c>orientation</c> property as a <c>velocityReference</c> value. The <c>orientation</c> property specifies the orientation of the object in the world. The orientation has no direct visual representation, but it is used to orient models, cones, pyramids, and other graphical items attached to the object.
/// </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 WriteOrientationPropertyVelocityReference(string identifier, string propertyName)
{
using (var writer = OpenOrientationProperty())
{
writer.WriteVelocityReference(identifier, propertyName);
}
}

/// <summary>
/// Writes a value for the <c>orientation</c> property as a <c>velocityReference</c> value. The <c>orientation</c> property specifies the orientation of the object in the world. The orientation has no direct visual representation, but it is used to orient models, cones, pyramids, and other graphical items attached to the object.
/// </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 WriteOrientationPropertyVelocityReference(string identifier, string[] propertyNames)
{
using (var writer = OpenOrientationProperty())
{
writer.WriteVelocityReference(identifier, propertyNames);
}
}

/// <summary>
/// Gets the writer for the <c>viewFrom</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>viewFrom</c> property defines a suggested camera location when viewing this object. The property is specified as a Cartesian position in the East (x), North (y), Up (z) reference frame relative to the object's position.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,16 @@ public class OrientationCesiumWriter extends CesiumInterpolatablePropertyWriter<

*/
public static final String ReferencePropertyName = "reference";
/**
*
The name of the {@code velocityReference} property.


*/
public static final String VelocityReferencePropertyName = "velocityReference";
private Lazy<ICesiumInterpolatableValuePropertyWriter<UnitQuaternion>> m_asUnitQuaternion;
private Lazy<ICesiumValuePropertyWriter<Reference>> m_asReference;
private Lazy<ICesiumValuePropertyWriter<Reference>> m_asVelocityReference;

/**
*
Expand All @@ -54,6 +62,12 @@ public cesiumlanguagewriter.advanced.ICesiumValuePropertyWriter<Reference> invok
return createReferenceAdaptor();
}
}, false);
m_asVelocityReference = new Lazy<cesiumlanguagewriter.advanced.ICesiumValuePropertyWriter<Reference>>(new Func1<cesiumlanguagewriter.advanced.ICesiumValuePropertyWriter<Reference>>(this,
"createVelocityReferenceAdaptor", new Class[] {}) {
public cesiumlanguagewriter.advanced.ICesiumValuePropertyWriter<Reference> invoke() {
return createVelocityReferenceAdaptor();
}
}, false);
}

/**
Expand All @@ -78,6 +92,12 @@ public cesiumlanguagewriter.advanced.ICesiumValuePropertyWriter<Reference> invok
return createReferenceAdaptor();
}
}, false);
m_asVelocityReference = new Lazy<cesiumlanguagewriter.advanced.ICesiumValuePropertyWriter<Reference>>(new Func1<cesiumlanguagewriter.advanced.ICesiumValuePropertyWriter<Reference>>(this,
"createVelocityReferenceAdaptor", new Class[] {}) {
public cesiumlanguagewriter.advanced.ICesiumValuePropertyWriter<Reference> invoke() {
return createVelocityReferenceAdaptor();
}
}, false);
}

@Override
Expand Down Expand Up @@ -198,6 +218,70 @@ public final void writeReference(String identifier, String[] propertyNames) {
CesiumWritingHelper.writeReference(getOutput(), identifier, propertyNames);
}

/**
*
Writes the value expressed as a {@code velocityReference}, which is the orientation specified as the normalized velocity vector of a position property. The reference must be to a {@code position} property.



* @param value The reference.
*/
public final void writeVelocityReference(Reference value) {
final String PropertyName = VelocityReferencePropertyName;
openIntervalIfNecessary();
getOutput().writePropertyName(PropertyName);
CesiumWritingHelper.writeReference(getOutput(), value);
}

/**
*
Writes the value expressed as a {@code velocityReference}, which is the orientation specified as the normalized velocity vector of a position property. The reference must be to a {@code position} property.



* @param value The earliest date of the interval.
*/
public final void writeVelocityReference(String value) {
final String PropertyName = VelocityReferencePropertyName;
openIntervalIfNecessary();
getOutput().writePropertyName(PropertyName);
CesiumWritingHelper.writeReference(getOutput(), value);
}

/**
*
Writes the value expressed as a {@code velocityReference}, which is the orientation specified as the normalized velocity vector of a position property. The reference must be to a {@code position} property.




* @param identifier The identifier of the object which contains the referenced property.
* @param propertyName The property on the referenced object.
*/
public final void writeVelocityReference(String identifier, String propertyName) {
final String PropertyName = VelocityReferencePropertyName;
openIntervalIfNecessary();
getOutput().writePropertyName(PropertyName);
CesiumWritingHelper.writeReference(getOutput(), identifier, propertyName);
}

/**
*
Writes the value expressed as a {@code velocityReference}, which is the orientation specified as the normalized velocity vector of a position property. The reference must be to a {@code position} property.




* @param identifier The identifier of the object which contains the referenced property.
* @param propertyNames The hierarchy of properties to be indexed on the referenced object.
*/
public final void writeVelocityReference(String identifier, String[] propertyNames) {
final String PropertyName = VelocityReferencePropertyName;
openIntervalIfNecessary();
getOutput().writePropertyName(PropertyName);
CesiumWritingHelper.writeReference(getOutput(), identifier, propertyNames);
}

/**
*
Returns a wrapper for this instance that implements {@link ICesiumInterpolatableValuePropertyWriter} to write a value in {@code UnitQuaternion} format. Because the returned instance is a wrapper for this instance, you may call {@link ICesiumElementWriter#close} on either this instance or the wrapper, but you must not call it on both.
Expand Down Expand Up @@ -243,4 +327,25 @@ public void invoke(OrientationCesiumWriter me, Reference value) {
}
});
}

/**
*
Returns a wrapper for this instance that implements {@link ICesiumValuePropertyWriter} to write a value in {@code VelocityReference} format. Because the returned instance is a wrapper for this instance, you may call {@link ICesiumElementWriter#close} on either this instance or the wrapper, but you must not call it on both.



* @return The wrapper.
*/
public final ICesiumValuePropertyWriter<Reference> asVelocityReference() {
return m_asVelocityReference.getValue();
}

private final ICesiumValuePropertyWriter<Reference> createVelocityReferenceAdaptor() {
return new CesiumWriterAdaptor<cesiumlanguagewriter.OrientationCesiumWriter, cesiumlanguagewriter.Reference>(this,
new CesiumWriterAdaptorWriteCallback<cesiumlanguagewriter.OrientationCesiumWriter, cesiumlanguagewriter.Reference>() {
public void invoke(OrientationCesiumWriter me, Reference value) {
me.writeVelocityReference(value);
}
});
}
}
Loading