Skip to content

Commit

Permalink
IfcTextLiteral Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jmirtsch committed Oct 6, 2022
1 parent 0589fe7 commit a45248f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions Core/IFC/Enumerations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public enum IfcBearingTypeDisplacementEnum { NOTDEFINED, FIXED_MOVEMENT, GUIDED_
public enum IfcBearingTypeEnum { NOTDEFINED, USERDEFINED, CYLINDRICAL, SPHERICAL, ELASTOMERIC, POT, GUIDE, ROCKER, ROLLER, [VersionAdded(ReleaseVersion.IFC4X2)] DISK };
public enum IfcBenchmarkEnum { GREATERTHAN, GREATERTHANOREQUALTO, LESSTHAN, LESSTHANOREQUALTO, EQUALTO, NOTEQUALTO, INCLUDES, NOTINCLUDES, INCLUDEDIN, NOTINCLUDEDIN };
public enum IfcBoilerTypeEnum { NOTDEFINED, USERDEFINED, WATER, STEAM };
public enum IfcBoxAlignment { TOP_LEFT, TOP_MIDDLE, TOP_RIGHT, MIDDLE_LEFT, CENTER, MIDDLE_RIGHT, BOTTOM_LEFT, BOTTOM_MIDDLE, BOTTOM_RIGHT };
public enum IfcBooleanOperator { UNION, INTERSECTION, DIFFERENCE };
public enum IfcBridgePartTypeEnum { NOTDEFINED, USERDEFINED, ABUTMENT, DECK, DECK_SEGMENT, FOUNDATION, PIER, PIER_SEGMENT, PYLON, SUBSTRUCTURE, SUPERSTRUCTURE, SURFACESTRUCTURE };
public enum IfcBridgeTypeEnum { NOTDEFINED, USERDEFINED, ARCHED, CABLE_STAYED, CANTILEVER, CULVERT, FRAMEWORK, GIRDER, SUSPENSION, TRUSS };
Expand Down
17 changes: 15 additions & 2 deletions Core/IFC/IFC T.cs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ public partial class IfcTextLiteral : IfcGeometricRepresentationItem //SUPERTYPE
internal IfcAxis2Placement mPlacement;// : IfcAxis2Placement;
internal IfcTextPath mPath;// : IfcTextPath;

public string Literal { get { return ParserIfc.Decode(mLiteral); } set { mLiteral = ParserIfc.Encode(value); } }
public string Literal { get { return mLiteral; } set { mLiteral = value; } }
public IfcAxis2Placement Placement { get { return mPlacement; } }
public IfcTextPath Path { get { return mPath; } set { mPath = value; } }

Expand All @@ -424,16 +424,29 @@ internal IfcTextLiteral(DatabaseIfc db, IfcTextLiteral l, DuplicateOptions optio
mPlacement = db.Factory.Duplicate<IfcAxis2Placement>(l.mPlacement);
mPath = l.mPath;
}
public IfcTextLiteral(string literal, IfcAxis2Placement placement, IfcTextPath path)
: base(placement.Database)
{
Literal = literal;
mPlacement = placement;
mPath = path;
}
}
[Serializable]
public partial class IfcTextLiteralWithExtent : IfcTextLiteral
{
internal IfcPlanarExtent mExtent;// : IfcPlanarExtent;
internal string mBoxAlignment = "";// : IfcBoxAlignment;
internal IfcBoxAlignment mBoxAlignment = IfcBoxAlignment.CENTER;// : IfcBoxAlignment;

public IfcPlanarExtent Extent { get { return mExtent; } set { mExtent = value; } }

internal IfcTextLiteralWithExtent() : base() { }
public IfcTextLiteralWithExtent(string literal, IfcAxis2Placement placement, IfcTextPath path, IfcPlanarExtent extent, IfcBoxAlignment alignment)
: base(literal, placement, path)
{
mExtent = extent;
mBoxAlignment = alignment;
}
}
[Serializable]
public partial class IfcTextStyle : IfcPresentationStyle, IfcPresentationStyleSelect
Expand Down
7 changes: 5 additions & 2 deletions Core/IFC/STEP/IFC T STEP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,15 @@ internal override void parse(string str, ref int pos, ReleaseVersion release, in
}
public partial class IfcTextLiteralWithExtent
{
protected override string BuildStringSTEP(ReleaseVersion release) { return base.BuildStringSTEP(release) + ",#" + mExtent.StepId + ",'" + mBoxAlignment + "'"; }
protected override string BuildStringSTEP(ReleaseVersion release)
{
return base.BuildStringSTEP(release) + ",#" + mExtent.StepId + ",'" + mBoxAlignment.ToString().ToLower().Replace("_","-") + "'";
}
internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary<int, BaseClassIfc> dictionary)
{
base.parse(str, ref pos, release, len, dictionary);
mExtent = dictionary[ParserSTEP.StripLink(str, ref pos, len)] as IfcPlanarExtent;
mBoxAlignment = ParserSTEP.StripString(str, ref pos, len);
Enum.TryParse<IfcBoxAlignment>(ParserSTEP.StripString(str, ref pos, len).Replace("-","_"), true, out mBoxAlignment);
}
}
public partial class IfcTextStyle
Expand Down

0 comments on commit a45248f

Please sign in to comment.