// generated by Fast Light User Interface Designer (fluid) version 1.0104

#include "CuttingPlane.H"

inline void CuttingPlaneUserInterface::cb_CuttingPlaneValue_i(Fl_Value_Input* o, void*) {
  glviewer_->SetCuttingPlaneValueto( ((Fl_Value_Input *)o)->value() );
glviewer_->redraw();
}
void CuttingPlaneUserInterface::cb_CuttingPlaneValue(Fl_Value_Input* o, void* v) {
  ((CuttingPlaneUserInterface*)(o->parent()->user_data()))->cb_CuttingPlaneValue_i(o,v);
}

inline void CuttingPlaneUserInterface::cb_XDirection_i(Fl_Menu_*, void*) {
  glviewer_->SetCuttingDirectionTo( 1 );
glviewer_->redraw();
}
void CuttingPlaneUserInterface::cb_XDirection(Fl_Menu_* o, void* v) {
  ((CuttingPlaneUserInterface*)(o->parent()->user_data()))->cb_XDirection_i(o,v);
}

inline void CuttingPlaneUserInterface::cb_YDirection_i(Fl_Menu_*, void*) {
  glviewer_->SetCuttingDirectionTo( 2 );
glviewer_->redraw();
}
void CuttingPlaneUserInterface::cb_YDirection(Fl_Menu_* o, void* v) {
  ((CuttingPlaneUserInterface*)(o->parent()->user_data()))->cb_YDirection_i(o,v);
}

inline void CuttingPlaneUserInterface::cb_ZDirection_i(Fl_Menu_*, void*) {
  glviewer_->SetCuttingDirectionTo( 3 );
glviewer_->redraw();
}
void CuttingPlaneUserInterface::cb_ZDirection(Fl_Menu_* o, void* v) {
  ((CuttingPlaneUserInterface*)(o->parent()->user_data()))->cb_ZDirection_i(o,v);
}

Fl_Menu_Item CuttingPlaneUserInterface::menu_Cutting[] = {
 {"Constant X", 0,  (Fl_Callback*)CuttingPlaneUserInterface::cb_XDirection, 0, 0, 0, 0, 14, 56},
 {"Constant Y", 0,  (Fl_Callback*)CuttingPlaneUserInterface::cb_YDirection, 0, 0, 0, 0, 14, 56},
 {"Constant Z", 0,  (Fl_Callback*)CuttingPlaneUserInterface::cb_ZDirection, 0, 0, 0, 0, 14, 56},
 {0}
};
Fl_Menu_Item* CuttingPlaneUserInterface::XDirection = CuttingPlaneUserInterface::menu_Cutting + 0;
Fl_Menu_Item* CuttingPlaneUserInterface::YDirection = CuttingPlaneUserInterface::menu_Cutting + 1;
Fl_Menu_Item* CuttingPlaneUserInterface::ZDirection = CuttingPlaneUserInterface::menu_Cutting + 2;

CuttingPlaneUserInterface::CuttingPlaneUserInterface() {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = MainWindow = new Fl_Double_Window(297, 106, "Cutting Plane");
    w = o;
    o->user_data((void*)(this));
    o->align(129);
    { Fl_Value_Input* o = CuttingPlaneValue = new Fl_Value_Input(179, 50, 110, 35, "Cutting Plane Value:");
      o->callback((Fl_Callback*)cb_CuttingPlaneValue);
    }
    { Fl_Choice* o = new Fl_Choice(180, 4, 110, 35, "Cutting Plane:");
      o->down_box(FL_BORDER_BOX);
      o->menu(menu_Cutting);
    }
    o->end();
  }
}

void CuttingPlaneUserInterface::show(GL_VIEWER *glviewer) {
  glviewer_ = glviewer;
CuttingPlaneValue->value(glviewer_->GetCuttingPlaneValue());
int CutDir = glviewer_->GetCuttingDirection();
if ( CutDir == 1 ) XDirection->set();
if ( CutDir == 2 ) YDirection->set();
if ( CutDir == 3 ) ZDirection->set();
MainWindow->show();
}
