Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:47

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