objc2_model_io/generated/
MDLMaterial.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-graphics")]
7use objc2_core_graphics::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12/// MDLMaterialSemantic
13///
14/// The material semantics are identifiers for material properties
15/// formally identified by one of the standard material descriptors.
16///
17///
18/// When files containing material properties are loaded and translated
19/// by ModelIO, an appropriate standard material descriptor will be
20/// chosen, and any properties translated from the loaded file can be
21/// retrieved using one of these semantics.
22///
23/// MDLMaterialSemanticBaseColor
24/// The inherent color of a surface to be used as a modulator during shading.
25/// Default is 50% gray
26///
27/// MDLMaterialSemanticSubsurface,
28/// The degree to which light scatters under the surface of a material
29///
30/// MDLMaterialSemanticMetallic
31/// A blend between a material behaving as a dielectric material at zero, and a
32/// metal at one.
33///
34/// MDLMaterialSemanticSpecular
35/// Specular response to incident light
36///
37/// MDLMaterialSemanticSpecularExponent
38/// Power of the specular exponent in the case that a Blinn/Phong BSDF is in use.
39///
40/// MDLMaterialSemanticSpecularTint
41/// At zero, the specular highlight will use the hue, saturation, and intensity
42/// of incoming light to color the specular response; at one, the material's
43/// base color, and the light's intensity will be used.
44///
45/// MDLMaterialSemanticRoughness
46/// Controls diffuse and specular response. A value of zero is smooth and shiny.
47/// At one, a diffuse material will retroreflect, and the specular highlight
48/// will be very spread out.
49///
50/// MDLMaterialSemanticAnisotropic
51/// The degree to which the specular highlight is elongated in the direction of
52/// the local tangent basis. A mesh that does not have a tangent basis will not
53/// respond to this parameter.
54///
55/// MDLMaterialSemanticAnisotropicRotation
56/// The degree to which the anisotropy is rotated relative to the direction of the
57/// local tangent basis. Values from zero to one are mapped to zero to two PI.
58///
59/// MDLMaterialSemanticSheen
60/// A specular tint that appears at glancing angles on an object
61///
62/// MDLMaterialSemanticSheenTint
63/// At zero, the specular highlight will use the hue, saturation, and intensity
64/// of incoming light to color the specular response; at one, the material's
65/// base color, and the light's intensity will be used.
66///
67/// MDLMaterialSemanticClearcoat
68/// A second specular highlight, much like the gloss that results from a clear
69/// coat on an automotive finish
70///
71/// MDLMaterialSemanticClearcoatGloss
72/// The glossiness of the clear coat highlight.
73///
74/// MDLMaterialSemanticEmission
75/// A value that is to be emitted as radiance by a surface
76///
77/// MDLMaterialSemanticBump
78/// A value that perturbs surface normals according to the local gradient of
79/// the property
80///
81/// MDLMaterialSemanticOpacity
82/// The opacity of the surface
83///
84/// MDLMaterialSemanticInterfaceIndexOfRefraction
85/// n1 in Schlick's equation, typically 1.0 for air
86///
87/// MDLMaterialSemanticMaterialIndexOfRefraction
88/// n2 in Schlick's equation
89///
90/// MDLMaterialSemanticObjectSpaceNormal
91/// A value that perturbs surface normals in object space
92///
93/// MDLMaterialSemanticTangentSpaceNormal
94/// A value that perturbs surface normals in a local tangent space
95///
96/// MDLMaterialSemanticDisplacement
97/// Displacement of a surface relative to surface normal
98///
99/// MDLMaterialSemanticDisplacementScale
100/// Scaling factor for displacement
101///
102/// MDLMaterialSemanticAmbientOcclusion
103/// Ambient occlusion describes the accessibility of the surface to the
104/// surrounding radiant environment and is typically used to attenuate it. It is
105/// not intended to attenuate direct illumination sources.
106///
107/// MDLMaterialSemanticAmbientOcclusionScale
108/// The degree to which the ambient occlusion values are applied
109///
110/// MDLMaterialSemanticUserDefined = 0x8000
111/// Properties with this value are created when material properties are
112/// translated for which no known semantic applies.
113/// Semantics defined at greater than this value are available to be user defined.
114/// The first value is also used to indicate
115///
116/// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterialsemantic?language=objc)
117// NS_ENUM
118#[repr(transparent)]
119#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
120pub struct MDLMaterialSemantic(pub NSUInteger);
121impl MDLMaterialSemantic {
122    #[doc(alias = "MDLMaterialSemanticBaseColor")]
123    pub const BaseColor: Self = Self(0);
124    #[doc(alias = "MDLMaterialSemanticSubsurface")]
125    pub const Subsurface: Self = Self(1);
126    #[doc(alias = "MDLMaterialSemanticMetallic")]
127    pub const Metallic: Self = Self(2);
128    #[doc(alias = "MDLMaterialSemanticSpecular")]
129    pub const Specular: Self = Self(3);
130    #[doc(alias = "MDLMaterialSemanticSpecularExponent")]
131    pub const SpecularExponent: Self = Self(4);
132    #[doc(alias = "MDLMaterialSemanticSpecularTint")]
133    pub const SpecularTint: Self = Self(5);
134    #[doc(alias = "MDLMaterialSemanticRoughness")]
135    pub const Roughness: Self = Self(6);
136    #[doc(alias = "MDLMaterialSemanticAnisotropic")]
137    pub const Anisotropic: Self = Self(7);
138    #[doc(alias = "MDLMaterialSemanticAnisotropicRotation")]
139    pub const AnisotropicRotation: Self = Self(8);
140    #[doc(alias = "MDLMaterialSemanticSheen")]
141    pub const Sheen: Self = Self(9);
142    #[doc(alias = "MDLMaterialSemanticSheenTint")]
143    pub const SheenTint: Self = Self(10);
144    #[doc(alias = "MDLMaterialSemanticClearcoat")]
145    pub const Clearcoat: Self = Self(11);
146    #[doc(alias = "MDLMaterialSemanticClearcoatGloss")]
147    pub const ClearcoatGloss: Self = Self(12);
148    #[doc(alias = "MDLMaterialSemanticEmission")]
149    pub const Emission: Self = Self(13);
150    #[doc(alias = "MDLMaterialSemanticBump")]
151    pub const Bump: Self = Self(14);
152    #[doc(alias = "MDLMaterialSemanticOpacity")]
153    pub const Opacity: Self = Self(15);
154    #[doc(alias = "MDLMaterialSemanticInterfaceIndexOfRefraction")]
155    pub const InterfaceIndexOfRefraction: Self = Self(16);
156    #[doc(alias = "MDLMaterialSemanticMaterialIndexOfRefraction")]
157    pub const MaterialIndexOfRefraction: Self = Self(17);
158    #[doc(alias = "MDLMaterialSemanticObjectSpaceNormal")]
159    pub const ObjectSpaceNormal: Self = Self(18);
160    #[doc(alias = "MDLMaterialSemanticTangentSpaceNormal")]
161    pub const TangentSpaceNormal: Self = Self(19);
162    #[doc(alias = "MDLMaterialSemanticDisplacement")]
163    pub const Displacement: Self = Self(20);
164    #[doc(alias = "MDLMaterialSemanticDisplacementScale")]
165    pub const DisplacementScale: Self = Self(21);
166    #[doc(alias = "MDLMaterialSemanticAmbientOcclusion")]
167    pub const AmbientOcclusion: Self = Self(22);
168    #[doc(alias = "MDLMaterialSemanticAmbientOcclusionScale")]
169    pub const AmbientOcclusionScale: Self = Self(23);
170    #[doc(alias = "MDLMaterialSemanticNone")]
171    pub const None: Self = Self(0x8000);
172    #[doc(alias = "MDLMaterialSemanticUserDefined")]
173    pub const UserDefined: Self = Self(0x8001);
174}
175
176unsafe impl Encode for MDLMaterialSemantic {
177    const ENCODING: Encoding = NSUInteger::ENCODING;
178}
179
180unsafe impl RefEncode for MDLMaterialSemantic {
181    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
182}
183
184/// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterialpropertytype?language=objc)
185// NS_ENUM
186#[repr(transparent)]
187#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
188pub struct MDLMaterialPropertyType(pub NSUInteger);
189impl MDLMaterialPropertyType {
190    #[doc(alias = "MDLMaterialPropertyTypeNone")]
191    pub const None: Self = Self(0);
192    #[doc(alias = "MDLMaterialPropertyTypeString")]
193    pub const String: Self = Self(1);
194    #[doc(alias = "MDLMaterialPropertyTypeURL")]
195    pub const URL: Self = Self(2);
196    #[doc(alias = "MDLMaterialPropertyTypeTexture")]
197    pub const Texture: Self = Self(3);
198    #[doc(alias = "MDLMaterialPropertyTypeColor")]
199    pub const Color: Self = Self(4);
200    #[doc(alias = "MDLMaterialPropertyTypeFloat")]
201    pub const Float: Self = Self(5);
202    #[doc(alias = "MDLMaterialPropertyTypeFloat2")]
203    pub const Float2: Self = Self(6);
204    #[doc(alias = "MDLMaterialPropertyTypeFloat3")]
205    pub const Float3: Self = Self(7);
206    #[doc(alias = "MDLMaterialPropertyTypeFloat4")]
207    pub const Float4: Self = Self(8);
208    #[doc(alias = "MDLMaterialPropertyTypeMatrix44")]
209    pub const Matrix44: Self = Self(9);
210    #[doc(alias = "MDLMaterialPropertyTypeBuffer")]
211    pub const Buffer: Self = Self(10);
212}
213
214unsafe impl Encode for MDLMaterialPropertyType {
215    const ENCODING: Encoding = NSUInteger::ENCODING;
216}
217
218unsafe impl RefEncode for MDLMaterialPropertyType {
219    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
220}
221
222/// Texture filtering
223///
224/// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterialtexturewrapmode?language=objc)
225// NS_ENUM
226#[repr(transparent)]
227#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
228pub struct MDLMaterialTextureWrapMode(pub NSUInteger);
229impl MDLMaterialTextureWrapMode {
230    #[doc(alias = "MDLMaterialTextureWrapModeClamp")]
231    pub const Clamp: Self = Self(0);
232    #[doc(alias = "MDLMaterialTextureWrapModeRepeat")]
233    pub const Repeat: Self = Self(1);
234    #[doc(alias = "MDLMaterialTextureWrapModeMirror")]
235    pub const Mirror: Self = Self(2);
236}
237
238unsafe impl Encode for MDLMaterialTextureWrapMode {
239    const ENCODING: Encoding = NSUInteger::ENCODING;
240}
241
242unsafe impl RefEncode for MDLMaterialTextureWrapMode {
243    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
244}
245
246/// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterialtexturefiltermode?language=objc)
247// NS_ENUM
248#[repr(transparent)]
249#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
250pub struct MDLMaterialTextureFilterMode(pub NSUInteger);
251impl MDLMaterialTextureFilterMode {
252    #[doc(alias = "MDLMaterialTextureFilterModeNearest")]
253    pub const Nearest: Self = Self(0);
254    #[doc(alias = "MDLMaterialTextureFilterModeLinear")]
255    pub const Linear: Self = Self(1);
256}
257
258unsafe impl Encode for MDLMaterialTextureFilterMode {
259    const ENCODING: Encoding = NSUInteger::ENCODING;
260}
261
262unsafe impl RefEncode for MDLMaterialTextureFilterMode {
263    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
264}
265
266/// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterialmipmapfiltermode?language=objc)
267// NS_ENUM
268#[repr(transparent)]
269#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
270pub struct MDLMaterialMipMapFilterMode(pub NSUInteger);
271impl MDLMaterialMipMapFilterMode {
272    #[doc(alias = "MDLMaterialMipMapFilterModeNearest")]
273    pub const Nearest: Self = Self(0);
274    #[doc(alias = "MDLMaterialMipMapFilterModeLinear")]
275    pub const Linear: Self = Self(1);
276}
277
278unsafe impl Encode for MDLMaterialMipMapFilterMode {
279    const ENCODING: Encoding = NSUInteger::ENCODING;
280}
281
282unsafe impl RefEncode for MDLMaterialMipMapFilterMode {
283    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
284}
285
286extern_class!(
287    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdltexturefilter?language=objc)
288    #[unsafe(super(NSObject))]
289    #[derive(Debug, PartialEq, Eq, Hash)]
290    pub struct MDLTextureFilter;
291);
292
293extern_conformance!(
294    unsafe impl NSObjectProtocol for MDLTextureFilter {}
295);
296
297impl MDLTextureFilter {
298    extern_methods!(
299        #[unsafe(method(sWrapMode))]
300        #[unsafe(method_family = none)]
301        pub unsafe fn sWrapMode(&self) -> MDLMaterialTextureWrapMode;
302
303        /// Setter for [`sWrapMode`][Self::sWrapMode].
304        #[unsafe(method(setSWrapMode:))]
305        #[unsafe(method_family = none)]
306        pub unsafe fn setSWrapMode(&self, s_wrap_mode: MDLMaterialTextureWrapMode);
307
308        #[unsafe(method(tWrapMode))]
309        #[unsafe(method_family = none)]
310        pub unsafe fn tWrapMode(&self) -> MDLMaterialTextureWrapMode;
311
312        /// Setter for [`tWrapMode`][Self::tWrapMode].
313        #[unsafe(method(setTWrapMode:))]
314        #[unsafe(method_family = none)]
315        pub unsafe fn setTWrapMode(&self, t_wrap_mode: MDLMaterialTextureWrapMode);
316
317        #[unsafe(method(rWrapMode))]
318        #[unsafe(method_family = none)]
319        pub unsafe fn rWrapMode(&self) -> MDLMaterialTextureWrapMode;
320
321        /// Setter for [`rWrapMode`][Self::rWrapMode].
322        #[unsafe(method(setRWrapMode:))]
323        #[unsafe(method_family = none)]
324        pub unsafe fn setRWrapMode(&self, r_wrap_mode: MDLMaterialTextureWrapMode);
325
326        #[unsafe(method(minFilter))]
327        #[unsafe(method_family = none)]
328        pub unsafe fn minFilter(&self) -> MDLMaterialTextureFilterMode;
329
330        /// Setter for [`minFilter`][Self::minFilter].
331        #[unsafe(method(setMinFilter:))]
332        #[unsafe(method_family = none)]
333        pub unsafe fn setMinFilter(&self, min_filter: MDLMaterialTextureFilterMode);
334
335        #[unsafe(method(magFilter))]
336        #[unsafe(method_family = none)]
337        pub unsafe fn magFilter(&self) -> MDLMaterialTextureFilterMode;
338
339        /// Setter for [`magFilter`][Self::magFilter].
340        #[unsafe(method(setMagFilter:))]
341        #[unsafe(method_family = none)]
342        pub unsafe fn setMagFilter(&self, mag_filter: MDLMaterialTextureFilterMode);
343
344        #[unsafe(method(mipFilter))]
345        #[unsafe(method_family = none)]
346        pub unsafe fn mipFilter(&self) -> MDLMaterialMipMapFilterMode;
347
348        /// Setter for [`mipFilter`][Self::mipFilter].
349        #[unsafe(method(setMipFilter:))]
350        #[unsafe(method_family = none)]
351        pub unsafe fn setMipFilter(&self, mip_filter: MDLMaterialMipMapFilterMode);
352    );
353}
354
355/// Methods declared on superclass `NSObject`.
356impl MDLTextureFilter {
357    extern_methods!(
358        #[unsafe(method(init))]
359        #[unsafe(method_family = init)]
360        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
361
362        #[unsafe(method(new))]
363        #[unsafe(method_family = new)]
364        pub unsafe fn new() -> Retained<Self>;
365    );
366}
367
368extern_class!(
369    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdltexturesampler?language=objc)
370    #[unsafe(super(NSObject))]
371    #[derive(Debug, PartialEq, Eq, Hash)]
372    pub struct MDLTextureSampler;
373);
374
375extern_conformance!(
376    unsafe impl NSObjectProtocol for MDLTextureSampler {}
377);
378
379impl MDLTextureSampler {
380    extern_methods!(
381        #[cfg(feature = "MDLTexture")]
382        #[unsafe(method(texture))]
383        #[unsafe(method_family = none)]
384        pub unsafe fn texture(&self) -> Option<Retained<MDLTexture>>;
385
386        #[cfg(feature = "MDLTexture")]
387        /// Setter for [`texture`][Self::texture].
388        #[unsafe(method(setTexture:))]
389        #[unsafe(method_family = none)]
390        pub unsafe fn setTexture(&self, texture: Option<&MDLTexture>);
391
392        #[unsafe(method(hardwareFilter))]
393        #[unsafe(method_family = none)]
394        pub unsafe fn hardwareFilter(&self) -> Option<Retained<MDLTextureFilter>>;
395
396        /// Setter for [`hardwareFilter`][Self::hardwareFilter].
397        #[unsafe(method(setHardwareFilter:))]
398        #[unsafe(method_family = none)]
399        pub unsafe fn setHardwareFilter(&self, hardware_filter: Option<&MDLTextureFilter>);
400
401        #[cfg(feature = "MDLTransform")]
402        #[unsafe(method(transform))]
403        #[unsafe(method_family = none)]
404        pub unsafe fn transform(&self) -> Option<Retained<MDLTransform>>;
405
406        #[cfg(feature = "MDLTransform")]
407        /// Setter for [`transform`][Self::transform].
408        #[unsafe(method(setTransform:))]
409        #[unsafe(method_family = none)]
410        pub unsafe fn setTransform(&self, transform: Option<&MDLTransform>);
411    );
412}
413
414/// Methods declared on superclass `NSObject`.
415impl MDLTextureSampler {
416    extern_methods!(
417        #[unsafe(method(init))]
418        #[unsafe(method_family = init)]
419        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
420
421        #[unsafe(method(new))]
422        #[unsafe(method_family = new)]
423        pub unsafe fn new() -> Retained<Self>;
424    );
425}
426
427extern_class!(
428    /// If a color is encoded in a floatN property, it is to be interpreted as
429    /// a Rec 709 color.
430    ///
431    /// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterialproperty?language=objc)
432    #[unsafe(super(NSObject))]
433    #[derive(Debug, PartialEq, Eq, Hash)]
434    pub struct MDLMaterialProperty;
435);
436
437#[cfg(feature = "MDLTypes")]
438extern_conformance!(
439    unsafe impl MDLNamed for MDLMaterialProperty {}
440);
441
442extern_conformance!(
443    unsafe impl NSCopying for MDLMaterialProperty {}
444);
445
446unsafe impl CopyingHelper for MDLMaterialProperty {
447    type Result = Self;
448}
449
450extern_conformance!(
451    unsafe impl NSObjectProtocol for MDLMaterialProperty {}
452);
453
454impl MDLMaterialProperty {
455    extern_methods!(
456        #[unsafe(method(init))]
457        #[unsafe(method_family = init)]
458        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
459
460        #[unsafe(method(initWithName:semantic:))]
461        #[unsafe(method_family = init)]
462        pub unsafe fn initWithName_semantic(
463            this: Allocated<Self>,
464            name: &NSString,
465            semantic: MDLMaterialSemantic,
466        ) -> Retained<Self>;
467
468        #[unsafe(method(initWithName:semantic:float:))]
469        #[unsafe(method_family = init)]
470        pub unsafe fn initWithName_semantic_float(
471            this: Allocated<Self>,
472            name: &NSString,
473            semantic: MDLMaterialSemantic,
474            value: c_float,
475        ) -> Retained<Self>;
476
477        #[unsafe(method(initWithName:semantic:URL:))]
478        #[unsafe(method_family = init)]
479        pub unsafe fn initWithName_semantic_URL(
480            this: Allocated<Self>,
481            name: &NSString,
482            semantic: MDLMaterialSemantic,
483            url: Option<&NSURL>,
484        ) -> Retained<Self>;
485
486        #[unsafe(method(initWithName:semantic:string:))]
487        #[unsafe(method_family = init)]
488        pub unsafe fn initWithName_semantic_string(
489            this: Allocated<Self>,
490            name: &NSString,
491            semantic: MDLMaterialSemantic,
492            string: Option<&NSString>,
493        ) -> Retained<Self>;
494
495        #[unsafe(method(initWithName:semantic:textureSampler:))]
496        #[unsafe(method_family = init)]
497        pub unsafe fn initWithName_semantic_textureSampler(
498            this: Allocated<Self>,
499            name: &NSString,
500            semantic: MDLMaterialSemantic,
501            texture_sampler: Option<&MDLTextureSampler>,
502        ) -> Retained<Self>;
503
504        #[cfg(feature = "objc2-core-graphics")]
505        #[unsafe(method(initWithName:semantic:color:))]
506        #[unsafe(method_family = init)]
507        pub unsafe fn initWithName_semantic_color(
508            this: Allocated<Self>,
509            name: &NSString,
510            semantic: MDLMaterialSemantic,
511            color: &CGColor,
512        ) -> Retained<Self>;
513
514        #[unsafe(method(setProperties:))]
515        #[unsafe(method_family = none)]
516        pub unsafe fn setProperties(&self, property: &MDLMaterialProperty);
517
518        #[unsafe(method(semantic))]
519        #[unsafe(method_family = none)]
520        pub unsafe fn semantic(&self) -> MDLMaterialSemantic;
521
522        /// Setter for [`semantic`][Self::semantic].
523        #[unsafe(method(setSemantic:))]
524        #[unsafe(method_family = none)]
525        pub unsafe fn setSemantic(&self, semantic: MDLMaterialSemantic);
526
527        #[unsafe(method(type))]
528        #[unsafe(method_family = none)]
529        pub unsafe fn r#type(&self) -> MDLMaterialPropertyType;
530
531        /// Setter for [`type`][Self::type].
532        #[unsafe(method(setType:))]
533        #[unsafe(method_family = none)]
534        pub unsafe fn setType(&self, r#type: MDLMaterialPropertyType);
535
536        /// See: MDLNamed
537        #[unsafe(method(name))]
538        #[unsafe(method_family = none)]
539        pub unsafe fn name(&self) -> Retained<NSString>;
540
541        /// Setter for [`name`][Self::name].
542        ///
543        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
544        #[unsafe(method(setName:))]
545        #[unsafe(method_family = none)]
546        pub unsafe fn setName(&self, name: &NSString);
547
548        #[unsafe(method(stringValue))]
549        #[unsafe(method_family = none)]
550        pub unsafe fn stringValue(&self) -> Option<Retained<NSString>>;
551
552        /// Setter for [`stringValue`][Self::stringValue].
553        ///
554        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
555        #[unsafe(method(setStringValue:))]
556        #[unsafe(method_family = none)]
557        pub unsafe fn setStringValue(&self, string_value: Option<&NSString>);
558
559        #[unsafe(method(URLValue))]
560        #[unsafe(method_family = none)]
561        pub unsafe fn URLValue(&self) -> Option<Retained<NSURL>>;
562
563        /// Setter for [`URLValue`][Self::URLValue].
564        ///
565        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
566        #[unsafe(method(setURLValue:))]
567        #[unsafe(method_family = none)]
568        pub unsafe fn setURLValue(&self, url_value: Option<&NSURL>);
569
570        #[unsafe(method(textureSamplerValue))]
571        #[unsafe(method_family = none)]
572        pub unsafe fn textureSamplerValue(&self) -> Option<Retained<MDLTextureSampler>>;
573
574        /// Setter for [`textureSamplerValue`][Self::textureSamplerValue].
575        #[unsafe(method(setTextureSamplerValue:))]
576        #[unsafe(method_family = none)]
577        pub unsafe fn setTextureSamplerValue(
578            &self,
579            texture_sampler_value: Option<&MDLTextureSampler>,
580        );
581
582        #[cfg(feature = "objc2-core-graphics")]
583        #[unsafe(method(color))]
584        #[unsafe(method_family = none)]
585        pub unsafe fn color(&self) -> Option<Retained<CGColor>>;
586
587        #[cfg(feature = "objc2-core-graphics")]
588        /// Setter for [`color`][Self::color].
589        #[unsafe(method(setColor:))]
590        #[unsafe(method_family = none)]
591        pub unsafe fn setColor(&self, color: Option<&CGColor>);
592
593        #[unsafe(method(floatValue))]
594        #[unsafe(method_family = none)]
595        pub unsafe fn floatValue(&self) -> c_float;
596
597        /// Setter for [`floatValue`][Self::floatValue].
598        #[unsafe(method(setFloatValue:))]
599        #[unsafe(method_family = none)]
600        pub unsafe fn setFloatValue(&self, float_value: c_float);
601
602        #[unsafe(method(luminance))]
603        #[unsafe(method_family = none)]
604        pub unsafe fn luminance(&self) -> c_float;
605
606        /// Setter for [`luminance`][Self::luminance].
607        #[unsafe(method(setLuminance:))]
608        #[unsafe(method_family = none)]
609        pub unsafe fn setLuminance(&self, luminance: c_float);
610    );
611}
612
613/// Methods declared on superclass `NSObject`.
614impl MDLMaterialProperty {
615    extern_methods!(
616        #[unsafe(method(new))]
617        #[unsafe(method_family = new)]
618        pub unsafe fn new() -> Retained<Self>;
619    );
620}
621
622extern_class!(
623    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterialpropertyconnection?language=objc)
624    #[unsafe(super(NSObject))]
625    #[derive(Debug, PartialEq, Eq, Hash)]
626    pub struct MDLMaterialPropertyConnection;
627);
628
629#[cfg(feature = "MDLTypes")]
630extern_conformance!(
631    unsafe impl MDLNamed for MDLMaterialPropertyConnection {}
632);
633
634extern_conformance!(
635    unsafe impl NSObjectProtocol for MDLMaterialPropertyConnection {}
636);
637
638impl MDLMaterialPropertyConnection {
639    extern_methods!(
640        #[unsafe(method(init))]
641        #[unsafe(method_family = init)]
642        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
643
644        /// Connects the output to the input
645        #[unsafe(method(initWithOutput:input:))]
646        #[unsafe(method_family = init)]
647        pub unsafe fn initWithOutput_input(
648            this: Allocated<Self>,
649            output: &MDLMaterialProperty,
650            input: &MDLMaterialProperty,
651        ) -> Retained<Self>;
652
653        #[unsafe(method(output))]
654        #[unsafe(method_family = none)]
655        pub unsafe fn output(&self) -> Option<Retained<MDLMaterialProperty>>;
656
657        #[unsafe(method(input))]
658        #[unsafe(method_family = none)]
659        pub unsafe fn input(&self) -> Option<Retained<MDLMaterialProperty>>;
660    );
661}
662
663/// Methods declared on superclass `NSObject`.
664impl MDLMaterialPropertyConnection {
665    extern_methods!(
666        #[unsafe(method(new))]
667        #[unsafe(method_family = new)]
668        pub unsafe fn new() -> Retained<Self>;
669    );
670}
671
672extern_class!(
673    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterialpropertynode?language=objc)
674    #[unsafe(super(NSObject))]
675    #[derive(Debug, PartialEq, Eq, Hash)]
676    pub struct MDLMaterialPropertyNode;
677);
678
679#[cfg(feature = "MDLTypes")]
680extern_conformance!(
681    unsafe impl MDLNamed for MDLMaterialPropertyNode {}
682);
683
684extern_conformance!(
685    unsafe impl NSObjectProtocol for MDLMaterialPropertyNode {}
686);
687
688impl MDLMaterialPropertyNode {
689    extern_methods!(
690        #[unsafe(method(init))]
691        #[unsafe(method_family = init)]
692        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
693
694        #[cfg(feature = "block2")]
695        #[unsafe(method(initWithInputs:outputs:evaluationFunction:))]
696        #[unsafe(method_family = init)]
697        pub unsafe fn initWithInputs_outputs_evaluationFunction(
698            this: Allocated<Self>,
699            inputs: &NSArray<MDLMaterialProperty>,
700            outputs: &NSArray<MDLMaterialProperty>,
701            function: &block2::DynBlock<dyn Fn(NonNull<MDLMaterialPropertyNode>)>,
702        ) -> Retained<Self>;
703
704        #[cfg(feature = "block2")]
705        /// # Safety
706        ///
707        /// The returned block's argument must be a valid pointer.
708        #[unsafe(method(evaluationFunction))]
709        #[unsafe(method_family = none)]
710        pub unsafe fn evaluationFunction(
711            &self,
712        ) -> NonNull<block2::DynBlock<dyn Fn(NonNull<MDLMaterialPropertyNode>)>>;
713
714        #[cfg(feature = "block2")]
715        /// Setter for [`evaluationFunction`][Self::evaluationFunction].
716        ///
717        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
718        #[unsafe(method(setEvaluationFunction:))]
719        #[unsafe(method_family = none)]
720        pub unsafe fn setEvaluationFunction(
721            &self,
722            evaluation_function: &block2::DynBlock<dyn Fn(NonNull<MDLMaterialPropertyNode>)>,
723        );
724
725        #[unsafe(method(inputs))]
726        #[unsafe(method_family = none)]
727        pub unsafe fn inputs(&self) -> Retained<NSArray<MDLMaterialProperty>>;
728
729        #[unsafe(method(outputs))]
730        #[unsafe(method_family = none)]
731        pub unsafe fn outputs(&self) -> Retained<NSArray<MDLMaterialProperty>>;
732    );
733}
734
735/// Methods declared on superclass `NSObject`.
736impl MDLMaterialPropertyNode {
737    extern_methods!(
738        #[unsafe(method(new))]
739        #[unsafe(method_family = new)]
740        pub unsafe fn new() -> Retained<Self>;
741    );
742}
743
744extern_class!(
745    /// inputs and outputs will contain all of the inputs and outputs
746    /// external to the graph, which are all the inputs and outputs not
747    /// internally connected to something
748    ///
749    /// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterialpropertygraph?language=objc)
750    #[unsafe(super(MDLMaterialPropertyNode, NSObject))]
751    #[derive(Debug, PartialEq, Eq, Hash)]
752    pub struct MDLMaterialPropertyGraph;
753);
754
755#[cfg(feature = "MDLTypes")]
756extern_conformance!(
757    unsafe impl MDLNamed for MDLMaterialPropertyGraph {}
758);
759
760extern_conformance!(
761    unsafe impl NSObjectProtocol for MDLMaterialPropertyGraph {}
762);
763
764impl MDLMaterialPropertyGraph {
765    extern_methods!(
766        #[unsafe(method(init))]
767        #[unsafe(method_family = init)]
768        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
769
770        #[unsafe(method(initWithNodes:connections:))]
771        #[unsafe(method_family = init)]
772        pub unsafe fn initWithNodes_connections(
773            this: Allocated<Self>,
774            nodes: &NSArray<MDLMaterialPropertyNode>,
775            connections: &NSArray<MDLMaterialPropertyConnection>,
776        ) -> Retained<Self>;
777
778        #[unsafe(method(evaluate))]
779        #[unsafe(method_family = none)]
780        pub unsafe fn evaluate(&self);
781
782        #[unsafe(method(nodes))]
783        #[unsafe(method_family = none)]
784        pub unsafe fn nodes(&self) -> Retained<NSArray<MDLMaterialPropertyNode>>;
785
786        #[unsafe(method(connections))]
787        #[unsafe(method_family = none)]
788        pub unsafe fn connections(&self) -> Retained<NSArray<MDLMaterialPropertyConnection>>;
789    );
790}
791
792/// Methods declared on superclass `MDLMaterialPropertyNode`.
793impl MDLMaterialPropertyGraph {
794    extern_methods!(
795        #[cfg(feature = "block2")]
796        #[unsafe(method(initWithInputs:outputs:evaluationFunction:))]
797        #[unsafe(method_family = init)]
798        pub unsafe fn initWithInputs_outputs_evaluationFunction(
799            this: Allocated<Self>,
800            inputs: &NSArray<MDLMaterialProperty>,
801            outputs: &NSArray<MDLMaterialProperty>,
802            function: &block2::DynBlock<dyn Fn(NonNull<MDLMaterialPropertyNode>)>,
803        ) -> Retained<Self>;
804    );
805}
806
807/// Methods declared on superclass `NSObject`.
808impl MDLMaterialPropertyGraph {
809    extern_methods!(
810        #[unsafe(method(new))]
811        #[unsafe(method_family = new)]
812        pub unsafe fn new() -> Retained<Self>;
813    );
814}
815
816extern_class!(
817    /// The base scattering function is Lambertian, with a Blinn-Phong specular response.
818    /// Specular power for Blinn-Phong can be derived from the roughness property using
819    /// an approximation.
820    ///
821    /// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlscatteringfunction?language=objc)
822    #[unsafe(super(NSObject))]
823    #[derive(Debug, PartialEq, Eq, Hash)]
824    pub struct MDLScatteringFunction;
825);
826
827#[cfg(feature = "MDLTypes")]
828extern_conformance!(
829    unsafe impl MDLNamed for MDLScatteringFunction {}
830);
831
832extern_conformance!(
833    unsafe impl NSObjectProtocol for MDLScatteringFunction {}
834);
835
836impl MDLScatteringFunction {
837    extern_methods!(
838        /// See: MDLNamed
839        #[unsafe(method(name))]
840        #[unsafe(method_family = none)]
841        pub unsafe fn name(&self) -> Retained<NSString>;
842
843        /// Setter for [`name`][Self::name].
844        ///
845        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
846        #[unsafe(method(setName:))]
847        #[unsafe(method_family = none)]
848        pub unsafe fn setName(&self, name: &NSString);
849
850        #[unsafe(method(baseColor))]
851        #[unsafe(method_family = none)]
852        pub unsafe fn baseColor(&self) -> Retained<MDLMaterialProperty>;
853
854        #[unsafe(method(emission))]
855        #[unsafe(method_family = none)]
856        pub unsafe fn emission(&self) -> Retained<MDLMaterialProperty>;
857
858        #[unsafe(method(specular))]
859        #[unsafe(method_family = none)]
860        pub unsafe fn specular(&self) -> Retained<MDLMaterialProperty>;
861
862        #[unsafe(method(materialIndexOfRefraction))]
863        #[unsafe(method_family = none)]
864        pub unsafe fn materialIndexOfRefraction(&self) -> Retained<MDLMaterialProperty>;
865
866        #[unsafe(method(interfaceIndexOfRefraction))]
867        #[unsafe(method_family = none)]
868        pub unsafe fn interfaceIndexOfRefraction(&self) -> Retained<MDLMaterialProperty>;
869
870        #[unsafe(method(normal))]
871        #[unsafe(method_family = none)]
872        pub unsafe fn normal(&self) -> Retained<MDLMaterialProperty>;
873
874        #[unsafe(method(ambientOcclusion))]
875        #[unsafe(method_family = none)]
876        pub unsafe fn ambientOcclusion(&self) -> Retained<MDLMaterialProperty>;
877
878        #[unsafe(method(ambientOcclusionScale))]
879        #[unsafe(method_family = none)]
880        pub unsafe fn ambientOcclusionScale(&self) -> Retained<MDLMaterialProperty>;
881    );
882}
883
884/// Methods declared on superclass `NSObject`.
885impl MDLScatteringFunction {
886    extern_methods!(
887        #[unsafe(method(init))]
888        #[unsafe(method_family = init)]
889        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
890
891        #[unsafe(method(new))]
892        #[unsafe(method_family = new)]
893        pub unsafe fn new() -> Retained<Self>;
894    );
895}
896
897extern_class!(
898    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlphysicallyplausiblescatteringfunction?language=objc)
899    #[unsafe(super(MDLScatteringFunction, NSObject))]
900    #[derive(Debug, PartialEq, Eq, Hash)]
901    pub struct MDLPhysicallyPlausibleScatteringFunction;
902);
903
904#[cfg(feature = "MDLTypes")]
905extern_conformance!(
906    unsafe impl MDLNamed for MDLPhysicallyPlausibleScatteringFunction {}
907);
908
909extern_conformance!(
910    unsafe impl NSObjectProtocol for MDLPhysicallyPlausibleScatteringFunction {}
911);
912
913impl MDLPhysicallyPlausibleScatteringFunction {
914    extern_methods!(
915        #[unsafe(method(version))]
916        #[unsafe(method_family = none)]
917        pub unsafe fn version(&self) -> NSInteger;
918
919        #[unsafe(method(subsurface))]
920        #[unsafe(method_family = none)]
921        pub unsafe fn subsurface(&self) -> Retained<MDLMaterialProperty>;
922
923        #[unsafe(method(metallic))]
924        #[unsafe(method_family = none)]
925        pub unsafe fn metallic(&self) -> Retained<MDLMaterialProperty>;
926
927        #[unsafe(method(specularAmount))]
928        #[unsafe(method_family = none)]
929        pub unsafe fn specularAmount(&self) -> Retained<MDLMaterialProperty>;
930
931        #[unsafe(method(specularTint))]
932        #[unsafe(method_family = none)]
933        pub unsafe fn specularTint(&self) -> Retained<MDLMaterialProperty>;
934
935        #[unsafe(method(roughness))]
936        #[unsafe(method_family = none)]
937        pub unsafe fn roughness(&self) -> Retained<MDLMaterialProperty>;
938
939        #[unsafe(method(anisotropic))]
940        #[unsafe(method_family = none)]
941        pub unsafe fn anisotropic(&self) -> Retained<MDLMaterialProperty>;
942
943        #[unsafe(method(anisotropicRotation))]
944        #[unsafe(method_family = none)]
945        pub unsafe fn anisotropicRotation(&self) -> Retained<MDLMaterialProperty>;
946
947        #[unsafe(method(sheen))]
948        #[unsafe(method_family = none)]
949        pub unsafe fn sheen(&self) -> Retained<MDLMaterialProperty>;
950
951        #[unsafe(method(sheenTint))]
952        #[unsafe(method_family = none)]
953        pub unsafe fn sheenTint(&self) -> Retained<MDLMaterialProperty>;
954
955        #[unsafe(method(clearcoat))]
956        #[unsafe(method_family = none)]
957        pub unsafe fn clearcoat(&self) -> Retained<MDLMaterialProperty>;
958
959        #[unsafe(method(clearcoatGloss))]
960        #[unsafe(method_family = none)]
961        pub unsafe fn clearcoatGloss(&self) -> Retained<MDLMaterialProperty>;
962    );
963}
964
965/// Methods declared on superclass `NSObject`.
966impl MDLPhysicallyPlausibleScatteringFunction {
967    extern_methods!(
968        #[unsafe(method(init))]
969        #[unsafe(method_family = init)]
970        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
971
972        #[unsafe(method(new))]
973        #[unsafe(method_family = new)]
974        pub unsafe fn new() -> Retained<Self>;
975    );
976}
977
978/// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterialface?language=objc)
979// NS_ENUM
980#[repr(transparent)]
981#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
982pub struct MDLMaterialFace(pub NSUInteger);
983impl MDLMaterialFace {
984    #[doc(alias = "MDLMaterialFaceFront")]
985    pub const Front: Self = Self(0);
986    #[doc(alias = "MDLMaterialFaceBack")]
987    pub const Back: Self = Self(1);
988    #[doc(alias = "MDLMaterialFaceDoubleSided")]
989    pub const DoubleSided: Self = Self(2);
990}
991
992unsafe impl Encode for MDLMaterialFace {
993    const ENCODING: Encoding = NSUInteger::ENCODING;
994}
995
996unsafe impl RefEncode for MDLMaterialFace {
997    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
998}
999
1000extern_class!(
1001    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterial?language=objc)
1002    #[unsafe(super(NSObject))]
1003    #[derive(Debug, PartialEq, Eq, Hash)]
1004    pub struct MDLMaterial;
1005);
1006
1007#[cfg(feature = "MDLTypes")]
1008extern_conformance!(
1009    unsafe impl MDLNamed for MDLMaterial {}
1010);
1011
1012extern_conformance!(
1013    unsafe impl NSFastEnumeration for MDLMaterial {}
1014);
1015
1016extern_conformance!(
1017    unsafe impl NSObjectProtocol for MDLMaterial {}
1018);
1019
1020impl MDLMaterial {
1021    extern_methods!(
1022        #[unsafe(method(initWithName:scatteringFunction:))]
1023        #[unsafe(method_family = init)]
1024        pub unsafe fn initWithName_scatteringFunction(
1025            this: Allocated<Self>,
1026            name: &NSString,
1027            scattering_function: &MDLScatteringFunction,
1028        ) -> Retained<Self>;
1029
1030        #[unsafe(method(setProperty:))]
1031        #[unsafe(method_family = none)]
1032        pub unsafe fn setProperty(&self, property: &MDLMaterialProperty);
1033
1034        #[unsafe(method(removeProperty:))]
1035        #[unsafe(method_family = none)]
1036        pub unsafe fn removeProperty(&self, property: &MDLMaterialProperty);
1037
1038        #[unsafe(method(propertyNamed:))]
1039        #[unsafe(method_family = none)]
1040        pub unsafe fn propertyNamed(
1041            &self,
1042            name: &NSString,
1043        ) -> Option<Retained<MDLMaterialProperty>>;
1044
1045        #[unsafe(method(propertyWithSemantic:))]
1046        #[unsafe(method_family = none)]
1047        pub unsafe fn propertyWithSemantic(
1048            &self,
1049            semantic: MDLMaterialSemantic,
1050        ) -> Option<Retained<MDLMaterialProperty>>;
1051
1052        #[unsafe(method(propertiesWithSemantic:))]
1053        #[unsafe(method_family = none)]
1054        pub unsafe fn propertiesWithSemantic(
1055            &self,
1056            semantic: MDLMaterialSemantic,
1057        ) -> Retained<NSArray<MDLMaterialProperty>>;
1058
1059        #[unsafe(method(removeAllProperties))]
1060        #[unsafe(method_family = none)]
1061        pub unsafe fn removeAllProperties(&self);
1062
1063        #[cfg(feature = "MDLAssetResolver")]
1064        #[unsafe(method(resolveTexturesWithResolver:))]
1065        #[unsafe(method_family = none)]
1066        pub unsafe fn resolveTexturesWithResolver(
1067            &self,
1068            resolver: &ProtocolObject<dyn MDLAssetResolver>,
1069        );
1070
1071        #[cfg(feature = "MDLAssetResolver")]
1072        #[unsafe(method(loadTexturesUsingResolver:))]
1073        #[unsafe(method_family = none)]
1074        pub unsafe fn loadTexturesUsingResolver(
1075            &self,
1076            resolver: &ProtocolObject<dyn MDLAssetResolver>,
1077        );
1078
1079        #[unsafe(method(scatteringFunction))]
1080        #[unsafe(method_family = none)]
1081        pub unsafe fn scatteringFunction(&self) -> Retained<MDLScatteringFunction>;
1082
1083        /// See: MDLNamed
1084        #[unsafe(method(name))]
1085        #[unsafe(method_family = none)]
1086        pub unsafe fn name(&self) -> Retained<NSString>;
1087
1088        /// Setter for [`name`][Self::name].
1089        ///
1090        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1091        #[unsafe(method(setName:))]
1092        #[unsafe(method_family = none)]
1093        pub unsafe fn setName(&self, name: &NSString);
1094
1095        #[unsafe(method(baseMaterial))]
1096        #[unsafe(method_family = none)]
1097        pub unsafe fn baseMaterial(&self) -> Option<Retained<MDLMaterial>>;
1098
1099        /// Setter for [`baseMaterial`][Self::baseMaterial].
1100        #[unsafe(method(setBaseMaterial:))]
1101        #[unsafe(method_family = none)]
1102        pub unsafe fn setBaseMaterial(&self, base_material: Option<&MDLMaterial>);
1103
1104        #[unsafe(method(objectAtIndexedSubscript:))]
1105        #[unsafe(method_family = none)]
1106        pub unsafe fn objectAtIndexedSubscript(
1107            &self,
1108            idx: NSUInteger,
1109        ) -> Option<Retained<MDLMaterialProperty>>;
1110
1111        #[unsafe(method(objectForKeyedSubscript:))]
1112        #[unsafe(method_family = none)]
1113        pub unsafe fn objectForKeyedSubscript(
1114            &self,
1115            name: &NSString,
1116        ) -> Option<Retained<MDLMaterialProperty>>;
1117
1118        #[unsafe(method(count))]
1119        #[unsafe(method_family = none)]
1120        pub unsafe fn count(&self) -> NSUInteger;
1121
1122        #[unsafe(method(materialFace))]
1123        #[unsafe(method_family = none)]
1124        pub unsafe fn materialFace(&self) -> MDLMaterialFace;
1125
1126        /// Setter for [`materialFace`][Self::materialFace].
1127        #[unsafe(method(setMaterialFace:))]
1128        #[unsafe(method_family = none)]
1129        pub unsafe fn setMaterialFace(&self, material_face: MDLMaterialFace);
1130    );
1131}
1132
1133/// Methods declared on superclass `NSObject`.
1134impl MDLMaterial {
1135    extern_methods!(
1136        #[unsafe(method(init))]
1137        #[unsafe(method_family = init)]
1138        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1139
1140        #[unsafe(method(new))]
1141        #[unsafe(method_family = new)]
1142        pub unsafe fn new() -> Retained<Self>;
1143    );
1144}