conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
import { Locations, PlayTypes } from '../Constants';
=======
import { Locations, Stages } from '../Constants';
>>>>>>>
import { Locations, PlayTypes, Stages } from '../Constants';
<<<<<<<
playType?: PlayTypes;
=======
playCardTarget?: (context: AbilityContext, properties: PlayCardProperties) => void;
location?: Locations;
>>>>>>>
playType?: PlayTypes;
playCardTarget?: (context: AbilityContext, properties: PlayCardProperties) => void;
location?: Locations; |
<<<<<<<
vscode.commands.registerCommand(
"webTemplateStudioExtension.wizardLaunch.local",
async () => {
//TODO: Modify this to support React Native
Controller.getInstance(context, PLATFORM.WEB);
}
),
vscode.commands.registerCommand(
"webTemplateStudioExtension.deployApp.local",
async () => {
await Deploy.getInstance(context).deployProject();
}
)
=======
vscode.commands.registerCommand("webTemplateStudioExtension.wizardLaunch.local", async () => {
Controller.getInstance(context, Platform.Web);
}),
vscode.commands.registerCommand("webTemplateStudioExtension.deployApp.local", async () => {
await Deploy.getInstance(context).deployProject();
})
>>>>>>>
vscode.commands.registerCommand("webTemplateStudioExtension.wizardLaunch.local", async () => {
//TODO: Modify this to support React Native
Controller.getInstance(context, PLATFORM.WEB);
}),
vscode.commands.registerCommand("webTemplateStudioExtension.deployApp.local", async () => {
await Deploy.getInstance(context).deployProject();
}) |
<<<<<<<
WEB_PROJECT_TYPE,
RN_PROJECT_TYPE,
ROUTE,
REQUIREMENTS_DATA
=======
REQUIREMENTS_DATA,
>>>>>>>
WEB_PROJECT_TYPE,
RN_PROJECT_TYPE,
ROUTE,
REQUIREMENTS_DATA, |
<<<<<<<
const pages = [
{
templateId: "wts.Page.React.Blank",
name: "Blank",
defaultName: "Blank",
description: "A blank page for you to build your web application from scratch.",
richDescription:
"This is the most basic page. A blank canvas to mold into whatever you wish. The blank page leaves pretty much everything up to you.",
author: "Microsoft",
version: "1.0.0",
icon: "",
displayOrder: 0,
isHidden: false,
isGroupExclusiveSelection: false,
genGroup: 0,
multipleInstance: true,
itemNameEditable: true,
licenses: [
{
text: "Bootstrap",
url: "https://github.com/twbs/bootstrap/blob/master/LICENSE",
},
],
dependencies: [],
templateType: "Page",
rightClickEnabled: true,
requiredVisualStudioWorkloads: [],
},
{
templateId: "wts.Page.React.Grid",
name: "Grid",
defaultName: "Grid",
description: "Simple image and text components which are organized into a grid.",
richDescription:
"A page displaying simple image and text components which are organized into a grid. Grid pages are a system for creating order among elements in a website.",
author: "Microsoft",
version: "1.0.0",
icon: "",
displayOrder: 1,
isHidden: false,
isGroupExclusiveSelection: false,
genGroup: 0,
multipleInstance: false,
itemNameEditable: false,
licenses: [
{
text: "Bootstrap",
url: "https://github.com/twbs/bootstrap/blob/master/LICENSE",
},
],
dependencies: [],
templateType: "Page",
rightClickEnabled: true,
requiredVisualStudioWorkloads: [],
},
{
templateId: "wts.Page.React.List",
name: "List",
defaultName: "List",
description: "Add and remove text from an adaptive list.",
richDescription:
"The list page allows you to add custom text in the form of an adaptive list. This pattern is frequently used for blog pages and messaging apps. If a database is selected from the Azure Cloud Services the list page will automatically connect to the deployed Azure database.",
author: "Microsoft",
version: "1.0.0",
icon: "",
displayOrder: 1,
isHidden: false,
isGroupExclusiveSelection: false,
genGroup: 0,
multipleInstance: true,
itemNameEditable: true,
licenses: [
{
text: "Bootstrap",
url: "https://github.com/twbs/bootstrap/blob/master/LICENSE",
},
],
dependencies: [],
templateType: "Page",
rightClickEnabled: true,
requiredVisualStudioWorkloads: [],
},
{
templateId: "wts.Page.React.MasterDetail",
name: "Master Detail",
defaultName: "Master Detail",
description: "A master pane and a details pane for content.",
richDescription:
"The master-detail page has a master pane and a details pane for content. When an item in the master list is selected, the details pane is updated. This pattern is frequently used for email and address books.",
author: "Microsoft",
version: "1.0.0",
icon: "",
displayOrder: 1,
isHidden: false,
isGroupExclusiveSelection: false,
genGroup: 0,
multipleInstance: true,
itemNameEditable: true,
licenses: [
{
text: "Bootstrap",
url: "https://github.com/twbs/bootstrap/blob/master/LICENSE",
},
],
dependencies: [],
templateType: "Page",
rightClickEnabled: true,
requiredVisualStudioWorkloads: [],
},
];
=======
const pages = (frontendFramework: string) => {
return [
{
templateId: `wts.Page.${frontendFramework}.Blank`,
name: "Blank",
defaultName: "Blank",
description: "A blank page for you to build your web application from scratch.",
richDescription:
"This is the most basic page. A blank canvas to mold into whatever you wish. The blank page leaves pretty much everything up to you.",
author: "Microsoft",
version: "1.0.0",
icon: "",
displayOrder: 0,
isHidden: false,
isGroupExclusiveSelection: false,
genGroup: 0,
multipleInstance: true,
itemNameEditable: true,
licenses: [
{
text: "Bootstrap",
url: "https://github.com/twbs/bootstrap/blob/master/LICENSE",
},
],
dependencies: [],
templateType: "Page",
rightClickEnabled: true,
requiredVisualStudioWorkloads: [],
},
{
templateId: `wts.Page.${frontendFramework}.Grid`,
name: "Grid",
defaultName: "Grid",
description: "Simple image and text components which are organized into a grid.",
richDescription:
"A page displaying simple image and text components which are organized into a grid. Grid pages are a system for creating order among elements in a website.",
author: "Microsoft",
version: "1.0.0",
icon: "",
displayOrder: 1,
isHidden: false,
isGroupExclusiveSelection: false,
genGroup: 0,
multipleInstance: true,
itemNameEditable: true,
licenses: [
{
text: "Bootstrap",
url: "https://github.com/twbs/bootstrap/blob/master/LICENSE",
},
],
dependencies: [],
templateType: "Page",
rightClickEnabled: true,
requiredVisualStudioWorkloads: [],
},
{
templateId: `wts.Page.${frontendFramework}.List`,
name: "List",
defaultName: "List",
description: "Add and remove text from an adaptive list.",
richDescription:
"The list page allows you to add custom text in the form of an adaptive list. This pattern is frequently used for blog pages and messaging apps. If a database is selected from the Azure Cloud Services the list page will automatically connect to the deployed Azure database.",
author: "Microsoft",
version: "1.0.0",
icon: "",
displayOrder: 1,
isHidden: false,
isGroupExclusiveSelection: false,
genGroup: 0,
multipleInstance: true,
itemNameEditable: true,
licenses: [
{
text: "Bootstrap",
url: "https://github.com/twbs/bootstrap/blob/master/LICENSE",
},
],
dependencies: [],
templateType: "Page",
rightClickEnabled: true,
requiredVisualStudioWorkloads: [],
},
{
templateId: `wts.Page.${frontendFramework}.MasterDetail`,
name: "Master Detail",
defaultName: "Master Detail",
description: "A master pane and a details pane for content.",
richDescription:
"The master-detail page has a master pane and a details pane for content. When an item in the master list is selected, the details pane is updated. This pattern is frequently used for email and address books.",
author: "Microsoft",
version: "1.0.0",
icon: "",
displayOrder: 1,
isHidden: false,
isGroupExclusiveSelection: false,
genGroup: 0,
multipleInstance: true,
itemNameEditable: true,
licenses: [
{
text: "Bootstrap",
url: "https://github.com/twbs/bootstrap/blob/master/LICENSE",
},
],
dependencies: [],
templateType: "Page",
rightClickEnabled: true,
requiredVisualStudioWorkloads: [],
},
];
};
>>>>>>>
const pages = (frontendFramework: string) => {
return [
{
templateId: `wts.Page.${frontendFramework}.Blank`,
name: "Blank",
defaultName: "Blank",
description: "A blank page for you to build your web application from scratch.",
richDescription:
"This is the most basic page. A blank canvas to mold into whatever you wish. The blank page leaves pretty much everything up to you.",
author: "Microsoft",
version: "1.0.0",
icon: "",
displayOrder: 0,
isHidden: false,
isGroupExclusiveSelection: false,
genGroup: 0,
multipleInstance: true,
itemNameEditable: true,
licenses: [
{
text: "Bootstrap",
url: "https://github.com/twbs/bootstrap/blob/master/LICENSE",
},
],
dependencies: [],
templateType: "Page",
rightClickEnabled: true,
requiredVisualStudioWorkloads: [],
},
{
templateId: `wts.Page.${frontendFramework}.Grid`,
name: "Grid",
defaultName: "Grid",
description: "Simple image and text components which are organized into a grid.",
richDescription:
"A page displaying simple image and text components which are organized into a grid. Grid pages are a system for creating order among elements in a website.",
author: "Microsoft",
version: "1.0.0",
icon: "",
displayOrder: 1,
isHidden: false,
isGroupExclusiveSelection: false,
genGroup: 0,
multipleInstance: false,
itemNameEditable: false,
licenses: [
{
text: "Bootstrap",
url: "https://github.com/twbs/bootstrap/blob/master/LICENSE",
},
],
dependencies: [],
templateType: "Page",
rightClickEnabled: true,
requiredVisualStudioWorkloads: [],
},
{
templateId: `wts.Page.${frontendFramework}.List`,
name: "List",
defaultName: "List",
description: "Add and remove text from an adaptive list.",
richDescription:
"The list page allows you to add custom text in the form of an adaptive list. This pattern is frequently used for blog pages and messaging apps. If a database is selected from the Azure Cloud Services the list page will automatically connect to the deployed Azure database.",
author: "Microsoft",
version: "1.0.0",
icon: "",
displayOrder: 1,
isHidden: false,
isGroupExclusiveSelection: false,
genGroup: 0,
multipleInstance: true,
itemNameEditable: true,
licenses: [
{
text: "Bootstrap",
url: "https://github.com/twbs/bootstrap/blob/master/LICENSE",
},
],
dependencies: [],
templateType: "Page",
rightClickEnabled: true,
requiredVisualStudioWorkloads: [],
},
{
templateId: `wts.Page.${frontendFramework}.MasterDetail`,
name: "Master Detail",
defaultName: "Master Detail",
description: "A master pane and a details pane for content.",
richDescription:
"The master-detail page has a master pane and a details pane for content. When an item in the master list is selected, the details pane is updated. This pattern is frequently used for email and address books.",
author: "Microsoft",
version: "1.0.0",
icon: "",
displayOrder: 1,
isHidden: false,
isGroupExclusiveSelection: false,
genGroup: 0,
multipleInstance: true,
itemNameEditable: true,
licenses: [
{
text: "Bootstrap",
url: "https://github.com/twbs/bootstrap/blob/master/LICENSE",
},
],
dependencies: [],
templateType: "Page",
rightClickEnabled: true,
requiredVisualStudioWorkloads: [],
},
];
}; |
<<<<<<<
import dependencyInfo from "./dependencyInfo";
=======
import generationStatus from "./generationStatus/combineReducers";
>>>>>>>
<<<<<<<
versions,
dependencyInfo
=======
generationStatus,
versions
>>>>>>>
versions
<<<<<<<
dependencyInfo: undefined,
=======
generationStatus: undefined,
>>>>>>> |
<<<<<<<
const methodName = "_onRequestWithOptions";
=======
let onRequestInnerMethodName = "_onRequestWithOpts";
if (compareVersionStrings(firebaseFunctionsResolution.version, "3.1.0") >= 0) {
onRequestInnerMethodName = "_onRequestWithOptions";
}
const onRequestMethodOriginal = httpsProvider[onRequestInnerMethodName];
>>>>>>>
const onRequestInnerMethodName = "_onRequestWithOptions";
const onRequestMethodOriginal = httpsProvider[onRequestInnerMethodName];
<<<<<<<
// If you take a look at the link above, you'll see that onRequest relies on _onRequestWithOptions
// so in theory, we should only need to mock _onRequestWithOptions, however that is not the case
// because onRequest is defined in the same scope as _onRequestWithOptions, so replacing
// the definition of _onRequestWithOptions does not replace the link to the original function
// which onRequest uses, so we need to manually force it to use our error-handle-able version.
httpsProvider.onRequest = (handler: (req: Request, resp: Response) => void) => {
return httpsProvider[methodName](handler, {});
=======
// If you take a look at the link above, you'll see that onRequest relies on _onRequestWithOptions
// so in theory, we should only need to mock _onRequestWithOptions, however that is not the case
// because onRequest is defined in the same scope as _onRequestWithOptions, so replacing
// the definition of _onRequestWithOptions does not replace the link to the original function
// which onRequest uses, so we need to manually force it to use our version.
httpsProvider.onRequest = (handler: HttpsHandler) => {
return httpsProvider[onRequestInnerMethodName](handler, {});
>>>>>>>
// If you take a look at the link above, you'll see that onRequest relies on _onRequestWithOptions
// so in theory, we should only need to mock _onRequestWithOptions, however that is not the case
// because onRequest is defined in the same scope as _onRequestWithOptions, so replacing
// the definition of _onRequestWithOptions does not replace the link to the original function
// which onRequest uses, so we need to manually force it to use our version.
httpsProvider.onRequest = (handler: HttpsHandler) => {
return httpsProvider[onRequestInnerMethodName](handler, {});
<<<<<<<
=======
/**
* Wrap a callable functions handler with an outer method that extracts a special authorization
* header used to mock auth in the emulator.
*/
function wrapCallableHandler(handler: CallableHandler): CallableHandler {
const newHandler = (data: any, context: https.CallableContext) => {
if (context.rawRequest) {
const authContext = context.rawRequest.header(HttpConstants.CALLABLE_AUTH_HEADER);
if (authContext) {
logDebug("Callable functions auth override", {
key: HttpConstants.CALLABLE_AUTH_HEADER,
value: authContext,
});
context.auth = JSON.parse(authContext);
} else {
logDebug("No callable functions auth found");
}
}
return handler(data, context);
};
return newHandler;
}
/*
@google-cloud/[email protected] made a breaking change which swapped relying on "grpc" to "@grpc/grpc-js"
which has a slightly different signature. We need to detect the firestore version to know which version
of grpc to pass as a credential.
*/
async function getGRPCInsecureCredential(frb: FunctionsRuntimeBundle): Promise<any> {
const firestorePackageJSON = require(path.join(
findModuleRoot(
"@google-cloud/firestore",
require.resolve("@google-cloud/firestore", { paths: [frb.cwd] })
),
"package.json"
));
if (firestorePackageJSON.version.startsWith("1")) {
const grpc = await requireAsync("grpc", { paths: [frb.cwd] }).catch(noOp);
new EmulatorLog("SYSTEM", "runtime-status", "using grpc-native for admin credential").log();
return grpc.credentials.createInsecure();
} else {
const grpc = await requireAsync("@grpc/grpc-js", { paths: [frb.cwd] }).catch(noOp);
new EmulatorLog("SYSTEM", "runtime-status", "using grpc-js for admin credential").log();
return grpc.ChannelCredentials.createInsecure();
}
}
>>>>>>>
/**
* Wrap a callable functions handler with an outer method that extracts a special authorization
* header used to mock auth in the emulator.
*/
function wrapCallableHandler(handler: CallableHandler): CallableHandler {
const newHandler = (data: any, context: https.CallableContext) => {
if (context.rawRequest) {
const authContext = context.rawRequest.header(HttpConstants.CALLABLE_AUTH_HEADER);
if (authContext) {
logDebug("Callable functions auth override", {
key: HttpConstants.CALLABLE_AUTH_HEADER,
value: authContext,
});
context.auth = JSON.parse(authContext);
} else {
logDebug("No callable functions auth found");
}
}
return handler(data, context);
};
return newHandler;
} |
<<<<<<<
spec: modsApi.ModSpec,
newSpec: modsApi.ModSpec,
currentParams: { [option: string]: string },
projectId: string
=======
spec: extensionsApi.ExtensionSpec,
newSpec: extensionsApi.ExtensionSpec,
currentParams: { [option: string]: string }
>>>>>>>
spec: extensionsApi.ExtensionSpec,
newSpec: extensionsApi.ExtensionSpec,
currentParams: { [option: string]: string },
projectId: string |
<<<<<<<
import { ordString } from '../src/Ord'
=======
import { semigroupString } from '../src/Semigroup'
>>>>>>>
import { ordString } from '../src/Ord'
import { semigroupString } from '../src/Semigroup' |
<<<<<<<
*
* @example
* cy.getFieldValue('Description').then(fieldValue => {
=======
*
* @example
* cy.getStringFieldValue('Description').then(fieldValue => {
>>>>>>>
*
* @example
* cy.getStringFieldValue('Description').then(fieldValue => {
<<<<<<<
isChecked(fieldName: string, modal?: boolean): Chainable<any>
=======
getCheckboxValue(fieldName: string, modal: boolean): Chainable<any>
>>>>>>>
getCheckboxValue(fieldName: string, modal?: boolean): Chainable<any> |
<<<<<<<
import { SCHEMA_OPTIONS_SYMBOL, SchemaOptions, ValidatorError } from './morphism';
=======
import { SCHEMA_OPTIONS_SYMBOL, SchemaOptions } from "./morphism";
>>>>>>>
import { SCHEMA_OPTIONS_SYMBOL, SchemaOptions, ValidatorError } from './morphism';
<<<<<<<
export interface ActionSelector<Source = object, Target = any> {
path?: ActionString<Source> | ActionAggregator<Source>;
fn?: (fieldValue: any, object: Source, items: Source, objectToCompute: Target) => Target;
validation?: ValidateFunction;
=======
export interface ActionSelector<
Source = object,
Target = any,
TargetProperty extends keyof Target = any
> {
path: ActionString<Source> | ActionAggregator<Source>;
fn: (
fieldValue: any,
object: Source,
items: Source,
objectToCompute: Target
) => Target[TargetProperty];
>>>>>>>
export interface ActionSelector<Source = object, Target = any, TargetProperty extends keyof Target = any> {
path?: ActionString<Source> | ActionAggregator<Source>;
fn?: (fieldValue: any, object: Source, items: Source, objectToCompute: Target) => Target[TargetProperty];
validation?: ValidateFunction;
<<<<<<<
/**
* Function to map an Input source towards a Target. Input can be a single object, or a collection of objects
* @function
* @typeparam TSchema Schema
* @typeparam TResult Result Type
*/
export interface Mapper<TSchema extends Schema | StrictSchema, TResult = ResultItem<TSchema>> {
(data?: SourceFromSchema<TSchema>[] | null): TResult[];
(data?: SourceFromSchema<TSchema> | null): TResult;
=======
export interface Mapper<
TSchema extends Schema | StrictSchema,
TResult = ResultItem<TSchema>
> {
(data?: SourceFromSchema<TSchema>[] | null): TResult[];
(data?: SourceFromSchema<TSchema> | null): TResult;
>>>>>>>
/**
* Function to map an Input source towards a Target. Input can be a single object, or a collection of objects
* @function
* @typeparam TSchema Schema
* @typeparam TResult Result Type
*/
export interface Mapper<TSchema extends Schema | StrictSchema, TResult = ResultItem<TSchema>> {
(data?: SourceFromSchema<TSchema>[] | null): TResult[];
(data?: SourceFromSchema<TSchema> | null): TResult; |
<<<<<<<
import { setCharacter } from './actions/save'
import { ButtonState } from './GamepadManager'
=======
import { testEmulator } from '../models/Emulator.mock'
>>>>>>>
import { setCharacter } from './actions/save'
import { ButtonState } from './GamepadManager'
import { testEmulator } from '../models/Emulator.mock' |
<<<<<<<
[stratName: string]: any; // Is this how to do it???????
}
export interface googOptions {
client_id:string; /*we do not supply this-----R*/
redirect_uri:string; /*we do not supply this-----R*/
response_type:string; /*we do not supply this-----R*/
scope:string; /*we do not supply this------R*/
client_secret:string;
access_type?:string; /*we do not supply this ------Reccommend*/
state?:string; /*we do not supply this------Reccomend*/
included_granted_scopes?:string; /*we do not supply this**********OPTIONAL*/
login_hint?:string; /*we do not supply this**********OPTIONAL*/
prompt?:string; /*we do not supply this**********OPTIONAL*/
grant_type?:string;
=======
[stratName: string]: any; // Is this how to do it?? What's the correct type for classes?
>>>>>>>
[stratName: string]: any; // Is this how to do it?? What's the correct type for classes?
}
export interface googOptions {
client_id:string; /*we do not supply this-----R*/
redirect_uri:string; /*we do not supply this-----R*/
response_type:string; /*we do not supply this-----R*/
scope:string; /*we do not supply this------R*/
client_secret:string;
access_type?:string; /*we do not supply this ------Reccommend*/
state?:string; /*we do not supply this------Reccomend*/
included_granted_scopes?:string; /*we do not supply this**********OPTIONAL*/
login_hint?:string; /*we do not supply this**********OPTIONAL*/
prompt?:string; /*we do not supply this**********OPTIONAL*/
grant_type?:string; |
<<<<<<<
assertNotEquals,
assertThrows,
assertThrowsAsync,
} from "https://deno.land/[email protected]/testing/asserts.ts";
=======
assertNotEquals
} from "https://deno.land/[email protected]/testing/asserts.ts";
export { Base64 } from "https://deno.land/x/bb64/mod.ts";
>>>>>>>
assertNotEquals,
assertThrows,
assertThrowsAsync,
} from "https://deno.land/[email protected]/testing/asserts.ts";
export { Base64 } from "https://deno.land/x/bb64/mod.ts"; |
<<<<<<<
/**
* import Authenticate from Authenticate.ts
*/
/***** Some person that wants to use Dashport, in their server file, they would
****** do below
import { Dashport } from 'Our URL Here';
const dp = new Dashport('oak');
app.use(dp.initialize())
*/
=======
import SessionManager from './sessionManager.ts';
>>>>>>>
/**
* import Authenticate from Authenticate.ts
*/
/***** Some person that wants to use Dashport, in their server file, they would
****** do below
import { Dashport } from 'Our URL Here';
const dp = new Dashport('oak');
app.use(dp.initialize())
*/
import SessionManager from './sessionManager.ts';
<<<<<<<
* , dashport: Dashport
=======
*
* In OAuth, there is a lot of back and forth communication between the
* client, the app, and the OAuth provider, when a user begins a sign in to
* the OAuth provider. Tokens are sent back and forth and user data gets sent
* back at the end. The middleware function that is returned from the
* 'authenticate' method bundles up this functionality by having multiple
* checks to see what stage of the OAuth cycle the login process is in, and
* executes code accordingly. This allows one method to be used for a seamless
* OAuth process.
*
>>>>>>>
*
* In OAuth, there is a lot of back and forth communication between the
* client, the app, and the OAuth provider, when a user begins a sign in to
* the OAuth provider. Tokens are sent back and forth and user data gets sent
* back at the end. The middleware function that is returned from the
* 'authenticate' method bundles up this functionality by having multiple
* checks to see what stage of the OAuth cycle the login process is in, and
* executes code accordingly. This allows one method to be used for a seamless
* OAuth process.
*
<<<<<<<
// PART OF DEBATING IF NEEDED
// public authCbHandler(uri: string) {
// throw new Error('Name of current framework is not supported');
// }
=======
>>>>>>>
// PART OF DEBATING IF NEEDED
// public authCbHandler(uri: string) {
// throw new Error('Name of current framework is not supported');
// } |
<<<<<<<
locale_strings[1044] = "当前的 runtime 版本不支持视频播放,请使用最新的版本";
locale_strings[1045] = "没有设置要加载的资源地址";
=======
locale_strings[1043] = "{0} 中存在编译错误,属性名 : {1},属性值 : {2}";
locale_strings[1046] = "BitmapText 找不到对应字符:{0},请检查配置文件";
>>>>>>>
locale_strings[1043] = "{0} 中存在编译错误,属性名 : {1},属性值 : {2}";
locale_strings[1044] = "当前的 runtime 版本不支持视频播放,请使用最新的版本";
locale_strings[1045] = "没有设置要加载的资源地址";
locale_strings[1046] = "BitmapText 找不到对应字符:{0},请检查配置文件"; |
<<<<<<<
if (!this["navigator"]) {
return true;
=======
if (!window["navigator"]) {
return true
>>>>>>>
if (!window["navigator"]) {
return true;
<<<<<<<
// egret["testRuntimeType1"] = function () {
// if (this["navigator"]) {
// return true;
// }
// return false;
// };
=======
egret["testRuntimeType1"] = function () {
if (window["navigator"]) {
return true;
}
return false;
};
>>>>>>>
egret["testDeviceType1"] = function () {
if (!window["navigator"]) {
return true;
}
let ua = navigator.userAgent.toLowerCase();
return (ua.indexOf('mobile') != -1 || ua.indexOf('android') != -1);
}; |
<<<<<<<
imageSourceWidth, imageSourceHeight, meshUVs, meshVertices, meshIndices, bounds);
if (image["texture"] || (image.source && image.source["texture"])) {
buffer.restoreTransform();
}
=======
imageSourceWidth, imageSourceHeight, meshUVs, meshVertices, meshIndices, bounds, smoothing);
>>>>>>>
imageSourceWidth, imageSourceHeight, meshUVs, meshVertices, meshIndices, bounds, smoothing);
if (image["texture"] || (image.source && image.source["texture"])) {
buffer.restoreTransform();
} |
<<<<<<<
=======
/// <reference path="../context/MainContext.ts"/>
/// <reference path="../context/Ticker.ts"/>
/// <reference path="Bitmap.ts"/>
/// <reference path="DisplayObjectContainer.ts"/>
/// <reference path="SpriteSheet.ts"/>
/// <reference path="Texture.ts"/>
/// <reference path="../utils/Logger.ts"/>
>>>>>>>
/// <reference path="../context/MainContext.ts"/>
/// <reference path="../context/Ticker.ts"/>
/// <reference path="Bitmap.ts"/>
/// <reference path="DisplayObjectContainer.ts"/>
/// <reference path="SpriteSheet.ts"/>
/// <reference path="Texture.ts"/>
/// <reference path="../utils/Logger.ts"/>
<<<<<<<
/**
* @class egret.MovieClip
* @classdesc MovieClip是位图动画序列类,由FlashPro + egret插件生成配置文件
*/
=======
>>>>>>>
<<<<<<<
/**
* 播放指定动画
* @method egret.MovieClip#gotoAndPlay
* @param frameName {string} 镇定跳转帧的名称
*/
public gotoAndPlay(frameName:string) {
=======
public setMovieClip(movieClip:MovieClip):void {
this.movieClip = movieClip;
this.bitmap = new egret.Bitmap();
this.movieClip.addChild(this.bitmap);
}
public gotoAndPlay(frameName:string):void {
>>>>>>>
public setMovieClip(movieClip:MovieClip):void {
this.movieClip = movieClip;
this.bitmap = new egret.Bitmap();
this.movieClip.addChild(this.bitmap);
}
public gotoAndPlay(frameName:string):void {
<<<<<<<
/**
* 播放并暂停指定动画
* @method egret.MovieClip#gotoAndStop
* @param frameName {string} 镇定跳转帧的名称
*/
public gotoAndStop(frameName:string) {
=======
public gotoAndStop(frameName:string):void {
>>>>>>>
public gotoAndStop(frameName:string):void {
<<<<<<<
/**
* 暂停动画
* @method egret.MovieClip#stop
*/
public stop() {
this._isPlaying = false;
Ticker.getInstance().unregister(this.update, this);
}
=======
private update(advancedTime:number):void {
>>>>>>>
private update(advancedTime:number):void { |
<<<<<<<
var maskBufferWidth = maskBuffer.width;
var maskBufferHeight = maskBuffer.height;
displayBuffer.drawTexture(<WebGLTexture><any>maskBuffer.rootRenderTarget.texture, 0, 0, maskBufferWidth, maskBufferHeight,
=======
maskBuffer.$drawWebGL();
maskBuffer.onRenderFinish();
WebGLUtils.deleteWebGLTexture(maskBuffer.surface);
var maskBufferWidth = maskBuffer.surface.width;
var maskBufferHeight = maskBuffer.surface.height;
displayBuffer.drawImage(<any>maskBuffer.surface, 0, 0, maskBufferWidth, maskBufferHeight,
>>>>>>>
var maskBufferWidth = maskBuffer.width;
var maskBufferHeight = maskBuffer.height;
displayBuffer.drawTexture(<WebGLTexture><any>maskBuffer.rootRenderTarget.texture, 0, 0, maskBufferWidth, maskBufferHeight,
<<<<<<<
buffer.setTransform(1, 0, 0, -1, region.minX + matrix.tx, region.minY + matrix.ty + displayBuffer.height);
var displayBufferWidth = displayBuffer.width;
var displayBufferHeight = displayBuffer.height;
buffer.drawTexture(<WebGLTexture><any>displayBuffer.rootRenderTarget.texture, 0, 0, displayBufferWidth, displayBufferHeight,
=======
buffer.setTransform(1, 0, 0, 1, region.minX + matrix.tx, region.minY + matrix.ty);
displayBuffer.$drawWebGL();
displayBuffer.onRenderFinish();
WebGLUtils.deleteWebGLTexture(displayBuffer.surface);
var displayBufferWidth = displayBuffer.surface.width;
var displayBufferHeight = displayBuffer.surface.height;
buffer.drawImage(<any>displayBuffer.surface, 0, 0, displayBufferWidth, displayBufferHeight,
>>>>>>>
buffer.setTransform(1, 0, 0, -1, region.minX + matrix.tx, region.minY + matrix.ty + displayBuffer.height);
var displayBufferWidth = displayBuffer.width;
var displayBufferHeight = displayBuffer.height;
buffer.drawTexture(<WebGLTexture><any>displayBuffer.rootRenderTarget.texture, 0, 0, displayBufferWidth, displayBufferHeight,
<<<<<<<
=======
displayBuffer.setGlobalCompositeOperation(defaultCompositeOp);
if(scrollRect) {
displayBuffer.popMask();
}
>>>>>>>
<<<<<<<
// matrix restore
webglBuffer.restoreTransform();
//popRenderTARGET
webglBuffer.renderContext.popBuffer();
=======
buffer.onRenderFinish();
>>>>>>>
buffer.onRenderFinish();
// matrix restore
webglBuffer.restoreTransform();
//popRenderTARGET
webglBuffer.renderContext.popBuffer(); |
<<<<<<<
/// <reference path="../core/Geometry.ts"/>
/// <reference path="../core/RenderFilter.ts"/>
=======
>>>>>>>
/// <reference path="../core/RenderFilter.ts"/>
<<<<<<<
draw(renderContext:RendererContext) {
=======
visit(renderContext:RendererContext) {
>>>>>>>
draw(renderContext:RendererContext) {
<<<<<<<
=======
this.preDraw();
this.draw(renderContext);
// renderContext.globalAlpha *= .5;
}
/**
* @private
*/
preDraw() {
}
/**
* @private
* @param renderContext
*/
draw(renderContext:RendererContext) {
>>>>>>>
<<<<<<<
updateTransform() {
=======
updateTransform(renderContext:RendererContext) {
>>>>>>>
updateTransform() { |
<<<<<<<
=======
}
declare namespace egret {
type runEgretOptions = {
renderMode?: string;
audioType?: number;
screenAdapter?: sys.IScreenAdapter;
antialias?: boolean;
canvasScaleFactor?: number;
calculateCanvasScaleFactor?: (context: CanvasRenderingContext2D) => number;
entryClassName?: string;
scaleMode?: string;
frameRate?: number;
contentWidth?: number;
contentHeight?: number;
orientation?: string;
};
>>>>>>> |
<<<<<<<
/**
*
* @example
* <pre>
* //获取动画数据
* var skeletonData = RES.getRes("skeleton");
* //获取纹理集数据
* var textureData = RES.getRes("textureConfig");
* //获取纹理集图片
* var texture = RES.getRes("texture");
*
* //创建一个工厂,用来创建Armature
* var factory:dragonBones.EgretFactory = new dragonBones.EgretFactory();
* //把动画数据添加到工厂里
* factory.addSkeletonData(dragonBones.DataParser.parseDragonBonesData(skeletonData));
* //把纹理集数据和图片添加到工厂里
* factory.addTextureAtlas(new dragonBones.EgretTextureAtlas(texture, textureData));
*
* //获取Armature的名字,dragonBones4.0的数据可以包含多个骨架,这里取第一个Armature
* var armatureName:string = skeletonData.armature[0].name;
* //从工厂里创建出Armature
* var armature:dragonBones.FastArmature = factory.buildFastArmature(armatureName);
* //获取装载Armature的容器
* var armatureDisplay = armature.display;
* //把它添加到舞台上
* this.addChild(armatureDisplay);
*
* //以60fps的帧率开启动画缓存,缓存所有的动画数据
* var animationCachManager:dragonBones.AnimationCacheManager = armature.enableAnimationCache(60);
*
* //取得这个Armature动画列表中的第一个动画的名字
* var curAnimationName = armature.animation.animationList[0];
* //播放这个动画,gotoAndPlay各个参数说明
* //第一个参数 animationName {string} 指定播放动画的名称.
* //第二个参数 fadeInTime {number} 动画淡入时间 (>= 0), 默认值:-1 意味着使用动画数据中的淡入时间.
* //第三个参数 duration {number} 动画播放时间。默认值:-1 意味着使用动画数据中的播放时间.
* //第四个参数 layTimes {number} 动画播放次数(0:循环播放, >=1:播放次数, NaN:使用动画数据中的播放时间), 默认值:NaN
* armature.animation.gotoAndPlay(curAnimationName,0.3,-1,0);
*
* //把Armature添加到心跳时钟里
* dragonBones.WorldClock.clock.add(armature);
* //心跳时钟开启
* egret.Ticker.getInstance().register(function (advancedTime) {
* dragonBones.WorldClock.clock.advanceTime(advancedTime / 1000);
* }, this);
* </pre>
*/
=======
/**
* @class dragonBones.AnimationCache
* @classdesc
* Slot 实例是骨头上的一个插槽,是显示图片的容器。
* 一个 Bone 上可以有多个Slot,每个Slot中同一时间都会有一张图片用于显示,不同的Slot中的图片可以同时显示。
* 每个 Slot 中可以包含多张图片,同一个 Slot 中的不同图片不能同时显示,但是可以在动画进行的过程中切换,用于实现帧动画。
* @extends dragonBones.DBObject
* @see dragonBones.Armature
* @see dragonBones.Bone
* @see dragonBones.SlotData
*/
>>>>>>>
/**
* @class dragonBones.AnimationCache
* @classdesc
* Slot 实例是骨头上的一个插槽,是显示图片的容器。
* 一个 Bone 上可以有多个Slot,每个Slot中同一时间都会有一张图片用于显示,不同的Slot中的图片可以同时显示。
* 每个 Slot 中可以包含多张图片,同一个 Slot 中的不同图片不能同时显示,但是可以在动画进行的过程中切换,用于实现帧动画。
* @extends dragonBones.DBObject
* @see dragonBones.Armature
* @see dragonBones.Bone
* @see dragonBones.SlotData
* @example
* <pre>
* //获取动画数据
* var skeletonData = RES.getRes("skeleton");
* //获取纹理集数据
* var textureData = RES.getRes("textureConfig");
* //获取纹理集图片
* var texture = RES.getRes("texture");
*
* //创建一个工厂,用来创建Armature
* var factory:dragonBones.EgretFactory = new dragonBones.EgretFactory();
* //把动画数据添加到工厂里
* factory.addSkeletonData(dragonBones.DataParser.parseDragonBonesData(skeletonData));
* //把纹理集数据和图片添加到工厂里
* factory.addTextureAtlas(new dragonBones.EgretTextureAtlas(texture, textureData));
*
* //获取Armature的名字,dragonBones4.0的数据可以包含多个骨架,这里取第一个Armature
* var armatureName:string = skeletonData.armature[0].name;
* //从工厂里创建出Armature
* var armature:dragonBones.FastArmature = factory.buildFastArmature(armatureName);
* //获取装载Armature的容器
* var armatureDisplay = armature.display;
* //把它添加到舞台上
* this.addChild(armatureDisplay);
*
* //以60fps的帧率开启动画缓存,缓存所有的动画数据
* var animationCachManager:dragonBones.AnimationCacheManager = armature.enableAnimationCache(60);
*
* //取得这个Armature动画列表中的第一个动画的名字
* var curAnimationName = armature.animation.animationList[0];
* //播放这个动画,gotoAndPlay各个参数说明
* //第一个参数 animationName {string} 指定播放动画的名称.
* //第二个参数 fadeInTime {number} 动画淡入时间 (>= 0), 默认值:-1 意味着使用动画数据中的淡入时间.
* //第三个参数 duration {number} 动画播放时间。默认值:-1 意味着使用动画数据中的播放时间.
* //第四个参数 layTimes {number} 动画播放次数(0:循环播放, >=1:播放次数, NaN:使用动画数据中的播放时间), 默认值:NaN
* armature.animation.gotoAndPlay(curAnimationName,0.3,-1,0);
*
* //把Armature添加到心跳时钟里
* dragonBones.WorldClock.clock.add(armature);
* //心跳时钟开启
* egret.Ticker.getInstance().register(function (advancedTime) {
* dragonBones.WorldClock.clock.advanceTime(advancedTime / 1000);
* }, this);
* </pre>
*/ |
<<<<<<<
{ "v": "5.2.30", command: Upgrade_5_2_30 }
=======
{ "v": "5.2.25", command: Upgrade_5_2_25 }
>>>>>>>
{ "v": "5.2.25", command: Upgrade_5_2_25 }
<<<<<<<
class Upgrade_5_2_30 {
async execute() {
file.copyAsync(path.join(egret.root, "tools", "templates", "empty", "scripts", "wxgame"), path.join(egret.args.projectDir, "scripts", "wxgame"));
file.copyAsync(path.join(egret.root, "tools", "templates", "empty", "scripts", "config.wxgame.ts"), path.join(egret.args.projectDir, "scripts", "config.wxgame.ts"));
file.copyAsync(path.join(egret.root, "tools", "templates", "empty", "api.d.ts"), path.join(egret.args.projectDir, "scripts", "api.d.ts"));
return 0;
}
}
=======
class Upgrade_5_2_25 {
async execute() {
file.copyAsync(path.join(egret.root, "tools", "templates", "empty", "scripts", "qqgame"), path.join(egret.args.projectDir, "scripts", "qqgame"));
file.copyAsync(path.join(egret.root, "tools", "templates", "empty", "scripts", "config.qqgame.ts"), path.join(egret.args.projectDir, "scripts", "config.qqgame.ts"));
return 0;
}
}
>>>>>>>
class Upgrade_5_2_25 {
async execute() {
file.copyAsync(path.join(egret.root, "tools", "templates", "empty", "scripts", "wxgame"), path.join(egret.args.projectDir, "scripts", "wxgame"));
file.copyAsync(path.join(egret.root, "tools", "templates", "empty", "scripts", "config.wxgame.ts"), path.join(egret.args.projectDir, "scripts", "config.wxgame.ts"));
file.copyAsync(path.join(egret.root, "tools", "templates", "empty", "api.d.ts"), path.join(egret.args.projectDir, "scripts", "api.d.ts"));
return 0;
}
} |
<<<<<<<
* 帧事件
*
* @example
* <pre>
* private exampleEvent():void
{
//获取动画数据
var skeletonData = RES.getRes("skeleton");
//获取纹理集数据
var textureData = RES.getRes("textureConfig");
//获取纹理集图片
var texture = RES.getRes("texture");
//创建一个工厂,用来创建Armature
var factory:dragonBones.EgretFactory = new dragonBones.EgretFactory();
//把动画数据添加到工厂里
factory.addSkeletonData(dragonBones.DataParser.parseDragonBonesData(skeletonData));
//把纹理集数据和图片添加到工厂里
factory.addTextureAtlas(new dragonBones.EgretTextureAtlas(texture, textureData));
//获取Armature的名字,dragonBones4.0的数据可以包含多个骨架,这里取第一个Armature
var armatureName:string = skeletonData.armature[0].name;
//从工厂里创建出Armature
var armature:dragonBones.Armature = factory.buildArmature(armatureName);
//获取装载Armature的容器
var armatureDisplay = armature.display;
armatureDisplay.x = 200;
armatureDisplay.y = 400;
//把它添加到舞台上
this.addChild(armatureDisplay);
//监听事件时间轴上的事件
armature.addEventListener(dragonBones.FrameEvent.ANIMATION_FRAME_EVENT, this.onFrameEvent,this);
//监听骨骼时间轴上的事件
armature.addEventListener(dragonBones.FrameEvent.BONE_FRAME_EVENT, this.onFrameEvent,this);
//监听动画完成事件
armature.addEventListener(dragonBones.AnimationEvent.COMPLETE, this.onAnimationEvent,this);
//监听动画开始事件
armature.addEventListener(dragonBones.AnimationEvent.START, this.onAnimationEvent,this);
//监听循环动画,播放完一遍的事件
armature.addEventListener(dragonBones.AnimationEvent.LOOP_COMPLETE, this.onAnimationEvent,this);
//监听声音事件
var soundManager:dragonBones.SoundEventManager = dragonBones.SoundEventManager.getInstance();
soundManager.addEventListener(dragonBones.SoundEvent.SOUND, this.onSoundEvent,this);
//取得这个Armature动画列表中的第一个动画的名字
var curAnimationName = armature.animation.animationList[0];
//播放一遍动画
armature.animation.gotoAndPlay(curAnimationName,0,-1,1);
//把Armature添加到心跳时钟里
dragonBones.WorldClock.clock.add(armature);
//心跳时钟开启
egret.Ticker.getInstance().register(function (advancedTime) {
dragonBones.WorldClock.clock.advanceTime(advancedTime / 1000);
}, this);
}
private onFrameEvent(evt: dragonBones.FrameEvent):void
{
//打印出事件的类型,和事件的帧标签
console.log(evt.type, evt.frameLabel);
}
private onAnimationEvent(evt: dragonBones.AnimationEvent):void
{
switch(evt.type)
{
case dragonBones.AnimationEvent.START:
break;
case dragonBones.AnimationEvent.LOOP_COMPLETE:
break;
case dragonBones.AnimationEvent.COMPLETE:
//动画完成后销毁这个armature
this.removeChild(evt.armature.display);
dragonBones.WorldClock.clock.remove(evt.armature);
evt.armature.dispose();
break;
}
}
private onSoundEvent(evt: dragonBones.SoundEvent):void
{
//播放声音
var flySound:egret.Sound = RES.getRes(evt.sound);
console.log("soundEvent",evt.sound);
}
* </pre>
=======
* 声音事件
>>>>>>>
* 声音事件
*
* @example
* <pre>
* private exampleEvent():void
{
//获取动画数据
var skeletonData = RES.getRes("skeleton");
//获取纹理集数据
var textureData = RES.getRes("textureConfig");
//获取纹理集图片
var texture = RES.getRes("texture");
//创建一个工厂,用来创建Armature
var factory:dragonBones.EgretFactory = new dragonBones.EgretFactory();
//把动画数据添加到工厂里
factory.addSkeletonData(dragonBones.DataParser.parseDragonBonesData(skeletonData));
//把纹理集数据和图片添加到工厂里
factory.addTextureAtlas(new dragonBones.EgretTextureAtlas(texture, textureData));
//获取Armature的名字,dragonBones4.0的数据可以包含多个骨架,这里取第一个Armature
var armatureName:string = skeletonData.armature[0].name;
//从工厂里创建出Armature
var armature:dragonBones.Armature = factory.buildArmature(armatureName);
//获取装载Armature的容器
var armatureDisplay = armature.display;
armatureDisplay.x = 200;
armatureDisplay.y = 400;
//把它添加到舞台上
this.addChild(armatureDisplay);
//监听事件时间轴上的事件
armature.addEventListener(dragonBones.FrameEvent.ANIMATION_FRAME_EVENT, this.onFrameEvent,this);
//监听骨骼时间轴上的事件
armature.addEventListener(dragonBones.FrameEvent.BONE_FRAME_EVENT, this.onFrameEvent,this);
//监听动画完成事件
armature.addEventListener(dragonBones.AnimationEvent.COMPLETE, this.onAnimationEvent,this);
//监听动画开始事件
armature.addEventListener(dragonBones.AnimationEvent.START, this.onAnimationEvent,this);
//监听循环动画,播放完一遍的事件
armature.addEventListener(dragonBones.AnimationEvent.LOOP_COMPLETE, this.onAnimationEvent,this);
//监听声音事件
var soundManager:dragonBones.SoundEventManager = dragonBones.SoundEventManager.getInstance();
soundManager.addEventListener(dragonBones.SoundEvent.SOUND, this.onSoundEvent,this);
//取得这个Armature动画列表中的第一个动画的名字
var curAnimationName = armature.animation.animationList[0];
//播放一遍动画
armature.animation.gotoAndPlay(curAnimationName,0,-1,1);
//把Armature添加到心跳时钟里
dragonBones.WorldClock.clock.add(armature);
//心跳时钟开启
egret.Ticker.getInstance().register(function (advancedTime) {
dragonBones.WorldClock.clock.advanceTime(advancedTime / 1000);
}, this);
}
private onFrameEvent(evt: dragonBones.FrameEvent):void
{
//打印出事件的类型,和事件的帧标签
console.log(evt.type, evt.frameLabel);
}
private onAnimationEvent(evt: dragonBones.AnimationEvent):void
{
switch(evt.type)
{
case dragonBones.AnimationEvent.START:
break;
case dragonBones.AnimationEvent.LOOP_COMPLETE:
break;
case dragonBones.AnimationEvent.COMPLETE:
//动画完成后销毁这个armature
this.removeChild(evt.armature.display);
dragonBones.WorldClock.clock.remove(evt.armature);
evt.armature.dispose();
break;
}
}
private onSoundEvent(evt: dragonBones.SoundEvent):void
{
//播放声音
var flySound:egret.Sound = RES.getRes(evt.sound);
console.log("soundEvent",evt.sound);
}
* </pre> |
<<<<<<<
let displayList = displayObject.$displayList;
if (displayList && !isStage) {
if (displayObject.$cacheDirty || displayObject.$renderDirty) {
=======
let filterPushed: boolean = false;
if (displayList && !root) {
if (displayList.isDirty ||
displayList.$canvasScaleX != sys.DisplayList.$canvasScaleX ||
displayList.$canvasScaleY != sys.DisplayList.$canvasScaleY) {
>>>>>>>
let displayList = displayObject.$displayList;
if (displayList && !isStage) {
if (displayObject.$cacheDirty || displayObject.$renderDirty ||
displayList.$canvasScaleX != sys.DisplayList.$canvasScaleX ||
displayList.$canvasScaleY != sys.DisplayList.$canvasScaleY) {
<<<<<<<
}
displayObject.$cacheDirty = false;
if (node) {
drawCalls++;
buffer.$offsetX = offsetX;
buffer.$offsetY = offsetY;
switch (node.type) {
case sys.RenderNodeType.BitmapNode:
this.renderBitmap(<sys.BitmapNode>node, buffer);
break;
case sys.RenderNodeType.TextNode:
this.renderText(<sys.TextNode>node, buffer);
break;
case sys.RenderNodeType.GraphicsNode:
this.renderGraphics(<sys.GraphicsNode>node, buffer);
break;
case sys.RenderNodeType.GroupNode:
this.renderGroup(<sys.GroupNode>node, buffer);
break;
case sys.RenderNodeType.MeshNode:
this.renderMesh(<sys.MeshNode>node, buffer);
break;
case sys.RenderNodeType.NormalBitmapNode:
this.renderNormalBitmap(<sys.NormalBitmapNode>node, buffer);
break;
=======
if (node.needRedraw) {
drawCalls++;
let renderAlpha: number;
let m: Matrix;
if (root) {
renderAlpha = displayObject.$getConcatenatedAlphaAt(root, displayObject.$getConcatenatedAlpha());
m = Matrix.create().copyFrom(displayObject.$getConcatenatedMatrix());
displayObject.$getConcatenatedMatrixAt(root, m);
}
else {
renderAlpha = node.renderAlpha;
m = Matrix.create().copyFrom(node.renderMatrix);
}
let a = m.a * matrix.a;
let b = 0.0;
let c = 0.0;
let d = m.d * matrix.d;
let tx = m.tx * matrix.a + matrix.tx * matrix.a;
let ty = m.ty * matrix.d + matrix.ty * matrix.d;
if (m.b !== 0.0 || m.c !== 0.0 || matrix.b !== 0.0 || matrix.c !== 0.0) {
a += m.b * matrix.c;
d += m.c * matrix.b;
b += m.a * matrix.b + m.b * matrix.d;
c += m.c * matrix.a + m.d * matrix.c;
tx += m.ty * matrix.c;
ty += m.tx * matrix.b;
}
m.a = a;
m.b = b;
m.c = c;
m.d = d;
m.tx = tx;
m.ty = ty;
buffer.setTransform(m.a, m.b, m.c, m.d, m.tx, m.ty);
Matrix.release(m);
buffer.globalAlpha = renderAlpha;
this.renderNode(node, buffer);
node.needRedraw = false;
>>>>>>>
}
displayObject.$cacheDirty = false;
if (node) {
drawCalls++;
buffer.$offsetX = offsetX;
buffer.$offsetY = offsetY;
switch (node.type) {
case sys.RenderNodeType.BitmapNode:
this.renderBitmap(<sys.BitmapNode>node, buffer);
break;
case sys.RenderNodeType.TextNode:
this.renderText(<sys.TextNode>node, buffer);
break;
case sys.RenderNodeType.GraphicsNode:
this.renderGraphics(<sys.GraphicsNode>node, buffer);
break;
case sys.RenderNodeType.GroupNode:
this.renderGroup(<sys.GroupNode>node, buffer);
break;
case sys.RenderNodeType.MeshNode:
this.renderMesh(<sys.MeshNode>node, buffer);
break;
case sys.RenderNodeType.NormalBitmapNode:
this.renderNormalBitmap(<sys.NormalBitmapNode>node, buffer);
break;
<<<<<<<
let displayBounds = displayObject.$getOriginalBounds();
if (displayBounds.width <= 0 || displayBounds.height <= 0) {
=======
let bounds = displayObject.$getOriginalBounds();
if (bounds.width <= 0 || bounds.height <= 0) {
>>>>>>>
let displayBounds = displayObject.$getOriginalBounds();
if (displayBounds.width <= 0 || displayBounds.height <= 0) {
<<<<<<<
drawCalls += this.drawDisplayObject(displayObject, displayBuffer, -displayBounds.x, -displayBounds.y);
=======
displayBuffer.setTransform(matrix.a, 0, 0, matrix.d, -region.minX, -region.minY);
let offsetM = Matrix.create().setTo(matrix.a, 0, 0, matrix.d, -region.minX, -region.minY);
drawCalls += this.drawDisplayObject(displayObject, displayBuffer, dirtyList, offsetM,
displayObject.$displayList, region, root);
>>>>>>>
drawCalls += this.drawDisplayObject(displayObject, displayBuffer, -displayBounds.x, -displayBounds.y);
<<<<<<<
let maskMatrix = Matrix.create();
maskMatrix.copyFrom(mask.$getConcatenatedMatrix());
mask.$getConcatenatedMatrixAt(displayObject, maskMatrix);
maskBuffer.setTransform(maskMatrix.a, maskMatrix.b, maskMatrix.c, maskMatrix.d, maskMatrix.tx, maskMatrix.ty);
Matrix.release(maskMatrix);
drawCalls += this.drawDisplayObject(mask, maskBuffer, -displayBounds.x, -displayBounds.y);
=======
maskBuffer.setTransform(matrix.a, 0, 0, matrix.d, -region.minX, -region.minY);
offsetM = Matrix.create().setTo(matrix.a, 0, 0, matrix.d, -region.minX, -region.minY);
drawCalls += this.drawDisplayObject(mask, maskBuffer, dirtyList, offsetM,
mask.$displayList, region, root);
>>>>>>>
let maskMatrix = Matrix.create();
maskMatrix.copyFrom(mask.$getConcatenatedMatrix());
mask.$getConcatenatedMatrixAt(displayObject, maskMatrix);
maskBuffer.setTransform(maskMatrix.a, maskMatrix.b, maskMatrix.c, maskMatrix.d, maskMatrix.tx, maskMatrix.ty);
Matrix.release(maskMatrix);
drawCalls += this.drawDisplayObject(mask, maskBuffer, -displayBounds.x, -displayBounds.y);
<<<<<<<
data[pos++], data[pos++], data[pos++], data[pos++], node.imageWidth, node.imageHeight, node.uvs, node.vertices, node.indices, node.bounds, node.smoothing);
=======
data[pos++], data[pos++], data[pos++], data[pos++], node.imageWidth, node.imageHeight, node.uvs, node.vertices, node.indices, node.bounds, node.rotated, node.smoothing);
>>>>>>>
data[pos++], data[pos++], data[pos++], data[pos++], node.imageWidth, node.imageHeight, node.uvs, node.vertices, node.indices, node.bounds, node.rotated, node.smoothing);
<<<<<<<
data[pos++], data[pos++], data[pos++], data[pos++], node.imageWidth, node.imageHeight, node.uvs, node.vertices, node.indices, node.bounds, node.smoothing);
=======
data[pos++], data[pos++], data[pos++], data[pos++], node.imageWidth, node.imageHeight, node.uvs, node.vertices, node.indices, node.bounds, node.rotated, node.smoothing);
>>>>>>>
data[pos++], data[pos++], data[pos++], data[pos++], node.imageWidth, node.imageHeight, node.uvs, node.vertices, node.indices, node.bounds, node.rotated, node.smoothing);
<<<<<<<
if (width <= 0 || height <= 0 || !width || !height || node.drawData.length == 0) {
return;
}
let pixelRatio = sys.DisplayList.$pixelRatio;
=======
let canvasScaleX = sys.DisplayList.$canvasScaleX;
let canvasScaleY = sys.DisplayList.$canvasScaleY;
>>>>>>>
if (width <= 0 || height <= 0 || !width || !height || node.drawData.length == 0) {
return;
}
let canvasScaleX = sys.DisplayList.$canvasScaleX;
let canvasScaleY = sys.DisplayList.$canvasScaleY;
<<<<<<<
=======
if (canvasScaleX != 1 || canvasScaleY != 1) {
this.canvasRenderBuffer.context.setTransform(canvasScaleX, 0, 0, canvasScaleY, 0, 0);
}
>>>>>>> |
<<<<<<<
import {Chain, FakeChain} from '../chain';
=======
import {calculateChannelId} from './state-utils';
>>>>>>>
import {Chain, FakeChain} from '../chain';
import {calculateChannelId} from './state-utils'; |
<<<<<<<
if (display._DO_Privs_._cacheDirty || display._texture_to_render == null ||
bounds.width - display._texture_to_render._textureWidth > 1 ||
bounds.height - display._texture_to_render._textureHeight > 1) {
=======
if (display._cacheDirty || display._texture_to_render == null ||
Math.round(bounds.width) - display._texture_to_render._textureWidth >= 1 ||
Math.round(bounds.height) - display._texture_to_render._textureHeight >= 1) {
>>>>>>>
if (display._DO_Privs_._cacheDirty || display._texture_to_render == null ||
Math.round(bounds.width) - display._texture_to_render._textureWidth >= 1 ||
Math.round(bounds.height) - display._texture_to_render._textureHeight >= 1) { |
<<<<<<<
const amounts = [2, 3].map(bigNumberify);
const outcome: Outcome = {
type: 'SimpleEthAllocation',
allocationItems: [
{destination: jointParticipants[0].destination, amount: amounts[0]},
{destination: jointParticipants[2].destination, amount: amounts[1]},
{destination: jointParticipants[1].destination, amount: amounts.reduce(add)}
]
};
=======
const amounts = [bigNumberify(2), bigNumberify(3)];
const outcome: Outcome = simpleEthAllocation([
{
destination: jointParticipants[0].destination,
amount: amounts[0]
},
{
destination: jointParticipants[2].destination,
amount: amounts[1]
},
{
destination: jointParticipants[1].destination,
amount: amounts.reduce(add)
}
]);
const state = firstState(outcome, jointChannel);
const signature = signState(state, wallet1.privateKey);
>>>>>>>
const amounts = [bigNumberify(2), bigNumberify(3)];
const outcome: Outcome = simpleEthAllocation([
{destination: jointParticipants[0].destination, amount: amounts[0]},
{destination: jointParticipants[2].destination, amount: amounts[1]},
{destination: jointParticipants[1].destination, amount: amounts.reduce(add)}
]); |
<<<<<<<
//todo 标记脏避免每次绘制到canvas
if(!sharedCanvas) {
sharedCanvas = createCanvas();
}
var canvas = sharedCanvas;
var context = canvas.getContext("2d");
canvas.width = this.surface.width;
canvas.height = this.surface.height;
context.drawImage(this.surface, 0, 0);
//todo 宽度设置回去
return <number[]><any>context.getImageData(x, y, 1, 1).data;
=======
// var canvas = sharedCanvas;
// var context = canvas.getContext("2d");
// canvas.width = this.surface.width;
// canvas.height = this.surface.height;
// context.drawImage(this.surface, 0, 0);
// return <number[]><any>context.getImageData(x, y, 1, 1).data;
var gl = this.context;
var pixels = new Uint8Array(4);
gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer);
gl.readPixels(x, y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
this.frameBufferBinding || gl.bindFramebuffer(gl.FRAMEBUFFER, null);
return <number[]><any>pixels;
>>>>>>>
var gl = this.context;
var pixels = new Uint8Array(4);
gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer);
gl.readPixels(x, y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
this.frameBufferBinding || gl.bindFramebuffer(gl.FRAMEBUFFER, null);
return <number[]><any>pixels; |
<<<<<<<
var h:number = !isNaN(this.$TextField[sys.TextKeys.textFieldHeight]) ? this.$TextField[sys.TextKeys.textFieldHeight] : TextFieldUtils.$getTextHeight(this);
=======
var h:number = !isNaN(this.$TextField[sys.TextKeys.textFieldHeight]) ? this.$TextField[sys.TextKeys.textFieldHeight] : TextFieldUtils.$getTextHeight(self);
w = Math.ceil(w)+2;//+2 是为了解决脏区域的问题
h = Math.ceil(h)+2;
>>>>>>>
var h:number = !isNaN(this.$TextField[sys.TextKeys.textFieldHeight]) ? this.$TextField[sys.TextKeys.textFieldHeight] : TextFieldUtils.$getTextHeight(this);
w = Math.ceil(w)+2;//+2 是为了解决脏区域的问题
h = Math.ceil(h)+2; |
<<<<<<<
import {timerFactory} from '../metrics';
import {OnchainServiceInterface} from '../onchain-service';
=======
import {timerFactory, recordFunctionMetrics} from '../metrics';
>>>>>>>
import {OnchainServiceInterface} from '../onchain-service';
import {timerFactory, recordFunctionMetrics} from '../metrics'; |
<<<<<<<
/**
* <div style="margin-top: 20px"><b>了解详细信息</b>
* <a href="http://docs.egret-labs.org/jkdoc/manual-net-websocket.html" style="padding-left: 20px" target="_blank" >WebSocket</a>
* </div>
*/
=======
/**
* @class egret.WebSocket
* @classdesc
* egret.WebSocket 类启用代码以建立传输控制协议 (TCP) 套接字连接,用于发送和接收字符串或二进制数据。
* 要使用 egret.WebSocket 类的方法,请先使用构造函数 new egret.WebSocket 创建一个 egret.WebSocket 对象。
* 套接字以异步方式传输和接收数据。
*/
>>>>>>>
/**
* @class egret.WebSocket
* @classdesc
* egret.WebSocket 类启用代码以建立传输控制协议 (TCP) 套接字连接,用于发送和接收字符串或二进制数据。
* 要使用 egret.WebSocket 类的方法,请先使用构造函数 new egret.WebSocket 创建一个 egret.WebSocket 对象。
* 套接字以异步方式传输和接收数据。
* <div style="margin-top: 20px"><b>了解详细信息</b>
* <a href="http://docs.egret-labs.org/jkdoc/manual-net-websocket.html" style="padding-left: 20px" target="_blank" >WebSocket</a>
* </div>
*/ |
<<<<<<<
=======
if (DEBUG) {
egret.$markReadOnly(TextField, "numLines");
egret.$markReadOnly(TextField, "textWidth");
egret.$markReadOnly(TextField, "textHeight");
}
export interface TextField{
addEventListener<Z>(type: "link"
, listener: (this: Z, e: TextEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number);
addEventListener<Z>(type: "focusIn" |
"focusOut"
, listener: (this: Z, e: FocusEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number);
addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number);
}
>>>>>>>
export interface TextField{
addEventListener<Z>(type: "link"
, listener: (this: Z, e: TextEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number);
addEventListener<Z>(type: "focusIn" |
"focusOut"
, listener: (this: Z, e: FocusEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number);
addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number);
} |
<<<<<<<
/**
*
* @example
* <pre>
* //获取动画数据
* var skeletonData = RES.getRes("skeleton");
* //获取纹理集数据
* var textureData = RES.getRes("textureConfig");
* //获取纹理集图片
* var texture = RES.getRes("texture");
*
* //创建一个工厂,用来创建Armature
* var factory:dragonBones.EgretFactory = new dragonBones.EgretFactory();
* //把动画数据添加到工厂里
* factory.addSkeletonData(dragonBones.DataParser.parseDragonBonesData(skeletonData));
* //把纹理集数据和图片添加到工厂里
* factory.addTextureAtlas(new dragonBones.EgretTextureAtlas(texture, textureData));
*
* //获取Armature的名字,dragonBones4.0的数据可以包含多个骨架,这里取第一个Armature
* var armatureName:string = skeletonData.armature[0].name;
* //从工厂里创建出Armature
* var armature:dragonBones.FastArmature = factory.buildFastArmature(armatureName);
* //获取装载Armature的容器
* var armatureDisplay = armature.display;
* //把它添加到舞台上
* this.addChild(armatureDisplay);
*
* //以60fps的帧率开启动画缓存,缓存所有的动画数据
* var animationCachManager:dragonBones.AnimationCacheManager = armature.enableAnimationCache(60);
*
* //取得这个Armature动画列表中的第一个动画的名字
* var curAnimationName = armature.animation.animationList[0];
* //播放这个动画,gotoAndPlay各个参数说明
* //第一个参数 animationName {string} 指定播放动画的名称.
* //第二个参数 fadeInTime {number} 动画淡入时间 (>= 0), 默认值:-1 意味着使用动画数据中的淡入时间.
* //第三个参数 duration {number} 动画播放时间。默认值:-1 意味着使用动画数据中的播放时间.
* //第四个参数 layTimes {number} 动画播放次数(0:循环播放, >=1:播放次数, NaN:使用动画数据中的播放时间), 默认值:NaN
* armature.animation.gotoAndPlay(curAnimationName,0.3,-1,0);
*
* //把Armature添加到心跳时钟里
* dragonBones.WorldClock.clock.add(armature);
* //心跳时钟开启
* egret.Ticker.getInstance().register(function (advancedTime) {
* dragonBones.WorldClock.clock.advanceTime(advancedTime / 1000);
* }, this);
* </pre>
*/
=======
/**
* @class dragonBones.AnimationCacheManager
* @classdesc
* AnimationCacheManager 实例是动画缓存管理器,他可以为一个或多个同类型的Armature生成动画缓存数据,从而提高动画运行效率。
* 目前AnimationCacheManager只支持对FastArmatrue生成缓存,以后会扩展为对任何实现ICacheableArmature接口的Armature生成缓存。
* @see dragonBones.ICacheableArmature
* @see dragonBones.FastArmature
* @see dragonBones.AnimationCache
* @see dragonBones.FrameCache
*/
>>>>>>>
/**
* @class dragonBones.AnimationCacheManager
* @classdesc
* AnimationCacheManager 实例是动画缓存管理器,他可以为一个或多个同类型的Armature生成动画缓存数据,从而提高动画运行效率。
* 目前AnimationCacheManager只支持对FastArmatrue生成缓存,以后会扩展为对任何实现ICacheableArmature接口的Armature生成缓存。
* @see dragonBones.ICacheableArmature
* @see dragonBones.FastArmature
* @see dragonBones.AnimationCache
* @see dragonBones.FrameCache
* @example
* <pre>
* //获取动画数据
* var skeletonData = RES.getRes("skeleton");
* //获取纹理集数据
* var textureData = RES.getRes("textureConfig");
* //获取纹理集图片
* var texture = RES.getRes("texture");
*
* //创建一个工厂,用来创建Armature
* var factory:dragonBones.EgretFactory = new dragonBones.EgretFactory();
* //把动画数据添加到工厂里
* factory.addSkeletonData(dragonBones.DataParser.parseDragonBonesData(skeletonData));
* //把纹理集数据和图片添加到工厂里
* factory.addTextureAtlas(new dragonBones.EgretTextureAtlas(texture, textureData));
*
* //获取Armature的名字,dragonBones4.0的数据可以包含多个骨架,这里取第一个Armature
* var armatureName:string = skeletonData.armature[0].name;
* //从工厂里创建出Armature
* var armature:dragonBones.FastArmature = factory.buildFastArmature(armatureName);
* //获取装载Armature的容器
* var armatureDisplay = armature.display;
* //把它添加到舞台上
* this.addChild(armatureDisplay);
*
* //以60fps的帧率开启动画缓存,缓存所有的动画数据
* var animationCachManager:dragonBones.AnimationCacheManager = armature.enableAnimationCache(60);
*
* //取得这个Armature动画列表中的第一个动画的名字
* var curAnimationName = armature.animation.animationList[0];
* //播放这个动画,gotoAndPlay各个参数说明
* //第一个参数 animationName {string} 指定播放动画的名称.
* //第二个参数 fadeInTime {number} 动画淡入时间 (>= 0), 默认值:-1 意味着使用动画数据中的淡入时间.
* //第三个参数 duration {number} 动画播放时间。默认值:-1 意味着使用动画数据中的播放时间.
* //第四个参数 layTimes {number} 动画播放次数(0:循环播放, >=1:播放次数, NaN:使用动画数据中的播放时间), 默认值:NaN
* armature.animation.gotoAndPlay(curAnimationName,0.3,-1,0);
*
* //把Armature添加到心跳时钟里
* dragonBones.WorldClock.clock.add(armature);
* //心跳时钟开启
* egret.Ticker.getInstance().register(function (advancedTime) {
* dragonBones.WorldClock.clock.advanceTime(advancedTime / 1000);
* }, this);
* </pre>
*/ |
<<<<<<<
import * as ContractAddressGenerator from '../../build/contracts/ContractAddressGenerator.json'
import * as RLPEncode from '../../build/contracts/RLPEncode.json'
import { Contract, ContractFactory, Wallet, utils } from 'ethers'
=======
>>>>>>>
import * as ContractAddressGenerator from '../../build/contracts/ContractAddressGenerator.json'
import * as RLPEncode from '../../build/contracts/RLPEncode.json' |
<<<<<<<
/* Internal Imports */
import { rootPath } from '../index'
const should = chai.should()
const testArtifactsDir = path.join(rootPath, 'test', 'artifacts.test.tmp')
const testRootPath = path.join(testArtifactsDir, (+new Date()).toString())
const dbRootPath = path.join(testRootPath, 'db')
// If these directories don't exist, create them.
fs.mkdirSync(testArtifactsDir, { recursive: true })
fs.mkdirSync(testRootPath, { recursive: true })
fs.mkdirSync(dbRootPath, { recursive: true })
export { should, dbRootPath }
export { testRootPath as rootPath }
=======
chai.use(chaiAsPromised)
const should = chai.should()
export { should }
>>>>>>>
/* Internal Imports */
import { rootPath } from '../index'
chai.use(chaiAsPromised)
const should = chai.should()
const testArtifactsDir = path.join(rootPath, 'test', 'artifacts.test.tmp')
const testRootPath = path.join(testArtifactsDir, (+new Date()).toString())
const dbRootPath = path.join(testRootPath, 'db')
// If these directories don't exist, create them.
fs.mkdirSync(testArtifactsDir, { recursive: true })
fs.mkdirSync(testRootPath, { recursive: true })
fs.mkdirSync(dbRootPath, { recursive: true })
export { should, dbRootPath }
export { testRootPath as rootPath } |
<<<<<<<
const obj = await ClassRegistry.createInstance({classFullName: testEcClass.schema + "." + testEcClass.name, iModel: imodel});
=======
const {result: obj} = await ClassRegistry.createInstance({schemaName: testEcClass.schema, className: testEcClass.name, iModel: imodel});
>>>>>>>
const {result: obj} = await ClassRegistry.createInstance({classFullName: testEcClass.schema + "." + testEcClass.name, iModel: imodel}); |
<<<<<<<
import { dispose } from "@bentley/bentleyjs-core";
import { FeatureIndexType } from "@bentley/imodeljs-common";
=======
import { dispose, assert } from "@bentley/bentleyjs-core";
>>>>>>>
import { dispose, assert } from "@bentley/bentleyjs-core";
import { FeatureIndexType } from "@bentley/imodeljs-common";
<<<<<<<
private readonly _vertices: QBufferHandle3d;
private readonly _vertexCount: number;
private readonly _colorHandle: BufferHandle | undefined = undefined;
private readonly _hasFeatures: boolean;
=======
public readonly buffers: BuffersContainer;
private _vertices: QBufferHandle3d;
private _vertexCount: number;
private _colorHandle: BufferHandle | undefined = undefined;
public features: FeaturesInfo | undefined;
>>>>>>>
public readonly buffers: BuffersContainer;
private readonly _vertices: QBufferHandle3d;
private readonly _vertexCount: number;
private readonly _colorHandle: BufferHandle | undefined = undefined;
private readonly _hasFeatures: boolean;
<<<<<<<
this._hasFeatures = FeatureIndexType.Empty !== pointCloud.features.type;
if (undefined !== pointCloud.colors)
=======
this.features = FeaturesInfo.create(pointCloud.features);
if (undefined !== pointCloud.colors) {
>>>>>>>
this._hasFeatures = FeatureIndexType.Empty !== pointCloud.features.type;
if (undefined !== pointCloud.colors) { |
<<<<<<<
private getState(): State { return this._rootAsTree3d.getState(this.depth - 1); }
/** Set the load state of the onwner attachment's array at this tile's depth. */
private setState(state: State) { this._rootAsTree3d.setState(this.depth - 1, state); }
=======
private getState(): State { return this.rootAsTree3d.getState(this.depth - 1); }
/** Set the load state of the owner attachment's array at this tile's depth. */
private setState(state: State) { this.rootAsTree3d.setState(this.depth - 1, state); }
>>>>>>>
private getState(): State { return this._rootAsTree3d.getState(this.depth - 1); }
/** Set the load state of the owner attachment's array at this tile's depth. */
private setState(state: State) { this._rootAsTree3d.setState(this.depth - 1, state); }
<<<<<<<
/** Returns true if all attachments in this list have defined tile trees. */
public get allReady(): boolean { return this._allReady; }
=======
/** Returns true if all of the 2d attachments in the list have tile trees that are fully loaded, and all 3d attachments have tile trees that are at least not undefined. */
public get allLoaded(): boolean {
if (!this._all2dReady)
return false;
for (const attachment of this.list)
if (attachment.tree === undefined)
return false;
return true;
}
/** Given a view id, return an attachment containing that view from the list. If no attachment in the list stores that view, returns undefined. */
public findByViewId(viewId: Id64): Attachment | undefined {
for (const attachment of this.list)
if (attachment.view.id.equals(viewId))
return attachment;
return undefined;
}
>>>>>>>
/** Returns true if all attachments in this list have defined tile trees. */
public get allReady(): boolean { return this._allReady; } |
<<<<<<<
// !!! TESTING METHOD
public executeTestById(_iModelToken: IModelToken, _id: number, _params: any): any {
return this.forward.apply(this, arguments);
}
=======
/**
* Commit pending changes to this iModel
* @param _description Optional description of the changes
* @throws [[IModelError]] if there is a problem saving changes.
*/
public async saveChanges(_iModelToken: IModelToken, _description?: string): Promise<void> {
return this.forward.apply(this, arguments);
}
>>>>>>>
// !!! TESTING METHOD
public executeTestById(_iModelToken: IModelToken, _id: number, _params: any): any {
}
/**
* Commit pending changes to this iModel
* @param _description Optional description of the changes
* @throws [[IModelError]] if there is a problem saving changes.
*/
public async saveChanges(_iModelToken: IModelToken, _description?: string): Promise<void> {
return this.forward.apply(this, arguments);
} |
<<<<<<<
const response = await this.iModel.executeQuery("SELECT * FROM [" + name[0] + "].[" + name[1] + "] WHERE Element.Id=" + this.id.toString()); // WIP: need to bind!
if (response.error || !response.result)
return Promise.reject(new IModelError(DgnDbStatus.SQLiteError));
const rows: any[] = JSON.parse(response.result);
=======
const rowsJson: string = await this.iModel.executeQuery("SELECT * FROM " + name[0] + "." + name[1] + " WHERE Element.Id=" + this.id.toString()); // WIP: need to bind!
const rows: any[] = JSON.parse(rowsJson);
>>>>>>>
const rowsJson: string = await this.iModel.executeQuery("SELECT * FROM [" + name[0] + "].[" + name[1] + "] WHERE Element.Id=" + this.id.toString()); // WIP: need to bind!
const rows: any[] = JSON.parse(rowsJson); |
<<<<<<<
import { FeatureMode, WithClipVolume } from "../TechniqueFlags";
import { GLSLFragment, addWhiteOnWhiteReversal, addPickBufferOutputs } from "./Fragment";
=======
import { FeatureMode } from "../TechniqueFlags";
import { GLSLFragment, addWhiteOnWhiteReversal } from "./Fragment";
>>>>>>>
import { FeatureMode } from "../TechniqueFlags";
import { GLSLFragment, addWhiteOnWhiteReversal, addPickBufferOutputs } from "./Fragment"; |
<<<<<<<
public requestSnap(activity: ActivityLoggingContext, connectionId: string, props: SnapRequestProps): Promise<SnapResponseProps> {
activity.enter();
=======
public async requestSnap(actx: ActivityLoggingContext, connectionId: string, props: SnapRequestProps): Promise<SnapResponseProps> {
actx.enter();
>>>>>>>
public async requestSnap(activity: ActivityLoggingContext, connectionId: string, props: SnapRequestProps): Promise<SnapResponseProps> {
activity.enter();
<<<<<<<
public requestTileTreeProps(activity: ActivityLoggingContext, id: string): Promise<TileTreeProps> {
activity.enter();
=======
public async requestTileTreeProps(actx: ActivityLoggingContext, id: string): Promise<TileTreeProps> {
actx.enter();
>>>>>>>
public async requestTileTreeProps(activity: ActivityLoggingContext, id: string): Promise<TileTreeProps> {
activity.enter();
<<<<<<<
public requestTileContent(activity: ActivityLoggingContext, treeId: string, tileId: string): Promise<Uint8Array> {
activity.enter();
=======
public async requestTileContent(actx: ActivityLoggingContext, treeId: string, tileId: string): Promise<Uint8Array> {
actx.enter();
>>>>>>>
public async requestTileContent(activity: ActivityLoggingContext, treeId: string, tileId: string): Promise<Uint8Array> {
activity.enter(); |
<<<<<<<
private readonly _attributes = new Array<Attribute>();
=======
private readonly _attrMap?: Map<string, AttributeDetails>;
private readonly _preserveShaderSourceCode: boolean;
>>>>>>>
private readonly _attrMap?: Map<string, AttributeDetails>; |
<<<<<<<
/** If true, requests for tile content will execute on a separate thread pool to avoid blocking other, less expensive asynchronous requests such as ECSql queries.
* @internal
*/
=======
/** If true, requests for tile content will execute on a separate thread pool in order to avoid blocking other, less expensive asynchronous requests such as ECSql queries.
* @internal
*/
>>>>>>>
/** If true, requests for tile content will execute on a separate thread pool to avoid blocking other, less expensive asynchronous requests such as ECSql queries.
* @internal
*/
<<<<<<<
/** Whether external tile caching is active.
* @internal
*/
public static get usingExternalTileCache(): boolean { return undefined !== IModelHost.configuration && undefined !== IModelHost.configuration.tileCacheCredentials; }
=======
/** The backend will log when a tile took longer to load than this threshold in seconds. */
public static get logTileLoadTimeThreshold(): number { return undefined !== IModelHost.configuration ? IModelHost.configuration.logTileLoadTimeThreshold : IModelHostConfiguration.defaultLogTileLoadTimeThreshold; }
/** The backend will log when a tile is loaded with a size in bytes above this threshold. */
public static get logTileSizeThreshold(): number { return undefined !== IModelHost.configuration ? IModelHost.configuration.logTileSizeThreshold : IModelHostConfiguration.defaultLogTileSizeThreshold; }
/** Whether external tile caching is active. */
public static get usingExternalTileCache(): boolean { return (undefined !== IModelHost.configuration && IModelHost.configuration.tileCacheCredentials) ? true : false; }
>>>>>>>
/** The backend will log when a tile took longer to load than this threshold in seconds. */
public static get logTileLoadTimeThreshold(): number { return undefined !== IModelHost.configuration ? IModelHost.configuration.logTileLoadTimeThreshold : IModelHostConfiguration.defaultLogTileLoadTimeThreshold; }
/** The backend will log when a tile is loaded with a size in bytes above this threshold. */
public static get logTileSizeThreshold(): number { return undefined !== IModelHost.configuration ? IModelHost.configuration.logTileSizeThreshold : IModelHostConfiguration.defaultLogTileSizeThreshold; }
/** Whether external tile caching is active.
* @internal
*/
public static get usingExternalTileCache(): boolean { return undefined !== IModelHost.configuration && undefined !== IModelHost.configuration.tileCacheCredentials; } |
<<<<<<<
/** Creates a change set file from the changes in a standalone iModel
* @return Path to the standalone change set file
* @internal
*/
public static createStandaloneChangeSet(iModelDb: IModelDb): ChangeSetToken {
if (!iModelDb.isSnapshot && !iModelDb.isStandalone) {
throw new IModelError(BentleyStatus.ERROR, "Cannot call createStandaloneChangeSet() when the briefcase is not a snapshot", Logger.logError, loggerCategory);
}
const briefcaseEntry = new BriefcaseEntry("", iModelDb.nativeDb.getDbGuid(), iModelDb.nativeDb.getParentChangeSetId(), iModelDb.nativeDb.getFilePath(), iModelDb.openParams, iModelDb.getBriefcaseId());
briefcaseEntry.setNativeDb(iModelDb.nativeDb);
briefcaseEntry.iModelDb = iModelDb;
const changeSetToken: ChangeSetToken = BriefcaseManager.startCreateChangeSet(briefcaseEntry);
BriefcaseManager.finishCreateChangeSet(briefcaseEntry);
return changeSetToken;
}
/** Attempt to push a ChangeSet to iModel Hub */
private static async pushChangeSet(requestContext: AuthorizedClientRequestContext, briefcase: BriefcaseEntry, description: string, changeType: ChangesType, relinquishCodesLocks: boolean): Promise<void> {
=======
/** Attempt to push a ChangeSet to iModelHub */
private static async pushChangeSet(requestContext: AuthorizedClientRequestContext, briefcase: BriefcaseEntry, description: string, relinquishCodesLocks: boolean): Promise<void> {
>>>>>>>
/** Attempt to push a ChangeSet to iModelHub */
private static async pushChangeSet(requestContext: AuthorizedClientRequestContext, briefcase: BriefcaseEntry, description: string, changeType: ChangesType, relinquishCodesLocks: boolean): Promise<void> { |
<<<<<<<
public get name() { return this._name; }
public get url() { return this._tilesetUrl; }
public tileTree(): TileTree | undefined { return this._tileTreeState.tileTree; }
public loadStatus(): TileTree.LoadStatus { return this._tileTreeState.loadStatus; }
=======
public get tileTree(): TileTree | undefined { return this._tileTreeState.tileTree; }
public get loadStatus(): TileTree.LoadStatus { return this._tileTreeState.loadStatus; }
>>>>>>>
public get name() { return this._name; }
public get url() { return this._tilesetUrl; }
public get tileTree(): TileTree | undefined { return this._tileTreeState.tileTree; }
public get loadStatus(): TileTree.LoadStatus { return this._tileTreeState.loadStatus; } |
<<<<<<<
import { Config, FileHandler } from "..";
=======
import { Config } from "..";
import { CustomRequestOptions } from "./CustomRequestOptions";
>>>>>>>
import { Config, FileHandler } from "..";
import { CustomRequestOptions } from "./CustomRequestOptions";
<<<<<<<
protected _agent: https.Agent;
protected _fileHandler: FileHandler | undefined;
=======
private _agent: https.Agent;
private _customRequestOptions: CustomRequestOptions = new CustomRequestOptions();
>>>>>>>
protected _agent: https.Agent;
protected _fileHandler: FileHandler | undefined;
private _customRequestOptions: CustomRequestOptions = new CustomRequestOptions(); |
<<<<<<<
const haveOverrides = FeatureSymbologyOptions.None !== (opts & FeatureSymbologyOptions.HasOverrides);
if (haveOverrides || System.instance.capabilities.supportsPickShaders) {
// Pick shaders use feature index to look up element ID - otherwise it's not needed unless we need to look up overrides.
addFeatureIndex(vert, alwaysUniform);
}
=======
addFeatureIndex(vert);
>>>>>>>
addFeatureIndex(vert, alwaysUniform); |
<<<<<<<
class RefreshTilesTool extends Tool {
public static toolId = "RefreshTiles";
public static get maxArgs() { return undefined; }
public run(changedModelIds?: string[]): boolean {
IModelApp.viewManager.refreshForModifiedModels(changedModelIds);
return true;
}
public parseAndRun(...args: string[]): boolean {
return this.run(args);
}
}
=======
class ResizeViewportTool extends Tool {
public static toolId = "ResizeViewport";
public static get minArgs() { return 2; }
public static get maxArgs() { return 2; }
public run(width: number, height: number): boolean {
const vp = IModelApp.viewManager.selectedView;
if (undefined === vp)
return true;
const dW = width - vp.canvas.width;
const dH = height - vp.canvas.height;
window.resizeTo(window.outerWidth + dW, window.outerHeight + dH);
return true;
}
public parseAndRun(...args: string[]): boolean {
const width = parseInt(args[0], 10);
const height = parseInt(args[1], 10);
if (!Number.isNaN(width) && !Number.isNaN(height))
this.run(width, height);
return true;
}
}
>>>>>>>
class ResizeViewportTool extends Tool {
public static toolId = "ResizeViewport";
public static get minArgs() { return 2; }
public static get maxArgs() { return 2; }
if (undefined === vp)
return true;
const dW = width - vp.canvas.width;
const dH = height - vp.canvas.height;
window.resizeTo(window.outerWidth + dW, window.outerHeight + dH);
return true;
}
public parseAndRun(...args: string[]): boolean {
const width = parseInt(args[0], 10);
const height = parseInt(args[1], 10);
if (!Number.isNaN(width) && !Number.isNaN(height))
this.run(width, height);
return true;
}
}
class RefreshTilesTool extends Tool {
public static toolId = "RefreshTiles";
public static get maxArgs() { return undefined; }
public run(changedModelIds?: string[]): boolean {
IModelApp.viewManager.refreshForModifiedModels(changedModelIds);
return true;
}
public parseAndRun(...args: string[]): boolean {
return this.run(args);
}
}
<<<<<<<
RefreshTilesTool.register(svtToolNamespace);
=======
ResizeViewportTool.register(svtToolNamespace);
>>>>>>>
ResizeViewportTool.register(svtToolNamespace);
RefreshTilesTool.register(svtToolNamespace); |
<<<<<<<
const testIModelName: string = "assets/datasets/Properties_60InstancesWithUrl2.ibim";
=======
initialize();
const testIModelName: string = "assets/datasets/1K.bim";
>>>>>>>
initialize();
const testIModelName: string = "assets/datasets/Properties_60InstancesWithUrl2.ibim"; |
<<<<<<<
import { Ray3d, Plane3dByOriginAndUnitNormal } from "@bentley/geometry-core/lib/AnalyticGeometry";
=======
import { GeometricModelState } from "./ModelState";
>>>>>>>
import { Ray3d, Plane3dByOriginAndUnitNormal } from "@bentley/geometry-core/lib/AnalyticGeometry";
import { GeometricModelState } from "./ModelState";
<<<<<<<
const extents = this.getGroundExtents(context.viewport);
if (!extents.isNull()) {
const points: Point3d[] = [extents.low.clone(), extents.low.clone(), extents.high.clone(), extents.high.clone()];
points[1].y = extents.high.y;
points[3].y = extents.low.y;
const environment = this.getDisplayStyle3d().getEnvironment();
const above = this.isEyePointAbove(extents.low.z);
const values = [0, .25, .5]; // gradient goes from edge of rectangle (0.0) to center (1.0)...
const color = above ? environment.ground.aboveColor : environment.ground.belowColor;
const colors: ColorDef[] = [color.clone(), color.clone(), color.clone()];
const alpha = above ? 0x80 : 0x85;
colors[0].setAlpha(0xff);
colors[1].setAlpha(alpha);
colors[2].setAlpha(alpha);
const gradient = new Gradient.Symb();
gradient.mode = Gradient.Mode.Cylindrical;
gradient.keys = [{ color: colors[0], value: values[0] }, { color: colors[1], value: values[1] }, { color: colors[2], value: values[2] }];
const params = new GraphicParams();
params.setLineColor(colors[0]);
params.setFillColor(ColorDef.white); // Fill should be set to opaque white for gradient texture...
params.gradient = gradient;
const builder = context.createWorldDecoration();
builder.activateGraphicParams(params);
/// ### TODO: Until we have more support in geometry package for tracking UV coordinates of higher level geometry
// we will use a PolyfaceBuilder here to add the ground plane as a quad, claim the polyface, and then send that to the GraphicBuilder
const strokeOptions = new StrokeOptions();
strokeOptions.needParams = true;
const polyfaceBuilder = PolyfaceBuilder.create(strokeOptions);
const uvParams: Point2d[] = [Point2d.create(0, 0), Point2d.create(0, 1), Point2d.create(1, 1), Point2d.create(1, 0)];
polyfaceBuilder.addQuad(points, uvParams);
polyfaceBuilder.endFace();
const polyface = polyfaceBuilder.claimPolyface();
builder.addPolyface(polyface, true);
context.addWorldDecoration(builder.finish());
} else {
// Ground extents could not be determined given the current view state and viewport
// Resorting to 'fake' version, which is an ellipse!
const projectExtents = this.getViewedExtents();
const center = projectExtents.low.interpolate(0.5, projectExtents.high);
const ellipse = Arc3d.createXYEllipse(center, Math.abs(center.x - projectExtents.low.x), Math.abs(center.y - projectExtents.low.y));
const gf = context.createWorldDecoration();
const green = ColorDef.green.clone();
gf.setSymbology(green, green, 2);
gf.addArc(ellipse, true, true);
gf.addRangeBox(projectExtents);
context.addWorldDecoration(gf.finish()!);
}
=======
// ###TODO: Check if enabled in display style; draw actual ground plane instead of this fake thing
const extents = this.getViewedExtents(); // the project extents
const center = extents.low.interpolate(0.5, extents.high);
center.z = extents.low.z;
const ellipse = Arc3d.createXYEllipse(center, Math.abs(center.x - extents.low.x), Math.abs(center.y - extents.low.y));
const gf = context.createWorldDecoration();
const green = ColorDef.green.clone();
gf.setSymbology(green, green, 2);
gf.addArc(ellipse, true, true);
gf.addRangeBox(extents);
context.addWorldDecoration(gf.finish()!);
>>>>>>>
const extents = this.getGroundExtents(context.viewport);
if (extents.isNull()) {
return;
}
const points: Point3d[] = [extents.low.clone(), extents.low.clone(), extents.high.clone(), extents.high.clone()];
points[1].y = extents.high.y;
points[3].y = extents.low.y;
const aboveGround = this.isEyePointAbove(extents.low.z);
const colors: ColorDef[] = [];
const material = this.getDisplayStyle3d().createGroundPlaneMaterial(context.viewport.target.renderSystem, aboveGround, colors);
const params = new GraphicParams();
params.setLineColor(colors[0]);
params.setFillColor(ColorDef.white); // Fill should be set to opaque white for gradient texture...
params.material = material;
const builder = context.createWorldDecoration();
builder.activateGraphicParams(params);
/// ### TODO: Until we have more support in geometry package for tracking UV coordinates of higher level geometry
// we will use a PolyfaceBuilder here to add the ground plane as a quad, claim the polyface, and then send that to the GraphicBuilder
const strokeOptions = new StrokeOptions();
strokeOptions.needParams = true;
const polyfaceBuilder = PolyfaceBuilder.create(strokeOptions);
const uvParams: Point2d[] = [Point2d.create(0, 0), Point2d.create(0, 1), Point2d.create(1, 1), Point2d.create(1, 0)];
polyfaceBuilder.addQuadFacet(points, uvParams);
const polyface = polyfaceBuilder.claimPolyface();
builder.addPolyface(polyface, true);
context.addWorldDecoration(builder.finish()); |
<<<<<<<
const viewport = new Viewport(canvas, spatialView);
const primBuilder = new PrimitiveBuilder(System.instance, GraphicType.Scene, viewport);
=======
const viewport = new Viewport(viewDiv, spatialView);
const gfParams = GraphicBuilderCreateParams.create(GraphicType.Scene, viewport);
const primBuilder = new PrimitiveBuilder(System.instance, gfParams);
>>>>>>>
const viewport = new Viewport(viewDiv, spatialView);
const primBuilder = new PrimitiveBuilder(System.instance, GraphicType.Scene, viewport);
<<<<<<<
const viewport = new Viewport(canvas, spatialView);
const primBuilder = new PrimitiveBuilder(System.instance, GraphicType.Scene, viewport);
=======
const viewport = new Viewport(viewDiv, spatialView);
const gfParams = GraphicBuilderCreateParams.create(GraphicType.Scene, viewport);
const primBuilder = new PrimitiveBuilder(System.instance, gfParams);
>>>>>>>
const viewport = new Viewport(viewDiv, spatialView);
const primBuilder = new PrimitiveBuilder(System.instance, GraphicType.Scene, viewport);
<<<<<<<
const viewport = new Viewport(canvas, spatialView);
const primBuilder = new PrimitiveBuilder(System.instance, GraphicType.Scene, viewport);
=======
const viewport = new Viewport(viewDiv, spatialView);
const gfParams = GraphicBuilderCreateParams.create(GraphicType.Scene, viewport);
const primBuilder = new PrimitiveBuilder(System.instance, gfParams);
>>>>>>>
const viewport = new Viewport(viewDiv, spatialView);
const primBuilder = new PrimitiveBuilder(System.instance, GraphicType.Scene, viewport);
<<<<<<<
const viewport = new Viewport(canvas, spatialView);
const primBuilder = new PrimitiveBuilder(System.instance, GraphicType.Scene, viewport);
=======
const viewport = new Viewport(viewDiv, spatialView);
const gfParams = GraphicBuilderCreateParams.create(GraphicType.Scene, viewport);
const primBuilder = new PrimitiveBuilder(System.instance, gfParams);
>>>>>>>
const viewport = new Viewport(viewDiv, spatialView);
const primBuilder = new PrimitiveBuilder(System.instance, GraphicType.Scene, viewport);
<<<<<<<
const viewport = new Viewport(canvas, spatialView);
const primBuilder = new PrimitiveBuilder(System.instance, GraphicType.Scene, viewport);
=======
const viewport = new Viewport(viewDiv, spatialView);
const gfParams = GraphicBuilderCreateParams.create(GraphicType.Scene, viewport);
const primBuilder = new PrimitiveBuilder(System.instance, gfParams);
>>>>>>>
const viewport = new Viewport(viewDiv, spatialView);
const primBuilder = new PrimitiveBuilder(System.instance, GraphicType.Scene, viewport); |
<<<<<<<
public async importSchema(schemaFileName: string): Promise<void> {
if (!this.briefcase)
throw this._newNotOpenError();
if (!this.briefcase.isStandalone) {
await this.concurrencyControl.lockSchema(IModelDb.getAccessToken(this.iModelToken.iModelId!));
}
const stat = this.briefcase.nativeDb.importSchema(schemaFileName);
if (DbResult.BE_SQLITE_OK !== stat) {
=======
public importSchema(schemaFileName: string) {
if (!this.briefcase) throw this.newNotOpenError();
const stat = this.nativeDb.importSchema(schemaFileName);
if (DbResult.BE_SQLITE_OK !== stat)
>>>>>>>
public async importSchema(schemaFileName: string): Promise<void> {
if (!this.briefcase)
throw this.newNotOpenError();
if (!this.briefcase.isStandalone) {
await this.concurrencyControl.lockSchema(IModelDb.getAccessToken(this.iModelToken.iModelId!));
}
const stat = this.briefcase.nativeDb.importSchema(schemaFileName);
if (DbResult.BE_SQLITE_OK !== stat) { |
<<<<<<<
import { OpCodeReader, OpCodeWriter, OpCodeIterator, GeometryStreamBuilder, GeometryStream, OpCode } from "../../common/geometry/GeometryStream";
import { GeometryParams } from "../../common/geometry/GeometryProps";
=======
import { GSReader, GSWriter, GSCollection, GeometryBuilder, GeometryStream, OpCode } from "@bentley/imodeljs-common/lib/geometry/GeometryStream";
import { GeometryParams } from "@bentley/imodeljs-common/lib/geometry/GeometryProps";
>>>>>>>
import { OpCodeReader, OpCodeWriter, OpCodeIterator, GeometryStreamBuilder, GeometryStream, OpCode } from "@bentley/imodeljs-common/lib/geometry/GeometryStream";
import { GeometryParams } from "@bentley/imodeljs-common/lib/geometry/GeometryProps"; |
<<<<<<<
const iModels: HubIModel[] = await BriefcaseManager.imodelClient.IModels().get(adminAccessToken, testProjectId, new IModelQuery().byName(iModelName));
=======
const iModels: IModelRepository[] = await BriefcaseManager.hubClient.IModels().get(adminAccessToken, testProjectId, new IModelQuery().byName(iModelName));
>>>>>>>
const iModels: IModelRepository[] = await BriefcaseManager.imodelClient.IModels().get(adminAccessToken, testProjectId, new IModelQuery().byName(iModelName));
<<<<<<<
const iModels: HubIModel[] = await BriefcaseManager.imodelClient.IModels().get(adminAccessToken, testProjectId, new IModelQuery().byName(iModelName));
=======
const iModels: IModelRepository[] = await BriefcaseManager.hubClient.IModels().get(adminAccessToken, testProjectId, new IModelQuery().byName(iModelName));
>>>>>>>
const iModels: IModelRepository[] = await BriefcaseManager.imodelClient.IModels().get(adminAccessToken, testProjectId, new IModelQuery().byName(iModelName));
<<<<<<<
const iModels: HubIModel[] = await BriefcaseManager.imodelClient.IModels().get(adminAccessToken, testProjectId, new IModelQuery().byName(iModelName));
=======
const iModels: IModelRepository[] = await BriefcaseManager.hubClient.IModels().get(adminAccessToken, testProjectId, new IModelQuery().byName(iModelName));
>>>>>>>
const iModels: IModelRepository[] = await BriefcaseManager.imodelClient.IModels().get(adminAccessToken, testProjectId, new IModelQuery().byName(iModelName)); |
<<<<<<<
configuration.disableInstancing = undefined !== process.env.SVT_DISABLE_INSTANCING;
configuration.useProjectExtents = undefined !== process.env.SVT_USE_PROJECT_EXTENTS;
configuration.disableMagnification = undefined !== process.env.SVT_DISABLE_MAGNIFICATION;
=======
if (undefined !== process.env.SVT_DISABLE_INSTANCING)
configuration.disableInstancing = true;
if (undefined !== process.env.SVT_DISABLE_MAGNIFICATION)
configuration.disableMagnification = true;
>>>>>>>
if (undefined !== process.env.SVT_DISABLE_INSTANCING)
configuration.disableInstancing = true;
if (undefined !== process.env.SVT_DISABLE_MAGNIFICATION)
configuration.disableMagnification = true;
configuration.useProjectExtents = undefined !== process.env.SVT_USE_PROJECT_EXTENTS; |
<<<<<<<
export abstract class DisplayStyleState extends ElementState {
private _viewFlags: ViewFlags;
private _background: ColorDef;
private _monochrome: ColorDef;
private _subCategoryOverrides: Map<string, SubCategoryOverride> = new Map<string, SubCategoryOverride>();
private _backgroundMap: BackgroundMapState;
public syncBackgroundMapState() {
this._backgroundMap = new BackgroundMapState(this.getStyle("backgroundMap"), this.iModel);
}
constructor(props: ElementProps, iModel: IModelConnection) {
=======
export abstract class DisplayStyleState extends ElementState implements DisplayStyleProps {
private readonly _viewFlags: ViewFlags;
private readonly _background: ColorDef;
private readonly _monochrome: ColorDef;
private readonly _subCategoryOverrides: Map<string, SubCategoryOverride> = new Map<string, SubCategoryOverride>();
public readonly backgroundMap: BackgroundMapState;
constructor(props: DisplayStyleProps, iModel: IModelConnection) {
>>>>>>>
export abstract class DisplayStyleState extends ElementState implements DisplayStyleProps {
private readonly _viewFlags: ViewFlags;
private readonly _background: ColorDef;
private readonly _monochrome: ColorDef;
private readonly _subCategoryOverrides: Map<string, SubCategoryOverride> = new Map<string, SubCategoryOverride>();
private _backgroundMap: BackgroundMapState;
constructor(props: DisplayStyleProps, iModel: IModelConnection) { |
<<<<<<<
export interface IElement extends IECInstance {
=======
export interface ElementParams extends FullClassName {
>>>>>>>
export interface ElementParams extends IECInstance {
<<<<<<<
// When JSON.stringify'ing an element, don't include internal properties that begin with _
// One consequence of including such properties is that we get into the LRUCache, and that can lead to a cycle back to the element that we are processing.
function stripInternalProperties(key: string, value: any): any {
if (key.startsWith("_"))
return undefined;
return value;
}
/** An element within an iModel */
=======
/**
* The full name of an ECClass
* @property {string } name The name of the class
* @property {string} schema The name of the ECSchema that defines this class
*/
export interface ECClassFullname {
name: string;
schema: string;
}
/**
* A custom attribute instance
* @property ecclass The ECClass of the custom attribute
* @property properties An object whose properties correspond by name to the properties of this class.
*/
export interface CustomAttribute {
ecclass: ECClassFullname;
properties: { [propName: string]: PrimitiveECProperty | NavigationECProperty | StructECProperty | PrimitiveArrayECProperty | StructArrayECProperty };
}
/**
* Metadata for an ECProperty that is a primitive type.
* @property primitiveECProperty Describes the type
* @property customAttributes The Custom Attributes for this class
*/
export interface PrimitiveECProperty {
primitiveECProperty: { type: string, extendedType?: string };
customAttributes: CustomAttribute[];
}
/**
* Metadata for an ECProperty that is a Navigation property (aka a pointer to another element in the iModel).
* @property { Object } navigationECProperty Describes the type
* @property customAttributes The Custom Attributes for this class
*/
export interface NavigationECProperty {
navigationECProperty: { type: string, direction: string, relationshipClass: ECClassFullname };
customAttributes: CustomAttribute[];
}
/**
* Metadata for an ECProperty that is a struct.
* @property { Object } structECProperty Describes the type
*/
export interface StructECProperty {
structECProperty: { type: string };
}
/**
* Metadata for an ECProperty that is a primitive array.
* @property { Object } primitiveArrayECProperty Describes the type
*/
export interface PrimitiveArrayECProperty {
primitiveArrayECProperty: { type: string, minOccurs: number, maxOccurs?: number };
}
/**
* Metadata for an ECProperty that is a struct array.
* @property { Object } structArrayECProperty Describes the type
*/
export interface StructArrayECProperty {
structArrayECProperty: { type: string, minOccurs: number, maxOccurs?: number };
}
/**
* Metadata for an ECClass.
* @property {string} name The ECClass name
* @property {string} schema The name of the ECSchema that defines this class
* @property { ECClassFullname[] } baseClasses The list of base classes that this class is derived from. If more than one, the first is the actual base class and the others are mixins.
* @property { CustomAttribute[] } customAttributes The Custom Attributes for this class
* @property { PrimitiveECProperty| NavigationECProperty|StructECProperty|PrimitiveArrayECProperty|StructArrayECProperty } properties An object whose properties correspond by name to the properties of this class.
*/
export interface ECClass {
name: string;
schema: string;
baseClasses: ECClassFullname[];
customAttributes: CustomAttribute[];
properties: { [propName: string]: PrimitiveECProperty | NavigationECProperty | StructECProperty | PrimitiveArrayECProperty | StructArrayECProperty };
}
/** An element within an iModel. */
@registerEcClass("BisCore.Element")
>>>>>>>
/** An element within an iModel */
<<<<<<<
constructor(val: IElement) {
=======
constructor(val: ElementParams) {
this.schemaName = val.schemaName;
this.className = val.className;
>>>>>>>
constructor(val: ElementParams) {
<<<<<<<
/** The full name of this class, including the schema name */
public static get sqlName(): string { return this.schema.name + "." + this.name; }
/** Safely convert an Element to JSON. This strips out internal properties, which excludes stuff that doesn't belong in JSON and also avoids cycles. */
public stringify(): string { return JSON.stringify(this, stripInternalProperties); }
=======
>>>>>>>
/** The full name of this class, including the schema name */
public static get sqlName(): string { return this.schema.name + "." + this.name; }
<<<<<<<
public async getECClass(): Promise<ECClass> { return Object.getPrototypeOf(this).constructor.getECClassFor(this._iModel, this.schemaName, this.className); }
=======
public async getECClass(): Promise<ECClass> { return Object.getPrototypeOf(this).constructor.getECClassFor(this._iModel, this.schemaName, this.className); }
>>>>>>>
public async getECClass(): Promise<ECClass> { return Object.getPrototypeOf(this).constructor.getECClassFor(this._iModel, this.schemaName, this.className); }
<<<<<<<
=======
@registerEcClass(BisCore.GeometricElement3d)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.SpatialElement)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.PhysicalElement)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.PhysicalPortion)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.SpatialLocationElement)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.SpatialLocationPortion)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.InformationContentElement)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.InformationReferenceElement)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.Subject)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.Document)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.Drawing)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.SectionDrawing)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.InformationCarrierElement)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.InformationRecordElement)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.DefinitionElement)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.TypeDefinitionElement)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.RecipeDefinitionElement)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.PhysicalType)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.SpatialLocationType)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.TemplateRecipe3d)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.GraphicalType2d)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.TemplateRecipe2d)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.InformationPartitionElement)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.DefinitionPartition)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.DocumentPartition)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.GroupInformationPartition)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.InformationRecordPartition)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.PhysicalPartition)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.SpatialLocationPartition)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.GroupInformationElement)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.RoleElement)
>>>>>>>
<<<<<<<
=======
@registerEcClass(BisCore.LinkPartition)
>>>>>>> |
<<<<<<<
import { assert, Id64, BeTimePoint, IndexedValue, IDisposable, dispose } from "@bentley/bentleyjs-core";
import { IModelConnection } from "../../IModelConnection";
=======
import { assert, Id64, BeTimePoint, IndexedValue, IDisposable } from "@bentley/bentleyjs-core";
>>>>>>>
import { assert, Id64, BeTimePoint, IndexedValue, IDisposable, dispose } from "@bentley/bentleyjs-core";
<<<<<<<
// Note: We assume the graphics array we get contains undisposed graphics to start
constructor(public graphics: RenderGraphic[], iModel: IModelConnection) { super(iModel); }
=======
constructor(public graphics: RenderGraphic[]) { super(); }
>>>>>>>
// Note: We assume the graphics array we get contains undisposed graphics to start
constructor(public graphics: RenderGraphic[]) { super(); } |
<<<<<<<
private static _uuidPattern = new RegExp("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$");
private static _hexChars = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
private static _v4VariantChars = ["8", "9", "a", "b"];
=======
private static uuidPattern = new RegExp("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$");
>>>>>>>
private static _uuidPattern = new RegExp("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$");
<<<<<<<
return [
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
"-",
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
"-",
"4",
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
"-",
Guid.randomCharFrom(Guid._v4VariantChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
"-",
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
Guid.randomCharFrom(Guid._hexChars),
].join("");
=======
// https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
const r = Math.random() * 16 | 0;
const v = c === "x" ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
>>>>>>>
// https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
const r = Math.random() * 16 | 0;
const v = c === "x" ? r : (r & 0x3 | 0x8);
return v.toString(16);
}); |
<<<<<<<
public readonly yAxisUp: boolean;
protected readonly _childIds: string[];
protected _childrenLastUsed: BeTimePoint;
protected _childrenLoadStatus: TileTree.LoadStatus;
protected _children?: Tile[];
protected _contentRange?: ElementAlignedBox3d;
protected _graphic?: RenderGraphic;
protected _rangeGraphic?: RenderGraphic;
=======
private readonly _childIds: string[];
private _childrenLastUsed: BeTimePoint;
private _childrenLoadStatus: TileTree.LoadStatus;
private _children?: Tile[];
private _contentRange?: ElementAlignedBox3d;
private _graphic?: RenderGraphic;
private _rangeGraphic?: RenderGraphic;
// ###TODO: Artificially limiting depth for now until tile selection is fixed...
>>>>>>>
protected readonly _childIds: string[];
protected _childrenLastUsed: BeTimePoint;
protected _childrenLoadStatus: TileTree.LoadStatus;
protected _children?: Tile[];
protected _contentRange?: ElementAlignedBox3d;
protected _graphic?: RenderGraphic;
protected _rangeGraphic?: RenderGraphic;
<<<<<<<
this.viewFlagOverrides = this.loader.viewFlagOverrides;
=======
this.isTerrain = props.isTerrain ? props.isTerrain : false;
this.yAxisUp = props.yAxisUp ? props.yAxisUp : false;
>>>>>>>
this.viewFlagOverrides = this.loader.viewFlagOverrides;
this.isTerrain = props.isTerrain ? props.isTerrain : false;
this.yAxisUp = props.yAxisUp ? props.yAxisUp : false;
<<<<<<<
public readonly clipVector?: ClipVector) { }
=======
public readonly yAxisUp?: boolean,
public readonly isTerrain?: boolean,
public readonly clipVector?: ClipVector,
public readonly viewFlagOverrides?: ViewFlag.Overrides) { }
>>>>>>>
public readonly yAxisUp?: boolean,
public readonly isTerrain?: boolean,
public readonly clipVector?: ClipVector) { } |
<<<<<<<
ViewStateProps, IModelCoordinatesResponseProps, GeoCoordinatesResponseProps, PageOptions, kPagingDefaultOptions, PageableECSql, RpcPendingResponse,
=======
ViewStateProps, IModelCoordinatesResponseProps, GeoCoordinatesResponseProps, QueryResponseStatus, QueryResponse, QueryPriority, QueryLimit, QueryQuota,
>>>>>>>
ViewStateProps, IModelCoordinatesResponseProps, GeoCoordinatesResponseProps, QueryResponseStatus, QueryResponse, QueryPriority, QueryLimit, QueryQuota, RpcPendingResponse, |
<<<<<<<
import { AccessToken } from "@bentley/imodeljs-clients";
import { BriefcaseToken, BriefcaseManager, KeepBriefcase } from "./backend/BriefcaseManager";
import { OpenMode } from "@bentley/bentleyjs-core/lib/BeSQLite";
import { ECSqlStatement } from "./backend/ECSqlStatement";
=======
import { BriefcaseToken, BriefcaseManager } from "./backend/BriefcaseManager";
>>>>>>>
import { BriefcaseToken, BriefcaseManager } from "./backend/BriefcaseManager";
import { ECSqlStatement } from "./backend/ECSqlStatement"; |
<<<<<<<
import { addClipping } from "./Clipping";
import { addHiliter } from "./FeatureSymbology";
=======
>>>>>>>
import { addHiliter } from "./FeatureSymbology";
<<<<<<<
export function createBuilder(clip: WithClipVolume): ProgramBuilder {
=======
export function createPointCloudBuilder(): ProgramBuilder {
>>>>>>>
function createBuilder(): ProgramBuilder { |
<<<<<<<
import { ClipVector, Transform } from "@bentley/geometry-core";
import { assert, Id64, IDisposable, dispose } from "@bentley/bentleyjs-core";
=======
import { ClipVector, Transform, Point2d, Range3d, Point3d } from "@bentley/geometry-core";
import { assert, Id64, IDisposable } from "@bentley/bentleyjs-core";
>>>>>>>
import { ClipVector, Transform, Point2d, Range3d, Point3d } from "@bentley/geometry-core";
import { assert, Id64, IDisposable, dispose } from "@bentley/bentleyjs-core";
<<<<<<<
public readonly iModel: IModelConnection;
constructor(iModel: IModelConnection) {
this.iModel = iModel;
}
=======
>>>>>>>
public readonly iModel: IModelConnection;
constructor(iModel: IModelConnection) {
this.iModel = iModel;
} |
<<<<<<<
const testIModelName: string = "assets/datasets/Properties_60InstancesWithUrl2.ibim";
=======
initialize();
const testIModelName: string = "assets/datasets/1K.bim";
>>>>>>>
initialize();
const testIModelName: string = "assets/datasets/Properties_60InstancesWithUrl2.ibim";
<<<<<<<
expect(row!.key.id.value).to.eq(new Id64(instances.physicalModel.id).value);
=======
const rowKey = instanceKeyFromJSON(JSON.parse(row!.key));
expect(rowKey.id.value).to.eq(new Id64(instances.functionalModel.id).value);
>>>>>>>
const rowKey = instanceKeyFromJSON(JSON.parse(row!.key));
expect(rowKey.id.value).to.eq(new Id64(instances.physicalModel.id).value); |
<<<<<<<
import { BackendIpc, BentleyStatus, HttpServerRequest, IModelError, IpcWebSocketBackend, MobileRpcConfiguration, MobileRpcGateway, MobileRpcProtocol, RpcMultipart, RpcSerializedValue } from "@bentley/imodeljs-common";
import * as ws from "ws";
import { MobileDevice } from "./MobileDevice";
=======
import { BentleyStatus, HttpServerRequest, IModelError, RpcMultipart, RpcSerializedValue } from "@bentley/imodeljs-common";
>>>>>>>
import { BentleyStatus, HttpServerRequest, IModelError, RpcMultipart, RpcSerializedValue } from "@bentley/imodeljs-common";
<<<<<<<
if (MobileRpcConfiguration.setup.checkPlatform()) {
setupMobileRpc();
BackendIpc.initialize(new IpcWebSocketBackend());
}
=======
>>>>>>>
BackendIpc.initialize(new IpcWebSocketBackend()); |
<<<<<<<
import { FeatureMode, WithClipVolume } from "../TechniqueFlags";
import { GLSLFragment, addWhiteOnWhiteReversal, addPickBufferOutputs } from "./Fragment";
=======
import { FeatureMode } from "../TechniqueFlags";
import { GLSLFragment, addWhiteOnWhiteReversal } from "./Fragment";
>>>>>>>
import { FeatureMode } from "../TechniqueFlags";
import { GLSLFragment, addWhiteOnWhiteReversal, addPickBufferOutputs } from "./Fragment"; |
<<<<<<<
import { AccessToken, Code as HubCode, CodeState, CodeQuery } from "@bentley/imodeljs-clients";
import { NativeBriefcaseManagerResourcesRequest } from "@bentley/imodeljs-native-platform-api";
=======
import { AccessToken, DeploymentEnv, Code as HubCode, IModelHubClient, CodeState, CodeQuery, AzureFileHandler } from "@bentley/imodeljs-clients";
import { NativeBriefcaseManagerResourcesRequest } from "./imodeljs-native-platform-api";
>>>>>>>
import { AccessToken, Code as HubCode, CodeState, CodeQuery } from "@bentley/imodeljs-clients";
import { NativeBriefcaseManagerResourcesRequest } from ./imodeljs-native-platform-api";
<<<<<<<
=======
private getDeploymentEnv(): DeploymentEnv { return IModelHost.configuration!.hubDeploymentEnv; }
private getIModelHubClient(): IModelHubClient { return new IModelHubClient(this.getDeploymentEnv(), new AzureFileHandler()); }
>>>>>>> |
<<<<<<<
import { BriefcaseManager, KeepBriefcase } from "./BriefcaseManager";
import { IModelError, IModelStatus } from "../IModelError";
=======
import { BriefcaseManager, BriefcaseToken, KeepBriefcase } from "./BriefcaseManager";
>>>>>>>
import { BriefcaseManager, BriefcaseToken, KeepBriefcase } from "./BriefcaseManager";
<<<<<<<
private statementCache: ECSqlStatementCache = new ECSqlStatementCache();
private _maxStatementCacheCount = 20;
=======
private static _openDbMap: Map<string, IModelDb> = new Map<string, IModelDb>();
>>>>>>>
private statementCache: ECSqlStatementCache = new ECSqlStatementCache();
private _maxStatementCacheCount = 20;
private static _openDbMap: Map<string, IModelDb> = new Map<string, IModelDb>(); |
<<<<<<<
private _skipAttachments = true; // ###TODO: Remove after merge - bug fixed on master
=======
public static get className() { return "SheetViewDefinition"; }
public readonly sheetSize: Point2d;
private _attachmentIds: Id64Array;
private _attachments = new Attachments.AttachmentList();
private all3dAttachmentTilesLoaded: boolean = true;
public getExtentLimits() { return { min: Constant.oneMillimeter, max: this.sheetSize.magnitude() * 10 }; }
/** Manually mark this SheetViewState as having to re-create its scene due to incomplete 3d attachments. Called from attachment tile "select" methods. */
public markAttachment3dSceneIncomplete() { this.all3dAttachmentTilesLoaded = false; }
>>>>>>>
public static get className() { return "SheetViewDefinition"; }
public readonly sheetSize: Point2d;
private _attachmentIds: Id64Array;
private _attachments = new Attachments.AttachmentList();
private all3dAttachmentTilesLoaded: boolean = true;
public getExtentLimits() { return { min: Constant.oneMillimeter, max: this.sheetSize.magnitude() * 10 }; }
/** Manually mark this SheetViewState as having to re-create its scene due to incomplete 3d attachments. Called from attachment tile "select" methods. */
public markAttachment3dSceneIncomplete() { this.all3dAttachmentTilesLoaded = false; }
<<<<<<<
const border = Sheet.Border.create(width, height, this._pickableBorder ? undefined : viewContext);
const builder: GraphicBuilder = this._pickableBorder ? viewContext.createPickableDecoration(new Id64("0xffffff0000000001")) : viewContext.createViewBackground();
=======
const border = SheetBorder.create(width, height, viewContext);
const builder: GraphicBuilder = viewContext.createViewBackground();
>>>>>>>
const border = SheetBorder.create(width, height, this._pickableBorder ? undefined : viewContext);
const builder: GraphicBuilder = this._pickableBorder ? viewContext.createPickableDecoration(new Id64("0xffffff0000000001")) : viewContext.createViewBackground(); |
<<<<<<<
public abstract changeScene(scene: GraphicList, activeVolume?: RenderClipVolume): void;
=======
public abstract changeScene(scene: GraphicList, activeVolume?: ClipVector): void;
public abstract changeTerrain(_scene: GraphicList): void;
>>>>>>>
public abstract changeScene(scene: GraphicList, activeVolume?: RenderClipVolume): void;
public abstract changeTerrain(_scene: GraphicList): void; |
<<<<<<<
const channelInfo = yield getChannelInfo(action.channelId);
return jrs.success(action.id, {...channelInfo});
=======
const {channelId} = action;
const channelStatus: ChannelState = yield select(getChannelStatus, channelId);
const state = getLastState(channelStatus);
const {participants} = channelStatus;
const {appData, appDefinition, turnNum} = state;
const funding = [];
const status = "Opening";
return jrs.success(action.id, {
participants,
allocations: createJsonRpcAllocationsFromOutcome(state.outcome),
appDefinition,
appData,
status,
funding,
turnNum,
channelId
});
case "WALLET.UPDATE_CHANNEL_RESPONSE":
return jrs.success(action.id, action.state);
>>>>>>>
const channelInfo = yield getChannelInfo(action.channelId);
return jrs.success(action.id, {...channelInfo});
case "WALLET.UPDATE_CHANNEL_RESPONSE":
return jrs.success(action.id, action.state);
<<<<<<<
case "WALLET.SEND_CHANNEL_PROPOSED_MESSAGE":
const channelStatus: ChannelState = yield select(getChannelStatus, action.channelId);
const request = {
type: "Channel.Open",
signedState: channelStatus.signedStates.slice(-1)[0],
participants: channelStatus.participants
};
return jrs.notification("MessageQueued", {
recipient: action.fromParticipantId,
sender: action.toParticipantId,
data: request
});
case "WALLET.CHANNEL_PROPOSED_EVENT":
return jrs.notification("ChannelProposed", yield getChannelInfo(action.channelId));
case "WALLET.POST_MESSAGE_RESPONSE":
return jrs.success(action.id, {success: true});
=======
case "WALLET.UNKNOWN_CHANNEL_ID_ERROR":
return jrs.error(
action.id,
new jrs.JsonRpcError(
"The wallet can't find the channel corresponding to the channelId",
1000
)
);
>>>>>>>
case "WALLET.SEND_CHANNEL_PROPOSED_MESSAGE":
const channelStatus: ChannelState = yield select(getChannelStatus, action.channelId);
const request = {
type: "Channel.Open",
signedState: channelStatus.signedStates.slice(-1)[0],
participants: channelStatus.participants
};
return jrs.notification("MessageQueued", {
recipient: action.fromParticipantId,
sender: action.toParticipantId,
data: request
});
case "WALLET.CHANNEL_PROPOSED_EVENT":
return jrs.notification("ChannelProposed", yield getChannelInfo(action.channelId));
case "WALLET.POST_MESSAGE_RESPONSE":
return jrs.success(action.id, {success: true});
case "WALLET.UNKNOWN_CHANNEL_ID_ERROR":
return jrs.error(
action.id,
new jrs.JsonRpcError(
"The wallet can't find the channel corresponding to the channelId",
1000
)
); |
<<<<<<<
import { Id64Array, Id64String, Id64 } from "@bentley/bentleyjs-core";
import { BisCodeSpec, CategoryProps, CategorySelectorProps, ColorDef, CreateIModelProps, DefinitionElementProps, InformationPartitionElementProps, ModelSelectorProps, SubCategoryAppearance, SpatialViewDefinitionProps, ViewFlags, AnalysisStyleProps } from "@bentley/imodeljs-common";
import { SpatialCategory } from "./Category";
import { DefinitionPartition, PhysicalPartition } from "./Element";
=======
import { Id64, Id64Array, Id64String } from "@bentley/bentleyjs-core";
import { BisCodeSpec, CodeSpec, CodeScopeSpec, CategoryProps, CategorySelectorProps, ColorDef, CreateIModelProps, DisplayStyleProps, ElementProps, IModel, InformationPartitionElementProps, ModelSelectorProps, RelatedElement, SubCategoryAppearance, ViewFlags } from "@bentley/imodeljs-common";
import { DrawingCategory, SpatialCategory } from "./Category";
import { DefinitionPartition, DocumentPartition, Drawing, PhysicalPartition } from "./Element";
>>>>>>>
import { Id64, Id64Array, Id64String } from "@bentley/bentleyjs-core";
import { BisCodeSpec, CodeSpec, CodeScopeSpec, CategoryProps, CategorySelectorProps, ColorDef, CreateIModelProps, DisplayStyleProps, ElementProps, IModel, InformationPartitionElementProps, ModelSelectorProps, RelatedElement, SubCategoryAppearance, ViewFlags, AnalysisStyleProps, DefinitionElementProps, SpatialViewDefinitionProps } from "@bentley/imodeljs-common";
import { DrawingCategory, SpatialCategory } from "./Category";
import { DefinitionPartition, DocumentPartition, Drawing, PhysicalPartition } from "./Element";
<<<<<<<
import { DefinitionModel, PhysicalModel } from "./Model";
import { CategorySelector, DisplayStyle3d, ModelSelector, ViewDefinition, OrthographicViewDefinition } from "./ViewDefinition";
import { Matrix3d, Transform, StandardViewIndex, YawPitchRollAngles, Range3d } from "@bentley/geometry-core";
=======
import { ElementRefersToElements } from "./LinkTableRelationship";
import { DefinitionModel, DocumentListModel, DrawingModel, PhysicalModel } from "./Model";
import { CategorySelector, DisplayStyle2d, DisplayStyle3d, ModelSelector } from "./ViewDefinition";
>>>>>>>
import { ElementRefersToElements } from "./LinkTableRelationship";
import { DefinitionModel, DocumentListModel, DrawingModel, PhysicalModel } from "./Model";
import { CategorySelector, DisplayStyle2d, DisplayStyle3d, ModelSelector, ViewDefinition, OrthographicViewDefinition } from "./ViewDefinition";
import { Range3d, StandardViewIndex, Matrix3d, YawPitchRollAngles, Transform } from "@bentley/geometry-core";
<<<<<<<
public insertDisplayStyle3d(definitionModelId: Id64String, name: string, viewFlagsIn?: ViewFlags, backgroundColor?: ColorDef, analysisStyle?: AnalysisStyleProps): Id64String {
const stylesIn: { [k: string]: any } = { viewflags: viewFlagsIn ? viewFlagsIn : new ViewFlags() };
if (analysisStyle)
stylesIn.analysisStyle = analysisStyle;
if (backgroundColor)
stylesIn.backgroundColor = backgroundColor;
const displayStyleProps: DefinitionElementProps = {
=======
public insertDisplayStyle3d(definitionModelId: Id64String, name: string): Id64String {
const displayStyleProps: DisplayStyleProps = {
>>>>>>>
public insertDisplayStyle3d(definitionModelId: Id64String, name: string, viewFlagsIn?: ViewFlags, backgroundColor?: ColorDef, analysisStyle?: AnalysisStyleProps): Id64String {
const stylesIn: { [k: string]: any } = { viewflags: viewFlagsIn ? viewFlagsIn : new ViewFlags() };
if (analysisStyle)
stylesIn.analysisStyle = analysisStyle;
if (backgroundColor)
stylesIn.backgroundColor = backgroundColor;
const displayStyleProps: DefinitionElementProps = {
<<<<<<<
public createOrthographicView(viewName: string, definitionModelId: Id64String, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso): Id64String {
const rotation = Matrix3d.createStandardWorldToView(standardView);
const angles = YawPitchRollAngles.createFromMatrix3d(rotation);
const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);
const rotatedRange = rotationTransform.multiplyRange(range);
const viewOrigin = rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z);
const viewExtents = rotatedRange.diagonal();
const viewDefinitionProps: SpatialViewDefinitionProps = {
classFullName: OrthographicViewDefinition.classFullName,
model: IModelDb.dictionaryId,
code: ViewDefinition.createCode(this.iModelDb, definitionModelId, viewName),
modelSelectorId,
categorySelectorId,
displayStyleId,
origin: viewOrigin,
extents: viewExtents,
angles,
cameraOn: false,
camera: { eye: [0, 0, 0], lens: 0, focusDist: 0 }, // not used when cameraOn === false
};
return this.iModelDb.elements.insertElement(viewDefinitionProps);
}
public setDefaultViewId(viewId: Id64String) {
const spec = { namespace: "dgn_View", name: "DefaultView" };
const blob32 = new Uint32Array(2);
blob32[0] = Id64.getLowerUint32(viewId);
blob32[1] = Id64.getUpperUint32(viewId);
const blob8 = new Uint8Array(blob32.buffer);
this.iModelDb.saveFileProperty(spec, undefined, blob8);
}
=======
/**
* Insert a DocumentListModel
* @param parentSubjectId The DocumentPartition will be inserted as a child of this Subject element.
* @param name The name of the DocumentPartition that the new DocumentListModel will break down.
* @returns The Id of the newly inserted DocumentListModel.
*/
public insertDocumentListModel(parentSubjectId: Id64String, name: string): Id64String {
const partitionProps: InformationPartitionElementProps = {
classFullName: DocumentPartition.classFullName,
model: IModel.repositoryModelId,
parent: this.createParentRelationship(parentSubjectId, "BisCore:SubjectOwnsPartitionElements"),
code: DocumentPartition.createCode(this.iModelDb, parentSubjectId, name),
};
const partitionId: Id64String = this.iModelDb.elements.insertElement(partitionProps);
const model: DocumentListModel = this.iModelDb.models.createModel({
classFullName: DocumentListModel.classFullName,
modeledElement: { id: partitionId },
}) as DocumentListModel;
return this.iModelDb.models.insertModel(model);
}
/**
* Insert a Drawing element and a DrawingModel that breaks it down.
* @param documentListModelId Insert the new Drawing into this DocumentListModel
* @param name The name of the Drawing.
* @returns The Id of the newly inserted Drawing element and the DrawingModel that breaks it down (same value).
*/
public insertDrawing(documentListModelId: Id64String, name: string): Id64String {
const drawingProps: ElementProps = {
classFullName: Drawing.classFullName,
model: documentListModelId,
code: Drawing.createCode(this.iModelDb, documentListModelId, name),
};
const drawingId: Id64String = this.iModelDb.elements.insertElement(drawingProps);
const model: DrawingModel = this.iModelDb.models.createModel({
classFullName: DrawingModel.classFullName,
modeledElement: { id: drawingId },
}) as DrawingModel;
return this.iModelDb.models.insertModel(model);
}
/**
* Insert a relationship between a DrawingGraphic and the Element that it represents.
* @param drawingGraphicId The Id of the DrawingGraphic
* @param elementId the Id of the Element that the DrawingGraphic represents
* @returns The Id of the newly inserted LinkTableRelationship instance.
*/
public insertDrawingGraphicRepresentsElement(drawingGraphicId: Id64String, elementId: Id64String): Id64String {
return this.iModelDb.linkTableRelationships.insertInstance(
ElementRefersToElements.create(this.iModelDb, drawingGraphicId, elementId, "BisCore:DrawingGraphicRepresentsElement"),
);
}
>>>>>>>
public createOrthographicView(viewName: string, definitionModelId: Id64String, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso): Id64String {
const rotation = Matrix3d.createStandardWorldToView(standardView);
const angles = YawPitchRollAngles.createFromMatrix3d(rotation);
const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);
const rotatedRange = rotationTransform.multiplyRange(range);
const viewOrigin = rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z);
const viewExtents = rotatedRange.diagonal();
const viewDefinitionProps: SpatialViewDefinitionProps = {
classFullName: OrthographicViewDefinition.classFullName,
model: IModelDb.dictionaryId,
code: ViewDefinition.createCode(this.iModelDb, definitionModelId, viewName),
modelSelectorId,
categorySelectorId,
displayStyleId,
origin: viewOrigin,
extents: viewExtents,
angles,
cameraOn: false,
camera: { eye: [0, 0, 0], lens: 0, focusDist: 0 }, // not used when cameraOn === false
};
return this.iModelDb.elements.insertElement(viewDefinitionProps);
}
public setDefaultViewId(viewId: Id64String) {
const spec = { namespace: "dgn_View", name: "DefaultView" };
const blob32 = new Uint32Array(2);
blob32[0] = Id64.getLowerUint32(viewId);
blob32[1] = Id64.getUpperUint32(viewId);
const blob8 = new Uint8Array(blob32.buffer);
this.iModelDb.saveFileProperty(spec, undefined, blob8);
}
/**
* Insert a DocumentListModel
* @param parentSubjectId The DocumentPartition will be inserted as a child of this Subject element.
* @param name The name of the DocumentPartition that the new DocumentListModel will break down.
* @returns The Id of the newly inserted DocumentListModel.
*/
public insertDocumentListModel(parentSubjectId: Id64String, name: string): Id64String {
const partitionProps: InformationPartitionElementProps = {
classFullName: DocumentPartition.classFullName,
model: IModel.repositoryModelId,
parent: this.createParentRelationship(parentSubjectId, "BisCore:SubjectOwnsPartitionElements"),
code: DocumentPartition.createCode(this.iModelDb, parentSubjectId, name),
};
const partitionId: Id64String = this.iModelDb.elements.insertElement(partitionProps);
const model: DocumentListModel = this.iModelDb.models.createModel({
classFullName: DocumentListModel.classFullName,
modeledElement: { id: partitionId },
}) as DocumentListModel;
return this.iModelDb.models.insertModel(model);
}
/**
* Insert a Drawing element and a DrawingModel that breaks it down.
* @param documentListModelId Insert the new Drawing into this DocumentListModel
* @param name The name of the Drawing.
* @returns The Id of the newly inserted Drawing element and the DrawingModel that breaks it down (same value).
*/
public insertDrawing(documentListModelId: Id64String, name: string): Id64String {
const drawingProps: ElementProps = {
classFullName: Drawing.classFullName,
model: documentListModelId,
code: Drawing.createCode(this.iModelDb, documentListModelId, name),
};
const drawingId: Id64String = this.iModelDb.elements.insertElement(drawingProps);
const model: DrawingModel = this.iModelDb.models.createModel({
classFullName: DrawingModel.classFullName,
modeledElement: { id: drawingId },
}) as DrawingModel;
return this.iModelDb.models.insertModel(model);
}
/**
* Insert a relationship between a DrawingGraphic and the Element that it represents.
* @param drawingGraphicId The Id of the DrawingGraphic
* @param elementId the Id of the Element that the DrawingGraphic represents
* @returns The Id of the newly inserted LinkTableRelationship instance.
*/
public insertDrawingGraphicRepresentsElement(drawingGraphicId: Id64String, elementId: Id64String): Id64String {
return this.iModelDb.linkTableRelationships.insertInstance(
ElementRefersToElements.create(this.iModelDb, drawingGraphicId, elementId, "BisCore:DrawingGraphicRepresentsElement"),
);
} |
<<<<<<<
=======
import { ElementPropertyFormatter } from "../ElementPropertyFormatter";
>>>>>>>
import { ElementPropertyFormatter } from "../ElementPropertyFormatter";
<<<<<<<
=======
it("ElementPropertyFormatter should format", async () => {
const elements: Elements = imodel.elements;
const code1 = new Code({ spec: "0x10", scope: "0x11", value: "RF1.dgn" });
const el = await elements.getElement(code1);
const formatter: ElementPropertyFormatter = new ElementPropertyFormatter(imodel);
const props = await formatter.formatProperties(el);
assert.exists(props);
// WIP: format seems to have changed?
// assert.isArray(props);
// assert.notEqual(props.length, 0);
// const item = props[0];
// assert.isString(item.category);
// assert.isArray(item.properties);
});
});
describe("Views", () => {
>>>>>>>
it("ElementPropertyFormatter should format", async () => {
const elements: Elements = imodel.elements;
const code1 = new Code({ spec: "0x10", scope: "0x11", value: "RF1.dgn" });
const el = await elements.getElement(code1);
const formatter: ElementPropertyFormatter = new ElementPropertyFormatter(imodel);
const props = await formatter.formatProperties(el);
assert.exists(props);
// WIP: format seems to have changed?
// assert.isArray(props);
// assert.notEqual(props.length, 0);
// const item = props[0];
// assert.isString(item.category);
// assert.isArray(item.properties);
}); |
<<<<<<<
public addMacro(macro: string): void {
if (-1 === this._macros.indexOf(macro))
this._macros.push(macro);
}
=======
protected buildPreludeCommon(attrMap: Map<string, AttributeDetails> | undefined, isFrag: boolean = false, isLit: boolean = false, maxClippingPlanes: number = 0): SourceBuilder {
const src = new SourceBuilder();
>>>>>>>
public addMacro(macro: string): void {
if (-1 === this._macros.indexOf(macro))
this._macros.push(macro);
}
<<<<<<<
=======
// Attribute declarations
if (attrMap !== undefined) {
attrMap.forEach((attr: AttributeDetails, key: string) => {
src.addline("attribute " + Convert.typeToString(attr.type) + " " + key + ";");
});
}
if (!isFrag) {
src.addline("#define MAT_NORM g_nmx");
if (!this.usesInstancedGeometry) {
src.addline("#define MAT_MV u_mv");
src.addline("#define MAT_MVP u_mvp");
src.addline("#define MAT_MODEL u_modelMatrix");
} else {
src.addline("#define MAT_MV g_mv");
src.addline("#define MAT_MVP g_mvp");
src.addline("#define MAT_MODEL g_instancedModelMatrix");
}
} else {
src.addline("#define FragColor gl_FragColor");
if (needMultiDrawBuffers) {
src.addline("#define FragColor0 gl_FragData[0]");
src.addline("#define FragColor1 gl_FragData[1]");
src.addline("#define FragColor2 gl_FragData[2]");
src.addline("#define FragColor3 gl_FragData[3]");
}
if (isLit) {
// ###TODO: Source Lighting
}
}
>>>>>>>
// Attribute declarations
if (attrMap !== undefined) {
attrMap.forEach((attr: AttributeDetails, key: string) => {
src.addline("attribute " + Convert.typeToString(attr.type) + " " + key + ";");
});
}
<<<<<<<
const prelude = this.buildPrelude();
=======
const prelude = this.buildPrelude(undefined, undefined !== applyLighting);
>>>>>>>
const prelude = this.buildPrelude(undefined);
<<<<<<<
const clone = new ProgramBuilder(this._flags);
clone.vert.copyFrom(this.vert);
clone.frag.copyFrom(this.frag);
=======
const clone = new ProgramBuilder(this._attrMap, this._flags);
// Copy from vertex builder
clone.vert.headerComment = this.vert.headerComment;
for (let i = 0; i < this.vert.computedVarying.length; i++)
clone.vert.computedVarying[i] = this.vert.computedVarying[i];
for (let i = 0; i < this.vert.initializers.length; i++)
clone.vert.initializers[i] = this.vert.initializers[i];
for (let i = 0; i < this.vert.components.length; i++)
clone.vert.components[i] = this.vert.components[i];
for (let i = 0; i < this.vert.functions.length; i++)
clone.vert.functions[i] = this.vert.functions[i];
for (let i = 0; i < this.vert.extensions.length; i++)
clone.vert.extensions[i] = this.vert.extensions[i];
for (let i = 0; i < this.vert.list.length; i++)
clone.vert.list[i] = this.vert.list[i];
// Copy from fragment builder
clone.frag.headerComment = this.frag.headerComment;
clone.frag.maxClippingPlanes = this.frag.maxClippingPlanes;
for (let i = 0; i < this.frag.components.length; i++)
clone.frag.components[i] = this.frag.components[i];
for (let i = 0; i < this.frag.functions.length; i++)
clone.frag.functions[i] = this.frag.functions[i];
for (let i = 0; i < this.frag.extensions.length; i++)
clone.frag.extensions[i] = this.frag.extensions[i];
for (let i = 0; i < this.frag.list.length; i++)
clone.frag.list[i] = this.frag.list[i];
>>>>>>>
const clone = new ProgramBuilder(this._attrMap, this._flags);
clone.vert.copyFrom(this.vert);
clone.frag.copyFrom(this.frag); |
<<<<<<<
import { IModelApp, IModelConnection, ViewState, Viewport, StandardViewId, ViewState3d, SpatialViewState, SpatialModelState, AccuDraw, PrimitiveTool, SnapMode, AccuSnap, NotificationManager, ToolTipOptions, NotifyMessageDetails } from "@bentley/imodeljs-frontend";
import { Target, FeatureSymbology } from "@bentley/imodeljs-frontend/lib/rendering";
=======
import { IModelApp, IModelConnection, ViewState, Viewport, StandardViewId, ViewState3d, SpatialViewState, SpatialModelState, AccuDraw, PrimitiveTool, SnapMode, AccuSnap } from "@bentley/imodeljs-frontend/lib/frontend";
import { Target, FeatureSymbology, PerformanceMetrics } from "@bentley/imodeljs-frontend/lib/rendering";
>>>>>>>
import { IModelApp, IModelConnection, ViewState, Viewport, StandardViewId, ViewState3d, SpatialViewState, SpatialModelState, AccuDraw, PrimitiveTool, SnapMode, AccuSnap, NotificationManager, ToolTipOptions, NotifyMessageDetails } from "@bentley/imodeljs-frontend";
import { Target, FeatureSymbology, PerformanceMetrics } from "@bentley/imodeljs-frontend/lib/rendering";
<<<<<<<
if (document.getElementById("showfps")) document.getElementById("showfps")!.innerHTML =
"Avg. FPS: " + (perfMet.spfTimes.length / perfMet.spfSum).toFixed(2)
=======
if (document.getElementById("showfps") && perfMet) document.getElementById("showfps")!.innerHTML =
"Avg. FPS (ms): " + (perfMet.spfTimes.length / perfMet.spfSum).toFixed(2)
>>>>>>>
if (document.getElementById("showfps") && perfMet) document.getElementById("showfps")!.innerHTML =
"Avg. FPS: " + (perfMet.spfTimes.length / perfMet.spfSum).toFixed(2) |
<<<<<<<
import { createPointCloudBuilder, createPointCloudHiliter } from "./glsl/PointCloud";
import { addElementId, addFeatureSymbology, addRenderOrder, computeElementId, computeUniformElementId, computeEyeSpace, FeatureSymbologyOptions } from "./glsl/FeatureSymbology";
import { GLSLFragment } from "./glsl/Fragment";
import { GLSLDecode } from "./glsl/Decode";
=======
import { createPointCloudBuilder } from "./glsl/PointCloud";
import { addElementId, addFeatureSymbology, addRenderOrder, computeElementId, computeEyeSpace, FeatureSymbologyOptions } from "./glsl/FeatureSymbology";
import { GLSLFragment, addPickBufferOutputs } from "./glsl/Fragment";
>>>>>>>
import { createPointCloudBuilder, createPointCloudHiliter } from "./glsl/PointCloud";
import { addElementId, addFeatureSymbology, addRenderOrder, computeElementId, computeUniformElementId, computeEyeSpace, FeatureSymbologyOptions } from "./glsl/FeatureSymbology";
import { GLSLFragment, addPickBufferOutputs } from "./glsl/Fragment";
<<<<<<<
addElementId(builder, alwaysUniform);
frag.addDrawBuffersExtension();
frag.addFunction(GLSLDecode.encodeDepthRgb);
frag.addFunction(GLSLFragment.computeLinearDepth);
frag.set(FragmentShaderComponent.AssignFragData, GLSLFragment.assignFragData);
=======
addElementId(builder);
addPickBufferOutputs(frag);
>>>>>>>
addElementId(builder, alwaysUniform);
addPickBufferOutputs(frag);
<<<<<<<
if (flags.hasClipVolume)
=======
let index = PointCloudTechnique.kOpaque;
if (flags.hasClip) {
>>>>>>>
if (flags.hasClip) { |
<<<<<<<
import { OpenMode, DbResult, Id64 } from "@bentley/bentleyjs-core";
import { AccessToken, ConnectClient, IModelHubClient, Project, IModelQuery, ChangeSet } from "@bentley/imodeljs-clients";
=======
import { OpenMode, DbResult, Id64, PerfLogger } from "@bentley/bentleyjs-core";
import { AccessToken, ChangeSet } from "@bentley/imodeljs-clients";
>>>>>>>
import { OpenMode, DbResult, Id64, PerfLogger } from "@bentley/bentleyjs-core";
import { AccessToken, ConnectClient, IModelHubClient, Project, IModelQuery, ChangeSet } from "@bentley/imodeljs-clients";
<<<<<<<
if (offline) {
console.log(" Setting up mock objects..."); // tslint:disable-line:no-console
cacheDir = path.normalize(path.join(KnownLocations.tmpdir, "Bentley/IModelJs/testCache/iModels/"));
IModelHost.configuration!.briefcaseCacheDir = cacheDir;
MockAssetUtil.setupConnectClientMock(connectClientMock, assetDir);
MockAssetUtil.setupIModelHubClientMock(iModelHubClientMock, assetDir);
(BriefcaseManager as any).hubClient = iModelHubClientMock.object;
// Get test projectId from the mocked connection client
const project: Project = await connectClientMock.object.getProject(accessToken as any, {
$select: "*",
$filter: "Name+eq+'NodeJstestproject'",
});
assert(project && project.wsgId, "No projectId returned from connectionClient mock");
testProjectId = project.wsgId;
// Get test iModelIds from the mocked iModelHub client
for (const iModelInfo of testIModels) {
const iModels = await iModelHubClientMock.object.IModels().get(accessToken as any, testProjectId, new IModelQuery().byName(iModelInfo.name));
assert(iModels.length > 0, `No IModels returned from iModelHubClient mock for ${iModelInfo.name} iModel`);
assert(iModels[0].wsgId, `No IModelId returned for ${iModelInfo.name} iModel`);
iModelInfo.id = iModels[0].wsgId;
iModelInfo.localReadonlyPath = path.join(cacheDir, iModelInfo.id, "readOnly");
iModelInfo.localReadWritePath = path.join(cacheDir, iModelInfo.id, "readWrite");
// getChangeSets
iModelInfo.changeSets = await iModelHubClientMock.object.ChangeSets().get(accessToken as any, iModelInfo.id);
iModelInfo.changeSets.shift(); // The first change set is a schema change that was not named
expect(iModelInfo.changeSets);
// downloadChangeSets
const csetDir = path.join(cacheDir, iModelInfo.id, "csets");
await iModelHubClientMock.object.ChangeSets().download(iModelInfo.changeSets, csetDir);
}
MockAssetUtil.verifyIModelInfo(testIModels);
console.log(` ...getting information on Project+IModel+ChangeSets for test case from mock data: ${new Date().getTime() - startTime} ms`); // tslint:disable-line:no-console
} else {
cacheDir = IModelHost.configuration!.briefcaseCacheDir;
accessToken = await IModelTestUtils.getTestUserAccessToken();
console.log(` ...getting user access token from IMS: ${new Date().getTime() - startTime} ms`); // tslint:disable-line:no-console
startTime = new Date().getTime();
testProjectId = await HubTestUtils.queryProjectIdByName(accessToken, TestConfig.projectName);
for (const iModelInfo of testIModels) {
iModelInfo.id = await HubTestUtils.queryIModelIdByName(accessToken, testProjectId, iModelInfo.name);
iModelInfo.localReadonlyPath = path.join(cacheDir, iModelInfo.id, "readOnly");
iModelInfo.localReadWritePath = path.join(cacheDir, iModelInfo.id, "readWrite");
iModelInfo.changeSets = await HubTestUtils.hubClient!.ChangeSets().get(accessToken, iModelInfo.id);
iModelInfo.changeSets.shift(); // The first change set is a schema change that was not named
iModelInfo.localReadonlyPath = path.join(cacheDir, iModelInfo.id, "readOnly");
iModelInfo.localReadWritePath = path.join(cacheDir, iModelInfo.id, "readWrite");
}
// Delete briefcases if the cache has been cleared, *and* we cannot acquire any more briefcases
await HubTestUtils.deleteBriefcasesIfAcquireLimitReached(accessToken, TestConfig.projectName, TestConfig.iModelName);
await HubTestUtils.deleteBriefcasesIfAcquireLimitReached(accessToken, TestConfig.projectName, "NoVersionsTest");
console.log(` ...getting information on Project+IModel+ChangeSets for test case from the Hub: ${new Date().getTime() - startTime} ms`); // tslint:disable-line:no-console
}
=======
// Delete briefcases if the cache has been cleared, *and* we cannot acquire any more briefcases
await HubTestUtils.purgeAcquiredBriefcases(accessToken, TestConfig.projectName, TestConfig.iModelName);
await HubTestUtils.purgeAcquiredBriefcases(accessToken, TestConfig.projectName, "NoVersionsTest");
>>>>>>>
if (offline) {
console.log(" Setting up mock objects..."); // tslint:disable-line:no-console
cacheDir = path.normalize(path.join(KnownLocations.tmpdir, "Bentley/IModelJs/testCache/iModels/"));
IModelHost.configuration!.briefcaseCacheDir = cacheDir;
MockAssetUtil.setupConnectClientMock(connectClientMock, assetDir);
MockAssetUtil.setupIModelHubClientMock(iModelHubClientMock, assetDir);
(BriefcaseManager as any).hubClient = iModelHubClientMock.object;
// Get test projectId from the mocked connection client
const project: Project = await connectClientMock.object.getProject(accessToken as any, {
$select: "*",
$filter: "Name+eq+'NodeJstestproject'",
});
assert(project && project.wsgId, "No projectId returned from connectionClient mock");
testProjectId = project.wsgId;
// Get test iModelIds from the mocked iModelHub client
for (const iModelInfo of testIModels) {
const iModels = await iModelHubClientMock.object.IModels().get(accessToken as any, testProjectId, new IModelQuery().byName(iModelInfo.name));
assert(iModels.length > 0, `No IModels returned from iModelHubClient mock for ${iModelInfo.name} iModel`);
assert(iModels[0].wsgId, `No IModelId returned for ${iModelInfo.name} iModel`);
iModelInfo.id = iModels[0].wsgId;
iModelInfo.localReadonlyPath = path.join(cacheDir, iModelInfo.id, "readOnly");
iModelInfo.localReadWritePath = path.join(cacheDir, iModelInfo.id, "readWrite");
// getChangeSets
iModelInfo.changeSets = await iModelHubClientMock.object.ChangeSets().get(accessToken as any, iModelInfo.id);
iModelInfo.changeSets.shift(); // The first change set is a schema change that was not named
expect(iModelInfo.changeSets);
// downloadChangeSets
const csetDir = path.join(cacheDir, iModelInfo.id, "csets");
await iModelHubClientMock.object.ChangeSets().download(iModelInfo.changeSets, csetDir);
}
MockAssetUtil.verifyIModelInfo(testIModels);
console.log(` ...getting information on Project+IModel+ChangeSets for test case from mock data: ${new Date().getTime() - startTime} ms`); // tslint:disable-line:no-console
} else {
cacheDir = IModelHost.configuration!.briefcaseCacheDir;
accessToken = await IModelTestUtils.getTestUserAccessToken();
console.log(` ...getting user access token from IMS: ${new Date().getTime() - startTime} ms`); // tslint:disable-line:no-console
startTime = new Date().getTime();
testProjectId = await HubTestUtils.queryProjectIdByName(accessToken, TestConfig.projectName);
for (const iModelInfo of testIModels) {
iModelInfo.id = await HubTestUtils.queryIModelIdByName(accessToken, testProjectId, iModelInfo.name);
iModelInfo.localReadonlyPath = path.join(cacheDir, iModelInfo.id, "readOnly");
iModelInfo.localReadWritePath = path.join(cacheDir, iModelInfo.id, "readWrite");
iModelInfo.changeSets = await HubTestUtils.hubClient!.ChangeSets().get(accessToken, iModelInfo.id);
iModelInfo.changeSets.shift(); // The first change set is a schema change that was not named
iModelInfo.localReadonlyPath = path.join(cacheDir, iModelInfo.id, "readOnly");
iModelInfo.localReadWritePath = path.join(cacheDir, iModelInfo.id, "readWrite");
}
// Delete briefcases if the cache has been cleared, *and* we cannot acquire any more briefcases
await HubTestUtils.purgeAcquiredBriefcases(accessToken, TestConfig.projectName, TestConfig.iModelName);
await HubTestUtils.purgeAcquiredBriefcases(accessToken, TestConfig.projectName, "NoVersionsTest");
console.log(` ...getting information on Project+IModel+ChangeSets for test case from the Hub: ${new Date().getTime() - startTime} ms`); // tslint:disable-line:no-console
}
<<<<<<<
it.skip("Query ChangeSummary content", async () => {
const iModel: IModelDb = await IModelDb.open(accessToken, testProjectId, testIModels[0].id, OpenMode.ReadWrite, IModelVersion.latest());
=======
it("Query ChangeSummary content", async () => {
// accessToken = await IModelTestUtils.getTestUserAccessToken(TestUsers.user1);
// const iModel: IModelDb = await IModelDb.open(accessToken, "d46de192-6cad-4086-b968-71b517edc215", "a237be2f-7a59-4f40-a0bd-14bf9c0634f1", OpenMode.ReadWrite, IModelVersion.latest());
const iModel: IModelDb = await IModelDb.open(accessToken, testProjectId, testIModelId, OpenMode.ReadWrite, IModelVersion.latest());
>>>>>>>
it.skip("Query ChangeSummary content", async () => {
const iModel: IModelDb = await IModelDb.open(accessToken, testProjectId, testIModels[0].id, OpenMode.ReadWrite, IModelVersion.latest()); |
<<<<<<<
import { ClientRequestContext, Id64String, Logger } from "@bentley/bentleyjs-core";
import { IModelDb } from "@bentley/imodeljs-backend";
import { IModelRpcProps } from "@bentley/imodeljs-common";
import {
ContentJSON, ContentRpcRequestOptions, Descriptor, DescriptorJSON, DescriptorOverrides, HierarchyRpcRequestOptions, InstanceKey, InstanceKeyJSON,
KeySet, KeySetJSON, LabelDefinition, LabelDefinitionJSON, LabelRpcRequestOptions, Node, NodeJSON, NodeKey, NodeKeyJSON, NodePathElement,
NodePathElementJSON, Paged, PartialHierarchyModification, PartialHierarchyModificationJSON, PresentationDataCompareRpcOptions, PresentationError,
PresentationRpcInterface, PresentationRpcResponse, PresentationStatus, Ruleset, SelectionInfo, SelectionScope, SelectionScopeRpcRequestOptions,
} from "@bentley/presentation-common";
import { PresentationBackendLoggerCategory } from "./BackendLoggerCategory";
import { Presentation } from "./Presentation";
import { PresentationManager } from "./PresentationManager";
=======
import { ClientRequestContext, Id64String, Logger } from "@bentley/bentleyjs-core";
import { IModelDb } from "@bentley/imodeljs-backend";
import { IModelRpcProps } from "@bentley/imodeljs-common";
import {
ContentJSON, ContentRpcRequestOptions, Descriptor, DescriptorJSON, DescriptorOverrides, DisplayValueGroup, DisplayValueGroupJSON,
DistinctValuesRpcRequestOptions, HierarchyRpcRequestOptions, InstanceKey, InstanceKeyJSON, KeySet, KeySetJSON, LabelDefinition, LabelDefinitionJSON,
LabelRpcRequestOptions, Node, NodeJSON, NodeKey, NodeKeyJSON, NodePathElement, NodePathElementJSON, Paged, PagedResponse,
PartialHierarchyModification, PartialHierarchyModificationJSON, PresentationDataCompareRpcOptions, PresentationError, PresentationRpcInterface,
PresentationRpcResponse, PresentationStatus, Ruleset, SelectionInfo, SelectionScope, SelectionScopeRpcRequestOptions,
} from "@bentley/presentation-common";
import { Presentation } from "./Presentation";
import { PresentationManager } from "./PresentationManager";
>>>>>>>
import { ClientRequestContext, Id64String, Logger } from "@bentley/bentleyjs-core";
import { IModelDb } from "@bentley/imodeljs-backend";
import { IModelRpcProps } from "@bentley/imodeljs-common";
import {
ContentJSON, ContentRpcRequestOptions, Descriptor, DescriptorJSON, DescriptorOverrides, DisplayValueGroup, DisplayValueGroupJSON,
DistinctValuesRpcRequestOptions, HierarchyRpcRequestOptions, InstanceKey, InstanceKeyJSON, KeySet, KeySetJSON, LabelDefinition, LabelDefinitionJSON,
LabelRpcRequestOptions, Node, NodeJSON, NodeKey, NodeKeyJSON, NodePathElement, NodePathElementJSON, Paged, PagedResponse,
PartialHierarchyModification, PartialHierarchyModificationJSON, PresentationDataCompareRpcOptions, PresentationError, PresentationRpcInterface,
PresentationRpcResponse, PresentationStatus, Ruleset, SelectionInfo, SelectionScope, SelectionScopeRpcRequestOptions,
} from "@bentley/presentation-common";
import { PresentationBackendLoggerCategory } from "./BackendLoggerCategory";
import { Presentation } from "./Presentation";
import { PresentationManager } from "./PresentationManager"; |
<<<<<<<
import { IElement, DefinitionElement } from "./Element";
=======
import { BisCore } from "./BisCore";
import { ElementParams, DefinitionElement } from "./Element";
>>>>>>>
import { ElementParams, DefinitionElement } from "./Element";
<<<<<<<
import { JsonUtils } from "@bentley/bentleyjs-core/lib/JsonUtils";
=======
import { JsonUtils } from "@bentley/Bentleyjs-common/lib/JsonUtils";
>>>>>>>
import { JsonUtils } from "@bentley/bentleyjs-core/lib/JsonUtils";
<<<<<<<
* The most @bentley/bentleyjs-core method for user-level camera positioning is #LookAt.
=======
* The most common method for user-level camera positioning is #lookAt.
>>>>>>>
* The most common method for user-level camera positioning is #lookAt. |
<<<<<<<
import { ToolCtor, Tool, ToolGroup } from "./tools/Tool";
import { I18N } from "./Localization";
=======
import { ToolCtor, Tool, ToolGroup, ImmediateTool } from "./tools/Tool";
>>>>>>>
import { ToolCtor, Tool, ToolGroup, ImmediateTool } from "./tools/Tool";
import { I18N } from "./Localization";
<<<<<<<
public createLocalizer(nameSpaces: string[], defaultNameSpace: string, renderFunction: any): I18N {
// create a separate instance of i18next, so it doesn't interfere with other i18next instances.
return new I18N(nameSpaces, defaultNameSpace, renderFunction);
}
=======
public runImmediateTool(toolId: string, ...args: any[]): boolean {
const tool = this.createTool(toolId);
if (!(tool instanceof ImmediateTool))
return false;
tool.run(...args);
return true;
}
>>>>>>>
public runImmediateTool(toolId: string, ...args: any[]): boolean {
const tool = this.createTool(toolId);
if (!(tool instanceof ImmediateTool))
return false;
tool.run(...args);
return true;
}
public createLocalizer(nameSpaces: string[], defaultNameSpace: string, renderFunction: any): I18N {
// create a separate instance of i18next, so it doesn't interfere with other i18next instances.
return new I18N(nameSpaces, defaultNameSpace, renderFunction);
} |
<<<<<<<
SET_INCOMPATIBLE_INTERFACE_VERSION: "setIncompatibleInterfaceVersion",
RESTORE_COMPATIBLE_INTERFACE_VERSION: "restoreIncompatibleInterfaceVersion",
=======
RESTART_BACKEND: "restartBackend",
>>>>>>>
SET_INCOMPATIBLE_INTERFACE_VERSION: "setIncompatibleInterfaceVersion",
RESTORE_COMPATIBLE_INTERFACE_VERSION: "restoreIncompatibleInterfaceVersion",
RESTART_BACKEND: "restartBackend", |
<<<<<<<
public static getLocalizedName(): string {
const namespace = this.group ? this.group.namespace : "tool";
return iModelApp.i18N.translate(namespace.concat(":", this.toolId));
}
=======
public static getLocalizedName(): string { return this.toolId; } // NEEDS_WORK
public static register(group: ToolGroup) { iModelApp.tools.registerTool(this.prototype.constructor as ToolCtor, group); }
>>>>>>>
public static getLocalizedName(): string {
const namespace = this.group ? this.group.namespace : "tool";
return iModelApp.i18N.translate(namespace.concat(":", this.toolId));
}
public static register(group: ToolGroup) { iModelApp.tools.registerTool(this.prototype.constructor as ToolCtor, group); } |
<<<<<<<
let gate: any = this._gates;
=======
let gate = this.gates;
>>>>>>>
let gate = this._gates;
<<<<<<<
let gate: any = this._gates;
=======
let gate = this.gates;
>>>>>>>
let gate = this._gates; |
<<<<<<<
import { IModelTestUtils, TestUsers, Timer } from "./IModelTestUtils";
import { BriefcaseManager, ChangeSetToken, KeepBriefcase, IModelDb, Element, DictionaryModel, SpatialCategory, IModelHost, AutoPush, AutoPushState, AutoPushEventHandler, AutoPushEventType } from "../backend";
=======
import { KeepBriefcase, IModelDb, Element, DictionaryModel, SpatialCategory, IModelHost, IModelHostConfiguration, AutoPush, AutoPushState, AutoPushEventHandler, AutoPushEventType } from "../backend";
>>>>>>>
import { IModelTestUtils, TestUsers, Timer } from "./IModelTestUtils";
import { BriefcaseManager, ChangeSetToken, KeepBriefcase, IModelDb, Element, DictionaryModel, SpatialCategory, IModelHost, IModelHostConfiguration, AutoPush, AutoPushState, AutoPushEventHandler, AutoPushEventType } from "../backend";
<<<<<<<
=======
import { IModelTestUtils, TestUsers } from "./IModelTestUtils";
import { HubTestUtils } from "./HubTestUtils";
import { IModelJsFs } from "../IModelJsFs";
import { ChangeSetToken } from "../BriefcaseManager";
import { ErrorStatusOrResult } from "@bentley/imodeljs-native-platform-api";
>>>>>>>
<<<<<<<
=======
it("should open a briefcase of an iModel with no versions", async () => {
const iModelNoVerId = await HubTestUtils.queryIModelIdByName(accessToken, testProjectId, "NoVersionsTest");
const iModelNoVer: IModelDb = await IModelDb.open(accessToken, testProjectId, iModelNoVerId, OpenMode.Readonly);
assert.exists(iModelNoVer);
});
>>>>>>>
it("should open a briefcase of an iModel with no versions", async () => {
const iModelNoVerId = await HubTestUtils.queryIModelIdByName(accessToken, testProjectId, "NoVersionsTest");
const iModelNoVer: IModelDb = await IModelDb.open(accessToken, testProjectId, iModelNoVerId, OpenMode.Readonly);
assert.exists(iModelNoVer);
}); |
<<<<<<<
import { iModelEngine } from "../IModelEngine";
import { AutoPush } from "../AutoPush";
let lastPushTimeMillis = 0;
=======
import { iModelHost } from "../IModelHost";
>>>>>>>
import { iModelHost } from "../IModelHost";
import { AutoPush } from "../AutoPush"; |
<<<<<<<
constructor(schema: Schema, name: string, modifier?: ECClassModifier) {
super(schema, name, modifier);
this.key.type = SchemaChildType.RelationshipClass;
=======
constructor(schema: Schema, name: string, strength?: StrengthType, strengthDirection?: RelatedInstanceDirection, modifier?: ECClassModifier) {
super(schema, name, SchemaChildType.RelationshipClass, modifier);
>>>>>>>
constructor(schema: Schema, name: string, modifier?: ECClassModifier) {
super(schema, name, SchemaChildType.RelationshipClass, modifier);
<<<<<<<
if (jsonObj.strength) this._strength = parseStrength(jsonObj.strength);
if (jsonObj.strengthDirection) this._strengthDirection = parseStrengthDirection(jsonObj.strengthDirection);
=======
if (undefined !== jsonObj.strength) {
if (typeof(jsonObj.strength) !== "string")
throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this.name} has an invalid 'strength' attribute. It should be of type 'string'.`);
this.strength = parseStrength(jsonObj.strength);
}
if (undefined !== jsonObj.strengthDirection) {
if (typeof(jsonObj.strengthDirection) !== "string")
throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this.name} has an invalid 'strengthDirection' attribute. It should be of type 'string'.`);
this.strengthDirection = parseStrengthDirection(jsonObj.strengthDirection);
}
>>>>>>>
if (undefined !== jsonObj.strength) {
if (typeof(jsonObj.strength) !== "string")
throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this.name} has an invalid 'strength' attribute. It should be of type 'string'.`);
this._strength = parseStrength(jsonObj.strength);
}
if (undefined !== jsonObj.strengthDirection) {
if (typeof(jsonObj.strengthDirection) !== "string")
throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this.name} has an invalid 'strengthDirection' attribute. It should be of type 'string'.`);
this._strengthDirection = parseStrengthDirection(jsonObj.strengthDirection);
}
<<<<<<<
this._multiplicity = tempMultiplicity;
=======
this.multiplicity = parsedMultiplicity;
>>>>>>>
this._multiplicity = parsedMultiplicity; |
<<<<<<<
const id: Id64String = ecdb.withPreparedStatement("INSERT INTO test.Foo(Struct) VALUES(?)", (stmt: ECSqlStatement) => {
stmt.bindStruct(1, { bl: blobVal, bo: boolVal, d: doubleVal, dt: { type: ECSqlStringType.DateTime, value: dtVal }, i: intVal, p2d: p2dVal, p3d: p3dVal, s: stringVal });
=======
const id: Id64 = ecdb.withPreparedStatement("INSERT INTO test.Foo(Struct) VALUES(?)", (stmt: ECSqlStatement) => {
stmt.bindStruct(1, { bl: blobVal, bo: boolVal, d: doubleVal, dt: dtVal, i: intVal, p2d: p2dVal, p3d: p3dVal, s: stringVal });
>>>>>>>
const id: Id64String = ecdb.withPreparedStatement("INSERT INTO test.Foo(Struct) VALUES(?)", (stmt: ECSqlStatement) => {
stmt.bindStruct(1, { bl: blobVal, bo: boolVal, d: doubleVal, dt: dtVal, i: intVal, p2d: p2dVal, p3d: p3dVal, s: stringVal }); |
<<<<<<<
public nativeDb: any;
private _classMetaDataRegistry: MetaDataRegistry;
=======
private statementCache: ECSqlStatementCache = new ECSqlStatementCache();
private _maxStatementCacheCount = 20;
private static _openDbMap: Map<string, IModelDb> = new Map<string, IModelDb>();
private _codeSpecs: CodeSpecs;
>>>>>>>
private statementCache: ECSqlStatementCache = new ECSqlStatementCache();
private _maxStatementCacheCount = 20;
public nativeDb: any;
private _codeSpecs: CodeSpecs;
private _classMetaDataRegistry: MetaDataRegistry;
<<<<<<<
if (!this.iModelToken)
=======
this.clearStatementCacheOnClose();
if (!this.briefcaseKey)
>>>>>>>
this.clearStatementCacheOnClose();
if (!this.iModelToken)
<<<<<<<
if (!this.iModelToken.isOpen)
=======
this.clearStatementCacheOnClose();
if (!this.briefcaseKey)
>>>>>>>
this.clearStatementCacheOnClose();
if (!this.iModelToken.isOpen)
<<<<<<<
/** @deprecated */
public async getElementPropertiesForDisplay(elementId: string): Promise<string> {
if (!this.iModelToken.isOpen)
return Promise.reject(new IModelError(IModelStatus.NotOpen));
const {error, result: json} = await this.nativeDb.getElementPropertiesForDisplay(elementId);
if (error)
return Promise.reject(new IModelError(error.status));
return json;
}
/** Prepare an ECSql statement.
* @param sql The ECSql statement to prepare
*/
public prepareECSqlStatement(ecsql: string): ECSqlStatement {
if (!this.iModelToken.isOpen)
throw new IModelError(IModelStatus.NotOpen);
const s = new ECSqlStatement();
s.prepare(this.nativeDb, ecsql);
return s;
}
/** Execute a query against this iModel
* @param ecsql The ECSql statement to execute
* @returns all rows in JSON syntax or the empty string if nothing was selected
* @throws [[IModelError]] If the statement is invalid
*/
public async executeQuery(ecsql: string): Promise<string> {
if (!this.iModelToken.isOpen)
return Promise.reject(new IModelError(IModelStatus.NotOpen));
const { error, result: json } = await this.nativeDb.executeQuery(ecsql);
if (error)
return Promise.reject(new IModelError(error.status));
return json!;
}
/** Get the meta data for the specified class defined in imodel iModel, blocking until the result is returned.
* @param schemaName The name of the schema
* @param className The name of the class
* @returns On success, the BentleyReturn result property will be the class meta data in JSON format.
*/
public getECClassMetaDataSync(schemaName: string, className: string): string {
if (!this.iModelToken.isOpen)
throw new IModelError(IModelStatus.NotOpen);
const { error, result: json } = this.nativeDb.getECClassMetaDataSync(schemaName, className);
if (error)
throw new IModelError(error.status);
return json;
}
/** Get the meta data for the specified class defined in imodel iModel (asynchronously).
* @param schemaName The name of the schema
* @param className The name of the class
* @returns The class meta data in JSON format.
* @throws [[IModelError]]
*/
public async getECClassMetaData(schemaName: string, className: string): Promise<string> {
if (!this.iModelToken.isOpen)
return Promise.reject(new IModelError(IModelStatus.NotOpen));
const { error, result: json } = await this.nativeDb.getECClassMetaData(schemaName, className);
if (error)
return Promise.reject(new IModelError(error.status));
return json;
=======
/** Get access to the CodeSpecs in this IModel */
public get codeSpecs(): CodeSpecs {
if (this._codeSpecs === undefined)
this._codeSpecs = new CodeSpecs(this);
return this._codeSpecs;
>>>>>>>
/** Get access to the CodeSpecs in this IModel */
public get codeSpecs(): CodeSpecs {
if (this._codeSpecs === undefined)
this._codeSpecs = new CodeSpecs(this);
return this._codeSpecs;
}
/** @deprecated */
public async getElementPropertiesForDisplay(elementId: string): Promise<string> {
if (!this.iModelToken.isOpen)
return Promise.reject(new IModelError(IModelStatus.NotOpen));
const {error, result: json} = await this.nativeDb.getElementPropertiesForDisplay(elementId);
if (error)
return Promise.reject(new IModelError(error.status));
return json;
}
/** Prepare an ECSql statement.
* @param sql The ECSql statement to prepare
*/
public prepareECSqlStatement(ecsql: string): ECSqlStatement {
if (!this.iModelToken.isOpen)
throw new IModelError(IModelStatus.NotOpen);
const s = new ECSqlStatement();
s.prepare(this.nativeDb, ecsql);
return s;
}
/** Get the meta data for the specified class defined in imodel iModel, blocking until the result is returned.
* @param schemaName The name of the schema
* @param className The name of the class
* @returns On success, the BentleyReturn result property will be the class meta data in JSON format.
*/
public getECClassMetaDataSync(schemaName: string, className: string): string {
if (!this.iModelToken.isOpen)
throw new IModelError(IModelStatus.NotOpen);
const { error, result: json } = this.nativeDb.getECClassMetaDataSync(schemaName, className);
if (error)
throw new IModelError(error.status);
return json;
}
/** Get the meta data for the specified class defined in imodel iModel (asynchronously).
* @param schemaName The name of the schema
* @param className The name of the class
* @returns The class meta data in JSON format.
* @throws [[IModelError]]
*/
public async getECClassMetaData(schemaName: string, className: string): Promise<string> {
if (!this.iModelToken.isOpen)
return Promise.reject(new IModelError(IModelStatus.NotOpen));
const { error, result: json } = await this.nativeDb.getECClassMetaData(schemaName, className);
if (error)
return Promise.reject(new IModelError(error.status));
return json;
<<<<<<<
public async insertElement(el: Element): Promise<Id64> {
if (!this._iModel.iModelToken.isOpen)
return Promise.reject(new IModelError(IModelStatus.NotOpen));
=======
public insertElement(el: Element): Id64 {
if (!this._iModel.briefcaseKey)
throw new IModelError(IModelStatus.NotOpen);
>>>>>>>
public insertElement(el: Element): Id64 {
if (!this._iModel.iModelToken.isOpen)
throw new IModelError(IModelStatus.NotOpen);
<<<<<<<
// Note that inserting an element is always done synchronously. That is because of constraints
// on the native code side. Nevertheless, we want the signature of this method to be
// that of an asynchronous method, since it must run in the services tier and will be
// asynchronous from a remote client's point of view in any case.
const {error, result: json} = this._iModel.nativeDb.insertElementSync(JSON.stringify(el));
if (error)
return Promise.reject(new IModelError(error.status));
=======
const json: string = BriefcaseManager.insertElement(this._iModel.briefcaseKey, JSON.stringify(el));
>>>>>>>
// Note that inserting an element is always done synchronously. That is because of constraints
// on the native code side. Nevertheless, we want the signature of this method to be
// that of an asynchronous method, since it must run in the services tier and will be
// asynchronous from a remote client's point of view in any case.
const {error, result: json} = this._iModel.nativeDb.insertElementSync(JSON.stringify(el));
if (error)
throw new IModelError(error.status); |
<<<<<<<
this._geom.composite!.update(flags);
this.renderStencilVolumes(commands);
=======
this._geometry.composite!.update(flags);
>>>>>>>
this._geom.composite!.update(flags);
<<<<<<<
const fboSet = this._frameBuffers.stencilSet;
const fboCopy = this._frameBuffers.stencilCopy;
=======
const fboSet = this._fbos.stencilSet;
const fboCopy = this.getBackgroundFbo(needComposite);
>>>>>>>
const fboSet = this._frameBuffers.stencilSet;
const fboCopy = this.getBackgroundFbo(needComposite); |
<<<<<<<
builder = context.createGraphicBuilder(GraphicType.WorldOverlay, transform);
=======
graphic = context.createWorldOverlay(this.getDisplayTransform(vp));
>>>>>>>
builder = context.createGraphicBuilder(GraphicType.WorldOverlay, this.getDisplayTransform(vp));
<<<<<<<
builder.activateGraphicParams(graphicParams);
builder.addArc(ellipse, true, true);
builder.addArc(ellipse, false, false);
=======
graphic.addArc(ellipse, true, true);
graphic.addArc(ellipse, false, false);
>>>>>>>
builder.addArc(ellipse, true, true);
builder.addArc(ellipse, false, false);
<<<<<<<
shapePts[4] = shapePts[0];
graphicParams.fillFlags |= FillFlags.ByView; // Mark as filled
builder.activateGraphicParams(graphicParams);
builder.addShape(shapePts);
graphicParams.fillFlags &= ~(FillFlags.ByView); // Mark as not filled
builder.activateGraphicParams(graphicParams);
=======
pts[4] = pts[0].clone();
graphic.addShape(pts);
graphic.addLineString(pts);
>>>>>>>
pts[4] = pts[0].clone();
builder.addShape(pts);
builder.addLineString(pts);
<<<<<<<
graphicParams.fillFlags |= FillFlags.ByView; // Mark as filled
builder.activateGraphicParams(graphicParams);
builder.addShape(shapePtsP);
graphicParams.fillFlags &= ~(FillFlags.ByView); // Mark as not filled
builder.activateGraphicParams(graphicParams);
builder.addLineString(shapePtsP);
=======
graphic.addShape(pts);
graphic.addLineString(pts);
>>>>>>>
builder.addShape(pts);
builder.addLineString(pts);
<<<<<<<
shapePts[4] = shapePts[0];
builder.addLineString(shapePts);
=======
pts[4] = pts[0].clone();
graphic.addLineString(pts);
>>>>>>>
pts[4] = pts[0].clone();
builder.addLineString(pts);
<<<<<<<
builder.setSymbology(xColor, xColor, 4);
const linePts: Point3d[] = [];
linePts[0] = new Point3d(1.2, 0.0, 0.0);
linePts[1] = new Point3d(0.8, 0.0, 0.0);
builder.addLineString(linePts);
=======
graphic.setSymbology(xColor, xColor, 4);
graphic.addLineString([new Point3d(1.2, 0.0, 0.0), new Point3d(0.8, 0.0, 0.0)]);
>>>>>>>
builder.setSymbology(xColor, xColor, 4);
builder.addLineString([new Point3d(1.2, 0.0, 0.0), new Point3d(0.8, 0.0, 0.0)]);
<<<<<<<
builder.setSymbology(frameColor, frameColor, 1);
linePts[0].set(-1.2, 0.0, 0.0);
linePts[1].set(-0.8, 0.0, 0.0);
builder.addLineString(linePts);
=======
graphic.setSymbology(frameColor, frameColor, 1);
graphic.addLineString([new Point3d(-1.2, 0.0, 0.0), new Point3d(-0.8, 0.0, 0.0)]);
>>>>>>>
builder.setSymbology(frameColor, frameColor, 1);
builder.addLineString([new Point3d(-1.2, 0.0, 0.0), new Point3d(-0.8, 0.0, 0.0)]);
<<<<<<<
builder.setSymbology(yColor, yColor, 4);
linePts[0].set(0.0, 1.2, 0.0);
linePts[1].set(0.0, 0.8, 0.0);
builder.addLineString(linePts);
=======
graphic.setSymbology(yColor, yColor, 4);
graphic.addLineString([new Point3d(0.0, 1.2, 0.0), new Point3d(0.0, 0.8, 0.0)]);
>>>>>>>
builder.setSymbology(yColor, yColor, 4);
builder.addLineString([new Point3d(0.0, 1.2, 0.0), new Point3d(0.0, 0.8, 0.0)]);
<<<<<<<
builder.setSymbology(frameColor, frameColor, 1);
linePts[0].set(0.0, -1.2, 0.0);
linePts[1].set(0.0, -0.8, 0.0);
builder.addLineString(linePts);
=======
graphic.setSymbology(frameColor, frameColor, 1);
graphic.addLineString([new Point3d(0.0, -1.2, 0.0), new Point3d(0.0, -0.8, 0.0)]);
>>>>>>>
builder.setSymbology(frameColor, frameColor, 1);
builder.addLineString([new Point3d(0.0, -1.2, 0.0), new Point3d(0.0, -0.8, 0.0)]); |
<<<<<<<
MeshArgs, OnScreenTarget, GraphicType,
Target, Decorations, Batch, WorldDecorations, TextureHandle, UpdatePlan, GraphicList,
=======
MeshArgs, OnScreenTarget, GraphicBuilderCreateParams, GraphicType,
Target, Decorations, Batch, DecorationList, WorldDecorations, TextureHandle,
>>>>>>>
MeshArgs, OnScreenTarget, GraphicType,
Target, Decorations, Batch, WorldDecorations, TextureHandle, |
<<<<<<<
import { ToolCtor, Tool, ToolGroup, ImmediateTool } from "./tools/Tool";
import { I18N } from "./Localization";
/** holds a mapping of toolId string to tool class */
export class ToolRegistry {
public map: Map<string, ToolCtor> = new Map<string, ToolCtor>();
public unRegisterTool(toolId: string) { this.map.delete(toolId); }
/** register a tool */
public registerTool(ctor: ToolCtor, group: ToolGroup) {
if (ctor.toolId.length !== 0) {
ctor.group = group;
this.map.set(ctor.toolId, ctor);
}
}
/**
* register all the tools found in a module.
* @param modelObj the module to search for subclasses of Tool.
*/
public registerModuleTools(moduleObj: any, scope: ToolGroup) {
for (const thisMember in moduleObj) {
if (!thisMember)
continue;
const thisTool = moduleObj[thisMember];
if (thisTool.prototype instanceof Tool) {
this.registerTool(thisTool, scope);
}
}
}
}
=======
import { ToolRegistry, ToolGroup } from "./tools/Tool";
>>>>>>>
import { ToolRegistry, ToolGroup } from "./tools/Tool";
import { I18N } from "./Localization";
<<<<<<<
/**
* Look up a tool by toolId. If found, create a new instance of that tool with the supplied arguments
*/
public createTool(toolId: string, ...args: any[]): Tool | undefined {
const ctor = this.tools.map.get(toolId);
return ctor ? new ctor(...args) : undefined;
}
public runImmediateTool(toolId: string, ...args: any[]): boolean {
const tool = this.createTool(toolId);
if (!(tool instanceof ImmediateTool))
return false;
tool.run(...args);
return true;
}
public createLocalizer(nameSpaces: string[], defaultNameSpace: string, renderFunction: any): I18N {
// create a separate instance of i18next, so it doesn't interfere with other i18next instances.
return new I18N(nameSpaces, defaultNameSpace, renderFunction);
}
=======
>>>>>>> |
<<<<<<<
public constructor(public deploymentEnv: DeploymentEnv, fileHandler?: FileHandler, baseHandler: IModelServerHandler = new IModelHubBaseHandler(deploymentEnv)) {
this._handler = baseHandler;
this._fileHandler = fileHandler || this._handler.getFileHandler();
=======
public constructor(public deploymentEnv: DeploymentEnv = "PROD", fileHandler?: FileHandler) {
this._handler = new IModelHubBaseHandler(deploymentEnv);
this._fileHandler = fileHandler;
>>>>>>>
public constructor(public deploymentEnv: DeploymentEnv = "PROD", fileHandler?: FileHandler, baseHandler: IModelServerHandler = new IModelHubBaseHandler(deploymentEnv)) {
this._handler = baseHandler;
this._fileHandler = fileHandler || this._handler.getFileHandler(); |
<<<<<<<
QParams3d, QPoint3dList, ColorByName, GraphicParams, RenderMaterial, TextureMapping, SubCategoryOverride, ViewStateData,
=======
QParams3d, QPoint3dList, ColorByName, GraphicParams, RenderMaterial, TextureMapping, SubCategoryOverride, SheetProps, ViewAttachmentProps,
>>>>>>>
QParams3d, QPoint3dList, ColorByName, GraphicParams, RenderMaterial, TextureMapping, SubCategoryOverride, ViewStateData, SheetProps, ViewAttachmentProps,
<<<<<<<
import { GeometricModelState, SheetModelState, GeometricModel2dState } from "./ModelState";
import { NotifyMessageDetails, OutputMessagePriority } from "./NotificationManager";
=======
import { GeometricModelState, GeometricModel2dState, SheetModelState } from "./ModelState";
import { RenderGraphic } from "./render/System";
import { Sheet } from "./Sheet";
import { TileTree, Tile } from "./tile/TileTree";
>>>>>>>
import { GeometricModelState, GeometricModel2dState } from "./ModelState";
import { NotifyMessageDetails, OutputMessagePriority } from "./NotificationManager";
import { RenderGraphic } from "./render/System";
import { Sheet } from "./Sheet";
import { TileTree, Tile } from "./tile/TileTree";
<<<<<<<
if (model.tileTree !== undefined && model.useRangeForFit()) { // can we assume that a loaded model
=======
if (model.tileTree !== undefined && model.tileTree.rootTile !== undefined) { // can we assume that a loaded model
>>>>>>>
if (model.tileTree !== undefined && model.tileTree.rootTile !== undefined && model.useRangeForFit()) { // can we assume that a loaded model
<<<<<<<
=======
/** Create the scene for this view from a set of pre-initialized DrawArgs. */
public createSceneFromDrawArgs(args: Tile.DrawArgs) {
// ###TODO: Check for a context RenderPlan wait time in the draw arguments given
args.root.draw(args);
}
/**
* This should be overridden by more specific leaf classes of ViewState2d
* @hidden
*/
public decorate(_context: DecorateContext): void { }
>>>>>>>
/** Create the scene for this view from a set of pre-initialized DrawArgs. */
public createSceneFromDrawArgs(args: Tile.DrawArgs) {
// ###TODO: Check for a context RenderPlan wait time in the draw arguments given
args.root.draw(args);
} |
<<<<<<<
public async openForRead(_accessToken: AccessToken, _contextId: string, _iModelId: string, _version: IModelVersion): Promise<IModel> {
=======
public async openForRead(_accessToken: AccessToken, _iModelToken: IModelToken): Promise<IModelGatewayOpenResponse> {
>>>>>>>
public async openForRead(_accessToken: AccessToken, _iModelToken: IModelToken): Promise<IModel> {
<<<<<<<
public async openForWrite(_accessToken: AccessToken, _contextId: string, _iModelId: string, _version: IModelVersion): Promise<IModel> {
=======
public async openForWrite(_accessToken: AccessToken, _iModelToken: IModelToken): Promise<IModelGatewayOpenResponse> {
>>>>>>>
public async openForWrite(_accessToken: AccessToken, _iModelToken: IModelToken): Promise<IModel> { |
<<<<<<<
import { TriMeshArgs, IndexedPolylineArgs, PolylineData, OctEncodedNormalList, QPoint3dList, MeshPolyline, MeshEdges, QParams3d,
FeatureTable, FeatureIndex, FeatureIndexType } from "@bentley/imodeljs-common";
import { DisplayParams, DisplayParamsRegionEdgeType } from "./DisplayParams";
=======
import { PolylineData, OctEncodedNormalList, QPoint3dList, MeshPolyline, MeshEdges, QParams3d, EdgeArgs, SilhouetteEdgeArgs, PolylineEdgeArgs, FillFlags,
FeatureTable, FeatureIndex, FeatureIndexType, ColorIndex, PolylineFlags, LinePixels, OctEncodedNormal, Texture, Material } from "@bentley/imodeljs-common";
import { DisplayParams } from "./DisplayParams";
>>>>>>>
import { PolylineData, OctEncodedNormalList, QPoint3dList, MeshPolyline, MeshEdges, QParams3d, EdgeArgs, SilhouetteEdgeArgs, PolylineEdgeArgs, FillFlags,
FeatureTable, FeatureIndex, FeatureIndexType, ColorIndex, PolylineFlags, LinePixels, OctEncodedNormal, Texture, Material } from "@bentley/imodeljs-common";
import { DisplayParams, DisplayParamsRegionEdgeType } from "./DisplayParams"; |
<<<<<<<
import { IModelError, RenderTexture, RenderMaterial, Gradient, ImageBuffer, FeatureTable, ElementAlignedBox3d, ColorDef, QPoint3dList, QParams3d, QPoint3d } from "@bentley/imodeljs-common";
import { ClipVector, Transform, Point3d, ClipUtilities, PolyfaceBuilder, Point2d, IndexedPolyface, Range3d, IndexedPolyfaceVisitor, Triangulator, StrokeOptions } from "@bentley/geometry-core";
import { RenderGraphic, GraphicBranch, RenderSystem, RenderTarget, SkyBoxCreateParams, RenderClipVolume, GraphicList } from "../System";
=======
import { IModelError, RenderTexture, RenderMaterial, Gradient, ImageBuffer, FeatureTable, ElementAlignedBox3d, QPoint3dList, QParams3d, QPoint3d, ColorDef } from "@bentley/imodeljs-common";
import { ClipVector, Transform, Point3d, ClipUtilities, PolyfaceBuilder, StrokeOptions, Point2d, IndexedPolyface, Range3d, IndexedPolyfaceVisitor, Triangulator } from "@bentley/geometry-core";
import { RenderGraphic, GraphicBranch, RenderSystem, RenderTarget, RenderClipVolume, GraphicList } from "../System";
import { SkyBox } from "../../DisplayStyleState";
>>>>>>>
import { IModelError, RenderTexture, RenderMaterial, Gradient, ImageBuffer, FeatureTable, ElementAlignedBox3d, ColorDef, QPoint3dList, QParams3d, QPoint3d } from "@bentley/imodeljs-common";
import { ClipVector, Transform, Point3d, ClipUtilities, PolyfaceBuilder, StrokeOptions, Point2d, IndexedPolyface, Range3d, IndexedPolyfaceVisitor, Triangulator } from "@bentley/geometry-core";
import { RenderGraphic, GraphicBranch, RenderSystem, RenderTarget, RenderClipVolume, GraphicList } from "../System";
import { SkyBox } from "../../DisplayStyleState"; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.