20,741
edits
| Line 641: | Line 641: | ||
The '''searchCmd()''' method is responsible for populating a vector with results that are to be drawn by the '''draw()''' method in the *.symbol file. For example, for navaid-based layers, this will normally serve as the back-end for a '''positionedSearch''' using a delta of the current result, compared to the previous result. This is done to enable a layer to tell how many results are new/missing, to selectively update those - rather than having to always delete all previous results and add all new ones. | The '''searchCmd()''' method is responsible for populating a vector with results that are to be drawn by the '''draw()''' method in the *.symbol file. Each object will typically be either a NasalPositioned ghost (i.e. a C++ FGPositioned object returned from a positioned query) or a Nasal hash with latitude/longitude fields/methods, or just a geo.Coord object create via geo.Coord.new(). | ||
For example, for navaid-based layers, this will normally serve as the back-end for a '''positionedSearch''' using a delta of the current result, compared to the previous result. This is done to enable a layer to tell how many results are new/missing, to selectively update those - rather than having to always delete all previous results and add all new ones. | |||
Whenever a new element (object) is added to the vector, the '''.onAdded()''' method will be invoked to add a new symbol to list of managed symbols - once an element is removed, the '''.onRemoved()''' method will be called to call the symbol's destructor. | Whenever a new element (object) is added to the vector, the '''.onAdded()''' method will be invoked to add a new symbol to list of managed symbols - once an element is removed, the '''.onRemoved()''' method will be called to call the symbol's destructor. | ||