本文整理汇总了C#中Shape.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# Shape.Clone方法的具体用法?C# Shape.Clone怎么用?C# Shape.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shape
的用法示例。
在下文中一共展示了Shape.Clone方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShapeInfoDialog
/// <summary>
/// Displays a dialog showing various information on the given shape:
/// Template, shape type, shape library and the shape's control points including their capabilities and connected shapes.
/// </summary>
public ShapeInfoDialog(Project project, Shape shape)
{
if (project == null) throw new ArgumentNullException("project");
if (shape == null) throw new ArgumentNullException("shape");
InitializeComponent();
this.project = project;
Rectangle shapeBounds = shape.GetBoundingRectangle(false);
this.shape = shape;
this.shapeClone = shape.Clone();
this.shapeClone.Fit(0, 0, shapeBounds.Width, shapeBounds.Height);
this.diagram.Size = shapeBounds.Size;
this.diagram.Shapes.Add(shapeClone);
diagramSetController.Project = project;
display.DrawDiagramSheet = false;
display.Diagram = diagram;
display.ShowGrid = false;
display.GripSize = 5;
display.HighQualityRendering = true;
display.RenderingQualityHighQuality = RenderingQuality.MaximumQuality;
display.CurrentTool = tool;
UpdateShapeInfo();
}
示例2: CanRotateShape
public bool CanRotateShape(Shape shape)
{
Shape rotatedShape = (Shape)shape.Clone();
rotatedShape.Rotate();
return !IsSidesCollision(rotatedShape) && !IsRoofCollision(rotatedShape);
}
示例3: DoCloneShape
private static Shape DoCloneShape(Shape shape, bool cloneModelObject)
{
Shape result = shape.Clone();
if (cloneModelObject) DoCloneShapeModelObject(result);
else {
// ToDo: For now, we delete assigned model objects. Resolve this issue later ("Cannot delete modelObject if there is a copied shape referencing the model object")
if (result.ModelObject != null) result.ModelObject = null;
}
return result;
}
示例4: Fixture
public Fixture(PhysicsBody body, Shape shape, object userData)
{
if (Settings.UseFPECollisionCategories)
_collisionCategories = Category.All;
else
_collisionCategories = Category.Cat1;
_collidesWith = Category.All;
_collisionGroup = 0;
//Fixture defaults
Friction = 0.2f;
Restitution = 0;
IsSensor = false;
Body = body;
UserData = userData;
if (Settings.ConserveMemory)
Shape = shape;
else
Shape = shape.Clone();
RegisterFixture();
}