Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DomCR committed Dec 19, 2024
1 parent 7e483a3 commit 3346f22
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 53 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using ACadSharp.Attributes;
using ACadSharp.Entities;

namespace ACadSharp.Objects.Evaluations
{
public partial class BlockVisibilityParameter
{
/// <summary>
/// Represents a named state containing <see cref="Entity"/> objects. <br/>
/// The state controls the visibility of the entities assigned to it.
/// </summary>
public class State : ICloneable
{
/// <summary>
/// Gets the name of the state.
/// </summary>
[DxfCodeValue(303)]
public string Name { get; set; }

/// <summary>
/// Get the list of <see cref="Entity"/> objects in this state.
/// </summary>
[DxfCodeValue(DxfReferenceType.Count, 94)]
[DxfCollectionCodeValue(DxfReferenceType.Handle, 332)]
public List<Entity> Entities { get; private set; } = new();

/// <summary>
/// Get the list of <see cref="EvaluationExpression"/> objects.
/// </summary>
[DxfCodeValue(DxfReferenceType.Count, 95)]
[DxfCollectionCodeValue(DxfReferenceType.Handle, 333)]
public List<EvaluationExpression> Expressions { get; private set; } = new();

/// <inheritdoc/>
public object Clone()
{
State clone = (State)MemberwiseClone();

clone.Entities = new List<Entity>();
foreach (var item in this.Entities)
{
clone.Entities.Add((Entity)item.Clone());
}

clone.Expressions = new();
foreach (var item in this.Expressions)
{
clone.Expressions.Add((EvaluationExpression)item.Clone());
}

return clone;
}
}
}
}
57 changes: 4 additions & 53 deletions src/ACadSharp/Objects/Evaluations/BlockVisibilityParameter.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using ACadSharp.Attributes;
using ACadSharp.Entities;
using CSMath;

namespace ACadSharp.Objects.Evaluations
{
/// <summary>
/// Represents a BLOCKVISIBILITYPARAMETER object, in AutoCAD used to
/// control the visibility state of entities in a dynamic block.
/// </summary>
public class BlockVisibilityParameter : Block1PtParameter
public partial class BlockVisibilityParameter : Block1PtParameter
{
/// <inheritdoc/>
public override string ObjectName => DxfFileToken.ObjectBlockVisibilityParameter;
Expand All @@ -33,67 +31,20 @@ public class BlockVisibilityParameter : Block1PtParameter
public List<State> States { get; private set; } = new List<State>();

/// <summary>
/// Gets a title for the dialog to select the subblock that is to be set visible.
/// Visibility parameter name.
/// </summary>
[DxfCodeValue(301)]
public string Name { get; set; }

/// <summary>
/// Gets a description presumably for the dialog to select the subblock that is to be set visible.
/// Visibility parameter description.
/// </summary>
[DxfCodeValue(302)]
public string Description { get; set; }

[DxfCodeValue(91)]
internal bool Value91 { get; set; }

/// <summary>
/// Represents a named state containing <see cref="Entity"/> objects. <br/>
/// The state controls the visibility of the entities assigned to it.
/// </summary>
public class State : ICloneable
{
/// <summary>
/// Gets the name of the state.
/// </summary>
[DxfCodeValue(303)]
public string Name { get; set; }

/// <summary>
/// Get the list of <see cref="Entity"/> objects in this state.
/// </summary>
[DxfCodeValue(DxfReferenceType.Count, 94)]
[DxfCollectionCodeValue(DxfReferenceType.Handle, 332)]
public List<Entity> Entities { get; private set; } = new();

/// <summary>
/// Get the list of <see cref="EvaluationExpression"/> objects.
/// </summary>
[DxfCodeValue(DxfReferenceType.Count, 95)]
[DxfCollectionCodeValue(DxfReferenceType.Handle, 333)]
public List<EvaluationExpression> Expressions { get; private set; } = new();

/// <inheritdoc/>
public object Clone()
{
State clone = (State)MemberwiseClone();

clone.Entities = new List<Entity>();
foreach (var item in this.Entities)
{
clone.Entities.Add((Entity)item.Clone());
}

clone.Expressions = new();
foreach (var item in this.Expressions)
{
clone.Expressions.Add((EvaluationExpression)item.Clone());
}

return clone;
}
}

/// <inheritdoc/>
public override CadObject Clone()
{
Expand Down

0 comments on commit 3346f22

Please sign in to comment.