Scene

Struct Scene 

Source
pub struct Scene {
Show 20 fields pub schema: Option<String>, pub format: String, pub creator: Option<String>, pub packages: Option<Vec<Package>>, pub status: Status, pub representations: Option<Vec<Representation>>, pub configuration_id: Option<String>, pub configuration_link: Option<String>, pub catalog: Option<Vec<CatalogEntry>>, pub base_path: Option<String>, pub hashes: HashMap<String, String>, pub redirections: Option<HashMap<String, String>>, pub scripts: Option<Vec<Script>>, pub geometries: Option<HashMap<String, Geometry>>, pub geometry_indexes: Option<HashMap<String, String>>, pub materials: Option<HashMap<String, Material>>, pub material_indexes: Option<HashMap<String, String>>, pub camera: Option<Camera>, pub products: Vec<Product>, pub com_products: Option<Vec<Commercial>>,
}
Expand description

The Scene is the central part of an OC data set. Each OC data set contains exactly one.

A Scene may contain initial product representations and/or updates.

A Scene may contain products that should be inserted instantly, as well as add-ons to be inserted later on and shown as placeholders before.

Fields§

§schema: Option<String>

Reference to the JSON schema.

§format: String

The mandatory attribute format must be structured as follows:

“OpenConfiguration_. [PRE]”

Legal combinations of . are: 1.0, 1.1 and 1.2

The optional postfix “ PRE“ marks a preliminary format.

§creator: Option<String>

This optional attribute contains informal information about the creator of this OC data set.

§packages: Option<Vec<Package>>

This optional attribute contains informal information about the projects used in this OC data set and its corresponding informal versions.

§status: Status

This attribute contains general status information about the Scene contents.

§representations: Option<Vec<Representation>>

The representations of the scene. Legal values are:

“Standard” - Real-time mesh data.

“CAD_BIM” - CAD/BIM volume bodies.

“Photo” - High-resolution mesh data.

This just lists possible usages and can be used for fast filtering, it does not influence the actual data. A “Photo” renderer would still use meshes attached as geometry.mesh

§configuration_id: Option<String>

This optional attribute may contain the id of a server-side session.

§configuration_link: Option<String>

This optional attribute may contain the link of the original configuration.

§catalog: Option<Vec<CatalogEntry>>

Optional, embedded catalog.

§base_path: Option<String>

The optional attribute provides a partial URI to be added to all relative asset uris. A valid base path should normally start with https:// or file://, and end with either a slash or the path separator character of the operating system. “Relative” basePath is always relative to the scene.json path, not to an application/deployment specific one! example.configurator.com/assets/oc/scene.json containing “tex.jpg” basepathes “gfx”, “./gfx”, “/gfx” are all resolved to the same example.configurator.com/assets/oc/gfx/tex.jpg

§hashes: HashMap<String, String>

The mandatory attribute provides unique content hashes for assets that are directly referenced in the OC data set. The specific hash algorithm is unspecified. It may be an MD5 hash of the binary content for instance. But low-res assets may use the same hash as the originals, they are derived from. So, the only operation that is legal for hash, is to compare them with an optionally existing one.

All assets should have an entry here as downloaders may iterate through this record rather than exploring the other data entities.

§redirections: Option<HashMap<String, String>>

Redirections maybe needed to convert absolute asset urls into file names, especially when compiling a self-contained OC zip. The attribute is optional.

Version: OC 1.3

§scripts: Option<Vec<Script>>

The optional attribute contains all client-side JavaScript packages.

§geometries: Option<HashMap<String, Geometry>>

The optional attribute provides an embedded geometry index.

IGXC Compatibility: now it’s embedded, self-contained geometries rather than just geometry names. Thus, separate assignments of geometry normal maps, deformations, etc. are removed. Also, the embedded geometry definition is optional. There can be external geometry definitions, too.

§geometry_indexes: Option<HashMap<String, String>>

The optional attribute provides links to external geometry indices. The key should be a two-level technical namespace to speedup the geometry lookup. The value must be an absolute or relative URI. The content of the value, must be de-serialized as GeometryIndex.

IGXC Compatibility: In IGXC, this concept did not exist.

§materials: Option<HashMap<String, Material>>

The optional attribute provides an embedded geometry index.

IGXC Compatibility: The embedded material definition is optional. There can be external material definitions, too.

§material_indexes: Option<HashMap<String, String>>

The optional attribute provides links to external geometry indices. The key should be a two-level technical namespace to speedup the geometry lookup. The value must be an absolute or relative URI. The content of the value, must be de-serialized as MaterialIndex.

IGXC Compatibility: In IGXC, this concept did not exist.

§camera: Option<Camera>

An optional camera setup to restore the camera in another viewer.

§products: Vec<Product>

The mandatory attribute contains the products to be inserted into/ updated in the client world.

IGXC Compatibility: in IGXC, there is only one product.

§com_products: Option<Vec<Commercial>>

Commercial products without an own visual representation.

Version: OC 1.3

Implementations§

Source§

impl Scene

Source

pub const fn schema() -> &'static str

Source

pub fn current_format() -> String

Source

pub fn new() -> Self

Source

pub fn new_with_format(format: String) -> Self

Trait Implementations§

Source§

impl Clone for Scene

Source§

fn clone(&self) -> Scene

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Scene

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Scene

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Scene

Source§

fn eq(&self, other: &Scene) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl SceneVisitorExtension for Scene

Source§

fn visit(&mut self, visitor: &mut dyn Visitor)

Source§

impl Serialize for Scene

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Scene

Auto Trait Implementations§

§

impl Freeze for Scene

§

impl RefUnwindSafe for Scene

§

impl Send for Scene

§

impl Sync for Scene

§

impl Unpin for Scene

§

impl UnwindSafe for Scene

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,