PageRenderTime 32ms CodeModel.GetById 12ms app.highlight 17ms RepoModel.GetById 1ms app.codeStats 0ms

/src/contrib/geom-5.1.2.7/inc/GEOMImpl_IMarker.hxx

http://pythonocc.googlecode.com/
C++ Header | 133 lines | 89 code | 20 blank | 24 comment | 0 complexity | b248cb3b2eb559811efe77dd90d5bc30 MD5 | raw file
  1// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
  2// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
  3// 
  4// This library is free software; you can redistribute it and/or
  5// modify it under the terms of the GNU Lesser General Public
  6// License as published by the Free Software Foundation; either 
  7// version 2.1 of the License.
  8// 
  9// This library is distributed in the hope that it will be useful 
 10// but WITHOUT ANY WARRANTY; without even the implied warranty of 
 11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
 12// Lesser General Public License for more details.
 13//
 14// You should have received a copy of the GNU Lesser General Public  
 15// License along with this library; if not, write to the Free Software 
 16// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 17//
 18// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 19//
 20//NOTE: This is an interface to a function for the local coordinate system creation.
 21
 22
 23#include "GEOM_Function.hxx"
 24
 25#define CS_ARG_O_X   1
 26#define CS_ARG_O_Y   2
 27#define CS_ARG_O_Z   3
 28
 29#define CS_ARG_X_DX  4
 30#define CS_ARG_X_DY  5
 31#define CS_ARG_X_DZ  6
 32
 33#define CS_ARG_Y_DX  7
 34#define CS_ARG_Y_DY  8
 35#define CS_ARG_Y_DZ  9
 36
 37class GEOMImpl_IMarker
 38{
 39 public:
 40
 41  GEOMImpl_IMarker(Handle(GEOM_Function) theFunction): _func(theFunction) {}
 42
 43  //as string
 44  void SetOrigin (const TCollection_AsciiString& theX, const TCollection_AsciiString& theY, const TCollection_AsciiString& theZ)
 45  {
 46    _func->SetReal(CS_ARG_O_X, theX);
 47    _func->SetReal(CS_ARG_O_Y, theY);
 48    _func->SetReal(CS_ARG_O_Z, theZ);
 49  }
 50
 51  void SetXDir (const TCollection_AsciiString& theDX, const TCollection_AsciiString& theDY, const TCollection_AsciiString& theDZ)
 52  {
 53    _func->SetReal(CS_ARG_X_DX, theDX);
 54    _func->SetReal(CS_ARG_X_DY, theDY);
 55    _func->SetReal(CS_ARG_X_DZ, theDZ);
 56  }
 57
 58  void SetYDir (const TCollection_AsciiString& theDX, const TCollection_AsciiString& theDY, const TCollection_AsciiString& theDZ)
 59  {
 60    _func->SetReal(CS_ARG_Y_DX, theDX);
 61    _func->SetReal(CS_ARG_Y_DY, theDY);
 62    _func->SetReal(CS_ARG_Y_DZ, theDZ);
 63  }
 64
 65  //as double
 66  void SetOrigin (const double& theX, const double& theY, const double& theZ)
 67  {
 68	_func->SetReal(CS_ARG_O_X, theX);
 69	_func->SetReal(CS_ARG_O_Y, theY);
 70	_func->SetReal(CS_ARG_O_Z, theZ);
 71  }
 72
 73  void SetXDir (const double& theDX, const double& theDY, const double& theDZ)
 74  {
 75	_func->SetReal(CS_ARG_X_DX, theDX);
 76	_func->SetReal(CS_ARG_X_DY, theDY);
 77	_func->SetReal(CS_ARG_X_DZ, theDZ);
 78  }
 79
 80  void SetYDir (const double& theDX, const double& theDY, const double& theDZ)
 81  {
 82	_func->SetReal(CS_ARG_Y_DX, theDX);
 83	_func->SetReal(CS_ARG_Y_DY, theDY);
 84	_func->SetReal(CS_ARG_Y_DZ, theDZ);
 85  }
 86
 87  //one by one as string
 88  void SetOX(const TCollection_AsciiString& theOX)   { _func->SetReal(CS_ARG_O_X,  theOX); }
 89  void SetOY(const TCollection_AsciiString& theOY)   { _func->SetReal(CS_ARG_O_Y,  theOY); }
 90  void SetOZ(const TCollection_AsciiString& theOZ)   { _func->SetReal(CS_ARG_O_Z,  theOZ); }
 91  void SetXDX(const TCollection_AsciiString& theXDX) { _func->SetReal(CS_ARG_X_DX, theXDX); }
 92  void SetXDY(const TCollection_AsciiString& theXDY) { _func->SetReal(CS_ARG_X_DY, theXDY); }
 93  void SetXDZ(const TCollection_AsciiString& theXDZ) { _func->SetReal(CS_ARG_X_DZ, theXDZ); }
 94  void SetYDX(const TCollection_AsciiString& theYDX) { _func->SetReal(CS_ARG_Y_DX, theYDX); }
 95  void SetYDY(const TCollection_AsciiString& theYDY) { _func->SetReal(CS_ARG_Y_DY, theYDY); }
 96  void SetYDZ(const TCollection_AsciiString& theYDZ) { _func->SetReal(CS_ARG_Y_DZ, theYDZ); }
 97
 98  //one by one as double
 99  void SetOX(const double&  theOX)   { _func->SetReal(CS_ARG_O_X,  theOX); }
100  void SetOY(const double&  theOY)   { _func->SetReal(CS_ARG_O_Y,  theOY); }
101  void SetOZ(const double&  theOZ)   { _func->SetReal(CS_ARG_O_Z,  theOZ); }
102  void SetXDX(const double& theXDX)  { _func->SetReal(CS_ARG_X_DX, theXDX); }
103  void SetXDY(const double& theXDY)  { _func->SetReal(CS_ARG_X_DY, theXDY); }
104  void SetXDZ(const double& theXDZ)  { _func->SetReal(CS_ARG_X_DZ, theXDZ); }
105  void SetYDX(const double& theYDX)  { _func->SetReal(CS_ARG_Y_DX, theYDX); }
106  void SetYDY(const double& theYDY)  { _func->SetReal(CS_ARG_Y_DY, theYDY); }
107  void SetYDZ(const double& theYDZ)  { _func->SetReal(CS_ARG_Y_DZ, theYDZ); }
108
109  void GetOrigin (double& theX, double& theY, double& theZ)
110  {
111    theX = _func->GetReal(CS_ARG_O_X);
112    theY = _func->GetReal(CS_ARG_O_Y);
113    theZ = _func->GetReal(CS_ARG_O_Z);
114  }
115
116  void GetXDir (double& theDX, double& theDY, double& theDZ)
117  {
118    theDX = _func->GetReal(CS_ARG_X_DX);
119    theDY = _func->GetReal(CS_ARG_X_DY);
120    theDZ = _func->GetReal(CS_ARG_X_DZ);
121  }
122
123  void GetYDir (double& theDX, double& theDY, double& theDZ)
124  {
125    theDX = _func->GetReal(CS_ARG_Y_DX);
126    theDY = _func->GetReal(CS_ARG_Y_DY);
127    theDZ = _func->GetReal(CS_ARG_Y_DZ);
128  }
129
130 private:
131
132  Handle(GEOM_Function) _func;
133};