Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Presentation: Property category nesting improvements (iTwin#1847)

* Add a way to display related properties without a special related class category

* Update docs/learning/presentation/Content/PropertyCategorySpecification.md

* Reduce content json size (iTwin#1686)

* Update presentation/common/src/presentation-common/content/Fields.ts

* Add offset body operation for IFC connector. (iTwin#1873)

* Correctly handle case where subtract operation consumes target body. (iTwin#1878)

* Use worker thread for mass properties calculations. (iTwin#1887)

* No need to ignore lint warning on return type now that's properly defined.

* Update to @bentley/[email protected]

Co-authored-by: Grigas <[email protected]>
Co-authored-by: Robert Lukasonok <[email protected]>
Co-authored-by: aurislt7 <[email protected]>
Co-authored-by: Paul Connelly <[email protected]>
Co-authored-by: EarlinLutz <[email protected]>
Co-authored-by: mgooding <[email protected]>
Co-authored-by: Bill Goehrig <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: imodeljs-admin <[email protected]>
Co-authored-by: hnn0003 <[email protected]>
Co-authored-by: David Stradley <[email protected]>
Co-authored-by: Michael Belousov <[email protected]>
Co-authored-by: Mike Belousov <[email protected]>
Co-authored-by: Seamus Kirby <[email protected]>
Co-authored-by: kckst8 <[email protected]>
Co-authored-by: dassaf4 <[email protected]>
Co-authored-by: Evan Preslar <[email protected]>
Co-authored-by: Keith Bentley <[email protected]>
Co-authored-by: bbastings <[email protected]>
  • Loading branch information
20 people authored Jul 20, 2021
2 parents 80230ec + 9399e22 commit f419a96
Show file tree
Hide file tree
Showing 31 changed files with 2,018 additions and 335 deletions.
8 changes: 7 additions & 1 deletion common/api/imodeljs-common.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ export interface BRepGeometryCreate {
entryArray: ElementGeometryDataEntry[];
onResult: BRepGeometryFunction;
operation: BRepGeometryOperation;
parameters?: BRepCutProps | BRepThickenProps | BRepHollowProps | BRepRoundProps;
parameters?: BRepCutProps | BRepThickenProps | BRepHollowProps | BRepRoundProps | BRepOffsetProps;
separateDisjoint?: boolean;
}

Expand All @@ -622,6 +622,7 @@ export enum BRepGeometryOperation {
Hollow = 7,
Intersect = 2,
Loft = 9,
Offset = 11,
Round = 10,
Sew = 3,
Subtract = 1,
Expand All @@ -635,6 +636,11 @@ export interface BRepHollowProps {
distance: number;
}

// @alpha
export interface BRepOffsetProps {
distance: number;
}

// @public
export interface BRepPrimitive {
// @beta (undocumented)
Expand Down
118 changes: 92 additions & 26 deletions common/api/presentation-common.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ export interface CategoryDescriptionJSON {
renderer?: RendererDescription;
}

// @public
export type CategoryIdentifier = ParentCategoryIdentifier | RootCategoryIdentifier | IdCategoryIdentifier;

// @public
export interface CheckBoxRule extends RuleBase, ConditionContainer {
condition?: string;
Expand Down Expand Up @@ -218,6 +221,23 @@ export interface CommonIpcParams {
clientId: string;
}

// @public
export interface CompressedClassInfoJSON {
// (undocumented)
label: string;
// (undocumented)
name: string;
}

// @public
export type CompressedDescriptorJSON = Omit<DescriptorJSON, "selectClasses" | "fields"> & {
selectClasses: SelectClassInfoJSON<string>[];
classesMap: {
[id: string]: CompressedClassInfoJSON;
};
fields: FieldJSON<string>[];
};

// @public
export type ComputeDisplayValueCallback = (type: string, value: PrimitivePropertyValue, displayValue: string) => Promise<string>;

Expand Down Expand Up @@ -478,7 +498,7 @@ export class Descriptor implements DescriptorSource {
readonly displayType: string;
readonly fields: Field[];
filterExpression?: string;
static fromJSON(json: DescriptorJSON | string | undefined): Descriptor | undefined;
static fromJSON(json: DescriptorJSON | CompressedDescriptorJSON | string | undefined): Descriptor | undefined;
getFieldByName(name: string, recurse?: boolean): Field | undefined;
readonly inputKeysHash: string;
// @internal
Expand All @@ -487,6 +507,7 @@ export class Descriptor implements DescriptorSource {
readonly selectionInfo?: SelectionInfo;
sortDirection?: SortDirection;
sortingField?: Field;
toCompressedJSON(): CompressedDescriptorJSON;
toJSON(): DescriptorJSON;
}

Expand Down Expand Up @@ -883,6 +904,9 @@ export class Field {
// (undocumented)
clone(): Field;
editor?: EditorDescription;
static fromCompressedJSON(json: FieldJSON<string>, classesMap: {
[id: string]: CompressedClassInfoJSON;
}): FieldJSON | undefined;
static fromJSON(json: FieldJSON | undefined, categories: CategoryDescription[]): Field | undefined;
// @deprecated
static fromJSON(json: FieldJSON | string | undefined): Field | undefined;
Expand All @@ -903,6 +927,9 @@ export class Field {
resetParentship(): void;
// @internal @deprecated
static reviver(key: string, value: any): any;
toCompressedJSON(classesMap: {
[id: string]: CompressedClassInfoJSON;
}): FieldJSON<string>;
toJSON(): FieldJSON;
type: TypeDescription;
}
Expand Down Expand Up @@ -942,7 +969,7 @@ export interface FieldHierarchy {
}

// @public
export type FieldJSON = BaseFieldJSON | PropertiesFieldJSON | NestedContentFieldJSON;
export type FieldJSON<TClassInfoJSON = ClassInfoJSON> = BaseFieldJSON | PropertiesFieldJSON<TClassInfoJSON> | NestedContentFieldJSON<TClassInfoJSON>;

// @internal (undocumented)
export const getFieldByName: (fields: Field[], name: string, recurse?: boolean | undefined) => Field | undefined;
Expand Down Expand Up @@ -1142,6 +1169,12 @@ export interface Id64sRulesetVariableJSON extends RulesetVariableBaseJSON {
value: Id64String[] | CompressedId64Set;
}

// @public
export interface IdCategoryIdentifier {
categoryId: string;
type: "Id";
}

// @public
export interface ImageIdOverride extends RuleBase, ConditionContainer {
condition?: string;
Expand Down Expand Up @@ -1590,17 +1623,17 @@ export class NestedContentField extends Field {
}

// @public
export interface NestedContentFieldJSON extends BaseFieldJSON {
export interface NestedContentFieldJSON<TClassInfoJSON = ClassInfoJSON> extends BaseFieldJSON {
// @alpha (undocumented)
actualPrimaryClassIds?: Id64String[];
// (undocumented)
autoExpand?: boolean;
// (undocumented)
contentClassInfo: ClassInfoJSON;
contentClassInfo: TClassInfoJSON;
// (undocumented)
nestedFields: FieldJSON[];
nestedFields: FieldJSON<TClassInfoJSON>[];
// (undocumented)
pathToPrimaryClass: RelationshipPathJSON;
pathToPrimaryClass: RelationshipPathJSON<TClassInfoJSON>;
// @alpha (undocumented)
relationshipMeaning?: RelationshipMeaning;
}
Expand Down Expand Up @@ -1631,6 +1664,11 @@ export interface NestedContentValueJSON {
values: ValuesDictionary<ValueJSON>;
}

// @public
export interface NoCategoryIdentifier {
type: "None";
}

// @public
export interface Node {
backColor?: string;
Expand Down Expand Up @@ -1867,6 +1905,11 @@ export interface PageOptions {
start?: number;
}

// @public
export interface ParentCategoryIdentifier {
type: "DefaultParent";
}

// @public
export type PartialHierarchyModification = NodeInsertionInfo | NodeDeletionInfo | NodeUpdateInfo;

Expand Down Expand Up @@ -2093,9 +2136,9 @@ export interface PropertiesFieldDescriptor extends FieldDescriptorBase {
}

// @public
export interface PropertiesFieldJSON extends BaseFieldJSON {
export interface PropertiesFieldJSON<TClassInfoJSON = ClassInfoJSON> extends BaseFieldJSON {
// (undocumented)
properties: PropertyJSON[];
properties: PropertyJSON<TClassInfoJSON>[];
}

// @public
Expand All @@ -2108,6 +2151,9 @@ export interface Property {
// @public (undocumented)
export namespace Property {
export function fromJSON(json: PropertyJSON): Property;
export function toCompressedJSON(prop: Property, classesMap: {
[id: string]: CompressedClassInfoJSON;
}): PropertyJSON<string>;
export function toJSON(prop: Property): PropertyJSON;
}

Expand All @@ -2126,7 +2172,7 @@ export interface PropertyCategorySpecification {
description?: string;
id: string;
label: string;
parentId?: string;
parentId?: string | CategoryIdentifier | NoCategoryIdentifier;
priority?: number;
renderer?: CustomRendererSpecification;
}
Expand Down Expand Up @@ -2217,13 +2263,16 @@ export interface PropertyInfo {
// @public (undocumented)
export namespace PropertyInfo {
export function fromJSON(json: PropertyInfoJSON): PropertyInfo;
export function toCompressedJSON(propertyInfo: PropertyInfo, classesMap: {
[id: string]: CompressedClassInfoJSON;
}): PropertyInfoJSON<string>;
export function toJSON(info: PropertyInfo): PropertyInfoJSON;
}

// @public
export interface PropertyInfoJSON {
export interface PropertyInfoJSON<TClassInfoJSON = ClassInfoJSON> {
// (undocumented)
classInfo: ClassInfoJSON;
classInfo: TClassInfoJSON;
// (undocumented)
enumerationInfo?: EnumerationInfo;
// (undocumented)
Expand All @@ -2235,16 +2284,16 @@ export interface PropertyInfoJSON {
}

// @public
export interface PropertyJSON {
export interface PropertyJSON<TClassInfoJSON = ClassInfoJSON> {
// (undocumented)
property: PropertyInfoJSON;
property: PropertyInfoJSON<TClassInfoJSON>;
// @deprecated (undocumented)
relatedClassPath: RelationshipPathJSON;
relatedClassPath: RelationshipPathJSON<TClassInfoJSON>;
}

// @public
export interface PropertyOverrides {
categoryId?: string;
categoryId?: string | CategoryIdentifier;
doNotHideOtherPropertiesOnDisplayOverride?: boolean;
editor?: PropertyEditorSpecification;
isDisplayed?: boolean;
Expand Down Expand Up @@ -2333,25 +2382,31 @@ export interface RelatedClassInfo {
// @public (undocumented)
export namespace RelatedClassInfo {
export function equals(lhs: RelatedClassInfo | StrippedRelatedClassInfo, rhs: RelatedClassInfo | StrippedRelatedClassInfo): boolean;
export function fromCompressedJSON(compressedInfoJSON: RelatedClassInfoJSON<string>, classesMap: {
[id: string]: CompressedClassInfoJSON;
}): RelatedClassInfoJSON;
export function fromJSON(json: RelatedClassInfoJSON): RelatedClassInfo;
export function strip(full: RelatedClassInfo): StrippedRelatedClassInfo;
export function toCompressedJSON(classInfo: RelatedClassInfo, classesMap: {
[id: string]: CompressedClassInfoJSON;
}): RelatedClassInfoJSON<string>;
export function toJSON(info: RelatedClassInfo): RelatedClassInfoJSON;
}

// @public
export interface RelatedClassInfoJSON {
export interface RelatedClassInfoJSON<TClassInfoJSON = ClassInfoJSON> {
// (undocumented)
isForwardRelationship: boolean;
// (undocumented)
isPolymorphicRelationship?: boolean;
// (undocumented)
isPolymorphicTargetClass?: boolean;
// (undocumented)
relationshipInfo: ClassInfoJSON;
relationshipInfo: TClassInfoJSON;
// (undocumented)
sourceClassInfo: ClassInfoJSON;
sourceClassInfo: TClassInfoJSON;
// (undocumented)
targetClassInfo: ClassInfoJSON;
targetClassInfo: TClassInfoJSON;
}

// @public
Expand Down Expand Up @@ -2419,7 +2474,7 @@ export namespace RelationshipPath {
}

// @public
export type RelationshipPathJSON = RelatedClassInfoJSON[];
export type RelationshipPathJSON<TClassInfoJSON = ClassInfoJSON> = RelatedClassInfoJSON<TClassInfoJSON>[];

// @public
export type RelationshipPathSpecification = RelationshipStepSpecification | RelationshipStepSpecification[];
Expand Down Expand Up @@ -2475,6 +2530,11 @@ export interface RequiredSchemaSpecification {
name: string;
}

// @public
export interface RootCategoryIdentifier {
type: "Root";
}

// @public
export interface RootNodeRule extends NavigationRuleBase {
autoExpand?: boolean;
Expand Down Expand Up @@ -2660,23 +2720,29 @@ export interface SelectClassInfo {

// @public (undocumented)
export namespace SelectClassInfo {
export function fromCompressedJSON(compressedSelectClass: SelectClassInfoJSON<string>, classesMap: {
[id: string]: CompressedClassInfoJSON;
}): SelectClassInfoJSON;
export function fromJSON(json: SelectClassInfoJSON): SelectClassInfo;
export function toCompressedJSON(selectClass: SelectClassInfo, classesMap: {
[id: string]: CompressedClassInfoJSON;
}): SelectClassInfoJSON<string>;
}

// @public
export interface SelectClassInfoJSON {
export interface SelectClassInfoJSON<TClassInfoJSON = ClassInfoJSON> {
// (undocumented)
isSelectPolymorphic: boolean;
// (undocumented)
navigationPropertyClasses: RelatedClassInfoJSON[];
navigationPropertyClasses: RelatedClassInfoJSON<TClassInfoJSON>[];
// (undocumented)
pathToPrimaryClass: RelationshipPathJSON;
pathToPrimaryClass: RelationshipPathJSON<TClassInfoJSON>;
// (undocumented)
relatedInstanceClasses: RelatedClassInfoJSON[];
relatedInstanceClasses: RelatedClassInfoJSON<TClassInfoJSON>[];
// (undocumented)
relatedPropertyPaths: RelationshipPathJSON[];
relatedPropertyPaths: RelationshipPathJSON<TClassInfoJSON>[];
// (undocumented)
selectClassInfo: ClassInfoJSON;
selectClassInfo: TClassInfoJSON;
}

// @public
Expand Down
1 change: 1 addition & 0 deletions common/api/summary/imodeljs-common.exports.csv
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ alpha;BRepGeometryFunction = (info: BRepGeometryInfo) => void
alpha;BRepGeometryInfo
alpha;BRepGeometryOperation
alpha;BRepHollowProps
alpha;BRepOffsetProps
public;BRepPrimitive
alpha;BRepRoundProps
alpha;BRepThickenProps
Expand Down
Loading

0 comments on commit f419a96

Please sign in to comment.