X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FXCAFPrs%2FXCAFPrs_Style.hxx;h=22c96645480fe988fda62bcac616c04d5d64cc6f;hb=1b6b8afcd0679fe632d31a059c8b658f8673c91e;hpb=ff1f0c9ae2515b35fd8ebf8453e9041c821b517f;ds=sidebyside diff --git a/src/XCAFPrs/XCAFPrs_Style.hxx b/src/XCAFPrs/XCAFPrs_Style.hxx index cef8024b70..22c9664548 100644 --- a/src/XCAFPrs/XCAFPrs_Style.hxx +++ b/src/XCAFPrs/XCAFPrs_Style.hxx @@ -83,6 +83,27 @@ public: //! Manage visibility. Standard_Boolean IsVisible() const { return myIsVisible; } + //! Return base color texture. + const Handle(Image_Texture)& BaseColorTexture() const + { + static const Handle(Image_Texture) THE_NULL_TEXTURE; + if (myMaterial.IsNull()) + { + return THE_NULL_TEXTURE; + } + else if (myMaterial->HasPbrMaterial() + && !myMaterial->PbrMaterial().BaseColorTexture.IsNull()) + { + return myMaterial->PbrMaterial().BaseColorTexture; + } + else if (myMaterial->HasCommonMaterial() + && !myMaterial->CommonMaterial().DiffuseTexture.IsNull()) + { + return myMaterial->CommonMaterial().DiffuseTexture; + } + return THE_NULL_TEXTURE; + } + //! Returns True if styles are the same //! Methods for using Style as key in maps Standard_Boolean IsEqual (const XCAFPrs_Style& theOther) const