0029296: Data Exchange - implement import of mesh data from files in OBJ format
[occt.git] / src / BRepMesh / BRepMesh_UVParamRangeSplitter.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_UVParamRangeSplitter_HeaderFile
17#define _BRepMesh_UVParamRangeSplitter_HeaderFile
18
19#include <BRepMesh_DefaultRangeSplitter.hxx>
20#include <IMeshData_Types.hxx>
21
22//! Intended to generate internal mesh nodes using UV parameters of boundary discrete points.
23class BRepMesh_UVParamRangeSplitter : public BRepMesh_DefaultRangeSplitter
24{
25public:
26
27 //! Constructor.
28 BRepMesh_UVParamRangeSplitter()
29 : myAllocator(new NCollection_IncAllocator(IMeshData::MEMORY_BLOCK_SIZE_HUGE)),
30 myUParams(1, myAllocator),
31 myVParams(1, myAllocator)
32 {
33 }
34
35 //! Destructor.
36 virtual ~BRepMesh_UVParamRangeSplitter()
37 {
38 }
39
40 //! Resets this splitter.
41 virtual void Reset(const IMeshData::IFaceHandle& theDFace,
42 const IMeshTools_Parameters& theParameters) Standard_OVERRIDE
43 {
44 BRepMesh_DefaultRangeSplitter::Reset(theDFace, theParameters);
45 myUParams.Clear();
46 myVParams.Clear();
47 myAllocator->Reset(Standard_False);
48 }
49
50public:
51 //! Returns U parameters.
52 inline const IMeshData::IMapOfReal& GetParametersU() const
53 {
54 return myUParams;
55 }
56
57 //! Returns U parameters.
58 inline IMeshData::IMapOfReal& GetParametersU()
59 {
60 return myUParams;
61 }
62
63 //! Returns V parameters.
64 inline const IMeshData::IMapOfReal& GetParametersV() const
65 {
66 return myVParams;
67 }
68
69 //! Returns V parameters.
70 inline IMeshData::IMapOfReal& GetParametersV()
71 {
72 return myVParams;
73 }
74
75private:
76 Handle(NCollection_IncAllocator) myAllocator;
77 IMeshData::IMapOfReal myUParams;
78 IMeshData::IMapOfReal myVParams;
79};
80
81#endif