Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Feat/generator add setters and getters #59

Merged
merged 3 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ASSET_PATH } from '../assets';
selector: 'app-on-demand-example',
templateUrl: './on-demand-example.component.html',
styleUrls: ['./on-demand-example.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class OnDemandExampleComponent {
protected controlType = 'orbit';
Expand Down
3 changes: 3 additions & 0 deletions projects/ngx-three/src/lib/generated/ThBatchedMesh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ export class ThBatchedMesh<
public get sortObjects(): boolean | undefined {
return this._objRef?.sortObjects;
}
public get maxGeometryCount(): number | undefined {
return this._objRef?.maxGeometryCount;
}
@Input()
public set isBatchedMesh(value: true) {
if (this._objRef) {
Expand Down
12 changes: 12 additions & 0 deletions projects/ngx-three/src/lib/generated/ThCompressedArrayTexture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ export class ThCompressedArrayTexture<
public get isCompressedArrayTexture(): true | undefined {
return this._objRef?.isCompressedArrayTexture;
}
public get image():
| { width: number; height: number; depth: number }
| undefined {
return this._objRef?.image;
}
@Input()
public set image(value: { width: number; height: number; depth: number }) {
if (this._objRef) {
this._objRef.image = value;
}
}

@Input()
public set wrapR(value: Wrapping) {
if (this._objRef) {
Expand Down
10 changes: 10 additions & 0 deletions projects/ngx-three/src/lib/generated/ThCompressedTexture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ export class ThCompressedTexture<
public get isCompressedTexture(): true | undefined {
return this._objRef?.isCompressedTexture;
}
public get image(): { width: number; height: number } | undefined {
return this._objRef?.image;
}
@Input()
public set image(value: { width: number; height: number }) {
if (this._objRef) {
this._objRef.image = value;
}
}

@Input()
public set mipmaps(value: ImageData[]) {
if (this._objRef) {
Expand Down
20 changes: 20 additions & 0 deletions projects/ngx-three/src/lib/generated/ThCubeTexture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,26 @@ export class ThCubeTexture<
public get isCubeTexture(): true | undefined {
return this._objRef?.isCubeTexture;
}
public get image(): any | undefined {
return this._objRef?.image;
}
@Input()
public set image(value: any) {
if (this._objRef) {
this._objRef.image = value;
}
}

public get images(): any | undefined {
return this._objRef?.images;
}
@Input()
public set images(value: any) {
if (this._objRef) {
this._objRef.images = value;
}
}

@Input()
public set mapping(value: CubeTextureMapping) {
if (this._objRef) {
Expand Down
37 changes: 15 additions & 22 deletions projects/ngx-three/src/lib/generated/ThData3DTexture.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,21 @@
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable no-underscore-dangle */
/* eslint-disable @angular-eslint/component-selector, @angular-eslint/component-class-suffix */
import {
ChangeDetectionStrategy,
Component,
Input,
Type,
forwardRef,
} from '@angular/core';
import {
Data3DTexture,
MagnificationTextureFilter,
MinificationTextureFilter,
Wrapping,
} from 'three';
import { ChangeDetectionStrategy, Component, Input, Type, forwardRef } from '@angular/core';
import { Data3DTexture, MagnificationTextureFilter, MinificationTextureFilter, Wrapping } from 'three';
import { ThTextureBase } from '../ThTextureBase';
import { ThTexture } from './ThTexture';
import { Texture3DImageData } from 'three/src/textures/types';

@Component({
selector: 'th-data3DTexture',
template: '<ng-content/>',
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [
{ provide: ThTextureBase, useExisting: forwardRef(() => ThData3DTexture) },
],
providers: [{ provide: ThTextureBase, useExisting: forwardRef(() => ThData3DTexture) }],
})
export class ThData3DTexture<
T extends Data3DTexture = Data3DTexture,
TARGS = [
data?: BufferSource | null,
width?: number,
height?: number,
depth?: number,
],
TARGS = [data?: BufferSource | null, width?: number, height?: number, depth?: number],
> extends ThTexture<T, TARGS> {
public getType(): Type<Data3DTexture> {
return Data3DTexture;
Expand All @@ -41,6 +24,16 @@ export class ThData3DTexture<
public get isData3DTexture(): true | undefined {
return this._objRef?.isData3DTexture;
}
public get image(): Texture3DImageData | undefined {
return this._objRef?.image;
}
@Input()
public set image(value: Texture3DImageData) {
if (this._objRef) {
this._objRef.image = value;
}
}

@Input()
public set magFilter(value: MagnificationTextureFilter) {
if (this._objRef) {
Expand Down
11 changes: 11 additions & 0 deletions projects/ngx-three/src/lib/generated/ThDataArrayTexture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { ChangeDetectionStrategy, Component, Input, Type, forwardRef } from '@an
import { DataArrayTexture, MagnificationTextureFilter, MinificationTextureFilter } from 'three';
import { ThTextureBase } from '../ThTextureBase';
import { ThTexture } from './ThTexture';
import { Texture3DImageData } from 'three/src/textures/types';

@Component({
selector: 'th-dataArrayTexture',
Expand All @@ -28,6 +29,16 @@ export class ThDataArrayTexture<
public get isDataArrayTexture(): true | undefined {
return this._objRef?.isDataArrayTexture;
}
public get image(): Texture3DImageData | undefined {
return this._objRef?.image;
}
@Input()
public set image(value: Texture3DImageData) {
if (this._objRef) {
this._objRef.image = value;
}
}

@Input()
public set magFilter(value: MagnificationTextureFilter) {
if (this._objRef) {
Expand Down
23 changes: 13 additions & 10 deletions projects/ngx-three/src/lib/generated/ThDataTexture.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable no-underscore-dangle */
/* eslint-disable @angular-eslint/component-selector, @angular-eslint/component-class-suffix */
import {
ChangeDetectionStrategy,
Component,
Input,
Type,
forwardRef,
} from '@angular/core';
import { ChangeDetectionStrategy, Component, Input, Type, forwardRef } from '@angular/core';
import {
ColorSpace,
DataTexture,
Expand All @@ -20,14 +14,13 @@ import {
} from 'three';
import { ThTextureBase } from '../ThTextureBase';
import { ThTexture } from './ThTexture';
import { TextureImageData } from 'three/src/textures/types';

@Component({
selector: 'th-dataTexture',
template: '<ng-content/>',
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [
{ provide: ThTextureBase, useExisting: forwardRef(() => ThDataTexture) },
],
providers: [{ provide: ThTextureBase, useExisting: forwardRef(() => ThDataTexture) }],
})
export class ThDataTexture<
T extends DataTexture = DataTexture,
Expand All @@ -53,6 +46,16 @@ export class ThDataTexture<
public get isDataTexture(): true | undefined {
return this._objRef?.isDataTexture;
}
public get image(): TextureImageData | undefined {
return this._objRef?.image;
}
@Input()
public set image(value: TextureImageData) {
if (this._objRef) {
this._objRef.image = value;
}
}

@Input()
public set magFilter(value: MagnificationTextureFilter) {
if (this._objRef) {
Expand Down
10 changes: 10 additions & 0 deletions projects/ngx-three/src/lib/generated/ThDepthTexture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ export class ThDepthTexture<
public get isDepthTexture(): true | undefined {
return this._objRef?.isDepthTexture;
}
public get image(): { width: number; height: number } | undefined {
return this._objRef?.image;
}
@Input()
public set image(value: { width: number; height: number }) {
if (this._objRef) {
this._objRef.image = value;
}
}

@Input()
public set flipY(value: boolean) {
if (this._objRef) {
Expand Down
16 changes: 16 additions & 0 deletions projects/ngx-three/src/lib/generated/ThMaterial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,22 @@ export class ThMaterial<
public get version(): number | undefined {
return this._objRef?.version;
}
public get alphaTest(): number | undefined {
return this._objRef?.alphaTest;
}
@Input()
public set alphaTest(value: number) {
if (this._objRef) {
this._objRef.alphaTest = value;
}
}

@Input()
public set needsUpdate(value: boolean) {
if (this._objRef) {
this._objRef.needsUpdate = value;
}
}

constructor(@SkipSelf() hostObject: ThObject3D) {
super(hostObject);
Expand Down
Loading