diff --git a/src/DlgRef/UIFiles/DlgRef_Skeleton_QTD.ui b/src/DlgRef/UIFiles/DlgRef_Skeleton_QTD.ui
index 0c6e57718..eed5c27f4 100644
--- a/src/DlgRef/UIFiles/DlgRef_Skeleton_QTD.ui
+++ b/src/DlgRef/UIFiles/DlgRef_Skeleton_QTD.ui
@@ -8,8 +8,8 @@
0
0
- 307
- 147
+ 321
+ 295
@@ -51,6 +51,22 @@
6
+
+ GroupMedium
+
+
+
+ 7
+ 7
+ 0
+ 0
+
+
+
+
+
+
+
GroupButtons
@@ -203,19 +219,51 @@
- GroupMedium
-
-
-
- 7
- 7
- 0
- 0
-
+ GroupBoxName
-
+ Result name
+
+
+ unnamed
+
+
+ 11
+
+
+ 6
+
+
+
+ Layout66
+
+
+
+ unnamed
+
+
+ 0
+
+
+ 6
+
+
+
+ ResultName
+
+
+
+
+ NameLabel
+
+
+ Name
+
+
+
+
+
diff --git a/src/EntityGUI/EntityGUI.cxx b/src/EntityGUI/EntityGUI.cxx
index f83cec33c..049b4fe00 100644
--- a/src/EntityGUI/EntityGUI.cxx
+++ b/src/EntityGUI/EntityGUI.cxx
@@ -26,7 +26,6 @@
// Module : GEOM
// $Header:
-using namespace std;
#include "EntityGUI.h"
#include "QAD_RightFrame.h"
@@ -36,18 +35,18 @@ using namespace std;
#include "SALOMEGUI_ImportOperation.h"
#include "SALOMEGUI_QtCatchCorbaException.hxx"
-#include
-#include
#include
-#include
#include
-#include
#include
-#include
-#include
#include "DisplayGUI.h"
-#include "EntityGUI_SubShapeDlg.h" // Method SUBSHAPE
+
+#include "EntityGUI_SketcherDlg.h" // Sketcher
+#include "EntityGUI_SubShapeDlg.h" // Method SUBSHAPE
+
+#include "utilities.h"
+
+using namespace std;
//=======================================================================
// function : EntityGUI()
@@ -59,6 +58,9 @@ EntityGUI::EntityGUI() :
myGeomBase = new GEOMBase();
myGeomGUI = GEOMContext::GetGeomGUI();
myGeom = myGeomGUI->myComponentGeom;
+
+ mySimulationShape1 = new AIS_Shape(TopoDS_Shape());
+ mySimulationShape2 = new AIS_Shape(TopoDS_Shape());
}
@@ -81,126 +83,12 @@ bool EntityGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
myEntityGUI->myGeomGUI->EmitSignalDeactivateDialog();
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
- QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
-
switch (theCommandID)
{
case 404: // SKETCHER
{
((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->onViewTop(); // DCQ : 28/02/2002
-
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
-
- myEntityGUI->myGeomGUI->GetSketcher() = Sketch(v3d->getViewer3d());
- myEntityGUI->myGeomGUI->myState = 2;
-
- Mb->setItemChecked(4052, false);
- Mb->setItemChecked(4053, false);
-
- myEntityGUI->myGeomGUI->GetSketcher().SetParameterVisibility(LENGTH_PARAMETER, Mb->isItemChecked(4061));
- myEntityGUI->myGeomGUI->GetSketcher().SetParameterVisibility(ANGLE_PARAMETER, Mb->isItemChecked(4062));
- myEntityGUI->myGeomGUI->GetSketcher().SetParameterVisibility(RADIUS_PARAMETER, Mb->isItemChecked(4063));
- myEntityGUI->myGeomGUI->GetSketcher().SetParameterVisibility(XVALUE_PARAMETER, Mb->isItemChecked(4064));
- myEntityGUI->myGeomGUI->GetSketcher().SetParameterVisibility(YVALUE_PARAMETER, Mb->isItemChecked(4065));
-
- myEntityGUI->myGeomGUI->GetSketcher().SetTransitionStatus(NOCONSTRAINT);
- break;
- }
- case 4041: // SKETCH Segment
- {
- myEntityGUI->myGeomGUI->GetSketcher().ChangeMode(SEGMENT);
- break;
- }
- case 4042: // SKETCH Arc
- {
- myEntityGUI->myGeomGUI->GetSketcher().ChangeMode(ARC_CHORD);
- break;
- }
- case 4043: // SKETCH Set Angle
- {
- myEntityGUI->OnSketchSetAngle();
- break;
- }
- case 4044: // SKETCH Set X
- {
- myEntityGUI->OnSketchSetx();
- break;
- }
- case 4045: // SKETCH Set Y
- {
- myEntityGUI->OnSketchSety();
- break;
- }
- case 4046: // SKETCH Delete
- {
- myEntityGUI->OnSketchDelete();
- break;
- }
- case 4047: // SKETCH End
- {
- myEntityGUI->OnSketchEnd();
- break;
- }
- case 4048: // SKETCH Close
- {
- myEntityGUI->OnSketchClose();
- break;
- }
- case 4051: // sketcher Set Plane
- {
- //TO DO
- break;
- }
- case 4052: // sketcher TANGENT
- {
- Mb->setItemChecked(theCommandID, !Mb->isItemChecked(theCommandID));
- if(Mb->isItemChecked(theCommandID) == true)
- myEntityGUI->myGeomGUI->GetSketcher().SetTransitionStatus(TANGENT);
- else
- myEntityGUI->myGeomGUI->GetSketcher().SetTransitionStatus(NOCONSTRAINT);
-
- Mb->setItemChecked(4053, false);
- break;
- }
- case 4053: // sketcher PERPENDICULAR
- {
- Mb->setItemChecked(theCommandID, !Mb->isItemChecked(theCommandID));
- if(Mb->isItemChecked(theCommandID) == true)
- myEntityGUI->myGeomGUI->GetSketcher().SetTransitionStatus(PERPENDICULAR);
- else
- myEntityGUI->myGeomGUI->GetSketcher().SetTransitionStatus(NOCONSTRAINT);
-
- Mb->setItemChecked(4052, false);
- break;
- }
- case 4061: // SKETCH OptionsOnofflengthdimension
- {
- Mb->setItemChecked(theCommandID, !Mb->isItemChecked(theCommandID));
- myEntityGUI->myGeomGUI->GetSketcher().SetParameterVisibility(LENGTH_PARAMETER, Mb->isItemChecked(theCommandID));
- break;
- }
- case 4062: // SKETCH OptionsOnoffangledimension
- {
- Mb->setItemChecked(theCommandID, !Mb->isItemChecked(theCommandID));
- myEntityGUI->myGeomGUI->GetSketcher().SetParameterVisibility(ANGLE_PARAMETER, Mb->isItemChecked(theCommandID));
- break;
- }
- case 4063: // SKETCH OptionsOnoffradiusdimension
- {
- Mb->setItemChecked(theCommandID, !Mb->isItemChecked(theCommandID));
- myEntityGUI->myGeomGUI->GetSketcher().SetParameterVisibility(RADIUS_PARAMETER, Mb->isItemChecked(theCommandID));
- break;
- }
- case 4064: // SKETCH OptionsOnoffxdimension
- {
- Mb->setItemChecked(theCommandID, !Mb->isItemChecked(theCommandID));
- myEntityGUI->myGeomGUI->GetSketcher().SetParameterVisibility(XVALUE_PARAMETER, Mb->isItemChecked(theCommandID));
- break;
- }
- case 4065: // SKETCH OptionsOnoffydimension
- {
- Mb->setItemChecked(theCommandID, !Mb->isItemChecked(theCommandID));
- myEntityGUI->myGeomGUI->GetSketcher().SetParameterVisibility(YVALUE_PARAMETER, Mb->isItemChecked(theCommandID));
+ EntityGUI_SketcherDlg* aDlg = new EntityGUI_SketcherDlg(parent, "", myEntityGUI, Sel);
break;
}
case 407: // EXPLODE : use ic
@@ -223,258 +111,101 @@ bool EntityGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
}
-//=======================================================================
-// function : OnSketchSetAngle()
-// purpose :
-//=======================================================================
-void EntityGUI::OnSketchSetAngle()
-{
- Standard_Real anAngle = myGeomGUI->GetSketcher().GetSegmentAngle()/PI180;
- Sketch::fitInResol(anAngle);
- Standard_Boolean res = false;
- QString Value = QString("%1").arg(anAngle);
- anAngle = myGeomBase->Parameter(res, Value, tr("GEOM_MEN_ANGLE"), tr("GEOM_MEN_ENTER_ANGLE"),
- -180.0, +180.0, 6) * PI180;
-
- if(res) {
- myGeomGUI->GetSketcher().SetSegmentAngle(anAngle);
- QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
- Mb->setItemChecked(4052, false);
- Mb->setItemChecked(4053, false);
- }
- return;
-}
-
-
-//=======================================================================
-// function : OnSketchSetx()
-// purpose :
-//=======================================================================
-void EntityGUI::OnSketchSetx()
-{
- Standard_Boolean res = false;
- double X = myGeomBase->Parameter(res, "0.", tr("GEOM_MEN_X"), tr("GEOM_MEN_SKETCHER_X"),
- 2.0 * Precision::Confusion(), 1E6, 6);
- if(res)
- myGeomGUI->GetSketcher().SetXDimension(X);
- QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
- Mb->setItemChecked(4052, false);
- Mb->setItemChecked(4053, false);
- return;
-}
-
-
-//=======================================================================
-// function : OnSketchSety()
-// purpose :
-//=======================================================================
-void EntityGUI::OnSketchSety()
-{
- Standard_Boolean res = false;
- double Y = myGeomBase->Parameter(res, "0.", tr("GEOM_MEN_Y"), tr("GEOM_MEN_SKETCHER_Y"), 2.0 * Precision::Confusion(), 1E6, 6);
- if(res)
- myGeomGUI->GetSketcher().SetYDimension(Y);
- QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
- Mb->setItemChecked(4052, false);
- Mb->setItemChecked(4053, false);
- return;
-}
-
-
-//=======================================================================
-// function : OnSketchDelete()
-// purpose :
-//=======================================================================
-void EntityGUI::OnSketchDelete()
-{
- if(myGeomGUI->GetSketcher().GetmyEdgesNumber() == 1) {
- QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
- Mb->setItemEnabled(405, false); // SKETCH CONTRAINTS
- myGeomGUI->GetSketcher().SetTransitionStatus(NOCONSTRAINT);
- }
-
- if(myGeomGUI->GetSketcher().Delete())
- myGeomGUI->myState = -1;
- return;
-}
-
-
-//=======================================================================
-// function : OnSketchClose()
-// purpose :
-//=======================================================================
-void EntityGUI::OnSketchClose()
-{
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
- Handle(AIS_InteractiveContext) myContext = v3d->getAISContext();
-
- TopoDS_Wire W = myGeomGUI->GetSketcher().Close();
- if(!W.IsNull()) {
- GEOM::GEOM_Gen::ListOfIOR_var listShapes = new GEOM::GEOM_Gen::ListOfIOR;
- listShapes->length(0);
- unsigned int i = 0;
-
- BRepTools_WireExplorer Ex(W);
- while(Ex.More()) {
- TopoDS_Edge E = Ex.Current();
- gp_Pnt pt1, pt2;
-
- pt1 = BRep_Tool::Pnt(TopExp::FirstVertex(E));
- pt2 = BRep_Tool::Pnt(TopExp::LastVertex(E));
-
- gp_Pnt CenterPoint;
- Handle(Geom_Curve) Curve;
- Handle(Geom_Circle) Circle;
- gp_Circ Circ;
- Standard_Real First,Last;
-
- Curve = BRep_Tool::Curve(E,First,Last);
- if(Curve->IsKind(STANDARD_TYPE(Geom_Circle))) {
- Circle = Handle(Geom_Circle)::DownCast(Curve); // pointer on geom_circ
- Circ = Circle->Circ(); // gp_Circ
-
- Curve->D0((First + Last) / 2., CenterPoint);
-
- GEOM::PointStruct pI = myGeom->MakePointStruct(pt1.X(), pt1.Y(), pt1.Z());
- GEOM::PointStruct pC = myGeom->MakePointStruct(CenterPoint.X(), CenterPoint.Y(), CenterPoint.Z());
- GEOM::PointStruct pE = myGeom->MakePointStruct(pt2.X(), pt2.Y(), pt2.Z());
-
- GEOM::GEOM_Shape_var arc;
-
- try {
- arc = myGeom->MakeArc(pI, pC, pE);
- }
- catch (const SALOME::SALOME_Exception& S_ex) {
- QtCatchCorbaException(S_ex);
- }
-
- listShapes->length(i+1);
- listShapes[i] = strdup(arc->Name());
- i++;
- }
- else {
- GEOM::PointStruct pI = myGeom->MakePointStruct(pt1.X(), pt1.Y(), pt1.Z());
- GEOM::PointStruct pE = myGeom->MakePointStruct(pt2.X(), pt2.Y(), pt2.Z());
- GEOM::GEOM_Shape_var segment;
-
- try {
- segment = myGeom->MakeEdge(pI,pE);
- }
- catch (const SALOME::SALOME_Exception& S_ex) {
- QtCatchCorbaException(S_ex);
- }
-
- listShapes->length(i+1);
- listShapes[i] = strdup(segment->Name());
- i++;
- }
- Ex.Next();
- }
- GEOM::GEOM_Shape_var Wire = myGeom->MakeWire(listShapes);
- TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, Wire);
- Standard_CString type;
- myGeomBase->GetShapeTypeString(S,type);
- Wire->NameType(type);
-
- if(myGeomBase->Display(Wire))
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
- }
- myGeomGUI->myState = -1;
- QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
- Mb->setItemEnabled(405, false); // SKETCH CONTRAINTS
- myGeomGUI->GetSketcher().SetTransitionStatus(NOCONSTRAINT);
- return;
-}
-
-
//=======================================================================
// function : OnSketchEnd()
// purpose :
//=======================================================================
-void EntityGUI::OnSketchEnd()
+void EntityGUI::OnSketchEnd(const char *Cmd)
{
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
- Handle (AIS_InteractiveContext) myContext = v3d->getAISContext();
-
- TopoDS_Wire W = myGeomGUI->GetSketcher().End();
- if(!W.IsNull()) {
- GEOM::GEOM_Gen::ListOfIOR_var listShapes = new GEOM::GEOM_Gen::ListOfIOR;
- listShapes->length(0);
- unsigned int i = 0;
-
- BRepTools_WireExplorer Ex(W);
- while(Ex.More()) {
- TopoDS_Edge E = TopoDS::Edge(Ex.Current());
-
- gp_Pnt pt1, pt2;
- pt1 = BRep_Tool::Pnt(TopExp::FirstVertex(E));
- pt2 = BRep_Tool::Pnt(TopExp::LastVertex(E));
-
- gp_Pnt CenterPoint;
- Handle(Geom_Curve) Curve;
- Handle(Geom_Circle) Circle;
- gp_Circ Circ;
- Standard_Real First,Last;
-
- Curve = BRep_Tool::Curve(E,First,Last);
- if(Curve->IsKind(STANDARD_TYPE(Geom_Circle))) {
- Circle = Handle(Geom_Circle)::DownCast(Curve); // pointer on geom_circ
- Circ = Circle->Circ(); // gp_Circ
-
- Curve->D0((First + Last) / 2., CenterPoint);
-
- GEOM::PointStruct pI = myGeom->MakePointStruct(pt1.X(), pt1.Y(), pt1.Z());
- GEOM::PointStruct pC = myGeom->MakePointStruct(CenterPoint.X(), CenterPoint.Y(), CenterPoint.Z());
- GEOM::PointStruct pE = myGeom->MakePointStruct(pt2.X(), pt2.Y(), pt2.Z());
-
- GEOM::GEOM_Shape_var arc;
-
- try {
- arc = myGeom->MakeArc(pI, pC, pE);
- }
- catch (const SALOME::SALOME_Exception& S_ex) {
- QtCatchCorbaException(S_ex);
- }
-
- listShapes->length(i+1);
- listShapes[i] = strdup(arc->Name());
- i++;
- } else {
- GEOM::PointStruct pI = myGeom->MakePointStruct(pt1.X(), pt1.Y(), pt1.Z());
- GEOM::PointStruct pE = myGeom->MakePointStruct(pt2.X(), pt2.Y(), pt2.Z());
- GEOM::GEOM_Shape_var segment;
-
- try {
- segment = myGeom->MakeEdge(pI,pE);
- }
- catch (const SALOME::SALOME_Exception& S_ex) {
- QtCatchCorbaException(S_ex);
- }
-
- listShapes->length(i+1);
- listShapes[i] = strdup(segment->Name());
- i++;
- }
- Ex.Next();
+ try {
+ GEOM::GEOM_Shape_var result = myGeom->MakeSketcher(Cmd);
+ if(result->_is_nil()) {
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
+ return;
}
-
- GEOM::GEOM_Shape_var Wire = myGeom->MakeWire(listShapes);
- TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, Wire);
- Standard_CString type;
- myGeomBase->GetShapeTypeString(S,type);
- Wire->NameType(type);
-
- if(myGeomBase->Display(Wire))
+ result->NameType(tr("GEOM_WIRE"));
+ if(myGeomBase->Display(result))
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
}
- myGeomGUI->myState = -1;
- QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
- Mb->setItemEnabled(405, false); // SKETCH CONTRAINTS
- myGeomGUI->GetSketcher().SetTransitionStatus(NOCONSTRAINT);
+ catch(const SALOME::SALOME_Exception& S_ex) {
+ QtCatchCorbaException(S_ex);
+ }
return;
}
+//=====================================================================================
+// function : DisplaySimulationShape()
+// purpose : Displays 'this->mySimulationShape' a pure graphical shape from a TopoDS_Shape
+//=====================================================================================
+void EntityGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2)
+{
+ //NRI DEBUG : 14/02/2002
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ return;
+
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
+ try {
+ if(!S1.IsNull()) {
+ /* erase any previous */
+ ic->Erase(mySimulationShape1, Standard_True, Standard_False);
+ ic->ClearPrs(mySimulationShape1);
+
+ mySimulationShape1 = new AIS_Shape(TopoDS_Shape());
+ mySimulationShape1->Set(S1);
+ mySimulationShape1->SetColor(Quantity_NOC_RED);
+
+ ic->Deactivate(mySimulationShape1);
+ ic->Display(mySimulationShape1, Standard_False);
+ mySimulationShape1->UnsetColor();
+ }
+ if(!S2.IsNull()) {
+ ic->Erase(mySimulationShape2, Standard_True, Standard_False);
+ ic->ClearPrs(mySimulationShape2);
+
+ mySimulationShape2 = new AIS_Shape(TopoDS_Shape());
+ mySimulationShape2->Set(S2);
+ mySimulationShape2->SetColor(Quantity_NOC_VIOLET);
+
+ ic->Deactivate(mySimulationShape2);
+ ic->Display(mySimulationShape2, Standard_False);
+ mySimulationShape2->UnsetColor();
+ }
+ ic->UpdateCurrentViewer();
+ }
+ catch(Standard_Failure) {
+ MESSAGE("Exception catched in EntityGUI::DisplaySimulationShape ");
+ }
+ return;
+}
+
+
+//==================================================================================
+// function : EraseSimulationShape()
+// purpose : Clears the display of 'mySimulationShape' a pure graphical shape
+//==================================================================================
+void EntityGUI::EraseSimulationShape(int Sh)
+{
+ int count = QAD_Application::getDesktop()->getActiveStudy()->getStudyFramesCount();
+ for(int i = 0; i < count; i++) {
+ if(QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i)->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i)->getRightFrame()->getViewFrame())->getViewer();
+ Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
+ if(Sh < 1) {
+ ic->Erase(mySimulationShape1, Standard_True, Standard_False);
+ ic->ClearPrs(mySimulationShape1);
+ }
+ if(Sh <= 1) {
+ ic->Erase(mySimulationShape2, Standard_True, Standard_False);
+ ic->ClearPrs(mySimulationShape2);
+ }
+ ic->UpdateCurrentViewer();
+ }
+ }
+}
+
+
//=====================================================================================
// function : SObjectExist()
// purpose :
diff --git a/src/EntityGUI/EntityGUI.h b/src/EntityGUI/EntityGUI.h
index 863e310ed..9ecb56744 100644
--- a/src/EntityGUI/EntityGUI.h
+++ b/src/EntityGUI/EntityGUI.h
@@ -45,14 +45,10 @@ public :
static bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
- /* Sketcher management */
- void OnSketchSetAngle();
- void OnSketchSetx();
- void OnSketchSety();
-
- void OnSketchDelete();
- void OnSketchClose();
- void OnSketchEnd();
+ void OnSketchEnd(const char *Cmd);
+
+ void DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2);
+ void EraseSimulationShape(int Sh = 0);
/* Methods for sub shapes explode */
bool SObjectExist(SALOMEDS::SObject_ptr theFatherObject, const char* IOR);
@@ -60,6 +56,10 @@ public :
bool OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType,
Standard_Integer& aLocalContextId, bool& myUseLocalContext);
+ /* AIS shape used only during topo/geom simulations */
+ Handle(AIS_Shape) mySimulationShape1;
+ Handle(AIS_Shape) mySimulationShape2;
+
GEOMBase* myGeomBase;
GEOMContext* myGeomGUI;
GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */
diff --git a/src/EntityGUI/EntityGUI_1Sel_QTD.cxx b/src/EntityGUI/EntityGUI_1Sel_QTD.cxx
new file mode 100644
index 000000000..01584de8f
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_1Sel_QTD.cxx
@@ -0,0 +1,94 @@
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_1Sel_QTD.ui'
+**
+** Created: Fri Apr 30 11:23:36 2004
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_1Sel_QTD.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/*
+ * Constructs a EntityGUI_1Sel_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_1Sel_QTD::EntityGUI_1Sel_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_1Sel_QTD" );
+ resize( 245, 110 );
+ setCaption( trUtf8( "EntityGUI_1Sel_QTD" ) );
+ EntityGUI_1Sel_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_1Sel_QTDLayout");
+
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setTitle( trUtf8( "Values" ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+ Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3");
+
+ Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
+
+ buttonUndo = new QPushButton( GroupBox1, "buttonUndo" );
+ buttonUndo->setText( trUtf8( "Undo" ) );
+
+ Layout2->addWidget( buttonUndo, 1, 0 );
+
+ buttonApply = new QPushButton( GroupBox1, "buttonApply" );
+ buttonApply->setText( trUtf8( "Create" ) );
+
+ Layout2->addWidget( buttonApply, 0, 0 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout2->addItem( spacer, 2, 0 );
+
+ Layout3->addLayout( Layout2, 0, 1 );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
+
+ Layout1->addWidget( TextLabel1, 0, 0 );
+ QSpacerItem* spacer_2 = new QSpacerItem( 0, 180, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer_2, 1, 2 );
+
+ PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
+ PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
+ PushButton1->setText( trUtf8( "" ) );
+
+ Layout1->addWidget( PushButton1, 0, 1 );
+
+ LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
+ LineEdit1->setFocusPolicy( QLineEdit::NoFocus );
+
+ Layout1->addWidget( LineEdit1, 0, 2 );
+
+ Layout3->addLayout( Layout1, 0, 0 );
+
+ GroupBox1Layout->addLayout( Layout3, 0, 0 );
+
+ EntityGUI_1Sel_QTDLayout->addWidget( GroupBox1, 0, 0 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_1Sel_QTD::~EntityGUI_1Sel_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
diff --git a/src/EntityGUI/EntityGUI_1Sel_QTD.h b/src/EntityGUI/EntityGUI_1Sel_QTD.h
new file mode 100644
index 000000000..915cda9c4
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_1Sel_QTD.h
@@ -0,0 +1,46 @@
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_1Sel_QTD.ui'
+**
+** Created: Fri Apr 30 11:23:32 2004
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_1SEL_QTD_H
+#define ENTITYGUI_1SEL_QTD_H
+
+#include
+#include
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QGroupBox;
+class QLabel;
+class QLineEdit;
+class QPushButton;
+
+class EntityGUI_1Sel_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_1Sel_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_1Sel_QTD();
+
+ QGroupBox* GroupBox1;
+ QPushButton* buttonUndo;
+ QPushButton* buttonApply;
+ QLabel* TextLabel1;
+ QPushButton* PushButton1;
+ QLineEdit* LineEdit1;
+
+
+protected:
+ QGridLayout* EntityGUI_1Sel_QTDLayout;
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* Layout3;
+ QGridLayout* Layout2;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_1SEL_QTD_H
diff --git a/src/KinematicGUI/KinematicGUI_3Sel1Spin.cxx b/src/EntityGUI/EntityGUI_1Spin.cxx
similarity index 78%
rename from src/KinematicGUI/KinematicGUI_3Sel1Spin.cxx
rename to src/EntityGUI/EntityGUI_1Spin.cxx
index b4e46acd9..131a45500 100644
--- a/src/KinematicGUI/KinematicGUI_3Sel1Spin.cxx
+++ b/src/EntityGUI/EntityGUI_1Spin.cxx
@@ -21,34 +21,36 @@
//
//
//
-// File : KinematicGUI_3Sel1Spin.cxx
+// File : EntityGUI_1Spin.cxx
// Author : Damien COQUERET
// Module : GEOM
// $Header:
-#include "KinematicGUI_3Sel1Spin.h"
+#include "EntityGUI_1Spin.h"
#include
#include
#include
/*
- * Constructs a KinematicGUI_3Sel1Spin which is a child of 'parent', with the
+ * Constructs a EntityGUI_1Spin which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'
*/
-KinematicGUI_3Sel1Spin::KinematicGUI_3Sel1Spin(QWidget* parent, const char* name, WFlags fl)
- :KinematicGUI_3Sel1Spin_QTD(parent, name, fl)
+EntityGUI_1Spin::EntityGUI_1Spin(QWidget* parent, const char* name, WFlags fl)
+ :EntityGUI_1Spin_QTD(parent, name, fl)
{
SpinBox1->close(TRUE);
+
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
- Layout2->addWidget(SpinBox_DX, 0, 1);
+ Layout1->addWidget(SpinBox_DX, 0, 1);
+
}
/*
* Destroys the object and frees any allocated resources
*/
-KinematicGUI_3Sel1Spin::~KinematicGUI_3Sel1Spin()
+EntityGUI_1Spin::~EntityGUI_1Spin()
{
// no need to delete child widgets, Qt does it all for us
}
diff --git a/src/KinematicGUI/KinematicGUI_3Sel1Spin.h b/src/EntityGUI/EntityGUI_1Spin.h
similarity index 75%
rename from src/KinematicGUI/KinematicGUI_3Sel1Spin.h
rename to src/EntityGUI/EntityGUI_1Spin.h
index 143274ed2..fb5814ca2 100644
--- a/src/KinematicGUI/KinematicGUI_3Sel1Spin.h
+++ b/src/EntityGUI/EntityGUI_1Spin.h
@@ -21,27 +21,27 @@
//
//
//
-// File : KinematicGUI_3Sel1Spin.h
+// File : EntityGUI_1Spin.h
// Author : Damien COQUERET
// Module : GEOM
// $Header:
-#ifndef KINEMATICGUI_3SEL1SPIN_H
-#define KINEMATICGUI_3SEL1SPIN_H
+#ifndef ENTITYGUI_1SPIN_H
+#define ENTITYGUI_1SPIN_H
-#include "KinematicGUI_3Sel1Spin_QTD.h"
+#include "EntityGUI_1Spin_QTD.h"
#include "DlgRef_SpinBox.h"
-class KinematicGUI_3Sel1Spin : public KinematicGUI_3Sel1Spin_QTD
+class EntityGUI_1Spin : public EntityGUI_1Spin_QTD
{
Q_OBJECT
public:
- KinematicGUI_3Sel1Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
- ~KinematicGUI_3Sel1Spin();
+ EntityGUI_1Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
+ ~EntityGUI_1Spin();
DlgRef_SpinBox* SpinBox_DX;
};
-#endif // KINEMATICGUI_3SEL1SPIN_H
+#endif // ENTITYGUI_1SPIN_H
diff --git a/src/EntityGUI/EntityGUI_1Spin_QTD.cxx b/src/EntityGUI/EntityGUI_1Spin_QTD.cxx
new file mode 100644
index 000000000..20f21d295
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_1Spin_QTD.cxx
@@ -0,0 +1,88 @@
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_1Spin_QTD.ui'
+**
+** Created: ven déc 12 11:17:10 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_1Spin_QTD.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/*
+ * Constructs a EntityGUI_1Spin_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_1Spin_QTD::EntityGUI_1Spin_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_1Spin_QTD" );
+ resize( 154, 96 );
+ setCaption( trUtf8( "EntityGUI_1Spin_QTD" ) );
+ EntityGUI_1Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_1Spin_QTDLayout");
+
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setTitle( trUtf8( "Values" ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+ Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3");
+
+ Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
+
+ buttonUndo = new QPushButton( GroupBox1, "buttonUndo" );
+ buttonUndo->setText( trUtf8( "Undo" ) );
+
+ Layout2->addWidget( buttonUndo, 1, 0 );
+
+ buttonApply = new QPushButton( GroupBox1, "buttonApply" );
+ buttonApply->setText( trUtf8( "Create" ) );
+
+ Layout2->addWidget( buttonApply, 0, 0 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout2->addItem( spacer, 2, 0 );
+
+ Layout3->addLayout( Layout2, 0, 1 );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
+
+ Layout1->addWidget( TextLabel1, 0, 0 );
+
+ SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
+ SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox1, 0, 1 );
+ QSpacerItem* spacer_2 = new QSpacerItem( 0, 82, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer_2, 3, 1 );
+
+ Layout3->addLayout( Layout1, 0, 0 );
+
+ GroupBox1Layout->addLayout( Layout3, 0, 0 );
+
+ EntityGUI_1Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_1Spin_QTD::~EntityGUI_1Spin_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
diff --git a/src/EntityGUI/EntityGUI_1Spin_QTD.h b/src/EntityGUI/EntityGUI_1Spin_QTD.h
new file mode 100644
index 000000000..b44238263
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_1Spin_QTD.h
@@ -0,0 +1,45 @@
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_1Spin_QTD.ui'
+**
+** Created: ven déc 12 11:17:10 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_1SPIN_QTD_H
+#define ENTITYGUI_1SPIN_QTD_H
+
+#include
+#include
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QGroupBox;
+class QLabel;
+class QPushButton;
+class QSpinBox;
+
+class EntityGUI_1Spin_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_1Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_1Spin_QTD();
+
+ QGroupBox* GroupBox1;
+ QPushButton* buttonUndo;
+ QPushButton* buttonApply;
+ QLabel* TextLabel1;
+ QSpinBox* SpinBox1;
+
+
+protected:
+ QGridLayout* EntityGUI_1Spin_QTDLayout;
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* Layout3;
+ QGridLayout* Layout2;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_1SPIN_QTD_H
diff --git a/src/EntityGUI/EntityGUI_2Spin.cxx b/src/EntityGUI/EntityGUI_2Spin.cxx
new file mode 100644
index 000000000..b71d731ae
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_2Spin.cxx
@@ -0,0 +1,60 @@
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_2Spin.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#include "EntityGUI_2Spin.h"
+
+#include
+#include
+#include
+
+/*
+ * Constructs a EntityGUI_2Spin which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+EntityGUI_2Spin::EntityGUI_2Spin(QWidget* parent, const char* name, WFlags fl)
+ :EntityGUI_2Spin_QTD(parent, name, fl)
+{
+ SpinBox1->close(TRUE);
+ SpinBox2->close(TRUE);
+
+ SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
+ Layout1->addWidget(SpinBox_DX, 0, 1);
+
+ SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY");
+ Layout1->addWidget(SpinBox_DY, 1, 1);
+
+}
+
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_2Spin::~EntityGUI_2Spin()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
diff --git a/src/EntityGUI/EntityGUI_2Spin.h b/src/EntityGUI/EntityGUI_2Spin.h
new file mode 100644
index 000000000..4d0dd21a3
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_2Spin.h
@@ -0,0 +1,48 @@
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_2Spin.h
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef ENTITYGUI_2SPIN_H
+#define ENTITYGUI_2SPIN_H
+
+#include "EntityGUI_2Spin_QTD.h"
+#include "DlgRef_SpinBox.h"
+
+class EntityGUI_2Spin : public EntityGUI_2Spin_QTD
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_2Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
+ ~EntityGUI_2Spin();
+
+ DlgRef_SpinBox* SpinBox_DX;
+ DlgRef_SpinBox* SpinBox_DY;
+
+};
+
+#endif // ENTITYGUI_2SPIN_H
diff --git a/src/EntityGUI/EntityGUI_2Spin_QTD.cxx b/src/EntityGUI/EntityGUI_2Spin_QTD.cxx
new file mode 100644
index 000000000..a01f2a783
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_2Spin_QTD.cxx
@@ -0,0 +1,99 @@
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_2Spin_QTD.ui'
+**
+** Created: ven déc 12 11:17:11 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_2Spin_QTD.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/*
+ * Constructs a EntityGUI_2Spin_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_2Spin_QTD::EntityGUI_2Spin_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_2Spin_QTD" );
+ resize( 154, 96 );
+ setCaption( trUtf8( "EntityGUI_2Spin_QTD" ) );
+ EntityGUI_2Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_2Spin_QTDLayout");
+
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setTitle( trUtf8( "Values" ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+ Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3");
+
+ Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
+
+ buttonUndo = new QPushButton( GroupBox1, "buttonUndo" );
+ buttonUndo->setText( trUtf8( "Undo" ) );
+
+ Layout2->addWidget( buttonUndo, 1, 0 );
+
+ buttonApply = new QPushButton( GroupBox1, "buttonApply" );
+ buttonApply->setText( trUtf8( "Create" ) );
+
+ Layout2->addWidget( buttonApply, 0, 0 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout2->addItem( spacer, 2, 0 );
+
+ Layout3->addLayout( Layout2, 0, 1 );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
+ TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
+ TextLabel2->setText( trUtf8( "TL2" ) );
+
+ Layout1->addWidget( TextLabel2, 1, 0 );
+
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
+
+ Layout1->addWidget( TextLabel1, 0, 0 );
+
+ SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
+ SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox1, 0, 1 );
+
+ SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
+ SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox2, 1, 1 );
+ QSpacerItem* spacer_2 = new QSpacerItem( 0, 82, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer_2, 3, 1 );
+
+ Layout3->addLayout( Layout1, 0, 0 );
+
+ GroupBox1Layout->addLayout( Layout3, 0, 0 );
+
+ EntityGUI_2Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_2Spin_QTD::~EntityGUI_2Spin_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
diff --git a/src/EntityGUI/EntityGUI_2Spin_QTD.h b/src/EntityGUI/EntityGUI_2Spin_QTD.h
new file mode 100644
index 000000000..4827aa86c
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_2Spin_QTD.h
@@ -0,0 +1,47 @@
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_2Spin_QTD.ui'
+**
+** Created: ven déc 12 11:17:10 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_2SPIN_QTD_H
+#define ENTITYGUI_2SPIN_QTD_H
+
+#include
+#include
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QGroupBox;
+class QLabel;
+class QPushButton;
+class QSpinBox;
+
+class EntityGUI_2Spin_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_2Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_2Spin_QTD();
+
+ QGroupBox* GroupBox1;
+ QPushButton* buttonUndo;
+ QPushButton* buttonApply;
+ QLabel* TextLabel2;
+ QLabel* TextLabel1;
+ QSpinBox* SpinBox1;
+ QSpinBox* SpinBox2;
+
+
+protected:
+ QGridLayout* EntityGUI_2Spin_QTDLayout;
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* Layout3;
+ QGridLayout* Layout2;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_2SPIN_QTD_H
diff --git a/src/KinematicGUI/KinematicGUI_3List3Spin.cxx b/src/EntityGUI/EntityGUI_3Spin.cxx
similarity index 76%
rename from src/KinematicGUI/KinematicGUI_3List3Spin.cxx
rename to src/EntityGUI/EntityGUI_3Spin.cxx
index 7cbc46c3f..fe73aeba5 100644
--- a/src/KinematicGUI/KinematicGUI_3List3Spin.cxx
+++ b/src/EntityGUI/EntityGUI_3Spin.cxx
@@ -21,40 +21,43 @@
//
//
//
-// File : KinematicGUI_3List3Spin.cxx
+// File : EntityGUI_3Spin.cxx
// Author : Damien COQUERET
// Module : GEOM
// $Header:
-#include "KinematicGUI_3List3Spin.h"
+#include "EntityGUI_3Spin.h"
#include
#include
#include
/*
- * Constructs a KinematicGUI_3List3Spin which is a child of 'parent', with the
+ * Constructs a EntityGUI_3Spin which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'
*/
-KinematicGUI_3List3Spin::KinematicGUI_3List3Spin(QWidget* parent, const char* name, WFlags fl)
- :KinematicGUI_3List3Spin_QTD(parent, name, fl)
+EntityGUI_3Spin::EntityGUI_3Spin(QWidget* parent, const char* name, WFlags fl)
+ :EntityGUI_3Spin_QTD(parent, name, fl)
{
SpinBox1->close(TRUE);
SpinBox2->close(TRUE);
SpinBox3->close(TRUE);
+
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
+ Layout1->addWidget(SpinBox_DX, 0, 1);
+
SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY");
+ Layout1->addWidget(SpinBox_DY, 1, 1);
+
SpinBox_DZ = new DlgRef_SpinBox(GroupBox1, "SpinBox_DZ");
- Layout1->addWidget(SpinBox_DX, 0, 3);
- Layout1->addWidget(SpinBox_DY, 1, 3);
- Layout1->addWidget(SpinBox_DZ, 2, 3);
+ Layout1->addWidget(SpinBox_DZ, 2, 1);
}
/*
* Destroys the object and frees any allocated resources
*/
-KinematicGUI_3List3Spin::~KinematicGUI_3List3Spin()
+EntityGUI_3Spin::~EntityGUI_3Spin()
{
// no need to delete child widgets, Qt does it all for us
}
diff --git a/src/KinematicGUI/KinematicGUI_3List3Spin.h b/src/EntityGUI/EntityGUI_3Spin.h
similarity index 76%
rename from src/KinematicGUI/KinematicGUI_3List3Spin.h
rename to src/EntityGUI/EntityGUI_3Spin.h
index c1363fafb..58b732d31 100644
--- a/src/KinematicGUI/KinematicGUI_3List3Spin.h
+++ b/src/EntityGUI/EntityGUI_3Spin.h
@@ -21,24 +21,24 @@
//
//
//
-// File : KinematicGUI_3List3Spin.h
+// File : EntityGUI_3Spin.h
// Author : Damien COQUERET
// Module : GEOM
// $Header:
-#ifndef KINEMATICGUI_3LIST3SPIN_H
-#define KINEMATICGUI_3LIST3SPIN_H
+#ifndef ENTITYGUI_3SPIN_H
+#define ENTITYGUI_3SPIN_H
-#include "KinematicGUI_3List3Spin_QTD.h"
+#include "EntityGUI_3Spin_QTD.h"
#include "DlgRef_SpinBox.h"
-class KinematicGUI_3List3Spin : public KinematicGUI_3List3Spin_QTD
+class EntityGUI_3Spin : public EntityGUI_3Spin_QTD
{
Q_OBJECT
public:
- KinematicGUI_3List3Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
- ~KinematicGUI_3List3Spin();
+ EntityGUI_3Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_3Spin();
DlgRef_SpinBox* SpinBox_DX;
DlgRef_SpinBox* SpinBox_DY;
@@ -46,4 +46,4 @@ public:
};
-#endif // KINEMATICGUI_3LIST3SPIN_H
+#endif // ENTITYGUI_3SPIN_H
diff --git a/src/EntityGUI/EntityGUI_3Spin_QTD.cxx b/src/EntityGUI/EntityGUI_3Spin_QTD.cxx
new file mode 100644
index 000000000..8fa505304
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_3Spin_QTD.cxx
@@ -0,0 +1,110 @@
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_3Spin_QTD.ui'
+**
+** Created: ven déc 12 11:17:11 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_3Spin_QTD.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/*
+ * Constructs a EntityGUI_3Spin_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_3Spin_QTD::EntityGUI_3Spin_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_3Spin_QTD" );
+ resize( 154, 120 );
+ setCaption( trUtf8( "EntityGUI_3Spin_QTD" ) );
+ EntityGUI_3Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_3Spin_QTDLayout");
+
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setTitle( trUtf8( "Values" ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+ Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3");
+
+ Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
+
+ buttonUndo = new QPushButton( GroupBox1, "buttonUndo" );
+ buttonUndo->setText( trUtf8( "Undo" ) );
+
+ Layout2->addWidget( buttonUndo, 1, 0 );
+
+ buttonApply = new QPushButton( GroupBox1, "buttonApply" );
+ buttonApply->setText( trUtf8( "Create" ) );
+
+ Layout2->addWidget( buttonApply, 0, 0 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout2->addItem( spacer, 2, 0 );
+
+ Layout3->addLayout( Layout2, 0, 1 );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
+ TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
+ TextLabel2->setText( trUtf8( "TL2" ) );
+
+ Layout1->addWidget( TextLabel2, 1, 0 );
+
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
+
+ Layout1->addWidget( TextLabel1, 0, 0 );
+
+ SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
+ SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox1, 0, 1 );
+
+ SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
+ SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox2, 1, 1 );
+
+ TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
+ TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
+ TextLabel3->setText( trUtf8( "TL3" ) );
+
+ Layout1->addWidget( TextLabel3, 2, 0 );
+ QSpacerItem* spacer_2 = new QSpacerItem( 0, 82, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer_2, 3, 1 );
+
+ SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" );
+ SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox3, 2, 1 );
+
+ Layout3->addLayout( Layout1, 0, 0 );
+
+ GroupBox1Layout->addLayout( Layout3, 0, 0 );
+
+ EntityGUI_3Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_3Spin_QTD::~EntityGUI_3Spin_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
diff --git a/src/KinematicGUI/KinematicGUI_3Sel1Spin_QTD.h b/src/EntityGUI/EntityGUI_3Spin_QTD.h
similarity index 50%
rename from src/KinematicGUI/KinematicGUI_3Sel1Spin_QTD.h
rename to src/EntityGUI/EntityGUI_3Spin_QTD.h
index dac9815e2..1efc3a5c1 100644
--- a/src/KinematicGUI/KinematicGUI_3Sel1Spin_QTD.h
+++ b/src/EntityGUI/EntityGUI_3Spin_QTD.h
@@ -1,13 +1,13 @@
/****************************************************************************
-** Form interface generated from reading ui file 'KinematicGUI_3Sel1Spin_QTD.ui'
+** Form interface generated from reading ui file 'EntityGUI_3Spin_QTD.ui'
**
-** Created: mer fév 4 13:09:40 2004
+** Created: ven déc 12 11:17:11 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
-#ifndef KINEMATICGUI_3SEL1SPIN_QTD_H
-#define KINEMATICGUI_3SEL1SPIN_QTD_H
+#ifndef ENTITYGUI_3SPIN_QTD_H
+#define ENTITYGUI_3SPIN_QTD_H
#include
#include
@@ -16,37 +16,34 @@ class QHBoxLayout;
class QGridLayout;
class QGroupBox;
class QLabel;
-class QLineEdit;
class QPushButton;
class QSpinBox;
-class KinematicGUI_3Sel1Spin_QTD : public QWidget
+class EntityGUI_3Spin_QTD : public QWidget
{
Q_OBJECT
public:
- KinematicGUI_3Sel1Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
- ~KinematicGUI_3Sel1Spin_QTD();
+ EntityGUI_3Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_3Spin_QTD();
QGroupBox* GroupBox1;
- QLineEdit* LineEdit1;
- QPushButton* PushButton3;
- QLabel* TextLabel4;
- QSpinBox* SpinBox1;
- QLabel* TextLabel3;
- QLineEdit* LineEdit3;
- QLineEdit* LineEdit2;
- QPushButton* PushButton2;
+ QPushButton* buttonUndo;
+ QPushButton* buttonApply;
QLabel* TextLabel2;
QLabel* TextLabel1;
- QPushButton* PushButton1;
+ QSpinBox* SpinBox1;
+ QSpinBox* SpinBox2;
+ QLabel* TextLabel3;
+ QSpinBox* SpinBox3;
protected:
- QGridLayout* KinematicGUI_3Sel1Spin_QTDLayout;
+ QGridLayout* EntityGUI_3Spin_QTDLayout;
QGridLayout* GroupBox1Layout;
- QGridLayout* Layout1;
+ QGridLayout* Layout3;
QGridLayout* Layout2;
+ QGridLayout* Layout1;
};
-#endif // KINEMATICGUI_3SEL1SPIN_QTD_H
+#endif // ENTITYGUI_3SPIN_QTD_H
diff --git a/src/EntityGUI/EntityGUI_4Spin.cxx b/src/EntityGUI/EntityGUI_4Spin.cxx
new file mode 100644
index 000000000..29aa398a1
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_4Spin.cxx
@@ -0,0 +1,67 @@
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_4Spin.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#include "EntityGUI_4Spin.h"
+
+#include
+#include
+#include
+
+/*
+ * Constructs a EntityGUI_4Spin which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+EntityGUI_4Spin::EntityGUI_4Spin(QWidget* parent, const char* name, WFlags fl)
+ :EntityGUI_4Spin_QTD(parent, name, fl)
+{
+ SpinBox1->close(TRUE);
+ SpinBox2->close(TRUE);
+ SpinBox3->close(TRUE);
+ SpinBox4->close(TRUE);
+
+ SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
+ Layout1->addWidget(SpinBox_DX, 0, 1);
+
+ SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY");
+ Layout1->addWidget(SpinBox_DY, 1, 1);
+
+ SpinBox_DZ = new DlgRef_SpinBox(GroupBox1, "SpinBox_DZ");
+ Layout1->addWidget(SpinBox_DZ, 2, 1);
+
+ SpinBox_DS = new DlgRef_SpinBox(GroupBox1, "SpinBox_DS");
+ Layout1->addWidget(SpinBox_DS, 3, 1);
+}
+
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_4Spin::~EntityGUI_4Spin()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
diff --git a/src/EntityGUI/EntityGUI_4Spin.h b/src/EntityGUI/EntityGUI_4Spin.h
new file mode 100644
index 000000000..9a97fff1e
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_4Spin.h
@@ -0,0 +1,50 @@
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_4Spin.h
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef ENTITYGUI_4SPIN_H
+#define ENTITYGUI_4SPIN_H
+
+#include "EntityGUI_4Spin_QTD.h"
+#include "DlgRef_SpinBox.h"
+
+class EntityGUI_4Spin : public EntityGUI_4Spin_QTD
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_4Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_4Spin();
+
+ DlgRef_SpinBox* SpinBox_DX;
+ DlgRef_SpinBox* SpinBox_DY;
+ DlgRef_SpinBox* SpinBox_DZ;
+ DlgRef_SpinBox* SpinBox_DS;
+
+};
+
+#endif // ENTITYGUI_4SPIN_H
diff --git a/src/KinematicGUI/KinematicGUI_3List3Spin_QTD.cxx b/src/EntityGUI/EntityGUI_4Spin_QTD.cxx
similarity index 50%
rename from src/KinematicGUI/KinematicGUI_3List3Spin_QTD.cxx
rename to src/EntityGUI/EntityGUI_4Spin_QTD.cxx
index 70b92345e..428da7dfb 100644
--- a/src/KinematicGUI/KinematicGUI_3List3Spin_QTD.cxx
+++ b/src/EntityGUI/EntityGUI_4Spin_QTD.cxx
@@ -1,15 +1,14 @@
/****************************************************************************
-** Form implementation generated from reading ui file 'KinematicGUI_3List3Spin_QTD.ui'
+** Form implementation generated from reading ui file 'EntityGUI_4Spin_QTD.ui'
**
-** Created: mer fév 4 16:57:37 2004
+** Created: Fri Apr 30 10:56:21 2004
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
-#include "KinematicGUI_3List3Spin_QTD.h"
+#include "EntityGUI_4Spin_QTD.h"
#include
-#include
#include
#include
#include
@@ -19,53 +18,79 @@
#include
/*
- * Constructs a KinematicGUI_3List3Spin_QTD which is a child of 'parent', with the
+ * Constructs a EntityGUI_4Spin_QTD which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*/
-KinematicGUI_3List3Spin_QTD::KinematicGUI_3List3Spin_QTD( QWidget* parent, const char* name, WFlags fl )
+EntityGUI_4Spin_QTD::EntityGUI_4Spin_QTD( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl )
{
if ( !name )
- setName( "KinematicGUI_3List3Spin_QTD" );
- resize( 279, 111 );
- setMinimumSize( QSize( 100, 0 ) );
- setCaption( trUtf8( "KinematicGUI_3List3Spin_QTD" ) );
- KinematicGUI_3List3Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "KinematicGUI_3List3Spin_QTDLayout");
+ setName( "EntityGUI_4Spin_QTD" );
+ resize( 176, 154 );
+ setCaption( trUtf8( "EntityGUI_4Spin_QTD" ) );
+ EntityGUI_4Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_4Spin_QTDLayout");
GroupBox1 = new QGroupBox( this, "GroupBox1" );
- GroupBox1->setTitle( trUtf8( "" ) );
+ GroupBox1->setTitle( trUtf8( "Values" ) );
GroupBox1->setColumnLayout(0, Qt::Vertical );
GroupBox1->layout()->setSpacing( 6 );
GroupBox1->layout()->setMargin( 11 );
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
GroupBox1Layout->setAlignment( Qt::AlignTop );
+ Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3");
+
+ Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
+
+ buttonUndo = new QPushButton( GroupBox1, "buttonUndo" );
+ buttonUndo->setText( trUtf8( "Undo" ) );
+
+ Layout2->addWidget( buttonUndo, 1, 0 );
+
+ buttonApply = new QPushButton( GroupBox1, "buttonApply" );
+ buttonApply->setText( trUtf8( "Create" ) );
+
+ Layout2->addWidget( buttonApply, 0, 0 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout2->addItem( spacer, 2, 0 );
+
+ Layout3->addLayout( Layout2, 0, 1 );
+
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+ SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" );
+ SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox3, 2, 1 );
+
+ SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
+ SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox2, 1, 1 );
+
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
TextLabel2->setText( trUtf8( "TL2" ) );
- Layout1->addWidget( TextLabel2, 0, 2 );
- QSpacerItem* spacer = new QSpacerItem( 0, 100, QSizePolicy::Minimum, QSizePolicy::Expanding );
- Layout1->addItem( spacer, 3, 3 );
+ Layout1->addWidget( TextLabel2, 1, 0 );
+ QSpacerItem* spacer_2 = new QSpacerItem( 0, 70, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer_2, 4, 1 );
- SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
- SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
+ SpinBox4 = new QSpinBox( GroupBox1, "SpinBox4" );
+ SpinBox4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox4->sizePolicy().hasHeightForWidth() ) );
- Layout1->addWidget( SpinBox1, 0, 3 );
-
- TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
- TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
- TextLabel4->setText( trUtf8( "TL4" ) );
-
- Layout1->addWidget( TextLabel4, 1, 2 );
+ Layout1->addWidget( SpinBox4, 3, 1 );
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
TextLabel3->setText( trUtf8( "TL3" ) );
- Layout1->addWidget( TextLabel3, 1, 0 );
+ Layout1->addWidget( TextLabel3, 2, 0 );
+
+ SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
+ SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox1, 0, 1 );
TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
@@ -73,52 +98,30 @@ KinematicGUI_3List3Spin_QTD::KinematicGUI_3List3Spin_QTD( QWidget* parent, cons
Layout1->addWidget( TextLabel1, 0, 0 );
- ComboBox3 = new QComboBox( FALSE, GroupBox1, "ComboBox3" );
- ComboBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, ComboBox3->sizePolicy().hasHeightForWidth() ) );
+ TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
+ TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
+ TextLabel4->setText( trUtf8( "TL4" ) );
- Layout1->addWidget( ComboBox3, 2, 1 );
+ Layout1->addWidget( TextLabel4, 3, 0 );
- SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
- SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
+ Layout3->addLayout( Layout1, 0, 0 );
- Layout1->addWidget( SpinBox2, 1, 3 );
+ GroupBox1Layout->addLayout( Layout3, 0, 0 );
- SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" );
- SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) );
+ EntityGUI_4Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
- Layout1->addWidget( SpinBox3, 2, 3 );
-
- TextLabel6 = new QLabel( GroupBox1, "TextLabel6" );
- TextLabel6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel6->sizePolicy().hasHeightForWidth() ) );
- TextLabel6->setText( trUtf8( "TL6" ) );
-
- Layout1->addWidget( TextLabel6, 2, 2 );
-
- ComboBox1 = new QComboBox( FALSE, GroupBox1, "ComboBox1" );
- ComboBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, ComboBox1->sizePolicy().hasHeightForWidth() ) );
-
- Layout1->addWidget( ComboBox1, 0, 1 );
-
- ComboBox2 = new QComboBox( FALSE, GroupBox1, "ComboBox2" );
- ComboBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, ComboBox2->sizePolicy().hasHeightForWidth() ) );
-
- Layout1->addWidget( ComboBox2, 1, 1 );
-
- TextLabel5 = new QLabel( GroupBox1, "TextLabel5" );
- TextLabel5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel5->sizePolicy().hasHeightForWidth() ) );
- TextLabel5->setText( trUtf8( "TL5" ) );
-
- Layout1->addWidget( TextLabel5, 2, 0 );
-
- GroupBox1Layout->addLayout( Layout1, 0, 0 );
-
- KinematicGUI_3List3Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
+ // tab order
+ setTabOrder( buttonUndo, buttonApply );
+ setTabOrder( buttonApply, SpinBox1 );
+ setTabOrder( SpinBox1, SpinBox2 );
+ setTabOrder( SpinBox2, SpinBox3 );
+ setTabOrder( SpinBox3, SpinBox4 );
}
/*
* Destroys the object and frees any allocated resources
*/
-KinematicGUI_3List3Spin_QTD::~KinematicGUI_3List3Spin_QTD()
+EntityGUI_4Spin_QTD::~EntityGUI_4Spin_QTD()
{
// no need to delete child widgets, Qt does it all for us
}
diff --git a/src/KinematicGUI/KinematicGUI_3List3Spin_QTD.h b/src/EntityGUI/EntityGUI_4Spin_QTD.h
similarity index 53%
rename from src/KinematicGUI/KinematicGUI_3List3Spin_QTD.h
rename to src/EntityGUI/EntityGUI_4Spin_QTD.h
index 9d8c70251..4aa37176d 100644
--- a/src/KinematicGUI/KinematicGUI_3List3Spin_QTD.h
+++ b/src/EntityGUI/EntityGUI_4Spin_QTD.h
@@ -1,51 +1,51 @@
/****************************************************************************
-** Form interface generated from reading ui file 'KinematicGUI_3List3Spin_QTD.ui'
+** Form interface generated from reading ui file 'EntityGUI_4Spin_QTD.ui'
**
-** Created: mer fév 4 16:57:37 2004
+** Created: Fri Apr 30 10:56:17 2004
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
-#ifndef KINEMATICGUI_3LIST3SPIN_QTD_H
-#define KINEMATICGUI_3LIST3SPIN_QTD_H
+#ifndef ENTITYGUI_4SPIN_QTD_H
+#define ENTITYGUI_4SPIN_QTD_H
#include
#include
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
-class QComboBox;
class QGroupBox;
class QLabel;
+class QPushButton;
class QSpinBox;
-class KinematicGUI_3List3Spin_QTD : public QWidget
+class EntityGUI_4Spin_QTD : public QWidget
{
Q_OBJECT
public:
- KinematicGUI_3List3Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
- ~KinematicGUI_3List3Spin_QTD();
+ EntityGUI_4Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_4Spin_QTD();
QGroupBox* GroupBox1;
- QLabel* TextLabel2;
- QSpinBox* SpinBox1;
- QLabel* TextLabel4;
- QLabel* TextLabel3;
- QLabel* TextLabel1;
- QComboBox* ComboBox3;
- QSpinBox* SpinBox2;
+ QPushButton* buttonUndo;
+ QPushButton* buttonApply;
QSpinBox* SpinBox3;
- QLabel* TextLabel6;
- QComboBox* ComboBox1;
- QComboBox* ComboBox2;
- QLabel* TextLabel5;
+ QSpinBox* SpinBox2;
+ QLabel* TextLabel2;
+ QSpinBox* SpinBox4;
+ QLabel* TextLabel3;
+ QSpinBox* SpinBox1;
+ QLabel* TextLabel1;
+ QLabel* TextLabel4;
protected:
- QGridLayout* KinematicGUI_3List3Spin_QTDLayout;
+ QGridLayout* EntityGUI_4Spin_QTDLayout;
QGridLayout* GroupBox1Layout;
+ QGridLayout* Layout3;
+ QGridLayout* Layout2;
QGridLayout* Layout1;
};
-#endif // KINEMATICGUI_3LIST3SPIN_QTD_H
+#endif // ENTITYGUI_4SPIN_QTD_H
diff --git a/src/EntityGUI/EntityGUI_Dir1_QTD.cxx b/src/EntityGUI/EntityGUI_Dir1_QTD.cxx
new file mode 100644
index 000000000..40b070b47
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_Dir1_QTD.cxx
@@ -0,0 +1,80 @@
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_Dir1_QTD.ui'
+**
+** Created: ven déc 12 11:17:09 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_Dir1_QTD.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/*
+ * Constructs a EntityGUI_Dir1_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_Dir1_QTD::EntityGUI_Dir1_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_Dir1_QTD" );
+ resize( 131, 123 );
+ setCaption( trUtf8( "EntityGUI_Dir1_QTD" ) );
+ EntityGUI_Dir1_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_Dir1_QTDLayout");
+
+ GroupDir1 = new QButtonGroup( this, "GroupDir1" );
+ GroupDir1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupDir1->sizePolicy().hasHeightForWidth() ) );
+ GroupDir1->setTitle( trUtf8( "Direction" ) );
+ GroupDir1->setColumnLayout(0, Qt::Vertical );
+ GroupDir1->layout()->setSpacing( 6 );
+ GroupDir1->layout()->setMargin( 11 );
+ GroupDir1Layout = new QGridLayout( GroupDir1->layout() );
+ GroupDir1Layout->setAlignment( Qt::AlignTop );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ RB_Dir12 = new QRadioButton( GroupDir1, "RB_Dir12" );
+ RB_Dir12->setText( trUtf8( "Perpendicular" ) );
+
+ Layout1->addWidget( RB_Dir12, 1, 0 );
+
+ RB_Dir13 = new QRadioButton( GroupDir1, "RB_Dir13" );
+ RB_Dir13->setText( trUtf8( "Tangent" ) );
+
+ Layout1->addWidget( RB_Dir13, 2, 0 );
+
+ RB_Dir11 = new QRadioButton( GroupDir1, "RB_Dir11" );
+ RB_Dir11->setText( trUtf8( "Angle" ) );
+
+ Layout1->addWidget( RB_Dir11, 0, 0 );
+
+ RB_Dir14 = new QRadioButton( GroupDir1, "RB_Dir14" );
+ RB_Dir14->setText( trUtf8( "VX-VY" ) );
+
+ Layout1->addWidget( RB_Dir14, 3, 0 );
+
+ GroupDir1Layout->addLayout( Layout1, 0, 0 );
+
+ EntityGUI_Dir1_QTDLayout->addWidget( GroupDir1, 0, 0 );
+
+ // tab order
+ setTabOrder( RB_Dir11, RB_Dir12 );
+ setTabOrder( RB_Dir12, RB_Dir13 );
+ setTabOrder( RB_Dir13, RB_Dir14 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_Dir1_QTD::~EntityGUI_Dir1_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
diff --git a/src/EntityGUI/EntityGUI_Dir1_QTD.h b/src/EntityGUI/EntityGUI_Dir1_QTD.h
new file mode 100644
index 000000000..31a85e8bb
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_Dir1_QTD.h
@@ -0,0 +1,41 @@
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_Dir1_QTD.ui'
+**
+** Created: ven déc 12 11:17:09 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_DIR1_QTD_H
+#define ENTITYGUI_DIR1_QTD_H
+
+#include
+#include
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QButtonGroup;
+class QRadioButton;
+
+class EntityGUI_Dir1_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_Dir1_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_Dir1_QTD();
+
+ QButtonGroup* GroupDir1;
+ QRadioButton* RB_Dir12;
+ QRadioButton* RB_Dir13;
+ QRadioButton* RB_Dir11;
+ QRadioButton* RB_Dir14;
+
+
+protected:
+ QGridLayout* EntityGUI_Dir1_QTDLayout;
+ QGridLayout* GroupDir1Layout;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_DIR1_QTD_H
diff --git a/src/EntityGUI/EntityGUI_Dir2_QTD.cxx b/src/EntityGUI/EntityGUI_Dir2_QTD.cxx
new file mode 100644
index 000000000..6fee0814c
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_Dir2_QTD.cxx
@@ -0,0 +1,76 @@
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_Dir2_QTD.ui'
+**
+** Created: ven déc 12 11:17:10 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_Dir2_QTD.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/*
+ * Constructs a EntityGUI_Dir2_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_Dir2_QTD::EntityGUI_Dir2_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_Dir2_QTD" );
+ resize( 124, 106 );
+ setCaption( trUtf8( "EntityGUI_Dir2_QTD" ) );
+ EntityGUI_Dir2_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_Dir2_QTDLayout");
+
+ GroupDir2 = new QButtonGroup( this, "GroupDir2" );
+ GroupDir2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupDir2->sizePolicy().hasHeightForWidth() ) );
+ GroupDir2->setTitle( trUtf8( "Direction" ) );
+ GroupDir2->setColumnLayout(0, Qt::Vertical );
+ GroupDir2->layout()->setSpacing( 6 );
+ GroupDir2->layout()->setMargin( 11 );
+ GroupDir2Layout = new QGridLayout( GroupDir2->layout() );
+ GroupDir2Layout->setAlignment( Qt::AlignTop );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ RB_Dir22 = new QRadioButton( GroupDir2, "RB_Dir22" );
+ RB_Dir22->setText( trUtf8( "X" ) );
+
+ Layout1->addWidget( RB_Dir22, 1, 0 );
+
+ RB_Dir23 = new QRadioButton( GroupDir2, "RB_Dir23" );
+ RB_Dir23->setText( trUtf8( "Y" ) );
+
+ Layout1->addWidget( RB_Dir23, 2, 0 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer, 3, 0 );
+
+ RB_Dir21 = new QRadioButton( GroupDir2, "RB_Dir21" );
+ RB_Dir21->setText( trUtf8( "Length" ) );
+
+ Layout1->addWidget( RB_Dir21, 0, 0 );
+
+ GroupDir2Layout->addLayout( Layout1, 0, 0 );
+
+ EntityGUI_Dir2_QTDLayout->addWidget( GroupDir2, 0, 0 );
+
+ // tab order
+ setTabOrder( RB_Dir21, RB_Dir22 );
+ setTabOrder( RB_Dir22, RB_Dir23 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_Dir2_QTD::~EntityGUI_Dir2_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
diff --git a/src/EntityGUI/EntityGUI_Dir2_QTD.h b/src/EntityGUI/EntityGUI_Dir2_QTD.h
new file mode 100644
index 000000000..04ae7382f
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_Dir2_QTD.h
@@ -0,0 +1,40 @@
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_Dir2_QTD.ui'
+**
+** Created: ven déc 12 11:17:09 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_DIR2_QTD_H
+#define ENTITYGUI_DIR2_QTD_H
+
+#include
+#include
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QButtonGroup;
+class QRadioButton;
+
+class EntityGUI_Dir2_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_Dir2_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_Dir2_QTD();
+
+ QButtonGroup* GroupDir2;
+ QRadioButton* RB_Dir22;
+ QRadioButton* RB_Dir23;
+ QRadioButton* RB_Dir21;
+
+
+protected:
+ QGridLayout* EntityGUI_Dir2_QTDLayout;
+ QGridLayout* GroupDir2Layout;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_DIR2_QTD_H
diff --git a/src/EntityGUI/EntityGUI_Point_QTD.cxx b/src/EntityGUI/EntityGUI_Point_QTD.cxx
new file mode 100644
index 000000000..901a14fe2
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_Point_QTD.cxx
@@ -0,0 +1,74 @@
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_Point_QTD.ui'
+**
+** Created: ven déc 12 11:17:08 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_Point_QTD.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/*
+ * Constructs a EntityGUI_Point_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_Point_QTD::EntityGUI_Point_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_Point_QTD" );
+ resize( 124, 106 );
+ setCaption( trUtf8( "EntityGUI_Point_QTD" ) );
+ EntityGUI_Point_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_Point_QTDLayout");
+
+ GroupPoint = new QButtonGroup( this, "GroupPoint" );
+ GroupPoint->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupPoint->sizePolicy().hasHeightForWidth() ) );
+ GroupPoint->setTitle( trUtf8( "Point" ) );
+ GroupPoint->setColumnLayout(0, Qt::Vertical );
+ GroupPoint->layout()->setSpacing( 6 );
+ GroupPoint->layout()->setMargin( 11 );
+ GroupPointLayout = new QGridLayout( GroupPoint->layout() );
+ GroupPointLayout->setAlignment( Qt::AlignTop );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ RB_Point2 = new QRadioButton( GroupPoint, "RB_Point2" );
+ RB_Point2->setText( trUtf8( "Relative" ) );
+
+ Layout1->addWidget( RB_Point2, 1, 0 );
+
+ RB_Point1 = new QRadioButton( GroupPoint, "RB_Point1" );
+ RB_Point1->setText( trUtf8( "Absolute" ) );
+
+ Layout1->addWidget( RB_Point1, 0, 0 );
+
+ RB_Point3 = new QRadioButton( GroupPoint, "RB_Point3" );
+ RB_Point3->setText( trUtf8( "Selection" ) );
+
+ Layout1->addWidget( RB_Point3, 2, 0 );
+
+ GroupPointLayout->addLayout( Layout1, 0, 0 );
+
+ EntityGUI_Point_QTDLayout->addWidget( GroupPoint, 0, 0 );
+
+ // tab order
+ setTabOrder( RB_Point1, RB_Point2 );
+ setTabOrder( RB_Point2, RB_Point3 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_Point_QTD::~EntityGUI_Point_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
diff --git a/src/EntityGUI/EntityGUI_Point_QTD.h b/src/EntityGUI/EntityGUI_Point_QTD.h
new file mode 100644
index 000000000..8b58ee2d0
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_Point_QTD.h
@@ -0,0 +1,40 @@
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_Point_QTD.ui'
+**
+** Created: ven déc 12 11:17:08 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_POINT_QTD_H
+#define ENTITYGUI_POINT_QTD_H
+
+#include
+#include
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QButtonGroup;
+class QRadioButton;
+
+class EntityGUI_Point_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_Point_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_Point_QTD();
+
+ QButtonGroup* GroupPoint;
+ QRadioButton* RB_Point2;
+ QRadioButton* RB_Point1;
+ QRadioButton* RB_Point3;
+
+
+protected:
+ QGridLayout* EntityGUI_Point_QTDLayout;
+ QGridLayout* GroupPointLayout;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_POINT_QTD_H
diff --git a/src/EntityGUI/EntityGUI_Skeleton_QTD.cxx b/src/EntityGUI/EntityGUI_Skeleton_QTD.cxx
new file mode 100644
index 000000000..8298731f4
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_Skeleton_QTD.cxx
@@ -0,0 +1,176 @@
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_Skeleton_QTD.ui'
+**
+** Created: ven déc 12 11:17:08 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_Skeleton_QTD.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/*
+ * Constructs a EntityGUI_Skeleton_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ *
+ * The dialog will by default be modeless, unless you set 'modal' to
+ * TRUE to construct a modal dialog.
+ */
+EntityGUI_Skeleton_QTD::EntityGUI_Skeleton_QTD( QWidget* parent, const char* name, bool modal, WFlags fl )
+ : QDialog( parent, name, modal, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_Skeleton_QTD" );
+ resize( 317, 276 );
+ setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) );
+ setCaption( trUtf8( "EntityGUI_Skeleton_QTD" ) );
+ EntityGUI_Skeleton_QTDLayout = new QGridLayout( this, 1, 1, 11, 6, "EntityGUI_Skeleton_QTDLayout");
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ GroupVal = new QGroupBox( this, "GroupVal" );
+ GroupVal->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupVal->sizePolicy().hasHeightForWidth() ) );
+ GroupVal->setTitle( trUtf8( "" ) );
+
+ Layout1->addWidget( GroupVal, 2, 0 );
+
+ GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
+ GroupConstructors->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, GroupConstructors->sizePolicy().hasHeightForWidth() ) );
+ GroupConstructors->setTitle( trUtf8( "Element Type" ) );
+ GroupConstructors->setColumnLayout(0, Qt::Vertical );
+ GroupConstructors->layout()->setSpacing( 6 );
+ GroupConstructors->layout()->setMargin( 11 );
+ GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
+ GroupConstructorsLayout->setAlignment( Qt::AlignTop );
+
+ Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2");
+
+ RadioButton1 = new QRadioButton( GroupConstructors, "RadioButton1" );
+ RadioButton1->setText( trUtf8( "Segment" ) );
+ Layout2->addWidget( RadioButton1 );
+
+ RadioButton2 = new QRadioButton( GroupConstructors, "RadioButton2" );
+ RadioButton2->setText( trUtf8( "Arc" ) );
+ Layout2->addWidget( RadioButton2 );
+
+ GroupConstructorsLayout->addLayout( Layout2, 0, 0 );
+
+ Layout1->addWidget( GroupConstructors, 0, 0 );
+
+ GroupDest = new QGroupBox( this, "GroupDest" );
+ GroupDest->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupDest->sizePolicy().hasHeightForWidth() ) );
+ GroupDest->setTitle( trUtf8( "Destination" ) );
+ GroupDest->setColumnLayout(0, Qt::Vertical );
+ GroupDest->layout()->setSpacing( 6 );
+ GroupDest->layout()->setMargin( 11 );
+ GroupDestLayout = new QGridLayout( GroupDest->layout() );
+ GroupDestLayout->setAlignment( Qt::AlignTop );
+
+ Layout5 = new QGridLayout( 0, 1, 1, 0, 6, "Layout5");
+
+ GroupDest1 = new QButtonGroup( GroupDest, "GroupDest1" );
+ GroupDest1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupDest1->sizePolicy().hasHeightForWidth() ) );
+ GroupDest1->setTitle( trUtf8( "Type" ) );
+ GroupDest1->setColumnLayout(0, Qt::Vertical );
+ GroupDest1->layout()->setSpacing( 6 );
+ GroupDest1->layout()->setMargin( 11 );
+ GroupDest1Layout = new QGridLayout( GroupDest1->layout() );
+ GroupDest1Layout->setAlignment( Qt::AlignTop );
+
+ Layout4 = new QGridLayout( 0, 1, 1, 0, 6, "Layout4");
+
+ RB_Dest2 = new QRadioButton( GroupDest1, "RB_Dest2" );
+ RB_Dest2->setText( trUtf8( "Direction" ) );
+
+ Layout4->addWidget( RB_Dest2, 0, 1 );
+
+ RB_Dest1 = new QRadioButton( GroupDest1, "RB_Dest1" );
+ RB_Dest1->setText( trUtf8( "Point" ) );
+
+ Layout4->addWidget( RB_Dest1, 0, 0 );
+
+ GroupDest1Layout->addLayout( Layout4, 0, 0 );
+
+ Layout5->addMultiCellWidget( GroupDest1, 0, 0, 0, 1 );
+
+ GroupDest2 = new QButtonGroup( GroupDest, "GroupDest2" );
+ GroupDest2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupDest2->sizePolicy().hasHeightForWidth() ) );
+ GroupDest2->setTitle( trUtf8( "" ) );
+ GroupDest2->setColumnLayout(0, Qt::Vertical );
+ GroupDest2->layout()->setSpacing( 6 );
+ GroupDest2->layout()->setMargin( 11 );
+ GroupDest2Layout = new QGridLayout( GroupDest2->layout() );
+ GroupDest2Layout->setAlignment( Qt::AlignTop );
+
+ Layout5->addWidget( GroupDest2, 1, 0 );
+
+ GroupDest3 = new QButtonGroup( GroupDest, "GroupDest3" );
+ GroupDest3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupDest3->sizePolicy().hasHeightForWidth() ) );
+ GroupDest3->setTitle( trUtf8( "" ) );
+ GroupDest3->setColumnLayout(0, Qt::Vertical );
+ GroupDest3->layout()->setSpacing( 6 );
+ GroupDest3->layout()->setMargin( 11 );
+ GroupDest3Layout = new QGridLayout( GroupDest3->layout() );
+ GroupDest3Layout->setAlignment( Qt::AlignTop );
+
+ Layout5->addWidget( GroupDest3, 1, 1 );
+
+ GroupDestLayout->addLayout( Layout5, 0, 0 );
+
+ Layout1->addWidget( GroupDest, 1, 0 );
+
+ GroupButtons = new QGroupBox( this, "GroupButtons" );
+ GroupButtons->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupButtons->sizePolicy().hasHeightForWidth() ) );
+ GroupButtons->setTitle( trUtf8( "" ) );
+ GroupButtons->setColumnLayout(0, Qt::Vertical );
+ GroupButtons->layout()->setSpacing( 6 );
+ GroupButtons->layout()->setMargin( 11 );
+ GroupButtonsLayout = new QHBoxLayout( GroupButtons->layout() );
+ GroupButtonsLayout->setAlignment( Qt::AlignTop );
+
+ Layout3 = new QHBoxLayout( 0, 0, 6, "Layout3");
+
+ buttonEnd = new QPushButton( GroupButtons, "buttonEnd" );
+ buttonEnd->setText( trUtf8( "End Sketch" ) );
+ Layout3->addWidget( buttonEnd );
+
+ buttonClose = new QPushButton( GroupButtons, "buttonClose" );
+ buttonClose->setText( trUtf8( "Close Sketch" ) );
+ Layout3->addWidget( buttonClose );
+ QSpacerItem* spacer = new QSpacerItem( 91, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ Layout3->addItem( spacer );
+
+ buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
+ buttonCancel->setText( trUtf8( "&Cancel" ) );
+ Layout3->addWidget( buttonCancel );
+ GroupButtonsLayout->addLayout( Layout3 );
+
+ Layout1->addWidget( GroupButtons, 3, 0 );
+
+ EntityGUI_Skeleton_QTDLayout->addLayout( Layout1, 0, 0 );
+
+ // tab order
+ setTabOrder( RadioButton1, RadioButton2 );
+ setTabOrder( RadioButton2, RB_Dest1 );
+ setTabOrder( RB_Dest1, RB_Dest2 );
+ setTabOrder( RB_Dest2, buttonEnd );
+ setTabOrder( buttonEnd, buttonClose );
+ setTabOrder( buttonClose, buttonCancel );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_Skeleton_QTD::~EntityGUI_Skeleton_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
diff --git a/src/EntityGUI/EntityGUI_Skeleton_QTD.h b/src/EntityGUI/EntityGUI_Skeleton_QTD.h
new file mode 100644
index 000000000..534f52ca3
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_Skeleton_QTD.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_Skeleton_QTD.ui'
+**
+** Created: ven déc 12 11:17:07 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_SKELETON_QTD_H
+#define ENTITYGUI_SKELETON_QTD_H
+
+#include
+#include
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QButtonGroup;
+class QGroupBox;
+class QPushButton;
+class QRadioButton;
+
+class EntityGUI_Skeleton_QTD : public QDialog
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_Skeleton_QTD( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~EntityGUI_Skeleton_QTD();
+
+ QGroupBox* GroupVal;
+ QButtonGroup* GroupConstructors;
+ QRadioButton* RadioButton1;
+ QRadioButton* RadioButton2;
+ QGroupBox* GroupDest;
+ QButtonGroup* GroupDest1;
+ QRadioButton* RB_Dest2;
+ QRadioButton* RB_Dest1;
+ QButtonGroup* GroupDest2;
+ QButtonGroup* GroupDest3;
+ QGroupBox* GroupButtons;
+ QPushButton* buttonEnd;
+ QPushButton* buttonClose;
+ QPushButton* buttonCancel;
+
+
+protected:
+ QGridLayout* EntityGUI_Skeleton_QTDLayout;
+ QGridLayout* Layout1;
+ QGridLayout* GroupConstructorsLayout;
+ QHBoxLayout* Layout2;
+ QGridLayout* GroupDestLayout;
+ QGridLayout* Layout5;
+ QGridLayout* GroupDest1Layout;
+ QGridLayout* Layout4;
+ QGridLayout* GroupDest2Layout;
+ QGridLayout* GroupDest3Layout;
+ QHBoxLayout* GroupButtonsLayout;
+ QHBoxLayout* Layout3;
+};
+
+#endif // ENTITYGUI_SKELETON_QTD_H
diff --git a/src/EntityGUI/EntityGUI_SketcherDlg.cxx b/src/EntityGUI/EntityGUI_SketcherDlg.cxx
new file mode 100644
index 000000000..d91c24544
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_SketcherDlg.cxx
@@ -0,0 +1,1168 @@
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_SketcherDlg.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+using namespace std;
+#include "EntityGUI_SketcherDlg.h"
+#include "Sketcher_Profile.hxx"
+#include "utilities.h"
+
+#include
+#include
+#include
+
+#include
+
+//=================================================================================
+// class : EntityGUI_SketcherDlg()
+// purpose : Constructs a EntityGUI_SketcherDlg which is a child of 'parent', with the
+// name 'name' and widget flags set to 'f'.
+// The dialog will by default be modeless, unless you set 'modal' to
+// TRUE to construct a modal dialog.
+//=================================================================================
+EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(QWidget* parent, const char* name, EntityGUI* theEntityGUI, SALOME_Selection* Sel, bool modal, WFlags fl)
+ :EntityGUI_Skeleton_QTD(parent, name, modal, fl)
+{
+ if (!name)
+ setName("EntityGUI_SketcherDlg");
+
+ buttonCancel->setText(tr("GEOM_BUT_CANCEL"));
+ buttonEnd->setText(tr("GEOM_BUT_END_SKETCH"));
+ buttonClose->setText(tr("GEOM_BUT_CLOSE_SKETCH"));
+ GroupVal->close(TRUE);
+ GroupDest2->close(TRUE);
+ GroupDest3->close(TRUE);
+ resize(0, 0);
+
+ QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
+
+ setCaption(tr("GEOM_SKETCHER_TITLE"));
+
+ GroupConstructors->setTitle(tr("GEOM_SKETCHER_EL"));
+ RadioButton1->setText(tr("GEOM_SKETCHER_SEGMENT"));
+ RadioButton2->setText(tr("GEOM_SKETCHER_ARC"));
+ GroupDest->setTitle(tr("GEOM_SKETCHER_DEST"));
+ GroupDest1->setTitle(tr("GEOM_SKETCHER_TYPE"));
+ RB_Dest1->setText(tr("GEOM_SKETCHER_POINT"));
+ RB_Dest2->setText(tr("GEOM_SKETCHER_DIR"));
+
+ /***************************************************************/
+ GroupPt = new EntityGUI_Point_QTD(GroupDest, "GroupPt");
+ GroupPt->GroupPoint->setTitle(tr("GEOM_SKETCHER_POINT"));
+ GroupPt->RB_Point1->setText(tr("GEOM_SKETCHER_ABS"));
+ GroupPt->RB_Point2->setText(tr("GEOM_SKETCHER_REL"));
+ GroupPt->RB_Point3->setText(tr("GEOM_SKETCHER_SEL"));
+
+ GroupD1 = new EntityGUI_Dir1_QTD(GroupDest, "GroupD1");
+ GroupD1->GroupDir1->setTitle(tr("GEOM_SKETCHER_DIR"));
+ GroupD1->RB_Dir11->setText(tr("GEOM_SKETCHER_ANGLE"));
+ GroupD1->RB_Dir12->setText(tr("GEOM_SKETCHER_PER"));
+ GroupD1->RB_Dir13->setText(tr("GEOM_SKETCHER_TAN"));
+ GroupD1->RB_Dir14->setText(tr("GEOM_SKETCHER_VXVY"));
+
+ GroupD2 = new EntityGUI_Dir2_QTD(GroupDest, "GroupD2");
+ GroupD2->GroupDir2->setTitle(tr("GEOM_SKETCHER_DIR"));
+ GroupD2->RB_Dir21->setText(tr("GEOM_SKETCHER_LENGTH"));
+ GroupD2->RB_Dir22->setText(tr("GEOM_SKETCHER_X"));
+ GroupD2->RB_Dir23->setText(tr("GEOM_SKETCHER_Y"));
+
+ Group1Sel = new EntityGUI_1Sel_QTD(this, "Group1Sel");
+ Group1Sel->TextLabel1->setText(tr("GEOM_SKETCHER_POINT2"));
+ Group1Sel->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
+ Group1Sel->buttonUndo->setText(tr("GEOM_SKETCHER_UNDO"));
+ Group1Sel->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
+ Group1Sel->PushButton1->setPixmap(image0);
+
+ Group1Spin = new EntityGUI_1Spin(this, "Group1Spin");
+ Group1Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
+ Group1Spin->buttonUndo->setText(tr("GEOM_SKETCHER_UNDO"));
+ Group1Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
+
+ Group2Spin = new EntityGUI_2Spin(this, "Group2Spin");
+ Group2Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
+ Group2Spin->buttonUndo->setText(tr("GEOM_SKETCHER_UNDO"));
+ Group2Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
+
+ Group3Spin = new EntityGUI_3Spin(this, "Group3Spin");
+ Group3Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
+ Group3Spin->buttonUndo->setText(tr("GEOM_SKETCHER_UNDO"));
+ Group3Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
+
+ Group4Spin = new EntityGUI_4Spin(this, "Group4Spin");
+ Group4Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
+ Group4Spin->buttonUndo->setText(tr("GEOM_SKETCHER_UNDO"));
+ Group4Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
+
+ Layout5->addMultiCellWidget(GroupPt, 1, 1, 0, 1);
+ Layout5->addWidget(GroupD1, 1, 0);
+ Layout5->addWidget(GroupD2, 1, 1);
+
+ Layout1->addWidget(Group1Sel, 2, 0);
+ Layout1->addWidget(Group1Spin, 2, 0);
+ Layout1->addWidget(Group2Spin, 2, 0);
+ Layout1->addWidget(Group3Spin, 2, 0);
+ Layout1->addWidget(Group4Spin, 2, 0);
+ /***************************************************************/
+
+ mySelection = Sel;
+ mySimulationTopoDs1.Nullify();
+ mySimulationTopoDs2.Nullify();
+ myEntityGUI = theEntityGUI;
+
+ /* Get setting of step value from file configuration */
+ QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
+ step = St.toDouble();
+
+ myGeomBase = new GEOMBase();
+ myGeomGUI = GEOMContext::GetGeomGUI();
+ myGeomGUI->SetActiveDialogBox((QDialog*)this);
+ myGeom = myGeomGUI->myComponentGeom;
+
+ myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom);
+ mySelection->AddFilter(myVertexFilter);
+
+ /* signals and slots connections */
+ connect(buttonEnd, SIGNAL(clicked()), this, SLOT(ClickOnEnd()));
+ connect(buttonClose, SIGNAL(clicked()), this, SLOT(ClickOnClose()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+
+ connect(Group1Sel->buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(Group1Sel->buttonUndo, SIGNAL(clicked()), this, SLOT(ClickOnUndo()));
+ connect(Group1Spin->buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(Group1Spin->buttonUndo, SIGNAL(clicked()), this, SLOT(ClickOnUndo()));
+ connect(Group2Spin->buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(Group2Spin->buttonUndo, SIGNAL(clicked()), this, SLOT(ClickOnUndo()));
+ connect(Group3Spin->buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(Group3Spin->buttonUndo, SIGNAL(clicked()), this, SLOT(ClickOnUndo()));
+ connect(Group4Spin->buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(Group4Spin->buttonUndo, SIGNAL(clicked()), this, SLOT(ClickOnUndo()));
+
+ connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(TypeClicked(int)));
+ connect(GroupDest1, SIGNAL(clicked(int)), this, SLOT(DestClicked(int)));
+ connect(GroupPt->GroupPoint, SIGNAL(clicked(int)), this, SLOT(PointClicked(int)));
+ connect(GroupD1->GroupDir1, SIGNAL(clicked(int)), this, SLOT(Dir1Clicked(int)));
+ connect(GroupD2->GroupDir2, SIGNAL(clicked(int)), this, SLOT(Dir2Clicked(int)));
+
+ connect(Group1Sel->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect(Group1Sel->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+
+ connect(Group1Spin->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group2Spin->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group2Spin->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group3Spin->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group3Spin->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group3Spin->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group4Spin->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group4Spin->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group4Spin->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group4Spin->SpinBox_DS, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1Spin->SpinBox_DX, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2Spin->SpinBox_DX, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2Spin->SpinBox_DY, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3Spin->SpinBox_DX, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3Spin->SpinBox_DY, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3Spin->SpinBox_DZ, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group4Spin->SpinBox_DX, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group4Spin->SpinBox_DY, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group4Spin->SpinBox_DZ, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group4Spin->SpinBox_DS, SLOT(SetStep(double)));
+
+ connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
+ connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+
+ /* Move widget on the botton right corner of main widget */
+// int x, y;
+// myGeomBase->DefineDlgPosition( this, x, y );
+
+ myEntityGUI = theEntityGUI;
+ this->Init();
+ this->show();
+}
+
+
+//=================================================================================
+// function : ~EntityGUI_SketcherDlg()
+// purpose : Destroys the object and frees any allocated resources
+//=================================================================================
+EntityGUI_SketcherDlg::~EntityGUI_SketcherDlg()
+{
+ // no need to delete child widgets, Qt does it all for us
+ this->destroy(TRUE, TRUE);
+}
+
+
+//=================================================================================
+// function : Init()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::Init()
+{
+ /* init variables */
+ myEditCurrentArgument = Group1Sel->LineEdit1;
+
+ /* min, max, step and decimals for spin boxes */
+ Group1Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group2Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group3Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group3Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group4Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, 0.1, 3);
+ Group4Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, 0.1, 3);
+ Group4Spin->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group4Spin->SpinBox_DS->RangeStepAndValidator(-999.999, 999.999, 5., 3);
+
+ Group1Spin->SpinBox_DX->SetValue(0.0);
+ Group2Spin->SpinBox_DX->SetValue(0.0);
+ Group2Spin->SpinBox_DY->SetValue(0.0);
+ Group3Spin->SpinBox_DX->SetValue(0.0);
+ Group3Spin->SpinBox_DY->SetValue(0.0);
+ Group3Spin->SpinBox_DZ->SetValue(0.0);
+ Group4Spin->SpinBox_DX->SetValue(0.0);
+ Group4Spin->SpinBox_DY->SetValue(0.0);
+ Group4Spin->SpinBox_DZ->SetValue(0.0);
+ Group4Spin->SpinBox_DS->SetValue(0.0);
+
+ /* displays Dialog */
+ Group1Sel->buttonUndo->setEnabled(false);
+ Group1Spin->buttonUndo->setEnabled(false);
+ Group2Spin->buttonUndo->setEnabled(false);
+ Group3Spin->buttonUndo->setEnabled(false);
+ Group4Spin->buttonUndo->setEnabled(false);
+
+ RadioButton1->setChecked(true);
+
+ myLastOp = 0;
+ myLastX1 = 0.0;
+ myLastY1 = 0.0;
+ myLastX2 = 0.0;
+ myLastY2 = 0.0;
+
+ mySketchState = FIRST_POINT;
+ this->TypeClicked(0);
+
+ return;
+}
+
+
+//=================================================================================
+// function : InitClick()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::InitClick()
+{
+ disconnect(mySelection, 0, this, 0);
+
+ Group2Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group3Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group3Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
+
+ Group1Sel->hide();
+ Group1Spin->hide();
+ Group2Spin->hide();
+ Group3Spin->hide();
+ Group4Spin->hide();
+
+ resize(0, 0);
+
+ return;
+}
+
+
+//=================================================================================
+// function : TypeClicked()
+// purpose : Radio button management
+//=================================================================================
+void EntityGUI_SketcherDlg::TypeClicked(int constructorId)
+{
+ myConstructorId = constructorId;
+ if(myConstructorId == 0) { // SEGMENT
+ GroupD2->setEnabled(true);
+ RB_Dest1->setEnabled(true);
+ RB_Dest1->setChecked(true);
+ this->DestClicked(1);
+ }
+ else if(myConstructorId == 1) { // ARC
+ GroupD2->setEnabled(false);
+ RB_Dest1->setEnabled(false);
+ RB_Dest2->setChecked(true);
+ this->DestClicked(0);
+ }
+ return;
+}
+
+
+//=================================================================================
+// function : DestClicked()
+// purpose : Radio button management
+//=================================================================================
+void EntityGUI_SketcherDlg::DestClicked(int constructorId)
+{
+ GroupPt->hide();
+ GroupD1->hide();
+ GroupD2->hide();
+
+ if(constructorId == 1) { // Point
+ GroupPt->RB_Point1->setChecked(true);
+ GroupPt->show();
+ this->PointClicked(1); // XY
+ }
+ else if(constructorId == 0) { // Direction
+ GroupD1->RB_Dir11->setChecked(true);
+ GroupD1->show();
+ GroupD2->show();
+ this->Dir1Clicked(2); // Angle
+ }
+ return;
+}
+
+
+//=================================================================================
+// function : PointClicked()
+// purpose : Radio button management
+//=================================================================================
+void EntityGUI_SketcherDlg::PointClicked(int constructorId)
+{
+ this->InitClick();
+
+ if(myConstructorId == 0) { // SEGMENT
+ if(constructorId == 1) { // XY
+ mySketchType = PT_ABS;
+ Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_X2"));
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_Y2"));
+ myX = 0.0;
+ Group2Spin->SpinBox_DX->SetValue(myX);
+ myY = 0.0;
+ Group2Spin->SpinBox_DY->SetValue(myY);
+ Group2Spin->show();
+ Group2Spin->buttonApply->setFocus();
+ this->MakeSimulationAndDisplay();
+ }
+ else if(constructorId == 0) { // DXDY
+ mySketchType = PT_RELATIVE;
+ Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_DX2"));
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_DY2"));
+ myDX = 0.0;
+ Group2Spin->SpinBox_DX->SetValue(myDX);
+ myDY = 0.0;
+ Group2Spin->SpinBox_DY->SetValue(myDY);
+ Group2Spin->show();
+ Group2Spin->buttonApply->setFocus();
+ this->MakeSimulationAndDisplay();
+ }
+ else if(constructorId == 2) { // Selection
+ mySketchType = PT_SEL;
+ myEditCurrentArgument = Group1Sel->LineEdit1;
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ Group1Sel->show();
+ Group1Sel->buttonApply->setFocus();
+ this->SelectionIntoArgument();
+ }
+ }
+
+ return;
+}
+
+
+//=================================================================================
+// function : Dir1Clicked()
+// purpose : Radio button management
+//=================================================================================
+void EntityGUI_SketcherDlg::Dir1Clicked(int constructorId)
+{
+ myConstructorDirId = constructorId;
+ GroupD2->RB_Dir21->setChecked(true);
+ this->Dir2Clicked(2);
+ return;
+}
+
+
+//=================================================================================
+// function : Dir2Clicked()
+// purpose : Radio button management
+//=================================================================================
+void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
+{
+ this->InitClick();
+ myAngle = 0.0;
+
+ if(myConstructorId == 0) { // SEGMENT
+ myX = 0.0;
+ myY = 0.0;
+ myLength = 100.0;
+ if(myConstructorDirId == 2) { // Angle
+ Group2Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, 5., 3);
+ Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ Group2Spin->SpinBox_DX->SetValue(myAngle);
+ Group2Spin->buttonApply->setFocus();
+ Group2Spin->show();
+
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_ANGLE_LENGTH;
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_LENGTH2"));
+ Group2Spin->SpinBox_DY->SetValue(myLength);
+ }
+ else if(constructorId == 0) { // X
+ mySketchType = DIR_ANGLE_X;
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_X3"));
+ Group2Spin->SpinBox_DY->SetValue(myX);
+ }
+ else if(constructorId == 1) { // Y
+ mySketchType = DIR_ANGLE_Y;
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_Y3"));
+ Group2Spin->SpinBox_DY->SetValue(myY);
+ }
+ }
+ else if(myConstructorDirId == 0) { // Perpendicular
+ Group1Spin->show();
+ Group1Spin->buttonApply->setFocus();
+
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_PER_LENGTH;
+ Group1Spin->TextLabel1->setText(tr("GEOM_SKETCHER_LENGTH2"));
+ Group1Spin->SpinBox_DX->SetValue(myLength);
+ }
+ else if(constructorId == 0) { // X
+ mySketchType = DIR_PER_X;
+ Group1Spin->TextLabel1->setText(tr("GEOM_SKETCHER_X3"));
+ Group1Spin->SpinBox_DX->SetValue(myX);
+ }
+ else if(constructorId == 1) { // Y
+ mySketchType = DIR_PER_Y;
+ Group1Spin->TextLabel1->setText(tr("GEOM_SKETCHER_Y3"));
+ Group1Spin->SpinBox_DX->SetValue(myY);
+ }
+ }
+ else if(myConstructorDirId == 1) { // Tangent
+ Group1Spin->show();
+ Group1Spin->buttonApply->setFocus();
+
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_TAN_LENGTH;
+ Group1Spin->TextLabel1->setText(tr("GEOM_SKETCHER_LENGTH2"));
+ Group1Spin->SpinBox_DX->SetValue(myLength);
+ }
+ else if(constructorId == 0) { // X
+ mySketchType = DIR_TAN_X;
+ Group1Spin->TextLabel1->setText(tr("GEOM_SKETCHER_X3"));
+ Group1Spin->SpinBox_DX->SetValue(myX);
+ }
+ else if(constructorId == 1) { // Y
+ mySketchType = DIR_TAN_Y;
+ Group1Spin->TextLabel1->setText(tr("GEOM_SKETCHER_Y3"));
+ Group1Spin->SpinBox_DX->SetValue(myY);
+ }
+ }
+ else if(myConstructorDirId == 3) { // DXDY
+ Group3Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, 0.1, 3);
+ Group3Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, 0.1, 3);
+ Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_VX2"));
+ Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_VY2"));
+ myDX = 0.0;
+ Group3Spin->SpinBox_DX->SetValue(myDX);
+ myDY = 0.0;
+ Group3Spin->SpinBox_DY->SetValue(myDY);
+ Group3Spin->show();
+ Group3Spin->buttonApply->setFocus();
+
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_DXDY_LENGTH;
+ Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_LENGTH2"));
+ Group3Spin->SpinBox_DZ->SetValue(myLength);
+ }
+ else if(constructorId == 0) { // X
+ mySketchType = DIR_DXDY_X;
+ Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_X3"));
+ Group3Spin->SpinBox_DZ->SetValue(myX);
+ }
+ else if(constructorId == 1) { // Y
+ mySketchType = DIR_DXDY_Y;
+ Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_Y3"));
+ Group3Spin->SpinBox_DZ->SetValue(myY);
+ }
+ }
+ }
+ else if(myConstructorId == 1) { // ARC
+ if(myConstructorDirId == 2) { // Angle
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_ANGLE_LENGTH;
+ Group3Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, 5., 3);
+ Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, 5., 3);
+ Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_RADIUS2"));
+ Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ Group3Spin->SpinBox_DX->SetValue(myAngle);
+ myRadius = 100.0;
+ Group3Spin->SpinBox_DY->SetValue(myRadius);
+ myLength = 30.0;
+ Group3Spin->SpinBox_DZ->SetValue(myLength);
+ Group3Spin->show();
+ Group3Spin->buttonApply->setFocus();
+ }
+ }
+ else if(myConstructorDirId == 0) { // Perpendicular
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_PER_LENGTH;
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, 5., 3);
+ Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2"));
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ myRadius = 100.0;
+ Group2Spin->SpinBox_DX->SetValue(myRadius);
+ myLength = 30.0;
+ Group2Spin->SpinBox_DY->SetValue(myLength);
+ Group2Spin->show();
+ Group2Spin->buttonApply->setFocus();
+ }
+ }
+ else if(myConstructorDirId == 1) { // Tangent
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_TAN_LENGTH;
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, 5., 3);
+ Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2"));
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ myRadius = 100.0;
+ Group2Spin->SpinBox_DX->SetValue(myRadius);
+ myLength = 30.0;
+ Group2Spin->SpinBox_DY->SetValue(myLength);
+ Group2Spin->show();
+ Group2Spin->buttonApply->setFocus();
+ }
+ }
+ else if(myConstructorDirId == 3) { // DXDY
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_DXDY_LENGTH;
+ Group4Spin->TextLabel1->setText(tr("GEOM_SKETCHER_VX2"));
+ Group4Spin->TextLabel2->setText(tr("GEOM_SKETCHER_VY2"));
+ Group4Spin->TextLabel3->setText(tr("GEOM_SKETCHER_RADIUS2"));
+ Group4Spin->TextLabel4->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ myDX = 0.0;
+ Group4Spin->SpinBox_DX->SetValue(myDX);
+ myDY = 0.0;
+ Group4Spin->SpinBox_DY->SetValue(myDY);
+ myRadius = 100.0;
+ Group4Spin->SpinBox_DZ->SetValue(myRadius);
+ myLength = 30.0;
+ Group4Spin->SpinBox_DS->SetValue(myLength);
+ Group4Spin->show();
+ Group4Spin->buttonApply->setFocus();
+ }
+ }
+ }
+
+ this->MakeSimulationAndDisplay();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnCancel()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ClickOnCancel()
+{
+ QAD_Application::getDesktop()->putInfo(tr(""));
+ myEntityGUI->EraseSimulationShape();
+ mySimulationTopoDs1.Nullify();
+ mySimulationTopoDs2.Nullify();
+
+ mySelection->ClearFilters();
+ disconnect(mySelection, 0, this, 0);
+
+ reject();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnEnd()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ClickOnEnd()
+{
+ if(mySketchState != FIRST_POINT && mySketchState != SECOND_POINT)
+ myEntityGUI->OnSketchEnd(myCommand.ascii());
+
+ this->ClickOnCancel();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnClose()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ClickOnClose()
+{
+ if(mySketchState != FIRST_POINT && mySketchState != SECOND_POINT) {
+ myCommand = myCommand + ":WW";
+ myEntityGUI->OnSketchEnd(myCommand.ascii());
+ }
+
+ this->ClickOnCancel();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnApply()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ClickOnApply()
+{
+ if(mySketchState == FIRST_POINT) {
+ mySketchState = SECOND_POINT;
+ myLastX2 = myLastX1;
+ myLastY2 = myLastY1;
+ }
+ else {
+ if(mySketchState != SECOND_POINT) {
+ Group1Sel->buttonUndo->setEnabled(true);
+ Group1Spin->buttonUndo->setEnabled(true);
+ Group2Spin->buttonUndo->setEnabled(true);
+ Group3Spin->buttonUndo->setEnabled(true);
+ Group4Spin->buttonUndo->setEnabled(true);
+ }
+
+ QString myNewCommand = this->GetNewCommand();
+ QString myCommandTemp = myCommand + myNewCommand;
+
+ Sketcher_Profile aProfile (myCommandTemp.ascii());
+
+ if(aProfile.IsDone()) {
+ myLastCommand = myCommand;
+ myCommand = myCommandTemp;
+ myLastX2 = myLastX1;
+ myLastY2 = myLastY1;
+ mySketchState = NEXT_POINT;
+ }
+ }
+
+ myLastOp = myConstructorId;
+ this->MakeSimulationAndDisplay();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnUndo()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ClickOnUndo()
+{
+ Group1Sel->buttonUndo->setEnabled(false);
+ Group1Spin->buttonUndo->setEnabled(false);
+ Group2Spin->buttonUndo->setEnabled(false);
+ Group3Spin->buttonUndo->setEnabled(false);
+ Group4Spin->buttonUndo->setEnabled(false);
+
+ myCommand = myLastCommand;
+ this->MakeSimulationAndDisplay();
+ return;
+}
+
+
+//=================================================================================
+// function : SelectionIntoArgument()
+// purpose : Called when selection as changed
+//=================================================================================
+void EntityGUI_SketcherDlg::SelectionIntoArgument()
+{
+ myEntityGUI->EraseSimulationShape(1); //Juste Shape2!!
+
+ Group1Sel->buttonApply->setEnabled(false);
+ Group1Sel->buttonApply->setFocus();
+
+ myEditCurrentArgument->setText("");
+ QString aString = "";
+
+ myX = 0.0;
+ myY = 0.0;
+
+ int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
+ if(nbSel != 1)
+ return;
+
+ /* nbSel == 1 */
+ TopoDS_Shape S;
+ gp_Pnt myPoint1;
+ Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
+
+ if(!myGeomBase->GetTopoFromSelection(mySelection, S))
+ return;
+
+ if(myEditCurrentArgument == Group1Sel->LineEdit1 && myGeomBase->VertexToPoint(S, myPoint1)) {
+ myX = myPoint1.X();
+ myY = myPoint1.Y();
+ Group1Sel->LineEdit1->setText(aString);
+
+ Group1Sel->buttonApply->setEnabled(true);
+ Group1Sel->buttonApply->setFocus();
+ this->MakeSimulationAndDisplay();
+ }
+
+ return;
+}
+
+
+//=================================================================================
+// function : SetEditCurrentArgument()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::SetEditCurrentArgument()
+{
+ QPushButton* send = (QPushButton*)sender();
+
+ mySelection->ClearFilters();
+ if(send == Group1Sel->PushButton1) {
+ //Group1Sel->LineEdit1->setFocus();
+ myEditCurrentArgument = Group1Sel->LineEdit1;
+ }
+ mySelection->AddFilter(myVertexFilter);
+ this->SelectionIntoArgument();
+ return;
+}
+
+
+//=================================================================================
+// function : LineEditReturnPressed()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::LineEditReturnPressed()
+{
+ /* User name of object input management */
+ /* If successfull the selection is changed and signal emitted... */
+ /* so SelectionIntoArgument() is automatically called. */
+ const QString objectUserName = myEditCurrentArgument->text();
+ QWidget* thisWidget = (QWidget*)this;
+ if(myGeomBase->SelectionByNameInDialogs(thisWidget, objectUserName, mySelection))
+ myEditCurrentArgument->setText(objectUserName);
+
+ return;
+}
+
+
+//=================================================================================
+// function : DeactivateActiveDialog()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::DeactivateActiveDialog()
+{
+ this->setEnabled(false);
+ mySelection->ClearFilters();
+ disconnect(mySelection, 0, this, 0);
+ myEntityGUI->EraseSimulationShape();
+ myGeomGUI->SetActiveDialogBox(0);
+ return;
+}
+
+
+//=================================================================================
+// function : ActivateThisDialog()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ActivateThisDialog()
+{
+ /* Emit a signal to deactivate the active dialog */
+ myGeomGUI->EmitSignalDeactivateDialog();
+ this->setEnabled(true);
+ myGeomGUI->SetActiveDialogBox((QDialog*)this);
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ mySelection->AddFilter(myVertexFilter);
+ myEntityGUI->DisplaySimulationShape(mySimulationTopoDs1, mySimulationTopoDs2);
+
+ return;
+}
+
+
+//=================================================================================
+// function : enterEvent [REDEFINED]
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::enterEvent(QEvent* e)
+{
+ if(GroupConstructors->isEnabled())
+ return;
+ this->ActivateThisDialog();
+ return;
+}
+
+
+//=================================================================================
+// function : closeEvent()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::closeEvent(QCloseEvent* e)
+{
+ /* same than click on cancel button */
+ this->ClickOnCancel();
+ return;
+}
+
+
+//=================================================================================
+// function : ValueChangedInSpinBox()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ValueChangedInSpinBox(double newValue)
+{
+ QObject* send = (QObject*)sender();
+ Standard_Real vx, vy, vz, vs;
+ vx = vy = vz = vs = 0.0;
+
+ if(send == Group1Spin->SpinBox_DX) {
+ vx = newValue;
+ Group1Spin->buttonApply->setFocus();
+ }
+ else if(send == Group2Spin->SpinBox_DX) {
+ vx = newValue;
+ vy = Group2Spin->SpinBox_DY->GetValue();
+ Group2Spin->buttonApply->setFocus();
+ }
+ else if(send == Group2Spin->SpinBox_DY) {
+ vx = Group2Spin->SpinBox_DX->GetValue();
+ vy = newValue;
+ Group2Spin->buttonApply->setFocus();
+ }
+ else if(send == Group3Spin->SpinBox_DX) {
+ vx = newValue;
+ vy = Group3Spin->SpinBox_DY->GetValue();
+ vz = Group3Spin->SpinBox_DZ->GetValue();
+ Group3Spin->buttonApply->setFocus();
+ }
+ else if(send == Group3Spin->SpinBox_DY) {
+ vx = Group3Spin->SpinBox_DX->GetValue();
+ vy = newValue;
+ vz = Group3Spin->SpinBox_DZ->GetValue();
+ Group3Spin->buttonApply->setFocus();
+ }
+ else if(send == Group3Spin->SpinBox_DZ) {
+ vx = Group3Spin->SpinBox_DX->GetValue();
+ vy = Group3Spin->SpinBox_DY->GetValue();
+ vz = newValue;
+ Group3Spin->buttonApply->setFocus();
+ }
+ else if(send == Group4Spin->SpinBox_DX) {
+ vx = newValue;
+ vy = Group4Spin->SpinBox_DY->GetValue();
+ vz = Group4Spin->SpinBox_DZ->GetValue();
+ vs = Group4Spin->SpinBox_DS->GetValue();
+ Group4Spin->buttonApply->setFocus();
+ }
+ else if(send == Group4Spin->SpinBox_DY) {
+ vx = Group4Spin->SpinBox_DX->GetValue();
+ vy = newValue;
+ vz = Group4Spin->SpinBox_DZ->GetValue();
+ vs = Group4Spin->SpinBox_DS->GetValue();
+ Group4Spin->buttonApply->setFocus();
+ }
+ else if(send == Group4Spin->SpinBox_DZ) {
+ vx = Group4Spin->SpinBox_DX->GetValue();
+ vy = Group4Spin->SpinBox_DY->GetValue();
+ vz = newValue;
+ vs = Group4Spin->SpinBox_DS->GetValue();
+ Group4Spin->buttonApply->setFocus();
+ }
+ else if(send == Group4Spin->SpinBox_DS) {
+ vx = Group4Spin->SpinBox_DX->GetValue();
+ vy = Group4Spin->SpinBox_DY->GetValue();
+ vz = Group4Spin->SpinBox_DZ->GetValue();
+ vs = newValue;
+ Group4Spin->buttonApply->setFocus();
+ }
+
+ if(myConstructorId == 0) { // SEGMENT
+ if(mySketchType == PT_ABS) {
+ myX = vx;
+ myY = vy;
+ }
+ else if(mySketchType == PT_RELATIVE) {
+ myDX = vx;
+ myDY = vy;
+ }
+ else if(mySketchType == DIR_ANGLE_LENGTH) {
+ myAngle = vx;
+ myLength = vy;
+ }
+ else if(mySketchType == DIR_ANGLE_X) {
+ myAngle = vx;
+ myX = vy;
+ }
+ else if(mySketchType == DIR_ANGLE_Y) {
+ myAngle = vx;
+ myY = vy;
+ }
+ else if(mySketchType == DIR_PER_LENGTH) {
+ myLength = vx;
+ }
+ else if(mySketchType == DIR_PER_X) {
+ myX = vx;
+ }
+ else if(mySketchType == DIR_PER_Y) {
+ myY = vx;
+ }
+ else if(mySketchType == DIR_TAN_LENGTH) {
+ myLength = vx;
+ }
+ else if(mySketchType == DIR_TAN_X) {
+ myX = vx;
+ }
+ else if(mySketchType == DIR_TAN_Y) {
+ myY = vx;
+ }
+ else if(mySketchType == DIR_DXDY_LENGTH) {
+ myDX = vx;
+ myDY = vy;
+ myLength = vz;
+ }
+ else if(mySketchType == DIR_DXDY_X) {
+ myDX = vx;
+ myDY = vy;
+ myX = vz;
+ }
+ else if(mySketchType == DIR_DXDY_Y) {
+ myDX = vx;
+ myDY = vy;
+ myY = vz;
+ }
+ }
+ else if(myConstructorId == 1) { // ARC
+ if(mySketchType == DIR_ANGLE_LENGTH) {
+ myAngle = vx;
+ myRadius = vy;
+ myLength = vz;
+ }
+ else if(mySketchType == DIR_PER_LENGTH) {
+ myRadius = vx;
+ myLength = vy;
+ }
+ else if(mySketchType == DIR_TAN_LENGTH) {
+ myRadius = vx;
+ myLength = vy;
+ }
+ else if(mySketchType == DIR_DXDY_LENGTH) {
+ myDX = vx;
+ myDY = vy;
+ myRadius = vz;
+ myLength = vs;
+ }
+ }
+
+ this->MakeSimulationAndDisplay();
+ return;
+}
+
+
+//=================================================================================
+// function : GetNewCommand()
+// purpose :
+//=================================================================================
+QString EntityGUI_SketcherDlg::GetNewCommand()
+{
+ QString myNewCommand = "";
+ if(mySketchState == FIRST_POINT)
+ return myNewCommand;
+
+ myNewCommand = ":";
+ if(myConstructorId == 0) { // SEGMENT
+ if(mySketchType == PT_ABS || mySketchType == PT_SEL)
+ myNewCommand = myNewCommand + "TT " + QString::number(myX) + " " + QString::number(myY);
+ if(mySketchType == PT_RELATIVE)
+ myNewCommand = myNewCommand + "T " + QString::number(myDX) + " " + QString::number(myDY);
+ if(mySketchType == DIR_ANGLE_LENGTH) {
+ myNewCommand = myNewCommand + "R " + QString::number(myAngle);
+ myNewCommand = myNewCommand + ":" + "L " + QString::number(myLength);
+ }
+ if(mySketchType == DIR_ANGLE_X) {
+ myNewCommand = myNewCommand + "R " + QString::number(myAngle);
+ myNewCommand = myNewCommand + ":" + "IX " + QString::number(myX);
+ }
+ if(mySketchType == DIR_ANGLE_Y) {
+ myNewCommand = myNewCommand + "R " + QString::number(myAngle);
+ myNewCommand = myNewCommand + ":" + "IY " + QString::number(myY);
+ }
+ if(mySketchType == DIR_PER_LENGTH) {
+ myNewCommand = myNewCommand + "R " + QString::number(90.0);
+ myNewCommand = myNewCommand + ":" + "L " + QString::number(myLength);
+ }
+ if(mySketchType == DIR_PER_X) {
+ myNewCommand = myNewCommand + "R " + QString::number(90.0);
+ myNewCommand = myNewCommand + ":" + "IX " + QString::number(myX);
+ }
+ if(mySketchType == DIR_PER_Y) {
+ myNewCommand = myNewCommand + "R " + QString::number(90.0);
+ myNewCommand = myNewCommand + ":" + "IY " + QString::number(myY);
+ }
+ if(mySketchType == DIR_TAN_LENGTH)
+ myNewCommand = myNewCommand + "L " + QString::number(myLength);
+ if(mySketchType == DIR_TAN_X)
+ myNewCommand = myNewCommand + "IX " + QString::number(myX);
+ if(mySketchType == DIR_TAN_Y)
+ myNewCommand = myNewCommand + "IY " + QString::number(myY);
+ if(mySketchType == DIR_DXDY_LENGTH) {
+ myNewCommand = myNewCommand + "D " + QString::number(myDX) + " " + QString::number(myDY);
+ myNewCommand = myNewCommand + ":" + "L " + QString::number(myLength);
+ }
+ if(mySketchType == DIR_DXDY_X) {
+ myNewCommand = myNewCommand + "D " + QString::number(myDX) + " " + QString::number(myDY);
+ myNewCommand = myNewCommand + ":" + "IX " + QString::number(myX);
+ }
+ if(mySketchType == DIR_DXDY_Y) {
+ myNewCommand = myNewCommand + "D " + QString::number(myDX) + " " + QString::number(myDY);
+ myNewCommand = myNewCommand + ":" + "IY " + QString::number(myY);
+ }
+ }
+ else if(myConstructorId == 1) { // ARC
+ if(mySketchType == DIR_ANGLE_LENGTH) {
+ myNewCommand = myNewCommand + "R " + QString::number(myAngle);
+ myNewCommand = myNewCommand + ":" + "C " + QString::number(myRadius) + " " + QString::number(myLength);
+ }
+ if(mySketchType == DIR_PER_LENGTH) {
+ myNewCommand = myNewCommand + "R " + QString::number(90.0);
+ myNewCommand = myNewCommand + ":" + "C " + QString::number(myRadius) + " " + QString::number(myLength);
+ }
+ if(mySketchType == DIR_TAN_LENGTH) {
+ myNewCommand = myNewCommand + "C " + QString::number(myRadius) + " " + QString::number(myLength);
+ }
+ if(mySketchType == DIR_DXDY_LENGTH) {
+ myNewCommand = myNewCommand + "D " + QString::number(myDX) + " " + QString::number(myDY);
+ myNewCommand = myNewCommand + ":" + "C " + QString::number(myRadius) + " " + QString::number(myLength);
+ }
+ }
+ return myNewCommand;
+}
+
+
+//=================================================================================
+// function : MakeSimulationAndDisplay()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::MakeSimulationAndDisplay()
+{
+ myEntityGUI->EraseSimulationShape();
+ mySimulationTopoDs1.Nullify();
+ mySimulationTopoDs2.Nullify();
+
+ try {
+ if(mySketchState == FIRST_POINT) {
+ myCommand = "Sketch ";
+ myCommand = myCommand + ":" + "F " + QString::number(myX) + " " + QString::number(myY);
+
+ myLastX1 = myX;
+ myLastY1 = myY;
+
+ }
+
+ Sketcher_Profile aProfile1 (myCommand.ascii());
+
+ if(aProfile1.IsDone()) {
+ myShape = aProfile1.GetShape();
+ mySimulationTopoDs1 = myShape;
+ }
+
+ if(mySketchState != FIRST_POINT) {
+ if(mySketchState == SECOND_POINT) {
+ gp_Pnt pt = BRep_Tool::Pnt(TopoDS::Vertex(myShape));
+ myLastX1 = pt.X();
+ myLastY1 = pt.Y();
+ }
+ else {
+ TopoDS_Vertex V1, V2;
+ TopExp::Vertices(TopoDS::Wire(myShape), V1, V2);
+ gp_Pnt pt = BRep_Tool::Pnt(V2);
+ myLastX1 = pt.X();
+ myLastY1 = pt.Y();
+ if(myLastOp == 1) { // ARC
+ myLastDir = aProfile1.GetLastDir();
+ myLastX2 = myLastX1 - myLastDir.X();
+ myLastY2 = myLastY1 - myLastDir.Y();
+ }
+ }
+ QString myNewCommand = "Sketch ";
+ myNewCommand = myNewCommand + ":" + "F " + QString::number(myLastX1) + " " + QString::number(myLastY1);
+ if(mySketchState != SECOND_POINT && !((myLastX1 - myLastX2) == 0 && (myLastY1 - myLastY2) == 0))
+ myNewCommand = myNewCommand + ":" + "D " + QString::number(myLastX1 - myLastX2) + " " + QString::number(myLastY1 - myLastY2);
+ myNewCommand = myNewCommand + this->GetNewCommand();
+ Sketcher_Profile aProfile2 (myNewCommand.ascii());
+ if(aProfile2.IsDone())
+ mySimulationTopoDs2 = aProfile2.GetShape();
+
+ if ( mySimulationTopoDs2.IsNull() ) {
+ if ( Group1Sel->isVisible() ) {
+ Group1Sel->buttonApply->setEnabled(false);
+ Group1Sel->buttonApply->setFocus();
+ }
+ if ( Group1Spin->isVisible() ) {
+ Group1Spin->buttonApply->setEnabled(false);
+ Group1Spin->buttonApply->setFocus();
+ }
+ if ( Group2Spin->isVisible() ) {
+ Group2Spin->buttonApply->setEnabled(false);
+ Group2Spin->buttonApply->setFocus();
+ }
+ if ( Group3Spin->isVisible() ) {
+ Group3Spin->buttonApply->setEnabled(false);
+ Group3Spin->buttonApply->setFocus();
+ }
+ if ( Group4Spin->isVisible() ) {
+ Group4Spin->buttonApply->setEnabled(false);
+ Group4Spin->buttonApply->setFocus();
+ }
+ } else {
+ if ( Group1Sel->isVisible() ) {
+ Group1Sel->buttonApply->setEnabled(true);
+ Group1Sel->buttonApply->setFocus();
+ }
+ if ( Group1Spin->isVisible() ) {
+ Group1Spin->buttonApply->setEnabled(true);
+ Group1Spin->buttonApply->setFocus();
+ }
+ if ( Group2Spin->isVisible() ) {
+ Group2Spin->buttonApply->setEnabled(true);
+ Group2Spin->buttonApply->setFocus();
+ }
+ if ( Group3Spin->isVisible() ) {
+ Group3Spin->buttonApply->setEnabled(true);
+ Group3Spin->buttonApply->setFocus();
+ }
+ if ( Group4Spin->isVisible() ) {
+ Group4Spin->buttonApply->setEnabled(true);
+ Group4Spin->buttonApply->setFocus();
+ }
+ }
+ }
+
+ myEntityGUI->DisplaySimulationShape(mySimulationTopoDs1, mySimulationTopoDs2);
+ }
+ catch(Standard_Failure) {
+ MESSAGE("Exception catched in MakeSimulationAndDisplay");
+ return;
+ }
+ return;
+}
diff --git a/src/EntityGUI/EntityGUI_SketcherDlg.h b/src/EntityGUI/EntityGUI_SketcherDlg.h
new file mode 100644
index 000000000..2da62fe81
--- /dev/null
+++ b/src/EntityGUI/EntityGUI_SketcherDlg.h
@@ -0,0 +1,149 @@
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_SketcherDlg.h
+// Author : Damine COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef ENTITYGUI_SKETCHERDLG_H
+#define ENTITYGUI_SKETCHERDLG_H
+
+#include "EntityGUI_Skeleton_QTD.h"
+#include "EntityGUI_Point_QTD.h"
+#include "EntityGUI_Dir1_QTD.h"
+#include "EntityGUI_Dir2_QTD.h"
+
+#include "EntityGUI_1Sel_QTD.h"
+#include "EntityGUI_1Spin.h"
+#include "EntityGUI_2Spin.h"
+#include "EntityGUI_3Spin.h"
+#include "EntityGUI_4Spin.h"
+
+#include "EntityGUI.h"
+
+#include "GEOM_ShapeTypeFilter.hxx"
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+//=================================================================================
+// class : EntityGUI_Dlg
+// purpose :
+//=================================================================================
+class EntityGUI_SketcherDlg : public EntityGUI_Skeleton_QTD
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_SketcherDlg(QWidget* parent = 0, const char* name = 0, EntityGUI* theEntityGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
+ ~EntityGUI_SketcherDlg();
+
+private :
+ void Init();
+ void enterEvent(QEvent* e);
+ void closeEvent(QCloseEvent* e);
+ void InitClick();
+ void MakeSimulationAndDisplay();
+ QString GetNewCommand();
+
+ EntityGUI* myEntityGUI;
+
+ double step;
+ int myConstructorId;
+ int myConstructorDirId;
+ int mySketchType;
+ int mySketchState;
+ Handle(GEOM_ShapeTypeFilter) myVertexFilter;
+
+ TopoDS_Shape mySimulationTopoDs1; /* Shape used for simulation display */
+ TopoDS_Shape mySimulationTopoDs2; /* Shape used for simulation display */
+ QLineEdit* myEditCurrentArgument; /* Current LineEdit */
+ SALOME_Selection* mySelection; /* User shape selection */
+ GEOM::GEOM_Gen_var myGeom; /* Current GeomI object */
+ GEOMBase* myGeomBase;
+ GEOMContext* myGeomGUI; /* Current GeomGUI object */
+
+ int myLastOp;
+ QString myCommand;
+ QString myLastCommand;
+ TopoDS_Shape myShape;
+ gp_Dir myLastDir;
+
+ Standard_Real myX;
+ Standard_Real myY;
+ Standard_Real myDX;
+ Standard_Real myDY;
+ Standard_Real myLastX1;
+ Standard_Real myLastY1;
+ Standard_Real myLastX2;
+ Standard_Real myLastY2;
+ Standard_Real myLength;
+ Standard_Real myAngle;
+ Standard_Real myRadius;
+
+ EntityGUI_Point_QTD* GroupPt;
+ EntityGUI_Dir1_QTD* GroupD1;
+ EntityGUI_Dir2_QTD* GroupD2;
+
+ EntityGUI_1Sel_QTD* Group1Sel;
+ EntityGUI_1Spin* Group1Spin;
+ EntityGUI_2Spin* Group2Spin;
+ EntityGUI_3Spin* Group3Spin;
+ EntityGUI_4Spin* Group4Spin;
+
+ enum SketchState {FIRST_POINT, SECOND_POINT, NEXT_POINT};
+
+ enum SketchType {PT_ABS, PT_RELATIVE, PT_SEL,
+ DIR_ANGLE_LENGTH, DIR_ANGLE_X, DIR_ANGLE_Y,
+ DIR_PER_LENGTH, DIR_PER_X, DIR_PER_Y,
+ DIR_TAN_LENGTH, DIR_TAN_X, DIR_TAN_Y,
+ DIR_DXDY_LENGTH, DIR_DXDY_X, DIR_DXDY_Y};
+
+private slots:
+ void ClickOnEnd();
+ void ClickOnClose();
+ void ClickOnCancel();
+ void ClickOnApply();
+ void ClickOnUndo();
+ void LineEditReturnPressed();
+ void SelectionIntoArgument();
+ void SetEditCurrentArgument();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void TypeClicked(int constructorId);
+ void DestClicked(int constructorId);
+ void PointClicked(int constructorId);
+ void Dir1Clicked(int constructorId);
+ void Dir2Clicked(int constructorId);
+ void ValueChangedInSpinBox(double newValue);
+
+};
+
+#endif // ENTITYGUI_SKETCHERDLG_H
diff --git a/src/EntityGUI/Makefile.in b/src/EntityGUI/Makefile.in
index 7a82dddd1..78574444c 100644
--- a/src/EntityGUI/Makefile.in
+++ b/src/EntityGUI/Makefile.in
@@ -41,10 +41,38 @@ LIB = libEntityGUI.la
EXPORT_HEADERS=
LIB_SRC = EntityGUI.cxx \
+ EntityGUI_Skeleton_QTD.cxx \
+ EntityGUI_Point_QTD.cxx \
+ EntityGUI_Dir1_QTD.cxx \
+ EntityGUI_Dir2_QTD.cxx \
+ EntityGUI_1Sel_QTD.cxx \
+ EntityGUI_1Spin_QTD.cxx \
+ EntityGUI_2Spin_QTD.cxx \
+ EntityGUI_3Spin_QTD.cxx \
+ EntityGUI_4Spin_QTD.cxx \
+ EntityGUI_1Spin.cxx \
+ EntityGUI_2Spin.cxx \
+ EntityGUI_3Spin.cxx \
+ EntityGUI_4Spin.cxx \
+ EntityGUI_SketcherDlg.cxx \
EntityGUI_SubShapeDlg.cxx
LIB_MOC = \
EntityGUI.h \
+ EntityGUI_Skeleton_QTD.h \
+ EntityGUI_Point_QTD.h \
+ EntityGUI_Dir1_QTD.h \
+ EntityGUI_Dir2_QTD.h \
+ EntityGUI_1Sel_QTD.h \
+ EntityGUI_1Spin_QTD.h \
+ EntityGUI_2Spin_QTD.h \
+ EntityGUI_3Spin_QTD.h \
+ EntityGUI_4Spin_QTD.h \
+ EntityGUI_1Spin.h \
+ EntityGUI_2Spin.h \
+ EntityGUI_3Spin.h \
+ EntityGUI_4Spin.h \
+ EntityGUI_SketcherDlg.h \
EntityGUI_SubShapeDlg.h
LIB_CLIENT_IDL = GEOM_Kinematic.idl
@@ -56,6 +84,6 @@ LIB_SERVER_IDL =
CPPFLAGS += $(QT_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
-LDFLAGS += -lGEOMFiltersSelection -lDisplayGUI
+LDFLAGS += -lGEOMFiltersSelection -lDisplayGUI -lGEOMSketcher
@CONCLUDE@
diff --git a/src/GEOM/GEOM_Animation_i.cc b/src/GEOM/GEOM_Animation_i.cc
index 1007a50d1..19ba20b60 100644
--- a/src/GEOM/GEOM_Animation_i.cc
+++ b/src/GEOM/GEOM_Animation_i.cc
@@ -26,16 +26,16 @@
// Module : GEOM
// $Header$
-using namespace std;
+
#include "GEOM_Animation_i.hh"
+using namespace std;
+
//=================================================================================
// function : GEOM_Animation_i() constructor (no arguments)
// purpose : for what now ?
//=================================================================================
-GEOM_Animation_i::GEOM_Animation_i()
-{
-}
+GEOM_Animation_i::GEOM_Animation_i() {}
//=================================================================================
@@ -64,46 +64,6 @@ GEOM_Animation_i::GEOM_Animation_i(Kinematic_Animation* Animation,
GEOM_Animation_i::~GEOM_Animation_i() { delete &_Animation; }
-//=================================================================================
-// function : GetAssembly()
-// purpose :
-//=================================================================================
-GEOM::GEOM_Assembly_ptr GEOM_Animation_i::GetAssembly() throw(SALOME::SALOME_Exception)
-{
- return GEOM::GEOM_Assembly::_duplicate(_Ass);
-}
-
-
-//=================================================================================
-// function : GetFrame()
-// purpose :
-//=================================================================================
-GEOM::GEOM_Shape_ptr GEOM_Animation_i::GetFrame() throw(SALOME::SALOME_Exception)
-{
- return GEOM::GEOM_Shape::_duplicate(_Frame);
-}
-
-
-//=================================================================================
-// function : GetDuration()
-// purpose :
-//=================================================================================
-CORBA::Double GEOM_Animation_i::GetDuration() throw(SALOME::SALOME_Exception)
-{
- return _Animation->Duration();
-}
-
-
-//=================================================================================
-// function : GetNbSeq()
-// purpose :
-//=================================================================================
-CORBA::Long GEOM_Animation_i::GetNbSeq() throw(SALOME::SALOME_Exception)
-{
- return _Animation->NbSeq();
-}
-
-
//=================================================================================
// function : Name (set method)
// purpose : to set the attribute 'name'.
@@ -116,32 +76,12 @@ void GEOM_Animation_i::Name(const char* name)
}
-//=================================================================================
-// function : Name (get method)
-// purpose : to get the attribute 'name' of this shape
-//=================================================================================
-char* GEOM_Animation_i::Name() { return strdup(_name); }
-
-
-//=================================================================================
-// function : ShapeId
-// purpose : to get the id of this shape from GEOM (OCAF entry)
-//=================================================================================
-char* GEOM_Animation_i::ShapeId() { return strdup(_shapeid); }
-
-
//=================================================================================
// function : ShapeId (set method)
// purpose : to set the id of this shape in GEOM/OCAF doc
//=================================================================================
-void GEOM_Animation_i::ShapeId(const char * shapeid) { _shapeid = strdup(shapeid); }
-
-
-//=================================================================================
-// function : StudyShapeId (get method)
-// purpose : to get the id of this shape from the study document (OCAF entry)
-//=================================================================================
-char* GEOM_Animation_i::StudyShapeId() { return strdup(_studyshapeid) ; }
+void GEOM_Animation_i::ShapeId(const char * shapeid)
+{ _shapeid = strdup(shapeid); }
//=================================================================================
@@ -150,3 +90,61 @@ char* GEOM_Animation_i::StudyShapeId() { return strdup(_studyshapeid) ; }
//=================================================================================
void GEOM_Animation_i::StudyShapeId(const char * studyshapeid)
{ _studyshapeid = strdup(studyshapeid); }
+
+
+//=================================================================================
+// function : GetDisplacement()
+// purpose :
+//=================================================================================
+GEOM::ListOfDouble* GEOM_Animation_i::GetDisplacement(GEOM::GEOM_Contact_ptr aContact)
+ throw(SALOME::SALOME_Exception)
+{
+ cout<<"GEOM_Animation_i::GetDisplacement"<length(12);
+
+ GEOM::ListOfContact_var aContactList = _Ass->GetContactList();
+ int aKContact = 0;
+ for(int i = 0; i < _Ass->NbContacts(); i++) {
+ if(aContact == aContactList[i])
+ aKContact = i;
+ }
+
+ cout<<"GEOM_Animation_i::GetDisplacement : Contact = "< aList = _Animation->GetDisplacement(aKContact);
+ list ::const_iterator it = aList.begin();
+ int k = 0;
+ while(it != aList.end()) {
+ cout<<"GEOM_Animation_i::GetDisplacement : k = "<GetContactList();
+ int aKContact = 0;
+ for(int i = 0; i < _Ass->NbContacts(); i++) {
+ if(aContact == aContactList[i])
+ aKContact = i;
+ }
+
+ list aKList;
+ for(int j = 0; j < 12; j++)
+ aKList.push_back(aList[j]);
+
+ _Animation->SetDisplacement(aKContact, aKList);
+
+ return;
+}
diff --git a/src/GEOM/GEOM_Animation_i.hh b/src/GEOM/GEOM_Animation_i.hh
index 4cc925f65..f425771cf 100644
--- a/src/GEOM/GEOM_Animation_i.hh
+++ b/src/GEOM/GEOM_Animation_i.hh
@@ -62,25 +62,32 @@ private:
char* _studyshapeid; // exists only if added in the study document
public:
- GEOM::GEOM_Assembly_ptr GetAssembly()
+ GEOM::GEOM_Assembly_ptr GetAssembly() throw (SALOME::SALOME_Exception)
+ {return GEOM::GEOM_Assembly::_duplicate(_Ass);};
+
+ GEOM::GEOM_Shape_ptr GetFrame() throw (SALOME::SALOME_Exception)
+ {return GEOM::GEOM_Shape::_duplicate(_Frame);};
+
+ CORBA::Double GetDuration() throw (SALOME::SALOME_Exception)
+ {return _Animation->GetDuration();};
+
+ CORBA::Long GetNbSeq() throw (SALOME::SALOME_Exception)
+ {return _Animation->GetNbSeq();};
+
+ GEOM::ListOfDouble* GetDisplacement(GEOM::GEOM_Contact_ptr aContact)
throw (SALOME::SALOME_Exception);
- GEOM::GEOM_Shape_ptr GetFrame()
+ void SetDisplacement(GEOM::GEOM_Contact_ptr aContact,
+ const GEOM::ListOfDouble& aList)
throw (SALOME::SALOME_Exception);
- CORBA::Double GetDuration()
- throw (SALOME::SALOME_Exception);
-
- CORBA::Long GetNbSeq()
- throw (SALOME::SALOME_Exception);
-
- char* Name();
+ char* Name() {return strdup(_name);};
void Name(const char* name);
- char* ShapeId();
+ char* ShapeId() {return strdup(_shapeid);};
void ShapeId(const char* shapeid);
- char* StudyShapeId();
+ char* StudyShapeId() {return strdup(_studyshapeid);};
void StudyShapeId(const char* studyshapeid);
};
diff --git a/src/GEOM/GEOM_Assembly_i.cc b/src/GEOM/GEOM_Assembly_i.cc
index bd151fd88..ee7af41bc 100644
--- a/src/GEOM/GEOM_Assembly_i.cc
+++ b/src/GEOM/GEOM_Assembly_i.cc
@@ -26,16 +26,15 @@
// Module : GEOM
// $Header$
-using namespace std;
#include "GEOM_Assembly_i.hh"
+using namespace std;
+
//=================================================================================
// function : GEOM_Assembly_i() constructor (no arguments)
// purpose : for what now ?
//=================================================================================
-GEOM_Assembly_i::GEOM_Assembly_i()
-{
-}
+GEOM_Assembly_i::GEOM_Assembly_i() {}
//=================================================================================
@@ -63,6 +62,34 @@ GEOM_Assembly_i::GEOM_Assembly_i(Kinematic_Assembly* Ass)
GEOM_Assembly_i::~GEOM_Assembly_i() { delete &_Ass; }
+//=================================================================================
+// function : Name (set method)
+// purpose : to set the attribute 'name'.
+// : WARNING : Register to naming service actually removed !
+//=================================================================================
+void GEOM_Assembly_i::Name(const char* name)
+{
+ _name = strdup(name);
+ GEOM::GEOM_Assembly_ptr g = GEOM::GEOM_Assembly::_narrow(_this());
+}
+
+
+//=================================================================================
+// function : ShapeId (set method)
+// purpose : to set the id of this shape in GEOM/OCAF doc
+//=================================================================================
+void GEOM_Assembly_i::ShapeId(const char * shapeid)
+{ _shapeid = strdup(shapeid); }
+
+
+//=================================================================================
+// function : StudyShapeId (set method)
+// purpose : to set the id of this shape in the Study document (OCAF entry)
+//=================================================================================
+void GEOM_Assembly_i::StudyShapeId(const char * studyshapeid)
+{ _studyshapeid = strdup(studyshapeid); }
+
+
//=================================================================================
// function : AddContact()
// purpose :
@@ -84,66 +111,8 @@ GEOM::ListOfContact* GEOM_Assembly_i::GetContactList() throw(SALOME::SALOME_Exce
{
GEOM::ListOfContact_var aContactList = new GEOM::ListOfContact;
aContactList->length(_aContactList.length());
- for(int i = 0; i < _NbContact; i++) {
+ for(int i = 0; i < _NbContact; i++)
aContactList[i] = GEOM::GEOM_Contact::_duplicate(_aContactList[i]);
- }
+
return aContactList._retn();
}
-
-
-//=================================================================================
-// function : NbContacts()
-// purpose :
-//=================================================================================
-CORBA::Long GEOM_Assembly_i::NbContacts() throw(SALOME::SALOME_Exception)
-{
- return _NbContact;
-}
-
-
-//=================================================================================
-// function : Name (set method)
-// purpose : to set the attribute 'name'.
-// : WARNING : Register to naming service actually removed !
-//=================================================================================
-void GEOM_Assembly_i::Name(const char* name)
-{
- _name = strdup(name);
- GEOM::GEOM_Assembly_ptr g = GEOM::GEOM_Assembly::_narrow(_this());
-}
-
-
-//=================================================================================
-// function : Name (get method)
-// purpose : to get the attribute 'name' of this shape
-//=================================================================================
-char* GEOM_Assembly_i::Name() { return strdup(_name); }
-
-
-//=================================================================================
-// function : ShapeId
-// purpose : to get the id of this shape from GEOM (OCAF entry)
-//=================================================================================
-char* GEOM_Assembly_i::ShapeId() { return strdup(_shapeid); }
-
-
-//=================================================================================
-// function : ShapeId (set method)
-// purpose : to set the id of this shape in GEOM/OCAF doc
-//=================================================================================
-void GEOM_Assembly_i::ShapeId(const char * shapeid) { _shapeid = strdup(shapeid); }
-
-
-//=================================================================================
-// function : StudyShapeId (get method)
-// purpose : to get the id of this shape from the study document (OCAF entry)
-//=================================================================================
-char* GEOM_Assembly_i::StudyShapeId() { return strdup(_studyshapeid) ; }
-
-
-//=================================================================================
-// function : StudyShapeId (set method)
-// purpose : to set the id of this shape in the Study document (OCAF entry)
-//=================================================================================
-void GEOM_Assembly_i::StudyShapeId(const char * studyshapeid)
-{ _studyshapeid = strdup(studyshapeid); }
diff --git a/src/GEOM/GEOM_Assembly_i.hh b/src/GEOM/GEOM_Assembly_i.hh
index 288b33fe6..00dc49c78 100644
--- a/src/GEOM/GEOM_Assembly_i.hh
+++ b/src/GEOM/GEOM_Assembly_i.hh
@@ -66,16 +66,16 @@ public:
GEOM::ListOfContact* GetContactList()
throw (SALOME::SALOME_Exception);
- CORBA::Long NbContacts()
- throw (SALOME::SALOME_Exception);
+ CORBA::Long NbContacts() throw (SALOME::SALOME_Exception)
+ {return _NbContact;};
- char* Name();
+ char* Name() {return strdup(_name);};
void Name(const char* name);
- char* ShapeId();
+ char* ShapeId() {return strdup(_shapeid);};
void ShapeId(const char* shapeid);
- char* StudyShapeId();
+ char* StudyShapeId() {return strdup(_studyshapeid);};
void StudyShapeId(const char* studyshapeid);
};
diff --git a/src/GEOM/GEOM_Contact_i.cc b/src/GEOM/GEOM_Contact_i.cc
index 051118a14..c92caeae9 100644
--- a/src/GEOM/GEOM_Contact_i.cc
+++ b/src/GEOM/GEOM_Contact_i.cc
@@ -26,19 +26,17 @@
// Module : GEOM
// $Header$
-using namespace std;
#include "GEOM_Contact_i.hh"
-#include "GEOM_Position_i.hh"
-#include "GEOM_Rotation_i.hh"
-#include "GEOM_Translation_i.hh"
+
+#include "utilities.h"
+
+using namespace std;
//=================================================================================
// function : GEOM_Contact_i() constructor (no arguments)
// purpose : for what now ?
//=================================================================================
-GEOM_Contact_i::GEOM_Contact_i()
-{
-}
+GEOM_Contact_i::GEOM_Contact_i() {}
//=================================================================================
@@ -47,45 +45,17 @@ GEOM_Contact_i::GEOM_Contact_i()
//=================================================================================
GEOM_Contact_i::GEOM_Contact_i(Kinematic_Contact* Contact,
GEOM::GEOM_Shape_ptr Shape1,
- GEOM::GEOM_Shape_ptr Shape2,
- GEOM::GEOM_Gen_ptr engine)
+ GEOM::GEOM_Shape_ptr Shape2)
{
_Contact = Contact;
_Shape1 = GEOM::GEOM_Shape::_duplicate(Shape1);
_Shape2 = GEOM::GEOM_Shape::_duplicate(Shape2);
- GEOM::PointStruct p0 = engine->MakePointStruct(Contact->Position().Origin().X(),
- Contact->Position().Origin().Y(),
- Contact->Position().Origin().Z());
- GEOM::PointStruct pX = engine->MakePointStruct(Contact->Position().DirX().X(),
- Contact->Position().DirX().Y(),
- Contact->Position().DirX().Z());
- GEOM::PointStruct pY = engine->MakePointStruct(Contact->Position().DirY().X(),
- Contact->Position().DirY().Y(),
- Contact->Position().DirY().Z());
- GEOM::PointStruct pZ = engine->MakePointStruct(Contact->Position().DirZ().X(),
- Contact->Position().DirZ().Y(),
- Contact->Position().DirZ().Z());
- GEOM::DirStruct VX = engine->MakeDirection(pX);
- GEOM::DirStruct VY = engine->MakeDirection(pY);
- GEOM::DirStruct VZ = engine->MakeDirection(pZ);
- GEOM_Position_i * Position_servant = new GEOM_Position_i(p0, VX, VY, VZ);
- _Position = GEOM::GEOM_Position::_narrow(Position_servant->_this());
-
- GEOM_Rotation_i * Rotation_servant = new GEOM_Rotation_i(Contact->Rotation().Rot1(),
- Contact->Rotation().Rot2(),
- Contact->Rotation().Rot3(),
- Contact->Rotation().ValX(),
- Contact->Rotation().ValY(),
- Contact->Rotation().ValZ());
- _Rotation = GEOM::GEOM_Rotation::_narrow(Rotation_servant->_this());
- GEOM_Translation_i * Translation_servant = new GEOM_Translation_i(0, 0, 0);
- _Translation = GEOM::GEOM_Translation::_narrow(Translation_servant->_this());
-
_shapeid = "";
_studyshapeid = "";
-
_name = "";
+
+ return;
}
@@ -96,76 +66,6 @@ GEOM_Contact_i::GEOM_Contact_i(Kinematic_Contact* Contact,
GEOM_Contact_i::~GEOM_Contact_i() { delete &_Contact; }
-//=================================================================================
-// function : GetType()
-// purpose :
-//=================================================================================
-CORBA::Long GEOM_Contact_i::GetType() throw(SALOME::SALOME_Exception)
-{
- return _Contact->Type();
-}
-
-
-//=================================================================================
-// function : GetShape1()
-// purpose :
-//=================================================================================
-GEOM::GEOM_Shape_ptr GEOM_Contact_i::GetShape1() throw(SALOME::SALOME_Exception)
-{
- return GEOM::GEOM_Shape::_duplicate(_Shape1);
-}
-
-
-//=================================================================================
-// function : GetShape2()
-// purpose :
-//=================================================================================
-GEOM::GEOM_Shape_ptr GEOM_Contact_i::GetShape2() throw(SALOME::SALOME_Exception)
-{
- return GEOM::GEOM_Shape::_duplicate(_Shape2);
-}
-
-
-//=================================================================================
-// function : GetPosition()
-// purpose :
-//=================================================================================
-GEOM::GEOM_Position_ptr GEOM_Contact_i::GetPosition() throw(SALOME::SALOME_Exception)
-{
- return GEOM::GEOM_Position::_duplicate(_Position);
-}
-
-
-//=================================================================================
-// function : GetRotation()
-// purpose :
-//=================================================================================
-GEOM::GEOM_Rotation_ptr GEOM_Contact_i::GetRotation() throw(SALOME::SALOME_Exception)
-{
- return GEOM::GEOM_Rotation::_duplicate(_Rotation);
-}
-
-
-//=================================================================================
-// function : GetTranslation()
-// purpose :
-//=================================================================================
-GEOM::GEOM_Translation_ptr GEOM_Contact_i::GetTranslation() throw(SALOME::SALOME_Exception)
-{
- return GEOM::GEOM_Translation::_duplicate(_Translation);
-}
-
-
-//=================================================================================
-// function : GetStep()
-// purpose :
-//=================================================================================
-CORBA::Double GEOM_Contact_i::GetStep() throw(SALOME::SALOME_Exception)
-{
- return _Contact->Step();
-}
-
-
//=================================================================================
// function : Name (set method)
// purpose : to set the attribute 'name'.
@@ -178,32 +78,12 @@ void GEOM_Contact_i::Name(const char* name)
}
-//=================================================================================
-// function : Name (get method)
-// purpose : to get the attribute 'name' of this shape
-//=================================================================================
-char* GEOM_Contact_i::Name() { return strdup(_name); }
-
-
-//=================================================================================
-// function : ShapeId
-// purpose : to get the id of this shape from GEOM (OCAF entry)
-//=================================================================================
-char* GEOM_Contact_i::ShapeId() { return strdup(_shapeid); }
-
-
//=================================================================================
// function : ShapeId (set method)
// purpose : to set the id of this shape in GEOM/OCAF doc
//=================================================================================
-void GEOM_Contact_i::ShapeId(const char * shapeid) { _shapeid = strdup(shapeid); }
-
-
-//=================================================================================
-// function : StudyShapeId (get method)
-// purpose : to get the id of this shape from the study document (OCAF entry)
-//=================================================================================
-char* GEOM_Contact_i::StudyShapeId() { return strdup(_studyshapeid) ; }
+void GEOM_Contact_i::ShapeId(const char * shapeid)
+{ _shapeid = strdup(shapeid); }
//=================================================================================
@@ -212,3 +92,162 @@ char* GEOM_Contact_i::StudyShapeId() { return strdup(_studyshapeid) ; }
//=================================================================================
void GEOM_Contact_i::StudyShapeId(const char * studyshapeid)
{ _studyshapeid = strdup(studyshapeid); }
+
+
+//=================================================================================
+// function : GetPosition()
+// purpose :
+//=================================================================================
+GEOM::ListOfDouble* GEOM_Contact_i::GetPosition() throw(SALOME::SALOME_Exception)
+{
+ GEOM::ListOfDouble_var aPositionList = new GEOM::ListOfDouble;
+ aPositionList->length(12);
+
+ aPositionList[0] = _Contact->GetPosition().GetOrigin().X();
+ aPositionList[1] = _Contact->GetPosition().GetOrigin().Y();
+ aPositionList[2] = _Contact->GetPosition().GetOrigin().Z();
+
+ aPositionList[3] = _Contact->GetPosition().GetDirX().X();
+ aPositionList[4] = _Contact->GetPosition().GetDirX().Y();
+ aPositionList[5] = _Contact->GetPosition().GetDirX().Z();
+
+ aPositionList[6] = _Contact->GetPosition().GetDirY().X();
+ aPositionList[7] = _Contact->GetPosition().GetDirY().Y();
+ aPositionList[8] = _Contact->GetPosition().GetDirY().Z();
+
+ aPositionList[9] = _Contact->GetPosition().GetDirZ().X();
+ aPositionList[10] = _Contact->GetPosition().GetDirZ().Y();
+ aPositionList[11] = _Contact->GetPosition().GetDirZ().Z();
+
+ return aPositionList._retn();
+}
+
+
+//=================================================================================
+// function : GetAngularRange()
+// purpose :
+//=================================================================================
+GEOM::ListOfDouble* GEOM_Contact_i::GetAngularRange() throw(SALOME::SALOME_Exception)
+{
+ GEOM::ListOfDouble_var anAngularRangeList = new GEOM::ListOfDouble;
+ anAngularRangeList->length(6);
+
+ anAngularRangeList[0] = _Contact->GetAngularRange().GetMinValX();
+ anAngularRangeList[1] = _Contact->GetAngularRange().GetMaxValX();
+
+ anAngularRangeList[2] = _Contact->GetAngularRange().GetMinValY();
+ anAngularRangeList[3] = _Contact->GetAngularRange().GetMaxValY();
+
+ anAngularRangeList[4] = _Contact->GetAngularRange().GetMinValZ();
+ anAngularRangeList[5] = _Contact->GetAngularRange().GetMaxValZ();
+
+ return anAngularRangeList._retn();
+}
+
+
+//=================================================================================
+// function : GetLinearRange()
+// purpose :
+//=================================================================================
+GEOM::ListOfDouble* GEOM_Contact_i::GetLinearRange() throw(SALOME::SALOME_Exception)
+{
+ GEOM::ListOfDouble_var aLinearRangeList = new GEOM::ListOfDouble;
+ aLinearRangeList->length(6);
+
+ aLinearRangeList[0] = _Contact->GetLinearRange().GetMinValX();
+ aLinearRangeList[1] = _Contact->GetLinearRange().GetMaxValX();
+
+ aLinearRangeList[2] = _Contact->GetLinearRange().GetMinValY();
+ aLinearRangeList[3] = _Contact->GetLinearRange().GetMaxValY();
+
+ aLinearRangeList[4] = _Contact->GetLinearRange().GetMinValZ();
+ aLinearRangeList[5] = _Contact->GetLinearRange().GetMaxValZ();
+
+ return aLinearRangeList._retn();
+}
+
+
+//=================================================================================
+// function : SetPosition()
+// purpose :
+//=================================================================================
+void GEOM_Contact_i::SetPosition(double P0x, double P0y, double P0z,
+ double VXx, double VXy, double VXz,
+ double VYx, double VYy, double VYz,
+ double VZx, double VZy, double VZz)
+ throw(SALOME::SALOME_Exception)
+{
+ gp_Pnt Center(P0x, P0y, P0z);
+ _Contact->GetPosition().SetOrigin(Center);
+
+ if(VXx == 0 && VXy == 0 && VXz == 0) {
+ MESSAGE("Null Vector in Contact Position (SetVX)."<GetPosition().SetDirX(aDirX);
+ }
+
+ if(VYx == 0 && VYy == 0 && VYz == 0) {
+ MESSAGE("Null Vector in Contact Position (SetVY)."<GetPosition().SetDirY(aDirY);
+ }
+
+ if(VZx == 0 && VZy == 0 && VZz == 0) {
+ MESSAGE("Null Vector in Contact Position (SetVZ)."<GetPosition().SetDirZ(aDirZ);
+ }
+
+ return;
+}
+
+
+//=================================================================================
+// function : SetAngularRange()
+// purpose :
+//=================================================================================
+void GEOM_Contact_i::SetAngularRange(double MinValX, double MaxValX,
+ double MinValY, double MaxValY,
+ double MinValZ, double MaxValZ)
+ throw(SALOME::SALOME_Exception)
+{
+ _Contact->GetAngularRange().SetRangeX(MinValX, MaxValX);
+ _Contact->GetAngularRange().SetRangeY(MinValY, MaxValY);
+ _Contact->GetAngularRange().SetRangeZ(MinValZ, MaxValZ);
+
+ if(_Contact->GetType() == 9) { //HELICOIDAL
+ double p = _Contact->GetStep() / 360;
+ _Contact->GetLinearRange().SetRangeX(p * MinValX, p * MaxValX);
+ _Contact->GetLinearRange().SetRangeY(p * MinValY, p * MaxValY);
+ _Contact->GetLinearRange().SetRangeZ(p * MinValZ, p * MaxValZ);
+ }
+
+ return;
+}
+
+
+//=================================================================================
+// function : SetLinearRange()
+// purpose :
+//=================================================================================
+void GEOM_Contact_i::SetLinearRange(double MinValX, double MaxValX,
+ double MinValY, double MaxValY,
+ double MinValZ, double MaxValZ)
+ throw(SALOME::SALOME_Exception)
+{
+ _Contact->GetLinearRange().SetRangeX(MinValX, MaxValX);
+ _Contact->GetLinearRange().SetRangeY(MinValY, MaxValY);
+ _Contact->GetLinearRange().SetRangeZ(MinValZ, MaxValZ);
+
+ if(_Contact->GetType() == 9) { //HELICOIDAL
+ double p = 360 / _Contact->GetStep();
+ _Contact->GetAngularRange().SetRangeX(p * MinValX, p * MaxValX);
+ _Contact->GetAngularRange().SetRangeY(p * MinValY, p * MaxValY);
+ _Contact->GetAngularRange().SetRangeZ(p * MinValZ, p * MaxValZ);
+ }
+
+ return;
+}
diff --git a/src/GEOM/GEOM_Contact_i.hh b/src/GEOM/GEOM_Contact_i.hh
index 6cd7ff94c..9e2ee826c 100644
--- a/src/GEOM/GEOM_Contact_i.hh
+++ b/src/GEOM/GEOM_Contact_i.hh
@@ -48,8 +48,7 @@ public:
GEOM_Contact_i();
GEOM_Contact_i(Kinematic_Contact* Contact,
GEOM::GEOM_Shape_ptr Shape1,
- GEOM::GEOM_Shape_ptr Shape2,
- GEOM::GEOM_Gen_ptr engine);
+ GEOM::GEOM_Shape_ptr Shape2);
~GEOM_Contact_i();
@@ -57,43 +56,51 @@ private:
Kinematic_Contact* _Contact;
GEOM::GEOM_Shape_ptr _Shape1;
GEOM::GEOM_Shape_ptr _Shape2;
- GEOM::GEOM_Position_ptr _Position;
- GEOM::GEOM_Rotation_ptr _Rotation;
- GEOM::GEOM_Translation_ptr _Translation;
char* _name;
char* _shapeid;
char* _studyshapeid; // exists only if added in the study document
public:
- CORBA::Long GetType()
+ CORBA::Long GetType() throw (SALOME::SALOME_Exception)
+ {return _Contact->GetType();};
+ CORBA::Double GetStep() throw (SALOME::SALOME_Exception)
+ {return _Contact->GetStep();};
+ GEOM::GEOM_Shape_ptr GetShape1() throw (SALOME::SALOME_Exception)
+ {return GEOM::GEOM_Shape::_duplicate(_Shape1);};
+ GEOM::GEOM_Shape_ptr GetShape2() throw (SALOME::SALOME_Exception)
+ {return GEOM::GEOM_Shape::_duplicate(_Shape2);};
+
+ GEOM::ListOfDouble* GetPosition()
+ throw (SALOME::SALOME_Exception);
+ GEOM::ListOfDouble* GetAngularRange()
+ throw (SALOME::SALOME_Exception);
+ GEOM::ListOfDouble* GetLinearRange()
throw (SALOME::SALOME_Exception);
- GEOM::GEOM_Shape_ptr GetShape1()
+ void SetPosition(double P0x, double P0y, double P0z,
+ double VXx, double VXy, double VXz,
+ double VYx, double VYy, double VYz,
+ double VZx, double VZy, double VZz)
throw (SALOME::SALOME_Exception);
- GEOM::GEOM_Shape_ptr GetShape2()
+ void SetAngularRange(double MinValX, double MaxValX,
+ double MinValY, double MaxValY,
+ double MinValZ, double MaxValZ)
throw (SALOME::SALOME_Exception);
- GEOM::GEOM_Position_ptr GetPosition()
+ void SetLinearRange(double MinValX, double MaxValX,
+ double MinValY, double MaxValY,
+ double MinValZ, double MaxValZ)
throw (SALOME::SALOME_Exception);
- GEOM::GEOM_Rotation_ptr GetRotation()
- throw (SALOME::SALOME_Exception);
-
- GEOM::GEOM_Translation_ptr GetTranslation()
- throw (SALOME::SALOME_Exception);
-
- CORBA::Double GetStep()
- throw (SALOME::SALOME_Exception);
-
- char* Name();
+ char* Name() {return strdup(_name);};
void Name(const char* name);
- char* ShapeId();
+ char* ShapeId() {return strdup(_shapeid);};
void ShapeId(const char* shapeid);
- char* StudyShapeId();
+ char* StudyShapeId() {return strdup(_studyshapeid) ;};
void StudyShapeId(const char* studyshapeid);
};
diff --git a/src/GEOM/GEOM_Gen_i.cc b/src/GEOM/GEOM_Gen_i.cc
index 48d910168..88301b077 100644
--- a/src/GEOM/GEOM_Gen_i.cc
+++ b/src/GEOM/GEOM_Gen_i.cc
@@ -31,6 +31,7 @@ using namespace std;
#include "Partition_Spliter.hxx"
#include "Archimede_VolumeSection.hxx"
+#include "Sketcher_Profile.hxx"
#include "Utils_CorbaException.hxx"
#include "utilities.h"
@@ -215,7 +216,7 @@ char* GEOM_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
{
GEOM::GEOM_Shape_var aShape = GEOM::GEOM_Shape::_narrow(_orb->string_to_object(IORString));
if (!CORBA::is_nil(aShape)) {
- return strdup(aShape->ShapeId());
+ return CORBA::string_dup(aShape->ShapeId());
}
GEOM::GEOM_Assembly_var aAssembly = GEOM::GEOM_Assembly::_narrow(_orb->string_to_object(IORString));
if (!CORBA::is_nil(aAssembly)) {
@@ -407,8 +408,7 @@ char* GEOM_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
}
/* Create the CORBA servant holding the TopoDS_Shape */
- GEOM::GEOM_Gen_ptr engine = POA_GEOM::GEOM_Gen::_this();
- GEOM_Contact_i * Contact_servant = new GEOM_Contact_i(Contact, aShape1, aShape2, engine);
+ GEOM_Contact_i * Contact_servant = new GEOM_Contact_i(Contact, aShape1, aShape2);
GEOM::GEOM_Contact_var result = GEOM::GEOM_Contact::_narrow(Contact_servant->_this());
/* Create and set the name (IOR of shape converted into a string) */
@@ -476,6 +476,7 @@ char* GEOM_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
result->ShapeId(aPersRefString);
return result->Name();
}
+ return 0 ;
}
//============================================================================
@@ -562,7 +563,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy,
aShapeName = "Vertex_";
}
if (strlen(theName) == 0) aShapeName += TCollection_AsciiString(aResultSO->Tag());
- else aShapeName = TCollection_AsciiString(strdup(theName));
+ else aShapeName = TCollection_AsciiString((char*)theName);
//Set a name of the added shape
anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeName");
@@ -645,7 +646,7 @@ CORBA::Boolean GEOM_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.ToCString(), aSeq.in(), true);
SALOMEDS::Study_var Study = theComponent->GetStudy();
- TCollection_AsciiString name( strdup(Study->Name()) );
+ TCollection_AsciiString name( Study->Name() );
int StudyID = Study->StudyId();
myStudyIDToDoc.Bind( StudyID, myCurrentOCAFDoc );
@@ -673,7 +674,7 @@ CORBA::Boolean GEOM_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
// void GEOM_Gen_i::Save(const char *IORSComponent, const char *aUrlOfFile)
// {
-// TCollection_ExtendedString path(strdup(aUrlOfFile));
+// TCollection_ExtendedString path((char*)aUrlOfFile);
// TCollection_ExtendedString pathWithExt = path + TCollection_ExtendedString(".sgd");
// myOCAFApp->SaveAs(myCurrentOCAFDoc,pathWithExt);
// }
@@ -686,14 +687,14 @@ CORBA::Boolean GEOM_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
// void GEOM_Gen_i::Load(const char *IORSComponent, const char *aUrlOfFile)
// {
-// TCollection_ExtendedString path(strdup(aUrlOfFile));
+// TCollection_ExtendedString path((char*)aUrlOfFile);
// TCollection_ExtendedString pathWithExt = path + TCollection_ExtendedString(".sgd");
// myOCAFApp->Open(pathWithExt,myCurrentOCAFDoc);
// SALOMEDS::SComponent_var SC = SALOMEDS::SComponent::_narrow(_orb->string_to_object(IORSComponent));
// SALOMEDS::Study_var Study = SC->GetStudy();
-// TCollection_AsciiString name( strdup(Study->Name()) );
+// TCollection_AsciiString name( Study->Name() );
// int StudyID = Study->StudyId();
// myStudyIDToDoc.Bind( StudyID, myCurrentOCAFDoc );
@@ -840,7 +841,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream,
//============================================================================
char* GEOM_Gen_i::ComponentDataType()
{
- return strdup("GEOM");
+ return CORBA::string_dup("GEOM");
}
//============================================================================
@@ -850,7 +851,7 @@ char* GEOM_Gen_i::ComponentDataType()
void GEOM_Gen_i::register_name(char * name)
{
GEOM::GEOM_Gen_ptr g = GEOM::GEOM_Gen::_narrow(POA_GEOM::GEOM_Gen::_this());
- name_service->Register(g, strdup(name));
+ name_service->Register(g, name);
}
@@ -889,7 +890,7 @@ TopoDS_Shape GEOM_Gen_i::GetTopoShape(GEOM::GEOM_Shape_ptr shape_ptr)
TDF_Label lab ;
Handle(TDF_Data) D = myCurrentOCAFDoc->GetData() ;
- TDF_Tool::Label( D, strdup(shape_ptr->ShapeId()), lab, true ) ;
+ TDF_Tool::Label( D, shape_ptr->ShapeId(), lab, true ) ;
Handle(TNaming_NamedShape) NamedShape ;
bool res = lab.FindAttribute(TNaming_NamedShape::GetID(), NamedShape) ;
@@ -939,7 +940,7 @@ const char * GEOM_Gen_i::InsertInLabel(TopoDS_Shape S, const char *mystr, Handle
{
GEOMDS_Commands GC(OCAFDoc->Main());
/* add attributs S and mystr in a new label */
- TDF_Label Lab = GC.AddShape (S, strdup(mystr));
+ TDF_Label Lab = GC.AddShape (S, (char*)mystr);
TCollection_AsciiString entry;
TDF_Tool::Entry(Lab,entry);
@@ -967,7 +968,7 @@ const char * GEOM_Gen_i::InsertInLabelDependentShape( TopoDS_Shape S,
TDF_Tool::Label(OCAFDoc->GetData(), mainshape_ptr->ShapeId(), mainRefLab);
/* add attributs : S, nameIor and ref to main */
- TDF_Label Lab = GC.AddDependentShape(S, strdup(nameIor), mainRefLab);
+ TDF_Label Lab = GC.AddDependentShape(S, (char*)nameIor, mainRefLab);
TCollection_AsciiString entry;
TDF_Tool::Entry(Lab, entry);
@@ -3003,7 +3004,6 @@ throw (SALOME::SALOME_Exception)
GEOM::GEOM_Shape_var aShape = GetIORFromString( ListTools[ind] );
TopoDS_Shape Shape = GetTopoShape(aShape);
if(Shape.IsNull() ) {
- //MESSAGE ( "In Partition a tool shape is null" );
THROW_SALOME_CORBA_EXCEPTION("In Partition a shape is null", SALOME::BAD_PARAM);
}
if ( !ShapesMap.Contains( Shape ) && ToolsMap.Add( Shape ))
@@ -3038,7 +3038,9 @@ throw (SALOME::SALOME_Exception)
PS.AddShape(Shape);
}
+ //MESSAGE ( "Partition::Compute() " );
PS.Compute ((TopAbs_ShapeEnum) Limit);
+ //MESSAGE ( "Partition::Compute() - END" );
// suppress result outside of shapes in KInsideMap
for (ind = 0; ind < ListKeepInside.length(); ind++) {
@@ -3164,6 +3166,7 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeFilling(GEOM::GEOM_Shape_ptr myShape,
THROW_SALOME_CORBA_EXCEPTION("Initial shape doesn't contain only edges !", SALOME::BAD_PARAM);
}
C = BRep_Tool::Curve(TopoDS::Edge(Scurrent), First, Last);
+ if (C.IsNull()) continue;
C = new Geom_TrimmedCurve(C, First, Last);
Section.AddCurve(C) ;
i++ ;
@@ -3637,7 +3640,7 @@ GEOM::GEOM_Gen::ListOfIOR* GEOM_Gen_i::GetReferencedObjects(GEOM::GEOM_Shape_ptr
Handle(TDataStd_Name) Att;
L.FindAttribute(TDataStd_Name::GetID(),Att);
TCollection_AsciiString nameIOR (Att->Get()) ;
- aList[i] = strdup( nameIOR.ToCString() );
+ aList[i] = CORBA::string_dup( nameIOR.ToCString() );
i++;
}
@@ -3687,7 +3690,7 @@ GEOM::GEOM_Gen::ListOfIOR* GEOM_Gen_i::GetObjects(GEOM::GEOM_Shape_ptr shape)
if (!Att->Get().IsEqual(TCollection_ExtendedString("Arguments")) ) {
TCollection_AsciiString nameIOR (Att->Get());
- aList[i] = strdup( nameIOR.ToCString() );
+ aList[i] = CORBA::string_dup( nameIOR.ToCString() );
i++;
}
ChildIterator1.Next();
@@ -3708,8 +3711,10 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::ImportBREP(const char* filename)
GEOM::GEOM_Shape_var result ;
try {
- BRep_Builder aBuilder;
- BRepTools::Read(tds, strdup(filename), aBuilder) ;
+ BRep_Builder aBuilder;
+ char* aCopyfilename = strdup(filename);
+ BRepTools::Read(tds, aCopyfilename, aBuilder) ;
+ free(aCopyfilename);
if (tds.IsNull()) {
THROW_SALOME_CORBA_EXCEPTION("Import BRep aborted", SALOME::BAD_PARAM);
}
@@ -3863,10 +3868,21 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeFaces(const GEOM::GEOM_Gen::ListOfIOR& List
FR.Perform();
if(FR.IsDone()) {
- for(; FR.More(); FR.Next())
- aBuilder.Add(C, FR.Current().Oriented(OriF));
- result = CreateObject(C);
- InsertInLabelMoreArguments(C, result, ListShapes, myCurrentOCAFDoc);
+ int k = 0;
+ TopoDS_Shape aFace;
+ for(; FR.More(); FR.Next()) {
+ aFace = FR.Current().Oriented(OriF);
+ aBuilder.Add(C, aFace);
+ k++;
+ }
+ if(k == 1) {
+ result = CreateObject(aFace);
+ InsertInLabelMoreArguments(aFace, result, ListShapes, myCurrentOCAFDoc);
+ }
+ else {
+ result = CreateObject(C);
+ InsertInLabelMoreArguments(C, result, ListShapes, myCurrentOCAFDoc);
+ }
}
}
}
@@ -4144,7 +4160,34 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeArc(const GEOM::PointStruct& pInit,
return result ;
}
-
+//=================================================================================
+ // function : MakeSketcher()
+ // purpose : Make a wire from a list containing many points
+ //=================================================================================
+ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeSketcher( const char *Cmd )
+ throw (SALOME::SALOME_Exception)
+ {
+ GEOM::GEOM_Shape_var result ;
+ TopoDS_Shape tds ;
+ try {
+ Sketcher_Profile aProfile (Cmd);
+ if(aProfile.IsDone())
+ tds = aProfile.GetShape();
+ }
+ catch(Standard_Failure) {
+ THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::MakeSketcher", SALOME::BAD_PARAM);
+ }
+
+ if (tds.IsNull()) {
+ THROW_SALOME_CORBA_EXCEPTION("MakeSketcher aborted : null shape", SALOME::BAD_PARAM);
+ }
+ else {
+ result = CreateObject(tds);
+ const char *entry = InsertInLabel(tds, result->Name(), myCurrentOCAFDoc) ;
+ result->ShapeId(entry) ;
+ }
+ return result;
+ }
//=================================================================================
// function : MakeTranslation()
@@ -5303,10 +5346,10 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakePanel(GEOM::GEOM_Shape_ptr shape,
GEOM::GEOM_Gen::ListOfIOR_var aList = new GEOM::GEOM_Gen::ListOfIOR;
aList->length(4);
- aList[0]=strdup(Edge1->Name());
- aList[1]=strdup(Edge2->Name());
- aList[2]=strdup(Edge3->Name());
- aList[3]=strdup(Edge4->Name());
+ aList[0]=CORBA::string_dup(Edge1->Name());
+ aList[1]=CORBA::string_dup(Edge2->Name());
+ aList[2]=CORBA::string_dup(Edge3->Name());
+ aList[3]=CORBA::string_dup(Edge4->Name());
GEOM::GEOM_Shape_ptr aWire = MakeWire( aList );
GEOM::GEOM_Shape_ptr aFace = MakeFace( aWire, true ) ;
@@ -5467,6 +5510,7 @@ GEOM::GEOM_Contact_ptr GEOM_Gen_i::AddContact(GEOM::GEOM_Assembly_ptr Ass,
CORBA::Double step)
throw (SALOME::SALOME_Exception)
{
+ cout<<"GEOM_Gen_i::AddContact"<GetData(), Ass->ShapeId(), mainRefLab);
@@ -5480,8 +5524,7 @@ GEOM::GEOM_Contact_ptr GEOM_Gen_i::AddContact(GEOM::GEOM_Assembly_ptr Ass,
THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::AddContact", SALOME::BAD_PARAM);
/* Create the CORBA servant holding the TopoDS_Shape */
- GEOM::GEOM_Gen_ptr engine = POA_GEOM::GEOM_Gen::_this();
- GEOM_Contact_i * Contact_servant = new GEOM_Contact_i(tds, Shape1, Shape2, engine);
+ GEOM_Contact_i * Contact_servant = new GEOM_Contact_i(tds, Shape1, Shape2);
GEOM::GEOM_Contact_var Contact = GEOM::GEOM_Contact::_narrow(Contact_servant->_this());
/* Create and set the name (IOR of shape converted into a string) */
@@ -5511,6 +5554,7 @@ GEOM::GEOM_Animation_ptr GEOM_Gen_i::AddAnimation(GEOM::GEOM_Assembly_ptr Ass,
const short NbSeq)
throw (SALOME::SALOME_Exception)
{
+ cout<<"GEOM_Gen_i::AddAnimation"<GetData(), Ass->ShapeId(), mainRefLab);
@@ -5538,9 +5582,8 @@ GEOM::GEOM_Animation_ptr GEOM_Gen_i::AddAnimation(GEOM::GEOM_Assembly_ptr Ass,
TCollection_AsciiString entry;
TDF_Tool::Entry(Lab, entry);
- const char *ent = entry.ToCString();
+ Animation->ShapeId(entry.ToCString());
- Animation->ShapeId(ent);
return Animation;
}
@@ -5557,16 +5600,12 @@ void GEOM_Gen_i::SetPosition(GEOM::GEOM_Contact_ptr Contact)
TDF_Tool::Label(myCurrentOCAFDoc->GetData(), Contact->ShapeId(), mainRefLab);
GEOMDS_Commands GC(myCurrentOCAFDoc->Main());
- GEOM::GEOM_Position_var myGeomPosition = GEOM::GEOM_Position::_narrow(Contact->GetPosition());
- GEOM::PointStruct P0 = myGeomPosition->GetOrigin();
- GEOM::DirStruct VX = myGeomPosition->GetVX();
- GEOM::DirStruct VY = myGeomPosition->GetVY();
- GEOM::DirStruct VZ = myGeomPosition->GetVZ();
+ GEOM::ListOfDouble_var aList = Contact->GetPosition();
- GC.SetPosition(mainRefLab, P0.x, P0.y, P0.z,
- VX.PS.x, VX.PS.y, VX.PS.z,
- VY.PS.x, VY.PS.y, VY.PS.z,
- VZ.PS.x, VZ.PS.y, VZ.PS.z);
+ GC.SetPosition(mainRefLab, aList[0], aList[1], aList[2],
+ aList[3], aList[4], aList[5],
+ aList[6], aList[7], aList[8],
+ aList[9], aList[10], aList[11]);
}
catch(Standard_Failure)
THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::SetPosition", SALOME::BAD_PARAM);
@@ -5576,10 +5615,10 @@ void GEOM_Gen_i::SetPosition(GEOM::GEOM_Contact_ptr Contact)
//=================================================================================
-// function : SetRotation()
+// function : SetAngularRange()
// purpose :
//=================================================================================
-void GEOM_Gen_i::SetRotation(GEOM::GEOM_Contact_ptr Contact)
+void GEOM_Gen_i::SetAngularRange(GEOM::GEOM_Contact_ptr Contact)
throw (SALOME::SALOME_Exception)
{
try {
@@ -5587,28 +5626,23 @@ void GEOM_Gen_i::SetRotation(GEOM::GEOM_Contact_ptr Contact)
TDF_Tool::Label(myCurrentOCAFDoc->GetData(), Contact->ShapeId(), mainRefLab);
GEOMDS_Commands GC(myCurrentOCAFDoc->Main());
- GEOM::GEOM_Rotation_var myGeomRotation = GEOM::GEOM_Rotation::_narrow(Contact->GetRotation());
- int aRot1 = myGeomRotation->GetRot1();
- int aRot2 = myGeomRotation->GetRot2();
- int aRot3 = myGeomRotation->GetRot3();
- double aVal1 = myGeomRotation->GetVal1();
- double aVal2 = myGeomRotation->GetVal2();
- double aVal3 = myGeomRotation->GetVal3();
+ GEOM::ListOfDouble_var aList = Contact->GetAngularRange();
- GC.SetRotation(mainRefLab, aRot1, aRot2, aRot3, aVal1, aVal2, aVal3);
+ GC.SetAngularRange(mainRefLab, aList[0], aList[1], aList[2],
+ aList[3], aList[4], aList[5]);
}
catch(Standard_Failure)
- THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::SetRotation", SALOME::BAD_PARAM);
+ THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::SetAngularRange", SALOME::BAD_PARAM);
return;
}
//=================================================================================
-// function : SetTranslation()
+// function : SetLinearRange()
// purpose :
//=================================================================================
-void GEOM_Gen_i::SetTranslation(GEOM::GEOM_Contact_ptr Contact)
+void GEOM_Gen_i::SetLinearRange(GEOM::GEOM_Contact_ptr Contact)
throw (SALOME::SALOME_Exception)
{
try {
@@ -5616,15 +5650,46 @@ void GEOM_Gen_i::SetTranslation(GEOM::GEOM_Contact_ptr Contact)
TDF_Tool::Label(myCurrentOCAFDoc->GetData(), Contact->ShapeId(), mainRefLab);
GEOMDS_Commands GC(myCurrentOCAFDoc->Main());
- GEOM::GEOM_Translation_var myGeomTranslation = GEOM::GEOM_Translation::_narrow(Contact->GetTranslation());
- double aValX = myGeomTranslation->GetValX();
- double aValY = myGeomTranslation->GetValY();
- double aValZ = myGeomTranslation->GetValZ();
+ GEOM::ListOfDouble_var aList = Contact->GetLinearRange();
- GC.SetTranslation(mainRefLab, aValX, aValY, aValZ);
+ GC.SetLinearRange(mainRefLab, aList[0], aList[1], aList[2],
+ aList[3], aList[4], aList[5]);
}
catch(Standard_Failure)
- THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::SetTranslation", SALOME::BAD_PARAM);
+ THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::SetLinearRange", SALOME::BAD_PARAM);
+
+ return;
+}
+
+
+//=================================================================================
+// function : SetDisplacement()
+// purpose :
+//=================================================================================
+void GEOM_Gen_i::SetDisplacement(GEOM::GEOM_Animation_ptr Animation, GEOM::GEOM_Contact_ptr Contact)
+ throw (SALOME::SALOME_Exception)
+{
+ cout<<"GEOM_Gen_i::SetDisplacement"<GetData(), Animation->ShapeId(), mainRefLab);
+ GEOMDS_Commands GC(myCurrentOCAFDoc->Main());
+
+ GEOM::GEOM_Assembly_var anAss = Animation->GetAssembly();
+ GEOM::ListOfContact_var aContactList = anAss->GetContactList();
+ int aKContact;
+ for(int i = 0; i < anAss->NbContacts(); i++) {
+ if(Contact == aContactList[i])
+ aKContact = i;
+ }
+
+ GEOM::ListOfDouble_var aList = Animation->GetDisplacement(Contact);
+ GC.SetDisplacement(mainRefLab, aKContact,
+ aList[0], aList[1], aList[2], aList[3], aList[4], aList[5],
+ aList[6], aList[7], aList[8], aList[9], aList[10], aList[11]);
+ }
+ catch(Standard_Failure)
+ THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::SetDisplacement", SALOME::BAD_PARAM);
return;
}
diff --git a/src/GEOM/GEOM_Gen_i.hh b/src/GEOM/GEOM_Gen_i.hh
index 83a9a72c2..ed533c610 100644
--- a/src/GEOM/GEOM_Gen_i.hh
+++ b/src/GEOM/GEOM_Gen_i.hh
@@ -392,6 +392,7 @@ class GEOM_Gen_i: public POA_GEOM::GEOM_Gen,
GEOM::GEOM_Shape_ptr MakePlacedBox(CORBA::Double x1, CORBA::Double y1, CORBA::Double z1,
CORBA::Double delta1, CORBA::Double delta2, CORBA::Double delta3)
throw (SALOME::SALOME_Exception) ;
+
GEOM::GEOM_Shape_ptr MakePanel(GEOM::GEOM_Shape_ptr shape,
CORBA::Short directiontype,
CORBA::Double delta)
@@ -400,18 +401,18 @@ class GEOM_Gen_i: public POA_GEOM::GEOM_Gen,
//---------------------------------------------------------------------//
// Transformations Operations //
//---------------------------------------------------------------------//
- // Copy
- GEOM::GEOM_Shape_ptr MakeCopy(GEOM::GEOM_Shape_ptr shape)
+ // Copy
+ GEOM::GEOM_Shape_ptr MakeCopy( GEOM::GEOM_Shape_ptr shape)
throw (SALOME::SALOME_Exception) ;
// Translation
- GEOM::GEOM_Shape_ptr MakeTranslation(GEOM::GEOM_Shape_ptr shape,
+ GEOM::GEOM_Shape_ptr MakeTranslation( GEOM::GEOM_Shape_ptr shape,
CORBA::Double x,
CORBA::Double y,
CORBA::Double z)
throw (SALOME::SALOME_Exception) ;
// Rotation
- GEOM::GEOM_Shape_ptr MakeRotation(GEOM::GEOM_Shape_ptr shape,
+ GEOM::GEOM_Shape_ptr MakeRotation( GEOM::GEOM_Shape_ptr shape,
const GEOM::AxisStruct& axis,
CORBA::Double angle)
throw (SALOME::SALOME_Exception) ;
@@ -587,6 +588,14 @@ class GEOM_Gen_i: public POA_GEOM::GEOM_Gen,
const GEOM::PointStruct& pEnd)
throw (SALOME::SALOME_Exception) ;
+ //-------------------------------------------------------------------//
+ // Specific method Sketcher //
+ //-------------------------------------------------------------------//
+ GEOM::GEOM_Shape_ptr MakeSketcher (const char* Cmd)
+ throw (SALOME::SALOME_Exception) ;
+
+ //-------------------------------------------------------------------//
+
GEOM::GEOM_Shape_ptr MakeCompound (const GEOM::GEOM_Gen::ListOfIOR& ListShapes)
throw (SALOME::SALOME_Exception) ;
GEOM::GEOM_Shape_ptr MakeWire (const GEOM::GEOM_Gen::ListOfIOR& ListShapes)
@@ -632,9 +641,12 @@ class GEOM_Gen_i: public POA_GEOM::GEOM_Gen,
throw (SALOME::SALOME_Exception) ;
void SetPosition(GEOM::GEOM_Contact_ptr Contact)
throw (SALOME::SALOME_Exception) ;
- void SetRotation(GEOM::GEOM_Contact_ptr Contact)
+ void SetAngularRange(GEOM::GEOM_Contact_ptr Contact)
throw (SALOME::SALOME_Exception) ;
- void SetTranslation(GEOM::GEOM_Contact_ptr Contact)
+ void SetLinearRange(GEOM::GEOM_Contact_ptr Contact)
+ throw (SALOME::SALOME_Exception) ;
+ void SetDisplacement(GEOM::GEOM_Animation_ptr Animation,
+ GEOM::GEOM_Contact_ptr Contact)
throw (SALOME::SALOME_Exception) ;
};
diff --git a/src/GEOM/GEOM_Position_i.cc b/src/GEOM/GEOM_Position_i.cc
deleted file mode 100644
index 3db2cf744..000000000
--- a/src/GEOM/GEOM_Position_i.cc
+++ /dev/null
@@ -1,147 +0,0 @@
-// GEOM GEOM :
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : GEOM_Position_i.cc
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header$
-
-using namespace std;
-#include "GEOM_Position_i.hh"
-
-//=================================================================================
-// function : GEOM_Position_i() constructor (no arguments)
-// purpose : for what now ?
-//=================================================================================
-GEOM_Position_i::GEOM_Position_i()
-{
-}
-
-
-//=================================================================================
-// function : constructor
-// purpose : constructor for servant creation
-//=================================================================================
-GEOM_Position_i::GEOM_Position_i(const GEOM::PointStruct& P0, const GEOM::DirStruct& VX,
- const GEOM::DirStruct& VY, const GEOM::DirStruct& VZ)
-{
-
- SetOrigin(P0);
- SetVX(VX);
- SetVY(VY);
- SetVZ(VZ);
- return;
-
-}
-
-
-//=================================================================================
-// function : destructor
-// purpose :
-//=================================================================================
-GEOM_Position_i::~GEOM_Position_i() {}
-
-
-//=================================================================================
-// function : SetOrigin()
-// purpose :
-//=================================================================================
-void GEOM_Position_i::SetOrigin(const GEOM::PointStruct& P0)
- throw(SALOME::SALOME_Exception)
-{
- _P0 = P0;
- return;
-}
-
-//=================================================================================
-// function : SetVX()
-// purpose :
-//=================================================================================
-void GEOM_Position_i::SetVX(const GEOM::DirStruct& Vect)
- throw(SALOME::SALOME_Exception)
-{
- _VX = Vect;
- return;
-}
-
-//=================================================================================
-// function : SetVY()
-// purpose :
-//=================================================================================
-void GEOM_Position_i::SetVY(const GEOM::DirStruct& Vect)
- throw(SALOME::SALOME_Exception)
-{
- _VY = Vect;
- return;
-}
-
-//=================================================================================
-// function : SetVZ()
-// purpose :
-//=================================================================================
-void GEOM_Position_i::SetVZ(const GEOM::DirStruct& Vect)
- throw(SALOME::SALOME_Exception)
-{
- _VZ = Vect;
- return;
-}
-
-//=================================================================================
-// function : GetOrigin()
-// purpose :
-//=================================================================================
-GEOM::PointStruct GEOM_Position_i::GetOrigin()
- throw(SALOME::SALOME_Exception)
-{
- return _P0;
-}
-
-//=================================================================================
-// function : GetVX()
-// purpose :
-//=================================================================================
-GEOM::DirStruct GEOM_Position_i::GetVX()
- throw(SALOME::SALOME_Exception)
-{
- return _VX;
-}
-
-//=================================================================================
-// function : GetVY()
-// purpose :
-//=================================================================================
-GEOM::DirStruct GEOM_Position_i::GetVY()
- throw(SALOME::SALOME_Exception)
-{
- return _VY;
-}
-
-//=================================================================================
-// function : GetVZ()
-// purpose :
-//=================================================================================
-GEOM::DirStruct GEOM_Position_i::GetVZ()
- throw(SALOME::SALOME_Exception)
-{
- return _VZ;
-}
diff --git a/src/GEOM/GEOM_Position_i.hh b/src/GEOM/GEOM_Position_i.hh
deleted file mode 100644
index 57b66a0f0..000000000
--- a/src/GEOM/GEOM_Position_i.hh
+++ /dev/null
@@ -1,84 +0,0 @@
-// GEOM GEOM :
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : GEOM_Position_i.hh
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header$
-
-#ifndef __GEOM_POSITION_I_H__
-#define __GEOM_POSITION_I_H__
-
-// IDL headers
-#include
-#include CORBA_SERVER_HEADER(GEOM_Gen)
-#include CORBA_SERVER_HEADER(GEOM_Shape)
-#include CORBA_SERVER_HEADER(GEOM_Kinematic)
-
-//=====================================================================
-// GEOM_Position_i : class definition
-//=====================================================================
-class GEOM_Position_i:
- public POA_GEOM::GEOM_Position
-{
-public:
- GEOM_Position_i();
- GEOM_Position_i(const GEOM::PointStruct& P0, const GEOM::DirStruct& VX,
- const GEOM::DirStruct& VY, const GEOM::DirStruct& VZ);
-
- ~GEOM_Position_i();
-
-private:
- GEOM::PointStruct _P0;
- GEOM::DirStruct _VX;
- GEOM::DirStruct _VY;
- GEOM::DirStruct _VZ;
-
-public:
- void SetOrigin(const GEOM::PointStruct& P0)
- throw (SALOME::SALOME_Exception);
-
- void SetVX(const GEOM::DirStruct& Vect)
- throw (SALOME::SALOME_Exception);
-
- void SetVY(const GEOM::DirStruct& Vect)
- throw (SALOME::SALOME_Exception);
-
- void SetVZ(const GEOM::DirStruct& Vect)
- throw (SALOME::SALOME_Exception);
-
- GEOM::PointStruct GetOrigin()
- throw (SALOME::SALOME_Exception);
-
- GEOM::DirStruct GetVX()
- throw (SALOME::SALOME_Exception);
-
- GEOM::DirStruct GetVY()
- throw (SALOME::SALOME_Exception);
-
- GEOM::DirStruct GetVZ()
- throw (SALOME::SALOME_Exception);
-
-};
-
-#endif
diff --git a/src/GEOM/GEOM_Rotation_i.cc b/src/GEOM/GEOM_Rotation_i.cc
deleted file mode 100644
index c0fa00432..000000000
--- a/src/GEOM/GEOM_Rotation_i.cc
+++ /dev/null
@@ -1,135 +0,0 @@
-// GEOM GEOM :
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : GEOM_Rotation_i.cc
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header$
-
-using namespace std;
-#include "GEOM_Rotation_i.hh"
-
-//=================================================================================
-// function : GEOM_Rotation_i() constructor (no arguments)
-// purpose : for what now ?
-//=================================================================================
-GEOM_Rotation_i::GEOM_Rotation_i()
-{
-}
-
-
-//=================================================================================
-// function : constructor
-// purpose : constructor for servant creation
-//=================================================================================
-GEOM_Rotation_i::GEOM_Rotation_i(CORBA::Long Rot1, CORBA::Long Rot2, CORBA::Long Rot3,
- CORBA::Double Val1, CORBA::Double Val2, CORBA::Double Val3)
-{
-
- SetRotation(Rot1, Rot2, Rot3, Val1, Val2, Val3);
- return;
-
-}
-
-
-//=================================================================================
-// function : destructor
-// purpose :
-//=================================================================================
-GEOM_Rotation_i::~GEOM_Rotation_i() {}
-
-
-//=================================================================================
-// function : SetRotation()
-// purpose :
-//=================================================================================
-void GEOM_Rotation_i::SetRotation(CORBA::Long Rot1, CORBA::Long Rot2, CORBA::Long Rot3,
- CORBA::Double Val1, CORBA::Double Val2, CORBA::Double Val3)
- throw(SALOME::SALOME_Exception)
-{
-
- _Rot1 = Rot1;
- _Rot2 = Rot2;
- _Rot3 = Rot3;
-
- _Val1 = Val1;
- _Val2 = Val2;
- _Val3 = Val3;
-
- return;
-
-}
-
-//=================================================================================
-// function : GetRot1()
-// purpose :
-//=================================================================================
-CORBA::Long GEOM_Rotation_i::GetRot1() throw(SALOME::SALOME_Exception)
-{
- return _Rot1;
-}
-
-//=================================================================================
-// function : GetRot2()
-// purpose :
-//=================================================================================
-CORBA::Long GEOM_Rotation_i::GetRot2() throw(SALOME::SALOME_Exception)
-{
- return _Rot2;
-}
-
-//=================================================================================
-// function : GetRot3()
-// purpose :
-//=================================================================================
-CORBA::Long GEOM_Rotation_i::GetRot3() throw(SALOME::SALOME_Exception)
-{
- return _Rot3;
-}
-
-//=================================================================================
-// function : GetVal1()
-// purpose :
-//=================================================================================
-CORBA::Double GEOM_Rotation_i::GetVal1() throw(SALOME::SALOME_Exception)
-{
- return _Val1;
-}
-
-//=================================================================================
-// function : GetVal2()
-// purpose :
-//=================================================================================
-CORBA::Double GEOM_Rotation_i::GetVal2() throw(SALOME::SALOME_Exception)
-{
- return _Val2;
-}
-
-//=================================================================================
-// function : GetVal3()
-// purpose :
-//=================================================================================
-CORBA::Double GEOM_Rotation_i::GetVal3() throw(SALOME::SALOME_Exception)
-{
- return _Val3;
-}
diff --git a/src/GEOM/GEOM_Rotation_i.hh b/src/GEOM/GEOM_Rotation_i.hh
deleted file mode 100644
index 598073005..000000000
--- a/src/GEOM/GEOM_Rotation_i.hh
+++ /dev/null
@@ -1,85 +0,0 @@
-// GEOM GEOM :
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : GEOM_Rotation_i.hh
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header$
-
-#ifndef __GEOM_ROTATION_I_H__
-#define __GEOM_ROTATION_I_H__
-
-// IDL headers
-#include
-#include CORBA_SERVER_HEADER(GEOM_Gen)
-#include CORBA_SERVER_HEADER(GEOM_Shape)
-#include CORBA_SERVER_HEADER(GEOM_Kinematic)
-
-//=====================================================================
-// GEOM_Rotation_i : class definition
-//=====================================================================
-class GEOM_Rotation_i:
- public POA_GEOM::GEOM_Rotation
-{
-public:
- GEOM_Rotation_i();
- GEOM_Rotation_i(CORBA::Long Rot1, CORBA::Long Rot2, CORBA::Long Rot3,
- CORBA::Double Val1, CORBA::Double Val2, CORBA::Double Val3);
-
- ~GEOM_Rotation_i();
-
-private:
- CORBA::Long _Rot1;
- CORBA::Long _Rot2;
- CORBA::Long _Rot3;
-
- CORBA::Double _Val1;
- CORBA::Double _Val2;
- CORBA::Double _Val3;
-
-public:
- void SetRotation(CORBA::Long Rot1, CORBA::Long Rot2, CORBA::Long Rot3,
- CORBA::Double Val1, CORBA::Double Val2, CORBA::Double Val3)
- throw (SALOME::SALOME_Exception);
-
- CORBA::Long GetRot1()
- throw (SALOME::SALOME_Exception);
-
- CORBA::Long GetRot2()
- throw (SALOME::SALOME_Exception);
-
- CORBA::Long GetRot3()
- throw (SALOME::SALOME_Exception);
-
- CORBA::Double GetVal1()
- throw (SALOME::SALOME_Exception);
-
- CORBA::Double GetVal2()
- throw (SALOME::SALOME_Exception);
-
- CORBA::Double GetVal3()
- throw (SALOME::SALOME_Exception);
-
-};
-
-#endif
diff --git a/src/GEOM/GEOM_Shape_i.cc b/src/GEOM/GEOM_Shape_i.cc
index 60db998b4..bd2110d50 100644
--- a/src/GEOM/GEOM_Shape_i.cc
+++ b/src/GEOM/GEOM_Shape_i.cc
@@ -26,13 +26,16 @@
// Module : GEOM
// $Header$
-using namespace std;
-#include
-#include "GEOM_Shape_i.hh"
-#include "SALOME_NamingService.hxx"
#include
+#include
+
+#include
#include
+#include "GEOM_Shape_i.hh"
+#include "SALOME_NamingService.hxx"
+
+using namespace std;
//=================================================================================
@@ -84,7 +87,7 @@ GEOM_Shape_i::~GEOM_Shape_i() { delete &_geom; }
// : WARNING : Register to naming service actually removed !
//=================================================================================
void GEOM_Shape_i::Name(const char* name) {
- _name = strdup(name);
+ _name = CORBA::string_dup(name);
GEOM::GEOM_Shape_ptr g = GEOM::GEOM_Shape::_narrow(_this());
// Removed declaration of shapes to naming service
@@ -97,14 +100,14 @@ void GEOM_Shape_i::Name(const char* name) {
// function : Name (get method)
// purpose : to get the attribute 'name' of this shape
//=================================================================================
-char* GEOM_Shape_i::Name() { return strdup(_name); }
+char* GEOM_Shape_i::Name() { return CORBA::string_dup(_name); }
//=================================================================================
// function : MainName (set method)
// purpose : to set the attribute 'name' of this mainshape.
//=================================================================================
void GEOM_Shape_i::MainName(const char* name) {
- _mainname = strdup(name);
+ _mainname = CORBA::string_dup(name);
}
@@ -112,7 +115,7 @@ void GEOM_Shape_i::MainName(const char* name) {
// function : MainName (get method)
// purpose : to get the attribute 'name' of this shape
//=================================================================================
-char* GEOM_Shape_i::MainName() { return strdup(_mainname); }
+char* GEOM_Shape_i::MainName() { return CORBA::string_dup(_mainname); }
//=================================================================================
// function : IsMainShape (get method)
@@ -132,14 +135,14 @@ void GEOM_Shape_i::IsMainShape(const bool abool) { _ismain = abool ; }
// function : ShapeId
// purpose : to get the id of this shape from GEOM (OCAF entry)
//=================================================================================
-char* GEOM_Shape_i::ShapeId() { return strdup(_shapeid) ; }
+char* GEOM_Shape_i::ShapeId() { return CORBA::string_dup(_shapeid) ; }
//=================================================================================
// function : ShapeId (set method)
// purpose : to set the id of this shape in GEOM/OCAF doc
//=================================================================================
-void GEOM_Shape_i::ShapeId(const char * shapeid) { _shapeid = strdup(shapeid) ; }
+void GEOM_Shape_i::ShapeId(const char * shapeid) { _shapeid = CORBA::string_dup(shapeid) ; }
@@ -147,7 +150,7 @@ void GEOM_Shape_i::ShapeId(const char * shapeid) { _shapeid = strdup(shapeid) ;
// function : StudyShapeId (get method)
// purpose : to get the id of this shape from the study document (OCAF entry)
//=================================================================================
-char* GEOM_Shape_i::StudyShapeId() { return strdup(_studyshapeid) ; }
+char* GEOM_Shape_i::StudyShapeId() { return CORBA::string_dup(_studyshapeid) ; }
//=================================================================================
@@ -155,7 +158,7 @@ char* GEOM_Shape_i::StudyShapeId() { return strdup(_studyshapeid) ; }
// purpose : to set the id of this shape in the Study document (OCAF entry)
//=================================================================================
void GEOM_Shape_i::StudyShapeId(const char * studyshapeid)
-{ _studyshapeid = strdup(studyshapeid) ; }
+{ _studyshapeid = CORBA::string_dup(studyshapeid) ; }
@@ -209,7 +212,7 @@ void GEOM_Shape_i::NameType(const char* name) {
// function : NameType (get method)
// purpose : to get the attribute 'nametype' of this shape
//=================================================================================
-char* GEOM_Shape_i::NameType() { return strdup(_nametype); }
+char* GEOM_Shape_i::NameType() { return CORBA::string_dup(_nametype); }
//=================================================================================
// function : GetShapeStream
diff --git a/src/GEOM/GEOM_Translation_i.hh b/src/GEOM/GEOM_Translation_i.hh
deleted file mode 100644
index 923207767..000000000
--- a/src/GEOM/GEOM_Translation_i.hh
+++ /dev/null
@@ -1,70 +0,0 @@
-// GEOM GEOM :
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : GEOM_Translation_i.hh
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header$
-
-#ifndef __GEOM_TRANSLATION_I_H__
-#define __GEOM_TRANSLATION_I_H__
-
-// IDL headers
-#include
-#include CORBA_SERVER_HEADER(GEOM_Gen)
-#include CORBA_SERVER_HEADER(GEOM_Shape)
-#include CORBA_SERVER_HEADER(GEOM_Kinematic)
-
-//=====================================================================
-// GEOM_Translation_i : class definition
-//=====================================================================
-class GEOM_Translation_i:
- public POA_GEOM::GEOM_Translation
-{
-public:
- GEOM_Translation_i();
- GEOM_Translation_i(CORBA::Double ValX, CORBA::Double ValY, CORBA::Double ValZ);
-
- ~GEOM_Translation_i();
-
-private:
- CORBA::Double _ValX;
- CORBA::Double _ValY;
- CORBA::Double _ValZ;
-
-public:
- void SetTranslation(CORBA::Double ValX, CORBA::Double ValY, CORBA::Double ValZ)
- throw (SALOME::SALOME_Exception);
-
- CORBA::Double GetValX()
- throw (SALOME::SALOME_Exception);
-
- CORBA::Double GetValY()
- throw (SALOME::SALOME_Exception);
-
- CORBA::Double GetValZ()
- throw (SALOME::SALOME_Exception);
-
-};
-
-#endif
diff --git a/src/GEOM/Makefile.in b/src/GEOM/Makefile.in
index 03e5d9640..99fa12b9b 100644
--- a/src/GEOM/Makefile.in
+++ b/src/GEOM/Makefile.in
@@ -37,7 +37,7 @@ VPATH=.:@srcdir@:@top_srcdir@/idl
# Libraries targets
LIB = libGEOMEngine.la
-LIB_SRC = GEOM_Shape_i.cc GEOM_Position_i.cc GEOM_Rotation_i.cc GEOM_Translation_i.cc GEOM_Contact_i.cc GEOM_Assembly_i.cc GEOM_Animation_i.cc GEOM_Gen_i.cc
+LIB_SRC = GEOM_Shape_i.cc GEOM_Contact_i.cc GEOM_Assembly_i.cc GEOM_Animation_i.cc GEOM_Gen_i.cc
LIB_SERVER_IDL = SALOME_Component.idl SALOMEDS.idl SALOME_Exception.idl GEOM_Gen.idl GEOM_Shape.idl GEOM_Kinematic.idl
# Executables targets
@@ -46,12 +46,12 @@ BIN_SRC =
BIN_CLIENT_IDL =
BIN_SERVER_IDL =
-EXPORT_HEADERS =
+EXPORT_HEADERS = GEOM_Assembly_i.hh
# additionnal information to compil and link file
CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
-LDFLAGS += -lGEOMDS -lTOOLSDS -lSalomeNS -lSalomeContainer -lGEOMPartition -lGEOMArchimede -lGEOMKinematic $(CAS_LDPATH) -lTKIGES -lTKSTEP -lTKFillet -lTKOffset -L${KERNEL_ROOT_DIR}/lib/salome
+LDFLAGS += -lGEOMDS -lTOOLSDS -lSalomeNS -lSalomeContainer -lGEOMPartition -lGEOMArchimede -lGEOMSketcher -lGEOMKinematic $(CAS_LDPATH) -lTKIGES -lTKSTEP -lTKFillet -lTKOffset -L${KERNEL_ROOT_DIR}/lib/salome
# additional file to be cleaned
MOSTLYCLEAN =
diff --git a/src/GEOMBase/GEOMBase.cxx b/src/GEOMBase/GEOMBase.cxx
index f3c845c66..d1ede3674 100644
--- a/src/GEOMBase/GEOMBase.cxx
+++ b/src/GEOMBase/GEOMBase.cxx
@@ -219,9 +219,9 @@ bool GEOMBase::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString
GEOM::GEOM_Contact_ptr myGeomContact = myGeomBase->ConvertIOinContact(IO, testResult);
int type = myGeomContact->GetType();
if(type == 0 || type == 2) //EMBEDDING || SLIDE
- popup->removeItem(6132); //ROTATION
+ popup->removeItem(6123); //ANGULAR
if(type == 0 || type == 1 || type == 4) //EMBEDDING || PIVOT || SPHERICAL
- popup->removeItem(6133); //TRANSLATION
+ popup->removeItem(6124); //LINEAR
popup->removeItem(QAD_DisplayOnly_Popup_ID);
popup->removeItem(QAD_Display_Popup_ID);
popup->removeItem(QAD_Erase_Popup_ID);
@@ -382,9 +382,9 @@ bool GEOMBase::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString
GEOM::GEOM_Contact_ptr myGeomContact = myGeomBase->ConvertIOinContact(IO, testResult);
int type = myGeomContact->GetType();
if(type == 0 || type == 2) //EMBEDDING || SLIDE
- popup->removeItem(6132); //ROTATION
+ popup->removeItem(6123); //ANGULAR
if(type == 0 || type == 1 || type == 4) //EMBEDDING || PIVOT || SPHERICAL
- popup->removeItem(6133); //TRANSLATION
+ popup->removeItem(6124); //LINEAR
popup->removeItem(QAD_DisplayOnly_Popup_ID);
popup->removeItem(QAD_Display_Popup_ID);
popup->removeItem(QAD_Erase_Popup_ID);
@@ -717,11 +717,17 @@ bool GEOMBase::AddInStudy(bool selection, const Handle(SALOME_InteractiveObject)
QString Name = SALOMEGUI_NameDlg::getName(QAD_Application::getDesktop(), anIO->getName());
if(!Name.isEmpty()) {
// VTK
- if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
- GActor->setName(strdup(Name.latin1()));
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
+ char* aCopy = CORBA::string_dup(Name.latin1());
+ GActor->setName(aCopy);
+ delete(aCopy);
+ }
// OCC
- else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
- GAISShape->setName(strdup(Name.latin1()));
+ else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ char* aCopy = CORBA::string_dup(Name.latin1());
+ GAISShape->setName(aCopy);
+ delete(aCopy);
+ }
}
else
return false;
@@ -958,55 +964,55 @@ bool GEOMBase::GetShapeTypeString(const TopoDS_Shape& aShape, Standard_CString&
{
case TopAbs_COMPOUND:
{
- aTypeString = strdup(tr("GEOM_COMPOUND"));
+ aTypeString = CORBA::string_dup(tr("GEOM_COMPOUND"));
return true;
}
case TopAbs_COMPSOLID:
{
- aTypeString = strdup(tr("GEOM_COMPOUNDSOLID")) ;
+ aTypeString = CORBA::string_dup(tr("GEOM_COMPOUNDSOLID")) ;
return true ;
}
case TopAbs_SOLID:
{
- aTypeString = strdup(tr("GEOM_SOLID")) ;
+ aTypeString = CORBA::string_dup(tr("GEOM_SOLID")) ;
return true ;
}
case TopAbs_SHELL:
{
- aTypeString = strdup(tr("GEOM_SHELL")) ;
+ aTypeString = CORBA::string_dup(tr("GEOM_SHELL")) ;
return true ;
}
case TopAbs_FACE:
{
BRepAdaptor_Surface surf(TopoDS::Face(aShape));
if(surf.GetType() == GeomAbs_Plane) {
- aTypeString = strdup(tr("GEOM_PLANE"));
+ aTypeString = CORBA::string_dup(tr("GEOM_PLANE"));
return true;
}
else if(surf.GetType() == GeomAbs_Cylinder) {
- aTypeString = strdup(tr("GEOM_SURFCYLINDER"));
+ aTypeString = CORBA::string_dup(tr("GEOM_SURFCYLINDER"));
return true;
}
else if(surf.GetType() == GeomAbs_Sphere) {
- aTypeString = strdup(tr("GEOM_SURFSPHERE"));
+ aTypeString = CORBA::string_dup(tr("GEOM_SURFSPHERE"));
return true ;
}
else if(surf.GetType() == GeomAbs_Torus) {
- aTypeString = strdup(tr("GEOM_SURFTORUS"));
+ aTypeString = CORBA::string_dup(tr("GEOM_SURFTORUS"));
return true ;
}
else if(surf.GetType() == GeomAbs_Cone) {
- aTypeString = strdup(tr("GEOM_SURFCONE"));
+ aTypeString = CORBA::string_dup(tr("GEOM_SURFCONE"));
return true ;
}
else {
- aTypeString = strdup(tr("GEOM_FACE"));
+ aTypeString = CORBA::string_dup(tr("GEOM_FACE"));
return true;
}
}
case TopAbs_WIRE:
{
- aTypeString = strdup(tr("GEOM_WIRE"));
+ aTypeString = CORBA::string_dup(tr("GEOM_WIRE"));
return true;
}
case TopAbs_EDGE:
@@ -1014,31 +1020,31 @@ bool GEOMBase::GetShapeTypeString(const TopoDS_Shape& aShape, Standard_CString&
BRepAdaptor_Curve curv(TopoDS::Edge(aShape));
if(curv.GetType() == GeomAbs_Line) {
if((Abs(curv.FirstParameter()) >= 1E6) || (Abs(curv.LastParameter()) >= 1E6))
- aTypeString = strdup(tr("GEOM_LINE"));
+ aTypeString = CORBA::string_dup(tr("GEOM_LINE"));
else
- aTypeString = strdup(tr("GEOM_EDGE"));
+ aTypeString = CORBA::string_dup(tr("GEOM_EDGE"));
return true;
}
else if(curv.GetType() == GeomAbs_Circle) {
if(curv.IsClosed())
- aTypeString = strdup(tr("GEOM_CIRCLE"));
+ aTypeString = CORBA::string_dup(tr("GEOM_CIRCLE"));
else
- aTypeString = strdup(tr("GEOM_ARC"));
+ aTypeString = CORBA::string_dup(tr("GEOM_ARC"));
return true;
}
else {
- aTypeString = strdup(tr("GEOM_EDGE"));
+ aTypeString = CORBA::string_dup(tr("GEOM_EDGE"));
return true;
}
}
case TopAbs_VERTEX:
{
- aTypeString = strdup(tr("GEOM_VERTEX"));
+ aTypeString = CORBA::string_dup(tr("GEOM_VERTEX"));
return true;
}
case TopAbs_SHAPE:
{
- aTypeString = strdup(tr("GEOM_SHAPE"));
+ aTypeString = CORBA::string_dup(tr("GEOM_SHAPE"));
return true;
}
}
@@ -1349,7 +1355,7 @@ void GEOMBase::ConvertListOfIOInListOfIOR(const SALOME_ListIO& aList, GEOM::GEOM
CORBA::String_var theValue = anIOR->Value();
CORBA::Object_var theObj = _orb->string_to_object(theValue);
if(theObj->_is_a("IDL:GEOM/GEOM_Shape:1.0")) {
- listIOR[j] = strdup(theValue);
+ listIOR[j] = CORBA::string_dup(theValue);
j++;
}
}
@@ -1357,7 +1363,7 @@ void GEOMBase::ConvertListOfIOInListOfIOR(const SALOME_ListIO& aList, GEOM::GEOM
else if(IObject->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject))) {
Handle(GEOM_InteractiveObject) GIObject = Handle(GEOM_InteractiveObject)::DownCast(IObject);
Standard_CString ior = GIObject->getIOR();
- listIOR[j] = strdup(ior);
+ listIOR[j] = CORBA::string_dup(ior);
j++;
}
}
@@ -1593,7 +1599,9 @@ bool GEOMBase::SelectionByNameInDialogs(QWidget* aWidget, const QString& objectU
SALOMEDS::SObject_var theObj = listSO[0];
/* Create a SALOME_InteractiveObject with a SALOME::SObject */
Standard_CString anEntry = theObj->GetID();
- Handle(SALOME_InteractiveObject) SI = new SALOME_InteractiveObject(anEntry, "GEOM", strdup(objectUserName));
+ char* aCopyobjectUserName = CORBA::string_dup(objectUserName);
+ Handle(SALOME_InteractiveObject) SI = new SALOME_InteractiveObject(anEntry, "GEOM", aCopyobjectUserName);
+ delete(aCopyobjectUserName);
/* Add as a selected object */
/* Clear any previous selection : */
@@ -1617,6 +1625,23 @@ bool GEOMBase::DefineDlgPosition(QWidget* aDlg, int& x, int& y)
return true;
}
+QString GEOMBase::GetDefaultName(const QString& theOperation)
+{
+ SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
+ int aNumber = 0;
+ QString aName;
+ SALOMEDS::SObject_var obj;
+
+ do
+ {
+ aName = theOperation+"_"+QString::number(++aNumber);
+ obj = aStudy->FindObject(aName);
+ }
+ while (!obj->_is_nil());
+
+ return aName;
+}
+
//=====================================================================================
// EXPORTED METHODS
diff --git a/src/GEOMBase/GEOMBase.h b/src/GEOMBase/GEOMBase.h
index 12cbd728f..56ce5ff9c 100644
--- a/src/GEOMBase/GEOMBase.h
+++ b/src/GEOMBase/GEOMBase.h
@@ -116,6 +116,9 @@ public :
bool SelectionByNameInDialogs(QWidget* aWidget, const QString& userObjectName, SALOME_Selection *Sel);
bool DefineDlgPosition(QWidget* aDlg, int& x, int& y);
+ /* This method generates default names for results of geometrical operations */
+ static QString GetDefaultName(const QString& theOperation);
+
GEOMContext* myGeomGUI;
GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */
diff --git a/src/GEOMBase/GEOMBase_Skeleton.h b/src/GEOMBase/GEOMBase_Skeleton.h
index 0ec58c125..cfeb6ea45 100644
--- a/src/GEOMBase/GEOMBase_Skeleton.h
+++ b/src/GEOMBase/GEOMBase_Skeleton.h
@@ -39,6 +39,7 @@
#include
#include
#include
+#include
class GEOMBase_Skeleton : public DlgRef_Skeleton_QTD
{
diff --git a/src/GEOMContext/GEOMContext.cxx b/src/GEOMContext/GEOMContext.cxx
index aed81c294..fcd33c80f 100644
--- a/src/GEOMContext/GEOMContext.cxx
+++ b/src/GEOMContext/GEOMContext.cxx
@@ -81,6 +81,7 @@ GEOMContext* GEOMContext::GetOrCreateGeomGUI(QAD_Desktop* desktop)
/* GetCurrentStudy */
int studyId = desktop->getActiveStudy()->getStudyId();
GeomGUI->myComponentGeom->GetCurrentStudy(studyId);
+
GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels();
}
@@ -88,7 +89,7 @@ GEOMContext* GEOMContext::GetOrCreateGeomGUI(QAD_Desktop* desktop)
int studyId = desktop->getActiveStudy()->getStudyId();
GeomGUI->myComponentGeom->GetCurrentStudy(studyId);
- //GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels();
+ GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels();
return GeomGUI;
}
diff --git a/src/GEOMContext/GEOMContext.h b/src/GEOMContext/GEOMContext.h
index f5746fc2f..e83a93288 100644
--- a/src/GEOMContext/GEOMContext.h
+++ b/src/GEOMContext/GEOMContext.h
@@ -31,7 +31,6 @@
#include "QAD_Desktop.h"
#include "GEOM_Client.hxx"
-#include "GEOM_Sketcher.h"
#include
#include
@@ -51,7 +50,6 @@ private :
QDialog* myActiveDialogBox; /* Unique active dialog box */
GEOM_Client myShapeReader;
Standard_CString myFatherior;
- Sketch mySketcher;
public :
int myNbGeom; /* Unique name for a geom entity */
@@ -68,7 +66,6 @@ public :
int& GetNbGeom(){return myNbGeom;};
GEOM_Client& GetShapeReader(){return myShapeReader;};
Standard_CString& GetFatherior(){return myFatherior;};
- Sketch& GetSketcher(){return mySketcher;};
bool LoadLibrary(QString GUILibrary);
diff --git a/src/GEOMContext/GEOM_icons.po b/src/GEOMContext/GEOM_icons.po
index 08e173903..943bd4296 100644
--- a/src/GEOMContext/GEOM_icons.po
+++ b/src/GEOMContext/GEOM_icons.po
@@ -410,10 +410,6 @@ msgstr "anim_prev.png"
msgid "ICON_ANIM_PLAY"
msgstr "anim_play.png"
-#:
-msgid "ICON_ANIM_STOP"
-msgstr "anim_stop.png"
-
#:
msgid "ICON_ANIM_NEXT"
msgstr "anim_next.png"
diff --git a/src/GEOMContext/GEOM_msg_en.po b/src/GEOMContext/GEOM_msg_en.po
index bee59ab47..35f35bf7f 100644
--- a/src/GEOMContext/GEOM_msg_en.po
+++ b/src/GEOMContext/GEOM_msg_en.po
@@ -1314,6 +1314,24 @@ msgstr "Fillet can't be computed with radius %1"
msgid "GEOM_CHAMFER_ABORT"
msgstr "Chamfer can't be computed with %1 and %2"
+msgid "GEOM_RANGE_X"
+msgstr "X"
+
+msgid "GEOM_RANGE_Y"
+msgstr "Y"
+
+msgid "GEOM_RANGE_Z"
+msgstr "Z"
+
+msgid "GEOM_RANGE_TITLE"
+msgstr "Define Contact Range"
+
+msgid "GEOM_LIN_RANGE"
+msgstr "Linear Range"
+
+msgid "GEOM_ANG_RANGE"
+msgstr "Angular Range"
+
msgid "GEOM_CONTACT_TITLE"
msgstr "Add Contact"
@@ -1398,6 +1416,36 @@ msgstr "Animation"
msgid "GEOM_ANIM_INLOOP"
msgstr "In Loop"
+msgid "GEOM_ANIMVALUES_TITLE"
+msgstr "Set Values of Animation"
+
+msgid "GEOM_ANIMVALUES"
+msgstr "Animation Values"
+
+msgid "GEOM_BEGIN"
+msgstr "Begin"
+
+msgid "GEOM_END"
+msgstr "End"
+
+msgid "GEOM_RX"
+msgstr "RX"
+
+msgid "GEOM_RY"
+msgstr "RY"
+
+msgid "GEOM_RZ"
+msgstr "RZ"
+
+msgid "GEOM_TX"
+msgstr "TX"
+
+msgid "GEOM_TY"
+msgstr "TY"
+
+msgid "GEOM_TZ"
+msgstr "TZ"
+
msgid "GEOM_POSITION"
msgstr "Position"
diff --git a/src/GEOMContext/GEOM_msg_fr.po b/src/GEOMContext/GEOM_msg_fr.po
index bdf18ab6f..494ee85c0 100644
--- a/src/GEOMContext/GEOM_msg_fr.po
+++ b/src/GEOMContext/GEOM_msg_fr.po
@@ -1315,6 +1315,24 @@ msgstr "Le congé ne peut-être realisé avec un rayon de %1 "
msgid "GEOM_CHAMFER_ABORT"
msgstr "Le chanfrein ne peut-être realisé avec %1 et %2 "
+msgid "GEOM_RANGE_X"
+msgstr "X"
+
+msgid "GEOM_RANGE_Y"
+msgstr "Y"
+
+msgid "GEOM_RANGE_Z"
+msgstr "Z"
+
+msgid "GEOM_RANGE_TITLE"
+msgstr "Débattement de Contact"
+
+msgid "GEOM_LIN_RANGE"
+msgstr "Débattement Linéaire"
+
+msgid "GEOM_ANG_RANGE"
+msgstr "Débattement Angulaire"
+
msgid "GEOM_CONTACT_TITLE"
msgstr "Nouveau Contact"
@@ -1399,6 +1417,36 @@ msgstr "Animation"
msgid "GEOM_ANIM_INLOOP"
msgstr "En boucle"
+msgid "GEOM_ANIMVALUES_TITLE"
+msgstr "Définir les Valeurs d'Animation"
+
+msgid "GEOM_ANIMVALUES"
+msgstr "Valeurs d'Animation"
+
+msgid "GEOM_BEGIN"
+msgstr "Début"
+
+msgid "GEOM_END"
+msgstr "Fin"
+
+msgid "GEOM_RX"
+msgstr "RX"
+
+msgid "GEOM_RY"
+msgstr "RY"
+
+msgid "GEOM_RZ"
+msgstr "RZ"
+
+msgid "GEOM_TX"
+msgstr "TX"
+
+msgid "GEOM_TY"
+msgstr "TY"
+
+msgid "GEOM_TZ"
+msgstr "TZ"
+
msgid "GEOM_POSITION"
msgstr "Position"
diff --git a/src/GEOMContext/Makefile.in b/src/GEOMContext/Makefile.in
index 9215429ea..7f564228c 100644
--- a/src/GEOMContext/Makefile.in
+++ b/src/GEOMContext/Makefile.in
@@ -60,6 +60,6 @@ LIB_SERVER_IDL =
CPPFLAGS += $(QT_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
-LDFLAGS += -lOCCViewer -lVTKViewer -lSalomeObject -lSalomeGUI -lGEOMClient -lGEOMObject -lGEOMSketcher -L${KERNEL_ROOT_DIR}/lib/salome
+LDFLAGS += -lOCCViewer -lVTKViewer -lSalomeObject -lSalomeGUI -lGEOMClient -lGEOMObject -L${KERNEL_ROOT_DIR}/lib/salome
@CONCLUDE@
diff --git a/src/GEOMDS/GEOMDS_Commands.cxx b/src/GEOMDS/GEOMDS_Commands.cxx
index aad004200..5af23a8c4 100644
--- a/src/GEOMDS/GEOMDS_Commands.cxx
+++ b/src/GEOMDS/GEOMDS_Commands.cxx
@@ -342,56 +342,56 @@ TDF_Label GEOMDS_Commands::AddContact(Kinematic_Contact& KContact,
TDataStd_Integer::Set(LabContactType, 2);
TDF_Label LabType = LabContact.NewChild();
- TDataStd_Integer::Set(LabType, KContact.Type());
+ TDataStd_Integer::Set(LabType, KContact.GetType());
int ret;
TDF_Label NewLab1 = LabContact.NewChild();
TNaming_Builder B1(NewLab1);
- B1.Select(KContact.Shape1(), KContact.Shape1());
- TDF_Label RefLab1 = TNaming_Tool::Label(myLab, KContact.Shape1(), ret);
+ B1.Select(KContact.GetShape1(), KContact.GetShape1());
+ TDF_Label RefLab1 = TNaming_Tool::Label(myLab, KContact.GetShape1(), ret);
TDF_Reference::Set(NewLab1, RefLab1);
TDF_Label NewLab2 = LabContact.NewChild();
TNaming_Builder B2(NewLab2);
- B2.Select(KContact.Shape2(), KContact.Shape2());
- TDF_Label RefLab2 = TNaming_Tool::Label(myLab, KContact.Shape2(), ret);
+ B2.Select(KContact.GetShape2(), KContact.GetShape2());
+ TDF_Label RefLab2 = TNaming_Tool::Label(myLab, KContact.GetShape2(), ret);
TDF_Reference::Set(NewLab2, RefLab2);
TDF_Label LabPosition = LabContact.NewChild();
Handle(TDataStd_RealArray) RealArrayP = TDataStd_RealArray::Set(LabPosition, 1, 12);
- RealArrayP->SetValue(1, KContact.Position().Origin().X());
- RealArrayP->SetValue(2, KContact.Position().Origin().Y());
- RealArrayP->SetValue(3, KContact.Position().Origin().Z());
- RealArrayP->SetValue(4, KContact.Position().DirX().X());
- RealArrayP->SetValue(5, KContact.Position().DirX().Y());
- RealArrayP->SetValue(6, KContact.Position().DirX().Z());
- RealArrayP->SetValue(7, KContact.Position().DirY().X());
- RealArrayP->SetValue(8, KContact.Position().DirY().Y());
- RealArrayP->SetValue(9, KContact.Position().DirY().Z());
- RealArrayP->SetValue(10, KContact.Position().DirZ().X());
- RealArrayP->SetValue(11, KContact.Position().DirZ().Y());
- RealArrayP->SetValue(12, KContact.Position().DirZ().Z());
+ RealArrayP->SetValue(1, KContact.GetPosition().GetOrigin().X());
+ RealArrayP->SetValue(2, KContact.GetPosition().GetOrigin().Y());
+ RealArrayP->SetValue(3, KContact.GetPosition().GetOrigin().Z());
+ RealArrayP->SetValue(4, KContact.GetPosition().GetDirX().X());
+ RealArrayP->SetValue(5, KContact.GetPosition().GetDirX().Y());
+ RealArrayP->SetValue(6, KContact.GetPosition().GetDirX().Z());
+ RealArrayP->SetValue(7, KContact.GetPosition().GetDirY().X());
+ RealArrayP->SetValue(8, KContact.GetPosition().GetDirY().Y());
+ RealArrayP->SetValue(9, KContact.GetPosition().GetDirY().Z());
+ RealArrayP->SetValue(10, KContact.GetPosition().GetDirZ().X());
+ RealArrayP->SetValue(11, KContact.GetPosition().GetDirZ().Y());
+ RealArrayP->SetValue(12, KContact.GetPosition().GetDirZ().Z());
- TDF_Label LabRotation1 = LabContact.NewChild();
- Handle(TDataStd_IntegerArray) IntegerArrayR = TDataStd_IntegerArray::Set(LabRotation1, 1, 3);
- IntegerArrayR->SetValue(1, KContact.Rotation().Rot1());
- IntegerArrayR->SetValue(2, KContact.Rotation().Rot2());
- IntegerArrayR->SetValue(3, KContact.Rotation().Rot3());
+ TDF_Label LabAngularRange = LabContact.NewChild();
+ Handle(TDataStd_RealArray) RealArrayR = TDataStd_RealArray::Set(LabAngularRange, 1, 6);
+ RealArrayR->SetValue(1, KContact.GetAngularRange().GetMinValX());
+ RealArrayR->SetValue(2, KContact.GetAngularRange().GetMaxValX());
+ RealArrayR->SetValue(3, KContact.GetAngularRange().GetMinValY());
+ RealArrayR->SetValue(4, KContact.GetAngularRange().GetMaxValY());
+ RealArrayR->SetValue(5, KContact.GetAngularRange().GetMinValZ());
+ RealArrayR->SetValue(6, KContact.GetAngularRange().GetMaxValZ());
- TDF_Label LabRotation2 = LabContact.NewChild();
- Handle(TDataStd_RealArray) RealArrayR = TDataStd_RealArray::Set(LabRotation2, 1, 3);
- RealArrayR->SetValue(1, KContact.Rotation().ValX());
- RealArrayR->SetValue(2, KContact.Rotation().ValY());
- RealArrayR->SetValue(3, KContact.Rotation().ValZ());
-
- TDF_Label LabTranslation = LabContact.NewChild();
- Handle(TDataStd_RealArray) RealArrayT = TDataStd_RealArray::Set(LabTranslation, 1, 3);
- RealArrayT->SetValue(1, KContact.Translation().ValX());
- RealArrayT->SetValue(2, KContact.Translation().ValY());
- RealArrayT->SetValue(3, KContact.Translation().ValZ());
+ TDF_Label LabLinearRange = LabContact.NewChild();
+ Handle(TDataStd_RealArray) RealArrayT = TDataStd_RealArray::Set(LabLinearRange, 1, 6);
+ RealArrayT->SetValue(1, KContact.GetLinearRange().GetMinValX());
+ RealArrayT->SetValue(2, KContact.GetLinearRange().GetMaxValX());
+ RealArrayT->SetValue(3, KContact.GetLinearRange().GetMinValY());
+ RealArrayT->SetValue(4, KContact.GetLinearRange().GetMaxValY());
+ RealArrayT->SetValue(5, KContact.GetLinearRange().GetMinValZ());
+ RealArrayT->SetValue(6, KContact.GetLinearRange().GetMaxValZ());
TDF_Label LabStep = LabContact.NewChild();
- TDataStd_Real::Set(LabStep, KContact.Step());
+ TDataStd_Real::Set(LabStep, KContact.GetStep());
return LabContact;
}
@@ -405,6 +405,7 @@ TDF_Label GEOMDS_Commands::AddAnimation(Kinematic_Animation& KAnimation,
const TDF_Label& AssLab,
const TCollection_ExtendedString& Name)
{
+ cout<<"GEOMDS_Commands::AddAnimation"< aContactList = returnAss->GetContactList();
+ list ::const_iterator it = aContactList.begin();
+ int i = 0;
+ while(it != aContactList.end()) {
+ TDF_Label LabDisplacement = LabAnimation.NewChild();
+ Handle(TDataStd_RealArray) RealArrayT = TDataStd_RealArray::Set(LabDisplacement, 1, 12);
+
+ list aList = KAnimation.GetDisplacement(i);
+ list ::const_iterator it1 = aList.begin();
+ int k = 1;
+ while(it1 != aList.end()) {
+ RealArrayT->SetValue(k, *it1);
+ k++;
+ it1++;
+ }
+ i++;
+ it++;
+ }
+ }
return LabAnimation;
}
@@ -480,7 +503,6 @@ Standard_Boolean GEOMDS_Commands::GetContact(const TDF_Label& aLabel,
Handle(TDataStd_Integer) anAttInteger1;
Handle(TDataStd_Integer) anAttInteger2;
Handle(TDataStd_Real) anAttReal;
- Handle(TDataStd_IntegerArray) anAttIntegerArrayR;
Handle(TDataStd_RealArray) anAttRealArrayP;
Handle(TDataStd_RealArray) anAttRealArrayR;
Handle(TDataStd_RealArray) anAttRealArrayT;
@@ -492,41 +514,36 @@ Standard_Boolean GEOMDS_Commands::GetContact(const TDF_Label& aLabel,
}
}
if(i == 2 && L.FindAttribute(TDataStd_Integer::GetID(), anAttInteger2)) {
- Contact->Type(anAttInteger2->Get());
+ Contact->SetType(anAttInteger2->Get());
}
if(i == 3 && L.FindAttribute(TNaming_NamedShape::GetID(), anAttTopo1)) {
- Contact->Shape1(TNaming_Tool::GetShape(anAttTopo1));
+ Contact->SetShape1(TNaming_Tool::GetShape(anAttTopo1));
}
if(i == 4 && L.FindAttribute(TNaming_NamedShape::GetID(), anAttTopo2)) {
- Contact->Shape2(TNaming_Tool::GetShape(anAttTopo2));
+ Contact->SetShape2(TNaming_Tool::GetShape(anAttTopo2));
}
if(i == 5 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayP)) {
gp_Pnt Center(anAttRealArrayP->Value(1), anAttRealArrayP->Value(2), anAttRealArrayP->Value(3));
gp_Dir aDirX(anAttRealArrayP->Value(4), anAttRealArrayP->Value(5), anAttRealArrayP->Value(6));
gp_Dir aDirY(anAttRealArrayP->Value(7), anAttRealArrayP->Value(8), anAttRealArrayP->Value(9));
gp_Dir aDirZ(anAttRealArrayP->Value(10), anAttRealArrayP->Value(11), anAttRealArrayP->Value(12));
- Contact->Position().Origin(Center);
- Contact->Position().DirX(aDirX);
- Contact->Position().DirY(aDirY);
- Contact->Position().DirZ(aDirZ);
+ Contact->GetPosition().SetOrigin(Center);
+ Contact->GetPosition().SetDirX(aDirX);
+ Contact->GetPosition().SetDirY(aDirY);
+ Contact->GetPosition().SetDirZ(aDirZ);
}
- if(i == 6 && L.FindAttribute(TDataStd_IntegerArray::GetID(), anAttIntegerArrayR)) {
- Contact->Rotation().Rot1(anAttIntegerArrayR->Value(1));
- Contact->Rotation().Rot2(anAttIntegerArrayR->Value(2));
- Contact->Rotation().Rot3(anAttIntegerArrayR->Value(3));
+ if(i == 6 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayR)) {
+ Contact->GetAngularRange().SetRangeX(anAttRealArrayR->Value(1), anAttRealArrayR->Value(2));
+ Contact->GetAngularRange().SetRangeY(anAttRealArrayR->Value(3), anAttRealArrayR->Value(4));
+ Contact->GetAngularRange().SetRangeZ(anAttRealArrayR->Value(5), anAttRealArrayR->Value(6));
}
- if(i == 7 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayR)) {
- Contact->Rotation().ValX(anAttRealArrayR->Value(1));
- Contact->Rotation().ValY(anAttRealArrayR->Value(2));
- Contact->Rotation().ValZ(anAttRealArrayR->Value(3));
+ if(i == 7 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayT)) {
+ Contact->GetLinearRange().SetRangeX(anAttRealArrayT->Value(1), anAttRealArrayT->Value(2));
+ Contact->GetLinearRange().SetRangeY(anAttRealArrayT->Value(3), anAttRealArrayT->Value(4));
+ Contact->GetLinearRange().SetRangeZ(anAttRealArrayT->Value(5), anAttRealArrayT->Value(6));
}
- if(i == 8 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayT)) {
- Contact->Translation().ValX(anAttRealArrayT->Value(1));
- Contact->Translation().ValY(anAttRealArrayT->Value(2));
- Contact->Translation().ValZ(anAttRealArrayT->Value(3));
- }
- if(i == 9 && L.FindAttribute(TDataStd_Real::GetID(), anAttReal)) {
- Contact->Step(anAttReal->Get());
+ if(i == 8 && L.FindAttribute(TDataStd_Real::GetID(), anAttReal)) {
+ Contact->SetStep(anAttReal->Get());
}
i++;
}
@@ -542,16 +559,19 @@ Standard_Boolean GEOMDS_Commands::GetContact(const TDF_Label& aLabel,
Standard_Boolean GEOMDS_Commands::GetAnimation(const TDF_Label& aLabel,
Kinematic_Animation& returnAnim)
{
+ cout<<"GEOMDS_Commands::GetAnimation"<Get() != 3) {
@@ -562,16 +582,23 @@ Standard_Boolean GEOMDS_Commands::GetAnimation(const TDF_Label& aLabel,
if(i == 2) {
Kinematic_Assembly* aAss = new Kinematic_Assembly();
Standard_Boolean test = GetAssembly(L, *aAss);
- Anim->Assembly(aAss);
+ Anim->SetAssembly(aAss);
}
if(i == 3 && L.FindAttribute(TNaming_NamedShape::GetID(), anAttTopo)) {
- Anim->Frame(TNaming_Tool::GetShape(anAttTopo));
+ Anim->SetFrame(TNaming_Tool::GetShape(anAttTopo));
}
if(i == 4 && L.FindAttribute(TDataStd_Real::GetID(), anAttReal)) {
- Anim->Duration(anAttReal->Get());
+ Anim->SetDuration(anAttReal->Get());
}
if(i == 5 && L.FindAttribute(TDataStd_Integer::GetID(), anAttInteger1)) {
- Anim->NbSeq(anAttInteger1->Get());
+ Anim->SetNbSeq(anAttInteger1->Get());
+ }
+ if(i > 5 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayP)) {
+ list aList;
+ for(int j = 1; j <= 12; j++)
+ aList.push_back(anAttRealArrayP->Value(j));
+ Anim->SetDisplacement(k, aList);
+ k++;
}
i++;
}
@@ -619,29 +646,27 @@ void GEOMDS_Commands::SetPosition(const TDF_Label& aLabel,
//=======================================================================
-// function : SetRotation()
+// function : SetAngularRange()
// purpose :
//=======================================================================
-void GEOMDS_Commands::SetRotation(const TDF_Label& aLabel,
- int Rot1, int Rot2, int Rot3,
- double Val1, double Val2, double Val3)
+void GEOMDS_Commands::SetAngularRange(const TDF_Label& aLabel,
+ double MinValX, double MaxValX,
+ double MinValY, double MaxValY,
+ double MinValZ, double MaxValZ)
{
TDF_ChildIterator it;
int i = 1;
for(it.Initialize(aLabel, Standard_False); it.More(); it.Next()) {
TDF_Label L = it.Value();
- Handle(TDataStd_IntegerArray) anAttIntegerArrayR;
Handle(TDataStd_RealArray) anAttRealArrayR;
- if(i == 6 && L.FindAttribute(TDataStd_IntegerArray::GetID(), anAttIntegerArrayR)) {
- anAttIntegerArrayR->SetValue(1, Rot1);
- anAttIntegerArrayR->SetValue(2, Rot2);
- anAttIntegerArrayR->SetValue(3, Rot3);
- }
- if(i == 7 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayR)) {
- anAttRealArrayR->SetValue(1, Val1);
- anAttRealArrayR->SetValue(2, Val2);
- anAttRealArrayR->SetValue(3, Val3);
+ if(i == 6 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayR)) {
+ anAttRealArrayR->SetValue(1, MinValX);
+ anAttRealArrayR->SetValue(2, MaxValX);
+ anAttRealArrayR->SetValue(3, MinValY);
+ anAttRealArrayR->SetValue(4, MaxValY);
+ anAttRealArrayR->SetValue(5, MinValZ);
+ anAttRealArrayR->SetValue(6, MaxValZ);
return;
}
i++;
@@ -651,11 +676,13 @@ void GEOMDS_Commands::SetRotation(const TDF_Label& aLabel,
//=======================================================================
-// function : SetTranslation()
+// function : SetLinearRange()
// purpose :
//=======================================================================
-void GEOMDS_Commands::SetTranslation(const TDF_Label& aLabel,
- double Val1, double Val2, double Val3)
+void GEOMDS_Commands::SetLinearRange(const TDF_Label& aLabel,
+ double MinValX, double MaxValX,
+ double MinValY, double MaxValY,
+ double MinValZ, double MaxValZ)
{
TDF_ChildIterator it;
int i = 1;
@@ -663,13 +690,56 @@ void GEOMDS_Commands::SetTranslation(const TDF_Label& aLabel,
TDF_Label L = it.Value();
Handle(TDataStd_RealArray) anAttRealArrayT;
- if(i == 8 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayT)) {
- anAttRealArrayT->SetValue(1, Val1);
- anAttRealArrayT->SetValue(2, Val2);
- anAttRealArrayT->SetValue(3, Val3);
+ if(i == 7 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayT)) {
+ anAttRealArrayT->SetValue(1, MinValX);
+ anAttRealArrayT->SetValue(2, MaxValX);
+ anAttRealArrayT->SetValue(3, MinValY);
+ anAttRealArrayT->SetValue(4, MaxValY);
+ anAttRealArrayT->SetValue(5, MinValZ);
+ anAttRealArrayT->SetValue(6, MaxValZ);
return;
}
i++;
}
return;
}
+
+
+//=======================================================================
+// function : SetDisplacement()
+// purpose :
+//=======================================================================
+void GEOMDS_Commands::SetDisplacement(const TDF_Label& aLabel, int aContact,
+ double MinValRX, double MaxValRX,
+ double MinValRY, double MaxValRY,
+ double MinValRZ, double MaxValRZ,
+ double MinValTX, double MaxValTX,
+ double MinValTY, double MaxValTY,
+ double MinValTZ, double MaxValTZ)
+{
+ cout<<"GEOMDS_Commands::SetDisplacement"<SetValue(1, MinValRX);
+ anAttRealArrayT->SetValue(2, MaxValRX);
+ anAttRealArrayT->SetValue(3, MinValRY);
+ anAttRealArrayT->SetValue(4, MaxValRY);
+ anAttRealArrayT->SetValue(5, MinValRZ);
+ anAttRealArrayT->SetValue(6, MaxValRZ);
+ anAttRealArrayT->SetValue(7, MinValTX);
+ anAttRealArrayT->SetValue(8, MaxValTX);
+ anAttRealArrayT->SetValue(9, MinValTY);
+ anAttRealArrayT->SetValue(10, MaxValTY);
+ anAttRealArrayT->SetValue(11, MinValTZ);
+ anAttRealArrayT->SetValue(12, MaxValTZ);
+ }
+ i++;
+ }
+ return;
+}
diff --git a/src/GEOMDS/GEOMDS_Commands.hxx b/src/GEOMDS/GEOMDS_Commands.hxx
index f45516a7a..cf5471d5b 100644
--- a/src/GEOMDS/GEOMDS_Commands.hxx
+++ b/src/GEOMDS/GEOMDS_Commands.hxx
@@ -146,10 +146,21 @@ public:
double VXx, double VXy, double VXz,
double VYx, double VYy, double VYz,
double VZx, double VZy, double VZz) ;
- Standard_EXPORT void SetRotation(const TDF_Label& aLabel, int Rot1, int Rot2, int Rot3,
- double Val1, double Val2, double Val3) ;
- Standard_EXPORT void SetTranslation(const TDF_Label& aLabel,
- double Val1, double Val2, double Val3) ;
+ Standard_EXPORT void SetAngularRange(const TDF_Label& aLabel,
+ double MinValX, double MaxValX,
+ double MinValY, double MaxValY,
+ double MinValZ, double MaxValZ) ;
+ Standard_EXPORT void SetLinearRange(const TDF_Label& aLabel,
+ double MinValX, double MaxValX,
+ double MinValY, double MaxValY,
+ double MinValZ, double MaxValZ) ;
+ Standard_EXPORT void SetDisplacement(const TDF_Label& aLabel, int aContact,
+ double MinValRX, double MaxValRX,
+ double MinValRY, double MaxValRY,
+ double MinValRZ, double MaxValRZ,
+ double MinValTX, double MaxValTX,
+ double MinValTY, double MaxValTY,
+ double MinValTZ, double MaxValTZ) ;
protected:
diff --git a/src/GEOMDS/GEOMDS_Commands.jxx b/src/GEOMDS/GEOMDS_Commands.jxx
index 017dcd329..8d4cccf10 100644
--- a/src/GEOMDS/GEOMDS_Commands.jxx
+++ b/src/GEOMDS/GEOMDS_Commands.jxx
@@ -35,4 +35,4 @@
#endif
#ifndef _GEOMDS_Commands_HeaderFile
#include "GEOMDS_Commands.hxx"
-#endif
\ No newline at end of file
+#endif
diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx
index 139007359..332bd7869 100644
--- a/src/GEOMGUI/GeometryGUI.cxx
+++ b/src/GEOMGUI/GeometryGUI.cxx
@@ -63,10 +63,9 @@ typedef bool CP(QAD_Desktop*, QPopupMenu*, const QString&,
// function : GeometryGUI()
// purpose : Constructor
//=======================================================================
-GeometryGUI::GeometryGUI() :
- QObject()
-{
-}
+GeometryGUI::GeometryGUI( const QString& theName, QObject* theParent ) :
+ SALOMEGUI( theName, theParent )
+{}
//=======================================================================
@@ -109,7 +108,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
@@ -117,169 +115,134 @@ 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(theCommandID == 111 || // MENU FILE - IMPORT BREP
+ theCommandID == 112 || // MENU FILE - IMPORT IGES
+ theCommandID == 113 || // MENU FILE - IMPORT STEP
+ theCommandID == 121 || // MENU FILE - EXPORT BREP
+ theCommandID == 122 || // MENU FILE - EXPORT IGES
+ theCommandID == 123 || // MENU FILE - EXPORT STEP
+ theCommandID == 31 || // MENU EDIT - COPY
+ theCommandID == 33 || // MENU EDIT - DELETE
+ theCommandID == 411 || // MENU SETTINGS - ADD IN STUDY
+ theCommandID == 412 || // MENU SETTINGS - SHADING COLOR
+ theCommandID == 413 || // MENU SETTINGS - ISOS
+ theCommandID == 414 || // MENU SETTINGS - STEP VALUE FOR SPIN BOXES
+ theCommandID == 5103 || // MENU TOOLS - CHECK GEOMETRY
+ theCommandID == 5104 || // MENU TOOLS - LOAD SCRIPT
+ theCommandID == 8032 || // POPUP VIEWER - COLOR
+ theCommandID == 8033 || // POPUP VIEWER - TRANSPARENCY
+ theCommandID == 8034 || // POPUP VIEWER - ISOS
+ theCommandID == 804 || // POPUP VIEWER - ADD IN STUDY
+ theCommandID == 901 || // OBJECT BROWSER - RENAME
+ theCommandID == 9024) { // OBJECT BROWSER - OPEN
+ if(!GeomGUI->LoadLibrary("libGEOMToolsGUI.so"))
+ return false;
+ }
+ else if(theCommandID == 211 || // MENU VIEW - WIREFRAME/SHADING
+ theCommandID == 212 || // MENU VIEW - DISPLAY ALL
+ theCommandID == 213 || // MENU VIEW - DISPLAY ONLY
+ theCommandID == 214 || // MENU VIEW - ERASE ALL
+ theCommandID == 215 || // MENU VIEW - ERASE ONLY
+ theCommandID == 8031) { // POPUP VIEWER - WIREFRAME/SHADING
+ if(!GeomGUI->LoadLibrary("libDisplayGUI.so"))
+ return false;
+ }
+ else if(theCommandID == 4011 || // MENU BASIC - POINT
+ theCommandID == 4012 || // MENU BASIC - LINE
+ theCommandID == 4013 || // MENU BASIC - CIRCLE
+ theCommandID == 4014 || // MENU BASIC - ELLIPSE
+ theCommandID == 4015 || // MENU BASIC - ARC
+ theCommandID == 4016 || // MENU BASIC - VECTOR
+ theCommandID == 4017 || // MENU BASIC - PLANE
+ theCommandID == 4018) { // MENU BASIC - WPLANE
+ if(!GeomGUI->LoadLibrary("libBasicGUI.so"))
+ return false;
+ }
+ else if(theCommandID == 4021 || // MENU PRIMITIVE - BOX
+ theCommandID == 4022 || // MENU PRIMITIVE - CYLINDER
+ theCommandID == 4023 || // MENU PRIMITIVE - SPHERE
+ theCommandID == 4024 || // MENU PRIMITIVE - TORUS
+ theCommandID == 4025) { // MENU PRIMITIVE - CONE
+ if(!GeomGUI->LoadLibrary("libPrimitiveGUI.so"))
+ return false;
+ }
+ else if(theCommandID == 4031 || // MENU GENERATION - PRISM
+ theCommandID == 4032 || // MENU GENERATION - REVOLUTION
+ theCommandID == 4033 || // MENU GENERATION - FILLING
+ theCommandID == 4034) { // MENU GENERATION - PIPE
+ if(!GeomGUI->LoadLibrary("libGenerationGUI.so"))
+ return false;
+ }
+ else if(theCommandID == 404 || // MENU ENTITY - SKETCHER
+ theCommandID == 407) { // MENU ENTITY - EXPLODE
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
- theCommandID == 121 || // MENU FILE - EXPORT BREP
- theCommandID == 122 || // MENU FILE - EXPORT IGES
- theCommandID == 123 || // MENU FILE - EXPORT STEP
- theCommandID == 31 || // MENU EDIT - COPY
- theCommandID == 33 || // MENU EDIT - DELETE
- theCommandID == 411 || // MENU SETTINGS - ADD IN STUDY
- theCommandID == 412 || // MENU SETTINGS - SHADING COLOR
- theCommandID == 413 || // MENU SETTINGS - ISOS
- theCommandID == 414 || // MENU SETTINGS - STEP VALUE FOR SPIN BOXES
- theCommandID == 5103 || // MENU TOOLS - CHECK GEOMETRY
- theCommandID == 5104 || // MENU TOOLS - LOAD SCRIPT
- theCommandID == 8032 || // POPUP VIEWER - COLOR
- theCommandID == 8033 || // POPUP VIEWER - TRANSPARENCY
- theCommandID == 8034 || // POPUP VIEWER - ISOS
- theCommandID == 804 || // POPUP VIEWER - ADD IN STUDY
- theCommandID == 901 || // OBJECT BROWSER - RENAME
- theCommandID == 9024) { // OBJECT BROWSER - OPEN
- if(!GeomGUI->LoadLibrary("libGEOMToolsGUI.so"))
- return false;
- }
- else if(theCommandID == 211 || // MENU VIEW - WIREFRAME/SHADING
- theCommandID == 212 || // MENU VIEW - DISPLAY ALL
- theCommandID == 213 || // MENU VIEW - DISPLAY ONLY
- theCommandID == 214 || // MENU VIEW - ERASE ALL
- theCommandID == 215 || // MENU VIEW - ERASE ONLY
- theCommandID == 8031) { // POPUP VIEWER - WIREFRAME/SHADING
- if(!GeomGUI->LoadLibrary("libDisplayGUI.so"))
- return false;
- }
- else if(theCommandID == 4011 || // MENU BASIC - POINT
- theCommandID == 4012 || // MENU BASIC - LINE
- theCommandID == 4013 || // MENU BASIC - CIRCLE
- theCommandID == 4014 || // MENU BASIC - ELLIPSE
- theCommandID == 4015 || // MENU BASIC - ARC
- theCommandID == 4016 || // MENU BASIC - VECTOR
- theCommandID == 4017 || // MENU BASIC - PLANE
- theCommandID == 4018) { // MENU BASIC - WPLANE
- if(!GeomGUI->LoadLibrary("libBasicGUI.so"))
- return false;
- }
- else if(theCommandID == 4021 || // MENU PRIMITIVE - BOX
- theCommandID == 4022 || // MENU PRIMITIVE - CYLINDER
- theCommandID == 4023 || // MENU PRIMITIVE - SPHERE
- theCommandID == 4024 || // MENU PRIMITIVE - TORUS
- theCommandID == 4025) { // MENU PRIMITIVE - CONE
- if(!GeomGUI->LoadLibrary("libPrimitiveGUI.so"))
- return false;
- }
- else if(theCommandID == 4031 || // MENU GENERATION - PRISM
- theCommandID == 4032 || // MENU GENERATION - REVOLUTION
- theCommandID == 4033 || // MENU GENERATION - FILLING
- theCommandID == 4034) { // MENU GENERATION - PIPE
- if(!GeomGUI->LoadLibrary("libGenerationGUI.so"))
- return false;
- }
- else if(theCommandID == 404 || // SKETCHER
- theCommandID == 407) { // MENU ENTITY - EXPLODE
- if(!GeomGUI->LoadLibrary("libEntityGUI.so"))
- return false;
- }
- else if(theCommandID == 4081 || // MENU BUILD - EDGE
- theCommandID == 4082 || // MENU BUILD - WIRE
- theCommandID == 4083 || // MENU BUILD - FACE
- theCommandID == 4084 || // MENU BUILD - SHELL
- theCommandID == 4085 || // MENU BUILD - SOLID
- theCommandID == 4086) { // MENU BUILD - COMPUND
- if(!GeomGUI->LoadLibrary("libBuildGUI.so"))
- return false;
- }
- else if(theCommandID == 5011 || // MENU BOOLEAN - FUSE
- theCommandID == 5012 || // MENU BOOLEAN - COMMON
- theCommandID == 5013 || // MENU BOOLEAN - CUT
- theCommandID == 5014) { // MENU BOOLEAN - SECTION
- if(!GeomGUI->LoadLibrary("libBooleanGUI.so"))
- return false;
- }
- else if(theCommandID == 5021 || // MENU TRANSFORMATION - TRANSLATION
- theCommandID == 5022 || // MENU TRANSFORMATION - ROTATION
- theCommandID == 5023 || // MENU TRANSFORMATION - POSITION
- theCommandID == 5024 || // MENU TRANSFORMATION - MIRROR
- theCommandID == 5025 || // MENU TRANSFORMATION - SCALE
- theCommandID == 5026 || // MENU TRANSFORMATION - MULTI-TRANSLATION
- theCommandID == 5027) { // MENU TRANSFORMATION - MULTI-ROTATION
- if(!GeomGUI->LoadLibrary("libTransformationGUI.so"))
- return false;
- }
- else if(theCommandID == 503 || // MENU OPERATION - PARTITION
- theCommandID == 504 || // MENU OPERATION - ARCHIMEDE
- theCommandID == 505 || // MENU OPERATION - FILLET
- theCommandID == 506) { // MENU OPERATION - CHAMFER
- if(!GeomGUI->LoadLibrary("libOperationGUI.so"))
- return false;
- }
- else if(theCommandID == 601 || // MENU REPAIR - SEWING
- theCommandID == 602 || // MENU REPAIR - ORIENTATION
- theCommandID == 603 || // MENU REPAIR - SUPPRESS FACES
- theCommandID == 604) { // MENU REPAIR - SUPPRESS HOLE
- if(!GeomGUI->LoadLibrary("libRepairGUI.so"))
- return false;
- }
- else if(theCommandID == 611 || // MENU KINEMATIC - ASSEMBLY
- theCommandID == 61201 || // MENU KINEMATIC - EMBEDDING
- theCommandID == 61202 || // MENU KINEMATIC - PIVOT
- theCommandID == 61203 || // MENU KINEMATIC - SLIDE
- theCommandID == 61204 || // MENU KINEMATIC - SLIDING PIVOT
- theCommandID == 61205 || // MENU KINEMATIC - SPHERICAL
- theCommandID == 61206 || // MENU KINEMATIC - PLANE
- theCommandID == 61207 || // MENU KINEMATIC - ANNULAR
- theCommandID == 61208 || // MENU KINEMATIC - RECTILINEAR
- theCommandID == 61209 || // MENU KINEMATIC - PONCTUAL
- theCommandID == 61210 || // MENU KINEMATIC - HELICOIDAL
- theCommandID == 6131 || // MENU KINEMATIC - POSITION
- theCommandID == 6132 || // MENU KINEMATIC - ROTATION
- theCommandID == 6133 || // MENU KINEMATIC - TRANSLATION
- theCommandID == 614 || // MENU KINEMATIC - ANIMATION
- theCommandID == 6141) { // MENU KINEMATIC - RUN ANIMATION
- if(!GeomGUI->LoadLibrary("libKinematicGUI.so"))
- return false;
- }
- else if(theCommandID == 701 || // MENU MEASURE - PROPERTIES
- theCommandID == 702 || // MENU MEASURE - CDG
- theCommandID == 703 || // MENU MEASURE - INERTIA
- theCommandID == 7041 || // MENU MEASURE - BOUNDING BOX
- theCommandID == 7042 || // MENU MEASURE - MIN DISTANCE
- theCommandID == 705 || // MENU MEASURE - TOLERANCE
- theCommandID == 706 || // MENU MEASURE - WHATIS
- theCommandID == 707) { // MENU MEASURE - CHECK
- if(!GeomGUI->LoadLibrary("libMeasureGUI.so"))
- return false;
- }
- else
+ else if(theCommandID == 4081 || // MENU BUILD - EDGE
+ theCommandID == 4082 || // MENU BUILD - WIRE
+ theCommandID == 4083 || // MENU BUILD - FACE
+ theCommandID == 4084 || // MENU BUILD - SHELL
+ theCommandID == 4085 || // MENU BUILD - SOLID
+ theCommandID == 4086) { // MENU BUILD - COMPUND
+ if(!GeomGUI->LoadLibrary("libBuildGUI.so"))
return false;
}
-
+ else if(theCommandID == 5011 || // MENU BOOLEAN - FUSE
+ theCommandID == 5012 || // MENU BOOLEAN - COMMON
+ theCommandID == 5013 || // MENU BOOLEAN - CUT
+ theCommandID == 5014) { // MENU BOOLEAN - SECTION
+ if(!GeomGUI->LoadLibrary("libBooleanGUI.so"))
+ return false;
+ }
+ else if(theCommandID == 5021 || // MENU TRANSFORMATION - TRANSLATION
+ theCommandID == 5022 || // MENU TRANSFORMATION - ROTATION
+ theCommandID == 5023 || // MENU TRANSFORMATION - POSITION
+ theCommandID == 5024 || // MENU TRANSFORMATION - MIRROR
+ theCommandID == 5025 || // MENU TRANSFORMATION - SCALE
+ theCommandID == 5026 || // MENU TRANSFORMATION - MULTI-TRANSLATION
+ theCommandID == 5027) { // MENU TRANSFORMATION - MULTI-ROTATION
+ if(!GeomGUI->LoadLibrary("libTransformationGUI.so"))
+ return false;
+ }
+ else if(theCommandID == 503 || // MENU OPERATION - PARTITION
+ theCommandID == 504 || // MENU OPERATION - ARCHIMEDE
+ theCommandID == 505 || // MENU OPERATION - FILLET
+ theCommandID == 506) { // MENU OPERATION - CHAMFER
+ if(!GeomGUI->LoadLibrary("libOperationGUI.so"))
+ return false;
+ }
+ else if(theCommandID == 601 || // MENU REPAIR - SEWING
+ theCommandID == 602 || // MENU REPAIR - ORIENTATION
+ theCommandID == 603 || // MENU REPAIR - SUPPRESS FACES
+ theCommandID == 604) { // MENU REPAIR - SUPPRESS HOLE
+ if(!GeomGUI->LoadLibrary("libRepairGUI.so"))
+ return false;
+ }
+ else if(theCommandID == 611 || // MENU KINEMATIC - ASSEMBLY
+ theCommandID == 6121 || // MENU KINEMATIC - CONTACT
+ theCommandID == 6122 || // MENU KINEMATIC - POSITION
+ theCommandID == 6123 || // MENU KINEMATIC - ROTATION
+ theCommandID == 6124 || // MENU KINEMATIC - TRANSLATION
+ theCommandID == 613 || // MENU KINEMATIC - ANIMATION
+ theCommandID == 6131 || // MENU KINEMATIC - SET VALUES
+ theCommandID == 6132) { // MENU KINEMATIC - RUN ANIMATION
+ if(!GeomGUI->LoadLibrary("libKinematicGUI.so"))
+ return false;
+ }
+ else if(theCommandID == 701 || // MENU MEASURE - PROPERTIES
+ theCommandID == 702 || // MENU MEASURE - CDG
+ theCommandID == 703 || // MENU MEASURE - INERTIA
+ theCommandID == 7041 || // MENU MEASURE - BOUNDING BOX
+ theCommandID == 7042 || // MENU MEASURE - MIN DISTANCE
+ theCommandID == 705 || // MENU MEASURE - TOLERANCE
+ theCommandID == 706 || // MENU MEASURE - WHATIS
+ theCommandID == 707) { // MENU MEASURE - CHECK
+ if(!GeomGUI->LoadLibrary("libMeasureGUI.so"))
+ return false;
+ }
+ else
+ return false;
+
//Load Function OnGUIEvent
OSD_Function osdF = GeomGUI->myGUILibrary.DlSymb("OnGUIEvent");
OGE (*f1) = NULL;
@@ -319,12 +282,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;
}
@@ -340,14 +298,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;
@@ -451,8 +402,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
@@ -480,11 +429,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";
}
@@ -531,24 +477,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;
@@ -571,25 +499,17 @@ bool GeometryGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QStr
// function : activeStudyChanged()
// purpose : static
//=================================================================================
-void GeometryGUI::activeStudyChanged(QAD_Desktop* parent)
+bool GeometryGUI::ActiveStudyChanged(QAD_Desktop* parent)
{
GeometryGUI::GetOrCreateGeometryGUI(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
@@ -604,7 +524,7 @@ void GeometryGUI::activeStudyChanged(QAD_Desktop* parent)
// PAL5356: update VTK selection
::UpdateVtkSelection(parent);
- return;
+ return true;
}
@@ -630,49 +550,23 @@ void GeometryGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theI
}
-//=================================================================================
-// EXPORTED METHODS
-//=================================================================================
+void GeometryGUI::SupportedViewType(int* buffer, int bufferSize)
+{
+ if(!buffer || !bufferSize) return;
+ buffer[0] = (int)VIEW_OCC;
+ if (--bufferSize) buffer[1] = (int)VIEW_VTK;
+}
+
+void GeometryGUI::Deactivate()
+{
+ if ( GeomGUI )
+ GeomGUI->EmitSignalCloseAllDialogs();
+}
+
+static GeometryGUI aGUI("");
extern "C"
{
- bool OnGUIEvent(int theCommandID, QAD_Desktop* parent)
- {return GeometryGUI::OnGUIEvent(theCommandID, parent);}
-
- bool OnKeyPress(QKeyEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame)
- {return GeometryGUI::OnKeyPress(pe, parent, studyFrame);}
-
- bool OnMousePress(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame)
- {return GeometryGUI::OnMousePress(pe, parent, studyFrame);}
-
- bool OnMouseMove(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame)
- {return GeometryGUI::OnMouseMove(pe, parent, studyFrame);}
-
- bool SetSettings(QAD_Desktop* parent)
- {return GeometryGUI::SetSettings(parent);}
-
- bool customPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString & theContext,
- const QString & theParent, const QString & theObject)
- {return GeometryGUI::CustomPopup(parent, popup, theContext, theParent, theObject);}
-
- void definePopup(QString & theContext, QString & parent, QString & theObject)
- {GeometryGUI::DefinePopup(theContext, parent, theObject);}
-
- bool activeStudyChanged(QAD_Desktop* parent)
- {GeometryGUI::activeStudyChanged(parent);}
-
- void buildPresentation(const Handle(SALOME_InteractiveObject)& theIO)
- {GeometryGUI::BuildPresentation(theIO);}
-
- void supportedViewType(int* buffer, int bufferSize)
- {
- if(!buffer || !bufferSize) return;
- buffer[0] = (int)VIEW_OCC;
- if (--bufferSize) buffer[1] = (int)VIEW_VTK;
- }
-
- void deactivate()
- {
- if ( GeomGUI )
- GeomGUI->EmitSignalCloseAllDialogs();
+ Standard_EXPORT SALOMEGUI* GetComponentGUI() {
+ return &aGUI;
}
}
diff --git a/src/GEOMGUI/GeometryGUI.h b/src/GEOMGUI/GeometryGUI.h
index dd133add0..06649f622 100644
--- a/src/GEOMGUI/GeometryGUI.h
+++ b/src/GEOMGUI/GeometryGUI.h
@@ -29,34 +29,36 @@
#ifndef GEOMETRYGUI_H
#define GEOMETRYGUI_H
+#include "SALOMEGUI.h"
#include "GEOMContext.h"
//=================================================================================
// class : GeometryGUI
// purpose :
//=================================================================================
-class GeometryGUI : public QObject
+class GeometryGUI : public SALOMEGUI
{
Q_OBJECT /* for QT compatibility */
public :
- GeometryGUI();
- ~GeometryGUI();
-
- static GEOMContext* GetOrCreateGeometryGUI(QAD_Desktop* desktop);
-
- /* Managed by IAPP */
- Standard_EXPORT static bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
- Standard_EXPORT static bool OnMousePress(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame);
- Standard_EXPORT static bool OnMouseMove(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame);
- Standard_EXPORT static bool OnKeyPress(QKeyEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame);
- Standard_EXPORT static bool SetSettings(QAD_Desktop* parent);
- Standard_EXPORT static void activeStudyChanged(QAD_Desktop* parent);
- Standard_EXPORT static void BuildPresentation(const Handle(SALOME_InteractiveObject)&);
- Standard_EXPORT static void DefinePopup(QString & theContext, QString & theParent, QString & theObject);
- Standard_EXPORT static bool CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString& theContext,
- const QString& theParent, const QString& theObject);
-
+ GeometryGUI( const QString& name = "", QObject* parent = 0 );
+ ~GeometryGUI();
+
+ static GEOMContext* GetOrCreateGeometryGUI(QAD_Desktop* desktop);
+
+ /* Managed by IAPP */
+ virtual bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
+ virtual bool OnMousePress(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame);
+ virtual bool OnMouseMove(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame);
+ virtual bool OnKeyPress(QKeyEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame);
+ virtual bool SetSettings(QAD_Desktop* parent);
+ virtual bool ActiveStudyChanged(QAD_Desktop* parent);
+ virtual void BuildPresentation(const Handle(SALOME_InteractiveObject)&);
+ virtual void DefinePopup(QString & theContext, QString & theParent, QString & theObject);
+ virtual bool CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString& theContext,
+ const QString& theParent, const QString& theObject);
+ virtual void SupportedViewType (int* buffer, int bufferSize);
+ virtual void Deactivate ();
};
#endif
diff --git a/src/GEOMGUI/GeometryGUI_Swig.cxx b/src/GEOMGUI/GeometryGUI_Swig.cxx
index 81e1f1b45..bb7159bbb 100644
--- a/src/GEOMGUI/GeometryGUI_Swig.cxx
+++ b/src/GEOMGUI/GeometryGUI_Swig.cxx
@@ -264,6 +264,7 @@ const char* GEOM_Swig::getShapeTypeString(const char* IOR)
case TopAbs_SHAPE:
{ return "Shape" ;}
}
+ return 0;
}
diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.cxx b/src/GEOMToolsGUI/GEOMToolsGUI.cxx
index 591c97c3c..e4aab6706 100644
--- a/src/GEOMToolsGUI/GEOMToolsGUI.cxx
+++ b/src/GEOMToolsGUI/GEOMToolsGUI.cxx
@@ -26,7 +26,6 @@
// Module : GEOM
// $Header:
-using namespace std;
#include "GEOMToolsGUI.h"
#include "QAD_Config.h"
@@ -34,6 +33,7 @@ using namespace std;
#include "QAD_Tools.h"
#include "QAD_MessageBox.h"
#include "QAD_RightFrame.h"
+#include "QAD_PyEditor.h"
#include "OCCViewer_Viewer3d.h"
#include "VTKViewer_ViewFrame.h"
@@ -60,6 +60,10 @@ using namespace std;
#include "GEOMToolsGUI_NbIsosDlg.h" // Method ISOS adjustement
#include "GEOMToolsGUI_TransparencyDlg.h" // Method TRANSPARENCY adjustement
+#include "utilities.h"
+
+using namespace std;
+
//=======================================================================
// function : GEOMToolsGUI()
// purpose : Constructor
@@ -150,7 +154,7 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
{
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
break;
-
+
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
@@ -791,7 +795,7 @@ bool GEOMToolsGUI::Import(int aState)
QString nameShape = QAD_Tools::getFileNameFromPath(file,false) + QString("_%1").arg(myGeomGUI->myNbGeom++);
- if(myGeomBase->Display(aShape, strdup(nameShape.latin1()))) {
+ if(myGeomBase->Display(aShape, (char*)nameShape.latin1())) {
QAD_Application::getDesktop()->getActiveStudy()->setMessage( tr("GEOM_INF_LOADED").arg(QAD_Tools::getFileNameFromPath( file )) );
QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_READY"));
}
@@ -839,7 +843,7 @@ bool GEOMToolsGUI::Export(int aState)
QApplication::setOverrideCursor( Qt::waitCursor );
// Standard_Boolean result = BRepTools::Write(Shape->Shape(), strdup(file.latin1()) );
try {
- myGeom->ExportBREP(strdup( file.latin1()), aShape);
+ myGeom->ExportBREP((char*)file.latin1(), aShape);
}
catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
@@ -866,7 +870,7 @@ bool GEOMToolsGUI::Export(int aState)
if ( !file.isEmpty() && !aShape->_is_nil() ) {
QApplication::setOverrideCursor( Qt::waitCursor );
try {
- myGeom->ExportIGES(strdup( file.latin1()), aShape);
+ myGeom->ExportIGES((char*)file.latin1(), aShape);
}
catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
@@ -912,7 +916,7 @@ bool GEOMToolsGUI::Export(int aState)
QApplication::setOverrideCursor( Qt::waitCursor ) ;
try {
- myGeom->ExportSTEP(strdup( file.latin1()), aShape);
+ myGeom->ExportSTEP((char*)file.latin1(), aShape);
}
catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
@@ -938,6 +942,7 @@ bool GEOMToolsGUI::Export(int aState)
}
QApplication::restoreOverrideCursor() ;
+ return true;
}
diff --git a/src/GEOM_SWIG/GEOM_Kinematic.py b/src/GEOM_SWIG/GEOM_Kinematic.py
new file mode 100644
index 000000000..f44742742
--- /dev/null
+++ b/src/GEOM_SWIG/GEOM_Kinematic.py
@@ -0,0 +1,105 @@
+# GEOM GEOM_SWIG : binding of C++ omplementaion with Python
+#
+# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+#
+#
+#
+# File : GEOM_Kinematic.py
+# Author : Damien COQUERET, Open CASCADE
+# Module : GEOM
+# $Header:
+
+import salome
+import geompy
+import math
+
+geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
+myBuilder = salome.myStudy.NewBuilder()
+
+#Varaibles
+TypeShape = 8 #Explode In Shape
+Pivot = 1
+Step = 0.
+Duration = 5.
+NbSeq = 50
+
+#Import Shapes : Robot
+Robot = geompy.ImportBREP("/home/dcq/robot.brep")
+Id_Robot = geompy.addToStudy(Robot, "Robot")
+
+#Decompose objects
+SubShape = []
+SubShape = geompy.SubShapeAll(Robot, TypeShape)
+
+for Shape in SubShape :
+ name = geompy.SubShapeName(Shape._get_Name(), Robot._get_Name())
+# Id_SubShape = geompy.addToStudy(Shape, "Shape")
+ Id_SubShape = geompy.addToStudyInFather(Robot, Shape, name)
+
+#Kinematic
+anAss = geompy.InitAssembly()
+Id_Ass = geompy.addAssemblyToStudy(anAss, "Robot_Assembly")
+
+aContact1 = geompy.AddContact(anAss, SubShape[0], SubShape[1], Pivot, Step)
+aContact1.SetPosition(0., 0., 0., 0., 0., 1., 1., 0., 0., 0., 1., 0.)
+geompy.SetPosition(aContact1)
+aContact1.SetAngularRange(0., 45., 0., 0., 0., 0.)
+geompy.SetAngularRange(aContact1)
+Id_Contact1 = geompy.addContactToStudy(anAss, aContact1, "Robot_Contact1")
+
+aContact2 = geompy.AddContact(anAss, SubShape[1], SubShape[2], Pivot, Step)
+aContact2.SetPosition(0., 0., 900., 0., 1., 0., 0., 0., 1., 1., 0., 0.)
+geompy.SetPosition(aContact2)
+aContact2.SetAngularRange(0., 30., 0., 0., 0., 0.)
+geompy.SetAngularRange(aContact2)
+Id_Contact2 = geompy.addContactToStudy(anAss, aContact2, "Robot_Contact2")
+
+aContact3 = geompy.AddContact(anAss, SubShape[2], SubShape[3], Pivot, Step)
+aContact3.SetPosition(565.7, 0., 1465.7, 0., 1., 0., 0., 0., 1., 1., 0., 0.)
+geompy.SetPosition(aContact3)
+aContact3.SetAngularRange(-180., 0., 0., 0., 0., 0.)
+geompy.SetAngularRange(aContact3)
+Id_Contact3 = geompy.addContactToStudy(anAss, aContact3, "Robot_Contact3")
+
+aContact4 = geompy.AddContact(anAss, SubShape[3], SubShape[4], Pivot, Step)
+aContact4.SetPosition(1132.5, 0., 901.1, 0., 1., 0., 0., 0., 1., 1., 0., 0.)
+geompy.SetPosition(aContact4)
+aContact4.SetAngularRange(0., 180., 0., 0., 0., 0.)
+geompy.SetAngularRange(aContact4)
+Id_Contact4 = geompy.addContactToStudy(anAss, aContact4, "Robot_Contact4")
+
+aContact5 = geompy.AddContact(anAss, SubShape[4], SubShape[5], Pivot, Step)
+aContact5.SetPosition(0., 0., 900., 1., 0., 0., 0., 1., 0., 0., 0., 1.)
+geompy.SetPosition(aContact5)
+aContact5.SetAngularRange(0., 180., 0., 0., 0., 0.)
+geompy.SetAngularRange(aContact5)
+Id_Contact5 = geompy.addContactToStudy(anAss, aContact5, "Robot_Contact5")
+
+anAnim = geompy.AddAnimation(anAss, SubShape[0], Duration, NbSeq)
+aList = []
+aList.append(0.)
+aList.append(-180.)
+i = 0
+while i <= 9 :
+ aList.append(0.)
+ i = i + 1
+anAnim.SetDisplacement(aContact3, aList)
+geompy.SetDisplacement(anAnim, aContact3)
+Id_Anim = geompy.addAnimationToStudy(anAnim, "Robot_Animation")
diff --git a/src/GEOM_SWIG/GEOM_Sketcher.py b/src/GEOM_SWIG/GEOM_Sketcher.py
new file mode 100644
index 000000000..fbdb7fbf5
--- /dev/null
+++ b/src/GEOM_SWIG/GEOM_Sketcher.py
@@ -0,0 +1,58 @@
+# GEOM GEOM_SWIG : binding of C++ omplementaion with Python
+#
+# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+#
+#
+#
+# File : GEOM_Sketcher.py
+# Author : Damien COQUERET, Open CASCADE
+# Module : GEOM
+# $Header$
+
+import geompy
+
+#SKETCHER INFOS
+#Init Sketcher
+#Create a string beginning by :"Sketcher:"
+#Each command must be separated by ":"
+#"F x y" : Create first point at X & Y
+
+#To Make Segment
+#"R angle" : Set the direction by angle
+#"D dx dy" : Set the direction by DX & DY
+
+#"TT x y" : Create by point at X & Y
+#"T dx dy" : Create by point with DX & DY
+#"L length" : Create by direction & Length
+#"IX x" : Create by direction & Intersect. X
+#"IY y" : Create by direction & Intersect. Y
+
+#To Make Arc
+#"C radius length" : Create by direction, radius and length(in degree)
+
+#To finish
+#"WW" : Close Wire
+
+#Create Sketcher
+Cmd = "Sketch:F 0 0:TT 0 100:C 100 180:WW"
+Sketcher = geompy.MakeSketcher(Cmd) #(string)->GEOM_Shape_ptr
+
+#Add In Study
+id_Sketcher = geompy.addToStudy(Sketcher, "Sketcher")
diff --git a/src/GEOM_SWIG/Makefile.in b/src/GEOM_SWIG/Makefile.in
index 5984c7dce..338ff43e9 100644
--- a/src/GEOM_SWIG/Makefile.in
+++ b/src/GEOM_SWIG/Makefile.in
@@ -45,13 +45,15 @@ EXPORT_PYSCRIPTS = libGEOM_Swig.py geompy.py batchmode_geompy.py \
GEOM_example2.py \
GEOM_example3.py \
GEOM_example4.py \
+ GEOM_Kinematic.py \
GEOM_moteur.py \
GEOM_usinggeom.py \
GEOM_Partition1.py \
GEOM_Partition2.py \
GEOM_Partition3.py \
GEOM_Partition4.py \
- GEOM_Partition5.py
+ GEOM_Partition5.py \
+ GEOM_Sketcher.py
LIB_CLIENT_IDL = SALOMEDS.idl \
SALOMEDS_Attributes.idl \
diff --git a/src/GEOM_SWIG/batchmode_geompy.py b/src/GEOM_SWIG/batchmode_geompy.py
index 7d1ae1db8..ec0421c2d 100644
--- a/src/GEOM_SWIG/batchmode_geompy.py
+++ b/src/GEOM_SWIG/batchmode_geompy.py
@@ -164,6 +164,12 @@ def MakePlane(p1,d1,trimsize):
anObj._set_Name(ior)
return anObj
+def MakeSketcher(Cmd):
+ anObj = geom.MakeSketcher(Cmd)
+ ior = orb.object_to_string(anObj)
+ anObj._set_Name(ior)
+ return anObj
+
# -----------------------------------------------------------------------------
# Create Geometry 3D
# -----------------------------------------------------------------------------
@@ -487,11 +493,14 @@ def AddAnimation(Ass,Frame,Duration,NbSeq):
def SetPosition(aContact):
geom.SetPosition(aContact)
-def SetRotation(aContact):
- geom.SetRotation(aContact)
+def SetAngularRange(aContact):
+ geom.SetAngularRange(aContact)
-def SetTranslation(aContact):
- geom.SetTranslation(aContact)
+def SetLinearRange(aContact):
+ geom.SetLinearRange(aContact)
+
+def SetDisplacement(anAnim,aContact):
+ geom.SetDisplacement(anAnim,aContact)
def addAssemblyToStudy(anAss, aName):
myBuilder.NewCommand()
diff --git a/src/GEOM_SWIG/geompy.py b/src/GEOM_SWIG/geompy.py
index 2a128aebe..f2c7c7ec1 100644
--- a/src/GEOM_SWIG/geompy.py
+++ b/src/GEOM_SWIG/geompy.py
@@ -190,6 +190,12 @@ def MakePlane(p1,d1,trimsize):
anObj._set_Name(ior)
return anObj
+def MakeSketcher(Cmd):
+ anObj = geom.MakeSketcher(Cmd)
+ ior = salome.orb.object_to_string(anObj)
+ anObj._set_Name(ior)
+ return anObj
+
# -----------------------------------------------------------------------------
# Create Geometry 3D
# -----------------------------------------------------------------------------
@@ -513,11 +519,14 @@ def AddAnimation(Ass,Frame,Duration,NbSeq):
def SetPosition(aContact):
geom.SetPosition(aContact)
-def SetRotation(aContact):
- geom.SetRotation(aContact)
+def SetAngularRange(aContact):
+ geom.SetAngularRange(aContact)
-def SetTranslation(aContact):
- geom.SetTranslation(aContact)
+def SetLinearRange(aContact):
+ geom.SetLinearRange(aContact)
+
+def SetDisplacement(anAnim,aContact):
+ geom.SetDisplacement(anAnim,aContact)
def addAssemblyToStudy(anAss, aName):
myBuilder.NewCommand()
diff --git a/src/GenerationGUI/GenerationGUI_FillingDlg.cxx b/src/GenerationGUI/GenerationGUI_FillingDlg.cxx
index fc32ef980..85d0203b8 100644
--- a/src/GenerationGUI/GenerationGUI_FillingDlg.cxx
+++ b/src/GenerationGUI/GenerationGUI_FillingDlg.cxx
@@ -26,9 +26,9 @@
// Module : GEOM
// $Header$
-using namespace std;
#include "GenerationGUI_FillingDlg.h"
+#include "QAD_WaitCursor.h"
#include "QAD_Config.h"
#include
@@ -38,8 +38,14 @@ using namespace std;
#include
#include
#include
+#include
#include
#include
+#include
+
+#include "utilities.h"
+
+using namespace std;
//=================================================================================
// class : GenerationGUI_FillingDlg()
@@ -210,10 +216,14 @@ void GenerationGUI_FillingDlg::SelectionIntoArgument()
return;
if(myEditCurrentArgument == GroupPoints->LineEdit1 && mySectionShape.ShapeType() == TopAbs_COMPOUND) {
- myEditCurrentArgument->setText(aString);
myGeomShape = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult)
return;
+ // mySectionShape should be a compound of edges
+ for ( TopoDS_Iterator it( mySectionShape ); it.More(); it.Next() )
+ if ( it.Value().ShapeType() != TopAbs_EDGE )
+ return;
+ myEditCurrentArgument->setText(aString);
myOkSectionShape = true;
}
@@ -319,6 +329,8 @@ void GenerationGUI_FillingDlg::ValueChangedInSpinBox(double newValue)
//=================================================================================
void GenerationGUI_FillingDlg::MakeFillingSimulationAndDisplay()
{
+ QAD_WaitCursor wc;
+
myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify();
@@ -336,6 +348,7 @@ void GenerationGUI_FillingDlg::MakeFillingSimulationAndDisplay()
if( Scurrent.IsNull() || Scurrent.ShapeType() != TopAbs_EDGE)
return;
C = BRep_Tool::Curve(TopoDS::Edge(Scurrent), First, Last);
+ if (C.IsNull()) continue;
C = new Geom_TrimmedCurve(C, First, Last);
Section.AddCurve(C) ;
i++ ;
diff --git a/src/GenerationGUI/GenerationGUI_PipeDlg.cxx b/src/GenerationGUI/GenerationGUI_PipeDlg.cxx
index d1bc9969e..adb21593b 100644
--- a/src/GenerationGUI/GenerationGUI_PipeDlg.cxx
+++ b/src/GenerationGUI/GenerationGUI_PipeDlg.cxx
@@ -26,7 +26,6 @@
// Module : GEOM
// $Header$
-using namespace std;
#include "GenerationGUI_PipeDlg.h"
#include
@@ -38,6 +37,10 @@ using namespace std;
#include
#endif
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : GenerationGUI_PipeDlg()
// purpose : Constructs a GenerationGUI_PipeDlg which is a child of 'parent', with the
diff --git a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx
index b9c8057ec..90fc67b70 100644
--- a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx
+++ b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx
@@ -26,12 +26,15 @@
// Module : GEOM
// $Header$
-using namespace std;
#include "GenerationGUI_PrismDlg.h"
#include
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : GenerationGUI_PrismDlg()
// purpose : Constructs a GenerationGUI_PrismDlg which is a child of 'parent', with the
diff --git a/src/GenerationGUI/GenerationGUI_RevolDlg.cxx b/src/GenerationGUI/GenerationGUI_RevolDlg.cxx
index 69d69205c..0aa52712c 100644
--- a/src/GenerationGUI/GenerationGUI_RevolDlg.cxx
+++ b/src/GenerationGUI/GenerationGUI_RevolDlg.cxx
@@ -26,13 +26,18 @@
// Module : GEOM
// $Header$
-using namespace std;
#include "GenerationGUI_RevolDlg.h"
#include
#include
#include
#include "QAD_Config.h"
+#include
+#include
+
+#include "utilities.h"
+
+using namespace std;
//=================================================================================
// class : GenerationGUI_RevolDlg()
@@ -157,6 +162,32 @@ void GenerationGUI_RevolDlg::ClickOnApply()
return;
}
+//=======================================================================
+//function : isAcceptableBase
+//purpose : return true if theBase can be used as algo argument
+//=======================================================================
+
+static bool isAcceptableBase(const TopoDS_Shape& theBase)
+{
+ switch ( theBase.ShapeType() ) {
+ case TopAbs_VERTEX:
+ case TopAbs_EDGE:
+ case TopAbs_WIRE:
+ case TopAbs_FACE:
+ case TopAbs_SHELL:
+ return true;
+ case TopAbs_SOLID:
+ case TopAbs_COMPSOLID:
+ return false;
+ case TopAbs_COMPOUND: {
+ TopExp_Explorer exp( theBase, TopAbs_SOLID);
+ return !exp.More();
+ }
+ default:
+ return false;
+ }
+ return false;
+}
//=================================================================================
// function : SelectionIntoArgument()
@@ -189,8 +220,7 @@ void GenerationGUI_RevolDlg::SelectionIntoArgument()
myGeomShape = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult)
return;
- TopAbs_ShapeEnum aType = S.ShapeType();
- if(aType != TopAbs_VERTEX && aType != TopAbs_EDGE && aType != TopAbs_WIRE && aType != TopAbs_FACE && aType != TopAbs_SHELL && aType != TopAbs_COMPOUND)
+ if( !isAcceptableBase( S ))
return;
myEditCurrentArgument->setText(aString);
myOkBase = true;
@@ -318,8 +348,7 @@ void GenerationGUI_RevolDlg::MakeRevolutionSimulationAndDisplay()
myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify();
- TopAbs_ShapeEnum aType = myBase.ShapeType();
- if(aType != TopAbs_VERTEX && aType != TopAbs_EDGE && aType != TopAbs_WIRE && aType != TopAbs_FACE && aType != TopAbs_SHELL && aType !=TopAbs_COMPOUND)
+ if (!isAcceptableBase( myBase ))
return;
try {
diff --git a/src/KINEMATIC/Kinematic_Animation.cxx b/src/KINEMATIC/Kinematic_Animation.cxx
index 935443e91..97d5eda6b 100644
--- a/src/KINEMATIC/Kinematic_Animation.cxx
+++ b/src/KINEMATIC/Kinematic_Animation.cxx
@@ -26,13 +26,14 @@
// Module : GEOM
// $Header:
-using namespace std;
#include "Kinematic_Animation.hxx"
#include
#include
#include
+using namespace std;
+
//=======================================================================
// profile
// command to build a profile
@@ -53,14 +54,16 @@ Kinematic_Animation::Kinematic_Animation()
Kinematic_Animation::Kinematic_Animation(Kinematic_Assembly* Ass, TopoDS_Shape frame,
double duration, int nbseq)
{
- myAss = Ass;
- myFrame = frame;
- myDuration = duration;
- myNbSeq = nbseq;
myIsShading = false;
IsCreated = false;
myNbAIS = 0;
+
+ SetAssembly(Ass);
+ SetFrame(frame);
+ SetDuration(duration);
+ SetNbSeq(nbseq);
this->SetMap();
+ this->InitValues();
return;
}
@@ -74,42 +77,141 @@ Kinematic_Animation::~Kinematic_Animation() {}
//=================================================================================
// function : SetMap()
-// purpose :
+// purpose : Create Kinematic Graph
//=================================================================================
void Kinematic_Animation::SetMap()
{
- list ContactList = myAss->GetContactList();
+ list aContactList = myAss->GetContactList();
Kinematic_Contact* aContact;
- list ::const_iterator it = ContactList.begin();
- while(it != ContactList.end()) {
+ list ::const_iterator it = aContactList.begin();
+ while(it != aContactList.end()) {
aContact = *it;
- if(!myIndexToShape.Contains(aContact->Shape1()))
- myIndexToShape.Add(aContact->Shape1());
+ if(!myIndexToShape.Contains(aContact->GetShape1()))
+ myIndexToShape.Add(aContact->GetShape1());
- if(!myIndexToShape.Contains(aContact->Shape2()))
- myIndexToShape.Add(aContact->Shape2());
+ if(!myIndexToShape.Contains(aContact->GetShape2()))
+ myIndexToShape.Add(aContact->GetShape2());
it++;
}
for(int i = 1; i <= myIndexToShape.Extent(); i++) {
- it = ContactList.begin();
- list ContactListOfShape;
- TopoDS_Shape myShape = myIndexToShape.FindKey(i);
- while(it != ContactList.end()) {
+ it = aContactList.begin();
+ list aContactListOfShape;
+ TopoDS_Shape aShape = myIndexToShape.FindKey(i);
+ while(it != aContactList.end()) {
aContact = *it;
- if(myShape == aContact->Shape1() || myShape == aContact->Shape2())
- ContactListOfShape.push_back(aContact);
+ if(aShape == aContact->GetShape1() || aShape == aContact->GetShape2())
+ aContactListOfShape.push_back(aContact);
it++;
}
- myStlMapofShapeListOfContact[i] = ContactListOfShape;
+ myStlMapofShapeListOfContact[i] = aContactListOfShape;
}
return;
}
+//=================================================================================
+// function : InitValues()
+// purpose :
+//=================================================================================
+void Kinematic_Animation::InitValues()
+{
+ list aContactList = myAss->GetContactList();
+ list ::const_iterator it = aContactList.begin();
+ while(it != aContactList.end()) {
+ InitValuesOnContact(*it);
+ it++;
+ }
+
+ return;
+}
+
+
+//=================================================================================
+// function : InitValuesOnContact()
+// purpose :
+//=================================================================================
+void Kinematic_Animation::InitValuesOnContact(Kinematic_Contact* aContact)
+{
+ cout<<"Kinematic_Animation::InitValuesOnContact"< aContactListOfValue;
+
+ cout<<"Kinematic_Animation::InitValuesOnContact : Val = "<GetAngularRange().GetMaxValX()<GetAngularRange().GetMinValX());
+ aContactListOfValue.push_back(aContact->GetAngularRange().GetMaxValX());
+ aContactListOfValue.push_back(aContact->GetAngularRange().GetMinValY());
+ aContactListOfValue.push_back(aContact->GetAngularRange().GetMaxValY());
+ aContactListOfValue.push_back(aContact->GetAngularRange().GetMinValZ());
+ aContactListOfValue.push_back(aContact->GetAngularRange().GetMaxValZ());
+
+ aContactListOfValue.push_back(aContact->GetLinearRange().GetMinValX());
+ aContactListOfValue.push_back(aContact->GetLinearRange().GetMaxValX());
+ aContactListOfValue.push_back(aContact->GetLinearRange().GetMinValY());
+ aContactListOfValue.push_back(aContact->GetLinearRange().GetMaxValY());
+ aContactListOfValue.push_back(aContact->GetLinearRange().GetMinValZ());
+ aContactListOfValue.push_back(aContact->GetLinearRange().GetMaxValZ());
+
+ myStlMapofContactListOfValue[aContact] = aContactListOfValue;
+ return;
+}
+
+
+//=================================================================================
+// function : GetDisplacement()
+// purpose :
+//=================================================================================
+list Kinematic_Animation::GetDisplacement(int aContact)
+{
+ cout<<"Kinematic_Animation::GetDisplacement"< aContactList = myAss->GetContactList();
+
+ list ::const_iterator it = aContactList.begin();
+ int i = 0;
+ while(it != aContactList.end()) {
+ if(i == aContact)
+ aKContact = *it;
+ i++;
+ it++;
+ }
+
+ if(myStlMapofContactListOfValue.find(aKContact) == myStlMapofContactListOfValue.end()) {
+ cout<<"Kinematic_Animation::GetDisplacement : ADD"< aContactListOfValue = myStlMapofContactListOfValue[aKContact];
+ return aContactListOfValue;
+}
+
+
+//=================================================================================
+// function : SetDisplacement()
+// purpose :
+//=================================================================================
+void Kinematic_Animation::SetDisplacement(int aContact, list aList)
+{
+ cout<<"Kinematic_Animation::SetDisplacement"< aContactList = myAss->GetContactList();
+
+ list ::const_iterator it = aContactList.begin();
+ int i = 0;
+ while(it != aContactList.end()) {
+ if(i == aContact)
+ aKContact = *it;
+ i++;
+ it++;
+ }
+
+ myStlMapofContactListOfValue[aKContact] = aList;
+ return;
+}
+
+
//=================================================================================
// function : GetNextShape()
// purpose :
@@ -118,36 +220,36 @@ void Kinematic_Animation::GetNextShape(const Handle(AIS_InteractiveContext)& ic,
gp_Trsf& aLoc, TopoDS_Shape Shape1, double Step)
{
int j = 0;
- list ContactListOfShape;
+ list aContactListOfShape;
Kinematic_Contact* aContact;
- TopoDS_Shape myShape, myShape2, aNewShape;
+ TopoDS_Shape aShape, aShape2, aNewShape;
for(int i = 1; i <= myIndexToShape.Extent(); i++) {
- myShape = myIndexToShape.FindKey(i);
- if(myShape == Shape1) {
+ aShape = myIndexToShape.FindKey(i);
+ if(aShape == Shape1) {
gp_Trsf aNewLoc = aLoc;
- ContactListOfShape = myStlMapofShapeListOfContact[i];
- list ::const_iterator it = ContactListOfShape.begin();
- while(it != ContactListOfShape.end()) {
+ aContactListOfShape = myStlMapofShapeListOfContact[i];
+ list ::const_iterator it = aContactListOfShape.begin();
+ while(it != aContactListOfShape.end()) {
aContact = *it;
- if(aContact->Shape1() == Shape1)
- myShape2 = aContact->Shape2();
- else if(aContact->Shape2() == Shape1)
- myShape2 = aContact->Shape1();
+ if(aContact->GetShape1() == Shape1)
+ aShape2 = aContact->GetShape2();
+ else if(aContact->GetShape2() == Shape1)
+ aShape2 = aContact->GetShape1();
- if(!myMovedShape.Contains(myShape2)) {
- myMovedShape.Add(myShape2);
+ if(!myMovedShape.Contains(aShape2)) {
+ myMovedShape.Add(aShape2);
if(!IsCreated) {
Handle(AIS_Shape) mySimulationShape;
mySimulationShape = new AIS_Shape(TopoDS_Shape());
- mySimulationShape->Set(myShape2);
- ListOfAIS.Append(mySimulationShape);
+ mySimulationShape->Set(aShape2);
+ myListOfAIS.Append(mySimulationShape);
}
else
MoveShape(ic, aLoc, aContact, Step);
- GetNextShape(ic, aLoc, myShape2, Step);
+ GetNextShape(ic, aLoc, aShape2, Step);
}
aLoc = aNewLoc;
it++;
@@ -160,18 +262,18 @@ void Kinematic_Animation::GetNextShape(const Handle(AIS_InteractiveContext)& ic,
//=================================================================================
-// function : CreateShape()
+// function : MoveShape()
// purpose :
//=================================================================================
void Kinematic_Animation::MoveShape(const Handle(AIS_InteractiveContext)& ic,
gp_Trsf& aLoc, Kinematic_Contact* aContact,
double Step)
{
- gp_Trsf aTrans = aContact->GetTransformation(Step);
+ gp_Trsf aTrans = GetTransformation(aContact, Step);
aLoc = aLoc * aTrans;
myNbAIS++;
- Handle(AIS_Shape) mySimulationShape = Handle(AIS_Shape)::DownCast(ListOfAIS.Value(myNbAIS));
+ Handle(AIS_Shape) mySimulationShape = Handle(AIS_Shape)::DownCast(myListOfAIS.Value(myNbAIS));
Handle(Geom_Transformation) aGTrans = new Geom_Transformation();
aGTrans->SetTrsf(aLoc);
mySimulationShape->SetTransformation(aGTrans, false, false);
@@ -187,3 +289,39 @@ void Kinematic_Animation::MoveShape(const Handle(AIS_InteractiveContext)& ic,
ic->Display(mySimulationShape, Standard_False);
return;
}
+
+
+//=================================================================================
+// function : GetTransformation()
+// purpose :
+//=================================================================================
+gp_Trsf Kinematic_Animation::GetTransformation(Kinematic_Contact* aContact, double Step)
+{
+ gp_Vec aVect;
+ gp_Trsf aTransformation, aRot, aRot1, aRot2, aRot3;
+
+ list aValuesList = myStlMapofContactListOfValue[aContact];
+ list ::const_iterator it = aValuesList.begin();
+ double aL[12];
+
+ int i = 0;
+ while(it != aValuesList.end()) {
+ aL[i] = *it;
+ i++;
+ it++;
+ }
+
+ aRot1.SetRotation(aContact->GetPosition().GetAxeX(), (Step * (aL[1] - aL[0]) + aL[0]) * PI / 180);
+ aRot2.SetRotation(aContact->GetPosition().GetAxeY(), (Step * (aL[3] - aL[2]) + aL[2]) * PI / 180);
+ aRot3.SetRotation(aContact->GetPosition().GetAxeZ(), (Step * (aL[5] - aL[4]) + aL[4]) * PI / 180);
+ aRot = aRot1 * aRot2 * aRot3;
+
+ aVect.SetCoord(Step * (aL[7] - aL[6]) + aL[6],
+ Step * (aL[9] - aL[8]) + aL[8],
+ Step * (aL[11] - aL[10]) + aL[10]);
+
+ aTransformation.SetTranslation(aVect);
+ aTransformation = aTransformation * aRot;
+
+ return aTransformation;
+}
diff --git a/src/KINEMATIC/Kinematic_Animation.hxx b/src/KINEMATIC/Kinematic_Animation.hxx
index 258665a54..ae00f2496 100644
--- a/src/KINEMATIC/Kinematic_Animation.hxx
+++ b/src/KINEMATIC/Kinematic_Animation.hxx
@@ -36,6 +36,7 @@
#include
#include
#include
+#include
#include
#include