1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 //NOTE: This is an intreface to a function for the Transfer Data functionality.
27 #ifndef _GEOMImpl_ITransferData_HXX_
28 #define _GEOMImpl_ITransferData_HXX_
31 #include "GEOM_GEOMImpl.hxx"
32 #include "GEOM_Function.hxx"
34 #include <TColStd_HArray1OfInteger.hxx>
39 #define TD_ARG_METHOD 3
40 #define TD_ARG_DATUM_NAME 4
41 #define TD_ARG_DATUM_MAX_VALUE 5
42 #define TD_ARG_DATUM_VALUE 6
44 class GEOMImpl_ITransferData
48 GEOMImpl_ITransferData(const Handle(GEOM_Function) &theFunction)
49 : _func(theFunction) {}
51 void SetRef1(const Handle(GEOM_Function) &theRefPoint1)
52 { _func->SetReference(TD_ARG_REF1, theRefPoint1); }
54 Handle(GEOM_Function) GetRef1() { return _func->GetReference(TD_ARG_REF1); }
56 void SetRef2(const Handle(GEOM_Function) &theRefPoint2)
57 { _func->SetReference(TD_ARG_REF2, theRefPoint2); }
59 Handle(GEOM_Function) GetRef2() { return _func->GetReference(TD_ARG_REF2); }
61 void SetFindMethod(const int theFindMethod)
62 { _func->SetInteger(TD_ARG_METHOD, theFindMethod); }
64 int GetFindMethod() { return _func->GetInteger(TD_ARG_METHOD); }
66 void SetDatumName(const Handle(TColStd_HArray1OfExtendedString) &theDatumName)
67 { _func->SetStringArray(TD_ARG_DATUM_NAME, theDatumName); }
69 Handle(TColStd_HArray1OfExtendedString) GetDatumName()
70 { return _func->GetStringArray(TD_ARG_DATUM_NAME); }
72 void SetDatumMaxVal(const Handle(TColStd_HArray1OfInteger) &theDatumMaxVal)
73 { _func->SetIntegerArray(TD_ARG_DATUM_MAX_VALUE, theDatumMaxVal); }
75 Handle(TColStd_HArray1OfInteger) GetDatumMaxVal()
76 { return _func->GetIntegerArray(TD_ARG_DATUM_MAX_VALUE); }
78 void SetDatumVal(const Handle(TColStd_HArray1OfInteger) &theDatumVal)
79 { _func->SetIntegerArray(TD_ARG_DATUM_VALUE, theDatumVal); }
81 Handle(TColStd_HArray1OfInteger) GetDatumVal()
82 { return _func->GetIntegerArray(TD_ARG_DATUM_VALUE); }
84 GEOMIMPL_EXPORT void SetName(const TopoDS_Shape &theSubShape,
85 const TCollection_AsciiString &theName)
86 { SetStringData(theSubShape, theName, Standard_True); }
88 GEOMIMPL_EXPORT TCollection_AsciiString GetName
89 (const TopoDS_Shape &theSubShape)
90 { return GetStringData(theSubShape, Standard_True); }
92 GEOMIMPL_EXPORT void SetMaterial(const TopoDS_Shape &theSubShape,
93 const TCollection_AsciiString &theName)
94 { SetStringData(theSubShape, theName, Standard_False); }
96 GEOMIMPL_EXPORT TCollection_AsciiString GetMaterial
97 (const TopoDS_Shape &theSubShape)
98 { return GetStringData(theSubShape, Standard_False); }
102 TCollection_AsciiString GetStringData(const TopoDS_Shape &theSubShape,
103 const Standard_Boolean IsName);
105 void SetStringData(const TopoDS_Shape &theSubShape,
106 const TCollection_AsciiString &theData,
107 const Standard_Boolean IsName);
111 Handle(GEOM_Function) _func;