DCQ : new Sketcher + merge

This commit is contained in:
dcq 2004-05-04 14:19:44 +00:00
parent 8b14e1e649
commit ebc2144ffc

View File

@ -103,7 +103,6 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
return false;
Mb->setItemEnabled(404, ViewOCC);//SKETCHER
Mb->setItemEnabled(406, ViewOCC);//SKETCHER
Mb->setItemEnabled(603, ViewOCC);//SuppressFace
Mb->setItemEnabled(604, ViewOCC);//SuppressHole
@ -111,32 +110,6 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
Mb->setItemEnabled(413, ViewOCC);// ShadingColor Settings
Mb->setItemEnabled(414, ViewOCC);// Isos Settings
if(theCommandID == 4041 || // SKETCHER - POPUP VIEWER - SEGMENT
theCommandID == 4042 || // SKETCHER - POPUP VIEWER - ARC
theCommandID == 4043 || // SKETCHER - POPUP VIEWER - SET ANGLE
theCommandID == 4044 || // SKETCHER - POPUP VIEWER - SET X
theCommandID == 4045 || // SKETCHER - POPUP VIEWER - SET Y
theCommandID == 4046 || // SKETCHER - POPUP VIEWER - DELETE
theCommandID == 4047 || // SKETCHER - POPUP VIEWER - END
theCommandID == 4048 || // SKETCHER - POPUP VIEWER - CLOSE
theCommandID == 4051 || // SKETCHER - MENU - SET PLANE
theCommandID == 4052 || // SKETCHER - MENU - TANGENT
theCommandID == 4053 || // SKETCHER - MENU - PERPENDICULAR
theCommandID == 4061 || // SKETCHER - MENU - LENGTH
theCommandID == 4062 || // SKETCHER - MENU - ANGLE
theCommandID == 4063 || // SKETCHER - MENU - RADIUS
theCommandID == 4064 || // SKETCHER - MENU - X
theCommandID == 4065) { // SKETCHER - MENU - Y
if(!GeomGUI->LoadLibrary("libEntityGUI.so"))
return false;
}
else {
if(GeomGUI->myState == 2) {
Mb->setItemEnabled(405, false);//SKETCHER
GeomGUI->GetSketcher().Clear();
GeomGUI->myState = -1;
}
if(theCommandID == 111 || // MENU FILE - IMPORT BREP
theCommandID == 112 || // MENU FILE - IMPORT IGES
theCommandID == 113 || // MENU FILE - IMPORT STEP
@ -195,7 +168,7 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
if(!GeomGUI->LoadLibrary("libGenerationGUI.so"))
return false;
}
else if(theCommandID == 404 || // SKETCHER
else if(theCommandID == 404 || // MENU ENTITY - SKETCHER
theCommandID == 407) { // MENU ENTITY - EXPLODE
if(!GeomGUI->LoadLibrary("libEntityGUI.so"))
return false;
@ -252,7 +225,6 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
}
else
return false;
}
//Load Function OnGUIEvent
OSD_Function osdF = GeomGUI->myGUILibrary.DlSymb("OnGUIEvent");
@ -293,12 +265,7 @@ bool GeometryGUI::OnMouseMove(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFra
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
return false;
if(GeomGUI->myState == 2) {
OCCViewer_ViewPort* vp = ((OCCViewer_ViewFrame*)studyFrame->getRightFrame()->getViewFrame())->getViewPort();
GeomGUI->GetSketcher().MakeCurrentEdge(pe->x(), pe->y(), ((OCCViewer_ViewPort3d*)vp)->getView());
}
else
return true;
}
@ -314,14 +281,7 @@ bool GeometryGUI::OnMousePress(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFr
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
return false;
if(GeomGUI->myState == 2) {
GeomGUI->GetSketcher().ValidateEdge();
if(GeomGUI->GetSketcher().GetmyEdgesNumber() == 1) {
QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
Mb->setItemEnabled(405, true); // SKETCH CONTRAINTS
}
}
else if(GeomGUI->myState == 0) {
if(GeomGUI->myState == 0) {
if(!GeomGUI->LoadLibrary("libBasicGUI.so"))
return false;
@ -425,8 +385,6 @@ bool GeometryGUI::SetSettings(QAD_Desktop* parent)
}
Mb->setItemEnabled(404, ViewOCC);//SKETCHER
Mb->setItemEnabled(405, false);//SKETCHER
Mb->setItemEnabled(406, ViewOCC);//SKETCHER
Mb->setItemEnabled(603, ViewOCC);//SuppressFace
Mb->setItemEnabled(604, ViewOCC);//SuppressHole
@ -454,11 +412,8 @@ void GeometryGUI::DefinePopup(QString & theContext, QString & theParent, QString
theObject = "";
theContext = "";
if((theParent.compare("Viewer") == 0)) {
if(GeomGUI->myState == 2)
theContext = "Sketch";
else if(Sel->IObjectCount() == 0)
if(Sel->IObjectCount() == 0)
theContext = "NothingSelected";
}
@ -489,24 +444,6 @@ bool GeometryGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QStr
{
GeometryGUI::GetOrCreateGeometryGUI(parent);
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
if(theParent.compare("Viewer") == 0) {
if(theContext.compare("Sketch") == 0) {
SketchStatus myCS = GeomGUI->GetSketcher().GetCurrentStatus();
popup->setCheckable(TRUE);
if(myCS == SEGMENT) {
popup->setItemChecked(4041, true); //Sketch Segment Menu
popup->setItemChecked(4042, false); //Sketch Arc Menu
}
else if(myCS == ARC_CHORD) {
popup->setItemChecked(4041, false); //Sketch Segment Menu
popup->setItemChecked(4042, true); //Sketch Arc Menu
}
return true;
}
}
}
if(!GeomGUI->LoadLibrary("libGEOMBase.so"))
return false;
@ -535,19 +472,11 @@ bool GeometryGUI::ActiveStudyChanged(QAD_Desktop* parent)
if(GeomGUI != 0) {
QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels();
if(GeomGUI->myState == 2) {
Mb->setItemEnabled(405, false);//SKETCHER
GeomGUI->GetSketcher().Clear();
GeomGUI->myState = -1;
}
bool ViewOCC = false;
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
ViewOCC = true;
Mb->setItemEnabled(404, ViewOCC);//SKETCHER
Mb->setItemEnabled(406, ViewOCC);//SKETCHER
Mb->setItemEnabled(603, ViewOCC);//SuppressFace
Mb->setItemEnabled(604, ViewOCC);//SuppressHole