Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-25 09:19:58

0001 // Copyright (c) 2019 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _Graphic3d_Aspects_HeaderFile
0015 #define _Graphic3d_Aspects_HeaderFile
0016 
0017 #include <Aspect_InteriorStyle.hxx>
0018 #include <Aspect_TypeOfDisplayText.hxx>
0019 #include <Aspect_TypeOfLine.hxx>
0020 #include <Aspect_TypeOfStyleText.hxx>
0021 #include <Font_FontAspect.hxx>
0022 #include <Graphic3d_AlphaMode.hxx>
0023 #include <Graphic3d_MarkerImage.hxx>
0024 #include <Graphic3d_MaterialAspect.hxx>
0025 #include <Graphic3d_HatchStyle.hxx>
0026 #include <Graphic3d_PolygonOffset.hxx>
0027 #include <Graphic3d_ShaderProgram.hxx>
0028 #include <Graphic3d_TextureSet.hxx>
0029 #include <Graphic3d_TypeOfBackfacingModel.hxx>
0030 #include <Graphic3d_TypeOfShadingModel.hxx>
0031 #include <TCollection_HAsciiString.hxx>
0032 
0033 //! This class defines graphic attributes.
0034 class Graphic3d_Aspects : public Standard_Transient
0035 {
0036   DEFINE_STANDARD_RTTIEXT(Graphic3d_Aspects, Standard_Transient)
0037 public:
0038   //! Creates a context table for drawing primitives defined with the following default values:
0039   Standard_EXPORT Graphic3d_Aspects();
0040 
0041   //! Return interior rendering style; Aspect_IS_SOLID by default.
0042   Aspect_InteriorStyle InteriorStyle() const { return myInteriorStyle; }
0043 
0044   //! Modifies the interior type used for rendering
0045   void SetInteriorStyle(const Aspect_InteriorStyle theStyle) { myInteriorStyle = theStyle; }
0046 
0047   //! Returns shading model; Graphic3d_TypeOfShadingModel_DEFAULT by default.
0048   //! Graphic3d_TOSM_DEFAULT means that Shading Model set as default for entire Viewer will be used.
0049   Graphic3d_TypeOfShadingModel ShadingModel() const { return myShadingModel; }
0050 
0051   //! Sets shading model
0052   void SetShadingModel(const Graphic3d_TypeOfShadingModel theShadingModel)
0053   {
0054     myShadingModel = theShadingModel;
0055   }
0056 
0057   //! Returns the way how alpha value should be treated (Graphic3d_AlphaMode_BlendAuto by default,
0058   //! for backward compatibility).
0059   Graphic3d_AlphaMode AlphaMode() const { return myAlphaMode; }
0060 
0061   //! Returns alpha cutoff threshold, for discarding fragments within Graphic3d_AlphaMode_Mask mode
0062   //! (0.5 by default). If the alpha value is greater than or equal to this value then it is
0063   //! rendered as fully opaque, otherwise, it is rendered as fully transparent.
0064   float AlphaCutoff() const { return myAlphaCutoff; }
0065 
0066   //! Defines the way how alpha value should be treated.
0067   void SetAlphaMode(Graphic3d_AlphaMode theMode, float theAlphaCutoff = 0.5f)
0068   {
0069     myAlphaMode   = theMode;
0070     myAlphaCutoff = theAlphaCutoff;
0071   }
0072 
0073   //! Return color
0074   const Quantity_ColorRGBA& ColorRGBA() const { return myInteriorColor; }
0075 
0076   //! Return the color.
0077   const Quantity_Color& Color() const { return myInteriorColor.GetRGB(); }
0078 
0079   //! Modifies the color.
0080   void SetColor(const Quantity_Color& theColor) { myInteriorColor.SetRGB(theColor); }
0081 
0082   //! Return interior color.
0083   const Quantity_Color& InteriorColor() const { return myInteriorColor.GetRGB(); }
0084 
0085   //! Return interior color.
0086   const Quantity_ColorRGBA& InteriorColorRGBA() const { return myInteriorColor; }
0087 
0088   //! Modifies the color of the interior of the face
0089   void SetInteriorColor(const Quantity_Color& theColor) { myInteriorColor.SetRGB(theColor); }
0090 
0091   //! Modifies the color of the interior of the face
0092   void SetInteriorColor(const Quantity_ColorRGBA& theColor) { myInteriorColor = theColor; }
0093 
0094   //! Return back interior color.
0095   const Quantity_Color& BackInteriorColor() const { return myBackInteriorColor.GetRGB(); }
0096 
0097   //! Return back interior color.
0098   const Quantity_ColorRGBA& BackInteriorColorRGBA() const { return myBackInteriorColor; }
0099 
0100   //! Modifies the color of the interior of the back face
0101   void SetBackInteriorColor(const Quantity_Color& theColor)
0102   {
0103     myBackInteriorColor.SetRGB(theColor);
0104   }
0105 
0106   //! Modifies the color of the interior of the back face
0107   void SetBackInteriorColor(const Quantity_ColorRGBA& theColor) { myBackInteriorColor = theColor; }
0108 
0109   //! Returns the surface material of external faces
0110   const Graphic3d_MaterialAspect& FrontMaterial() const { return myFrontMaterial; }
0111 
0112   //! Returns the surface material of external faces
0113   Graphic3d_MaterialAspect& ChangeFrontMaterial() { return myFrontMaterial; }
0114 
0115   //! Modifies the surface material of external faces
0116   void SetFrontMaterial(const Graphic3d_MaterialAspect& theMaterial)
0117   {
0118     myFrontMaterial = theMaterial;
0119   }
0120 
0121   //! Returns the surface material of internal faces
0122   const Graphic3d_MaterialAspect& BackMaterial() const { return myBackMaterial; }
0123 
0124   //! Returns the surface material of internal faces
0125   Graphic3d_MaterialAspect& ChangeBackMaterial() { return myBackMaterial; }
0126 
0127   //! Modifies the surface material of internal faces
0128   void SetBackMaterial(const Graphic3d_MaterialAspect& theMaterial)
0129   {
0130     myBackMaterial = theMaterial;
0131   }
0132 
0133   //! Return face culling mode; Graphic3d_FaceCulling_BackClosed by default.
0134   //! A back-facing polygon is defined as a polygon whose
0135   //! vertices are in a clockwise order with respect to screen coordinates.
0136   Graphic3d_TypeOfBackfacingModel FaceCulling() const { return myFaceCulling; }
0137 
0138   //! Set face culling mode.
0139   void SetFaceCulling(Graphic3d_TypeOfBackfacingModel theCulling) { myFaceCulling = theCulling; }
0140 
0141   //! Returns true if material properties should be distinguished for back and front faces (false by
0142   //! default).
0143   bool Distinguish() const { return myToDistinguishMaterials; }
0144 
0145   //! Set material distinction between front and back faces.
0146   void SetDistinguish(bool toDistinguish) { myToDistinguishMaterials = toDistinguish; }
0147 
0148   //! Allows material distinction between front and back faces.
0149   void SetDistinguishOn() { myToDistinguishMaterials = true; }
0150 
0151   //! Forbids material distinction between front and back faces.
0152   void SetDistinguishOff() { myToDistinguishMaterials = false; }
0153 
0154   //! Return true if per-vertex color should be applied to back-facing fragments.
0155   //! True by default for backward compatibility.
0156   bool ToUseVertexColorForBackFaces() const { return myToUseVertexColorForBackFaces; }
0157 
0158   //! Set whether per-vertex color should be applied to back-facing fragments.
0159   //! When disabled, back faces use back material/interior color without vertex color modulation.
0160   void SetUseVertexColorForBackFaces(bool theToUse) { myToUseVertexColorForBackFaces = theToUse; }
0161 
0162   //! Return shader program.
0163   const occ::handle<Graphic3d_ShaderProgram>& ShaderProgram() const { return myProgram; }
0164 
0165   //! Sets up OpenGL/GLSL shader program.
0166   void SetShaderProgram(const occ::handle<Graphic3d_ShaderProgram>& theProgram)
0167   {
0168     myProgram = theProgram;
0169   }
0170 
0171   //! Return texture array to be mapped.
0172   const occ::handle<Graphic3d_TextureSet>& TextureSet() const { return myTextureSet; }
0173 
0174   //! Setup texture array to be mapped.
0175   void SetTextureSet(const occ::handle<Graphic3d_TextureSet>& theTextures)
0176   {
0177     myTextureSet = theTextures;
0178   }
0179 
0180   //! Return texture to be mapped.
0181   // Standard_DEPRECATED("Deprecated method, TextureSet() should be used instead")
0182   occ::handle<Graphic3d_TextureMap> TextureMap() const
0183   {
0184     return !myTextureSet.IsNull() && !myTextureSet->IsEmpty() ? myTextureSet->First()
0185                                                               : occ::handle<Graphic3d_TextureMap>();
0186   }
0187 
0188   //! Assign texture to be mapped.
0189   //! See also SetTextureMapOn() to actually activate texture mapping.
0190   // Standard_DEPRECATED("Deprecated method, SetTextureSet() should be used instead")
0191   Standard_EXPORT void SetTextureMap(const occ::handle<Graphic3d_TextureMap>& theTexture);
0192 
0193   //! Return true if texture mapping is enabled (false by default).
0194   bool ToMapTexture() const { return myToMapTexture; }
0195 
0196   //! Return true if texture mapping is enabled (false by default).
0197   bool TextureMapState() const { return myToMapTexture; }
0198 
0199   //! Enable or disable texture mapping (has no effect if texture is not set).
0200   void SetTextureMapOn(bool theToMap) { myToMapTexture = theToMap; }
0201 
0202   //! Enable texture mapping (has no effect if texture is not set).
0203   void SetTextureMapOn() { myToMapTexture = true; }
0204 
0205   //! Disable texture mapping.
0206   void SetTextureMapOff() { myToMapTexture = false; }
0207 
0208   //! Returns current polygon offsets settings.
0209   const Graphic3d_PolygonOffset& PolygonOffset() const { return myPolygonOffset; }
0210 
0211   //! Sets polygon offsets settings.
0212   void SetPolygonOffset(const Graphic3d_PolygonOffset& theOffset) { myPolygonOffset = theOffset; }
0213 
0214   //! Returns current polygon offsets settings.
0215   void PolygonOffsets(int& theMode, float& theFactor, float& theUnits) const
0216   {
0217     theMode   = myPolygonOffset.Mode;
0218     theFactor = myPolygonOffset.Factor;
0219     theUnits  = myPolygonOffset.Units;
0220   }
0221 
0222   //! Sets up OpenGL polygon offsets mechanism.
0223   //! <aMode> parameter can contain various combinations of
0224   //! Aspect_PolygonOffsetMode enumeration elements (Aspect_POM_None means
0225   //! that polygon offsets are not changed).
0226   //! If <aMode> is different from Aspect_POM_Off and Aspect_POM_None, then <aFactor> and <aUnits>
0227   //! arguments are used by graphic renderer to calculate a depth offset value:
0228   //!
0229   //! offset = <aFactor> * m + <aUnits> * r, where
0230   //! m - maximum depth slope for the polygon currently being displayed,
0231   //! r - minimum window coordinates depth resolution (implementation-specific)
0232   //!
0233   //! Default settings for OCC 3D viewer: mode = Aspect_POM_Fill, factor = 1., units = 1.
0234   //!
0235   //! Negative offset values move polygons closer to the viewport,
0236   //! while positive values shift polygons away.
0237   //! Consult OpenGL reference for details (glPolygonOffset function description).
0238   void SetPolygonOffsets(const int   theMode,
0239                          const float theFactor = 1.0f,
0240                          const float theUnits  = 0.0f)
0241   {
0242     myPolygonOffset.Mode   = (Aspect_PolygonOffsetMode)(theMode & Aspect_POM_Mask);
0243     myPolygonOffset.Factor = theFactor;
0244     myPolygonOffset.Units  = theUnits;
0245   }
0246 
0247   //! @name parameters specific to Line primitive rendering
0248 public:
0249   //! Return line type; Aspect_TOL_SOLID by default.
0250   Aspect_TypeOfLine LineType() const { return myLineType; }
0251 
0252   //! Modifies the line type
0253   void SetLineType(Aspect_TypeOfLine theType)
0254   {
0255     myLineType    = theType;
0256     myLinePattern = DefaultLinePatternForType(theType);
0257   }
0258 
0259   //! Return custom stipple line pattern; 0xFFFF by default.
0260   uint16_t LinePattern() const { return myLinePattern; }
0261 
0262   //! Modifies the stipple line pattern, and changes line type to Aspect_TOL_USERDEFINED for
0263   //! non-standard pattern.
0264   void SetLinePattern(uint16_t thePattern)
0265   {
0266     myLineType    = DefaultLineTypeForPattern(thePattern);
0267     myLinePattern = thePattern;
0268   }
0269 
0270   //! Return a multiplier for each bit in the line stipple pattern within [1, 256] range; 1 by
0271   //! default.
0272   uint16_t LineStippleFactor() const { return myLineFactor; }
0273 
0274   //! Set a multiplier for each bit in the line stipple pattern.
0275   void SetLineStippleFactor(uint16_t theFactor)
0276   {
0277     if (theFactor == 0 || theFactor > 256)
0278     {
0279       throw Standard_OutOfRange("Graphic3d_Aspects::SetLineStippleFactor(), bad factor value");
0280     }
0281     myLineFactor = theFactor;
0282   }
0283 
0284   //! Return width for edges in pixels; 1.0 by default.
0285   float LineWidth() const { return myLineWidth; }
0286 
0287   //! Modifies the line thickness
0288   //! Warning: Raises Standard_OutOfRange if the width is a negative value.
0289   void SetLineWidth(float theWidth)
0290   {
0291     if (theWidth <= 0.0f)
0292     {
0293       throw Standard_OutOfRange("Bad value for EdgeLineWidth");
0294     }
0295     myLineWidth = theWidth;
0296   }
0297 
0298   //! Return stipple line pattern for line type.
0299   static uint16_t DefaultLinePatternForType(Aspect_TypeOfLine theType)
0300   {
0301     switch (theType)
0302     {
0303       case Aspect_TOL_DASH:
0304         return 0xFFC0;
0305       case Aspect_TOL_DOT:
0306         return 0xCCCC;
0307       case Aspect_TOL_DOTDASH:
0308         return 0xFF18;
0309       case Aspect_TOL_EMPTY:
0310         return 0x0000;
0311       case Aspect_TOL_SOLID:
0312         return 0xFFFF;
0313       case Aspect_TOL_USERDEFINED:
0314         return 0xFF24;
0315     }
0316     return 0xFFFF;
0317   }
0318 
0319   //! Return line type for stipple line pattern.
0320   static Aspect_TypeOfLine DefaultLineTypeForPattern(uint16_t thePattern)
0321   {
0322     switch (thePattern)
0323     {
0324       case 0x0000:
0325         return Aspect_TOL_EMPTY;
0326       case 0xFFC0:
0327         return Aspect_TOL_DASH;
0328       case 0xCCCC:
0329         return Aspect_TOL_DOT;
0330       case 0xFF18:
0331         return Aspect_TOL_DOTDASH;
0332       case 0xFFFF:
0333         return Aspect_TOL_SOLID;
0334       case 0xFF24:
0335         return Aspect_TOL_USERDEFINED;
0336     }
0337     return Aspect_TOL_USERDEFINED;
0338   }
0339 
0340   //! @name parameters specific to Point (Marker) primitive rendering
0341 public:
0342   //! Return marker type; Aspect_TOM_POINT by default.
0343   Aspect_TypeOfMarker MarkerType() const { return myMarkerType; }
0344 
0345   //! Modifies the type of marker.
0346   void SetMarkerType(Aspect_TypeOfMarker theType) { myMarkerType = theType; }
0347 
0348   //! Return marker scale factor; 1.0 by default.
0349   float MarkerScale() const { return myMarkerScale; }
0350 
0351   //! Modifies the scale factor.
0352   //! Marker type Aspect_TOM_POINT is not affected by the marker size scale factor.
0353   //! It is always the smallest displayable dot.
0354   //! Warning: Raises Standard_OutOfRange if the scale is a negative value.
0355   void SetMarkerScale(const float theScale)
0356   {
0357     if (theScale <= 0.0f)
0358     {
0359       throw Standard_OutOfRange("Bad value for MarkerScale");
0360     }
0361     myMarkerScale = theScale;
0362   }
0363 
0364   //! Returns marker's image texture.
0365   //! Could be null handle if marker aspect has been initialized as default type of marker.
0366   const occ::handle<Graphic3d_MarkerImage>& MarkerImage() const { return myMarkerImage; }
0367 
0368   //! Set marker's image texture.
0369   void SetMarkerImage(const occ::handle<Graphic3d_MarkerImage>& theImage)
0370   {
0371     myMarkerImage = theImage;
0372   }
0373 
0374   //! Returns TRUE if marker should be drawn using marker sprite (either user-provided or
0375   //! generated).
0376   bool IsMarkerSprite() const
0377   {
0378     if (myMarkerType == Aspect_TOM_POINT || myMarkerType == Aspect_TOM_EMPTY)
0379     {
0380       return false;
0381     }
0382 
0383     return myMarkerType != Aspect_TOM_USERDEFINED || !myMarkerImage.IsNull();
0384   }
0385 
0386   //! @name parameters specific to text rendering
0387 public:
0388   //! Returns the font; NULL string by default.
0389   const occ::handle<TCollection_HAsciiString>& TextFont() const { return myTextFont; }
0390 
0391   //! Modifies the font.
0392   void SetTextFont(const occ::handle<TCollection_HAsciiString>& theFont) { myTextFont = theFont; }
0393 
0394   //! Returns text FontAspect
0395   Font_FontAspect TextFontAspect() const { return myTextFontAspect; }
0396 
0397   //! Turns usage of Aspect text
0398   void SetTextFontAspect(Font_FontAspect theFontAspect) { myTextFontAspect = theFontAspect; }
0399 
0400   //! Returns display type; Aspect_TODT_NORMAL by default.
0401   Aspect_TypeOfDisplayText TextDisplayType() const { return myTextDisplayType; }
0402 
0403   //! Sets display type.
0404   void SetTextDisplayType(Aspect_TypeOfDisplayText theType) { myTextDisplayType = theType; }
0405 
0406   //! Returns text background/shadow color; equals to EdgeColor() property.
0407   const Quantity_ColorRGBA& ColorSubTitleRGBA() const { return myEdgeColor; }
0408 
0409   //! Return text background/shadow color; equals to EdgeColor() property.
0410   const Quantity_Color& ColorSubTitle() const { return myEdgeColor.GetRGB(); }
0411 
0412   //! Modifies text background/shadow color; equals to EdgeColor() property.
0413   void SetColorSubTitle(const Quantity_Color& theColor) { myEdgeColor.SetRGB(theColor); }
0414 
0415   //! Modifies text background/shadow color; equals to EdgeColor() property.
0416   void SetColorSubTitle(const Quantity_ColorRGBA& theColor) { myEdgeColor = theColor; }
0417 
0418   //! Returns TRUE when the Text Zoomable is on.
0419   bool IsTextZoomable() const { return myIsTextZoomable; }
0420 
0421   //! Turns usage of text zoomable on/off
0422   void SetTextZoomable(bool theFlag) { myIsTextZoomable = theFlag; }
0423 
0424   //! Returns the text style; Aspect_TOST_NORMAL by default.
0425   Aspect_TypeOfStyleText TextStyle() const { return myTextStyle; }
0426 
0427   //! Modifies the style of the text.
0428   void SetTextStyle(Aspect_TypeOfStyleText theStyle) { myTextStyle = theStyle; }
0429 
0430   //! Returns Angle of degree
0431   float TextAngle() const { return myTextAngle; }
0432 
0433   //! Turns usage of text rotated
0434   void SetTextAngle(float theAngle) { myTextAngle = (float)theAngle; }
0435 
0436   //! @name parameters specific to Mesh Edges (of triangulation primitive) rendering
0437 public:
0438   //! Returns true if mesh edges should be drawn (false by default).
0439   bool ToDrawEdges() const { return myToDrawEdges && myLineType != Aspect_TOL_EMPTY; }
0440 
0441   //! Set if mesh edges should be drawn or not.
0442   void SetDrawEdges(bool theToDraw)
0443   {
0444     myToDrawEdges = theToDraw;
0445     if (myLineType == Aspect_TOL_EMPTY)
0446     {
0447       myLineType = Aspect_TOL_SOLID;
0448     }
0449   }
0450 
0451   //! The edges of FillAreas are drawn.
0452   void SetEdgeOn() { SetDrawEdges(true); }
0453 
0454   //! The edges of FillAreas are not drawn.
0455   void SetEdgeOff() { SetDrawEdges(false); }
0456 
0457   //! Return color of edges.
0458   const Quantity_Color& EdgeColor() const { return myEdgeColor.GetRGB(); }
0459 
0460   //! Return color of edges.
0461   const Quantity_ColorRGBA& EdgeColorRGBA() const { return myEdgeColor; }
0462 
0463   //! Modifies the color of the edge of the face
0464   void SetEdgeColor(const Quantity_Color& theColor) { myEdgeColor.SetRGB(theColor); }
0465 
0466   //! Modifies the color of the edge of the face
0467   void SetEdgeColor(const Quantity_ColorRGBA& theColor) { myEdgeColor = theColor; }
0468 
0469   //! Return edges line type (same as LineType()).
0470   Aspect_TypeOfLine EdgeLineType() const { return myLineType; }
0471 
0472   //! Modifies the edge line type (same as SetLineType())
0473   void SetEdgeLineType(Aspect_TypeOfLine theType) { SetLineType(theType); }
0474 
0475   //! Return width for edges in pixels (same as LineWidth()).
0476   float EdgeWidth() const { return myLineWidth; }
0477 
0478   //! Modifies the edge thickness (same as SetLineWidth())
0479   void SetEdgeWidth(double theWidth) { SetLineWidth((float)theWidth); }
0480 
0481   //! Returns TRUE if drawing element edges should discard first edge in triangle; FALSE by default.
0482   //! Graphics hardware works mostly with triangles, so that wireframe presentation will draw
0483   //! triangle edges by default. This flag allows rendering wireframe presentation of quad-only
0484   //! array split into triangles. For this, quads should be split in specific order, so that the
0485   //! quad diagonal (to be NOT rendered) goes first:
0486   //!     1------2
0487   //!    /      /   Triangle #1: 2-0-1; Triangle #2: 0-2-3
0488   //!   0------3
0489   bool ToSkipFirstEdge() const { return myToSkipFirstEdge; }
0490 
0491   //! Set skip first triangle edge flag for drawing wireframe presentation of quads array split into
0492   //! triangles.
0493   void SetSkipFirstEdge(bool theToSkipFirstEdge) { myToSkipFirstEdge = theToSkipFirstEdge; }
0494 
0495   //! Returns TRUE if silhouette (outline) should be drawn (with edge color and width); FALSE by
0496   //! default.
0497   bool ToDrawSilhouette() const { return myToDrawSilhouette; }
0498 
0499   //! Enables/disables drawing silhouette (outline).
0500   void SetDrawSilhouette(bool theToDraw) { myToDrawSilhouette = theToDraw; }
0501 
0502 public:
0503   //! Returns the hatch type used when InteriorStyle is IS_HATCH
0504   const occ::handle<Graphic3d_HatchStyle>& HatchStyle() const { return myHatchStyle; }
0505 
0506   //! Modifies the hatch type used when InteriorStyle is IS_HATCH
0507   void SetHatchStyle(const occ::handle<Graphic3d_HatchStyle>& theStyle) { myHatchStyle = theStyle; }
0508 
0509   //! Modifies the hatch type used when InteriorStyle is IS_HATCH
0510   //! @warning This method always creates a new handle for a given hatch style
0511   void SetHatchStyle(const Aspect_HatchStyle theStyle)
0512   {
0513     if (theStyle == Aspect_HS_SOLID)
0514     {
0515       myHatchStyle.Nullify();
0516       return;
0517     }
0518 
0519     myHatchStyle = new Graphic3d_HatchStyle(theStyle);
0520   }
0521 
0522 public:
0523   //! Check for equality with another aspects.
0524   bool IsEqual(const Graphic3d_Aspects& theOther)
0525   {
0526     if (this == &theOther)
0527     {
0528       return true;
0529     }
0530 
0531     return myProgram == theOther.myProgram && myTextureSet == theOther.myTextureSet
0532            && myMarkerImage == theOther.myMarkerImage && myInteriorColor == theOther.myInteriorColor
0533            && myBackInteriorColor == theOther.myBackInteriorColor
0534            && myFrontMaterial == theOther.myFrontMaterial
0535            && myBackMaterial == theOther.myBackMaterial
0536            && myInteriorStyle == theOther.myInteriorStyle
0537            && myShadingModel == theOther.myShadingModel && myFaceCulling == theOther.myFaceCulling
0538            && myAlphaMode == theOther.myAlphaMode && myAlphaCutoff == theOther.myAlphaCutoff
0539            && myLineType == theOther.myLineType && myEdgeColor == theOther.myEdgeColor
0540            && myLineWidth == theOther.myLineWidth && myLineFactor == theOther.myLineFactor
0541            && myLinePattern == theOther.myLinePattern && myMarkerType == theOther.myMarkerType
0542            && myMarkerScale == theOther.myMarkerScale && myHatchStyle == theOther.myHatchStyle
0543            && myTextFont == theOther.myTextFont && myPolygonOffset == theOther.myPolygonOffset
0544            && myTextStyle == theOther.myTextStyle && myTextDisplayType == theOther.myTextDisplayType
0545            && myTextFontAspect == theOther.myTextFontAspect && myTextAngle == theOther.myTextAngle
0546            && myToSkipFirstEdge == theOther.myToSkipFirstEdge
0547            && myToDistinguishMaterials == theOther.myToDistinguishMaterials
0548            && myToUseVertexColorForBackFaces == theOther.myToUseVertexColorForBackFaces
0549            && myToDrawEdges == theOther.myToDrawEdges
0550            && myToDrawSilhouette == theOther.myToDrawSilhouette
0551            && myToMapTexture == theOther.myToMapTexture
0552            && myIsTextZoomable == theOther.myIsTextZoomable;
0553   }
0554 
0555   //! Dumps the content of me into the stream
0556   Standard_EXPORT virtual void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const;
0557 
0558 public:
0559   Standard_DEPRECATED("Deprecated method, FaceCulling() should be used instead")
0560   bool ToSuppressBackFaces() const
0561   {
0562     return myFaceCulling == Graphic3d_TypeOfBackfacingModel_BackCulled
0563            || myFaceCulling == Graphic3d_TypeOfBackfacingModel_Auto;
0564   }
0565 
0566   Standard_DEPRECATED("Deprecated method, SetFaceCulling() should be used "
0567                       "instead")
0568   void SetSuppressBackFaces(bool theToSuppress)
0569   {
0570     myFaceCulling = theToSuppress ? Graphic3d_TypeOfBackfacingModel_Auto
0571                                   : Graphic3d_TypeOfBackfacingModel_DoubleSided;
0572   }
0573 
0574   Standard_DEPRECATED("Deprecated method, FaceCulling() should be used instead")
0575   bool BackFace() const
0576   {
0577     return myFaceCulling == Graphic3d_TypeOfBackfacingModel_BackCulled
0578            || myFaceCulling == Graphic3d_TypeOfBackfacingModel_Auto;
0579   }
0580 
0581   Standard_DEPRECATED("Deprecated method, SetFaceCulling() should be used instead")
0582   void AllowBackFace() { myFaceCulling = Graphic3d_TypeOfBackfacingModel_DoubleSided; }
0583 
0584   Standard_DEPRECATED("Deprecated method, SetFaceCulling() should be used instead")
0585   void SuppressBackFace() { myFaceCulling = Graphic3d_TypeOfBackfacingModel_Auto; }
0586 
0587 protected:
0588   occ::handle<Graphic3d_ShaderProgram>  myProgram;
0589   occ::handle<Graphic3d_TextureSet>     myTextureSet;
0590   occ::handle<Graphic3d_MarkerImage>    myMarkerImage;
0591   occ::handle<Graphic3d_HatchStyle>     myHatchStyle;
0592   occ::handle<TCollection_HAsciiString> myTextFont;
0593   Graphic3d_MaterialAspect              myFrontMaterial;
0594   Graphic3d_MaterialAspect              myBackMaterial;
0595 
0596   Quantity_ColorRGBA myInteriorColor;
0597   Quantity_ColorRGBA myBackInteriorColor;
0598   Quantity_ColorRGBA myEdgeColor;
0599 
0600   Graphic3d_PolygonOffset         myPolygonOffset;
0601   Aspect_InteriorStyle            myInteriorStyle;
0602   Graphic3d_TypeOfShadingModel    myShadingModel;
0603   Graphic3d_TypeOfBackfacingModel myFaceCulling;
0604   Graphic3d_AlphaMode             myAlphaMode;
0605   float                           myAlphaCutoff;
0606 
0607   Aspect_TypeOfLine myLineType;
0608   float             myLineWidth;
0609   uint16_t          myLineFactor;
0610   uint16_t          myLinePattern;
0611 
0612   Aspect_TypeOfMarker myMarkerType;
0613   float               myMarkerScale;
0614 
0615   Aspect_TypeOfStyleText   myTextStyle;
0616   Aspect_TypeOfDisplayText myTextDisplayType;
0617   Font_FontAspect          myTextFontAspect;
0618   float                    myTextAngle;
0619 
0620   bool myToSkipFirstEdge;
0621   bool myToDistinguishMaterials;
0622   bool myToUseVertexColorForBackFaces;
0623   bool myToDrawEdges;
0624   bool myToDrawSilhouette;
0625   bool myToMapTexture;
0626   bool myIsTextZoomable;
0627 };
0628 
0629 #endif // _Graphic3d_Aspects_HeaderFile