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


C# GeometryElement.GetTransformed方法代码示例

本文整理汇总了C#中GeometryElement.GetTransformed方法的典型用法代码示例。如果您正苦于以下问题:C# GeometryElement.GetTransformed方法的具体用法?C# GeometryElement.GetTransformed怎么用?C# GeometryElement.GetTransformed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GeometryElement的用法示例。


在下文中一共展示了GeometryElement.GetTransformed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetTransformedGeometry

        /// <summary>
        /// Transforms a geometry by a given transform.
        /// </summary>
        /// <remarks>The geometry element created by "GetTransformed" is a copy which will have its own allocated
        /// membership - this needs to be stored and disposed of (see AllocatedGeometryObjectCache
        /// for details)</remarks>
        /// <param name="geomElem">The geometry.</param>
        /// <param name="trf">The transform.</param>
        /// <returns>The transformed geometry.</returns>
        public static GeometryElement GetTransformedGeometry(GeometryElement geomElem, Transform trf)
        {
            if (geomElem == null)
                return null;

            GeometryElement currGeomElem = geomElem.GetTransformed(trf);
            ExporterCacheManager.AllocatedGeometryObjectCache.AddGeometryObject(currGeomElem);
            return currGeomElem;
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:18,代码来源:GeometryUtil.cs

示例2: CollectSolidMeshGeometry

 /// <summary>
 /// Collects all solids and meshes within all nested levels of a given GeometryElement.
 /// </summary>
 /// <remarks>
 /// This is a private helper method for the GetSolidMeshGeometry type collection methods.
 /// </remarks>
 /// <param name="geomElem">
 /// The GeometryElement we are collecting solids and meshes from.
 /// </param>
 /// <param name="trf">
 /// The initial Transform applied on the GeometryElement.
 /// </param>
 /// <param name="solidMeshCapsule">
 /// The SolidMeshGeometryInfo object that contains the lists of collected solids and meshes.
 /// </param>
 private static void CollectSolidMeshGeometry(GeometryElement geomElem, Transform trf, SolidMeshGeometryInfo solidMeshCapsule)
 {
     if (geomElem == null)
     {
         return;
     }
     GeometryElement currGeomElem = geomElem;
     Transform localTrf = trf;
     if (localTrf == null)
     {
         localTrf = Transform.Identity;
     }
     else if (!localTrf.IsIdentity)
     {
         currGeomElem = geomElem.GetTransformed(localTrf);
         // The geometry element created by "GetTransformed" is a copy which will have its own allocated
         // membership - this needs to be stored and disposed of (see AllocatedGeometryObjectCache
         // for details)
         ExporterCacheManager.AllocatedGeometryObjectCache.AddGeometryObject(currGeomElem);
     }
     // iterate through the GeometryObjects contained in the GeometryElement
     foreach (GeometryObject geomObj in currGeomElem){
         Solid solid = geomObj as Solid;
         if (solid != null && solid.Faces.Size > 0 && solid.Volume > 0.0)
         {
             solidMeshCapsule.AddSolid(solid);
         }
         else
         {
             Mesh mesh = geomObj as Mesh;
             if (mesh != null)
             {
                 solidMeshCapsule.AddMesh(mesh);
             }
             else
             {
                 // if the current geomObj is castable as a GeometryInstance, then we perform the same collection on its symbol geometry
                 GeometryInstance inst = geomObj as GeometryInstance;
                 if (inst != null)
                 {
                     GeometryElement instanceSymbol = inst.GetSymbolGeometry();
                     if (instanceSymbol != null)
                     {
                         Transform instanceTransform = localTrf.Multiply(inst.Transform);
                         CollectSolidMeshGeometry(instanceSymbol, instanceTransform, solidMeshCapsule);
                     }
                 }
             }
         }
     }
 }
开发者ID:whztt07,项目名称:BIM-IFC,代码行数:66,代码来源:GeometryUtil.cs


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