src/ARCHIMEDE/Archimede_VolumeSection.hxx

Go to the documentation of this file.
00001 //  GEOM ARCHIMEDE : algorithm implementation
00002 //
00003 //  Copyright (C) 2003  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 //
00024 //  File   : Archimede_VolumeSection.hxx
00025 //  Author : Nicolas REJNERI
00026 //  Module : GEOM
00027 //  $Header: /home/server/cvs/GEOM/GEOM_SRC/src/ARCHIMEDE/Archimede_VolumeSection.hxx,v 1.7 2006/06/01 11:32:33 jfa Exp $
00028 
00029 #ifndef ARCHIMEDE_VOLUMESECTION_HXX
00030 #define ARCHIMEDE_VOLUMESECTION_HXX
00031 
00032 #include <gp_Pnt.hxx>
00033 #include <gp_Dir.hxx>
00034 #include <TopoDS_Shape.hxx>
00035 #include <Geom_Plane.hxx>
00036 #include <Geom_RectangularTrimmedSurface.hxx>
00037 
00038 class VolumeSection{
00039 
00040 public:
00041   // Constructeur effectuant le maillage de peau de la shape
00042   Standard_EXPORT VolumeSection(TopoDS_Shape , Standard_Real); 
00043 
00044   //Methode qui affecte € un point,les coordonn‰es de centre de la boite englobante de la shape 
00045   Standard_EXPORT void CenterOfGravity();
00046 
00047   // Methode qui calcule le volume sous un plan Z = h
00048   Standard_EXPORT Standard_Real CalculateVolume(Standard_Real); 
00049 
00050   // Methode qui resout l'equation V(h)=constante
00051   Standard_EXPORT Standard_Real Archimede(Standard_Real , Standard_Real); 
00052 
00053   // Methode permettant de "setter" un plan afin de l'utiliser € l'interieur de la classe
00054   Standard_EXPORT void SetPlane(Handle (Geom_Plane));
00055 
00056   // Methode permettant de r‰cup‰rer la shape modifi‰e € l'ext‰rieur de la classe
00057   Standard_EXPORT TopoDS_Shape GetShape();
00058 
00059   // Methode effectuant la rotation du plan et de la shape
00060   Standard_EXPORT void MakeRotation(gp_Dir);
00061 
00062   // Methode effectuant la rotation inverse du plan et de la shape
00063   Standard_EXPORT Handle (Geom_RectangularTrimmedSurface) InvMakeRotation(gp_Dir,Handle(Geom_RectangularTrimmedSurface));
00064 
00065   // Methode permettant de d‰couper le plan selon une projection de la Shape
00066   Standard_EXPORT Handle (Geom_RectangularTrimmedSurface) TrimSurf();
00067 
00068   // Methode permmettant de deplacer le plan jusqu'a la position donn‰e par Archimˆde
00069   Standard_EXPORT Handle (Geom_RectangularTrimmedSurface) AjustePlan(Handle(Geom_RectangularTrimmedSurface),Standard_Real,gp_Pnt);
00070 
00071   Standard_EXPORT void getZ( double& min, double& max);
00072   
00073 private:
00074   
00075   TopoDS_Shape  myShape;
00076   Standard_Real Tolerance;
00077   gp_Pnt        InitPoint;
00078   Standard_Real Zmin,Zmax,Ymin,Ymax,Xmin,Xmax;
00079   Handle(Geom_Plane) myPlane;
00080   
00081   Standard_Real ElementaryVolume(gp_Pnt,gp_Pnt,gp_Pnt);
00082   gp_Pnt        Intersection(gp_Pnt,gp_Pnt,Standard_Real);
00083   
00084 };
00085 #endif