Skip to content

Commit

Permalink
v0.0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
jmirtsch committed Dec 9, 2016
1 parent ae4e89d commit 3357157
Show file tree
Hide file tree
Showing 47 changed files with 1,584 additions and 901 deletions.
62 changes: 59 additions & 3 deletions Core/IFC/DatabaseIFC.cs
Expand Up @@ -23,7 +23,6 @@
using System.IO;
using System.ComponentModel;
using System.Linq;
using System.Drawing;
using System.Globalization;
using System.Threading;
using GeometryGym.STEP;
Expand Down Expand Up @@ -71,7 +70,7 @@ private DatabaseIfc(bool generate, ReleaseVersion schema, ModelView view) : this
mRelease = schema;
mModelView = view;
#if (RHINO)
mModelSIScale = 1 / GGYM.Units.mLengthConversion[(int) GGYM.GGYMRhino.GGRhino.ActiveUnits()];
//mModelSIScale = 1 / GGYM.Units.mLengthConversion[(int) GGYM.GGYMRhino.GGRhino.ActiveUnits()];
Tolerance = Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance;
#endif
//mFactory.mGeomRepContxt = new IfcGeometricRepresentationContext(this, 3, Tolerance) { ContextType = "Model" };
Expand Down Expand Up @@ -267,6 +266,7 @@ internal void ReadFile(FileStreamIfc fs)
}
private IfcContext ReadFile(TextReader sr, int offset)
{

mRelease = ReleaseVersion.IFC2x3;
bool ownerHistory = mFactory.Options.GenerateOwnerHistory;
mFactory.Options.GenerateOwnerHistory = false;
Expand Down Expand Up @@ -941,8 +941,64 @@ internal IfcCartesianPoint Origin
return mOrigin;
}
}


private Dictionary<string, IfcBoundaryNodeCondition> mBoundaryNodeConditions = new Dictionary<string, IfcBoundaryNodeCondition>();
public IfcBoundaryNodeCondition FindOrCreateBoundaryNodeCondition(bool isPointRestraint, bool x, bool y, bool z, bool xx, bool yy, bool zz)
{ return FindOrCreateBoundaryNodeCondition(isPointRestraint, new IfcTranslationalStiffnessSelect(x), new IfcTranslationalStiffnessSelect(y), new IfcTranslationalStiffnessSelect(z), new IfcRotationalStiffnessSelect(xx), new IfcRotationalStiffnessSelect(yy), new IfcRotationalStiffnessSelect(zz)); }
public IfcBoundaryNodeCondition FindOrCreateBoundaryNodeCondition(bool isPointRestraint, IfcTranslationalStiffnessSelect x, IfcTranslationalStiffnessSelect y, IfcTranslationalStiffnessSelect z, IfcRotationalStiffnessSelect xx, IfcRotationalStiffnessSelect yy, IfcRotationalStiffnessSelect zz)
{
string name = "";
bool partial = false;
double tol = 1e-6;

if (x == null)
name += isPointRestraint ? 'F' : 'T';
else if (!x.mRigid && x.mStiffness != null)
partial = true;
else
name += (x.mRigid ? 'T' : 'F');
if (y == null)
name += isPointRestraint ? 'F' : 'T';
else if (!y.mRigid && y.mStiffness != null)
partial = true;
else
name += (y.mRigid ? 'T' : 'F');
if (z == null)
name += isPointRestraint ? 'F' : 'T';
else if (!z.mRigid && z.mStiffness != null)
partial = true;
else
name += (z.mRigid ? 'T' : 'F');
if (xx == null)
name += isPointRestraint ? 'F' : 'T';
else if (!xx.mRigid && xx.mStiffness != null)
partial = true;
else
name += (xx.mRigid ? 'T' : 'F');
if (yy == null)
name += isPointRestraint ? 'F' : 'T';
else if (!yy.mRigid && yy.mStiffness != null)
partial = true;
else
name += (yy.mRigid ? 'T' : 'F');
if (zz == null)
name += isPointRestraint ? 'F' : 'T';
else if (!zz.mRigid && zz.mStiffness != null)
partial = true;
else
name += (zz.mRigid ? 'T' : 'F');

if (partial)
{
#warning implement
return new IfcBoundaryNodeCondition(mDatabase, "", x, y, z, xx, yy, zz);
}
if (mBoundaryNodeConditions.ContainsKey(name))
return mBoundaryNodeConditions[name];
IfcBoundaryNodeCondition result = new IfcBoundaryNodeCondition(mDatabase, name, x, y, z, xx, yy, zz);
mBoundaryNodeConditions.Add(name, result);
return result;
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions Core/IFC/Enumerations.cs
Expand Up @@ -239,9 +239,9 @@ public enum IfcStairFlightTypeEnum { STRAIGHT, WINDER, SPIRAL, CURVED, FREEFORM,
public enum IfcStateEnum { READWRITE, READONLY, LOCKED, READWRITELOCKED, READONLYLOCKED, NA };
public enum IfcStatusEnum { NEW, EXISTING, DEMOLISH, TEMPORARY, OTHER, NOTKNOWN, UNSET };
public enum IfcStructuralCurveActivityTypeEnum {CONST, LINEAR, POLYGONAL, EQUIDISTANT, SINUS, PARABOLA, DISCRETE, USERDEFINED, NOTDEFINED}
public enum IfcStructuralCurveTypeEnum { RIGID_JOINED_MEMBER, PIN_JOINED_MEMBER, CABLE, TENSION_MEMBER, COMPRESSION_MEMBER, USERDEFINED, NOTDEFINED };
public enum IfcStructuralCurveMemberTypeEnum { RIGID_JOINED_MEMBER, PIN_JOINED_MEMBER, CABLE, TENSION_MEMBER, COMPRESSION_MEMBER, USERDEFINED, NOTDEFINED };
public enum IfcStructuralSurfaceActivityTypeEnum {CONST, BILINEAR, DISCRETE, ISOCONTOUR, USERDEFINED, NOTDEFINED}
public enum IfcStructuralSurfaceTypeEnum { BENDING_ELEMENT, MEMBRANE_ELEMENT, SHELL, USERDEFINED, NOTDEFINED };
public enum IfcStructuralSurfaceMemberTypeEnum { BENDING_ELEMENT, MEMBRANE_ELEMENT, SHELL, USERDEFINED, NOTDEFINED };
public enum IfcSubContractResourceTypeEnum { PURCHASE, WORK, USERDEFINED, NOTDEFINED };
public enum IfcSurfaceSide { POSITIVE, NEGATIVE, BOTH };
public enum IfcSurfaceTextureEnum { BUMP, OPACITY, REFLECTION, SELFILLUMINATION, SHININESS, SPECULAR, TEXTURE, TRANSPARENCYMAP, NOTDEFINED };
Expand Down
72 changes: 33 additions & 39 deletions Core/IFC/IFC A.cs
Expand Up @@ -23,7 +23,6 @@
using System.IO;
using System.ComponentModel;
using System.Linq;
using System.Drawing;
using GeometryGym.STEP;

namespace GeometryGym.Ifc
Expand Down Expand Up @@ -51,13 +50,8 @@ public partial class IfcActor : IfcObject // SUPERTYPE OF(IfcOccupant)
public IfcActorSelect TheActor { get { return mDatabase[mTheActor] as IfcActorSelect; } set { mTheActor = value.Index; } }

internal IfcActor() : base() { }
internal IfcActor(DatabaseIfc db, IfcActor a) : base(db,a) { TheActor = db.Factory.Duplicate(a.mDatabase[ a.mTheActor]) as IfcActorSelect; }
internal IfcActor(IfcActorSelect a) : base(a.Database)
{
if(mDatabase.mModelView != ModelView.If2x3NotAssigned && mDatabase.mModelView != ModelView.Ifc4NotAssigned )
throw new Exception("Invalid Model View for IfcActor : " + mDatabase.ModelView.ToString());
mTheActor = a.Index;
}
internal IfcActor(DatabaseIfc db, IfcActor a) : base(db,a,false) { TheActor = db.Factory.Duplicate(a.mDatabase[ a.mTheActor]) as IfcActorSelect; }
public IfcActor(IfcActorSelect a) : base(a.Database) { mTheActor = a.Index; }
internal static IfcActor Parse(string strDef) { IfcActor a = new IfcActor(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; }
internal static void parseFields(IfcActor a, List<string> arrFields, ref int ipos) { IfcObject.parseFields(a, arrFields, ref ipos); a.mTheActor = ParserSTEP.ParseLink(arrFields[ipos++]); }
protected override string BuildStringSTEP() { return base.BuildStringSTEP() + "," + ParserSTEP.LinkToString(mTheActor); }
Expand Down Expand Up @@ -163,7 +157,7 @@ public partial class IfcAdvancedBrep : IfcManifoldSolidBrep // IFC4
internal IfcAdvancedBrep(DatabaseIfc db, IfcAdvancedBrep b) : base(db,b) { }
internal IfcAdvancedBrep(IfcClosedShell s) : base(s) { }

internal static IfcAdvancedBrep Parse(string str) { IfcAdvancedBrep b = new IfcAdvancedBrep(); int pos = 0; b.Parse(str,ref pos); return b; }
internal static IfcAdvancedBrep Parse(string str) { IfcAdvancedBrep b = new IfcAdvancedBrep(); int pos = 0; b.Parse(str,ref pos, str.Length); return b; }
protected override string BuildStringSTEP() { return (mDatabase.mRelease == ReleaseVersion.IFC2x3 ? "" : base.BuildStringSTEP()); }
}
public partial class IfcAdvancedBrepWithVoids : IfcAdvancedBrep
Expand All @@ -174,11 +168,11 @@ public partial class IfcAdvancedBrepWithVoids : IfcAdvancedBrep
internal IfcAdvancedBrepWithVoids() : base() { }
internal IfcAdvancedBrepWithVoids(DatabaseIfc db, IfcAdvancedBrepWithVoids b) : base(db,b) { Voids = b.Voids.ConvertAll(x=> db.Factory.Duplicate(x) as IfcClosedShell); }

internal new static IfcAdvancedBrepWithVoids Parse(string str) { IfcAdvancedBrepWithVoids b = new IfcAdvancedBrepWithVoids(); int pos = 0; b.Parse(str,ref pos); return b; }
protected override void Parse(string str, ref int pos)
internal new static IfcAdvancedBrepWithVoids Parse(string str) { IfcAdvancedBrepWithVoids b = new IfcAdvancedBrepWithVoids(); int pos = 0; b.Parse(str,ref pos, str.Length); return b; }
protected override void Parse(string str, ref int pos, int len)
{
base.Parse(str, ref pos);
mVoids = ParserSTEP.StripListLink(str,ref pos);
base.Parse(str, ref pos, len);
mVoids = ParserSTEP.StripListLink(str, ref pos, len);
}
protected override string BuildStringSTEP()
{
Expand Down Expand Up @@ -339,13 +333,13 @@ public partial class IfcAlarmType : IfcDistributionControlElementType
public partial class IfcAngularDimension : IfcDimensionCurveDirectedCallout //IFC4 depreceated
{
internal IfcAngularDimension() : base() { }
internal new static IfcAngularDimension Parse(string str) { IfcAngularDimension d = new IfcAngularDimension(); int pos = 0; d.Parse(str, ref pos); return d; }
internal new static IfcAngularDimension Parse(string str) { IfcAngularDimension d = new IfcAngularDimension(); int pos = 0; d.Parse(str, ref pos, str.Length); return d; }
}
public partial class IfcAnnotation : IfcProduct
{ //INVERSE
internal IfcRelContainedInSpatialStructure mContainedInStructure = null;
internal IfcAnnotation() : base() { }
internal IfcAnnotation(DatabaseIfc db, IfcAnnotation a) : base(db,a) { }
internal IfcAnnotation(DatabaseIfc db, IfcAnnotation a) : base(db,a,false) { }
public IfcAnnotation(DatabaseIfc db) : base(db) { }
internal static IfcAnnotation Parse(string strDef) { int ipos = 0; IfcAnnotation a = new IfcAnnotation(); parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; }
internal static void parseFields(IfcAnnotation a, List<string> arrFields, ref int ipos) { IfcProduct.parseFields(a,arrFields, ref ipos); }
Expand Down Expand Up @@ -394,12 +388,12 @@ public partial class IfcAnnotationFillAreaOccurrence : IfcAnnotationOccurrence /
internal IfcGlobalOrLocalEnum mGlobalOrLocal;// : OPTIONAL IfcGlobalOrLocalEnum;
internal IfcAnnotationFillAreaOccurrence(DatabaseIfc db, IfcAnnotationFillAreaOccurrence f) : base(db,f) { }
internal IfcAnnotationFillAreaOccurrence() : base() { }
internal new static IfcAnnotationFillAreaOccurrence Parse(string str) { IfcAnnotationFillAreaOccurrence a = new IfcAnnotationFillAreaOccurrence(); int pos = 0; a.Parse(str, ref pos); return a; }
protected override void Parse(string str, ref int pos)
internal new static IfcAnnotationFillAreaOccurrence Parse(string str) { IfcAnnotationFillAreaOccurrence a = new IfcAnnotationFillAreaOccurrence(); int pos = 0; a.Parse(str, ref pos, str.Length); return a; }
protected override void Parse(string str, ref int pos, int len)
{
base.Parse(str, ref pos);
mFillStyleTarget = ParserSTEP.StripLink(str,ref pos);
string s = ParserSTEP.StripField(str,ref pos);
base.Parse(str, ref pos, len);
mFillStyleTarget = ParserSTEP.StripLink(str, ref pos, len);
string s = ParserSTEP.StripField(str, ref pos, len);
if(s != "$")
mGlobalOrLocal = (IfcGlobalOrLocalEnum)Enum.Parse(typeof(IfcGlobalOrLocalEnum),s.Replace(".",""));
}
Expand All @@ -423,9 +417,9 @@ public partial class IfcAnnotationSurface : IfcGeometricRepresentationItem //DEP
internal static IfcAnnotationSurface Parse(string str)
{
IfcAnnotationSurface a = new IfcAnnotationSurface();
int pos = 0;
a.mItem = ParserSTEP.StripLink(str, ref pos);
a.mTextureCoordinates = ParserSTEP.StripLink(str, ref pos);
int pos = 0, len = str.Length;
a.mItem = ParserSTEP.StripLink(str, ref pos, len);
a.mTextureCoordinates = ParserSTEP.StripLink(str, ref pos, len);
return a;
}
protected override string BuildStringSTEP() { return base.BuildStringSTEP() + "," + ParserSTEP.LinkToString(mItem) + "," + ParserSTEP.LinkToString(mTextureCoordinates); }
Expand All @@ -434,18 +428,18 @@ public partial class IfcAnnotationSurfaceOccurrence : IfcAnnotationOccurrence //
{
internal IfcAnnotationSurfaceOccurrence(DatabaseIfc db, IfcAnnotationSurfaceOccurrence o) : base(db,o) { }
internal IfcAnnotationSurfaceOccurrence() : base() { }
internal new static IfcAnnotationSurfaceOccurrence Parse(string str) { IfcAnnotationSurfaceOccurrence a = new IfcAnnotationSurfaceOccurrence(); int pos = 0; a.Parse(str, ref pos); return a; }
internal new static IfcAnnotationSurfaceOccurrence Parse(string str) { IfcAnnotationSurfaceOccurrence a = new IfcAnnotationSurfaceOccurrence(); int pos = 0; a.Parse(str, ref pos, str.Length); return a; }
}
public partial class IfcAnnotationSymbolOccurrence : IfcAnnotationOccurrence //IFC4 Depreceated
{
internal IfcAnnotationSymbolOccurrence() : base() { }
internal new static IfcAnnotationSymbolOccurrence Parse(string str) { IfcAnnotationSymbolOccurrence a = new IfcAnnotationSymbolOccurrence(); int pos = 0; a.Parse(str, ref pos); return a; }
internal new static IfcAnnotationSymbolOccurrence Parse(string str) { IfcAnnotationSymbolOccurrence a = new IfcAnnotationSymbolOccurrence(); int pos = 0; a.Parse(str, ref pos, str.Length); return a; }
}
public partial class IfcAnnotationTextOccurrence : IfcAnnotationOccurrence //IFC4 Depreceated
{
internal IfcAnnotationTextOccurrence() : base() { }
internal IfcAnnotationTextOccurrence(DatabaseIfc db, IfcAnnotationTextOccurrence o) : base(db,o) { }
internal new static IfcAnnotationTextOccurrence Parse(string str) { IfcAnnotationTextOccurrence a = new IfcAnnotationTextOccurrence(); int pos = 0; a.Parse(str, ref pos); return a; }
internal new static IfcAnnotationTextOccurrence Parse(string str) { IfcAnnotationTextOccurrence a = new IfcAnnotationTextOccurrence(); int pos = 0; a.Parse(str, ref pos, str.Length); return a; }
}
public partial class IfcApplication : BaseClassIfc
{
Expand Down Expand Up @@ -971,11 +965,11 @@ public partial class IfcAxis1Placement : IfcPlacement
internal IfcAxis1Placement(DatabaseIfc db, IfcAxis1Placement p) : base(db,p) { if(p.mAxis > 0) Axis = db.Factory.Duplicate( p.Axis) as IfcDirection; }

protected override string BuildStringSTEP() { return base.BuildStringSTEP() + "," + ParserSTEP.LinkToString(mAxis); }
internal static IfcAxis1Placement Parse(string str) { IfcAxis1Placement p = new IfcAxis1Placement(); int pos = 0; p.Parse(str, ref pos); return p; }
protected override void Parse(string str, ref int pos)
internal static IfcAxis1Placement Parse(string str) { IfcAxis1Placement p = new IfcAxis1Placement(); int pos = 0; p.Parse(str, ref pos, str.Length); return p; }
protected override void Parse(string str, ref int pos, int len)
{
base.Parse(str, ref pos);
mAxis = ParserSTEP.StripLink(str,ref pos);
base.Parse(str, ref pos, len);
mAxis = ParserSTEP.StripLink(str, ref pos, len);
}
}
public partial interface IfcAxis2Placement : IBaseClassIfc { bool IsWorldXY { get; } } //SELECT ( IfcAxis2Placement2D, IfcAxis2Placement3D);
Expand All @@ -995,11 +989,11 @@ internal IfcAxis2Placement2D(DatabaseIfc db, IfcAxis2Placement2D p) : base(db, p


protected override string BuildStringSTEP() { return base.BuildStringSTEP() + "," + ParserSTEP.LinkToString(mRefDirection); }
internal static IfcAxis2Placement2D Parse(string str) { IfcAxis2Placement2D p = new IfcAxis2Placement2D(); int pos = 0; p.Parse(str, ref pos); return p; }
protected override void Parse(string str, ref int pos)
internal static IfcAxis2Placement2D Parse(string str) { IfcAxis2Placement2D p = new IfcAxis2Placement2D(); int pos = 0; p.Parse(str, ref pos, str.Length); return p; }
protected override void Parse(string str, ref int pos, int len)
{
base.Parse(str, ref pos);
mRefDirection = ParserSTEP.StripLink(str,ref pos);
base.Parse(str, ref pos, len);
mRefDirection = ParserSTEP.StripLink(str, ref pos, len);
}

public override bool IsWorldXY { get { return base.IsWorldXY && (mRefDirection == 0 || RefDirection.isXAxis); } }
Expand Down Expand Up @@ -1051,12 +1045,12 @@ internal IfcAxis2Placement3D(DatabaseIfc db, IfcAxis2Placement3D p) : base(db, p
RefDirection = db.Factory.Duplicate(p.RefDirection) as IfcDirection;
}

internal static IfcAxis2Placement3D Parse(string str) { IfcAxis2Placement3D p = new IfcAxis2Placement3D(); int pos = 0; p.Parse(str,ref pos); return p; }
protected override void Parse(string str, ref int pos)
internal static IfcAxis2Placement3D Parse(string str) { IfcAxis2Placement3D p = new IfcAxis2Placement3D(); int pos = 0; p.Parse(str,ref pos, str.Length); return p; }
protected override void Parse(string str, ref int pos, int len)
{
base.Parse(str, ref pos);
mAxis = ParserSTEP.StripLink(str, ref pos);
mRefDirection = ParserSTEP.StripLink(str,ref pos);
base.Parse(str, ref pos, len);
mAxis = ParserSTEP.StripLink(str, ref pos, len);
mRefDirection = ParserSTEP.StripLink(str, ref pos, len);
}
protected override string BuildStringSTEP() { return base.BuildStringSTEP() + (mAxis > 0 ? "," + ParserSTEP.LinkToString(mAxis) : ",$") + (mRefDirection > 0 ? "," + ParserSTEP.LinkToString(mRefDirection) : ",$"); }

Expand Down

0 comments on commit 3357157

Please sign in to comment.