/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. #include "GEOM_Function.hxx"
  22. #define CS_ARG_O_X 1
  23. #define CS_ARG_O_Y 2
  24. #define CS_ARG_O_Z 3
  25. #define CS_ARG_X_DX 4
  26. #define CS_ARG_X_DY 5
  27. #define CS_ARG_X_DZ 6
  28. #define CS_ARG_Y_DX 7
  29. #define CS_ARG_Y_DY 8
  30. #define CS_ARG_Y_DZ 9
  31. class GEOMImpl_IMarker
  32. {
  33. public:
  34. GEOMImpl_IMarker(Handle(GEOM_Function) theFunction): _func(theFunction) {}
  35. //as string
  36. void SetOrigin (const TCollection_AsciiString& theX, const TCollection_AsciiString& theY, const TCollection_AsciiString& theZ)
  37. {
  38. _func->SetReal(CS_ARG_O_X, theX);
  39. _func->SetReal(CS_ARG_O_Y, theY);
  40. _func->SetReal(CS_ARG_O_Z, theZ);
  41. }
  42. void SetXDir (const TCollection_AsciiString& theDX, const TCollection_AsciiString& theDY, const TCollection_AsciiString& theDZ)
  43. {
  44. _func->SetReal(CS_ARG_X_DX, theDX);
  45. _func->SetReal(CS_ARG_X_DY, theDY);
  46. _func->SetReal(CS_ARG_X_DZ, theDZ);
  47. }
  48. void SetYDir (const TCollection_AsciiString& theDX, const TCollection_AsciiString& theDY, const TCollection_AsciiString& theDZ)
  49. {
  50. _func->SetReal(CS_ARG_Y_DX, theDX);
  51. _func->SetReal(CS_ARG_Y_DY, theDY);
  52. _func->SetReal(CS_ARG_Y_DZ, theDZ);
  53. }
  54. //as double
  55. void SetOrigin (const double& theX, const double& theY, const double& theZ)
  56. {
  57. _func->SetReal(CS_ARG_O_X, theX);
  58. _func->SetReal(CS_ARG_O_Y, theY);
  59. _func->SetReal(CS_ARG_O_Z, theZ);
  60. }
  61. void SetXDir (const double& theDX, const double& theDY, const double& theDZ)
  62. {
  63. _func->SetReal(CS_ARG_X_DX, theDX);
  64. _func->SetReal(CS_ARG_X_DY, theDY);
  65. _func->SetReal(CS_ARG_X_DZ, theDZ);
  66. }
  67. void SetYDir (const double& theDX, const double& theDY, const double& theDZ)
  68. {
  69. _func->SetReal(CS_ARG_Y_DX, theDX);
  70. _func->SetReal(CS_ARG_Y_DY, theDY);
  71. _func->SetReal(CS_ARG_Y_DZ, theDZ);
  72. }
  73. //one by one as string
  74. void SetOX(const TCollection_AsciiString& theOX) { _func->SetReal(CS_ARG_O_X, theOX); }
  75. void SetOY(const TCollection_AsciiString& theOY) { _func->SetReal(CS_ARG_O_Y, theOY); }
  76. void SetOZ(const TCollection_AsciiString& theOZ) { _func->SetReal(CS_ARG_O_Z, theOZ); }
  77. void SetXDX(const TCollection_AsciiString& theXDX) { _func->SetReal(CS_ARG_X_DX, theXDX); }
  78. void SetXDY(const TCollection_AsciiString& theXDY) { _func->SetReal(CS_ARG_X_DY, theXDY); }
  79. void SetXDZ(const TCollection_AsciiString& theXDZ) { _func->SetReal(CS_ARG_X_DZ, theXDZ); }
  80. void SetYDX(const TCollection_AsciiString& theYDX) { _func->SetReal(CS_ARG_Y_DX, theYDX); }
  81. void SetYDY(const TCollection_AsciiString& theYDY) { _func->SetReal(CS_ARG_Y_DY, theYDY); }
  82. void SetYDZ(const TCollection_AsciiString& theYDZ) { _func->SetReal(CS_ARG_Y_DZ, theYDZ); }
  83. //one by one as double
  84. void SetOX(const double& theOX) { _func->SetReal(CS_ARG_O_X, theOX); }
  85. void SetOY(const double& theOY) { _func->SetReal(CS_ARG_O_Y, theOY); }
  86. void SetOZ(const double& theOZ) { _func->SetReal(CS_ARG_O_Z, theOZ); }
  87. void SetXDX(const double& theXDX) { _func->SetReal(CS_ARG_X_DX, theXDX); }
  88. void SetXDY(const double& theXDY) { _func->SetReal(CS_ARG_X_DY, theXDY); }
  89. void SetXDZ(const double& theXDZ) { _func->SetReal(CS_ARG_X_DZ, theXDZ); }
  90. void SetYDX(const double& theYDX) { _func->SetReal(CS_ARG_Y_DX, theYDX); }
  91. void SetYDY(const double& theYDY) { _func->SetReal(CS_ARG_Y_DY, theYDY); }
  92. void SetYDZ(const double& theYDZ) { _func->SetReal(CS_ARG_Y_DZ, theYDZ); }
  93. void GetOrigin (double& theX, double& theY, double& theZ)
  94. {
  95. theX = _func->GetReal(CS_ARG_O_X);
  96. theY = _func->GetReal(CS_ARG_O_Y);
  97. theZ = _func->GetReal(CS_ARG_O_Z);
  98. }
  99. void GetXDir (double& theDX, double& theDY, double& theDZ)
  100. {
  101. theDX = _func->GetReal(CS_ARG_X_DX);
  102. theDY = _func->GetReal(CS_ARG_X_DY);
  103. theDZ = _func->GetReal(CS_ARG_X_DZ);
  104. }
  105. void GetYDir (double& theDX, double& theDY, double& theDZ)
  106. {
  107. theDX = _func->GetReal(CS_ARG_Y_DX);
  108. theDY = _func->GetReal(CS_ARG_Y_DY);
  109. theDZ = _func->GetReal(CS_ARG_Y_DZ);
  110. }
  111. private:
  112. Handle(GEOM_Function) _func;
  113. };