geom/src/ARCHIMEDE/Archimede_VolumeSection.hxx

86 lines
3.1 KiB
C++
Raw Normal View History

2012-08-09 13:58:02 +06:00
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
2009-02-13 17:16:39 +05:00
//
2012-08-09 13:58:02 +06:00
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
2003-07-09 20:33:44 +06:00
//
2012-08-09 13:58:02 +06:00
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
2003-07-09 20:33:44 +06:00
//
2012-08-09 13:58:02 +06:00
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
2003-07-09 20:33:44 +06:00
//
2012-08-09 13:58:02 +06:00
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2003-07-09 20:33:44 +06:00
//
2012-08-09 13:58:02 +06:00
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
2009-02-13 17:16:39 +05:00
//
2012-08-09 13:58:02 +06:00
2009-02-13 17:16:39 +05:00
// GEOM ARCHIMEDE : algorithm implementation
2003-07-09 20:33:44 +06:00
// File : Archimede_VolumeSection.hxx
// Author : Nicolas REJNERI
// Module : GEOM
2009-02-13 17:16:39 +05:00
//
2003-05-12 21:24:23 +06:00
#ifndef ARCHIMEDE_VOLUMESECTION_HXX
#define ARCHIMEDE_VOLUMESECTION_HXX
#include <gp_Pnt.hxx>
#include <gp_Dir.hxx>
#include <TopoDS_Shape.hxx>
#include <Geom_Plane.hxx>
2009-02-13 17:16:39 +05:00
class Handle(Geom_RectangularTrimmedSurface);
2003-05-12 21:24:23 +06:00
class VolumeSection{
public:
// Constructeur effectuant le maillage de peau de la shape
2005-08-11 10:04:55 +06:00
Standard_EXPORT VolumeSection(TopoDS_Shape , Standard_Real);
2003-05-12 21:24:23 +06:00
2005-08-11 10:04:55 +06:00
//Methode qui affecte <20> un point,les coordonn<6E>es de centre de la boite englobante de la shape
Standard_EXPORT void CenterOfGravity();
2003-05-12 21:24:23 +06:00
// Methode qui calcule le volume sous un plan Z = h
2005-08-11 10:04:55 +06:00
Standard_EXPORT Standard_Real CalculateVolume(Standard_Real);
2003-05-12 21:24:23 +06:00
// Methode qui resout l'equation V(h)=constante
2005-08-11 10:04:55 +06:00
Standard_EXPORT Standard_Real Archimede(Standard_Real , Standard_Real);
2003-05-12 21:24:23 +06:00
2005-08-11 10:04:55 +06:00
// Methode permettant de "setter" un plan afin de l'utiliser <20> l'interieur de la classe
Standard_EXPORT void SetPlane(Handle (Geom_Plane));
2003-05-12 21:24:23 +06:00
2005-08-11 10:04:55 +06:00
// Methode permettant de r<>cup<75>rer la shape modifi<66>e <20> l'ext<78>rieur de la classe
Standard_EXPORT TopoDS_Shape GetShape();
2003-05-12 21:24:23 +06:00
// Methode effectuant la rotation du plan et de la shape
2005-08-11 10:04:55 +06:00
Standard_EXPORT void MakeRotation(gp_Dir);
2003-05-12 21:24:23 +06:00
// Methode effectuant la rotation inverse du plan et de la shape
2005-08-11 10:04:55 +06:00
Standard_EXPORT Handle (Geom_RectangularTrimmedSurface) InvMakeRotation(gp_Dir,Handle(Geom_RectangularTrimmedSurface));
2003-05-12 21:24:23 +06:00
2005-08-11 10:04:55 +06:00
// Methode permettant de d<>couper le plan selon une projection de la Shape
Standard_EXPORT Handle (Geom_RectangularTrimmedSurface) TrimSurf();
2003-05-12 21:24:23 +06:00
2005-08-11 10:04:55 +06:00
// Methode permmettant de deplacer le plan jusqu'a la position donn<6E>e par Archim<69>de
Standard_EXPORT Handle (Geom_RectangularTrimmedSurface) AjustePlan(Handle(Geom_RectangularTrimmedSurface),Standard_Real,gp_Pnt);
2003-05-12 21:24:23 +06:00
2005-08-11 10:04:55 +06:00
Standard_EXPORT void getZ( double& min, double& max);
2003-05-12 21:24:23 +06:00
private:
TopoDS_Shape myShape;
Standard_Real Tolerance;
gp_Pnt InitPoint;
Standard_Real Zmin,Zmax,Ymin,Ymax,Xmin,Xmax;
Handle(Geom_Plane) myPlane;
Standard_Real ElementaryVolume(gp_Pnt,gp_Pnt,gp_Pnt);
gp_Pnt Intersection(gp_Pnt,gp_Pnt,Standard_Real);
};
#endif