File indexing completed on 2026-05-17 08:18:43
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _XCAFDoc_VisMaterialPBR_HeaderFile
0015 #define _XCAFDoc_VisMaterialPBR_HeaderFile
0016
0017 #include <Graphic3d_Vec.hxx>
0018 #include <Image_Texture.hxx>
0019 #include <Quantity_ColorRGBA.hxx>
0020 #include <Standard_Dump.hxx>
0021
0022
0023 struct XCAFDoc_VisMaterialPBR
0024 {
0025 Handle(Image_Texture) BaseColorTexture;
0026
0027 Handle(Image_Texture) MetallicRoughnessTexture;
0028 Handle(Image_Texture) EmissiveTexture;
0029 Handle(Image_Texture) OcclusionTexture;
0030 Handle(Image_Texture) NormalTexture;
0031 Quantity_ColorRGBA BaseColor;
0032 Graphic3d_Vec3 EmissiveFactor;
0033 Standard_ShortReal Metallic;
0034 Standard_ShortReal Roughness;
0035 Standard_ShortReal RefractionIndex;
0036
0037 Standard_Boolean IsDefined;
0038
0039
0040 XCAFDoc_VisMaterialPBR()
0041 : BaseColor(1.0f, 1.0f, 1.0f, 1.0f),
0042 EmissiveFactor(0.0f, 0.0f, 0.0f),
0043 Metallic(1.0f),
0044 Roughness(1.0f),
0045 RefractionIndex(1.5f),
0046 IsDefined(Standard_True)
0047 {
0048 }
0049
0050
0051 Standard_Boolean IsEqual(const XCAFDoc_VisMaterialPBR& theOther) const
0052 {
0053 if (&theOther == this)
0054 {
0055 return true;
0056 }
0057 else if (theOther.IsDefined != IsDefined)
0058 {
0059 return false;
0060 }
0061 else if (!IsDefined)
0062 {
0063 return true;
0064 }
0065
0066 return theOther.BaseColorTexture == BaseColorTexture
0067 && theOther.MetallicRoughnessTexture == MetallicRoughnessTexture
0068 && theOther.EmissiveTexture == EmissiveTexture
0069 && theOther.OcclusionTexture == OcclusionTexture
0070 && theOther.NormalTexture == NormalTexture && theOther.BaseColor == BaseColor
0071 && theOther.EmissiveFactor == EmissiveFactor && theOther.Metallic == Metallic
0072 && theOther.Roughness == Roughness && theOther.RefractionIndex == RefractionIndex;
0073 }
0074
0075
0076 void DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
0077 {
0078 OCCT_DUMP_CLASS_BEGIN(theOStream, XCAFDoc_VisMaterialPBR)
0079
0080 OCCT_DUMP_FIELD_VALUES_DUMPED(theOStream, theDepth, BaseColorTexture.get())
0081 OCCT_DUMP_FIELD_VALUES_DUMPED(theOStream, theDepth, MetallicRoughnessTexture.get())
0082 OCCT_DUMP_FIELD_VALUES_DUMPED(theOStream, theDepth, EmissiveTexture.get())
0083 OCCT_DUMP_FIELD_VALUES_DUMPED(theOStream, theDepth, OcclusionTexture.get())
0084 OCCT_DUMP_FIELD_VALUES_DUMPED(theOStream, theDepth, NormalTexture.get())
0085
0086 OCCT_DUMP_FIELD_VALUES_DUMPED(theOStream, theDepth, &BaseColor)
0087 OCCT_DUMP_FIELD_VALUES_DUMPED(theOStream, theDepth, &EmissiveFactor)
0088
0089 OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Metallic)
0090 OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Roughness)
0091 OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, RefractionIndex)
0092 OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, IsDefined)
0093 }
0094 };
0095
0096 #endif