Back to index

salome-med  6.5.0
UnitTetraIntersectionBary.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 // File      : UnitTetraIntersectionBary.hxx
00021 // Created   : Tue Dec  9 16:06:33 2008
00022 // Author    : Edward AGAPOV (eap)
00023 //
00024 #ifndef __UNITTETRAINTERSECTIONBARY_HXX__
00025 #define __UNITTETRAINTERSECTIONBARY_HXX__
00026 
00027 #include "TransformedTriangle.hxx"
00028 #include "INTERPKERNELDefines.hxx"
00029 
00030 #include <vector>
00031 #include <list>
00032 
00033 namespace INTERP_KERNEL
00034 {
00035   class UnitTetraIntersectionBary : protected TransformedTriangle
00036   {
00037   public:
00038     INTERPKERNEL_EXPORT UnitTetraIntersectionBary(bool isTetraInversed=false);
00039 
00040     INTERPKERNEL_EXPORT void init(bool isTetraInversed=false);
00046     INTERPKERNEL_EXPORT void addSide(const TransformedTriangle& triangle);
00047 
00051     INTERPKERNEL_EXPORT bool getBary(double* baryCenter);
00052 
00057     INTERPKERNEL_EXPORT inline double getVolume() const { return _int_volume; }
00058 
00059     INTERPKERNEL_EXPORT virtual ~UnitTetraIntersectionBary();
00060 
00061   private:
00062 
00063     int addSideFaces();
00064 
00065     void setTriangleOnSide(int i);
00066 
00067     void clearPolygons(bool andFaces=false);
00068 
00070     double  _int_volume;
00071 
00073     std::list< std::vector< double* > >   _faces;
00074     std::vector< std::vector< double > >  _polyNormals;
00075 
00076     bool _isTetraInversed;
00077   };
00078 
00079 }
00080 
00081 #endif