Open CASCADE Technology  7.7.0
Static Public Member Functions
StdPrs_ToolTriangulatedShape Class Reference

#include <StdPrs_ToolTriangulatedShape.hxx>

Inheritance diagram for StdPrs_ToolTriangulatedShape:
Inheritance graph
[legend]

Static Public Member Functions

static Standard_Boolean IsTriangulated (const TopoDS_Shape &theShape)
 Similar to BRepTools::Triangulation() but without extra checks. More...
 
static Standard_Boolean IsClosed (const TopoDS_Shape &theShape)
 Checks back faces visibility for specified shape (to activate back-face culling).
More...
 
static Standard_Real GetDeflection (const TopoDS_Shape &theShape, const Handle< Prs3d_Drawer > &theDrawer)
 Computes the absolute deflection value depending on the type of deflection in theDrawer: More...
 
static Standard_Boolean IsTessellated (const TopoDS_Shape &theShape, const Handle< Prs3d_Drawer > &theDrawer)
 Checks whether the shape is properly triangulated for a given display settings. More...
 
static Standard_Boolean Tessellate (const TopoDS_Shape &theShape, const Handle< Prs3d_Drawer > &theDrawer)
 Validates triangulation within the shape and performs tessellation if necessary. More...
 
static void ClearOnOwnDeflectionChange (const TopoDS_Shape &theShape, const Handle< Prs3d_Drawer > &theDrawer, const Standard_Boolean theToResetCoeff)
 If presentation has own deviation coefficient and IsAutoTriangulation() is true, function will compare actual coefficients with previous values and will clear triangulation on their change (regardless actual tessellation quality). Function is placed here for compatibility reasons - new code should avoid using IsAutoTriangulation(). More...
 
- Static Public Member Functions inherited from BRepLib_ToolTriangulatedShape
static void ComputeNormals (const TopoDS_Face &theFace, const Handle< Poly_Triangulation > &theTris)
 Computes nodal normals for Poly_Triangulation structure using UV coordinates and surface. Does nothing if triangulation already defines normals. More...
 
static void ComputeNormals (const TopoDS_Face &theFace, const Handle< Poly_Triangulation > &theTris, Poly_Connect &thePolyConnect)
 Computes nodal normals for Poly_Triangulation structure using UV coordinates and surface. Does nothing if triangulation already defines normals. More...
 

Member Function Documentation

◆ ClearOnOwnDeflectionChange()

static void StdPrs_ToolTriangulatedShape::ClearOnOwnDeflectionChange ( const TopoDS_Shape theShape,
const Handle< Prs3d_Drawer > &  theDrawer,
const Standard_Boolean  theToResetCoeff 
)
static

If presentation has own deviation coefficient and IsAutoTriangulation() is true, function will compare actual coefficients with previous values and will clear triangulation on their change (regardless actual tessellation quality). Function is placed here for compatibility reasons - new code should avoid using IsAutoTriangulation().

Parameters
theShape[in] the shape
theDrawer[in] the display settings
theToResetCoeff[in] updates coefficients in theDrawer to actual state to avoid redundant recomputations

◆ GetDeflection()

static Standard_Real StdPrs_ToolTriangulatedShape::GetDeflection ( const TopoDS_Shape theShape,
const Handle< Prs3d_Drawer > &  theDrawer 
)
static

Computes the absolute deflection value depending on the type of deflection in theDrawer:

  • Aspect_TOD_RELATIVE: the absolute deflection is computed using the relative deviation coefficient from theDrawer and the shape's bounding box;
  • Aspect_TOD_ABSOLUTE: the maximal chordial deviation from theDrawer is returned.

In case of the type of deflection in theDrawer computed relative deflection for shape is stored as absolute deflection. It is necessary to use it later on for sub-shapes. This function should always be used to compute the deflection value for building discrete representations of the shape (triangulation, wireframe) to avoid inconsistencies between different representations of the shape and undesirable visual artifacts.

◆ IsClosed()

static Standard_Boolean StdPrs_ToolTriangulatedShape::IsClosed ( const TopoDS_Shape theShape)
static

Checks back faces visibility for specified shape (to activate back-face culling).

Returns
true if shape is closed manifold Solid or compound of such Solids.

◆ IsTessellated()

static Standard_Boolean StdPrs_ToolTriangulatedShape::IsTessellated ( const TopoDS_Shape theShape,
const Handle< Prs3d_Drawer > &  theDrawer 
)
static

Checks whether the shape is properly triangulated for a given display settings.

Parameters
theShape[in] the shape.
theDrawer[in] the display settings.

◆ IsTriangulated()

static Standard_Boolean StdPrs_ToolTriangulatedShape::IsTriangulated ( const TopoDS_Shape theShape)
static

Similar to BRepTools::Triangulation() but without extra checks.

Returns
true if all faces within shape are triangulated.

◆ Tessellate()

static Standard_Boolean StdPrs_ToolTriangulatedShape::Tessellate ( const TopoDS_Shape theShape,
const Handle< Prs3d_Drawer > &  theDrawer 
)
static

Validates triangulation within the shape and performs tessellation if necessary.

Parameters
theShape[in] the shape.
theDrawer[in] the display settings.
Returns
true if tessellation was recomputed and false otherwise.

The documentation for this class was generated from the following file: