当前位置: 首页>>代码示例>>C#>>正文


C# ShapeBase类代码示例

本文整理汇总了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;
		}
开发者ID:jessejiang0214,项目名称:SwitchMediaTest,代码行数:8,代码来源:ColorWebServices.cs

示例2: ShapeViewModel

		public ShapeViewModel (ShapeBase shape)
		{
			_shape = shape;
			_webServices = ColorWebServices.Instance;
			_imageService = ImageService.Instance;
			_shapeFactory = ShapeFactory.Instance;
			DoubleTapCommand = new Command (async ()=> HandleDoubleTap());
		}
开发者ID:jessejiang0214,项目名称:SwitchMediaTest,代码行数:8,代码来源:ShapeViewModel.cs

示例3: RemoveChild

 /// <summary>
 /// Overridden function
 /// </summary>
 /// <param name="child"></param>
 public override void RemoveChild(ShapeBase child)
 {
     base.RemoveChild (child);
       if (child is PathNodeShape)
     Update();
 }
开发者ID:bgarrels,项目名称:projectanarchy,代码行数:10,代码来源:PathShape.cs

示例4: AddUIControlInstance

        public void AddUIControlInstance(ShapeBase child)
        {
            if (UIListInstance != null)
            {
                if (child is UIShapeSliderControl)
                {
                    //

                    UIListInstance.AddScrollbarControl(child._engineInstance);
                }

            }
        }
开发者ID:taru00,项目名称:GUIEditor,代码行数:13,代码来源:UIShapeListControl.cs

示例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);
        }
开发者ID:RexBaribal,项目名称:projectanarchy,代码行数:13,代码来源:FmodEditorPlugin.cs

示例6: OnChildRemoved

 public override void OnChildRemoved(ShapeBase childShape, int iDepth)
 {
     base.OnChildRemoved(childShape, iDepth);
       if (iDepth == 1 && childShape is BoneProxyShape)
     _cachedBoneList = null;
 }
开发者ID:shuaiharry,项目名称:projectanarchy,代码行数:6,代码来源:EntityShape.cs

示例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);
              }
        }
开发者ID:romance-ii,项目名称:projectanarchy,代码行数:19,代码来源:TerrainShape.cs

示例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;
      }  
开发者ID:hxzpily,项目名称:projectanarchy,代码行数:34,代码来源:StaticMeshGroupShape.cs

示例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);
            }
        }
开发者ID:RexBaribal,项目名称:projectanarchy,代码行数:23,代码来源:SearchToolDlg.cs

示例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;
        }
开发者ID:romance-ii,项目名称:projectanarchy,代码行数:15,代码来源:SortShapesIntoZonesAction.cs

示例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;
        }
开发者ID:romance-ii,项目名称:projectanarchy,代码行数:38,代码来源:SortShapesIntoZonesAction.cs

示例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];
        }
开发者ID:romance-ii,项目名称:projectanarchy,代码行数:32,代码来源:SortShapesIntoZonesAction.cs

示例13: ShapeCreatedEventArgs

 public ShapeCreatedEventArgs(ShapeBase shape)
 {
     _shape = shape;
 }
开发者ID:panoti,项目名称:DADHMT_LTW,代码行数:4,代码来源:ShapeCreatedEventArgs.cs

示例14: GestureListener

 public GestureListener(ShapeBase shape)
 {
     Shape = shape;
 }
开发者ID:jessejiang0214,项目名称:SwitchMediaTest,代码行数:4,代码来源:GestureListener.cs

示例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;
 }
开发者ID:bgarrels,项目名称:projectanarchy,代码行数:9,代码来源:PathShape.cs


注:本文中的ShapeBase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。