本文整理汇总了C#中GeometryGym.Ifc.DatabaseIfc类的典型用法代码示例。如果您正苦于以下问题:C# DatabaseIfc类的具体用法?C# DatabaseIfc怎么用?C# DatabaseIfc使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DatabaseIfc类属于GeometryGym.Ifc命名空间,在下文中一共展示了DatabaseIfc类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IfcCartesianPointList2D
public IfcCartesianPointList2D(DatabaseIfc m, IEnumerable<Point2d> coordList) : base(m)
{
List<Tuple<double, double>> pts = new List<Tuple<double, double>>();
foreach (Point2d t in coordList)
pts.Add(new Tuple<double, double>(t.X, t.Y));
mCoordList = pts.ToArray();
}
示例2: IfcRationalBSplineCurveWithKnots
internal IfcRationalBSplineCurveWithKnots(DatabaseIfc db, NurbsCurve nc, bool twoD)
: base(db, nc, twoD)
{
mWeightsData = new List<double>(nc.Points.Count);
for (int icounter = 0; icounter < nc.Points.Count; icounter++)
mWeightsData.Add(nc.Points[icounter].Weight);
}
示例3: attachModel
private void attachModel(DatabaseIfc m)
{
bool added = false;
for (int icounter = m.mNextBlank; icounter < m.mIfcObjects.Count; icounter++)
{
if (m.mIfcObjects[icounter] == null)
{
added = true;
mIndex = icounter;
m.mNextBlank = icounter + 1;
m.mIfcObjects[icounter] = this;
break;
}
}
if (!added)
{
if (m.mNextBlank > m.mIfcObjects.Count)
{
int count = m.mNextBlank - m.mIfcObjects.Count;
for (int pcounter = 0; pcounter < count; pcounter++)
m.mIfcObjects.Add(null);
}
mIndex = m.mIfcObjects.Count;
m.mIfcObjects.Add(this);
m.mNextBlank = mIndex + 1;
}
mDatabase = m;
}
示例4: IfcEdge
internal IfcEdge(DatabaseIfc db, IfcEdge e) : base(db, e)
{
if(e.mEdgeStart > 0)
EdgeStart = db.Factory.Duplicate( e.EdgeStart) as IfcVertex;
if(e.mEdgeEnd > 0)
EdgeEnd = db.Factory.Duplicate( e.EdgeEnd) as IfcVertex;
}
示例5: IfcParameterizedProfileDef
protected IfcParameterizedProfileDef(DatabaseIfc m)
: base(m)
{
if (mDatabase.mModelView == ModelView.Ifc4Reference)
throw new Exception("Invalid Model View for IfcParameterizedProfileDef : " + m.ModelView.ToString());
if (mDatabase.mSchema == Schema.IFC2x3)
Position = (mDatabase.m2DPlaceOrigin == null ? new IfcAxis2Placement2D(m) : mDatabase.m2DPlaceOrigin);
}
示例6: IfcDirection
public IfcDirection(DatabaseIfc db, Vector2D v)
: base(db)
{
double len = v.Length;
mDirectionRatioX = v.X / len;
mDirectionRatioY = v.Y / len;
mDirectionRatioZ = double.NaN;
}
示例7: Main
static void Main(string[] args)
{
DatabaseIfc db = new DatabaseIfc(Console.In);
IfcProject project = db.Project;
IfcSpatialElement rootElement = project.RootElement;
int buildingStoreyCount = CountStories(rootElement);
Console.Out.Write("Number of Stories in file :" + buildingStoreyCount);
}
示例8: IfcTable
public IfcTable(DatabaseIfc m, string name, List<IfcTableRow> rows, List<IfcTableColumn> cols) : base(m)
{
if (!string.IsNullOrEmpty(name))
mName = name.Replace("'", "");
if (rows != null && rows.Count > 0)
mRows = rows.ConvertAll(x => x.mIndex);
if (cols != null && cols.Count > 0)
mColumns = cols.ConvertAll(x => x.mIndex);
}
示例9: IfcMapConversion
internal IfcMapConversion(DatabaseIfc m, IfcCoordinateReferenceSystemSelect source, IfcCoordinateReferenceSystem target, double eastings, double northings, double orthogonalHeight, double XAxisAbscissa, double XAxisOrdinate, double scale)
: base(m, source, target)
{
mEastings = eastings;
mNorthings = northings;
mOrthogonalHeight = orthogonalHeight;
mXAxisAbscissa = XAxisAbscissa;
mXAxisOrdinate = XAxisOrdinate;
mScale = scale;
}
示例10: IfcDirection
public IfcDirection(DatabaseIfc db, Vector3d v)
: base(db)
{
Vector3d unit = v;
unit.Unitize();
mDirectionRatioX = unit.X;
mDirectionRatioY = unit.Y;
mDirectionRatioZ = unit.Z;
}
示例11: IfcColourRgbList
public IfcColourRgbList(DatabaseIfc db, IEnumerable<Color> colourList)
: base(db)
{
mColourList = new Tuple<double, double, double>[colourList.Count()];
int ilast = colourList.Count();
for (int icounter = 0; icounter < ilast; icounter++)
{
Color c = colourList.ElementAt(icounter);
mColourList[icounter] = new Tuple<double, double, double>(c.R / 255.0, c.G / 255.0, c.B / 255.0);
}
}
示例12: ConvertRhinoCommonCurve
public static IfcBoundedCurve ConvertRhinoCommonCurve(DatabaseIfc db, Curve crv)
{
double tol = db.Tolerance, angTol = Math.PI / 1800;
if (crv.IsLinear(tol))
return new IfcPolyline(new List<IfcCartesianPoint>() { new IfcCartesianPoint(db, crv.PointAtStart), new IfcCartesianPoint(db, crv.PointAtEnd) });
Plane pln = new Plane();
if (crv.TryGetPlane(out pln, tol))
{
if (Math.Abs(pln.Origin.Z) < tol && pln.ZAxis.IsParallelTo(Vector3d.ZAxis, angTol) != 0)
return convCurve(db, crv, true);
}
return convCurve(db, crv, false);
}
示例13: IfcNamedUnit
protected IfcNamedUnit(DatabaseIfc m, IfcUnitEnum unitEnum, bool gendims) : base(m)
{
mUnitType = unitEnum;
if (gendims)
{
if (unitEnum == IfcUnitEnum.LENGTHUNIT)
mDimensions = new IfcDimensionalExponents(m, 1, 0, 0, 0, 0, 0, 0).mIndex;
else if (unitEnum == IfcUnitEnum.AREAUNIT)
mDimensions = new IfcDimensionalExponents(m, 2, 0, 0, 0, 0, 0, 0).mIndex;
else if (unitEnum == IfcUnitEnum.VOLUMEUNIT)
mDimensions = new IfcDimensionalExponents(m, 3, 0, 0, 0, 0, 0, 0).mIndex;
else if (unitEnum == IfcUnitEnum.PLANEANGLEUNIT)
mDimensions = new IfcDimensionalExponents(m, 0, 0, 0, 0, 0, 0, 0).mIndex;
}
}
示例14: IfcTrimmedCurve
internal IfcTrimmedCurve(DatabaseIfc db, Arc a, bool twoD, IfcCartesianPoint optStrt, out IfcCartesianPoint end)
: base(db)
{
Point3d o = a.Plane.Origin, s = a.StartPoint, e = a.EndPoint;
Vector3d x = s - o;
mSenseAgreement = true;
if (optStrt == null)
optStrt = twoD ? new IfcCartesianPoint(db, new Point2d(s.X, s.Y)) : new IfcCartesianPoint(db, s);
end = twoD ? new IfcCartesianPoint(db, new Point2d(e.X, e.Y)) : new IfcCartesianPoint(db,e);
double angleFactor = mDatabase.mContext.UnitsInContext.getScaleSI(IfcUnitEnum.PLANEANGLEUNIT);
if (twoD)
{
if (a.Plane.ZAxis.Z < 0)
{
mSenseAgreement = false;
x = e - o;
IfcAxis2Placement2D ap = new IfcAxis2Placement2D(db, new Point2d(o.X, o.Y), new Vector2d(x.X, x.Y));
BasisCurve = new IfcCircle(ap, a.Radius);
mTrim1 = new IfcTrimmingSelect(a.Angle / angleFactor, optStrt);
mTrim2 = new IfcTrimmingSelect(0, end);
}
else
{
IfcAxis2Placement2D ap = new IfcAxis2Placement2D(db, new Point2d(o.X, o.Y), new Vector2d(x.X, x.Y));
BasisCurve = new IfcCircle(ap, a.Radius);
mTrim1 = new IfcTrimmingSelect(0, optStrt);
mTrim2 = new IfcTrimmingSelect(a.Angle / angleFactor, end);
}
}
else
{
Vector3d y = Vector3d.CrossProduct(a.Plane.ZAxis, x);
Plane pl = new Plane(o, x, y);
IfcAxis2Placement3D ap = new IfcAxis2Placement3D(db, pl);
BasisCurve = new IfcCircle(ap, a.Radius);
mTrim1 = new IfcTrimmingSelect(0, optStrt);
mTrim2 = new IfcTrimmingSelect(a.Angle / angleFactor, end);
}
mMasterRepresentation = IfcTrimmingPreference.PARAMETER;
}
示例15: IfcWindowType
internal IfcWindowType(DatabaseIfc m, string name, IfcWindowTypeEnum type, IfcWindowTypePartitioningEnum partition, string userDefinedPartionType, IfcWindowLiningProperties wlp, List<IfcWindowPanelProperties> pps)
: base(m)
{
Name = name;
mPredefinedType = type;
mPartitioningType = partition;
mParameterTakesPrecedence = true;
if (wlp != null)
mHasPropertySets.Add(wlp.mIndex);
if (pps != null && pps.Count > 0)
mHasPropertySets.AddRange(pps.ConvertAll(x => x.mIndex));
if (!string.IsNullOrEmpty(userDefinedPartionType))
mUserDefinedPartitioningType = userDefinedPartionType.Replace("'", "");
}