1 // panel.cxx - default, 2D single-engine prop instrument panel
3 // Written by David Megginson, started January 2000.
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License as
7 // published by the Free Software Foundation; either version 2 of the
8 // License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful, but
11 // WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #include <stdio.h> // sprintf
35 #include <simgear/debug/logstream.hxx>
36 #include <simgear/misc/sg_path.hxx>
38 #include <Main/globals.hxx>
39 #include <Main/fg_props.hxx>
40 #include <Main/viewmgr.hxx>
41 #include <Objects/texload.h>
42 #include <Time/light.hxx>
52 // The number of polygon-offset "units" to place between layers. In
53 // principle, one is supposed to be enough. In practice, I find that
54 // my hardware/driver requires many more.
58 ////////////////////////////////////////////////////////////////////////
60 ////////////////////////////////////////////////////////////////////////
64 * Calculate the aspect adjustment for the panel.
67 get_aspect_adjust (int xsize, int ysize)
69 float ideal_aspect = float(WIN_W) / float(WIN_H);
70 float real_aspect = float(xsize) / float(ysize);
71 return (real_aspect / ideal_aspect);
76 ////////////////////////////////////////////////////////////////////////
78 ////////////////////////////////////////////////////////////////////////
83 if(current_panel == 0)
85 if(current_panel->getVisibility() == 0)
87 if(globals->get_viewmgr()->get_current() != 0)
89 if(globals->get_current_view()->getHeadingOffset_deg() * SGD_DEGREES_TO_RADIANS != 0)
96 ////////////////////////////////////////////////////////////////////////
97 // Implementation of FGTextureManager.
98 ////////////////////////////////////////////////////////////////////////
100 map<string,ssgTexture *> FGTextureManager::_textureMap;
103 FGTextureManager::createTexture (const string &relativePath)
105 ssgTexture * texture = _textureMap[relativePath];
107 SG_LOG( SG_COCKPIT, SG_DEBUG,
108 "Texture " << relativePath << " does not yet exist" );
109 SGPath tpath(globals->get_fg_root());
110 tpath.append(relativePath);
111 texture = new ssgTexture((char *)tpath.c_str(), false, false);
112 _textureMap[relativePath] = texture;
113 if (_textureMap[relativePath] == 0)
114 SG_LOG( SG_COCKPIT, SG_ALERT, "Texture *still* doesn't exist" );
115 SG_LOG( SG_COCKPIT, SG_DEBUG, "Created texture " << relativePath
116 << " handle=" << texture->getHandle() );
125 ////////////////////////////////////////////////////////////////////////
126 // Implementation of FGCropped Texture.
127 ////////////////////////////////////////////////////////////////////////
130 FGCroppedTexture::FGCroppedTexture ()
131 : _path(""), _texture(0),
132 _minX(0.0), _minY(0.0), _maxX(1.0), _maxY(1.0)
137 FGCroppedTexture::FGCroppedTexture (const string &path,
138 float minX, float minY,
139 float maxX, float maxY)
140 : _path(path), _texture(0),
141 _minX(minX), _minY(minY), _maxX(maxX), _maxY(maxY)
146 FGCroppedTexture::~FGCroppedTexture ()
152 FGCroppedTexture::getTexture ()
155 _texture = FGTextureManager::createTexture(_path);
162 ////////////////////////////////////////////////////////////////////////
163 // Implementation of FGPanel.
164 ////////////////////////////////////////////////////////////////////////
166 FGPanel * current_panel = NULL;
167 static fntRenderer text_renderer;
168 static fntTexFont *default_font;
169 static fntTexFont *led_font;
177 _width(WIN_W), _height(int(WIN_H * 0.5768 + 1)),
178 _x_offset(0), _y_offset(0), _view_height(int(WIN_H * 0.4232)),
180 _xsize_node(fgGetNode("/sim/startup/xsize", true)),
181 _ysize_node(fgGetNode("/sim/startup/ysize", true))
183 setVisibility(fgPanelVisible());
192 for (instrument_list_type::iterator it = _instruments.begin();
193 it != _instruments.end();
202 * Add an instrument to the panel.
205 FGPanel::addInstrument (FGPanelInstrument * instrument)
207 _instruments.push_back(instrument);
212 * Initialize the panel.
218 char* envp = ::getenv( "FG_FONTS" );
219 if ( envp != NULL ) {
220 base_path.set( envp );
222 base_path.set( globals->get_fg_root() );
223 base_path.append( "Fonts" );
228 // Install the default font
230 fntpath.append( "typewriter.txf" );
231 default_font = new fntTexFont ;
232 default_font -> load ( (char *)fntpath.c_str() ) ;
234 // Install the LED font
236 fntpath.append( "led.txf" );
237 led_font = new fntTexFont ;
238 led_font -> load ( (char *)fntpath.c_str() ) ;
243 * Bind panel properties.
248 fgSetArchivable("/sim/panel/visibility");
249 fgSetArchivable("/sim/panel/x-offset");
250 fgSetArchivable("/sim/panel/y-offset");
251 fgSetArchivable("/sim/panel/jitter");
256 * Unbind panel properties.
268 FGPanel::update (double dt)
270 // TODO: cache the nodes
271 _visibility = fgGetBool("/sim/panel/visibility");
272 _x_offset = fgGetInt("/sim/panel/x-offset");
273 _y_offset = fgGetInt("/sim/panel/y-offset");
274 _jitter = fgGetFloat("/sim/panel/jitter");
275 _flipx = fgGetBool("/sim/panel/flip-x");
277 // Do nothing if the panel isn't visible.
278 if ( !fgPanelVisible() ) {
282 // If the mouse is down, do something
285 if (_mouseDelay < 0) {
286 _mouseInstrument->doMouseAction(_mouseButton, _mouseX, _mouseY);
291 // Now, draw the panel
292 float aspect_adjust = get_aspect_adjust(_xsize_node->getIntValue(),
293 _ysize_node->getIntValue());
294 if (aspect_adjust <1.0)
295 update(WIN_X, int(WIN_W * aspect_adjust), WIN_Y, WIN_H);
297 update(WIN_X, WIN_W, WIN_Y, int(WIN_H / aspect_adjust));
302 FGPanel::update (GLfloat winx, GLfloat winw, GLfloat winy, GLfloat winh)
304 // Calculate accelerations
305 // and jiggle the panel accordingly
306 // The factors and bounds are just
307 // initial guesses; using sqrt smooths
309 double x_offset = _x_offset;
310 double y_offset = _y_offset;
313 if (_jitter != 0.0) {
314 double a_x_pilot = current_aircraft.fdm_state->get_A_X_pilot();
315 double a_y_pilot = current_aircraft.fdm_state->get_A_Y_pilot();
316 double a_z_pilot = current_aircraft.fdm_state->get_A_Z_pilot();
318 double a_zx_pilot = a_z_pilot - a_x_pilot;
320 int x_adjust = int(sqrt(fabs(a_y_pilot) * _jitter)) *
321 (a_y_pilot < 0 ? -1 : 1);
322 int y_adjust = int(sqrt(fabs(a_zx_pilot) * _jitter)) *
323 (a_zx_pilot < 0 ? -1 : 1);
325 // adjustments in screen coordinates
326 x_offset += x_adjust;
327 y_offset += y_adjust;
331 glMatrixMode(GL_PROJECTION);
335 gluOrtho2D(winx + winw, winx, winy + winh, winy); /* up side down */
337 gluOrtho2D(winx, winx + winw, winy, winy + winh); /* right side up */
340 glMatrixMode(GL_MODELVIEW);
344 glTranslated(x_offset, y_offset, 0);
348 glMatrixMode(GL_PROJECTION);
350 glMatrixMode(GL_MODELVIEW);
353 ssgForceBasicState();
354 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
360 // In 3D mode, it's possible that we are being drawn exactly on top
361 // of an existing polygon. Use an offset to prevent z-fighting. In
362 // 2D mode, this is a no-op.
363 glEnable(GL_POLYGON_OFFSET_FILL);
364 glPolygonOffset(0, -POFF_UNITS);
367 glPushAttrib( GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT | GL_LIGHTING_BIT
368 | GL_TEXTURE_BIT | GL_PIXEL_MODE_BIT );
370 // Draw the background
371 glEnable(GL_TEXTURE_2D);
372 glDisable(GL_LIGHTING);
374 glEnable(GL_ALPHA_TEST);
375 glEnable(GL_COLOR_MATERIAL);
377 sgCopyVec4( panel_color, cur_light_params.scene_diffuse );
378 if ( fgGetDouble("/systems/electrical/outputs/instrument-lights") > 1.0 ) {
379 if ( panel_color[0] < 0.7 ) panel_color[0] = 0.7;
380 if ( panel_color[1] < 0.2 ) panel_color[1] = 0.2;
381 if ( panel_color[2] < 0.2 ) panel_color[2] = 0.2;
383 glColor4fv( panel_color );
385 glBindTexture(GL_TEXTURE_2D, _bg->getHandle());
386 // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
387 // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
388 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
390 glTexCoord2f(0.0, 0.0); glVertex2f(WIN_X, WIN_Y);
391 glTexCoord2f(1.0, 0.0); glVertex2f(WIN_X + _width, WIN_Y);
392 glTexCoord2f(1.0, 1.0); glVertex2f(WIN_X + _width, WIN_Y + _height);
393 glTexCoord2f(0.0, 1.0); glVertex2f(WIN_X, WIN_Y + _height);
396 for (int i = 0; i < 4; i ++) {
397 // top row of textures...(1,3,5,7)
398 glBindTexture(GL_TEXTURE_2D, _mbg[i*2]->getHandle());
399 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
401 glTexCoord2f(0.0, 0.0); glVertex2f(WIN_X + (_width/4) * i, WIN_Y + (_height/2));
402 glTexCoord2f(1.0, 0.0); glVertex2f(WIN_X + (_width/4) * (i+1), WIN_Y + (_height/2));
403 glTexCoord2f(1.0, 1.0); glVertex2f(WIN_X + (_width/4) * (i+1), WIN_Y + _height);
404 glTexCoord2f(0.0, 1.0); glVertex2f(WIN_X + (_width/4) * i, WIN_Y + _height);
406 // bottom row of textures...(2,4,6,8)
407 glBindTexture(GL_TEXTURE_2D, _mbg[(i*2)+1]->getHandle());
408 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
410 glTexCoord2f(0.0, 0.0); glVertex2f(WIN_X + (_width/4) * i, WIN_Y);
411 glTexCoord2f(1.0, 0.0); glVertex2f(WIN_X + (_width/4) * (i+1), WIN_Y);
412 glTexCoord2f(1.0, 1.0); glVertex2f(WIN_X + (_width/4) * (i+1), WIN_Y + (_height/2));
413 glTexCoord2f(0.0, 1.0); glVertex2f(WIN_X + (_width/4) * i, WIN_Y + (_height/2));
418 // Draw the instruments.
419 instrument_list_type::const_iterator current = _instruments.begin();
420 instrument_list_type::const_iterator end = _instruments.end();
422 for ( ; current != end; current++) {
423 FGPanelInstrument * instr = *current;
425 glTranslated(instr->getXPos(), instr->getYPos(), 0);
430 // restore some original state
432 glPolygonOffset(0, 0);
433 glDisable(GL_POLYGON_OFFSET_FILL);
437 * Set the panel's visibility.
440 FGPanel::setVisibility (bool visibility)
442 _visibility = visibility;
447 * Return true if the panel is visible.
450 FGPanel::getVisibility () const
457 * Set the panel's background texture.
460 FGPanel::setBackground (ssgTexture * texture)
466 * Set the panel's multiple background textures.
469 FGPanel::setMultiBackground (ssgTexture * texture, int idx)
476 * Set the panel's x-offset.
479 FGPanel::setXOffset (int offset)
481 if (offset <= 0 && offset >= -_width + WIN_W)
487 * Set the panel's y-offset.
490 FGPanel::setYOffset (int offset)
492 if (offset <= 0 && offset >= -_height)
497 * Perform a mouse action.
500 FGPanel::doMouseAction (int button, int updown, int x, int y)
502 // FIXME: this same code appears in update()
503 int xsize = _xsize_node->getIntValue();
504 int ysize = _ysize_node->getIntValue();
505 float aspect_adjust = get_aspect_adjust(xsize, ysize);
507 // Note a released button and return
508 // cerr << "Doing mouse action\n";
511 _mouseInstrument = 0;
515 // Scale for the real window size.
516 if (aspect_adjust < 1.0) {
517 x = int(((float)x / xsize) * WIN_W * aspect_adjust);
518 y = int(WIN_H - ((float(y) / ysize) * WIN_H));
520 x = int(((float)x / xsize) * WIN_W);
521 y = int((WIN_H - ((float(y) / ysize) * WIN_H)) / aspect_adjust);
524 // Adjust for offsets.
528 // Search for a matching instrument.
529 for (int i = 0; i < (int)_instruments.size(); i++) {
530 FGPanelInstrument *inst = _instruments[i];
531 int ix = inst->getXPos();
532 int iy = inst->getYPos();
533 int iw = inst->getWidth() / 2;
534 int ih = inst->getHeight() / 2;
535 if (x >= ix - iw && x < ix + iw && y >= iy - ih && y < iy + ih) {
538 _mouseInstrument = inst;
539 _mouseButton = button;
542 // Always do the action once.
543 return _mouseInstrument->doMouseAction(_mouseButton, _mouseX, _mouseY);
551 ////////////////////////////////////////////////////////////////////////.
552 // Implementation of FGPanelAction.
553 ////////////////////////////////////////////////////////////////////////
555 FGPanelAction::FGPanelAction ()
559 FGPanelAction::FGPanelAction (int button, int x, int y, int w, int h)
560 : _button(button), _x(x), _y(y), _w(w), _h(h)
562 for (unsigned int i = 0; i < _bindings.size(); i++)
566 FGPanelAction::~FGPanelAction ()
571 FGPanelAction::addBinding (FGBinding * binding)
573 _bindings.push_back(binding);
577 FGPanelAction::doAction ()
580 int nBindings = _bindings.size();
581 for (int i = 0; i < nBindings; i++) {
582 _bindings[i]->fire();
589 ////////////////////////////////////////////////////////////////////////
590 // Implementation of FGPanelTransformation.
591 ////////////////////////////////////////////////////////////////////////
593 FGPanelTransformation::FGPanelTransformation ()
598 FGPanelTransformation::~FGPanelTransformation ()
605 ////////////////////////////////////////////////////////////////////////
606 // Implementation of FGPanelInstrument.
607 ////////////////////////////////////////////////////////////////////////
610 FGPanelInstrument::FGPanelInstrument ()
616 FGPanelInstrument::FGPanelInstrument (int x, int y, int w, int h)
622 FGPanelInstrument::~FGPanelInstrument ()
624 for (action_list_type::iterator it = _actions.begin();
625 it != _actions.end();
633 FGPanelInstrument::setPosition (int x, int y)
640 FGPanelInstrument::setSize (int w, int h)
647 FGPanelInstrument::getXPos () const
653 FGPanelInstrument::getYPos () const
659 FGPanelInstrument::getWidth () const
665 FGPanelInstrument::getHeight () const
671 FGPanelInstrument::addAction (FGPanelAction * action)
673 _actions.push_back(action);
676 // Coordinates relative to centre.
678 FGPanelInstrument::doMouseAction (int button, int x, int y)
681 action_list_type::iterator it = _actions.begin();
682 action_list_type::iterator last = _actions.end();
683 for ( ; it != last; it++) {
684 if ((*it)->inArea(button, x, y)) {
695 ////////////////////////////////////////////////////////////////////////
696 // Implementation of FGLayeredInstrument.
697 ////////////////////////////////////////////////////////////////////////
699 FGLayeredInstrument::FGLayeredInstrument (int x, int y, int w, int h)
700 : FGPanelInstrument(x, y, w, h)
704 FGLayeredInstrument::~FGLayeredInstrument ()
706 for (layer_list::iterator it = _layers.begin(); it != _layers.end(); it++) {
713 FGLayeredInstrument::draw ()
718 for (int i = 0; i < (int)_layers.size(); i++) {
720 glPolygonOffset(-1, -POFF_UNITS*(i+2));
727 FGLayeredInstrument::addLayer (FGInstrumentLayer *layer)
729 int n = _layers.size();
730 if (layer->getWidth() == -1) {
731 layer->setWidth(getWidth());
733 if (layer->getHeight() == -1) {
734 layer->setHeight(getHeight());
736 _layers.push_back(layer);
741 FGLayeredInstrument::addLayer (FGCroppedTexture &texture,
744 return addLayer(new FGTexturedLayer(texture, w, h));
748 FGLayeredInstrument::addTransformation (FGPanelTransformation * transformation)
750 int layer = _layers.size() - 1;
751 _layers[layer]->addTransformation(transformation);
756 ////////////////////////////////////////////////////////////////////////
757 // Implementation of FGInstrumentLayer.
758 ////////////////////////////////////////////////////////////////////////
760 FGInstrumentLayer::FGInstrumentLayer (int w, int h)
766 FGInstrumentLayer::~FGInstrumentLayer ()
768 for (transformation_list::iterator it = _transformations.begin();
769 it != _transformations.end();
777 FGInstrumentLayer::transform () const
779 transformation_list::const_iterator it = _transformations.begin();
780 transformation_list::const_iterator last = _transformations.end();
782 FGPanelTransformation *t = *it;
784 float val = (t->node == 0 ? 0.0 : t->node->getFloatValue());
787 } else if (val > t->max) {
791 val = val * t->factor + t->offset;
793 val = t->table->interpolate(val) * t->factor + t->offset;
797 case FGPanelTransformation::XSHIFT:
798 glTranslatef(val, 0.0, 0.0);
800 case FGPanelTransformation::YSHIFT:
801 glTranslatef(0.0, val, 0.0);
803 case FGPanelTransformation::ROTATION:
804 glRotatef(-val, 0.0, 0.0, 1.0);
813 FGInstrumentLayer::addTransformation (FGPanelTransformation * transformation)
815 _transformations.push_back(transformation);
820 ////////////////////////////////////////////////////////////////////////
821 // Implementation of FGGroupLayer.
822 ////////////////////////////////////////////////////////////////////////
824 FGGroupLayer::FGGroupLayer ()
828 FGGroupLayer::~FGGroupLayer ()
830 for (unsigned int i = 0; i < _layers.size(); i++)
835 FGGroupLayer::draw ()
838 int nLayers = _layers.size();
839 for (int i = 0; i < nLayers; i++)
845 FGGroupLayer::addLayer (FGInstrumentLayer * layer)
847 _layers.push_back(layer);
852 ////////////////////////////////////////////////////////////////////////
853 // Implementation of FGTexturedLayer.
854 ////////////////////////////////////////////////////////////////////////
857 FGTexturedLayer::FGTexturedLayer (const FGCroppedTexture &texture, int w, int h)
858 : FGInstrumentLayer(w, h)
864 FGTexturedLayer::~FGTexturedLayer ()
870 FGTexturedLayer::draw ()
877 glBindTexture(GL_TEXTURE_2D, _texture.getTexture()->getHandle());
880 // From Curt: turn on the panel
881 // lights after sundown.
883 sgCopyVec4( panel_color, cur_light_params.scene_diffuse );
884 if ( fgGetDouble("/systems/electrical/outputs/instrument-lights") > 1.0 ) {
885 if ( panel_color[0] < 0.7 ) panel_color[0] = 0.7;
886 if ( panel_color[1] < 0.2 ) panel_color[1] = 0.2;
887 if ( panel_color[2] < 0.2 ) panel_color[2] = 0.2;
889 glColor4fv( panel_color );
891 glTexCoord2f(_texture.getMinX(), _texture.getMinY()); glVertex2f(-w2, -h2);
892 glTexCoord2f(_texture.getMaxX(), _texture.getMinY()); glVertex2f(w2, -h2);
893 glTexCoord2f(_texture.getMaxX(), _texture.getMaxY()); glVertex2f(w2, h2);
894 glTexCoord2f(_texture.getMinX(), _texture.getMaxY()); glVertex2f(-w2, h2);
901 ////////////////////////////////////////////////////////////////////////
902 // Implementation of FGTextLayer.
903 ////////////////////////////////////////////////////////////////////////
905 FGTextLayer::FGTextLayer (int w, int h)
906 : FGInstrumentLayer(w, h), _pointSize(14.0), _font_name("default")
909 _color[0] = _color[1] = _color[2] = 0.0;
913 FGTextLayer::~FGTextLayer ()
915 chunk_list::iterator it = _chunks.begin();
916 chunk_list::iterator last = _chunks.end();
917 for ( ; it != last; it++) {
928 if ( _font_name == "led" ) {
929 text_renderer.setFont(led_font);
931 text_renderer.setFont(guiFntHandle);
933 text_renderer.setPointSize(_pointSize);
934 text_renderer.begin();
935 text_renderer.start3f(0, 0, 0);
938 long diff = _now - _then;
940 if (diff > 100000 || diff < 0 ) {
941 // ( diff < 0 ) is a sanity check and indicates our time stamp
942 // difference math probably overflowed. We can handle a max
943 // difference of 35.8 minutes since the returned value is in
944 // usec. So if the panel is left off longer than that we can
945 // over flow the math with it is turned back on. This (diff <
946 // 0) catches that situation, get's us out of trouble, and
952 // Something is goofy. The code in this file renders only CCW
953 // polygons, and I have verified that the font code in plib
954 // renders only CCW trianbles. Yet they come out backwards.
955 // Something around here or in plib is either changing the winding
956 // order or (more likely) pushing a left-handed matrix onto the
957 // stack. But I can't find it; get out the chainsaw...
959 text_renderer.puts((char *)(_value.c_str()));
963 glColor4f(1.0, 1.0, 1.0, 1.0); // FIXME
968 FGTextLayer::addChunk (FGTextLayer::Chunk * chunk)
970 _chunks.push_back(chunk);
974 FGTextLayer::setColor (float r, float g, float b)
983 FGTextLayer::setPointSize (float size)
989 FGTextLayer::setFontName(const string &name)
996 FGTextLayer::setFont(fntFont * font)
998 text_renderer.setFont(font);
1003 FGTextLayer::recalc_value () const
1006 chunk_list::const_iterator it = _chunks.begin();
1007 chunk_list::const_iterator last = _chunks.end();
1008 for ( ; it != last; it++) {
1009 _value += (*it)->getValue();
1015 ////////////////////////////////////////////////////////////////////////
1016 // Implementation of FGTextLayer::Chunk.
1017 ////////////////////////////////////////////////////////////////////////
1019 FGTextLayer::Chunk::Chunk (const string &text, const string &fmt)
1020 : _type(FGTextLayer::TEXT), _fmt(fmt)
1027 FGTextLayer::Chunk::Chunk (ChunkType type, const SGPropertyNode * node,
1028 const string &fmt, float mult)
1029 : _type(type), _fmt(fmt), _mult(mult)
1032 if (type == TEXT_VALUE)
1041 FGTextLayer::Chunk::getValue () const
1047 sprintf(_buf, _fmt.c_str(), _text.c_str());
1050 sprintf(_buf, _fmt.c_str(), _node->getStringValue());
1053 sprintf(_buf, _fmt.c_str(), _node->getFloatValue() * _mult);
1064 ////////////////////////////////////////////////////////////////////////
1065 // Implementation of FGSwitchLayer.
1066 ////////////////////////////////////////////////////////////////////////
1068 FGSwitchLayer::FGSwitchLayer (int w, int h, const SGPropertyNode * node,
1069 FGInstrumentLayer * layer1,
1070 FGInstrumentLayer * layer2)
1071 : FGInstrumentLayer(w, h), _node(node), _layer1(layer1), _layer2(layer2)
1075 FGSwitchLayer::~FGSwitchLayer ()
1082 FGSwitchLayer::draw ()
1086 if (_node->getBoolValue()) {