Back to index

salome-geom  6.5.0
Archimede_VolumeSection.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 //  GEOM ARCHIMEDE : algorithm implementation
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.9.18.2.14.1 2012-04-13 05:47:51 vsr 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 
00037 class Handle(Geom_RectangularTrimmedSurface);
00038 
00039 class VolumeSection{
00040 
00041 public:
00042   // Constructeur effectuant le maillage de peau de la shape
00043   Standard_EXPORT VolumeSection(TopoDS_Shape , Standard_Real); 
00044 
00045   //Methode qui affecte € un point,les coordonn‰es de centre de la boite englobante de la shape 
00046   Standard_EXPORT void CenterOfGravity();
00047 
00048   // Methode qui calcule le volume sous un plan Z = h
00049   Standard_EXPORT Standard_Real CalculateVolume(Standard_Real); 
00050 
00051   // Methode qui resout l'equation V(h)=constante
00052   Standard_EXPORT Standard_Real Archimede(Standard_Real , Standard_Real); 
00053 
00054   // Methode permettant de "setter" un plan afin de l'utiliser € l'interieur de la classe
00055   Standard_EXPORT void SetPlane(Handle (Geom_Plane));
00056 
00057   // Methode permettant de r‰cup‰rer la shape modifi‰e € l'ext‰rieur de la classe
00058   Standard_EXPORT TopoDS_Shape GetShape();
00059 
00060   // Methode effectuant la rotation du plan et de la shape
00061   Standard_EXPORT void MakeRotation(gp_Dir);
00062 
00063   // Methode effectuant la rotation inverse du plan et de la shape
00064   Standard_EXPORT Handle (Geom_RectangularTrimmedSurface) InvMakeRotation(gp_Dir,Handle(Geom_RectangularTrimmedSurface));
00065 
00066   // Methode permettant de d‰couper le plan selon une projection de la Shape
00067   Standard_EXPORT Handle (Geom_RectangularTrimmedSurface) TrimSurf();
00068 
00069   // Methode permmettant de deplacer le plan jusqu'a la position donn‰e par Archimˆde
00070   Standard_EXPORT Handle (Geom_RectangularTrimmedSurface) AjustePlan(Handle(Geom_RectangularTrimmedSurface),Standard_Real,gp_Pnt);
00071 
00072   Standard_EXPORT void getZ( double& min, double& max);
00073   
00074 private:
00075   
00076   TopoDS_Shape  myShape;
00077   Standard_Real Tolerance;
00078   gp_Pnt        InitPoint;
00079   Standard_Real Zmin,Zmax,Ymin,Ymax,Xmin,Xmax;
00080   Handle(Geom_Plane) myPlane;
00081   
00082   Standard_Real ElementaryVolume(gp_Pnt,gp_Pnt,gp_Pnt);
00083   gp_Pnt        Intersection(gp_Pnt,gp_Pnt,Standard_Real);
00084   
00085 };
00086 #endif