//! Returns current polygon offsets settings.
const Graphic3d_PolygonOffset& PolygonOffset() const { return myPolygonOffset; }
+ //! Sets polygon offsets settings.
+ void SetPolygonOffset (const Graphic3d_PolygonOffset& theOffset) { myPolygonOffset = theOffset; }
+
//! Returns current polygon offsets settings.
void PolygonOffsets (Standard_Integer& theMode,
Standard_ShortReal& theFactor,
public:
//! Returns true if edges should be drawn (false by default).
- bool ToDrawEdges() const { return myToDrawEdges; }
+ bool ToDrawEdges() const { return myToDrawEdges && myEdgeType != Aspect_TOL_EMPTY; }
//! Set if edges should be drawn or not.
- void SetDrawEdges (bool theToDraw) { myToDrawEdges = theToDraw; }
+ void SetDrawEdges (bool theToDraw)
+ {
+ myToDrawEdges = theToDraw;
+ if (myEdgeType == Aspect_TOL_EMPTY)
+ {
+ myEdgeType = Aspect_TOL_SOLID;
+ }
+ }
//! Returns true if edges should be drawn.
- bool Edge() const { return myToDrawEdges; }
+ bool Edge() const { return ToDrawEdges(); }
//! The edges of FillAreas are drawn.
- void SetEdgeOn() { myToDrawEdges = true; }
+ void SetEdgeOn() { SetDrawEdges (true); }
//! The edges of FillAreas are not drawn.
- void SetEdgeOff() { myToDrawEdges = false; }
+ void SetEdgeOff() { SetDrawEdges (false); }
//! Return color of edges.
const Quantity_Color& EdgeColor() const { return myEdgeColor.GetRGB(); }
//! Modifies the color of the edge of the face
void SetEdgeColor (const Quantity_Color& theColor) { myEdgeColor.SetRGB (theColor); }
+ //! Modifies the color of the edge of the face
+ void SetEdgeColor (const Quantity_ColorRGBA& theColor) { myEdgeColor = theColor; }
+
//! Return edges line type.
Aspect_TypeOfLine EdgeLineType() const { return myEdgeType; }
myEdgeWidth = (float )theWidth;
}
+ //! Returns TRUE if drawing element edges should discard first edge in triangle; FALSE by default.
+ //! Graphics hardware works mostly with triangles, so that wireframe presentation will draw triangle edges by default.
+ //! This flag allows rendering wireframe presentation of quad-only array split into triangles.
+ //! For this, quads should be split in specific order, so that the quad diagonal (to be NOT rendered) goes first:
+ //! 1------2
+ //! / / Triangle #1: 2-0-1; Triangle #2: 0-2-3
+ //! 0------3
+ bool ToSkipFirstEdge() const { return myToSkipFirstEdge; }
+
+ //! Set skip first triangle edge flag for drawing wireframe presentation of quads array split into triangles.
+ void SetSkipFirstEdge (bool theToSkipFirstEdge) { myToSkipFirstEdge = theToSkipFirstEdge; }
+
+ //! Returns TRUE if silhouette (outline) should be drawn (with edge color and width); FALSE by default.
+ bool ToDrawSilhouette() const { return myToDrawSilhouette; }
+
+ //! Enables/disables drawing silhouette (outline).
+ void SetDrawSilhouette (bool theToDraw) { myToDrawSilhouette = theToDraw; }
+
public:
//! Returns the hatch type used when InteriorStyle is IS_HATCH
Handle(Graphic3d_HatchStyle) myHatchStyle;
Graphic3d_PolygonOffset myPolygonOffset;
+ bool myToSkipFirstEdge;
bool myToDistinguishMaterials;
bool myToDrawEdges;
+ bool myToDrawSilhouette;
bool myToSuppressBackFaces;
bool myToMapTexture;