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

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

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

Definition at line 243 of file necinput.cpp.

References Primitive::GetEnd1(), Primitive::GetEnd2(), Primitive::GetLabel(), Primitive::GetTagNumber(), primitiveList, Patch::Reflect(), and Line::Reflect().

Referenced by ProcessPrimitive().

{
      Line* newLine;
      Patch* newPatch;
      Primitive* oldPrim;
      int inc=1;

      bool x = false;
      bool y = false;
      bool z = false;

      QVector<double> end1;
      QVector<double> end2;
      QVector<double> end3;
      QVector<double> end4;

      int its = primitiveList.at(index)->GetTagNumber();
      int reflect = primitiveList.at(index)->GetCardParameter();
      primitiveList.removeAt(index);

      if(reflect>=100)
      {
            x = true;
            reflect = reflect-100;
      }
      if(reflect>=10)
      {
            y = true;
            reflect = reflect -10;
      }
      if(reflect==1)
      {
            z = true;
      }
      if(z)
      {
            for (int i=0; i<index; i++)
            {
                  oldPrim = primitiveList.at(i);
                  if(oldPrim->GetLabel()=="GW")       // It's a line.
                  {
                        end1 = oldPrim->GetEnd1();
                        end2 = oldPrim->GetEnd2();
                        newLine = new Line("GW", end1, end2, oldPrim->GetTagNumber()+its,0,0);
                        newLine->Reflect(false, false, z);
                        primitiveList.insert((i+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->Reflect(false, false, z);
                        primitiveList.insert((i+index),newPatch);
                  }

            }
            inc=2*inc;
      }
      if(y)
      {
            for (int i=0; i<inc*index; i++)
            {
                  oldPrim = primitiveList.at(i);
                  if(oldPrim->GetLabel()=="GW")       // It's a line.
                  {
                        end1 = oldPrim->GetEnd1();
                        end2 = oldPrim->GetEnd2();
                        newLine = new Line("GW", end1, end2, oldPrim->GetTagNumber()+its,0,0);
                        newLine->Reflect(false, false, z);
                        primitiveList.insert((i+inc*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->Reflect(false, y, false);
                        primitiveList.insert((i+inc*index),newPatch);
                  }
            }
            inc = 2*inc;
      }
      if(x)
      {
            for (int i=0; i<inc*index; i++)
            {
                  oldPrim = primitiveList.at(i);
                  if(oldPrim->GetLabel()=="GW")       // It's a line.
                  {
                        end1 = oldPrim->GetEnd1();
                        end2 = oldPrim->GetEnd2();
                        newLine = new Line("GW", end1, end2, oldPrim->GetTagNumber()+its,0,0);
                        newLine->Reflect(false, false, z);
                        primitiveList.insert((i+inc*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->Reflect(x, false, false);
                        primitiveList.insert((i+inc*index),newPatch);
                  }
            }
      }
}


Generated by  Doxygen 1.6.0   Back to index