A3DObject, SceneObject, Entity — Aspose.3D TypeScript API Reference
الحزمة: @aspose/3d (v24.12.0)
هذه الفئات الثلاث تشكل أساس @aspose/3d تسلسل الفئات. كل كائن عام في المكتبة يمتد في النهاية A3DObject,، الذي يوفر نظام الاسم والخصائص الديناميكية. SceneObject يضيف تتبع عضوية المشهد. Entity هو الأساس لجميع الكائنات التي يمكن ربطها بـ Node ككيانها الأساسي (الشبكات، الكاميرات، الأضواء، إلخ).
import { A3DObject, SceneObject, Entity } from '@aspose/3d';A3DObject
فئة القاعدة الجذرية لجميع @aspose/3d الكائنات. يطبق INamedObject.
export class A3DObject implements INamedObjectEnumerations
new A3DObject(name?: string)Enumerations
| Enumerations | Enumerations | Enumerations | Enumerations |
|---|---|---|---|
name | string | قراءة/كتابة | اسم قابل للقراءة البشرية. الافتراضي هو ''. |
properties | PropertyCollection | قراءة | مجموعة خصائص ديناميكية. تكرار باستخدام for...of أو استعلام بالاسم. |
Enumerations
findProperty(propertyName)
إرجاع الـ Property بالاسم المعطى، أو null إذا كان غير موجود.
findProperty(propertyName: string): Property | nullgetProperty(property)
إرجاع قيمة خاصية مسماة، أو null إذا لم تكن الخاصية موجودة.
getProperty(property: string): anysetProperty(property, value)
تعيين قيمة خاصية مسماة. يتم إنشاؤها إذا لم تكن موجودة مسبقًا.
setProperty(property: string, value: any): voidremoveProperty(property)
إزالة خاصية مسماة أو a Property instance من المجموعة.
removeProperty(property: string | Property): booleantoString()
Enumerations "ClassName(name)".
Enumerations
import { Scene } from '@aspose/3d';
const scene = new Scene();
const node = scene.rootNode.createChildNode('my_node');
node.setProperty('exportLayer', 2);
console.log(node.getProperty('exportLayer')); // 2
const prop = node.findProperty('name');
if (prop) {
console.log(prop.value); // my_node
console.log(prop.valueType); // string
}
for (const p of node.properties) {
console.log(`${p.name} = ${p.value}`);
}
node.removeProperty('exportLayer');
console.log(node.getProperty('exportLayer')); // null
SceneObject
Enumerations A3DObject مع إشارة إلى المالك Scene.
export class SceneObject extends A3DObjectEnumerations
A3DObject → SceneObject
تمثل فئة Transform تحويلًا محليًا مرفقًا بـ Node، وتوفر خصائص translation و rotation و scale.
| Enumerations | Enumerations | Enumerations | Enumerations |
|---|---|---|---|
scene | `Scene | null` | قراءة/كتابة |
Enumerations
import { Scene } from '@aspose/3d';
const scene = new Scene();
const node = scene.rootNode.createChildNode('child');
console.log(node.scene === scene); // true
Enumerations
قاعدة تجريدية لجميع الكائنات التي يمكن إرفاقها بـ a Node ككيان المشهد الأساسي لها. تشمل الفئات الفرعية Mesh, Camera, Light,، وأنواع الهندسة.
export class Entity extends SceneObjectEnumerations
A3DObject → SceneObject → Entity
Enumerations
| Enumerations | Enumerations | Enumerations | Enumerations |
|---|---|---|---|
parentNode | `Node | undefined` | قراءة/كتابة |
parentNodes | Node[] | قراءة | جميع عقد الآباء التي تشير إلى هذا الكيان (نسخة للقراءة فقط). في معظم المشاهد يكون للكيان أب واحد بالضبط. |
excluded | boolean | قراءة/كتابة | Enumerations true,، يتم استبعاد الكيان من العرض والتصدير. القيمة الافتراضية هي false. |
Enumerations
getBoundingBox()
إرجاع صندوق الحدود المحاذى للمحاور لهذا الكيان. يُرمى استثناء في الفئة الأساسية؛ يتم تنفيذها في الفئات الفرعية الملموسة مثل Mesh.
getBoundingBox(): BoundingBoxgetEntityRendererKey()
تُعيد مفتاح المُعالج الذي يحدد مسار العرض لهذا النوع من الكيانات. تُرمى استثناء في الفئة الأساسية؛ يُستخدم داخليًا.
Enumerations
import { Scene, Mesh } from '@aspose/3d';
const scene = new Scene();
const mesh = new Mesh();
// Add control points and a polygon
// ...
const node = scene.rootNode.createChildNode('geo', mesh);
console.log(mesh.parentNode === node); // true
console.log(mesh.excluded); // false
// Exclude from next export
mesh.excluded = true;