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 Box, Cylinder & Corridor #111

Merged
merged 3 commits into from
Jun 13, 2016
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
55 changes: 21 additions & 34 deletions DotNet/CesiumLanguageWriter/Advanced/CesiumFormattingHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,12 @@ private static ImageFormat CesiumImageFormatToImageFormat(CesiumImageFormat imag
{
case CesiumImageFormat.Jpeg:
return ImageFormat.Jpeg;

case CesiumImageFormat.Png:
return ImageFormat.Png;

case CesiumImageFormat.Bmp:
return ImageFormat.Bmp;

case CesiumImageFormat.Gif:
return ImageFormat.Gif;

default:
throw new ArgumentException(CesiumLocalization.ArgumentTypeInvalid, "imageFormat");
}
Expand Down Expand Up @@ -172,16 +168,12 @@ private static string GetMimeTypeFromCesiumImageFormat(CesiumImageFormat imageFo
{
case CesiumImageFormat.Jpeg:
return "image/jpeg";

case CesiumImageFormat.Png:
return "image/png";

case CesiumImageFormat.Bmp:
return "image/bmp";

case CesiumImageFormat.Gif:
return "image/gif";

default:
throw new ArgumentException(CesiumLocalization.ArgumentTypeInvalid, "imageFormat");
}
Expand All @@ -199,10 +191,8 @@ public static string StripeOrientationToString(CesiumStripeOrientation orientati
{
case CesiumStripeOrientation.Horizontal:
return "HORIZONTAL";

case CesiumStripeOrientation.Vertical:
return "VERTICAL";

default:
throw new ArgumentException(CesiumLocalization.UnknownEnumerationValue, "orientation");
}
Expand All @@ -220,13 +210,10 @@ public static string HorizontalOriginToString(CesiumHorizontalOrigin horizontalO
{
case CesiumHorizontalOrigin.Left:
return "LEFT";

case CesiumHorizontalOrigin.Center:
return "CENTER";

case CesiumHorizontalOrigin.Right:
return "RIGHT";

default:
throw new ArgumentException(CesiumLocalization.UnknownEnumerationValue, "horizontalOrigin");
}
Expand All @@ -244,13 +231,10 @@ public static string VerticalOriginToString(CesiumVerticalOrigin verticalOrigin)
{
case CesiumVerticalOrigin.Bottom:
return "BOTTOM";

case CesiumVerticalOrigin.Center:
return "CENTER";

case CesiumVerticalOrigin.Top:
return "TOP";

default:
throw new ArgumentException(CesiumLocalization.UnknownEnumerationValue, "verticalOrigin");
}
Expand All @@ -268,13 +252,10 @@ public static string InterpolationAlgorithmToString(CesiumInterpolationAlgorithm
{
case CesiumInterpolationAlgorithm.Linear:
return "LINEAR";

case CesiumInterpolationAlgorithm.Lagrange:
return "LAGRANGE";

case CesiumInterpolationAlgorithm.Hermite:
return "HERMITE";

default:
throw new ArgumentException(CesiumLocalization.UnknownEnumerationValue, "interpolationAlgorithm");
}
Expand All @@ -292,13 +273,10 @@ public static string ExtrapolationTypeToString(CesiumExtrapolationType extrapola
{
case CesiumExtrapolationType.None:
return "NONE";

case CesiumExtrapolationType.Hold:
return "HOLD";

case CesiumExtrapolationType.Extrapolate:
return "EXTRAPOLATE";

default:
throw new ArgumentException(CesiumLocalization.UnknownEnumerationValue, "extrapolationType");
}
Expand All @@ -316,13 +294,10 @@ public static string ClockRangeToString(ClockRange clockRange)
{
case ClockRange.Clamped:
return "CLAMPED";

case ClockRange.Unbounded:
return "UNBOUNDED";

case ClockRange.LoopStop:
return "LOOP_STOP";

default:
throw new ArgumentException(CesiumLocalization.UnknownEnumerationValue, "clockRange");
}
Expand All @@ -340,13 +315,10 @@ public static string ClockStepToString(ClockStep clockStep)
{
case ClockStep.SystemClock:
return "SYSTEM_CLOCK";

case ClockStep.SystemClockMultiplier:
return "SYSTEM_CLOCK_MULTIPLIER";

case ClockStep.TickDependent:
return "TICK_DEPENDENT";

default:
throw new ArgumentException(CesiumLocalization.UnknownEnumerationValue, "clockStep");
}
Expand All @@ -364,18 +336,36 @@ public static string LabelStyleToString(CesiumLabelStyle labelStyle)
{
case CesiumLabelStyle.Fill:
return "FILL";

case CesiumLabelStyle.Outline:
return "OUTLINE";

case CesiumLabelStyle.FillAndOutline:
return "FILL_AND_OUTLINE";

default:
throw new ArgumentException(CesiumLocalization.UnknownEnumerationValue, "labelStyle");
}
}

/// <summary>
/// Converts a <see cref="CesiumCornerType"/> to the corresponding string in a
/// CZML stream.
/// </summary>
/// <param name="cornerType">The label style to convert.</param>
/// <returns>The string representing the specified <see cref="CesiumCornerType"/>.</returns>
public static string CornerTypeToString(CesiumCornerType cornerType)
{
switch (cornerType)
{
case CesiumCornerType.Rounded:
return "ROUNDED";
case CesiumCornerType.Mitered:
return "MITERED";
case CesiumCornerType.Beveled:
return "BEVELED";
default:
throw new ArgumentException(CesiumLocalization.UnknownEnumerationValue, "cornerType");
}
}

/// <summary>
/// Converts a <see cref="CesiumLabelStyle"/> to the corresponding string in a
/// CZML stream.
Expand All @@ -388,13 +378,10 @@ public static string SensorVolumePortionToDisplayToString(CesiumSensorVolumePort
{
case CesiumSensorVolumePortionToDisplay.Complete:
return "COMPLETE";

case CesiumSensorVolumePortionToDisplay.AboveEllipsoidHorizon:
return "ABOVE_ELLIPSOID_HORIZON";

case CesiumSensorVolumePortionToDisplay.BelowEllipsoidHorizon:
return "BELOW_ELLIPSOID_HORIZON";

default:
throw new ArgumentException(CesiumLocalization.UnknownEnumerationValue, "portionToDisplay");
}
Expand Down
5 changes: 4 additions & 1 deletion DotNet/CesiumLanguageWriter/Advanced/CesiumPropertyWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ protected void OpenIntervalIfNecessary()
private TDerived CopyForInterval()
{
TDerived result = Clone();
result.m_elementType = ElementType.Interval;

CesiumPropertyWriter<TDerived> cesiumPropertyWriter = result;
cesiumPropertyWriter.m_elementType = ElementType.Interval;

return result;
}

Expand Down
23 changes: 23 additions & 0 deletions DotNet/CesiumLanguageWriter/CesiumCornerType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace CesiumLanguageWriter
{
/// <summary>
/// Specifies the style of a corner.
/// </summary>
public enum CesiumCornerType
{
/// <summary>
/// The corner has a smooth edge.
/// </summary>
Rounded,

/// <summary>
/// The corner point is the intersection of adjacent edges.
/// </summary>
Mitered,

/// <summary>
/// The corner is clipped.
/// </summary>
Beveled,
}
}
6 changes: 6 additions & 0 deletions DotNet/CesiumLanguageWriter/CesiumLanguageWriter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
<Compile Include="Cartesian.cs" />
<Compile Include="Cartographic.cs" />
<Compile Include="CartographicExtent.cs" />
<Compile Include="CesiumCornerType.cs" />
<Compile Include="CesiumSensorVolumePortionToDisplay.cs" />
<Compile Include="CesiumStripeOrientation.cs" />
<Compile Include="CesiumResource.cs" />
Expand All @@ -88,10 +89,15 @@
<Compile Include="Generated\AlignedAxisCesiumWriter.cs" />
<Compile Include="Generated\BillboardCesiumWriter.cs" />
<Compile Include="Generated\BooleanCesiumWriter.cs" />
<Compile Include="Generated\BoxCesiumWriter.cs" />
<Compile Include="Generated\BoxDimensionsCesiumWriter.cs" />
<Compile Include="Generated\ClockCesiumWriter.cs" />
<Compile Include="Generated\ColorCesiumWriter.cs" />
<Compile Include="Generated\ConicSensorCesiumWriter.cs" />
<Compile Include="Generated\CornerTypeCesiumWriter.cs" />
<Compile Include="Generated\CorridorCesiumWriter.cs" />
<Compile Include="Generated\CustomPatternSensorCesiumWriter.cs" />
<Compile Include="Generated\CylinderCesiumWriter.cs" />
<Compile Include="Generated\DirectionCesiumWriter.cs" />
<Compile Include="Generated\DirectionListCesiumWriter.cs" />
<Compile Include="Generated\DoubleCesiumWriter.cs" />
Expand Down
Loading