-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D
//
-// 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.
+// 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.
//
-// 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.
+// 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.
//
-// 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
+// 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
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __POLYGONALGORITHMS_TXX__
#define __POLYGONALGORITHMS_TXX__
if(fabs(det) > _epsilon)
{
inv_det = 1/det;
- t1=(AC[1]*DC[2]-AC[2]*DC[1])*inv_det;
- t2=(AB[1]*AC[2]-AB[2]*AC[1])*inv_det;
+ t1=(AC[1]*DC[DIM-1]-AC[DIM-1]*DC[1])*inv_det;
+ t2=(AB[1]*AC[DIM-1]-AB[DIM-1]*AC[1])*inv_det;
}
else //beware AB and CD may belong to a plane y = constant
{
- det = AB[0]*DC[2]-AB[2]*DC[0];
+ det = AB[0]*DC[DIM-1]-AB[DIM-1]*DC[0];
if(fabs(det) > _epsilon)
{
inv_det = 1/det;
- t1=(AC[0]*DC[2]-AC[2]*DC[0])*inv_det;
- t2=(AB[0]*AC[2]-AB[2]*AC[0])*inv_det;
+ t1=(AC[0]*DC[DIM-1]-AC[DIM-1]*DC[0])*inv_det;
+ t2=(AB[0]*AC[DIM-1]-AB[DIM-1]*AC[0])*inv_det;
}
else
{
break;
case 2 :
if(!_Inter.empty())
- if(i_glob < N1) for(idim=0;idim<DIM;idim++) _Inter.push_back(P_1[DIM*i_glob+idim]);
- else for(idim=0;idim<DIM;idim++) _Inter.push_back(P_2[DIM*(i_glob-N1)+idim]);
+ {
+ if(i_glob < N1) for(idim=0;idim<DIM;idim++) _Inter.push_back(P_1[DIM*i_glob+idim]);
+ else for(idim=0;idim<DIM;idim++) _Inter.push_back(P_2[DIM*(i_glob-N1)+idim]);
+ }
return _Inter;
case 0 ://To do if possible : remove this case from here
if(_Inter.empty() && (i_glob < N1) != which_start){
//std::cout<<"coucou1" << std::endl;
if( _is_in_intersection)
{
- for(int idim=0;idim<DIM;idim++) _Inter.push_back(Poly1[DIM*i_loc+idim]);
+ for(int iidim=0;iidim<DIM;iidim++)
+ _Inter.push_back(Poly1[DIM*i_loc+iidim]);
_End_segments.push_back(std::make_pair(i_glob,i_next_glob));
_End_segments.push_back(std::make_pair(i_glob,i_prev_glob));
}