@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
96 lines (95 loc) • 5.45 kB
TypeScript
import { AttribValue, NumericAttribValue } from './../../types/GlobalTypes';
import { PolyDictionary } from '../../types/GlobalTypes';
import { Box3, BufferGeometry, Object3D, Vector2, Vector3, Vector4 } from 'three';
import { AttribSize, ObjectData, AttribType, GroupString, AttribClass } from './Constant';
import { CoreObjectType, ObjectBuilder, ObjectContent } from './ObjectContent';
import { BaseCoreObject } from './entities/object/BaseCoreObject';
import { CoreEntity } from './CoreEntity';
import type { CorePoint } from './entities/point/CorePoint';
import type { CadGeometryType, CadGeometryTypeShape } from './modules/cad/CadCommon';
import type { CadObject } from './modules/cad/CadObject';
import type { CsgGeometryType } from './modules/csg/CsgCommon';
import type { CsgObject } from './modules/csg/CsgObject';
import type { QuadObject } from './modules/quad/QuadObject';
import { TetObject } from './modules/tet/TetObject';
import { ThreejsCoreObject } from './modules/three/ThreejsCoreObject';
import { CoreVertex } from './entities/vertex/CoreVertex';
import { CorePrimitive } from './entities/primitive/CorePrimitive';
import { TraversedRelatedEntityData } from './entities/utils/TraversedRelatedEntities';
type AttributeDictionary = PolyDictionary<AttribValue>;
export interface Object3DWithGeometry extends Object3D {
geometry: BufferGeometry;
}
export declare class CoreGroup extends CoreEntity {
private _timestamp;
private _allObjects;
constructor();
dispose(): void;
geometry(): null;
builder<T extends CoreObjectType>(): ObjectBuilder<T> | undefined;
timestamp(): number | undefined;
touch(): void;
resetBoundingBox(): void;
clone(): CoreGroup;
setAllObjects(objects: ObjectContent<CoreObjectType>[]): void;
allObjects(): ObjectContent<CoreObjectType>[];
allCoreObjects(): BaseCoreObject<CoreObjectType>[];
cadObjects(): CadObject<CadGeometryType>[] | undefined;
cadObjectsWithShape(): CadObject<CadGeometryTypeShape>[] | undefined;
cadCoreObjects(): BaseCoreObject<CoreObjectType.CAD>[] | undefined;
csgObjects(): CsgObject<CsgGeometryType>[] | undefined;
csgCoreObjects(): BaseCoreObject<CoreObjectType.CSG>[] | undefined;
quadObjects(): QuadObject[] | undefined;
quadCoreObjects(): BaseCoreObject<CoreObjectType.QUAD>[] | undefined;
threejsOrQuadObjects(): Array<Object3D | QuadObject>;
threejsOrQuadCoreObjects(): BaseCoreObject<CoreObjectType.QUAD>[];
tetObjects(): TetObject[] | undefined;
tetCoreObjects(): BaseCoreObject<CoreObjectType>[] | undefined;
threejsObjects(): Object3D[];
threejsObjectsWithGeo(): Object3DWithGeometry[];
threejsCoreObjects(): ThreejsCoreObject[];
geometries(): BufferGeometry[];
points(target: CorePoint<CoreObjectType>[]): CorePoint<CoreObjectType>[];
pointsCount(): number;
totalPointsCount(): number;
pointsFromGroup(group: GroupString, target: CorePoint<CoreObjectType>[]): CorePoint<CoreObjectType>[];
pointAttribNames(): string[];
hasPointAttrib(attribName: string): boolean;
pointAttribType(attribName: string): AttribType;
pointAttribNamesMatchingMask(masksString: GroupString): string[];
pointAttribSizes(): Record<string, number>;
pointAttribSize(attribName: string): number;
static _fromObjects(objects: Object3D[]): CoreGroup;
objectAttribTypesByName(): PolyDictionary<AttribType[]>;
objectAttribNames(): string[];
objectAttribNamesMatchingMask(masksString: GroupString): string[];
objectAttribSizesByName(): PolyDictionary<AttribSize[]>;
renameAttribute(oldName: string, newName: string): void;
attribNamesMatchingMask(masksString: GroupString): string[];
hasAttribute(attribName: string): boolean;
private _attributes;
addAttribute(attribName: string, attribValue: AttribValue): void;
addNumericAttribute<T extends CoreObjectType>(attribName: string, size?: AttribSize, defaultValue?: NumericAttribValue): 0 | Vector2 | Vector3 | Vector4 | undefined;
deleteAttribute(name: string): void;
attribValue(attribName: string): AttribValue;
attribNames(): string[];
attribType(name: string): AttribType;
attribSizes(): PolyDictionary<AttribSize>;
attribSize(name: string): AttribSize | null;
attributes(): AttributeDictionary;
private _createAttributesDictionaryIfNone;
setAttribValue(attribName: string, attribValue: AttribValue | string): void;
stringAttribValue(attribName: string): string | null;
position(target: Vector3): Vector3;
attributeNames(): string[];
attributeNamesMatchingMask(masksString: GroupString): string[];
relatedObjects(target: BaseCoreObject<CoreObjectType>[], traversedRelatedEntityData?: TraversedRelatedEntityData): void;
relatedPrimitives(target: CorePrimitive<CoreObjectType>[], traversedRelatedEntityData?: TraversedRelatedEntityData): void;
relatedVertices(target: CoreVertex<CoreObjectType>[], traversedRelatedEntityData?: TraversedRelatedEntityData): void;
relatedPoints(target: CorePoint<CoreObjectType>[], traversedRelatedEntityData?: TraversedRelatedEntityData): void;
relatedEntities(attribClass: AttribClass, coreGroup: CoreGroup, target: CoreEntity[], traversedRelatedEntityData?: TraversedRelatedEntityData): void;
objectsData(): ObjectData[];
boundingBox(target: Box3): void;
static geometryFromObject(object: Object3D): BufferGeometry | null;
}
export {};