Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace GeometryStream with GeometryMap. #36

Open
wants to merge 2 commits into
base: core/GeometryDetailRecord
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Domains/Core/BisCore.ecschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<NoAdditionalLinkTables xmlns="ECDbSchemaPolicies.1.0"/>
<SchemaHasBehavior/>
</ECCustomAttributes>

<!-- Applied to an ECClass to reserve a list of properties that cannot be used by that class or its derived classes. -->
<ECCustomAttributeClass typeName="ReservedPropertyNames" modifier="Sealed" appliesTo="EntityClass,RelationshipClass"
description="Declare a list of properties as reserved. The property name listed would be forbidden from use in the class and classes that inherit from it.">
Expand Down Expand Up @@ -566,14 +565,14 @@

<ECEntityClass typeName="GeometryDetailRecord" modifier="Abstract" displayLabel="Geometry Detail Record" description="An abstract InformationRecordElement that holds geometry for use by the 'feature tree' stored in the `GeometricElement3d.GeometryOperations` property of its parent Element.">
<BaseClass>InformationRecordElement</BaseClass>
<ECProperty propertyName="GeometryStream" typeName="binary" extendedTypeName="GeometryStream" displayLabel="Geometry Stream" description="Binary stream used to persist the geometry of this bis:Element.">
<ECProperty propertyName="GeometryMap" typeName="binary" extendedTypeName="GeometryMap" displayLabel="Geometry Map" description="Binary stream used to persist the geometries of this bis:Element.">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has Brien's code to work with GeometryDetailRecords also been updated to work with GeometryMap instead of GeometryStream?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bbastings Looks like there won't be any issues to update the code if/when we decide to merge that branch.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a .remarks.md file documenting the format or linking to its documentation. Should also link to docs for the API for working with this stuff.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the remarks, the API is not published to public registry yet.

<ECCustomAttributes>
<HiddenProperty xmlns="CoreCustomAttributes.1.0"/>
<!-- WIP: can't have this CA without the class having a ClassHasHandler CA. Need a policy/strategy decision here...
<CustomHandledProperty/>
-->
</ECCustomAttributes>
</ECProperty>
</ECProperty>
</ECEntityClass>

<ECRelationshipClass typeName="GeometricElementOwnsGeometryDetailRecord" strength="embedding" modifier="None" displayLabel="GeometricElement Owns GeometryDetailRecord" description="Relates GeometryDetailRecords to their parent Element (of which they describe a geometry detail).">
Expand Down Expand Up @@ -2047,7 +2046,7 @@
<ECEnumerator value="5" displayLabel="Elevation"/>
<ECEnumerator value="6" displayLabel="Plan"/>
</ECEnumeration>

<ECEntityClass typeName="SectionDrawingLocation" displayLabel="Section Drawing Location" description="The spatial location of a section drawing generated from a SpatialViewDefinition.">
<BaseClass>SpatialLocationElement</BaseClass>
<ECNavigationProperty propertyName="SectionView" relationshipName="SectionDrawingLocationRefersToSectionView" direction="forward" displayLabel="Section View" description="The section view generated from the SpatialViewDefinition."/>
Expand Down
22 changes: 20 additions & 2 deletions Domains/Core/BisCore.remarks.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Other schemas should use domain handlers (written in TypeScript) and the `Schema

### ISubModeledElement

Sub-modeling is also sometimes described as "breaking down", i.e. a sub-modeled Element can be "broken down into" a finer-grained (sub) Model.
Sub-modeling is also sometimes described as "breaking down", i.e. a sub-modeled Element can be "broken down into" a finer-grained (sub) Model.
See also [IParentElement](#iparentelement).

> Behavior: The system handler (C++) for `Element` only permits a sub-model to be inserted if the class of the *modeled element* implements the `ISubModeledElement` interface.
Expand Down Expand Up @@ -438,6 +438,24 @@ A `GeometryDetailRecord` should always be the child of a `GeometricElement3d` wh

A `GeometryDetailRecord` models a geometric detail of the Entity modeled by its parent `GeometricElement3d`.

The `GeometryMap` property of the `GeometryDetailRecord` holds an array of identifiable geometry streams serialized in flat buffer format, see [ElementGeometryDataEntry](https://www.itwinjs.org/reference/core-common/geometry/elementgeometrydataentry/):

```text
table GeometryMap {
entries: [GeometryMapEntry];
}

table GeometryMapEntry {
id: int;
entries: [ElementGeometryDataEntry];
}

table ElementGeometryDataEntry {
opcode: int;
data: [ubyte];
}
```

The GeometryStream of the `GeometryDetailRecord` does not actually hold the geometry of the geometric detail, but rather holds information needed to *produce* the specific geometric detail in its parent `GeometricElement3d`'s GeometryStream. There may be two other geometries that a user will wish to see in conjunction with a `GeometryDetailRecord`:
- The faces and edges produced in the parent's GeometryStream by the `GeometryDetailRecord`'s associated operation in the feature tree.
- A representation of the geometric change caused by the associated operation in the "feature tree", e.g. a solid representing the material subtracted to create an opening or the material added to create a protrusion.
Expand Down Expand Up @@ -477,7 +495,7 @@ Other `InformationContentElement` instances can also be inserted into a `Definit

### RepositoryModel

> Behavior: The singleton `RepositoryModel` behaves like a standard `InformationModel` and should have been a direct subclass of `InformationModel`. Unfortunately, it subclasses from `DefinitionModel` for legacy reasons that are no longer relevant.
> Behavior: The singleton `RepositoryModel` behaves like a standard `InformationModel` and should have been a direct subclass of `InformationModel`. Unfortunately, it subclasses from `DefinitionModel` for legacy reasons that are no longer relevant.
However, the system handler (C++) for `RepositoryModel` makes it act like a direct subclass of `InformationModel`.
Consistent with a standard `InformationModel`, all `InformationContentElement` instances except `DefinitionElement` subclasses may be inserted.
For backwards compatibility reasons, the superclass of `RepositoryModel` cannot be corrected until a major schema version upgrade.
Expand Down