Class Path
A geoobject, that derives from Block and represents a ordered collection of
geoobjects which all support the ICurve intrface. The contained curves are connected,
i.e. Child(i).EndPoint is equal or close to Child(i+1).StartPoint.
The Path is not necessary planar, closed and may be self intersecting.
Inheritance
System.Object
Path
Implements
System.IComparable
System.ICloneable
System.Runtime.Serialization.ISerializable
System.Runtime.Serialization.IDeserializationCallback
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: CADability.dll
Syntax
[Serializable]
public class Path : IGeoObjectImpl, IGeoObject, ILayer, IStyle, IOctTreeInsertable, IComparable, IFeedBack, ICloneable, IColorDef, ILinePattern, ILineWidth, ICurve, IGeoObjectOwner, ISerializable, IDeserializationCallback, IExtentedableCurve
Constructors
|
Improve this Doc
View Source
Path()
Declaration
|
Improve this Doc
View Source
Path(SerializationInfo, StreamingContext)
Constructor required by deserialization
Declaration
protected Path(SerializationInfo info, StreamingContext context)
Parameters
| Type |
Name |
Description |
| System.Runtime.Serialization.SerializationInfo |
info |
SerializationInfo
|
| System.Runtime.Serialization.StreamingContext |
context |
StreamingContext
|
Fields
|
Improve this Doc
View Source
Constructor
Declaration
public static Path.ConstructionDelegate Constructor
Field Value
|
Improve this Doc
View Source
OnPaintTo3D
Declaration
public static Path.PaintTo3DDelegate OnPaintTo3D
Field Value
Properties
|
Improve this Doc
View Source
ColorDef
Declaration
public ColorDef ColorDef { get; set; }
Property Value
|
Improve this Doc
View Source
Count
Declaration
public int Count { get; }
Property Value
| Type |
Description |
| System.Int32 |
Gets the number uf subcurves in this path.
|
|
Improve this Doc
View Source
CurveCount
Returns the number of curves in the Path
Declaration
public int CurveCount { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
Curves
Returns a cloned array of the curves of this path. Do not modify the
curves or the path will be in an invalid state.
Declaration
public ICurve[] Curves { get; }
Property Value
|
Improve this Doc
View Source
Description
Declaration
public override string Description { get; }
Property Value
| Type |
Description |
| System.String |
|
Overrides
|
Improve this Doc
View Source
EndDirection
Declaration
public GeoVector EndDirection { get; }
Property Value
|
Improve this Doc
View Source
EndPoint
Declaration
public GeoPoint EndPoint { get; set; }
Property Value
|
Improve this Doc
View Source
IsClosed
Declaration
public bool IsClosed { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
IsSingular
Declaration
public bool IsSingular { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Layer
Declaration
public override Layer Layer { get; set; }
Property Value
Overrides
|
Improve this Doc
View Source
Length
Declaration
public double Length { get; }
Property Value
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
LinePattern
Declaration
public LinePattern LinePattern { get; set; }
Property Value
|
Improve this Doc
View Source
LineWidth
Declaration
public LineWidth LineWidth { get; set; }
Property Value
|
Improve this Doc
View Source
StartDirection
Declaration
public GeoVector StartDirection { get; }
Property Value
|
Improve this Doc
View Source
StartPoint
Declaration
public GeoPoint StartPoint { get; set; }
Property Value
|
Improve this Doc
View Source
Vertices
Declaration
public GeoPoint[] Vertices { get; }
Property Value
Methods
|
Improve this Doc
View Source
Add(ICurve)
Adds a curve to this path. It is checked whether the curve to add can be connected
to the start or endpoint of this path. If necessary the curve will be reversed. If
it cannot be connected false will be returned.
Declaration
public bool Add(ICurve ToAdd)
Parameters
| Type |
Name |
Description |
| ICurve |
ToAdd |
curve to add
|
Returns
| Type |
Description |
| System.Boolean |
true on success, false on failure
|
|
Improve this Doc
View Source
BestCyclicalPosition(Path)
Assumes both this and toThis are closed Paths with the same number of segments. Changes this Path
to start with the segment where the distance of corresponding vertices is minimal. The geometry of
this curve will not be changed
Declaration
public bool BestCyclicalPosition(Path toThis)
Parameters
| Type |
Name |
Description |
| Path |
toThis |
adapt to this path
|
Returns
| Type |
Description |
| System.Boolean |
true, if condition is satisfied
|
|
Improve this Doc
View Source
ChangeCyclicalStart(Int32)
Declaration
public void ChangeCyclicalStart(int newStartCurve)
Parameters
| Type |
Name |
Description |
| System.Int32 |
newStartCurve |
|
|
Improve this Doc
View Source
Clear()
Removes all subcurves, the Path will be empty. Use this before modifying
contained objects of this path because it is not allowed to mdify an object
in a path in a way that would compromise the consitence of the path
Declaration
|
Improve this Doc
View Source
Clone()
Declaration
public override IGeoObject Clone()
Returns
Overrides
|
Improve this Doc
View Source
Construct()
Declaration
public static Path Construct()
Returns
|
Improve this Doc
View Source
CopyGeometry(IGeoObject)
Declaration
public override void CopyGeometry(IGeoObject ToCopyFrom)
Parameters
Overrides
|
Improve this Doc
View Source
CreateFromModel(ICurve, Model, Projection, Boolean)
Returns a Path containing the curve BeginWith and other curves from the projectedModel.
The curve BeginWith is checked at both ends to find connected objects. The search is stopped
if there are nore more connected objects. The curves are clones and are tagged with UserData objects
with the name key "CADability.Path.Original" and the original object as the value.
If flatten is true, UserData will be lost.
Declaration
public static Path CreateFromModel(ICurve BeginWith, Model model, Projection projection, bool flatten)
Parameters
| Type |
Name |
Description |
| ICurve |
BeginWith |
Curve to begin with
|
| Model |
model |
|
| Projection |
projection |
|
| System.Boolean |
flatten |
true: flatten the result, false: result not flattened
|
Returns
| Type |
Description |
| Path |
The path or null if no cennecting objects found
|
|
Improve this Doc
View Source
CreateFromModel(ICurve, Model, Boolean)
Returns a Path containing the curve BeginWith and other curves from the Model.
The curve BeginWith is checked at both ends to find connected objects. The search is stopped
when there are nore more connected objects. The curves are clones and are tagged with UserData objects
with the name key "CADability.Path.Original" and the original object as the value.
If flatten is true, UserData will be lost.
Declaration
public static Path CreateFromModel(ICurve BeginWith, Model model, bool flatten)
Parameters
| Type |
Name |
Description |
| ICurve |
BeginWith |
Curve to begin with
|
| Model |
model |
the model to search for connecting curves
|
| System.Boolean |
flatten |
true: flatten the result, false: result not flattened
|
Returns
| Type |
Description |
| Path |
The path or null if no cennecting objects found
|
|
Improve this Doc
View Source
Curve(Int32)
Returns the i-th curve of the path. Do not modify this curve or the path
will be in an invalid state. For the number of curves see CurveCount.
Declaration
public ICurve Curve(int Index)
Parameters
| Type |
Name |
Description |
| System.Int32 |
Index |
Index of the desired curve
|
Returns
| Type |
Description |
| ICurve |
The curve with the given index
|
|
Improve this Doc
View Source
Decompose()
Declaration
public override GeoObjectList Decompose()
Returns
Overrides
|
Improve this Doc
View Source
DirectionAt(Double)
Declaration
public GeoVector DirectionAt(double Position)
Parameters
| Type |
Name |
Description |
| System.Double |
Position |
|
Returns
|
Improve this Doc
View Source
FindSnapPoint(SnapPointFinder)
Declaration
public override void FindSnapPoint(SnapPointFinder spf)
Parameters
Overrides
|
Improve this Doc
View Source
Flatten()
Flattens this path. All subcurves that are composed of simple curves
are decomposed into simpler curves (e.g. a polyline is decomposed into lines)
Declaration
|
Improve this Doc
View Source
FromSegments(IEnumerable<ICurve>, Boolean)
Declaration
public static Path FromSegments(IEnumerable<ICurve> curves, bool connectedAndOriented)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.IEnumerable<ICurve> |
curves |
|
| System.Boolean |
connectedAndOriented |
|
Returns
|
Improve this Doc
View Source
GetBoundingCube()
Declaration
public override BoundingCube GetBoundingCube()
Returns
Overrides
|
Improve this Doc
View Source
GetExtent(Projection, ExtentPrecision)
Declaration
public override BoundingRect GetExtent(Projection projection, ExtentPrecision extentPrecision)
Parameters
Returns
Overrides
|
Improve this Doc
View Source
GetExtent(Double)
Declaration
public override BoundingCube GetExtent(double precision)
Parameters
| Type |
Name |
Description |
| System.Double |
precision |
|
Returns
Overrides
|
Improve this Doc
View Source
GetObjectData(SerializationInfo, StreamingContext)
Implements ISerializable:GetObjectData
Declaration
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
| Type |
Name |
Description |
| System.Runtime.Serialization.SerializationInfo |
info |
|
| System.Runtime.Serialization.StreamingContext |
context |
|
Overrides
|
Improve this Doc
View Source
GetPlanarState()
Declaration
public PlanarState GetPlanarState()
Returns
|
Improve this Doc
View Source
GetPlane()
Declaration
Returns
|
Improve this Doc
View Source
GetProjectedCurve(Plane)
Declaration
public ICurve2D GetProjectedCurve(Plane p)
Parameters
| Type |
Name |
Description |
| Plane |
p |
|
Returns
|
Improve this Doc
View Source
GetQuadTreeItem(Projection, ExtentPrecision)
Declaration
public override IQuadTreeInsertableZ GetQuadTreeItem(Projection projection, ExtentPrecision extentPrecision)
Parameters
Returns
Overrides
|
Improve this Doc
View Source
GetShowProperties(IFrame)
Declaration
public override IShowProperty GetShowProperties(IFrame Frame)
Parameters
| Type |
Name |
Description |
| IFrame |
Frame |
|
Returns
Overrides
|
Improve this Doc
View Source
HitTest(ref BoundingCube, Double)
Declaration
public override bool HitTest(ref BoundingCube cube, double precision)
Parameters
| Type |
Name |
Description |
| BoundingCube |
cube |
|
| System.Double |
precision |
|
Returns
| Type |
Description |
| System.Boolean |
|
Overrides
|
Improve this Doc
View Source
HitTest(Projection, BoundingRect, Boolean)
Declaration
public override bool HitTest(Projection projection, BoundingRect rect, bool onlyInside)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Overrides
|
Improve this Doc
View Source
HitTest(Projection.PickArea, Boolean)
Declaration
public override bool HitTest(Projection.PickArea area, bool onlyInside)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Overrides
|
Improve this Doc
View Source
IndexAtLength(Double)
Returns the index of the subcurve at the given position. Position must be between 0.0 and this.Length
Declaration
public int IndexAtLength(double position)
Parameters
| Type |
Name |
Description |
| System.Double |
position |
Position for the query
|
Returns
| Type |
Description |
| System.Int32 |
Index of the curve
|
|
Improve this Doc
View Source
InsertPoint(Double)
Splits the curve of this path that contains the provided position. If position is exactely
on the connection of two subcurves, the path remains unchanged. Otherwise the curve containing the
position is split and both curves are added to the path
Declaration
public void InsertPoint(double position)
Parameters
| Type |
Name |
Description |
| System.Double |
position |
Where to split, must be inbetween 0 and 1
|
|
Improve this Doc
View Source
IsInPlane(Plane)
Declaration
public bool IsInPlane(Plane p)
Parameters
| Type |
Name |
Description |
| Plane |
p |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Modify(ModOp)
Declaration
public override void Modify(ModOp m)
Parameters
| Type |
Name |
Description |
| ModOp |
m |
|
Overrides
|
Improve this Doc
View Source
PaintTo3D(IPaintTo3D)
Declaration
public override void PaintTo3D(IPaintTo3D paintTo3D)
Parameters
Overrides
|
Improve this Doc
View Source
PointAt(Double)
Declaration
public GeoPoint PointAt(double Position)
Parameters
| Type |
Name |
Description |
| System.Double |
Position |
|
Returns
|
Improve this Doc
View Source
Position(GeoPoint, GeoVector, Double)
Declaration
public override double Position(GeoPoint fromHere, GeoVector direction, double precision)
Parameters
Returns
| Type |
Description |
| System.Double |
|
Overrides
|
Improve this Doc
View Source
PositionOf(GeoPoint)
Declaration
public double PositionOf(GeoPoint p)
Parameters
Returns
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
PositionOf(GeoPoint, Plane)
Declaration
public double PositionOf(GeoPoint p, Plane pl)
Parameters
Returns
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
PositionOf(GeoPoint, Double)
Declaration
public double PositionOf(GeoPoint p, double prefer)
Parameters
| Type |
Name |
Description |
| GeoPoint |
p |
|
| System.Double |
prefer |
|
Returns
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
PrepareDisplayList(Double)
Declaration
public override void PrepareDisplayList(double precision)
Parameters
| Type |
Name |
Description |
| System.Double |
precision |
|
Overrides
|
Improve this Doc
View Source
Remove(ICurve)
Declaration
public bool Remove(ICurve toRemove)
Parameters
| Type |
Name |
Description |
| ICurve |
toRemove |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
RemoveShortSegments(Double)
Removes all segments that are shorter than maxLengthToRemove. Connects the ramaining segments.
Declaration
public void RemoveShortSegments(double maxLengthToRemove)
Parameters
| Type |
Name |
Description |
| System.Double |
maxLengthToRemove |
Max. length of subcurves to remove
|
|
Improve this Doc
View Source
Set(GeoObjectList, Boolean, Double)
Takes a list of unsorted and unoriented geoobjects and tries to put them
together to a connected path. All previously contained segments are removed.
All objects of the list, that are used in this path will be removed
from their owner (see Owner). To avoid objects
bee removed from their owner (e.g. Model or Block)
use a list of cloned GeoObjects (CloneObjects()).
Declaration
public bool Set(GeoObjectList l, bool moreThanOne, double maxgap)
Parameters
| Type |
Name |
Description |
| GeoObjectList |
l |
List of unsorted GeoObjects
|
| System.Boolean |
moreThanOne |
if true, the path must consist of more than one curve
|
| System.Double |
maxgap |
|
Returns
| Type |
Description |
| System.Boolean |
success
|
|
Improve this Doc
View Source
Set(ICurve[])
Makes this path represent the given list if all objects in that list are properly
oriented and connected. If the objects do not connect, false will be returned and this
path remains unchanged.
Declaration
public bool Set(ICurve[] connectedCurves)
Parameters
| Type |
Name |
Description |
| ICurve[] |
connectedCurves |
new contents of this path
|
Returns
| Type |
Description |
| System.Boolean |
true on success, false on failure
|
|
Improve this Doc
View Source
SetPoint(Int32, GeoPoint, Path.ModificationMode)
Declaration
public void SetPoint(int index, GeoPoint newValue, Path.ModificationMode mode)
Parameters
|
Improve this Doc
View Source
SetPoint(Int32, Int32, GeoPoint)
Declaration
public void SetPoint(int indexEndPoint, int indexStartPoint, GeoPoint newValue)
Parameters
| Type |
Name |
Description |
| System.Int32 |
indexEndPoint |
|
| System.Int32 |
indexStartPoint |
|
| GeoPoint |
newValue |
|
|
Improve this Doc
View Source
Split(Double)
Declaration
public ICurve[] Split(double Position)
Parameters
| Type |
Name |
Description |
| System.Double |
Position |
|
Returns
|
Improve this Doc
View Source
Split(Double, Double)
Declaration
public ICurve[] Split(double Position1, double Position2)
Parameters
| Type |
Name |
Description |
| System.Double |
Position1 |
|
| System.Double |
Position2 |
|
Returns
|
Improve this Doc
View Source
Trim(Double, Double)
Declaration
public void Trim(double StartPos, double EndPos)
Parameters
| Type |
Name |
Description |
| System.Double |
StartPos |
|
| System.Double |
EndPos |
|
|
Improve this Doc
View Source
TryPointDeriv2At(Double, out GeoPoint, out GeoVector, out GeoVector)
Declaration
public virtual bool TryPointDeriv2At(double position, out GeoPoint point, out GeoVector deriv, out GeoVector deriv2)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Events
|
Improve this Doc
View Source
Constructed
Declaration
public static event Path.ConstructedDelegate Constructed
Event Type
Explicit Interface Implementations
|
Improve this Doc
View Source
IColorDef.SetTopLevel(ColorDef)
Declaration
void IColorDef.SetTopLevel(ColorDef newValue)
Parameters
|
Improve this Doc
View Source
IColorDef.SetTopLevel(ColorDef, Boolean)
Declaration
void IColorDef.SetTopLevel(ColorDef newValue, bool overwriteChildNullColor)
Parameters
| Type |
Name |
Description |
| ColorDef |
newValue |
|
| System.Boolean |
overwriteChildNullColor |
|
|
Improve this Doc
View Source
ICurve.Approximate(Boolean, Double)
Declaration
ICurve ICurve.Approximate(bool linesOnly, double maxError)
Parameters
| Type |
Name |
Description |
| System.Boolean |
linesOnly |
|
| System.Double |
maxError |
|
Returns
|
Improve this Doc
View Source
ICurve.Clone()
Declaration
Returns
|
Improve this Doc
View Source
ICurve.CloneModified(ModOp)
Declaration
ICurve ICurve.CloneModified(ModOp m)
Parameters
| Type |
Name |
Description |
| ModOp |
m |
|
Returns
|
Improve this Doc
View Source
ICurve.DistanceTo(GeoPoint)
Declaration
double ICurve.DistanceTo(GeoPoint p)
Parameters
Returns
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
ICurve.GetExtent()
Declaration
BoundingCube ICurve.GetExtent()
Returns
|
Improve this Doc
View Source
ICurve.GetExtrema(GeoVector)
Declaration
double[] ICurve.GetExtrema(GeoVector direction)
Parameters
Returns
| Type |
Description |
| System.Double[] |
|
|
Improve this Doc
View Source
ICurve.GetPlaneIntersection(Plane)
Declaration
double[] ICurve.GetPlaneIntersection(Plane plane)
Parameters
| Type |
Name |
Description |
| Plane |
plane |
|
Returns
| Type |
Description |
| System.Double[] |
|
|
Improve this Doc
View Source
ICurve.GetSavePositions()
Declaration
double[] ICurve.GetSavePositions()
Returns
| Type |
Description |
| System.Double[] |
|
|
Improve this Doc
View Source
ICurve.GetSelfIntersections()
Declaration
double[] ICurve.GetSelfIntersections()
Returns
| Type |
Description |
| System.Double[] |
|
|
Improve this Doc
View Source
ICurve.HitTest(BoundingCube)
Declaration
bool ICurve.HitTest(BoundingCube cube)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
ICurve.IsComposed
Declaration
bool ICurve.IsComposed { get; }
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
ICurve.ParameterToPosition(Double)
Declaration
double ICurve.ParameterToPosition(double parameter)
Parameters
| Type |
Name |
Description |
| System.Double |
parameter |
|
Returns
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
ICurve.PositionAtLength(Double)
Declaration
double ICurve.PositionAtLength(double position)
Parameters
| Type |
Name |
Description |
| System.Double |
position |
|
Returns
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
ICurve.PositionToParameter(Double)
Declaration
double ICurve.PositionToParameter(double position)
Parameters
| Type |
Name |
Description |
| System.Double |
position |
|
Returns
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
ICurve.Reverse()
Declaration
|
Improve this Doc
View Source
ICurve.SameGeometry(ICurve, Double)
Declaration
bool ICurve.SameGeometry(ICurve other, double precision)
Parameters
| Type |
Name |
Description |
| ICurve |
other |
|
| System.Double |
precision |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
ICurve.SubCurves
Declaration
ICurve[] ICurve.SubCurves { get; }
Returns
|
Improve this Doc
View Source
ICurve.TangentPosition(GeoVector)
Declaration
double[] ICurve.TangentPosition(GeoVector direction)
Parameters
Returns
| Type |
Description |
| System.Double[] |
|
|
Improve this Doc
View Source
IExtentedableCurve.GetExtendedCurve(ExtentedableCurveDirection)
Declaration
IOctTreeInsertable IExtentedableCurve.GetExtendedCurve(ExtentedableCurveDirection direction)
Parameters
Returns
|
Improve this Doc
View Source
IGeoObjectOwner.Add(IGeoObject)
Declaration
void IGeoObjectOwner.Add(IGeoObject toAdd)
Parameters
|
Improve this Doc
View Source
IGeoObjectOwner.Remove(IGeoObject)
Declaration
void IGeoObjectOwner.Remove(IGeoObject toRemove)
Parameters
|
Improve this Doc
View Source
IDeserializationCallback.OnDeserialization(Object)
Declaration
void IDeserializationCallback.OnDeserialization(object sender)
Parameters
| Type |
Name |
Description |
| System.Object |
sender |
|
Implements
System.IComparable
System.ICloneable
System.Runtime.Serialization.ISerializable
System.Runtime.Serialization.IDeserializationCallback