0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / BRepMesh / BRepMesh_NURBSRangeSplitter.hxx
CommitLineData
7bd071ed 1// Created on: 2016-07-07
2// Copyright (c) 2016 OPEN CASCADE SAS
3// Created by: Oleg AGASHIN
4//
5// This file is part of Open CASCADE Technology software library.
6//
7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef _BRepMesh_NURBSRangeSplitter_HeaderFile
17#define _BRepMesh_NURBSRangeSplitter_HeaderFile
18
19#include <BRepMesh_UVParamRangeSplitter.hxx>
20#include <IMeshData_Types.hxx>
21#include <IMeshTools_Parameters.hxx>
22
23//! Auxiliary class extending UV range splitter in order to generate
24//! internal nodes for NURBS surface.
25class BRepMesh_NURBSRangeSplitter : public BRepMesh_UVParamRangeSplitter
26{
27public:
28
29 //! Constructor.
30 BRepMesh_NURBSRangeSplitter()
d533dafb 31 : mySurfaceType(GeomAbs_OtherSurface)
7bd071ed 32 {
33 }
34
35 //! Destructor.
36 virtual ~BRepMesh_NURBSRangeSplitter()
37 {
38 }
39
40 //! Updates discrete range of surface according to its geometric range.
41 Standard_EXPORT virtual void AdjustRange() Standard_OVERRIDE;
42
43 //! Returns list of nodes generated using surface data and specified parameters.
44 Standard_EXPORT virtual Handle(IMeshData::ListOfPnt2d) GenerateSurfaceNodes(
45 const IMeshTools_Parameters& theParameters) const Standard_OVERRIDE;
46
47protected:
48
49 //! Initializes U and V parameters lists using CN continuity intervals.
46478ffe 50 Standard_EXPORT virtual Standard_Boolean initParameters() const;
7bd071ed 51
52private:
53
54 //! Computes parameters of filter and applies it to the source parameters.
55 Handle(IMeshData::SequenceOfReal) computeGrainAndFilterParameters(
56 const IMeshData::IMapOfReal& theSourceParams,
57 const Standard_Real theTol2d,
58 const Standard_Real theRangeDiff,
59 const Standard_Real theDelta,
60 const IMeshTools_Parameters& theParameters,
61 const Handle(NCollection_IncAllocator)& theAllocator) const;
62
63 //! Filters parameters in order to avoid too dence distribution.
64 Handle(IMeshData::SequenceOfReal) filterParameters(
65 const IMeshData::IMapOfReal& theParams,
66 const Standard_Real theMinDist,
67 const Standard_Real theFilterDist,
68 const Handle(NCollection_IncAllocator)& theAllocator) const;
69
46478ffe 70 enum EdgeType
71 {
72 Edge_Internal,
73 Edge_Frontier
74 };
75
76 enum ParamDimension
77 {
78 Param_U = 0x1,
79 Param_V = 0x2
80 };
81
82 //! Finds edges of discrete face and uses its points
83 //! as auxiliary control parameters for generation of nodes.
84 Standard_Boolean grabParamsOfEdges (const EdgeType theEdgeType,
85 const Standard_Integer theParamDimensionFlag) const;
86
7bd071ed 87private:
88
89 GeomAbs_SurfaceType mySurfaceType;
90};
91
92#endif