File indexing completed on 2025-01-18 10:05:34
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 Handle(Image_Texture) MetallicRoughnessTexture;
0027 Handle(Image_Texture) EmissiveTexture;
0028 Handle(Image_Texture) OcclusionTexture;
0029 Handle(Image_Texture) NormalTexture;
0030 Quantity_ColorRGBA BaseColor;
0031 Graphic3d_Vec3 EmissiveFactor;
0032 Standard_ShortReal Metallic;
0033 Standard_ShortReal Roughness;
0034 Standard_ShortReal RefractionIndex;
0035 Standard_Boolean IsDefined;
0036
0037
0038 XCAFDoc_VisMaterialPBR()
0039 : BaseColor (1.0f, 1.0f, 1.0f, 1.0f),
0040 EmissiveFactor (0.0f, 0.0f, 0.0f),
0041 Metallic (1.0f),
0042 Roughness (1.0f),
0043 RefractionIndex (1.5f),
0044 IsDefined (Standard_True) {}
0045
0046
0047 Standard_Boolean IsEqual (const XCAFDoc_VisMaterialPBR& theOther) const
0048 {
0049 if (&theOther == this)
0050 {
0051 return true;
0052 }
0053 else if (theOther.IsDefined != IsDefined)
0054 {
0055 return false;
0056 }
0057 else if (!IsDefined)
0058 {
0059 return true;
0060 }
0061
0062 return theOther.BaseColorTexture == BaseColorTexture
0063 && theOther.MetallicRoughnessTexture == MetallicRoughnessTexture
0064 && theOther.EmissiveTexture == EmissiveTexture
0065 && theOther.OcclusionTexture == OcclusionTexture
0066 && theOther.NormalTexture == NormalTexture
0067 && theOther.BaseColor == BaseColor
0068 && theOther.EmissiveFactor == EmissiveFactor
0069 && theOther.Metallic == Metallic
0070 && theOther.Roughness == Roughness
0071 && theOther.RefractionIndex == RefractionIndex;
0072 }
0073
0074
0075 void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
0076 {
0077 OCCT_DUMP_CLASS_BEGIN (theOStream, XCAFDoc_VisMaterialPBR)
0078
0079 OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, BaseColorTexture.get())
0080 OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, MetallicRoughnessTexture.get())
0081 OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, EmissiveTexture.get())
0082 OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, OcclusionTexture.get())
0083 OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, NormalTexture.get())
0084
0085 OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &BaseColor)
0086 OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &EmissiveFactor)
0087
0088 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Metallic)
0089 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Roughness)
0090 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, RefractionIndex)
0091 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsDefined)
0092 }
0093 };
0094
0095 #endif