#include ; #include ; Surface::Initialize(int mx, int my) { meshx = mx; meshy = my; size = mx*my; for(int i=0; i::Add(); } } Surface::Rotate(double ax, double ay, double az, double fi) { const Link * lp = TList::GetHead(); while ( lp != 0 ) { ((LPoint*)lp)->Rotate(ax, ay, az, fi); lp = ( lp -> Next() ); } } Surface::Translate(double ax, double ay, double az) { const Link * lp = TList::GetHead(); while ( lp != 0 ) { ((LPoint*)lp)->Translate(ax, ay, az); lp = ( lp -> Next() ); } } Surface::Scale(double ax, double ay, double az) { const Link * lp = TList::GetHead(); while ( lp != 0 ) { ((LPoint*)lp)->Scale(ax, ay, az); lp = ( lp -> Next() ); } } /////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// //---------------------------------------------------------------- void Hart::SetInternalModel() { Initialize(20,20); //Seting size of hart list double x,y,z; //space coordinates double fi; //angle coordinate in YZ plane double sx=12; //size of hart model in x direction double sy=10; //size of hart model in y direction double sz=8; //size of hart model in z direction double pi = 3.14; double dx=sx/(Meshx()-1); //step in x direction double dfi=2*pi/Meshy(); //step in angle variable double xFactor; //scaling factor of YZ intersection double deform=sy/8; //deformation factor in YZ plane x=-sx/2; int PointNum=0; //////////// const Link * pc = Surface::GetHead(); ////////// for (int ii=0; iix = x; ( (LPoint*)pc )->y = y; ( (LPoint*)pc )->z = z; if( pc != 0) { (LPoint*)( pc = (pc -> Next()) ); } fi=fi+dfi; PointNum=PointNum+1; } x=x+dx; } } ///////////////////////////////////////////////////////// void Breast::SetInternalModel() { Initialize(44,61); //Seting size of breast list double pi = 3.1415; double x1; double fi; int meshSize=60; double sx = 37; //double dx=(double)51/meshSize; double dx=(double)( sx/(Meshx()-1) ); double dfi=(double)(2*pi/Meshy()); //<<44<=2 && x1 - xStart<11) {xFactor = (11-(x1 - xStart))/9;} if (x1 - xStart>=11 && x1 - xStart<18) {xFactor = (18-(x1 - xStart))/7;} if (x1 - xStart>=18 && x1 - xStart<25) {xFactor = (25-(x1 - xStart))/7;} if (x1 - xStart>=25 && x1 - xStart<37) {xFactor = (37-(x1 - xStart))/12;} //for (double fi=0; fi<2*pi-0.5*dfi; fi=fi+dfi) for (int j=0; j=2 && x1 - xStart<11) { y1 = 22*cos(fi)-6*cos(fi)*cos(fi)*cos(fi); z1 = 11.75*sin(fi) - xFactor*(3.75*sin(fi)+1); } //3 - 4 section if (x1-xStart>=11 && x1-xStart<18) { y1 = 21*cos(fi)-6*cos(fi)*cos(fi)*cos(fi) + xFactor*cos(fi); z1 = 12.5*sin(fi) - xFactor*0.75*sin(fi); } //2 - 3 section if (x1 - xStart>=18 && x1 - xStart<25) { y1 = 19.5*cos(fi) - 6*cos(fi)*cos(fi)*cos(fi) - cos(fi)*sin(fi) + xFactor*(cos(fi)*sin(fi) + 1.5*cos(fi)); z1 = 11.5*sin(fi) - 1 + xFactor*(sin(fi) +1); } //1 - 2 section if (x1 - xStart>=25 && x1 - xStart<37) { y1 = 12.5*cos(fi) + xFactor*(7*cos(fi) - 6*cos(fi)*cos(fi)*cos(fi) - cos(fi)*sin(fi)); z1 = 9*sin(fi) + xFactor*(2.5*sin(fi)-1); } ( (LPoint*)pc )->x = x1; ( (LPoint*)pc )->y = y1; ( (LPoint*)pc )->z = z1; if( pc != 0) { (LPoint*)( pc = (pc -> Next()) ); } //out <::Add(); } } void ElectrodeSet::SetInternalModel() { Initialize(91); //Seting size of Electrodeset list double pi = 3.1415; double x1; double fi; double dx=4.5; //vertical distance beetwen electrodes //double dfi=(double)(2*pi/Meshy()); double xFactor = 0; double y1,z1; double xStart=-18; // mapping designations A B C D E double angles[13] = {0, pi/8, 2*pi/8, 3*pi/8, 4*pi/8, // F G H I 5*pi/8, 6*pi/8, 7*pi/8, pi, // J K L M 6*pi/5, 7*pi/5, 8*pi/5, 9*pi/5}; //////////// const Link * pc = TList::GetHead(); ////////// x1=xStart+3; //start -x- for electrodes setting for (int i=0; i<7; i++) //x direction { if (x1 - xStart<2) {xFactor = (2-x1+xStart)/2;} if (x1 - xStart>=2 && x1 - xStart<11) {xFactor = (11-(x1 - xStart))/9;} if (x1 - xStart>=11 && x1 - xStart<18) {xFactor = (18-(x1 - xStart))/7;} if (x1 - xStart>=18 && x1 - xStart<25) {xFactor = (25-(x1 - xStart))/7;} if (x1 - xStart>=25 && x1 - xStart<37) {xFactor = (37-(x1 - xStart))/12;} for (int j=0; j<13; j++) { fi = angles[j]; //5 - 6 section if (x1-xStart<2) { y1 = 22*cos(fi)-6*cos(fi)*cos(fi)*cos(fi) -xFactor*(-6*cos(fi)*cos(fi)*cos(fi) + 14.75*cos(fi)); z1 = 7*sin(fi) -1 - xFactor*(sin(fi) ); } //4 - 5 section if (x1 - xStart>=2 && x1 - xStart<11) { y1 = 22*cos(fi)-6*cos(fi)*cos(fi)*cos(fi); z1 = 11.75*sin(fi) - xFactor*(3.75*sin(fi)+1); } //3 - 4 section if (x1-xStart>=11 && x1-xStart<18) { y1 = 21*cos(fi)-6*cos(fi)*cos(fi)*cos(fi) + xFactor*cos(fi); z1 = 12.5*sin(fi) - xFactor*0.75*sin(fi); } //2 - 3 section if (x1 - xStart>=18 && x1 - xStart<25) { y1 = 19.5*cos(fi) - 6*cos(fi)*cos(fi)*cos(fi) - cos(fi)*sin(fi) + xFactor*(cos(fi)*sin(fi) + 1.5*cos(fi)); z1 = 11.5*sin(fi) - 1 + xFactor*(sin(fi) +1); } //1 - 2 section if (x1 - xStart>=25 && x1 - xStart<37) { y1 = 12.5*cos(fi) + xFactor*(7*cos(fi) - 6*cos(fi)*cos(fi)*cos(fi) - cos(fi)*sin(fi)); z1 = 9*sin(fi) + xFactor*(2.5*sin(fi)-1); } ( (LElectrode*)pc )->x = x1; ( (LElectrode*)pc )->y = y1; ( (LElectrode*)pc )->z = z1; if( pc != 0) { (LPoint*)( pc = (pc -> Next()) ); } } x1=x1+dx; } } //////////////////////////////////////////////////////////// void Patient::SetInternalModel() { Hart::SetInternalModel(); Breast::SetInternalModel(); ElectrodeSet::SetInternalModel(); } void Patient::RotateHart(double ax, double ay, double az, double fi) { } void Patient::TranslateHart(double ax, double ay, double az) { } //ChargeSet(10)