本文整理汇总了C#中ExporterIFC.PushTransform方法的典型用法代码示例。如果您正苦于以下问题:C# ExporterIFC.PushTransform方法的具体用法?C# ExporterIFC.PushTransform怎么用?C# ExporterIFC.PushTransform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExporterIFC
的用法示例。
在下文中一共展示了ExporterIFC.PushTransform方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
void Initialize(ExporterIFC exporterIFC, XYZ origin, XYZ xDir, XYZ yDir)
{
if (!m_Initialized)
{
m_ExporterIFC = exporterIFC;
Transform trf = Transform.Identity;
trf.Origin = origin;
trf.BasisX = xDir;
trf.BasisY = yDir;
m_ExporterIFC.PushTransform(trf);
m_Initialized = true;
}
}
示例2: commonInit
//.........这里部分代码省略.........
}
IFCLevelInfo levelInfo = levelInfoPair.Value;
double startHeight = levelInfo.Elevation - leveExtension;
double height = levelInfo.DistanceToNextLevel;
bool useHeight = !MathUtil.IsAlmostZero(height);
double endHeight = startHeight + height;
if (originIsValid && ((originToUse[2] > (startHeight - MathUtil.Eps())) && (!useHeight || originToUse[2] < (endHeight - MathUtil.Eps()))))
{
newLevelId = levelInfoPair.Key;
}
if (startHeight < (bottomHeight + MathUtil.Eps()))
{
bottomLevelId = levelInfoPair.Key;
bottomHeight = startHeight;
}
}
}
if (newLevelId == ElementId.InvalidElementId)
newLevelId = bottomLevelId;
}
LevelInfo = exporterIFC.GetLevelInfo(newLevelId);
if (LevelInfo == null)
{
foreach (KeyValuePair<ElementId, IFCLevelInfo> levelInfoPair in levelInfos)
{
// the cache contains levels from all the exported documents
// if the export is performed for a linked document, filter the levels that are not from this document
if (ExporterCacheManager.ExportOptionsCache.ExportingLink)
{
Element levelElem = doc.GetElement(levelInfoPair.Key);
if (levelElem == null || !(levelElem is Level))
continue;
}
LevelInfo = levelInfoPair.Value;
break;
}
//LevelInfo = levelInfos.Values.First<IFCLevelInfo>();
}
double elevation = (LevelInfo != null) ? LevelInfo.Elevation : 0.0;
IFCAnyHandle levelPlacement = (LevelInfo != null) ? LevelInfo.GetLocalPlacement() : null;
IFCFile file = exporterIFC.GetFile();
Transform trf = Transform.Identity;
if (familyTrf != null)
{
XYZ origin, xDir, yDir, zDir;
xDir = familyTrf.BasisX; yDir = familyTrf.BasisY; zDir = familyTrf.BasisZ;
Transform origOffsetTrf = Transform.Identity;
XYZ negLevelOrigin = new XYZ(0, 0, -elevation);
origOffsetTrf.Origin = negLevelOrigin;
Transform newTrf = origOffsetTrf * familyTrf;
origin = newTrf.Origin;
trf.BasisX = xDir; trf.BasisY = yDir; trf.BasisZ = zDir;
trf = trf.Inverse;
origin = UnitUtil.ScaleLength(origin);
LocalPlacement = ExporterUtil.CreateLocalPlacement(file, levelPlacement, origin, zDir, xDir);
}
else if (orientationTrf != null)
{
XYZ origin, xDir, yDir, zDir;
xDir = orientationTrf.BasisX; yDir = orientationTrf.BasisY; zDir = orientationTrf.BasisZ; origin = orientationTrf.Origin;
XYZ levelOrigin = new XYZ(0, 0, elevation);
origin = origin - levelOrigin;
trf.BasisX = xDir; trf.BasisY = yDir; trf.BasisZ = zDir; trf.Origin = origin;
trf = trf.Inverse;
origin = UnitUtil.ScaleLength(origin);
LocalPlacement = ExporterUtil.CreateLocalPlacement(file, levelPlacement, origin, zDir, xDir);
}
else
{
LocalPlacement = ExporterUtil.CreateLocalPlacement(file, levelPlacement, null, null, null);
}
Transform origOffsetTrf2 = Transform.Identity;
XYZ negLevelOrigin2 = new XYZ(0, 0, -elevation);
origOffsetTrf2.Origin = negLevelOrigin2;
Transform newTrf2 = trf * origOffsetTrf2;
ExporterIFC.PushTransform(newTrf2);
Offset = elevation;
LevelId = newLevelId;
}