Open CASCADE Technology  7.5.0
Static Public Member Functions

StdPrs_ToolTriangulatedShape Class Reference

#include <StdPrs_ToolTriangulatedShape.hxx>

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 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...
 
static void Normal (const TopoDS_Face &theFace, Poly_Connect &thePolyConnect, TColgp_Array1OfDir &theNormals)
 Evaluate normals for a triangle of a face. 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...
 

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

◆ ComputeNormals() [1/2]

static void StdPrs_ToolTriangulatedShape::ComputeNormals ( const TopoDS_Face theFace,
const Handle< Poly_Triangulation > &  theTris 
)
inlinestatic

Computes nodal normals for Poly_Triangulation structure using UV coordinates and surface. Does nothing if triangulation already defines normals.

Parameters
theFace[in] the face
theTris[in] the definition of a face triangulation

◆ ComputeNormals() [2/2]

static void StdPrs_ToolTriangulatedShape::ComputeNormals ( const TopoDS_Face theFace,
const Handle< Poly_Triangulation > &  theTris,
Poly_Connect thePolyConnect 
)
static

Computes nodal normals for Poly_Triangulation structure using UV coordinates and surface. Does nothing if triangulation already defines normals.

Parameters
theFace[in] the face
theTris[in] the definition of a face triangulation
thePolyConnect[in,out] optional, initialized tool for exploring triangulation

◆ 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 (triangualtion, wireframe) to avoid incosistencies 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.

◆ Normal()

static void StdPrs_ToolTriangulatedShape::Normal ( const TopoDS_Face theFace,
Poly_Connect thePolyConnect,
TColgp_Array1OfDir theNormals 
)
static

Evaluate normals for a triangle of a face.

Parameters
theFace[in] the face.
thePolyConnect[in] the definition of a face triangulation.
theNormal[out] the array of normals for each triangle.

◆ 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 tesselation was recomputed and false otherwise.

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