File indexing completed on 2026-11-13 10:47:38
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 <NCollection_Vec2.hxx>
0018
0019 #include <Standard_TypeDef.hxx>
0020
0021 #include <NCollection_Vec3.hxx>
0022
0023 #include <NCollection_Vec4.hxx>
0024
0025 #include <NCollection_Mat4.hxx>
0026 #include <Image_Texture.hxx>
0027 #include <Quantity_ColorRGBA.hxx>
0028 #include <Standard_Dump.hxx>
0029
0030
0031 struct XCAFDoc_VisMaterialPBR
0032 {
0033 occ::handle<Image_Texture> BaseColorTexture;
0034
0035 occ::handle<Image_Texture> MetallicRoughnessTexture;
0036 occ::handle<Image_Texture> EmissiveTexture;
0037 occ::handle<Image_Texture> OcclusionTexture;
0038 occ::handle<Image_Texture> NormalTexture;
0039 Quantity_ColorRGBA BaseColor;
0040 NCollection_Vec3<float> EmissiveFactor;
0041 float Metallic;
0042 float Roughness;
0043 float RefractionIndex;
0044
0045 bool IsDefined;
0046
0047
0048 XCAFDoc_VisMaterialPBR()
0049 : BaseColor(1.0f, 1.0f, 1.0f, 1.0f),
0050 EmissiveFactor(0.0f, 0.0f, 0.0f),
0051 Metallic(1.0f),
0052 Roughness(1.0f),
0053 RefractionIndex(1.5f),
0054 IsDefined(true)
0055 {
0056 }
0057
0058
0059 bool IsEqual(const XCAFDoc_VisMaterialPBR& theOther) const
0060 {
0061 if (&theOther == this)
0062 {
0063 return true;
0064 }
0065 else if (theOther.IsDefined != IsDefined)
0066 {
0067 return false;
0068 }
0069 else if (!IsDefined)
0070 {
0071 return true;
0072 }
0073
0074 return theOther.BaseColorTexture == BaseColorTexture
0075 && theOther.MetallicRoughnessTexture == MetallicRoughnessTexture
0076 && theOther.EmissiveTexture == EmissiveTexture
0077 && theOther.OcclusionTexture == OcclusionTexture
0078 && theOther.NormalTexture == NormalTexture && theOther.BaseColor == BaseColor
0079 && theOther.EmissiveFactor == EmissiveFactor && theOther.Metallic == Metallic
0080 && theOther.Roughness == Roughness && theOther.RefractionIndex == RefractionIndex;
0081 }
0082
0083
0084 void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const
0085 {
0086 OCCT_DUMP_CLASS_BEGIN(theOStream, XCAFDoc_VisMaterialPBR)
0087
0088 OCCT_DUMP_FIELD_VALUES_DUMPED(theOStream, theDepth, BaseColorTexture.get())
0089 OCCT_DUMP_FIELD_VALUES_DUMPED(theOStream, theDepth, MetallicRoughnessTexture.get())
0090 OCCT_DUMP_FIELD_VALUES_DUMPED(theOStream, theDepth, EmissiveTexture.get())
0091 OCCT_DUMP_FIELD_VALUES_DUMPED(theOStream, theDepth, OcclusionTexture.get())
0092 OCCT_DUMP_FIELD_VALUES_DUMPED(theOStream, theDepth, NormalTexture.get())
0093
0094 OCCT_DUMP_FIELD_VALUES_DUMPED(theOStream, theDepth, &BaseColor)
0095 OCCT_DUMP_FIELD_VALUES_DUMPED(theOStream, theDepth, &EmissiveFactor)
0096
0097 OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Metallic)
0098 OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Roughness)
0099 OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, RefractionIndex)
0100 OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, IsDefined)
0101 }
0102 };
0103
0104 #endif