Class ContentElement
An element representing user content.
Implements
Inherited Members
Namespace: Elements
Assembly: Hypar.Elements.dll
Syntax
[JsonConverter(typeof(JsonInheritanceConverter), new object[]{"discriminator"})]
public class ContentElement : GeometricElement, INotifyPropertyChanged
Constructors
ContentElement(String, BBox3, Double, Vector3, Transform, Material, Representation, Boolean, Guid, String)
This constructor adds backwards compatibility with the old constructor, before Symbols were added.
Declaration
public ContentElement(string gltfLocation, BBox3 boundingBox, double gltfScaleToMeters, Vector3 sourceDirection, Transform transform, Material material, Representation representation, bool isElementDefinition, Guid id, string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | gltfLocation | The path to the .glb file. |
BBox3 | boundingBox | The BBox3 of this Content Element. |
System.Double | gltfScaleToMeters | The number required to scale this contents dimensions to meters. Used during gltf merging. |
Vector3 | sourceDirection | The direction the element was facing when it was extracted from it's source. |
Transform | transform | The transform of this ContentElement. |
Material | material | The material, used for the BBox representation of this element. |
Representation | representation | The representation which will be updated when needed. |
System.Boolean | isElementDefinition | Should the element be used to create instances, or should it be inserted into a 3D scene. |
System.Guid | id | The guid of this element. |
System.String | name | The name of this element. |
ContentElement(String, BBox3, Double, Vector3, Transform, Material, Representation, Boolean, Guid, String, String)
This constructor adds the ability to include additionalProperties. The additional properties should be a dictionary that has been serialized to a string, they are deserialized during construction. This is used in Revit Content workflows to store instance parameter data.
Declaration
public ContentElement(string gltfLocation, BBox3 boundingBox, double gltfScaleToMeters, Vector3 sourceDirection, Transform transform, Material material, Representation representation, bool isElementDefinition, Guid id, string name, string additionalProperties)
Parameters
Type | Name | Description |
---|---|---|
System.String | gltfLocation | The path to the .glb file. |
BBox3 | boundingBox | The BBox3 of this Content Element. |
System.Double | gltfScaleToMeters | The number required to scale this contents dimensions to meters. Used during gltf merging. |
Vector3 | sourceDirection | The direction the element was facing when it was extracted from it's source. |
Transform | transform | The transform of this ContentElement. |
Material | material | The material, used for the BBox representation of this element. |
Representation | representation | The representation which will be updated when needed. |
System.Boolean | isElementDefinition | Should the element be used to create instances, or should it be inserted into a 3D scene. |
System.Guid | id | The guid of this element. |
System.String | name | The name of this element. |
System.String | additionalProperties | The string json serialization of a dictionary of additional parameters. |
ContentElement(String, BBox3, Double, Vector3, IList<Symbol>, Transform, Material, Representation, Boolean, Guid, String)
Construct a content element.
Declaration
[JsonConstructor]
public ContentElement(string gltfLocation, BBox3 boundingBox, double gltfScaleToMeters, Vector3 sourceDirection, IList<Symbol> symbols, Transform transform = null, Material material = null, Representation representation = null, bool isElementDefinition = false, Guid id = default(Guid), string name = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | gltfLocation | |
BBox3 | boundingBox | |
System.Double | gltfScaleToMeters | |
Vector3 | sourceDirection | |
System.Collections.Generic.IList<Symbol> | symbols | |
Transform | transform | |
Material | material | |
Representation | representation | |
System.Boolean | isElementDefinition | |
System.Guid | id | |
System.String | name |
ContentElement(String, BBox3, Double, Vector3, IList<Symbol>, Transform, Material, Representation, Boolean, Guid, String, String)
This constructor adds the ability to include additionalProperties. The additional properties should be a dictionary that has been serialized to a string, they are deserialized during construction. This is used in Revit Content workflows to store instance parameter data.
Declaration
public ContentElement(string gltfLocation, BBox3 boundingBox, double gltfScaleToMeters, Vector3 sourceDirection, IList<Symbol> symbols, Transform transform, Material material, Representation representation, bool isElementDefinition, Guid id, string name, string additionalProperties)
Parameters
Type | Name | Description |
---|---|---|
System.String | gltfLocation | The path to the .glb file. |
BBox3 | boundingBox | The BBox3 of this Content Element. |
System.Double | gltfScaleToMeters | The number required to scale this contents dimensions to meters. Used during gltf merging. |
Vector3 | sourceDirection | The direction the element was facing when it was extracted from it's source. |
System.Collections.Generic.IList<Symbol> | symbols | Any additional symbol representations of this content element. |
Transform | transform | The transform of this ContentElement. |
Material | material | The material, used for the BBox representation of this element. |
Representation | representation | The representation which will be updated when needed. |
System.Boolean | isElementDefinition | Should the element be used to create instances, or should it be inserted into a 3D scene. |
System.Guid | id | The guid of this element. |
System.String | name | The name of this element. |
System.String | additionalProperties | The string json serialization of a dictionary of additional parameters. |
Properties
BoundingBox
The bounding box of the content.
Declaration
[JsonProperty("Bounding Box", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
public BBox3 BoundingBox { get; set; }
Property Value
Type | Description |
---|---|
BBox3 |
GltfLocation
The URI of the gltf for this element.
Declaration
[JsonProperty("gltfLocation", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
public string GltfLocation { get; set; }
Property Value
Type | Description |
---|---|
System.String |
GltfScaleToMeters
The scale needed to convert the gltf to meters.
Declaration
[JsonProperty("Gltf Scale to Meters", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
public double GltfScaleToMeters { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
SourceDirection
A vector indicating the direction the source object was originally facing.
Declaration
[JsonProperty("SourceDirection", Required = Required.Default, NullValueHandling = NullValueHandling.Ignore)]
public Vector3 SourceDirection { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Symbols
Alternate symbolic representations of the object.
Declaration
[JsonProperty("Symbols", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
public IList<Symbol> Symbols { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<Symbol> |
Methods
UpdateRepresentations()
Update the ContentElement representation with a solid of the Bounding Box. This is used in the absence of finding a Gltf for import.
Declaration
public override void UpdateRepresentations()