Back to index

salome-geom  6.5.0
GEOMImpl_IPoint.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 interface to a function for the point creation.
00024 
00025 #include "GEOM_Function.hxx"
00026 
00027 #define ARG_X     1
00028 #define ARG_Y     2
00029 #define ARG_Z     3
00030 
00031 #define ARG_REF   4
00032 
00033 #define ARG_PARAM 5
00034 #define ARG_CURVE 6
00035 #define ARG_LINE1 7
00036 #define ARG_LINE2 8 
00037 
00038 #define ARG_SURFACE 9
00039 #define ARG_PARAM2 10
00040 
00041 #define ARG_LENGTH 11
00042 
00043 //#define ARG_FLAG 12
00044 
00045 class GEOMImpl_IPoint
00046 {
00047  public:
00048 
00049   GEOMImpl_IPoint(Handle(GEOM_Function) theFunction): _func(theFunction) {}
00050 
00051   void SetX(double theX) { _func->SetReal(ARG_X, theX); }
00052   void SetY(double theY) { _func->SetReal(ARG_Y, theY); }
00053   void SetZ(double theZ) { _func->SetReal(ARG_Z, theZ); }
00054 
00055   double GetX() { return _func->GetReal(ARG_X); }
00056   double GetY() { return _func->GetReal(ARG_Y); }
00057   double GetZ() { return _func->GetReal(ARG_Z); }
00058 
00059   void SetRef(Handle(GEOM_Function) theRefPoint) { _func->SetReference(ARG_REF, theRefPoint); }
00060 
00061   Handle(GEOM_Function) GetRef() { return _func->GetReference(ARG_REF); }
00062 
00063   void SetCurve(Handle(GEOM_Function) theRef) { _func->SetReference(ARG_CURVE, theRef); }
00064   void SetSurface(Handle(GEOM_Function) theRef) { _func->SetReference(ARG_SURFACE, theRef); }
00065   void SetLine1(Handle(GEOM_Function) theRef) { _func->SetReference(ARG_LINE1, theRef); }
00066   void SetLine2(Handle(GEOM_Function) theRef) { _func->SetReference(ARG_LINE2, theRef); }
00067 
00068   Handle(GEOM_Function) GetCurve() { return _func->GetReference(ARG_CURVE); }
00069   Handle(GEOM_Function) GetSurface() { return _func->GetReference(ARG_SURFACE); }
00070   Handle(GEOM_Function) GetLine1() { return _func->GetReference(ARG_LINE1); }
00071   Handle(GEOM_Function) GetLine2() { return _func->GetReference(ARG_LINE2); }
00072 
00073   void SetParameter(double theParam) { _func->SetReal(ARG_PARAM, theParam); }
00074   void SetParameter2(double theParam) { _func->SetReal(ARG_PARAM2, theParam); }
00075   void SetLength(double theLength) { _func->SetReal(ARG_LENGTH, theLength); }
00076   //void SetReversed(bool theReversed)  { _func->SetInteger(ARG_FLAG, theReversed); }
00077 
00078   double GetParameter() { return _func->GetReal(ARG_PARAM); }
00079   double GetParameter2() { return _func->GetReal(ARG_PARAM2); }
00080   double GetLength() { return _func->GetReal(ARG_LENGTH); }
00081   //bool   GetReversed() { return _func->GetInteger(ARG_FLAG); }
00082 
00083  private:
00084 
00085   Handle(GEOM_Function) _func;
00086 };