A3DObject, SceneObject, CustomObject — Aspose.3D FOSS for Java
पैकेज: com.aspose.threed (aspose-3d-foss 26.1.0)
ये तीन क्लासें Aspose.3D क्लास पदानुक्रम की आधार बनाती हैं। लाइब्रेरी में प्रत्येक सार्वजनिक ऑब्जेक्ट से विरासत में प्राप्त करता है A3DObject, जो एक नाम और एक गतिशील प्रॉपर्टी संग्रह प्रदान करता है।. SceneObject विस्तारित करता है A3DObject सीन सदस्यता ट्रैकिंग के साथ।. CustomObject एक हल्का कंक्रीट उपवर्ग है जो मनमाने उपयोगकर्ता मेटाडेटा को संग्रहीत करने के लिए है।.
A3DObject
सभी Aspose.3D प्रबंधित ऑब्जेक्ट्स के लिए मूल आधार क्लास। लाइब्रेरी में प्रत्येक नामित ऑब्जेक्ट – Node, Mesh, AnimationClip, Material, और इसी तरह – से विरासत में मिलता है A3DObject.
import com.aspose.threed.A3DObject;Example
| Example | Example | Example | Example | Example |
|---|---|---|---|---|
name | String | getName() | setName(String) | ऑब्जेक्ट का मानव‑पठनीय नाम। डिफ़ॉल्ट रूप से यह एक खाली स्ट्रिंग होता है।. |
properties | PropertyCollection | getProperties() | – | इस ऑब्जेक्ट से जुड़ा डायनेमिक प्रॉपर्टी कलेक्शन। इसे इटरेट करें या उपयोग करें findProperty() नामित लुकअप के लिए।. |
Example
findProperty(String propertyName)
इस ऑब्जेक्ट की नामित प्रॉपर्टी खोजें PropertyCollection और लौटाएँ Property इंस्टेंस, या null यदि नहीं मिला।.
| Example | Example | Example |
|---|---|---|
propertyName | String | खोजने के लिए नाम।. |
वापसी: Property या null
import com.aspose.threed.Scene;
Scene scene = new Scene();
Node node = scene.getRootNode().createChildNode("origin");
Property prop = node.findProperty("name");
if (prop != null) {
System.out.println(prop.getValue()); // "origin"
}getProperty(String property)
नामित प्रॉपर्टी का वर्तमान मान लौटाएँ, या null यदि प्रॉपर्टी मौजूद नहीं है।.
| Example | Example | Example |
|---|---|---|
property | String | प्रॉपर्टी का नाम।. |
वापसी: Object
Object val = node.getProperty("name");
System.out.println(val); // "origin"setProperty(String property, Object value)
नामित प्रॉपर्टी का मान सेट करें। यदि प्रॉपर्टी पहले से मौजूद नहीं है तो इसे बनाएं।.
| Example | Example | Example |
|---|---|---|
property | String | प्रॉपर्टी का नाम।. |
value | Object | नया मान।. |
वापसी: void
node.setProperty("layer", 3);
System.out.println(node.getProperty("layer")); // 3removeProperty(String property)
संग्रह से एक नामित प्रॉपर्टी को हटाएँ।.
| Example | Example | Example |
|---|---|---|
property | String या Property | प्रॉपर्टी नाम या Property हटाने के लिए इंस्टेंस।. |
रिटर्न्स: boolean – true यदि प्रॉपर्टी मिली और हटा दी गई।.
Example
import com.aspose.threed.Scene;
import com.aspose.threed.Node;
import com.aspose.threed.Property;
Scene scene = new Scene();
Node node = scene.getRootNode().createChildNode("my_node");
// Set and retrieve a custom property
node.setProperty("export_lod", 2);
System.out.println(node.getProperty("export_lod")); // 2
// Enumerate all properties
for (Property prop : node.getProperties()) {
System.out.println(" " + prop.getName() + " = " + prop.getValue());
}
// Find and inspect a specific property
Property p = node.findProperty("name");
if (p != null) {
System.out.println(p.getValueType()); // java.lang.String
}SceneObject
Example A3DObject स्वामित्व वाले के संदर्भ के साथ Scene. Node, Entity, और संबंधित क्लासेस इससे विरासत में लेते हैं SceneObject.
import com.aspose.threed.SceneObject;Example
A3DObject -> SceneObject
अतिरिक्त गुण
| Example | Example | Example | Example | Example |
|---|---|---|---|---|
scene | Scene | getScene() | setScene(Scene) | Example Scene यह ऑब्जेक्ट किसका है, या null यदि अभी तक संलग्न नहीं है।. |
import com.aspose.threed.Scene;
Scene scene = new Scene();
Node node = scene.getRootNode().createChildNode("child");
System.out.println(node.getScene() == scene); // trueCustomObject
हल्के वजन वाले कंक्रीट का उपवर्ग A3DObject जो केवल एक नाम और एक मनमाना PropertyCollection. इसका उपयोग किसी भी एंटिटी प्रकार को सबक्लास किए बिना एक सीन में free-form मेटाडेटा संलग्न करने के लिए करें।.
import com.aspose.threed.CustomObject;Example
A3DObject -> CustomObject
Example
CustomObject()
CustomObject(String name)Example
import com.aspose.threed.CustomObject;
import com.aspose.threed.Scene;
// Attach pipeline metadata to a scene as a custom object
CustomObject meta = new CustomObject("render_settings");
meta.setProperty("max_bounces", 8);
meta.setProperty("use_denoiser", true);
Scene scene = new Scene();
scene.getRootNode().setProperty("render_meta", meta.getName());
System.out.println(meta.getProperty("max_bounces")); // 8