Class ParticlePinGraphicState
A class that is created by the system to store a simplified version of the current state of the circuits of a single particle. This serves as a data container which updates the render system in each new configuration of the system.
Inheritance
Namespace: AS2.Visuals
Assembly: .dll
Syntax
public class ParticlePinGraphicState
Constructors
| Edit this page View SourceParticlePinGraphicState(int)
Declaration
private ParticlePinGraphicState(int pinsPerSide)
Parameters
Type | Name | Description |
---|---|---|
int | pinsPerSide |
Fields
| Edit this page View SourcecodeOverrideLineRotationDegrees1
Rotation of partition set placement line in the head.
Declaration
public float codeOverrideLineRotationDegrees1
Field Value
Type | Description |
---|---|
float |
codeOverrideLineRotationDegrees2
Rotation of partition set placement line in the head.
Declaration
public float codeOverrideLineRotationDegrees2
Field Value
Type | Description |
---|---|
float |
codeOverrideType1
Partition set placement type in the head.
Declaration
public ParticlePinGraphicState.CodeOverrideType_Node codeOverrideType1
Field Value
Type | Description |
---|---|
ParticlePinGraphicState.CodeOverrideType_Node |
codeOverrideType2
Partition set placement type in the tail.
Declaration
public ParticlePinGraphicState.CodeOverrideType_Node codeOverrideType2
Field Value
Type | Description |
---|---|
ParticlePinGraphicState.CodeOverrideType_Node |
hasNeighbor1
Neighbor flags for the particle's head. Indices are global directions.
Declaration
public bool[] hasNeighbor1
Field Value
Type | Description |
---|---|
bool[] |
hasNeighbor2
Neighbor flags for the particle's tail. Only relevant if the particle is expanded. Indices are global directions.
Declaration
public bool[] hasNeighbor2
Field Value
Type | Description |
---|---|
bool[] |
neighbor1ToNeighbor2Direction
Global direction from the particle's head to its tail. Is
-1
if the particle is contracted.
Declaration
public int neighbor1ToNeighbor2Direction
Field Value
Type | Description |
---|---|
int |
neighborPinConnection1
Types of pins connected to the particle's head. Indices are global directions.
Declaration
public ParticlePinGraphicState.NeighborPinConnection[] neighborPinConnection1
Field Value
Type | Description |
---|---|
NeighborPinConnection[] |
neighborPinConnection2
Types of pins connected to the particle's tail. Only relevant if the particle is expanded. Indices are global directions.
Declaration
public ParticlePinGraphicState.NeighborPinConnection[] neighborPinConnection2
Field Value
Type | Description |
---|---|
NeighborPinConnection[] |
partitionSets
Non-singleton and non-empty partition sets in the pin configuration.
Declaration
public List<ParticlePinGraphicState.PSetData> partitionSets
Field Value
Type | Description |
---|---|
List<ParticlePinGraphicState.PSetData> |
pinsPerSide
The number of pins on each edge of a particle.
Declaration
public int pinsPerSide
Field Value
Type | Description |
---|---|
int |
pool
Declaration
private static Stack<ParticlePinGraphicState> pool
Field Value
Type | Description |
---|---|
Stack<ParticlePinGraphicState> |
singletonSets
Singleton partition sets in the pin configuration.
Declaration
public List<ParticlePinGraphicState.PSetData> singletonSets
Field Value
Type | Description |
---|---|
List<ParticlePinGraphicState.PSetData> |
Properties
| Edit this page View SourceIsExpanded
Checks whether the pin configuration belongs to an expanded particle.
Declaration
public bool IsExpanded { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page View SourceCalculateAmountOfPSetsWithPinsInHeadAndTail(bool)
Calculates the amount of partition sets that have pins
in both halves of the expanded particle.
Returns 0
if the particle is contracted.
Declaration
public int CalculateAmountOfPSetsWithPinsInHeadAndTail(bool recalcPinNumbers = true)
Parameters
Type | Name | Description |
---|---|---|
bool | recalcPinNumbers | Whether the pin numbers
should be recalculated. Set this to |
Returns
Type | Description |
---|---|
int | The number of partition sets that contain pins in both the particle's head and tail, if the particle is expanded. |
CodePositionOverride_Automatic(bool)
Code override of the position of the partition sets by the use of the default placement algorithm. Replaces other code override values that have been set at this level of the object (like LineRotated).
Declaration
public void CodePositionOverride_Automatic(bool isHead)
Parameters
Type | Name | Description |
---|---|---|
bool | isHead |
|
CodePositionOverride_AutomaticLine(bool)
Code override of the position of the partition sets by the use of the standard partition set line. Non rotated, except for the expanded particles where the line is oriented orthogonally to the other half of the particle. Replaces other code override values that have been set at this level of the object (like LineRotated).
Declaration
public void CodePositionOverride_AutomaticLine(bool isHead)
Parameters
Type | Name | Description |
---|---|---|
bool | isHead |
|
CodePositionOverride_LineRotated(float, bool)
Code override of the position of the partition set rotation of the standard partition set line. Expanded particles must set the rotation manually with this mode. Replaces other code override values that have been set at this level of the object (like AutomaticLine).
Declaration
public void CodePositionOverride_LineRotated(float rotationDegrees, bool isHead)
Parameters
Type | Name | Description |
---|---|---|
float | rotationDegrees | The rotation degree, counterclockwise. It is recommended to use a value that is divisible by 60. 0 degrees means the line is vertical. |
bool | isHead |
|
CodePositionOverride_PolarCoordinatePlacement(bool)
Code override of the position of the partition sets by the use of manually set polar coordinates that need to be defined in the partition sets. Replaces other code override values that have been set at this level of the object (like LineRotated).
Declaration
public void CodePositionOverride_PolarCoordinatePlacement(bool isHead)
Parameters
Type | Name | Description |
---|---|---|
bool | isHead |
|
InitNeighbors()
Initializes the neighbor arrays with default values (indicating no neighbors).
Declaration
private void InitNeighbors()
PoolCreate(int)
Recycles a ParticlePinGraphicState instance from the pool or creates a new one.
Declaration
public static ParticlePinGraphicState PoolCreate(int pinsPerSide)
Parameters
Type | Name | Description |
---|---|---|
int | pinsPerSide | The number of pins with which to initialize the new instance. |
Returns
Type | Description |
---|---|
ParticlePinGraphicState | A ParticlePinGraphicState instance
initialized with |
PoolRelease(ParticlePinGraphicState)
Reinserts the given ParticlePinGraphicState instance into the pool so that it can be reused later.
Declaration
public static void PoolRelease(ParticlePinGraphicState state)
Parameters
Type | Name | Description |
---|---|---|
ParticlePinGraphicState | state | The instanced to be entered into the pool. |
Reset()
Resets the object to the default values. Does not change number of pins.
Declaration
public void Reset()
Reset(int)
Resets the object to the default values with a specific number of pins.
Declaration
public void Reset(int pinsPerSide)
Parameters
Type | Name | Description |
---|---|---|
int | pinsPerSide | The new number of pins. |
ResetCodePositionOverride()
Removes any code overrides that have been set on this level of the object. You might not need this.
Declaration
public void ResetCodePositionOverride()