]> git.mxchange.org Git - flightgear.git/commitdiff
Some cleanup in the ATC/AI code before merging with the next branch:
authorDurk Talsma <durk@localhost.(none)>
Sun, 24 Jul 2011 10:48:13 +0000 (12:48 +0200)
committerDurk Talsma <durk@localhost.(none)>
Sun, 24 Jul 2011 10:48:13 +0000 (12:48 +0200)
 - Hide the ATC dialog box by default
 - Allow dynamic enabling and disabling of the AI groundnetwork visualization
 - Cleanup of debug messages

src/AIModel/AIAircraft.cxx
src/ATC/atc_mgr.cxx
src/ATC/atc_mgr.hxx
src/ATC/atcdialog.cxx
src/ATC/trafficcontrol.cxx
src/ATC/trafficcontrol.hxx
src/Airports/groundnetwork.cxx
src/Airports/groundnetwork.hxx

index a153db7f7dc8fd6dcc13ac303207afb84415b201..7443a65d09db9db3c212a9eae1310456368aab61 100644 (file)
@@ -285,6 +285,7 @@ void FGAIAircraft::ProcessFlightPlan( double dt, time_t now ) {
     if (! leadPointReached(curr)) {
         controlHeading(curr);
         controlSpeed(curr, next);
+            /*
             if (speed < 0) { 
                 cerr << getCallSign() 
                      << ": verifying lead distance to waypoint : " 
@@ -297,7 +298,7 @@ void FGAIAircraft::ProcessFlightPlan( double dt, time_t now ) {
                      << speed
                      << ". Minimum Bearing " << minBearing
                      << endl;
-            }
+            } */
     } else {
         if (curr->finished)      //end of the flight plan
         {
index 0bdc5e5cd5a65ac31a3ba14dfb2dcf321a4c55f0..1e15445319aa9b9bcffd640d2dd60498dbc32554 100644 (file)
@@ -34,7 +34,7 @@
 
 
 FGATCManager::FGATCManager() {
-
+    networkVisible = false;
 }
 
 FGATCManager::~FGATCManager() {
@@ -76,7 +76,8 @@ void FGATCManager::init() {
     ai_ac.setAltitude ( altitude  );
     ai_ac.setPerformance("jet_transport");
 
-    // NEXT UP: Create a traffic Schedule and fill that with appropriate information. This we can use to flight plannign.
+    // NEXT UP: Create a traffic Schedule and fill that with appropriate information. This we can use to flight planning.
+    // Note that these are currently only defaults. 
     FGAISchedule *trafficRef = new FGAISchedule;
     trafficRef->setFlightType("gate");
 
@@ -179,16 +180,16 @@ void FGATCManager::update ( double time ) {
     /* test code : find out how the routing develops */
     int size = fp->getNrOfWayPoints();
     //cerr << "Setting pos" << pos << " ";
-    cerr << "setting intentions " ;
+    //cerr << "setting intentions " ;
     for (int i = 0; i < size; i++) {
         int val = fp->getRouteIndex(i);
-        cerr << val << " ";
+        //cerr << val << " ";
         //if ((val) && (val != pos)) {
             //intentions.push_back(val);
             //cerr << "[done ] " << endl;
         //}
     }
-    cerr << "[done ] " << endl;
+    //cerr << "[done ] " << endl;
     double longitude = fgGetDouble("/position/longitude-deg");
     double latitude  = fgGetDouble("/position/latitude-deg");
     double heading   = fgGetDouble("/orientation/heading-deg");
@@ -215,8 +216,14 @@ void FGATCManager::update ( double time ) {
         //string airport = fgGetString("/sim/presets/airport-id");
         //FGAirport *apt = FGAirport::findByIdent(airport); 
         // AT this stage we should update the flightplan, so that waypoint incrementing is conducted as well as leg loading. 
-
-       controller->render();
+       static SGPropertyNode_ptr trans_num = globals->get_props()->getNode("/sim/atc/transmission-num", true);
+            int n = trans_num->getIntValue();
+        if (n == 1) {
+            cerr << "Toggling ground network visibility " << networkVisible << endl;
+            networkVisible = !networkVisible;
+            trans_num->setIntValue(-1);
+        }
+        controller->render(networkVisible);
 
         //cerr << "Adding groundnetWork to the scenegraph::update" << endl;
    }
index 33fa5c40a970376c04e1d1d0ffa550dfbedba5e2..81025b95edac36ca9121b69a996ebabb45404257 100644 (file)
@@ -51,6 +51,7 @@ private:
   FGAIAircraft ai_ac;
   FGATCController *controller; // The ATC controller that is responsible for the user's aircraft. 
   //FGATCDialogNew dialog;  // note that this variable should really replace the ugly global "currentATCDialog();
+  bool networkVisible;
 
 public:
   FGATCManager();
index c59bf959b6b40a07e0764cbd1ba1e83230fa6763..41de936af77ea510081734e9ecf4b25972b615cf 100644 (file)
@@ -43,7 +43,7 @@ static bool doATCDialog(const SGPropertyNode* arg) {
 
 FGATCDialogNew::FGATCDialogNew()
 {
-  dialogVisible = false;
+  dialogVisible = true;
 }
 
 FGATCDialogNew::~FGATCDialogNew()
@@ -89,6 +89,7 @@ static SGPropertyNode *getNamedNode(SGPropertyNode *prop, const char *name) {
 void FGATCDialogNew::addEntry(int nr, string txt) {
     commands.clear();
     commands.push_back(txt);
+    commands.push_back(string("Toggle ground network visibility"));
 }
 
 void FGATCDialogNew::removeEntry(int nr) {
@@ -98,49 +99,6 @@ void FGATCDialogNew::removeEntry(int nr) {
 
 
 void FGATCDialogNew::PopupDialog() {
-    /*double onBoardRadioFreq0 =
-        fgGetDouble("/instrumentation/comm[0]/frequencies/selected-mhz");
-    double onBoardRadioFreq1 =
-        fgGetDouble("/instrumentation/comm[1]/frequencies/selected-mhz");
-
-    const char *dialog_name = "atc-dialog";
-    _gui = (NewGUI *)globals->get_subsystem("gui");
-    SGPropertyNode_ptr dlg = _gui->getDialogProperties(dialog_name);
-    if (!dlg)
-        return;
-
-    _gui->closeDialog(dialog_name);
-    SGPropertyNode_ptr button_group = getNamedNode(dlg, "transmission-choice");
-    button_group->removeChildren("button", false);
-
-    const int bufsize = 32;
-    char buf[bufsize];
-    int commandNr = 0;
-    // loop over all entries that should fill up the dialog; use 10 items for now...
-    for (StringVecIterator i = commands.begin(); i != commands.end(); i++) {
-        snprintf(buf, bufsize, "/sim/atc/opt[%d]", commandNr);
-            fgSetBool(buf, false);
-        SGPropertyNode *entry = button_group->getNode("button", commandNr, true);
-        copyProperties(button_group->getNode("button-template", true), entry);
-       entry->removeChildren("enabled", true);
-       entry->setStringValue("property", buf);
-       entry->setIntValue("keynum", '1' + commandNr);
-       if (commandNr == 0)
-           entry->setBoolValue("default", true);
-
-       snprintf(buf, bufsize, "%d", 1 + commandNr);
-       string legend = string(buf) + (*i); //"; // + current->menuentry;
-       entry->setStringValue("legend", legend.c_str());
-       entry->setIntValue("binding/value", commandNr);
-        commandNr++;
-       //current++;
-    }
-*/
-    //if (dialogVisible) {
-    //    _gui->closeDialog(dialog_name);
-    //} else {
-    //    _gui->showDialog(dialog_name);
-    //}
     dialogVisible = !dialogVisible;
     return;
 }
index 9a957bd5378370bce47a51973023f10c100415b2..9bc1ac6a3df61453f14eea362a21bcbb43db5c42 100644 (file)
@@ -469,7 +469,7 @@ bool FGATCInstruction::hasInstruction()
 
 FGATCController::FGATCController()
 {
-    cerr << "running FGATController constructor" << endl;
+    //cerr << "running FGATController constructor" << endl;
     dt_count = 0;
     available = true;
     lastTransmission = 0;
@@ -478,7 +478,7 @@ FGATCController::FGATCController()
 
 FGATCController::~FGATCController()
 {
-     cerr << "running FGATController destructor" << endl;
+     //cerr << "running FGATController destructor" << endl;
 }
 
 string FGATCController::getGateName(FGAIAircraft * ref)
@@ -906,8 +906,8 @@ FGATCInstruction FGTowerController::getInstruction(int id)
     return FGATCInstruction();
 }
 
-void FGTowerController::render() {
-    cerr << "FGTowerController::render function not yet implemented" << endl;
+void FGTowerController::render(bool visible) {
+    //cerr << "FGTowerController::render function not yet implemented" << endl;
 }
 
 
@@ -1033,7 +1033,7 @@ void FGStartupController::signOff(int id)
         SG_LOG(SG_GENERAL, SG_ALERT,
                "AI error: Aircraft without traffic record is signing off from tower");
     } else {
-        cerr << i->getAircraft()->getCallSign() << " signing off from startupcontroller" << endl;
+        //cerr << i->getAircraft()->getCallSign() << " signing off from startupcontroller" << endl;
         i = activeTraffic.erase(i);
     }
 }
@@ -1045,17 +1045,17 @@ bool FGStartupController::checkTransmissionState(int st, time_t now, time_t star
     if ((state == st) && available) {
         if ((msgDir == ATC_AIR_TO_GROUND) && isUserAircraft(i->getAircraft())) {
             
-            cerr << "Checking state " << st << " for " << i->getAircraft()->getCallSign() << endl;
+            //cerr << "Checking state " << st << " for " << i->getAircraft()->getCallSign() << endl;
             static SGPropertyNode_ptr trans_num = globals->get_props()->getNode("/sim/atc/transmission-num", true);
             int n = trans_num->getIntValue();
-            if (n >= 0) {
+            if (n == 0) {
                 trans_num->setIntValue(-1);
                  // PopupCallback(n);
-                 cerr << "Selected transmission message" << n << endl;
+                 cerr << "Selected transmission message " << n << endl;
                  FGATCManager *atc = (FGATCManager*) globals->get_subsystem("atc");
                  atc->getATCDialog()->removeEntry(1);
             } else {
-                cerr << "creading message for " << i->getAircraft()->getCallSign() << endl;
+                //cerr << "creading message for " << i->getAircraft()->getCallSign() << endl;
                 transmit(&(*i), msgId, msgDir, false);
                 return false;
             }
@@ -1161,7 +1161,7 @@ static void WorldCoordinate(osg::Matrix& obj_pos, double lat,
 }
 
 
-void FGStartupController::render()
+void FGStartupController::render(bool visible)
 {
 
     SGMaterialLib *matlib = globals->get_matlib();
@@ -1175,32 +1175,34 @@ void FGStartupController::render()
            //geode->releaseGLObjects();
            //group->removeChild(geode);
            //delete geode;
+        group = 0;
     }
-    group = new osg::Group;
-
-    //for ( FGTaxiSegmentVectorIterator i = segments.begin(); i != segments.end(); i++) {
-    double dx = 0;
-    for   (TrafficVectorIterator i = activeTraffic.begin(); i != activeTraffic.end(); i++) {
-        // Handle start point
-        int pos = i->getCurrentPosition();
-        //cerr << "rendering for " << i->getAircraft()->getCallSign() << "pos = " << pos << endl;
-        if (pos > 0) {
-            FGTaxiSegment *segment  = parent->getGroundNetwork()->findSegment(pos);
-            SGGeod start(SGGeod::fromDeg((i->getLongitude()), (i->getLatitude())));
-            SGGeod end  (SGGeod::fromDeg(segment->getEnd()->getLongitude(), segment->getEnd()->getLatitude()));
-
-            double length = SGGeodesy::distanceM(start, end);
-            //heading = SGGeodesy::headingDeg(start->getGeod(), end->getGeod());
-
-            double az2, heading; //, distanceM;
-            SGGeodesy::inverse(start, end, heading, az2, length);
-            double coveredDistance = length * 0.5;
-            SGGeod center;
-            SGGeodesy::direct(start, heading, coveredDistance, center, az2);
-            //cerr << "Active Aircraft : Centerpoint = (" << center.getLatitudeDeg() << ", " << center.getLongitudeDeg() << "). Heading = " << heading << endl;
-            ///////////////////////////////////////////////////////////////////////////////
-            // Make a helper function out of this
-            osg::Matrix obj_pos;
+    if (visible) {
+        group = new osg::Group;
+
+        //for ( FGTaxiSegmentVectorIterator i = segments.begin(); i != segments.end(); i++) {
+        double dx = 0;
+        for   (TrafficVectorIterator i = activeTraffic.begin(); i != activeTraffic.end(); i++) {
+            // Handle start point
+            int pos = i->getCurrentPosition();
+            //cerr << "rendering for " << i->getAircraft()->getCallSign() << "pos = " << pos << endl;
+            if (pos > 0) {
+                FGTaxiSegment *segment  = parent->getGroundNetwork()->findSegment(pos);
+                SGGeod start(SGGeod::fromDeg((i->getLongitude()), (i->getLatitude())));
+                SGGeod end  (SGGeod::fromDeg(segment->getEnd()->getLongitude(), segment->getEnd()->getLatitude()));
+
+                double length = SGGeodesy::distanceM(start, end);
+                //heading = SGGeodesy::headingDeg(start->getGeod(), end->getGeod());
+
+                double az2, heading; //, distanceM;
+                SGGeodesy::inverse(start, end, heading, az2, length);
+                double coveredDistance = length * 0.5;
+                SGGeod center;
+                SGGeodesy::direct(start, heading, coveredDistance, center, az2);
+                //cerr << "Active Aircraft : Centerpoint = (" << center.getLatitudeDeg() << ", " << center.getLongitudeDeg() << "). Heading = " << heading << endl;
+                ///////////////////////////////////////////////////////////////////////////////
+                // Make a helper function out of this
+                osg::Matrix obj_pos;
                 osg::MatrixTransform *obj_trans = new osg::MatrixTransform;
                 obj_trans->setDataVariance(osg::Object::STATIC);
 
@@ -1226,50 +1228,50 @@ void FGStartupController::render()
                 // wire as much of the scene graph together as we can
                 //->addChild( obj_trans );
                 group->addChild( obj_trans );
-        /////////////////////////////////////////////////////////////////////
-        } else {
-             cerr << "BIG FAT WARNING: current position is here : " << pos << endl;
-        }
-        for(intVecIterator j = (i)->getIntentions().begin(); j != (i)->getIntentions().end(); j++) {
-             osg::Matrix obj_pos;
-            int k = (*j);
-            if (k > 0) {
-                //cerr << "rendering for " << i->getAircraft()->getCallSign() << "intention = " << k << endl;
-                osg::MatrixTransform *obj_trans = new osg::MatrixTransform;
-                obj_trans->setDataVariance(osg::Object::STATIC);
-                FGTaxiSegment *segment  = parent->getGroundNetwork()->findSegment(k);
-                WorldCoordinate( obj_pos, segment->getLatitude(), segment->getLongitude(), parent->getElevation()+8+dx, -(segment->getHeading()) );
-
-                obj_trans->setMatrix( obj_pos );
-                //osg::Vec3 center(0, 0, 0)
-
-                float width = segment->getLength() /2.0;
-                osg::Vec3 corner(-width, 0, 0.25f);
-                osg::Vec3 widthVec(2*width + 1, 0, 0);
-                osg::Vec3 heightVec(0, 1, 0);
-                osg::Geometry* geometry;
-                geometry = osg::createTexturedQuadGeometry(corner, widthVec, heightVec);
-                simgear::EffectGeode* geode = new simgear::EffectGeode;
-                geode->setName("test");
-                geode->addDrawable(geometry);
-                //osg::Node *custom_obj;
-                SGMaterial *mat = matlib->find("UnidirectionalTaper");
-                if (mat)
-                    geode->setEffect(mat->get_effect());
-                obj_trans->addChild(geode);
-                // wire as much of the scene graph together as we can
-                //->addChild( obj_trans );
-                group->addChild( obj_trans );
+                /////////////////////////////////////////////////////////////////////
             } else {
-                cerr << "BIG FAT WARNING: k is here : " << pos << endl;
+                //cerr << "BIG FAT WARNING: current position is here : " << pos << endl;
             }
+            for(intVecIterator j = (i)->getIntentions().begin(); j != (i)->getIntentions().end(); j++) {
+                osg::Matrix obj_pos;
+                int k = (*j);
+                if (k > 0) {
+                    //cerr << "rendering for " << i->getAircraft()->getCallSign() << "intention = " << k << endl;
+                    osg::MatrixTransform *obj_trans = new osg::MatrixTransform;
+                    obj_trans->setDataVariance(osg::Object::STATIC);
+                    FGTaxiSegment *segment  = parent->getGroundNetwork()->findSegment(k);
+                    WorldCoordinate( obj_pos, segment->getLatitude(), segment->getLongitude(), parent->getElevation()+8+dx, -(segment->getHeading()) );
+
+                    obj_trans->setMatrix( obj_pos );
+                    //osg::Vec3 center(0, 0, 0)
+
+                    float width = segment->getLength() /2.0;
+                    osg::Vec3 corner(-width, 0, 0.25f);
+                    osg::Vec3 widthVec(2*width + 1, 0, 0);
+                    osg::Vec3 heightVec(0, 1, 0);
+                    osg::Geometry* geometry;
+                    geometry = osg::createTexturedQuadGeometry(corner, widthVec, heightVec);
+                    simgear::EffectGeode* geode = new simgear::EffectGeode;
+                    geode->setName("test");
+                    geode->addDrawable(geometry);
+                    //osg::Node *custom_obj;
+                    SGMaterial *mat = matlib->find("UnidirectionalTaper");
+                    if (mat)
+                        geode->setEffect(mat->get_effect());
+                    obj_trans->addChild(geode);
+                    // wire as much of the scene graph together as we can
+                    //->addChild( obj_trans );
+                    group->addChild( obj_trans );
+                } else {
+                    cerr << "BIG FAT WARNING: k is here : " << pos << endl;
+                }
+            }
+            //dx += 0.1;
         }
-        //dx += 0.1;
+        globals->get_scenery()->get_scene_graph()->addChild(group);
     }
-    globals->get_scenery()->get_scene_graph()->addChild(group);
 }
 
-
 /***************************************************************************
  * class FGApproachController
  *
@@ -1461,6 +1463,6 @@ ActiveRunway *FGApproachController::getRunway(string name)
     return &(*rwy);
 }
 
-void FGApproachController::render() {
-    cerr << "FGApproachController::render function not yet implemented" << endl;
+void FGApproachController::render(bool visible) {
+    //cerr << "FGApproachController::render function not yet implemented" << endl;
 }
index 8cc35a7e7e01f64a816d2ea519d72f2620e46e35..3cffcced4312f2db920c32d8788fe5de22fbd54c 100644 (file)
@@ -285,7 +285,7 @@ public:
   void   setDt(double dt) { dt_count = dt;};
   void transmit(FGTrafficRecord *rec, AtcMsgId msgId, AtcMsgDir msgDir, bool audible);
   string getGateName(FGAIAircraft *aircraft);
-  virtual void render() = 0;
+  virtual void render(bool) = 0;
 
 private:
 
@@ -314,7 +314,7 @@ public:
   virtual bool             hasInstruction(int id);
   virtual FGATCInstruction getInstruction(int id);
 
-  virtual void render();
+  virtual void render(bool);
   bool hasActiveTraffic() { return activeTraffic.size() != 0; };
   TrafficVector &getActiveTraffic() { return activeTraffic; };
 };
@@ -344,7 +344,7 @@ public:
   virtual bool             hasInstruction(int id);
   virtual FGATCInstruction getInstruction(int id);
 
-  virtual void render();
+  virtual void render(bool);
 
   bool hasActiveTraffic() { return activeTraffic.size() != 0; };
   TrafficVector &getActiveTraffic() { return activeTraffic; };
@@ -377,7 +377,7 @@ public:
   virtual bool             hasInstruction(int id);
   virtual FGATCInstruction getInstruction(int id);
 
-  virtual void render();
+  virtual void render(bool);
 
   ActiveRunway* getRunway(string name);
 
index c6a07982f4f9b26c2b1558c2fa29ab009e9d2252..2fd437026cd506930a5f33e44b1185c3ce24f055 100644 (file)
@@ -539,15 +539,15 @@ bool FGGroundNetwork::checkTransmissionState(int minState, int maxState, Traffic
     if ((state >= minState) && (state <= maxState) && available) {
         if ((msgDir == ATC_AIR_TO_GROUND) && isUserAircraft(i->getAircraft())) {
             
-            cerr << "Checking state " << state << " for " << i->getAircraft()->getCallSign() << endl;
+            //cerr << "Checking state " << state << " for " << i->getAircraft()->getCallSign() << endl;
             static SGPropertyNode_ptr trans_num = globals->get_props()->getNode("/sim/atc/transmission-num", true);
             int n = trans_num->getIntValue();
-            if (n >= 0) {
+            if (n == 0) {
                 trans_num->setIntValue(-1);
                  // PopupCallback(n);
-                 cerr << "Selected transmission message" << n << endl;
+                 cerr << "Selected transmission message " << n << endl;
             } else {
-                cerr << "creading message for " << i->getAircraft()->getCallSign() << endl;
+                //cerr << "creating message for " << i->getAircraft()->getCallSign() << endl;
                 transmit(&(*i), msgId, msgDir, false);
                 return false;
             }
@@ -1103,7 +1103,7 @@ static void WorldCoordinate(osg::Matrix& obj_pos, double lat,
 
 
 
-void FGGroundNetwork::render()
+void FGGroundNetwork::render(bool visible)
 {
 
     SGMaterialLib *matlib = globals->get_matlib();
@@ -1117,31 +1117,33 @@ void FGGroundNetwork::render()
            //geode->releaseGLObjects();
            //group->removeChild(geode);
            //delete geode;
+        group = 0;
     }
-    group = new osg::Group;
-
-    //for ( FGTaxiSegmentVectorIterator i = segments.begin(); i != segments.end(); i++) {
-    double dx = 0;
-    for   (TrafficVectorIterator i = activeTraffic.begin(); i != activeTraffic.end(); i++) {
-        // Handle start point
-        int pos = i->getCurrentPosition() - 1;
-        if (pos >= 0) {
+    if (visible) {
+        group = new osg::Group;
+
+        //for ( FGTaxiSegmentVectorIterator i = segments.begin(); i != segments.end(); i++) {
+        double dx = 0;
+        for   (TrafficVectorIterator i = activeTraffic.begin(); i != activeTraffic.end(); i++) {
+            // Handle start point
+            int pos = i->getCurrentPosition() - 1;
+            if (pos >= 0) {
             
-            SGGeod start(SGGeod::fromDeg((i->getLongitude()), (i->getLatitude())));
-            SGGeod end  (SGGeod::fromDeg(segments[pos]->getEnd()->getLongitude(), segments[pos]->getEnd()->getLatitude()));
-
-            double length = SGGeodesy::distanceM(start, end);
-            //heading = SGGeodesy::headingDeg(start->getGeod(), end->getGeod());
-
-            double az2, heading; //, distanceM;
-            SGGeodesy::inverse(start, end, heading, az2, length);
-            double coveredDistance = length * 0.5;
-            SGGeod center;
-            SGGeodesy::direct(start, heading, coveredDistance, center, az2);
-            //cerr << "Active Aircraft : Centerpoint = (" << center.getLatitudeDeg() << ", " << center.getLongitudeDeg() << "). Heading = " << heading << endl;
+                SGGeod start(SGGeod::fromDeg((i->getLongitude()), (i->getLatitude())));
+                SGGeod end  (SGGeod::fromDeg(segments[pos]->getEnd()->getLongitude(), segments[pos]->getEnd()->getLatitude()));
+
+                double length = SGGeodesy::distanceM(start, end);
+                //heading = SGGeodesy::headingDeg(start->getGeod(), end->getGeod());
+
+                double az2, heading; //, distanceM;
+                SGGeodesy::inverse(start, end, heading, az2, length);
+                double coveredDistance = length * 0.5;
+                SGGeod center;
+                SGGeodesy::direct(start, heading, coveredDistance, center, az2);
+                //cerr << "Active Aircraft : Centerpoint = (" << center.getLatitudeDeg() << ", " << center.getLongitudeDeg() << "). Heading = " << heading << endl;
             ///////////////////////////////////////////////////////////////////////////////
-            // Make a helper function out of this
-            osg::Matrix obj_pos;
+                // Make a helper function out of this
+                osg::Matrix obj_pos;
                 osg::MatrixTransform *obj_trans = new osg::MatrixTransform;
                 obj_trans->setDataVariance(osg::Object::STATIC);
 
@@ -1167,42 +1169,43 @@ void FGGroundNetwork::render()
                 // wire as much of the scene graph together as we can
                 //->addChild( obj_trans );
                 group->addChild( obj_trans );
-        /////////////////////////////////////////////////////////////////////
-        } else {
-             cerr << "BIG FAT WARNING: current position is here : " << pos << endl;
-        }
-        for(intVecIterator j = (i)->getIntentions().begin(); j != (i)->getIntentions().end(); j++) {
-             osg::Matrix obj_pos;
-            int k = (*j)-1;
-            if (k >= 0) {
-                osg::MatrixTransform *obj_trans = new osg::MatrixTransform;
-                obj_trans->setDataVariance(osg::Object::STATIC);
-
-                WorldCoordinate( obj_pos, segments[k]->getLatitude(), segments[k]->getLongitude(), parent->elevation()+8+dx, -(segments[k]->getHeading()) );
-
-                obj_trans->setMatrix( obj_pos );
-                //osg::Vec3 center(0, 0, 0)
-
-                float width = segments[k]->getLength() /2.0;
-                osg::Vec3 corner(-width, 0, 0.25f);
-                osg::Vec3 widthVec(2*width + 1, 0, 0);
-                osg::Vec3 heightVec(0, 1, 0);
-                osg::Geometry* geometry;
-                geometry = osg::createTexturedQuadGeometry(corner, widthVec, heightVec);
-                simgear::EffectGeode* geode = new simgear::EffectGeode;
-                geode->setName("test");
-                geode->addDrawable(geometry);
-                //osg::Node *custom_obj;
-                SGMaterial *mat = matlib->find("UnidirectionalTaper");
-                if (mat)
-                    geode->setEffect(mat->get_effect());
-                obj_trans->addChild(geode);
-                // wire as much of the scene graph together as we can
-                //->addChild( obj_trans );
-                group->addChild( obj_trans );
+            /////////////////////////////////////////////////////////////////////
+            } else {
+                //cerr << "BIG FAT WARNING: current position is here : " << pos << endl;
+            }
+            for(intVecIterator j = (i)->getIntentions().begin(); j != (i)->getIntentions().end(); j++) {
+                osg::Matrix obj_pos;
+                int k = (*j)-1;
+                if (k >= 0) {
+                    osg::MatrixTransform *obj_trans = new osg::MatrixTransform;
+                    obj_trans->setDataVariance(osg::Object::STATIC);
+
+                    WorldCoordinate( obj_pos, segments[k]->getLatitude(), segments[k]->getLongitude(), parent->elevation()+8+dx, -(segments[k]->getHeading()) );
+
+                    obj_trans->setMatrix( obj_pos );
+                    //osg::Vec3 center(0, 0, 0)
+
+                    float width = segments[k]->getLength() /2.0;
+                    osg::Vec3 corner(-width, 0, 0.25f);
+                    osg::Vec3 widthVec(2*width + 1, 0, 0);
+                    osg::Vec3 heightVec(0, 1, 0);
+                    osg::Geometry* geometry;
+                    geometry = osg::createTexturedQuadGeometry(corner, widthVec, heightVec);
+                    simgear::EffectGeode* geode = new simgear::EffectGeode;
+                    geode->setName("test");
+                    geode->addDrawable(geometry);
+                    //osg::Node *custom_obj;
+                    SGMaterial *mat = matlib->find("UnidirectionalTaper");
+                    if (mat)
+                        geode->setEffect(mat->get_effect());
+                    obj_trans->addChild(geode);
+                    // wire as much of the scene graph together as we can
+                    //->addChild( obj_trans );
+                    group->addChild( obj_trans );
+                }
             }
+            //dx += 0.1;
         }
-        //dx += 0.1;
+        globals->get_scenery()->get_scene_graph()->addChild(group);
     }
-    globals->get_scenery()->get_scene_graph()->addChild(group);
 }
\ No newline at end of file
index bc51fd85731560f71ca49eca76514b86889ce8e8..e72ef92a723646fd9ba263f6b2796af69d6ca37e 100644 (file)
@@ -287,7 +287,7 @@ public:
   bool checkTransmissionState(int minState, int MaxState, TrafficVectorIterator i, time_t now, AtcMsgId msgId,
                                AtcMsgDir msgDir);
   bool checkForCircularWaits(int id);
-  virtual void render();
+  virtual void render(bool);
 
 };