本文整理汇总了C#中ShapeBase类的典型用法代码示例。如果您正苦于以下问题:C# ShapeBase类的具体用法?C# ShapeBase怎么用?C# ShapeBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ShapeBase类属于命名空间,在下文中一共展示了ShapeBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetShapeInforAsync
public async Task<ShapeBase> GetShapeInforAsync (ShapeBase input)
{
if (input is SquareShape)
return await GetSquareInfoAsync (input as SquareShape);
if (input is CircleShape)
return await GetCircleInfoAsync (input as CircleShape);
return input;
}
示例2: ShapeViewModel
public ShapeViewModel (ShapeBase shape)
{
_shape = shape;
_webServices = ColorWebServices.Instance;
_imageService = ImageService.Instance;
_shapeFactory = ShapeFactory.Instance;
DoubleTapCommand = new Command (async ()=> HandleDoubleTap());
}
示例3: RemoveChild
/// <summary>
/// Overridden function
/// </summary>
/// <param name="child"></param>
public override void RemoveChild(ShapeBase child)
{
base.RemoveChild (child);
if (child is PathNodeShape)
Update();
}
示例4: AddUIControlInstance
public void AddUIControlInstance(ShapeBase child)
{
if (UIListInstance != null)
{
if (child is UIShapeSliderControl)
{
//
UIListInstance.AddScrollbarControl(child._engineInstance);
}
}
}
示例5: AddSoundShapesRecursive
void AddSoundShapesRecursive(ShapeCollection shapeList, ShapeBase parent)
{
if (parent.ShapeVirtualCounter > 0 || !parent.Modifiable)
return;
ShapeBase soundShape = parent as ShapeObject3D;
if (soundShape != null && (soundShape.GetType().FullName == "SoundEditorPlugin.SoundShape" || soundShape.GetType().FullName == "SoundEditorPlugin.SoundCollisionShape"))
shapeList.Add(soundShape);
if (parent.HasChildren())
foreach (ShapeBase shape in parent.ChildCollection)
AddSoundShapesRecursive(shapeList, shape);
}
示例6: OnChildRemoved
public override void OnChildRemoved(ShapeBase childShape, int iDepth)
{
base.OnChildRemoved(childShape, iDepth);
if (iDepth == 1 && childShape is BoneProxyShape)
_cachedBoneList = null;
}
示例7: AddShapesRecursive
void AddShapesRecursive(ShapeCollection target, ShapeBase parent, Rectangle2D selection )
{
if (parent.ShapeVirtualCounter==0 && parent.CanCopyPaste && (parent is Shape3D))
{
Shape3D shape3D = (Shape3D)parent;
if (selection.IsInside(shape3D.x, shape3D.y))
{
target.Add(parent);
//return; // iterate through children as well - the CloneForClipboard will take care of handling duplicates
}
}
if (parent.HasChildren())
{
ShapeCollection children = parent.ChildCollection;
foreach (ShapeBase child in children)
AddShapesRecursive(target, child, selection);
}
}
示例8: Visit
public override IShapeVisitor.VisitResult Visit(ShapeBase shape)
{
if (shape is StaticMeshGroupShape)
{
StaticMeshGroupShape groupShape = shape as StaticMeshGroupShape;
if (groupShape == _ignoreShape || groupShape.ExportFileName == null || groupShape.ExportFileName == "")
{
return VisitResult.VisitOk;
}
if (groupShape.ExportFileName.StartsWith(_searchExportFileName))
{
int newIndex = -1;
string remaining = groupShape.ExportFileName.Substring(_searchExportFileName.Length);
if (remaining.Length > 0)
{
try
{
newIndex = Convert.ToInt32(remaining);
}
catch (Exception)
{
newIndex = -1;
}
}
if (newIndex > _maxIndex)
{
_maxIndex = newIndex;
}
}
}
return VisitResult.VisitOk;
}
示例9: SelectEntities
private void SelectEntities(ShapeBase shape, String classText, String modelText, ShapeCollection sel)
{
//check the entity
EntityShape entity = shape as EntityShape;
if (entity!=null)
{
bool bSelect = true;
if (checkEntityClass.Checked)
bSelect &= (entity.EntityClass.ToUpper().IndexOf(classText)!=-1);
if (checkModel.Checked)
bSelect &= (entity.ModelFile.ToUpper().IndexOf(modelText)!=-1);
if (bSelect)
sel.Add(shape);
}
//check its children
foreach(ShapeBase child in shape.ChildCollection)
{
SelectEntities(child, classText, modelText, sel);
}
}
示例10: GetUnAssignedLayer
Layer GetUnAssignedLayer(ShapeBase shape)
{
if (_UnAssignedLayers == null)
_UnAssignedLayers = new Dictionary<Layer, Layer>();
Layer layer = null;
if (!_UnAssignedLayers.TryGetValue(shape.ParentLayer, out layer))
{
Object[] parameters = { "UnassignedShapes_" + shape.ParentLayer.LayerName };
layer = EditorManager.LayerFactory.CreateInstance(parameters);
this.Add(new AddLayerAction(layer,true));
_UnAssignedLayers.Add(shape.ParentLayer, layer);
}
return layer;
}
示例11: GetShapePosAndBox
bool GetShapePosAndBox(ShapeBase shape, out Vector3F pos, out BoundingBox box)
{
if (shape.HasChildren())
{
int iValidCount = 0;
BoundingBox baccum = new BoundingBox();
Vector3F paccum = Vector3F.Zero;
foreach (ShapeBase child in shape.ChildCollection)
{
BoundingBox b1;
Vector3F p1;
if (!GetShapePosAndBox(child, out p1, out b1))
continue;
iValidCount++;
paccum += p1;
if (b1 != null && b1.Valid)
baccum.AddBox(b1);
}
pos = paccum;
box = baccum;
if (iValidCount == 0)
return false;
pos *= (1.0f / (float)iValidCount); // average position
return true;
}
if (shape is Shape3D)
{
pos = ((Shape3D)shape).Position;
box = ((Shape3D)shape).AbsoluteBoundingBox;
if (box == null || !box.Valid)
box = null;
return true;
}
pos = Vector3F.Zero;
box = null;
return false;
}
示例12: GetBestLayer
Layer GetBestLayer(ShapeBase shape)
{
BoundingBox bbox;
Vector3F pos;
if (!GetShapePosAndBox(shape, out pos, out bbox))
return null;
if (bbox != null && bbox.Valid)
pos = bbox.Center; // position from box center
Zone bestZone = null;
float fMinDist = 1000000000000.0f;
foreach (Zone zone in _zones)
{
if (zone.Layers.Count < 1)
continue;
BoundingBox zonebox = zone.AssignmentBoundingBox;
float fDist = zonebox.GetDistance(pos);
if (fDist <= 0.0f)
{
if (bbox != null && bbox.Valid && zonebox.IsInside(bbox))
fDist -= 10.0f; // extra score
}
if (bestZone == null || fDist < fMinDist)
{
bestZone = zone;
fMinDist = fDist;
}
}
if (bestZone == null)
return null;
return bestZone.Layers[0];
}
示例13: ShapeCreatedEventArgs
public ShapeCreatedEventArgs(ShapeBase shape)
{
_shape = shape;
}
示例14: GestureListener
public GestureListener(ShapeBase shape)
{
Shape = shape;
}
示例15: AllowsToSetParent
/// <summary>
/// This shape type cannot be dragged in the tree view
/// </summary>
/// <param name="newParent"></param>
/// <returns></returns>
public override bool AllowsToSetParent(ShapeBase newParent)
{
return false;
}