Class ParametricRadiusProperty
- Namespace
- CADability
- Assembly
- CADability.dll
Parametric property of a shell which keeps the radius (or the diameter) of one or more faces with a radius
(cylinders, spheres, tori, fillets; see ISurfaceWithRadius) editable, e.g. the diameter of a hole.
When the value changes, the surfaces of the faces are replaced by surfaces with the new radius and the shell is
recalculated by ModifyRadius(IEnumerable<Face>, double). Instances are created by ParametricsRadiusAction, which is not part of the build yet.
public class ParametricRadiusProperty : ParametricProperty, IJsonSerialize
- Inheritance
-
ParametricRadiusProperty
- Implements
- Inherited Members
Constructors
ParametricRadiusProperty()
Empty constructor for the JSON deserialization; the data is set by SetObjectData(IJsonReadData).
protected ParametricRadiusProperty()
ParametricRadiusProperty(string, IEnumerable<Face>, bool, IEnumerable<object>)
Creates the radius property. The initial Value is the radius (or diameter) of the first face in
facesToModify.
public ParametricRadiusProperty(string name, IEnumerable<Face> facesToModify, bool useDiameter, IEnumerable<object> affectedObjects)
Parameters
namestringName shown in the property page
facesToModifyIEnumerable<Face>The faces whose radius is modified; their surfaces must implement ISurfaceWithRadius
useDiameterbooltrue: the value is the diameter, false: the value is the radius
affectedObjectsIEnumerable<object>Faces, edges and vertices of the shell which are modified by this property, see GetAffectedObjects()
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
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
clonedFacesDictionary<Face, Face>clonedEdgesDictionary<Edge, Edge>clonedVerticesDictionary<Vertex, Vertex>
Returns
Execute(Parametric)
Execute the parametrics. This will change the shell and the resulting shell may be inconsistent. But maybe further applications of other parametrics to the shell make it consistent again
public override bool Execute(Parametric parametric)
Parameters
parametricParametric
Returns
GetAffectedObjects()
Returns the faces, which will be modified by this parametric property
public override IEnumerable<object> GetAffectedObjects()
Returns
GetAnchor()
Returns the object on which serves as a anchorpoint for the operation
public override object GetAnchor()
Returns
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
projectionProjection
Returns
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
dataIJsonWriteDataReceives 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
mModOp
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
dataIJsonReadDataProvides the data