Back to index

salome-geom  6.5.0
GEOMImpl_IPartition.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //NOTE: This is an intreface to a function for the Partition creation.
00024 //
00025 #include "GEOM_Function.hxx"
00026 
00027 #include "TColStd_HSequenceOfTransient.hxx"
00028 #include "TColStd_HArray1OfInteger.hxx"
00029 
00030 #define PART_ARG_LIMIT   1
00031 #define PART_ARG_SHAPES  2
00032 #define PART_ARG_TOOLS   3
00033 #define PART_ARG_KEEP_IN 4
00034 #define PART_ARG_REM_IN  5
00035 
00036 #define PART_ARG_MATERIALS 6
00037 
00038 #define PART_ARG_SHAPE 7
00039 #define PART_ARG_PLANE 8
00040 
00041 #define PART_ARG_KEEP_NONLIMIT_SHAPES 9
00042 
00043 class GEOMImpl_IPartition
00044 {
00045  public:
00046 
00047   GEOMImpl_IPartition(Handle(GEOM_Function) theFunction): _func(theFunction) {}
00048 
00049   void SetLimit(int theLimit) { _func->SetInteger(PART_ARG_LIMIT, theLimit); }
00050 
00051   void SetKeepNonlimitShapes(int theKeepNonlimitShapes)
00052   { _func->SetInteger(PART_ARG_KEEP_NONLIMIT_SHAPES,theKeepNonlimitShapes ); }
00053 
00054   void SetShapes(const Handle(TColStd_HSequenceOfTransient)& theShapes)
00055   { _func->SetReferenceList(PART_ARG_SHAPES, theShapes); }
00056 
00057   void SetTools(const Handle(TColStd_HSequenceOfTransient)& theShapes)
00058   { _func->SetReferenceList(PART_ARG_TOOLS, theShapes); }
00059 
00060   void SetKeepIns(const Handle(TColStd_HSequenceOfTransient)& theShapes)
00061   { _func->SetReferenceList(PART_ARG_KEEP_IN, theShapes); }
00062 
00063   void SetRemoveIns(const Handle(TColStd_HSequenceOfTransient)& theShapes)
00064   { _func->SetReferenceList(PART_ARG_REM_IN, theShapes); }
00065 
00066   void SetMaterials(const Handle(TColStd_HArray1OfInteger)& theMaterials)
00067   { _func->SetIntegerArray(PART_ARG_MATERIALS, theMaterials); }
00068 
00069 
00070   int GetLimit() { return _func->GetInteger(PART_ARG_LIMIT); }
00071 
00072   int GetKeepNonlimitShapes() { return _func->GetInteger(PART_ARG_KEEP_NONLIMIT_SHAPES); }
00073 
00074   Handle(TColStd_HSequenceOfTransient) GetShapes()    { return _func->GetReferenceList(PART_ARG_SHAPES); }
00075   Handle(TColStd_HSequenceOfTransient) GetTools()     { return _func->GetReferenceList(PART_ARG_TOOLS); }
00076   Handle(TColStd_HSequenceOfTransient) GetKeepIns()   { return _func->GetReferenceList(PART_ARG_KEEP_IN); }
00077   Handle(TColStd_HSequenceOfTransient) GetRemoveIns() { return _func->GetReferenceList(PART_ARG_REM_IN); }
00078 
00079   Handle(TColStd_HArray1OfInteger) GetMaterials() { return _func->GetIntegerArray(PART_ARG_MATERIALS); }
00080 
00081 
00082   void SetShape(Handle(GEOM_Function) theShape) { _func->SetReference(PART_ARG_SHAPE, theShape); }
00083   void SetPlane(Handle(GEOM_Function) thePlane) { _func->SetReference(PART_ARG_PLANE, thePlane); }
00084 
00085   Handle(GEOM_Function) GetShape() { return _func->GetReference(PART_ARG_SHAPE); }
00086   Handle(GEOM_Function) GetPlane() { return _func->GetReference(PART_ARG_PLANE); }
00087 
00088  private:
00089 
00090   Handle(GEOM_Function) _func;
00091 };