Skip to content

Commit

Permalink
Move enums to a dedicated namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
B3zaleel committed Aug 17, 2024
1 parent abaedbe commit 3da014f
Show file tree
Hide file tree
Showing 38 changed files with 148 additions and 105 deletions.
1 change: 1 addition & 0 deletions src/Draco/IO/Attributes/AttributeOctahedronTransform.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Draco.IO.Enums;
using Draco.IO.Extensions;

namespace Draco.IO.Attributes;
Expand Down
1 change: 1 addition & 0 deletions src/Draco/IO/Attributes/AttributeQuantizationTransform.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Draco.IO.Core;
using Draco.IO.Enums;
using Draco.IO.Extensions;

namespace Draco.IO.Attributes;
Expand Down
2 changes: 2 additions & 0 deletions src/Draco/IO/Attributes/AttributeTransform.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Draco.IO.Enums;

namespace Draco.IO.Attributes;

internal abstract class AttributeTransform
Expand Down
1 change: 1 addition & 0 deletions src/Draco/IO/Attributes/AttributeTransformData.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Draco.IO.Core;
using Draco.IO.Enums;

namespace Draco.IO.Attributes;

Expand Down
1 change: 1 addition & 0 deletions src/Draco/IO/Attributes/AttributesDecoder.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Draco.IO.Enums;
using Draco.IO.Extensions;

namespace Draco.IO.Attributes;
Expand Down
1 change: 1 addition & 0 deletions src/Draco/IO/Attributes/GeometryAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Numerics;
using Draco.IO.Core;
using Draco.IO.Enums;
using Draco.IO.Extensions;

namespace Draco.IO.Attributes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Draco.IO.Enums;

namespace Draco.IO.Attributes.PredictionSchemes;

internal interface IPredictionScheme
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Numerics;
using Draco.IO.BitCoders;
using Draco.IO.Core;
using Draco.IO.Enums;
using Draco.IO.Extensions;

namespace Draco.IO.Attributes.PredictionSchemes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Numerics;
using Draco.IO.BitCoders;
using Draco.IO.Enums;
using Draco.IO.Extensions;

namespace Draco.IO.Attributes.PredictionSchemes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Draco.IO.Core;
using Draco.IO.Enums;
using Draco.IO.Extensions;

namespace Draco.IO.Attributes.PredictionSchemes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Draco.IO.Core;
using Draco.IO.Enums;
using Draco.IO.Extensions;
using Draco.IO.Mesh;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Numerics;
using Draco.IO.Core;
using Draco.IO.Enums;
using Draco.IO.Extensions;

namespace Draco.IO.Attributes.PredictionSchemes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Numerics;
using Draco.IO.Enums;
using Draco.IO.Extensions;
using Draco.IO.Mesh;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Numerics;
using Draco.IO.BitCoders;
using Draco.IO.Core;
using Draco.IO.Enums;
using Draco.IO.Extensions;

namespace Draco.IO.Attributes.PredictionSchemes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Numerics;
using Draco.IO.BitCoders;
using Draco.IO.Enums;
using Draco.IO.Extensions;

namespace Draco.IO.Attributes.PredictionSchemes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Numerics;
using Draco.IO.Enums;

namespace Draco.IO.Attributes.PredictionSchemes;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Numerics;
using Draco.IO.Enums;
using Draco.IO.Mesh;

namespace Draco.IO.Attributes.PredictionSchemes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Numerics;
using Draco.IO.Enums;
using Draco.IO.Extensions;

namespace Draco.IO.Attributes.PredictionSchemes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Numerics;
using Draco.IO.Enums;
using Draco.IO.Extensions;

namespace Draco.IO.Attributes.PredictionSchemes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Draco.IO.Enums;

namespace Draco.IO.Attributes;

internal class SequentialAttributeDecodersController : AttributesDecoder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Draco.IO.Attributes.PredictionSchemes;
using Draco.IO.Entropy;
using Draco.IO.Enums;
using Draco.IO.Extensions;

namespace Draco.IO.Attributes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Draco.IO.Attributes.PredictionSchemes;
using Draco.IO.Enums;
using Draco.IO.Extensions;

namespace Draco.IO.Attributes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Draco.IO.Enums;
using Draco.IO.Extensions;

namespace Draco.IO.Attributes;
Expand Down
107 changes: 2 additions & 105 deletions src/Draco/IO/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Draco.IO.Enums;

namespace Draco.IO;

internal static class Constants
Expand Down Expand Up @@ -189,108 +191,3 @@ public static TOut[] ReinterpretCast<TIn, TOut>(TIn[] values)
return result;
}
}

public enum GeometryAttributeType : sbyte
{
Invalid = -1,
Position = 0,
Normal = 1,
Color = 2,
TexCoord = 3,
Generic,
NamedAttributesCount
}

/// <summary>
/// Represents different variants of <see cref="Mesh.Mesh"/> attributes.
/// </summary>
public enum MeshAttributeElementType : byte
{
/// <summary>
/// All corners attached to a vertex share the same attribute value. A typical example are the vertex positions and often vertex colors.
/// </summary>
VertexAttribute = 0,
/// <summary>
/// The most general attribute where every corner of the mesh can have a different attribute value. Often used for texture coordinates or normals.
/// </summary>
CornerAttribute = 1,
/// <summary>
/// All corners of a single face share the same value.
/// </summary>
FaceAttribute = 2
}

public enum AttributeTransformType : sbyte
{
InvalidTransform = -1,
NoTransform = 0,
QuantizationTransform = 1,
OctahedronTransform = 2,
}

public enum SequentialAttributeEncoderType : byte
{
Generic = 0,
Integer,
Quantization,
Normals
}

public enum PredictionSchemeMethod : sbyte
{
None = -2,
Undefined = -1,
Difference = 0,
Parallelogram = 1,
MultiParallelogram = 2,
TexCoordsDeprecated = 3,
ConstrainedMultiParallelogram = 4,
TexCoordsPortable = 5,
GeometricNormal = 6,
Count
}

public enum PredictionSchemeTransformType : sbyte
{
None = -1,
Delta = 0,
Wrap = 1,
NormalOctahedron = 2,
NormalOctahedronCanonicalized = 3,
Count,
}

public enum MeshTraversalMethod : byte
{
DepthFirst = 0,
PredictionDegree,
Count
}

public enum DataType : byte
{
Invalid = 0,
Int8,
UInt8,
Int16,
UInt16,
Int32,
UInt32,
Int64,
UInt64,
Float32,
Float64,
Bool,
Count
}

public enum NormalPredictionMode : byte
{
OneTriangle = 0,
TriangleArea = 1,
}

public enum MultiParallelogramMode : byte
{
Optimal = 0
}
9 changes: 9 additions & 0 deletions src/Draco/IO/Enums/AttributeTransformType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Draco.IO.Enums;

public enum AttributeTransformType : sbyte
{
InvalidTransform = -1,
NoTransform = 0,
QuantizationTransform = 1,
OctahedronTransform = 2,
}
18 changes: 18 additions & 0 deletions src/Draco/IO/Enums/DataType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace Draco.IO.Enums;

public enum DataType : byte
{
Invalid = 0,
Int8,
UInt8,
Int16,
UInt16,
Int32,
UInt32,
Int64,
UInt64,
Float32,
Float64,
Bool,
Count
}
12 changes: 12 additions & 0 deletions src/Draco/IO/Enums/GeometryAttributeType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Draco.IO.Enums;

public enum GeometryAttributeType : sbyte
{
Invalid = -1,
Position = 0,
Normal = 1,
Color = 2,
TexCoord = 3,
Generic,
NamedAttributesCount
}
20 changes: 20 additions & 0 deletions src/Draco/IO/Enums/MeshAttributeElementType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace Draco.IO.Enums;

/// <summary>
/// Represents different variants of <see cref="Mesh.Mesh"/> attributes.
/// </summary>
public enum MeshAttributeElementType : byte
{
/// <summary>
/// All corners attached to a vertex share the same attribute value. A typical example are the vertex positions and often vertex colors.
/// </summary>
VertexAttribute = 0,
/// <summary>
/// The most general attribute where every corner of the mesh can have a different attribute value. Often used for texture coordinates or normals.
/// </summary>
CornerAttribute = 1,
/// <summary>
/// All corners of a single face share the same value.
/// </summary>
FaceAttribute = 2
}
8 changes: 8 additions & 0 deletions src/Draco/IO/Enums/MeshTraversalMethod.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Draco.IO.Enums;

public enum MeshTraversalMethod : byte
{
DepthFirst = 0,
PredictionDegree,
Count
}
6 changes: 6 additions & 0 deletions src/Draco/IO/Enums/MultiParallelogramMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Draco.IO.Enums;

public enum MultiParallelogramMode : byte
{
Optimal = 0
}
7 changes: 7 additions & 0 deletions src/Draco/IO/Enums/NormalPredictionMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Draco.IO.Enums;

public enum NormalPredictionMode : byte
{
OneTriangle = 0,
TriangleArea = 1,
}
15 changes: 15 additions & 0 deletions src/Draco/IO/Enums/PredictionSchemeMethod.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace Draco.IO.Enums;

public enum PredictionSchemeMethod : sbyte
{
None = -2,
Undefined = -1,
Difference = 0,
Parallelogram = 1,
MultiParallelogram = 2,
TexCoordsDeprecated = 3,
ConstrainedMultiParallelogram = 4,
TexCoordsPortable = 5,
GeometricNormal = 6,
Count
}
11 changes: 11 additions & 0 deletions src/Draco/IO/Enums/PredictionSchemeTransformType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Draco.IO.Enums;

public enum PredictionSchemeTransformType : sbyte
{
None = -1,
Delta = 0,
Wrap = 1,
NormalOctahedron = 2,
NormalOctahedronCanonicalized = 3,
Count,
}
9 changes: 9 additions & 0 deletions src/Draco/IO/Enums/SequentialAttributeEncoderType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Draco.IO.Enums;

public enum SequentialAttributeEncoderType : byte
{
Generic = 0,
Integer,
Quantization,
Normals
}
1 change: 1 addition & 0 deletions src/Draco/IO/Mesh/Mesh.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Draco.IO.Attributes;
using Draco.IO.Enums;
using Draco.IO.Extensions;

namespace Draco.IO.Mesh;
Expand Down
2 changes: 2 additions & 0 deletions src/Draco/IO/Mesh/MeshAttributeData.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Draco.IO.Enums;

namespace Draco.IO.Mesh;

internal class MeshAttributeData
Expand Down
Loading

0 comments on commit 3da014f

Please sign in to comment.