/src/contrib/geom-5.1.2.7/inc_pythonocc/Archimede_VolumeSection.hxx

http://pythonocc.googlecode.com/ · C++ Header · 86 lines · 30 code · 18 blank · 38 comment · 0 complexity · 7150cb290d1969bd1f4598cdaa26d1a6 MD5 · raw file

  1. // GEOM ARCHIMEDE : algorithm implementation
  2. //
  3. // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
  4. // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
  5. //
  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.
  10. //
  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.
  15. //
  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
  19. //
  20. // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
  21. //
  22. //
  23. //
  24. // File : Archimede_VolumeSection.hxx
  25. // Author : Nicolas REJNERI
  26. // Module : GEOM
  27. // $Header: /home/server/cvs/GEOM/GEOM_SRC/src/ARCHIMEDE/Archimede_VolumeSection.hxx,v 1.7 2006/06/01 11:32:33 jfa Exp $
  28. #ifndef ARCHIMEDE_VOLUMESECTION_HXX
  29. #define ARCHIMEDE_VOLUMESECTION_HXX
  30. #include <gp_Pnt.hxx>
  31. #include <gp_Dir.hxx>
  32. #include <TopoDS_Shape.hxx>
  33. #include <Geom_Plane.hxx>
  34. #include <Geom_RectangularTrimmedSurface.hxx>
  35. //!Class to compute the water line of an object based on its specific weight
  36. class VolumeSection{
  37. public:
  38. //! Constructeur effectuant le maillage de peau de la shape
  39. Standard_EXPORT VolumeSection(TopoDS_Shape , Standard_Real);
  40. //! Methode qui affecte &#x20AC; un point,les coordonn&#x2030;es de centre de la boite englobante de la shape
  41. Standard_EXPORT void CenterOfGravity();
  42. //! Methode qui calcule le volume sous un plan Z = h
  43. Standard_EXPORT Standard_Real CalculateVolume(Standard_Real);
  44. //! Methode qui resout l'equation V(h)=constante
  45. Standard_EXPORT Standard_Real Archimede(Standard_Real , Standard_Real);
  46. //! Methode permettant de "setter" un plan afin de l'utiliser &#x20AC; l'interieur de la classe
  47. Standard_EXPORT void SetPlane(Handle (Geom_Plane));
  48. //! Methode permettant de r&#x2030;cup&#x2030;rer la shape modifi&#x2030;e &#x20AC; l'ext&#x2030;rieur de la classe
  49. Standard_EXPORT TopoDS_Shape GetShape();
  50. //! Methode effectuant la rotation du plan et de la shape
  51. Standard_EXPORT void MakeRotation(gp_Dir);
  52. //! Methode effectuant la rotation inverse du plan et de la shape
  53. Standard_EXPORT Handle (Geom_RectangularTrimmedSurface) InvMakeRotation(gp_Dir,Handle(Geom_RectangularTrimmedSurface));
  54. //! Methode permettant de d&#x2030;couper le plan selon une projection de la Shape
  55. Standard_EXPORT Handle (Geom_RectangularTrimmedSurface) TrimSurf();
  56. //! Methode permmettant de deplacer le plan jusqu'a la position donn&#x2030;e par Archim&#x2C6;de
  57. Standard_EXPORT Handle (Geom_RectangularTrimmedSurface) AjustePlan(Handle(Geom_RectangularTrimmedSurface),Standard_Real,gp_Pnt);
  58. Standard_EXPORT void getZ( double& min, double& max);
  59. private:
  60. TopoDS_Shape myShape;
  61. Standard_Real Tolerance;
  62. gp_Pnt InitPoint;
  63. Standard_Real Zmin,Zmax,Ymin,Ymax,Xmin,Xmax;
  64. Handle(Geom_Plane) myPlane;
  65. Standard_Real ElementaryVolume(gp_Pnt,gp_Pnt,gp_Pnt);
  66. gp_Pnt Intersection(gp_Pnt,gp_Pnt,Standard_Real);
  67. };
  68. #endif