本文整理汇总了C#中Common.DebugFormat方法的典型用法代码示例。如果您正苦于以下问题:C# Common.DebugFormat方法的具体用法?C# Common.DebugFormat怎么用?C# Common.DebugFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Common
的用法示例。
在下文中一共展示了Common.DebugFormat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildGlobalScene
/// <summary>
/// This function builds a scene of all IfcProducts in the model, excluding the geometry of Openings
/// It will create a scene database, overwriting any of the same name
/// </summary>
/// <param name="model">Model containing the model entities</param>
/// <param name="sceneDbName">Name of scene DB file</param>
/// <param name="Logger">Logging engine for detailed feedback</param>
public void BuildGlobalScene(XbimModel model, string sceneDbName, Common.Logging.ILogger Logger = null)
{
if (File.Exists(sceneDbName))
File.Delete(sceneDbName);
//get a connection
using (var db = new XbimSqliteDB(sceneDbName))
{
try
{
short spaceId = IfcMetaData.IfcTypeId(typeof(IfcSpace));
XbimGeometryHandleCollection handles = new XbimGeometryHandleCollection(model.GetGeometryHandles()
.Exclude(IfcEntityNameEnum.IFCFEATUREELEMENT));
XbimRect3D modelBounds = XbimRect3D.Empty;
XbimColourMap cmap = new XbimColourMap();
int layerid = 1;
IfcProject project = model.IfcProject;
int projectId = 0;
if (project != null) projectId = Math.Abs(project.EntityLabel);
float mScalingReference = (float)model.ModelFactors.OneMetre;
if (Logger != null)
Logger.DebugFormat("XbimScene: Scaling reference {0}\r\n", mScalingReference);
XbimMatrix3D translate = XbimMatrix3D.Identity;
XbimMatrix3D scale = XbimMatrix3D.CreateScale(1 / mScalingReference);
XbimMatrix3D composed = translate * scale;
XbimGeometryData regionData = model.GetGeometryData(projectId, XbimGeometryType.Region).FirstOrDefault(); //get the region data should only be one
if (regionData != null)
{
// this results in centering the most populated area of the model
//
XbimRegionCollection regions = XbimRegionCollection.FromArray(regionData.ShapeData);
XbimRegion largest = regions.MostPopulated();
if (largest != null)
{
translate = XbimMatrix3D.CreateTranslation(
-largest.Centre.X,
-largest.Centre.Y,
-largest.Centre.Z
);
}
composed = translate * scale;
// store region information in Scene
if ((Options & GenerateSceneOption.IncludeRegions) == GenerateSceneOption.IncludeRegions)
{
if (Logger != null)
Logger.DebugFormat("XbimScene: Exporting regions.\r\n", mScalingReference);
foreach (var item in regions)
{
// the bounding box needs to be moved/scaled by the transform.
//
XbimRect3D transformed = item.ToXbimRect3D().Transform(composed);
db.AddMetaData(
"Region",
-1,
string.Format("Name:{0};Box:{1};", item.Name, transformed.ToString()), // verbose, but only a few items are expected in the model
item.Name
);
}
}
}
if ((Options & GenerateSceneOption.IncludeTransform) == GenerateSceneOption.IncludeTransform)
{
if (Logger != null)
Logger.DebugFormat("XbimScene: Exporting transform.\r\n", mScalingReference);
db.AddMetaData(
"Transform",
-1,
composed.ToArray(false),
"World"
);
db.Flush();
}
if (Logger != null)
Logger.DebugFormat("XbimScene: Exporting layers.\r\n", mScalingReference);
foreach (var layerContent in handles.GroupByBuildingElementTypes())
{
string elementTypeName = layerContent.Key;
XbimGeometryHandleCollection layerHandles = layerContent.Value;
IEnumerable<XbimGeometryData> geomColl = model.GetGeometryData(layerHandles);
XbimColour colour = cmap[elementTypeName];
XbimMeshLayer<XbimMeshGeometry3D, XbimRenderMaterial> layer = new XbimMeshLayer<XbimMeshGeometry3D, XbimRenderMaterial>(model, colour) { Name = elementTypeName };
//add all content initially into the hidden field
foreach (var geomData in geomColl)
{
geomData.TransformBy(composed);
if (geomData.IfcTypeId == spaceId)
//.........这里部分代码省略.........