Version: 9.16.0
GEOMImpl_IPartition.hxx
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
2//
3// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5//
6// This library is free software; you can redistribute it and/or
7// modify it under the terms of the GNU Lesser General Public
8// License as published by the Free Software Foundation; either
9// version 2.1 of the License, or (at your option) any later version.
10//
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14// Lesser General Public License for more details.
15//
16// You should have received a copy of the GNU Lesser General Public
17// License along with this library; if not, write to the Free Software
18// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19//
20// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21//
22
23//NOTE: This is an interface to a function for the Partition creation.
24//
25#include "GEOM_Function.hxx"
26
27#include "TColStd_HSequenceOfTransient.hxx"
28#include "TColStd_HArray1OfInteger.hxx"
29
30#define PART_ARG_LIMIT 1
31#define PART_ARG_SHAPES 2
32#define PART_ARG_TOOLS 3
33#define PART_ARG_KEEP_IN 4
34#define PART_ARG_REM_IN 5
35
36#define PART_ARG_MATERIALS 6
37
38#define PART_ARG_SHAPE 7
39#define PART_ARG_PLANE 8
40
41#define PART_ARG_KEEP_NONLIMIT_SHAPES 9
42#define PART_ARG_CHECK_SELF_INTERSECTION 10
43#define PART_ARG_FUZZY_PARAMETER 11
44
46{
47 public:
48
49 GEOMImpl_IPartition(Handle(GEOM_Function) theFunction): _func(theFunction) {}
50
51 void SetLimit(int theLimit) { _func->SetInteger(PART_ARG_LIMIT, theLimit); }
52
53 void SetKeepNonlimitShapes(int theKeepNonlimitShapes)
54 { _func->SetInteger(PART_ARG_KEEP_NONLIMIT_SHAPES,theKeepNonlimitShapes ); }
55
56 void SetShapes(const Handle(TColStd_HSequenceOfTransient)& theShapes)
57 { _func->SetReferenceList(PART_ARG_SHAPES, theShapes); }
58
59 void SetTools(const Handle(TColStd_HSequenceOfTransient)& theShapes)
60 { _func->SetReferenceList(PART_ARG_TOOLS, theShapes); }
61
62 void SetKeepIns(const Handle(TColStd_HSequenceOfTransient)& theShapes)
63 { _func->SetReferenceList(PART_ARG_KEEP_IN, theShapes); }
64
65 void SetRemoveIns(const Handle(TColStd_HSequenceOfTransient)& theShapes)
66 { _func->SetReferenceList(PART_ARG_REM_IN, theShapes); }
67
68 void SetMaterials(const Handle(TColStd_HArray1OfInteger)& theMaterials)
69 { _func->SetIntegerArray(PART_ARG_MATERIALS, theMaterials); }
70
71 void SetCheckSelfIntersection (Standard_Boolean theFlag)
72 { _func->SetInteger(PART_ARG_CHECK_SELF_INTERSECTION, theFlag ? 1 : 0); }
73
74 void SetFuzzyParameter (Standard_Real theValue)
75 { _func->SetReal(PART_ARG_FUZZY_PARAMETER, theValue); }
76
77 int GetLimit() { return _func->GetInteger(PART_ARG_LIMIT); }
78
79 int GetKeepNonlimitShapes() { return _func->GetInteger(PART_ARG_KEEP_NONLIMIT_SHAPES); }
80
81 Handle(TColStd_HSequenceOfTransient) GetShapes() { return _func->GetReferenceList(PART_ARG_SHAPES); }
82 Handle(TColStd_HSequenceOfTransient) GetTools() { return _func->GetReferenceList(PART_ARG_TOOLS); }
83 Handle(TColStd_HSequenceOfTransient) GetKeepIns() { return _func->GetReferenceList(PART_ARG_KEEP_IN); }
84 Handle(TColStd_HSequenceOfTransient) GetRemoveIns() { return _func->GetReferenceList(PART_ARG_REM_IN); }
85
86 Handle(TColStd_HArray1OfInteger) GetMaterials() { return _func->GetIntegerArray(PART_ARG_MATERIALS); }
87
88
89 void SetShape(Handle(GEOM_Function) theShape) { _func->SetReference(PART_ARG_SHAPE, theShape); }
90 void SetPlane(Handle(GEOM_Function) thePlane) { _func->SetReference(PART_ARG_PLANE, thePlane); }
91
92 Handle(GEOM_Function) GetShape() { return _func->GetReference(PART_ARG_SHAPE); }
93 Handle(GEOM_Function) GetPlane() { return _func->GetReference(PART_ARG_PLANE); }
94
95 Standard_Boolean GetCheckSelfIntersection()
96 { return (_func->GetInteger(PART_ARG_CHECK_SELF_INTERSECTION) != 0); }
97
98 Standard_Real GetFuzzyParameter()
99 { return _func->GetReal(PART_ARG_FUZZY_PARAMETER); }
100
101 private:
102
103 Handle(GEOM_Function) _func;
104};
#define PART_ARG_MATERIALS
Definition: GEOMImpl_IPartition.hxx:36
#define PART_ARG_KEEP_IN
Definition: GEOMImpl_IPartition.hxx:33
#define PART_ARG_KEEP_NONLIMIT_SHAPES
Definition: GEOMImpl_IPartition.hxx:41
#define PART_ARG_TOOLS
Definition: GEOMImpl_IPartition.hxx:32
#define PART_ARG_SHAPE
Definition: GEOMImpl_IPartition.hxx:38
#define PART_ARG_LIMIT
Definition: GEOMImpl_IPartition.hxx:30
#define PART_ARG_FUZZY_PARAMETER
Definition: GEOMImpl_IPartition.hxx:43
#define PART_ARG_REM_IN
Definition: GEOMImpl_IPartition.hxx:34
#define PART_ARG_CHECK_SELF_INTERSECTION
Definition: GEOMImpl_IPartition.hxx:42
#define PART_ARG_PLANE
Definition: GEOMImpl_IPartition.hxx:39
#define PART_ARG_SHAPES
Definition: GEOMImpl_IPartition.hxx:31
Definition: GEOMImpl_IPartition.hxx:46
int GetLimit()
Definition: GEOMImpl_IPartition.hxx:77
Standard_Real GetFuzzyParameter()
Definition: GEOMImpl_IPartition.hxx:98
void SetMaterials(const Handle(TColStd_HArray1OfInteger)&theMaterials)
Definition: GEOMImpl_IPartition.hxx:68
Standard_Boolean GetCheckSelfIntersection()
Definition: GEOMImpl_IPartition.hxx:95
void SetKeepIns(const Handle(TColStd_HSequenceOfTransient)&theShapes)
Definition: GEOMImpl_IPartition.hxx:62
void SetLimit(int theLimit)
Definition: GEOMImpl_IPartition.hxx:51
void SetShapes(const Handle(TColStd_HSequenceOfTransient)&theShapes)
Definition: GEOMImpl_IPartition.hxx:56
void SetPlane(Handle(GEOM_Function) thePlane)
Definition: GEOMImpl_IPartition.hxx:90
int GetKeepNonlimitShapes()
Definition: GEOMImpl_IPartition.hxx:79
Handle(TColStd_HSequenceOfTransient) GetKeepIns()
Definition: GEOMImpl_IPartition.hxx:83
void SetCheckSelfIntersection(Standard_Boolean theFlag)
Definition: GEOMImpl_IPartition.hxx:71
void SetShape(Handle(GEOM_Function) theShape)
Definition: GEOMImpl_IPartition.hxx:89
Handle(GEOM_Function) _func
Handle(TColStd_HSequenceOfTransient) GetShapes()
Definition: GEOMImpl_IPartition.hxx:81
Handle(TColStd_HSequenceOfTransient) GetRemoveIns()
Definition: GEOMImpl_IPartition.hxx:84
Handle(GEOM_Function) GetShape()
Definition: GEOMImpl_IPartition.hxx:92
Handle(TColStd_HArray1OfInteger) GetMaterials()
Definition: GEOMImpl_IPartition.hxx:86
void SetTools(const Handle(TColStd_HSequenceOfTransient)&theShapes)
Definition: GEOMImpl_IPartition.hxx:59
void SetFuzzyParameter(Standard_Real theValue)
Definition: GEOMImpl_IPartition.hxx:74
void SetRemoveIns(const Handle(TColStd_HSequenceOfTransient)&theShapes)
Definition: GEOMImpl_IPartition.hxx:65
void SetKeepNonlimitShapes(int theKeepNonlimitShapes)
Definition: GEOMImpl_IPartition.hxx:53
Handle(TColStd_HSequenceOfTransient) GetTools()
Definition: GEOMImpl_IPartition.hxx:82
GEOMImpl_IPartition(Handle(GEOM_Function) theFunction)
Definition: GEOMImpl_IPartition.hxx:49
Handle(GEOM_Function) GetPlane()
Definition: GEOMImpl_IPartition.hxx:93