1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00
occt/src/BRepMesh/BRepMesh_NURBSRangeSplitter.hxx
oan c4ea4ca3d1 0032241: Mesh - wrong shading display of thrusections [regression since OCCT 7.4.0]
0032422: Mesh - Weird rendering
0029641: Mesher produce 'bad' result for extruded spline with given deviation coefficient

Added method BRepMesh_NURBSRangeSplitter::getUndefinedInterval() intended to compute checkpoint parameters for those NURBS surfaces which have no intervals at all. In this case number of poles is used to produce artificial regular grid which can be refined further. Add at least one midpoint for surfaces with one interval and only two poles.

Added BRepMesh_ExtrusionRangeSplitter and BRepMesh_UndefinedRangeSplitter derivatives from BRepMesh_NURBSRangeSplitter intended to handle special cases of extrusion surfaces and general surfaces with undefined parameters.
2022-09-16 18:34:44 +03:00

107 lines
3.8 KiB
C++

// Created on: 2016-07-07
// Copyright (c) 2016 OPEN CASCADE SAS
// Created by: Oleg AGASHIN
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepMesh_NURBSRangeSplitter_HeaderFile
#define _BRepMesh_NURBSRangeSplitter_HeaderFile
#include <BRepMesh_UVParamRangeSplitter.hxx>
#include <IMeshData_Types.hxx>
#include <IMeshTools_Parameters.hxx>
//! Auxiliary class extending UV range splitter in order to generate
//! internal nodes for NURBS surface.
class BRepMesh_NURBSRangeSplitter : public BRepMesh_UVParamRangeSplitter
{
public:
//! Constructor.
BRepMesh_NURBSRangeSplitter()
: mySurfaceType(GeomAbs_OtherSurface)
{
}
//! Destructor.
virtual ~BRepMesh_NURBSRangeSplitter()
{
}
//! Updates discrete range of surface according to its geometric range.
Standard_EXPORT virtual void AdjustRange() Standard_OVERRIDE;
//! Returns list of nodes generated using surface data and specified parameters.
Standard_EXPORT virtual Handle(IMeshData::ListOfPnt2d) GenerateSurfaceNodes(
const IMeshTools_Parameters& theParameters) const Standard_OVERRIDE;
protected:
//! Initializes U and V parameters lists using CN continuity intervals.
Standard_EXPORT virtual Standard_Boolean initParameters() const;
//! Returns number of intervals computed using available geometrical parameters.
Standard_EXPORT virtual Standard_Integer getUndefinedIntervalNb(
const Handle(Adaptor3d_Surface)& theSurface,
const Standard_Boolean isU,
const GeomAbs_Shape theContinuity) const;
private:
//! Tries to compute intervals even for cases with no intervals
//! at all using available geometrical parameters.
void getUndefinedInterval(
const Handle(Adaptor3d_Surface)& theSurface,
const Standard_Boolean isU,
const GeomAbs_Shape theContinuity,
const std::pair<Standard_Real, Standard_Real>& theRange,
TColStd_Array1OfReal& theIntervals) const;
//! Computes parameters of filter and applies it to the source parameters.
Handle(IMeshData::SequenceOfReal) computeGrainAndFilterParameters(
const IMeshData::IMapOfReal& theSourceParams,
const Standard_Real theTol2d,
const Standard_Real theRangeDiff,
const Standard_Real theDelta,
const IMeshTools_Parameters& theParameters,
const Handle(NCollection_IncAllocator)& theAllocator) const;
//! Filters parameters in order to avoid too dence distribution.
Handle(IMeshData::SequenceOfReal) filterParameters(
const IMeshData::IMapOfReal& theParams,
const Standard_Real theMinDist,
const Standard_Real theFilterDist,
const Handle(NCollection_IncAllocator)& theAllocator) const;
enum EdgeType
{
Edge_Internal,
Edge_Frontier
};
enum ParamDimension
{
Param_U = 0x1,
Param_V = 0x2
};
//! Finds edges of discrete face and uses its points
//! as auxiliary control parameters for generation of nodes.
Standard_Boolean grabParamsOfEdges (const EdgeType theEdgeType,
const Standard_Integer theParamDimensionFlag) const;
private:
GeomAbs_SurfaceType mySurfaceType;
};
#endif