/**************************************************************************** ** $Id: cmds/cmdmeannormals.h ** AutoQ3D a qt 3d model editor program ** ** Copyright (C) 2005-2007 -Gonzalo Reynaga Garcia. ** ** This program is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public Licence ** as published by the Free Software Foundation; either version 2 ** of the License, or (at your option) any later option. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA ** *****************************************************************************/ #ifndef CMDMEANNORMALS_H #define CMDMEANNORMALS_H #include "cmds.h" int cmds::equal(d3triangle* tri1,int tp1,d3triangle* tri2,int tp2){ if(tp1==1&&tp2==1){if((tri1->v1[0]==tri2->v1[0])&&(tri1->v1[1]==tri2->v1[1])&&(tri1->v1[2]==tri2->v1[2]))return 1;} if(tp1==1&&tp2==2){if((tri1->v1[0]==tri2->v2[0])&&(tri1->v1[1]==tri2->v2[1])&&(tri1->v1[2]==tri2->v2[2]))return 1;} if(tp1==1&&tp2==3){if((tri1->v1[0]==tri2->v3[0])&&(tri1->v1[1]==tri2->v3[1])&&(tri1->v1[2]==tri2->v3[2]))return 1;} if(tp1==2&&tp2==1){if((tri1->v2[0]==tri2->v1[0])&&(tri1->v2[1]==tri2->v1[1])&&(tri1->v2[2]==tri2->v1[2]))return 1;} if(tp1==2&&tp2==2){if((tri1->v2[0]==tri2->v2[0])&&(tri1->v2[1]==tri2->v2[1])&&(tri1->v2[2]==tri2->v2[2]))return 1;} if(tp1==2&&tp2==3){if((tri1->v2[0]==tri2->v3[0])&&(tri1->v2[1]==tri2->v3[1])&&(tri1->v2[2]==tri2->v3[2]))return 1;} if(tp1==3&&tp2==1){if((tri1->v3[0]==tri2->v1[0])&&(tri1->v3[1]==tri2->v1[1])&&(tri1->v3[2]==tri2->v1[2]))return 1;} if(tp1==3&&tp2==2){if((tri1->v3[0]==tri2->v2[0])&&(tri1->v3[1]==tri2->v2[1])&&(tri1->v3[2]==tri2->v2[2]))return 1;} if(tp1==3&&tp2==3){if((tri1->v3[0]==tri2->v3[0])&&(tri1->v3[1]==tri2->v3[1])&&(tri1->v3[2]==tri2->v3[2]))return 1;} return 0; } void cmds::cmdmeannormals(){ int i,j,k,w,n; double var[1]; QVector findn; QVector flagn; d3triangle *DTV; DTV=DataTV->data(); if((SecCmd==tr("**Cancel**"))&&!PopViewMode){ SendText(SecCmd); CmdCancel(); return; } flagn.resize(DataSV.size()); for(i=0,flagn.resize(DataSV.size());i