Logo Search packages:      
Sourcecode: qantenna version File versions  Download package

void NECInput::ProcessGMCard ( int  index  )  [private]

This private function is used by ProcessPrimitive to process GM card. It only make the code more pleasing to read.

Definition at line 169 of file necinput.cpp.

References Patch::CalculateMaxModule(), Line::CalculateMaxModule(), centerPosition, CompareModule(), Primitive::GetEnd1(), Primitive::GetEnd2(), Primitive::GetLabel(), Primitive::GetTagNumber(), Patch::Move(), Line::Move(), primitiveList, Patch::Rotate(), and Line::Rotate().

Referenced by ProcessPrimitive().

{
      QVector<double> ang;
      QVector<double> pos;
      int its;    // TagNumber of the transfomation begin.
      int nrpt;   // Number of new structures to be created.
      int itgg;   // Tag increment

      ang = primitiveList.at(index)->GetEnd1();
      pos = primitiveList.at(index)->GetEnd2();
      itgg = primitiveList.at(index)->GetTagNumber();
      its = primitiveList.at(index)->GetCardParameter1();
      nrpt = primitiveList.at(index)->GetCardParameter();
      primitiveList.removeAt(index);

      if(nrpt==0)
      { // GM with NRPT = 0.
            for(int i=0; i<index; i++)
            {
                  if(primitiveList.at(i)->GetTagNumber()>=its)    // Check if tagNumber starts always at 1.
                  {
                        primitiveList.at(i)->Rotate(ang);
                        primitiveList.at(i)->Move(pos);
                        CompareModule(primitiveList.at(i)->CalculateMaxModule());
                        // TODO Check!!  We save the antenna center which is the same that radiation pattern center.
                        centerPosition[0] = pos[0];
                        centerPosition[1] = pos[1];
                        centerPosition[2] = pos[2];
                  }
            }
      }else
      { // GM with NRPT > 0. We must generate new structures.
            Line* newLine;
            Patch* newPatch;
            Primitive* oldPrim;
            QVector<double> end1;
            QVector<double> end2;
            QVector<double> end3;
            QVector<double> end4;

            for(int i=0; i<nrpt; i++)
            {
                  for(int j=0+i*index; j<(i+1)*index; j++)
                  {
                        oldPrim = primitiveList.at(j);
                        if(oldPrim->GetLabel()=="GW")       // It's a line.
                        {
                              end1 = oldPrim->GetEnd1();
                              end2 = oldPrim->GetEnd2();

                              newLine = new Line("GW", end1, end2, oldPrim->GetTagNumber()+itgg, 0, 0);
                              newLine->Rotate(ang);
                              newLine->Move(pos);
                              CompareModule(newLine->CalculateMaxModule());
                              primitiveList.insert((j+index),newLine);
                        }
                        // It's a patch.
                        else
                        {
                              end1 = oldPrim->GetEnd1();
                              end2 = oldPrim->GetEnd2();
                              end3 = ((Patch*)oldPrim)->GetEnd3();
                              end4 = ((Patch*)oldPrim)->GetEnd4();
                              newPatch = new Patch("SP", end1, end2, end3, end4, 0, 0, 0);
                              newPatch->Rotate(ang);
                              newPatch->Move(pos);
                              CompareModule(newPatch->CalculateMaxModule());
                              primitiveList.insert((j+index),newPatch);
                        }
                  }
            }
      }
}


Generated by  Doxygen 1.6.0   Back to index