Table of Contents

Class ParametricRotationProperty

Namespace
CADability
Assembly
CADability.dll

Parametric property of a shell which keeps the angle between two sets of faces editable. The rotation axis is currently given by an edge whose two faces belong one to the backward and one to the forward faces (an axis defined by faces with an axis or a normal is planned). When the value changes, the forward faces are rotated about the axis by the difference (in symmetric mode both sets by half of it in opposite directions) and the shell is recalculated by RotateFaces(Dictionary<Face, ModOp>, Axis, bool). Intended to be created by ParametricsAngleAction; the implementation is not complete yet.

public class ParametricRotationProperty : ParametricProperty, IJsonSerialize, IJsonSerializeDone
Inheritance
ParametricRotationProperty
Implements
Inherited Members

Constructors

ParametricRotationProperty()

Empty constructor for the JSON deserialization; the data is set by SetObjectData(IJsonReadData).

protected ParametricRotationProperty()

ParametricRotationProperty(string, IEnumerable<Face>, IEnumerable<Face>, IEnumerable<object>, Mode, object)

Creates the rotation property. The initial Value is the angle measured at the axis.

public ParametricRotationProperty(string name, IEnumerable<Face> backwardFaces, IEnumerable<Face> forwardFaces, IEnumerable<object> affectedObjects, ParametricRotationProperty.Mode mode, object axis)

Parameters

name string

Name shown in the property page

backwardFaces IEnumerable<Face>

The faces which stay in place (in symmetric mode they are rotated backwards)

forwardFaces IEnumerable<Face>

The faces which are rotated when the value changes

affectedObjects IEnumerable<object>

Faces, edges and vertices of the shell which are modified by this property, see GetAffectedObjects()

mode ParametricRotationProperty.Mode

Flags controlling the rotation

axis object

The Edge defining the rotation axis; its two faces must be one of the backward and one of the forward faces

Properties

Value

The value of the parametric property: a length, a radius or diameter, an angle in radians or a ratio, depending on the derived class. Getting it measures the current value in the shell; setting it only stores the desired value, which is applied to the shell by the next call to Execute(Parametric).

public override double Value { get; set; }

Property Value

double

Methods

Clone(Dictionary<Face, Face>, Dictionary<Edge, Edge>, Dictionary<Vertex, Vertex>)

When the shell is cloned, we need to replace the faces, edges and vertices with their clones

public override ParametricProperty Clone(Dictionary<Face, Face> clonedFaces, Dictionary<Edge, Edge> clonedEdges, Dictionary<Vertex, Vertex> clonedVertices)

Parameters

clonedFaces Dictionary<Face, Face>
clonedEdges Dictionary<Edge, Edge>
clonedVertices Dictionary<Vertex, Vertex>

Returns

ParametricProperty

Execute(Parametric)

if != NullVector, this is the direction of the extrusion. This is used by the distance calculation.

public override bool Execute(Parametric parametric)

Parameters

parametric Parametric

Returns

bool

GetAffectedObjects()

Returns the faces, which will be modified by this parametric property

public override IEnumerable<object> GetAffectedObjects()

Returns

IEnumerable<object>

GetAnchor()

Returns the object on which serves as a anchorpoint for the operation

public override object GetAnchor()

Returns

object

GetFeedback(Projection)

Returns a list of objects that can be used as a feedback for this property (usually an arrow)

public override GeoObjectList GetFeedback(Projection projection)

Parameters

projection Projection

Returns

GeoObjectList

GetObjectData(IJsonWriteData)

Writes the name and the Preserve flag for the JSON serialization (IJsonSerialize). Derived classes override this method, call the base implementation and add their own data.

public override void GetObjectData(IJsonWriteData data)

Parameters

data IJsonWriteData

Receives the data

Modify(ModOp)

When the shell is beeing modified, we have the chance here to update the parametric property if necessary

public override void Modify(ModOp m)

Parameters

m ModOp

SetObjectData(IJsonReadData)

Reads the name and the Preserve flag from the JSON serialization (IJsonSerialize). Derived classes override this method, call the base implementation and read their own data.

public override void SetObjectData(IJsonReadData data)

Parameters

data IJsonReadData

Provides the data