<rect>
<x>0</x>
<y>0</y>
- <width>307</width>
- <height>147</height>
+ <width>321</width>
+ <height>295</height>
</rect>
</property>
<property name="sizePolicy">
<number>6</number>
</property>
<widget class="QGroupBox" row="2" column="0">
+ <property name="name">
+ <cstring>GroupMedium</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="3" column="0">
<property name="name">
<cstring>GroupButtons</cstring>
</property>
</widget>
<widget class="QGroupBox" row="1" column="0">
<property name="name">
- <cstring>GroupMedium</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>7</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <cstring>GroupBoxName</cstring>
</property>
<property name="title">
- <string></string>
+ <string>Result name</string>
</property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout66</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>ResultName</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>NameLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Name</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
</widget>
</grid>
</widget>
// Module : GEOM
// $Header:
-using namespace std;
#include "EntityGUI.h"
#include "QAD_RightFrame.h"
#include "SALOMEGUI_ImportOperation.h"
#include "SALOMEGUI_QtCatchCorbaException.hxx"
-#include <BRepTools_WireExplorer.hxx>
-#include <TopoDS_Wire.hxx>
#include <TopoDS_Compound.hxx>
-#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
-#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
-#include <Geom_Circle.hxx>
-#include <Precision.hxx>
#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()
myGeomBase = new GEOMBase();
myGeomGUI = GEOMContext::GetGeomGUI();
myGeom = myGeomGUI->myComponentGeom;
+
+ mySimulationShape1 = new AIS_Shape(TopoDS_Shape());
+ mySimulationShape2 = new AIS_Shape(TopoDS_Shape());
}
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
//=======================================================================
-// function : OnSketchSetAngle()
+// function : OnSketchEnd()
// purpose :
//=======================================================================
-void EntityGUI::OnSketchSetAngle()
+void EntityGUI::OnSketchEnd(const char *Cmd)
{
- 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);
+ try {
+ GEOM::GEOM_Shape_var result = myGeom->MakeSketcher(Cmd);
+ if(result->_is_nil()) {
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
+ return;
+ }
+ result->NameType(tr("GEOM_WIRE"));
+ if(myGeomBase->Display(result))
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
}
- 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);
+ catch(const SALOME::SALOME_Exception& S_ex) {
+ QtCatchCorbaException(S_ex);
}
-
- if(myGeomGUI->GetSketcher().Delete())
- myGeomGUI->myState = -1;
return;
}
-//=======================================================================
-// function : OnSketchClose()
-// purpose :
-//=======================================================================
-void EntityGUI::OnSketchClose()
+//=====================================================================================
+// 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)
{
- 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
+ //NRI DEBUG : 14/02/2002
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ return;
- 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);
- }
+ 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);
- 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);
- }
+ mySimulationShape2 = new AIS_Shape(TopoDS_Shape());
+ mySimulationShape2->Set(S2);
+ mySimulationShape2->SetColor(Quantity_NOC_VIOLET);
- listShapes->length(i+1);
- listShapes[i] = strdup(segment->Name());
- i++;
- }
- Ex.Next();
+ ic->Deactivate(mySimulationShape2);
+ ic->Display(mySimulationShape2, Standard_False);
+ mySimulationShape2->UnsetColor();
}
- 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"));
+ ic->UpdateCurrentViewer();
}
- myGeomGUI->myState = -1;
- QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
- Mb->setItemEnabled(405, false); // SKETCH CONTRAINTS
- myGeomGUI->GetSketcher().SetTransitionStatus(NOCONSTRAINT);
+ catch(Standard_Failure) {
+ MESSAGE("Exception catched in EntityGUI::DisplaySimulationShape ");
+ }
return;
}
-//=======================================================================
-// function : OnSketchEnd()
-// purpose :
-//=======================================================================
-void EntityGUI::OnSketchEnd()
+//==================================================================================
+// function : EraseSimulationShape()
+// purpose : Clears the display of 'mySimulationShape' a pure graphical shape
+//==================================================================================
+void EntityGUI::EraseSimulationShape(int Sh)
{
- 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++;
+ 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);
}
- 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"));
+ if(Sh <= 1) {
+ ic->Erase(mySimulationShape2, Standard_True, Standard_False);
+ ic->ClearPrs(mySimulationShape2);
+ }
+ ic->UpdateCurrentViewer();
+ }
}
- myGeomGUI->myState = -1;
- QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
- Mb->setItemEnabled(405, false); // SKETCH CONTRAINTS
- myGeomGUI->GetSketcher().SetTransitionStatus(NOCONSTRAINT);
- return;
}
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);
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 */
--- /dev/null
+/****************************************************************************
+** 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 <qvariant.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * 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
+}
+
--- /dev/null
+/****************************************************************************
+** 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 <qvariant.h>
+#include <qwidget.h>
+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
--- /dev/null
+// 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_1Spin.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#include "EntityGUI_1Spin.h"
+
+#include <qlayout.h>
+#include <qspinbox.h>
+#include <qgroupbox.h>
+
+/*
+ * Constructs a EntityGUI_1Spin which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+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");
+ Layout1->addWidget(SpinBox_DX, 0, 1);
+
+}
+
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_1Spin::~EntityGUI_1Spin()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
--- /dev/null
+// 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_1Spin.h
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef ENTITYGUI_1SPIN_H
+#define ENTITYGUI_1SPIN_H
+
+#include "EntityGUI_1Spin_QTD.h"
+#include "DlgRef_SpinBox.h"
+
+class EntityGUI_1Spin : public EntityGUI_1Spin_QTD
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_1Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
+ ~EntityGUI_1Spin();
+
+ DlgRef_SpinBox* SpinBox_DX;
+
+};
+
+#endif // ENTITYGUI_1SPIN_H
--- /dev/null
+/****************************************************************************
+** 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 <qvariant.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qspinbox.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * 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
+}
+
--- /dev/null
+/****************************************************************************
+** 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 <qvariant.h>
+#include <qwidget.h>
+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
--- /dev/null
+// 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 <qlayout.h>
+#include <qspinbox.h>
+#include <qgroupbox.h>
+
+/*
+ * 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
+}
--- /dev/null
+// 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
--- /dev/null
+/****************************************************************************
+** 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 <qvariant.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qspinbox.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * 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
+}
+
--- /dev/null
+/****************************************************************************
+** 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 <qvariant.h>
+#include <qwidget.h>
+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
--- /dev/null
+// 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_3Spin.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#include "EntityGUI_3Spin.h"
+
+#include <qlayout.h>
+#include <qspinbox.h>
+#include <qgroupbox.h>
+
+/*
+ * Constructs a EntityGUI_3Spin which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+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_DZ, 2, 1);
+}
+
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_3Spin::~EntityGUI_3Spin()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
--- /dev/null
+// 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_3Spin.h
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef ENTITYGUI_3SPIN_H
+#define ENTITYGUI_3SPIN_H
+
+#include "EntityGUI_3Spin_QTD.h"
+#include "DlgRef_SpinBox.h"
+
+class EntityGUI_3Spin : public EntityGUI_3Spin_QTD
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_3Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_3Spin();
+
+ DlgRef_SpinBox* SpinBox_DX;
+ DlgRef_SpinBox* SpinBox_DY;
+ DlgRef_SpinBox* SpinBox_DZ;
+
+};
+
+#endif // ENTITYGUI_3SPIN_H
--- /dev/null
+/****************************************************************************
+** 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 <qvariant.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qspinbox.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * 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
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface 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!
+****************************************************************************/
+#ifndef ENTITYGUI_3SPIN_QTD_H
+#define ENTITYGUI_3SPIN_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QGroupBox;
+class QLabel;
+class QPushButton;
+class QSpinBox;
+
+class EntityGUI_3Spin_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_3Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_3Spin_QTD();
+
+ QGroupBox* GroupBox1;
+ QPushButton* buttonUndo;
+ QPushButton* buttonApply;
+ QLabel* TextLabel2;
+ QLabel* TextLabel1;
+ QSpinBox* SpinBox1;
+ QSpinBox* SpinBox2;
+ QLabel* TextLabel3;
+ QSpinBox* SpinBox3;
+
+
+protected:
+ QGridLayout* EntityGUI_3Spin_QTDLayout;
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* Layout3;
+ QGridLayout* Layout2;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_3SPIN_QTD_H
--- /dev/null
+// 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 <qlayout.h>
+#include <qspinbox.h>
+#include <qgroupbox.h>
+
+/*
+ * 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
+}
--- /dev/null
+// 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
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_4Spin_QTD.ui'
+**
+** 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 "EntityGUI_4Spin_QTD.h"
+
+#include <qvariant.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qspinbox.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a EntityGUI_4Spin_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_4Spin_QTD::EntityGUI_4Spin_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ 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( "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, 1, 0 );
+ QSpacerItem* spacer_2 = new QSpacerItem( 0, 70, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer_2, 4, 1 );
+
+ SpinBox4 = new QSpinBox( GroupBox1, "SpinBox4" );
+ SpinBox4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox4->sizePolicy().hasHeightForWidth() ) );
+
+ 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, 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() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
+
+ Layout1->addWidget( TextLabel1, 0, 0 );
+
+ 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, 3, 0 );
+
+ Layout3->addLayout( Layout1, 0, 0 );
+
+ GroupBox1Layout->addLayout( Layout3, 0, 0 );
+
+ EntityGUI_4Spin_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
+ */
+EntityGUI_4Spin_QTD::~EntityGUI_4Spin_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_4Spin_QTD.ui'
+**
+** 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 ENTITYGUI_4SPIN_QTD_H
+#define ENTITYGUI_4SPIN_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QGroupBox;
+class QLabel;
+class QPushButton;
+class QSpinBox;
+
+class EntityGUI_4Spin_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_4Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_4Spin_QTD();
+
+ QGroupBox* GroupBox1;
+ QPushButton* buttonUndo;
+ QPushButton* buttonApply;
+ QSpinBox* SpinBox3;
+ QSpinBox* SpinBox2;
+ QLabel* TextLabel2;
+ QSpinBox* SpinBox4;
+ QLabel* TextLabel3;
+ QSpinBox* SpinBox1;
+ QLabel* TextLabel1;
+ QLabel* TextLabel4;
+
+
+protected:
+ QGridLayout* EntityGUI_4Spin_QTDLayout;
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* Layout3;
+ QGridLayout* Layout2;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_4SPIN_QTD_H
--- /dev/null
+/****************************************************************************
+** 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 <qvariant.h>
+#include <qbuttongroup.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * 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
+}
+
--- /dev/null
+/****************************************************************************
+** 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 <qvariant.h>
+#include <qwidget.h>
+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
--- /dev/null
+/****************************************************************************
+** 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 <qvariant.h>
+#include <qbuttongroup.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * 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
+}
+
--- /dev/null
+/****************************************************************************
+** 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 <qvariant.h>
+#include <qwidget.h>
+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
--- /dev/null
+/****************************************************************************
+** 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 <qvariant.h>
+#include <qbuttongroup.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * 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
+}
+
--- /dev/null
+/****************************************************************************
+** 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 <qvariant.h>
+#include <qwidget.h>
+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
--- /dev/null
+/****************************************************************************
+** 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 <qvariant.h>
+#include <qbuttongroup.h>
+#include <qgroupbox.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * 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
+}
+
--- /dev/null
+/****************************************************************************
+** 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 <qvariant.h>
+#include <qdialog.h>
+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
--- /dev/null
+// 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 <BRep_Tool.hxx>
+#include <TopExp.hxx>
+#include <TopoDS_Vertex.hxx>
+
+#include <qpushbutton.h>
+
+//=================================================================================
+// 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;
+}
--- /dev/null
+// 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 <gp_Dir.hxx>
+
+#include <qwidget.h>
+#include <qgroupbox.h>
+#include <qlineedit.h>
+#include <qlayout.h>
+#include <qradiobutton.h>
+#include <qbuttongroup.h>
+
+//=================================================================================
+// 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
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
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@
// 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() {}
//=================================================================================
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'.
//=================================================================================
-// function : Name (get method)
-// purpose : to get the attribute 'name' of this shape
+// function : ShapeId (set method)
+// purpose : to set the id of this shape in GEOM/OCAF doc
//=================================================================================
-char* GEOM_Animation_i::Name() { return strdup(_name); }
+void GEOM_Animation_i::ShapeId(const char * shapeid)
+{ _shapeid = strdup(shapeid); }
//=================================================================================
-// function : ShapeId
-// purpose : to get the id of this shape from GEOM (OCAF entry)
+// function : StudyShapeId (set method)
+// purpose : to set the id of this shape in the Study document (OCAF entry)
//=================================================================================
-char* GEOM_Animation_i::ShapeId() { return strdup(_shapeid); }
+void GEOM_Animation_i::StudyShapeId(const char * studyshapeid)
+{ _studyshapeid = strdup(studyshapeid); }
//=================================================================================
-// function : ShapeId (set method)
-// purpose : to set the id of this shape in GEOM/OCAF doc
+// function : GetDisplacement()
+// purpose :
//=================================================================================
-void GEOM_Animation_i::ShapeId(const char * shapeid) { _shapeid = strdup(shapeid); }
+GEOM::ListOfDouble* GEOM_Animation_i::GetDisplacement(GEOM::GEOM_Contact_ptr aContact)
+ throw(SALOME::SALOME_Exception)
+{
+ cout<<"GEOM_Animation_i::GetDisplacement"<<endl;
+ GEOM::ListOfDouble_var aDisplacementList = new GEOM::ListOfDouble;
+ aDisplacementList->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 = "<<aKContact<<endl;
+ list <double> aList = _Animation->GetDisplacement(aKContact);
+ list <double>::const_iterator it = aList.begin();
+ int k = 0;
+ while(it != aList.end()) {
+ cout<<"GEOM_Animation_i::GetDisplacement : k = "<<k<<endl;
+ aDisplacementList[k] = *it;
+ k++;
+ it++;
+ }
+
+ return aDisplacementList._retn();
+}
//=================================================================================
-// function : StudyShapeId (get method)
-// purpose : to get the id of this shape from the study document (OCAF entry)
+// function : SetDisplacement()
+// purpose :
//=================================================================================
-char* GEOM_Animation_i::StudyShapeId() { return strdup(_studyshapeid) ; }
+void GEOM_Animation_i::SetDisplacement(GEOM::GEOM_Contact_ptr aContact,
+ const GEOM::ListOfDouble& aList)
+ throw (SALOME::SALOME_Exception)
+{
+ GEOM::ListOfContact_var aContactList = _Ass->GetContactList();
+ int aKContact = 0;
+ for(int i = 0; i < _Ass->NbContacts(); i++) {
+ if(aContact == aContactList[i])
+ aKContact = i;
+ }
+ list <double> aKList;
+ for(int j = 0; j < 12; j++)
+ aKList.push_back(aList[j]);
-//=================================================================================
-// function : StudyShapeId (set method)
-// purpose : to set the id of this shape in the Study document (OCAF entry)
-//=================================================================================
-void GEOM_Animation_i::StudyShapeId(const char * studyshapeid)
-{ _studyshapeid = strdup(studyshapeid); }
+ _Animation->SetDisplacement(aKContact, aKList);
+
+ return;
+}
char* _studyshapeid; // exists only if added in the study document
public:
- GEOM::GEOM_Assembly_ptr GetAssembly()
- throw (SALOME::SALOME_Exception);
+ GEOM::GEOM_Assembly_ptr GetAssembly() throw (SALOME::SALOME_Exception)
+ {return GEOM::GEOM_Assembly::_duplicate(_Ass);};
- GEOM::GEOM_Shape_ptr GetFrame()
- throw (SALOME::SALOME_Exception);
+ 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();};
- CORBA::Double GetDuration()
+ GEOM::ListOfDouble* GetDisplacement(GEOM::GEOM_Contact_ptr aContact)
throw (SALOME::SALOME_Exception);
- CORBA::Long GetNbSeq()
+ void SetDisplacement(GEOM::GEOM_Contact_ptr aContact,
+ const GEOM::ListOfDouble& aList)
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);
};
// 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() {}
//=================================================================================
GEOM_Assembly_i::~GEOM_Assembly_i() { delete &_Ass; }
-//=================================================================================
-// function : AddContact()
-// purpose :
-//=================================================================================
-void GEOM_Assembly_i::AddContact(GEOM::GEOM_Contact_ptr aContact) throw(SALOME::SALOME_Exception)
-{
- _aContactList.length(_NbContact + 1);
- _aContactList[_NbContact] = GEOM::GEOM_Contact::_duplicate(aContact);
- _NbContact++;
-
- return;
-}
-
-//=================================================================================
-// function : GetContactList()
-// purpose :
-//=================================================================================
-GEOM::ListOfContact* GEOM_Assembly_i::GetContactList() throw(SALOME::SALOME_Exception)
-{
- GEOM::ListOfContact_var aContactList = new GEOM::ListOfContact;
- aContactList->length(_aContactList.length());
- 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'.
//=================================================================================
-// 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)
+// function : ShapeId (set method)
+// purpose : to set the id of this shape in GEOM/OCAF doc
//=================================================================================
-char* GEOM_Assembly_i::ShapeId() { return strdup(_shapeid); }
+void GEOM_Assembly_i::ShapeId(const char * shapeid)
+{ _shapeid = strdup(shapeid); }
//=================================================================================
-// function : ShapeId (set method)
-// purpose : to set the id of this shape in GEOM/OCAF doc
+// function : StudyShapeId (set method)
+// purpose : to set the id of this shape in the Study document (OCAF entry)
//=================================================================================
-void GEOM_Assembly_i::ShapeId(const char * shapeid) { _shapeid = strdup(shapeid); }
+void GEOM_Assembly_i::StudyShapeId(const char * studyshapeid)
+{ _studyshapeid = strdup(studyshapeid); }
//=================================================================================
-// function : StudyShapeId (get method)
-// purpose : to get the id of this shape from the study document (OCAF entry)
+// function : AddContact()
+// purpose :
//=================================================================================
-char* GEOM_Assembly_i::StudyShapeId() { return strdup(_studyshapeid) ; }
+void GEOM_Assembly_i::AddContact(GEOM::GEOM_Contact_ptr aContact) throw(SALOME::SALOME_Exception)
+{
+ _aContactList.length(_NbContact + 1);
+ _aContactList[_NbContact] = GEOM::GEOM_Contact::_duplicate(aContact);
+ _NbContact++;
+ return;
+}
//=================================================================================
-// function : StudyShapeId (set method)
-// purpose : to set the id of this shape in the Study document (OCAF entry)
+// function : GetContactList()
+// purpose :
//=================================================================================
-void GEOM_Assembly_i::StudyShapeId(const char * studyshapeid)
-{ _studyshapeid = strdup(studyshapeid); }
+GEOM::ListOfContact* GEOM_Assembly_i::GetContactList() throw(SALOME::SALOME_Exception)
+{
+ GEOM::ListOfContact_var aContactList = new GEOM::ListOfContact;
+ aContactList->length(_aContactList.length());
+ for(int i = 0; i < _NbContact; i++)
+ aContactList[i] = GEOM::GEOM_Contact::_duplicate(_aContactList[i]);
+
+ return aContactList._retn();
+}
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);
};
// 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() {}
//=================================================================================
//=================================================================================
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;
}
//=================================================================================
-// function : GetType()
-// purpose :
+// function : Name (set method)
+// purpose : to set the attribute 'name'.
+// : WARNING : Register to naming service actually removed !
//=================================================================================
-CORBA::Long GEOM_Contact_i::GetType() throw(SALOME::SALOME_Exception)
+void GEOM_Contact_i::Name(const char* name)
{
- return _Contact->Type();
+ _name = strdup(name);
+ GEOM::GEOM_Contact_ptr g = GEOM::GEOM_Contact::_narrow(_this());
}
//=================================================================================
-// function : GetShape1()
-// purpose :
+// function : ShapeId (set method)
+// purpose : to set the id of this shape in GEOM/OCAF doc
//=================================================================================
-GEOM::GEOM_Shape_ptr GEOM_Contact_i::GetShape1() throw(SALOME::SALOME_Exception)
-{
- return GEOM::GEOM_Shape::_duplicate(_Shape1);
-}
+void GEOM_Contact_i::ShapeId(const char * shapeid)
+{ _shapeid = strdup(shapeid); }
//=================================================================================
-// function : GetShape2()
-// purpose :
+// function : StudyShapeId (set method)
+// purpose : to set the id of this shape in the Study document (OCAF entry)
//=================================================================================
-GEOM::GEOM_Shape_ptr GEOM_Contact_i::GetShape2() throw(SALOME::SALOME_Exception)
-{
- return GEOM::GEOM_Shape::_duplicate(_Shape2);
-}
+void GEOM_Contact_i::StudyShapeId(const char * studyshapeid)
+{ _studyshapeid = strdup(studyshapeid); }
//=================================================================================
// function : GetPosition()
// purpose :
//=================================================================================
-GEOM::GEOM_Position_ptr GEOM_Contact_i::GetPosition() throw(SALOME::SALOME_Exception)
+GEOM::ListOfDouble* GEOM_Contact_i::GetPosition() throw(SALOME::SALOME_Exception)
{
- return GEOM::GEOM_Position::_duplicate(_Position);
-}
+ 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();
-//=================================================================================
-// function : GetRotation()
-// purpose :
-//=================================================================================
-GEOM::GEOM_Rotation_ptr GEOM_Contact_i::GetRotation() throw(SALOME::SALOME_Exception)
-{
- return GEOM::GEOM_Rotation::_duplicate(_Rotation);
-}
+ 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();
-//=================================================================================
-// function : GetTranslation()
-// purpose :
-//=================================================================================
-GEOM::GEOM_Translation_ptr GEOM_Contact_i::GetTranslation() throw(SALOME::SALOME_Exception)
-{
- return GEOM::GEOM_Translation::_duplicate(_Translation);
+ aPositionList[9] = _Contact->GetPosition().GetDirZ().X();
+ aPositionList[10] = _Contact->GetPosition().GetDirZ().Y();
+ aPositionList[11] = _Contact->GetPosition().GetDirZ().Z();
+
+ return aPositionList._retn();
}
//=================================================================================
-// function : GetStep()
+// function : GetAngularRange()
// purpose :
//=================================================================================
-CORBA::Double GEOM_Contact_i::GetStep() throw(SALOME::SALOME_Exception)
+GEOM::ListOfDouble* GEOM_Contact_i::GetAngularRange() throw(SALOME::SALOME_Exception)
{
- return _Contact->Step();
+ 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 : Name (set method)
-// purpose : to set the attribute 'name'.
-// : WARNING : Register to naming service actually removed !
+// function : GetLinearRange()
+// purpose :
//=================================================================================
-void GEOM_Contact_i::Name(const char* name)
+GEOM::ListOfDouble* GEOM_Contact_i::GetLinearRange() throw(SALOME::SALOME_Exception)
{
- _name = strdup(name);
- GEOM::GEOM_Contact_ptr g = GEOM::GEOM_Contact::_narrow(_this());
-}
+ GEOM::ListOfDouble_var aLinearRangeList = new GEOM::ListOfDouble;
+ aLinearRangeList->length(6);
+ aLinearRangeList[0] = _Contact->GetLinearRange().GetMinValX();
+ aLinearRangeList[1] = _Contact->GetLinearRange().GetMaxValX();
-//=================================================================================
-// function : Name (get method)
-// purpose : to get the attribute 'name' of this shape
-//=================================================================================
-char* GEOM_Contact_i::Name() { return strdup(_name); }
+ aLinearRangeList[2] = _Contact->GetLinearRange().GetMinValY();
+ aLinearRangeList[3] = _Contact->GetLinearRange().GetMaxValY();
+ aLinearRangeList[4] = _Contact->GetLinearRange().GetMinValZ();
+ aLinearRangeList[5] = _Contact->GetLinearRange().GetMaxValZ();
-//=================================================================================
-// function : ShapeId
-// purpose : to get the id of this shape from GEOM (OCAF entry)
-//=================================================================================
-char* GEOM_Contact_i::ShapeId() { return strdup(_shapeid); }
+ return aLinearRangeList._retn();
+}
//=================================================================================
-// function : ShapeId (set method)
-// purpose : to set the id of this shape in GEOM/OCAF doc
+// function : SetPosition()
+// purpose :
//=================================================================================
-void GEOM_Contact_i::ShapeId(const char * shapeid) { _shapeid = strdup(shapeid); }
+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)."<<endl);
+ } else {
+ gp_Vec aDirX(VXx, VXy, VXz);
+ _Contact->GetPosition().SetDirX(aDirX);
+ }
+
+ if(VYx == 0 && VYy == 0 && VYz == 0) {
+ MESSAGE("Null Vector in Contact Position (SetVY)."<<endl);
+ } else {
+ gp_Vec aDirY(VYx, VYy, VYz);
+ _Contact->GetPosition().SetDirY(aDirY);
+ }
+
+ if(VZx == 0 && VZy == 0 && VZz == 0) {
+ MESSAGE("Null Vector in Contact Position (SetVZ)."<<endl);
+ } else {
+ gp_Vec aDirZ(VZx, VZy, VZz);
+ _Contact->GetPosition().SetDirZ(aDirZ);
+ }
+
+ return;
+}
//=================================================================================
-// function : StudyShapeId (get method)
-// purpose : to get the id of this shape from the study document (OCAF entry)
+// function : SetAngularRange()
+// purpose :
//=================================================================================
-char* GEOM_Contact_i::StudyShapeId() { return strdup(_studyshapeid) ; }
+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 : StudyShapeId (set method)
-// purpose : to set the id of this shape in the Study document (OCAF entry)
+// function : SetLinearRange()
+// purpose :
//=================================================================================
-void GEOM_Contact_i::StudyShapeId(const char * studyshapeid)
-{ _studyshapeid = strdup(studyshapeid); }
+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;
+}
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();
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::GEOM_Shape_ptr GetShape1()
- throw (SALOME::SALOME_Exception);
-
- GEOM::GEOM_Shape_ptr GetShape2()
+ GEOM::ListOfDouble* GetAngularRange()
throw (SALOME::SALOME_Exception);
-
- GEOM::GEOM_Position_ptr GetPosition()
+ GEOM::ListOfDouble* GetLinearRange()
throw (SALOME::SALOME_Exception);
- GEOM::GEOM_Rotation_ptr GetRotation()
+ 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_Translation_ptr GetTranslation()
+ void SetAngularRange(double MinValX, double MaxValX,
+ double MinValY, double MaxValY,
+ double MinValZ, double MaxValZ)
throw (SALOME::SALOME_Exception);
- CORBA::Double GetStep()
+ void SetLinearRange(double MinValX, double MaxValX,
+ double MinValY, double MaxValY,
+ double MinValZ, double MaxValZ)
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);
};
#include "Partition_Spliter.hxx"
#include "Archimede_VolumeSection.hxx"
+#include "Sketcher_Profile.hxx"
#include "Utils_CorbaException.hxx"
#include "utilities.h"
{
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)) {
}
/* 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) */
result->ShapeId(aPersRefString);
return result->Name();
}
+ return 0 ;
}
//============================================================================
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");
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 );
// 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);
// }
// 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 );
//============================================================================
char* GEOM_Gen_i::ComponentDataType()
{
- return strdup("GEOM");
+ return CORBA::string_dup("GEOM");
}
//============================================================================
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);
}
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) ;
{
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);
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);
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 ))
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++) {
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++ ;
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++;
}
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();
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);
}
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);
+ }
}
}
}
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()
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 ) ;
CORBA::Double step)
throw (SALOME::SALOME_Exception)
{
+ cout<<"GEOM_Gen_i::AddContact"<<endl;
Kinematic_Contact* tds;
TDF_Label mainRefLab;
TDF_Tool::Label(myCurrentOCAFDoc->GetData(), Ass->ShapeId(), mainRefLab);
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) */
const short NbSeq)
throw (SALOME::SALOME_Exception)
{
+ cout<<"GEOM_Gen_i::AddAnimation"<<endl;
Kinematic_Animation* tds;
TDF_Label mainRefLab;
TDF_Tool::Label(myCurrentOCAFDoc->GetData(), Ass->ShapeId(), mainRefLab);
TCollection_AsciiString entry;
TDF_Tool::Entry(Lab, entry);
- const char *ent = entry.ToCString();
+ Animation->ShapeId(entry.ToCString());
- Animation->ShapeId(ent);
return Animation;
}
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);
//=================================================================================
-// 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 {
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 {
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.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::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"<<endl;
+ try {
+ TDF_Label mainRefLab;
+ TDF_Tool::Label(myCurrentOCAFDoc->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;
+ }
- GC.SetTranslation(mainRefLab, aValX, aValY, aValZ);
+ 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::SetTranslation", SALOME::BAD_PARAM);
+ THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::SetDisplacement", SALOME::BAD_PARAM);
return;
}
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)
//---------------------------------------------------------------------//
// 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) ;
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)
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 SetLinearRange(GEOM::GEOM_Contact_ptr Contact)
throw (SALOME::SALOME_Exception) ;
- void SetTranslation(GEOM::GEOM_Contact_ptr Contact)
+ void SetDisplacement(GEOM::GEOM_Animation_ptr Animation,
+ GEOM::GEOM_Contact_ptr Contact)
throw (SALOME::SALOME_Exception) ;
};
+++ /dev/null
-// 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;
-}
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#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
+++ /dev/null
-// 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;
-}
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#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
// Module : GEOM
// $Header$
-using namespace std;
+#include <fstream.h>
+#include <strstream>
+
#include <BRepTools_ShapeSet.hxx>
+#include <BRepTools.hxx>
+
#include "GEOM_Shape_i.hh"
#include "SALOME_NamingService.hxx"
-#include <fstream.h>
-#include <BRepTools.hxx>
+using namespace std;
//=================================================================================
// : 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
// 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);
}
// 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)
// 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) ; }
// 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) ; }
//=================================================================================
// 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) ; }
// 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
+++ /dev/null
-// 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.cc
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header$
-
-using namespace std;
-#include "GEOM_Translation_i.hh"
-
-//=================================================================================
-// function : GEOM_Translation_i() constructor (no arguments)
-// purpose : for what now ?
-//=================================================================================
-GEOM_Translation_i::GEOM_Translation_i()
-{
-}
-
-
-//=================================================================================
-// function : constructor
-// purpose : constructor for servant creation
-//=================================================================================
-GEOM_Translation_i::GEOM_Translation_i(CORBA::Double ValX, CORBA::Double ValY, CORBA::Double ValZ)
-{
-
- SetTranslation(ValX, ValY, ValZ);
- return;
-
-}
-
-
-//=================================================================================
-// function : destructor
-// purpose :
-//=================================================================================
-GEOM_Translation_i::~GEOM_Translation_i() {}
-
-
-//=================================================================================
-// function : SetTranslation()
-// purpose :
-//=================================================================================
-void GEOM_Translation_i::SetTranslation(CORBA::Double ValX, CORBA::Double ValY, CORBA::Double ValZ)
- throw(SALOME::SALOME_Exception)
-{
-
- _ValX = ValX;
- _ValY = ValY;
- _ValZ = ValZ;
- return;
-
-}
-
-//=================================================================================
-// function : GetValX()
-// purpose :
-//=================================================================================
-CORBA::Double GEOM_Translation_i::GetValX() throw(SALOME::SALOME_Exception)
-{
- return _ValX;
-}
-
-//=================================================================================
-// function : GetValY()
-// purpose :
-//=================================================================================
-CORBA::Double GEOM_Translation_i::GetValY() throw(SALOME::SALOME_Exception)
-{
- return _ValY;
-}
-
-//=================================================================================
-// function : GetValZ()
-// purpose :
-//=================================================================================
-CORBA::Double GEOM_Translation_i::GetValZ() throw(SALOME::SALOME_Exception)
-{
- return _ValZ;
-}
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#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
# 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
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 =
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);
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);
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;
{
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:
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;
}
}
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++;
}
}
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++;
}
}
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 : */
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
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 */
#include <qlayout.h>
#include <qradiobutton.h>
#include <qbuttongroup.h>
+#include <qpushbutton.h>
class GEOMBase_Skeleton : public DlgRef_Skeleton_QTD
{
/* GetCurrentStudy */
int studyId = desktop->getActiveStudy()->getStudyId();
GeomGUI->myComponentGeom->GetCurrentStudy(studyId);
+
GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels();
}
int studyId = desktop->getActiveStudy()->getStudyId();
GeomGUI->myComponentGeom->GetCurrentStudy(studyId);
- //GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels();
+ GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels();
return GeomGUI;
}
#include "QAD_Desktop.h"
#include "GEOM_Client.hxx"
-#include "GEOM_Sketcher.h"
#include <OSD_SharedLibrary.hxx>
#include <qapplication.h>
QDialog* myActiveDialogBox; /* Unique active dialog box */
GEOM_Client myShapeReader;
Standard_CString myFatherior;
- Sketch mySketcher;
public :
int myNbGeom; /* Unique name for a geom entity */
int& GetNbGeom(){return myNbGeom;};
GEOM_Client& GetShapeReader(){return myShapeReader;};
Standard_CString& GetFatherior(){return myFatherior;};
- Sketch& GetSketcher(){return mySketcher;};
bool LoadLibrary(QString GUILibrary);
msgid "ICON_ANIM_PLAY"
msgstr "anim_play.png"
-#:
-msgid "ICON_ANIM_STOP"
-msgstr "anim_stop.png"
-
#:
msgid "ICON_ANIM_NEXT"
msgstr "anim_next.png"
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"
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"
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"
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"
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@
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());
-
- 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 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());
+ 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 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 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;
}
const TDF_Label& AssLab,
const TCollection_ExtendedString& Name)
{
+ cout<<"GEOMDS_Commands::AddAnimation"<<endl;
TDF_Label LabAnimation = myLab.NewChild();
TDataStd_Name::Set(LabAnimation, Name);
int ret;
TDF_Label LabFrame = LabAnimation.NewChild();
TNaming_Builder B1(LabFrame);
- B1.Select(KAnimation.Frame(), KAnimation.Frame());
- TDF_Label RefLab = TNaming_Tool::Label(myLab, KAnimation.Frame(), ret);
+ B1.Select(KAnimation.GetFrame(), KAnimation.GetFrame());
+ TDF_Label RefLab = TNaming_Tool::Label(myLab, KAnimation.GetFrame(), ret);
TDF_Reference::Set(LabFrame, RefLab);
TDF_Label LabDuration = LabAnimation.NewChild();
- Standard_Real duration = double(KAnimation.Duration());
+ Standard_Real duration = double(KAnimation.GetDuration());
TDataStd_Real::Set(LabDuration, duration);
TDF_Label LabNbSeq = LabAnimation.NewChild();
- TDataStd_Integer::Set(LabNbSeq, KAnimation.NbSeq());
+ TDataStd_Integer::Set(LabNbSeq, KAnimation.GetNbSeq());
+
+ Kinematic_Assembly* returnAss = new Kinematic_Assembly();
+ if(GetAssembly(AssLab, *returnAss)) {
+ list <Kinematic_Contact *> aContactList = returnAss->GetContactList();
+ list <Kinematic_Contact *>::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 <double> aList = KAnimation.GetDisplacement(i);
+ list <double>::const_iterator it1 = aList.begin();
+ int k = 1;
+ while(it1 != aList.end()) {
+ RealArrayT->SetValue(k, *it1);
+ k++;
+ it1++;
+ }
+ i++;
+ it++;
+ }
+ }
return LabAnimation;
}
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;
}
}
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++;
}
Standard_Boolean GEOMDS_Commands::GetAnimation(const TDF_Label& aLabel,
Kinematic_Animation& returnAnim)
{
+ cout<<"GEOMDS_Commands::GetAnimation"<<endl;
Kinematic_Animation* Anim = new Kinematic_Animation();
TDF_ChildIterator it;
int i = 1;
+ int k = 0;
for(it.Initialize(aLabel, Standard_False); it.More(); it.Next()) {
TDF_Label L = it.Value();
Handle(TNaming_NamedShape) anAttTopo;
Handle(TDataStd_Real) anAttReal;
Handle(TDataStd_Integer) anAttInteger;
Handle(TDataStd_Integer) anAttInteger1;
+ Handle(TDataStd_RealArray) anAttRealArrayP;
if(i == 1 && L.FindAttribute(TDataStd_Integer::GetID(), anAttInteger)) {
if(anAttInteger->Get() != 3) {
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 <double> aList;
+ for(int j = 1; j <= 12; j++)
+ aList.push_back(anAttRealArrayP->Value(j));
+ Anim->SetDisplacement(k, aList);
+ k++;
}
i++;
}
//=======================================================================
-// 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++;
//=======================================================================
-// 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;
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"<<endl;
+ int i = 1;
+ TDF_ChildIterator it;
+ Handle(TDataStd_RealArray) anAttRealArrayT;
+
+ for(it.Initialize(aLabel, Standard_False); it.More(); it.Next()) {
+ TDF_Label L = it.Value();
+
+ if(i == (aContact + 6) && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayT)) {
+ anAttRealArrayT->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;
+}
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:
#endif
#ifndef _GEOMDS_Commands_HeaderFile
#include "GEOMDS_Commands.hxx"
-#endif
\ No newline at end of file
+#endif
// function : GeometryGUI()
// purpose : Constructor
//=======================================================================
-GeometryGUI::GeometryGUI() :
- QObject()
-{
-}
+GeometryGUI::GeometryGUI( const QString& theName, QObject* theParent ) :
+ SALOMEGUI( theName, theParent )
+{}
//=======================================================================
return false;
Mb->setItemEnabled(404, ViewOCC);//SKETCHER
- Mb->setItemEnabled(406, ViewOCC);//SKETCHER
Mb->setItemEnabled(603, ViewOCC);//SuppressFace
Mb->setItemEnabled(604, ViewOCC);//SuppressHole
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;
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;
}
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;
}
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
theObject = "";
theContext = "";
-
if((theParent.compare("Viewer") == 0)) {
- if(GeomGUI->myState == 2)
- theContext = "Sketch";
- else if(Sel->IObjectCount() == 0)
+ if(Sel->IObjectCount() == 0)
theContext = "NothingSelected";
}
{
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;
// 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
// PAL5356: update VTK selection
::UpdateVtkSelection(parent);
- return;
+ return true;
}
}
-//=================================================================================
-// EXPORTED METHODS
-//=================================================================================
-extern "C"
+void GeometryGUI::SupportedViewType(int* buffer, int bufferSize)
{
- 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);}
+ if(!buffer || !bufferSize) return;
+ buffer[0] = (int)VIEW_OCC;
+ if (--bufferSize) buffer[1] = (int)VIEW_VTK;
+}
- void 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();
+}
- void deactivate()
- {
- if ( GeomGUI )
- GeomGUI->EmitSignalCloseAllDialogs();
+static GeometryGUI aGUI("");
+extern "C"
+{
+ Standard_EXPORT SALOMEGUI* GetComponentGUI() {
+ return &aGUI;
}
}
#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
case TopAbs_SHAPE:
{ return "Shape" ;}
}
+ return 0;
}
// Module : GEOM
// $Header:
-using namespace std;
#include "GEOMToolsGUI.h"
#include "QAD_Config.h"
#include "QAD_Tools.h"
#include "QAD_MessageBox.h"
#include "QAD_RightFrame.h"
+#include "QAD_PyEditor.h"
#include "OCCViewer_Viewer3d.h"
#include "VTKViewer_ViewFrame.h"
#include "GEOMToolsGUI_NbIsosDlg.h" // Method ISOS adjustement
#include "GEOMToolsGUI_TransparencyDlg.h" // Method TRANSPARENCY adjustement
+#include "utilities.h"
+
+using namespace std;
+
//=======================================================================
// function : GEOMToolsGUI()
// purpose : Constructor
{
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();
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"));
}
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);
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);
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);
}
QApplication::restoreOverrideCursor() ;
+ return true;
}
--- /dev/null
+# 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")
--- /dev/null
+# GEOM GEOM_SWIG : binding of C++ omplementaion with Python\r
+#\r
+# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS \r
+# \r
+# This library is free software; you can redistribute it and/or \r
+# modify it under the terms of the GNU Lesser General Public \r
+# License as published by the Free Software Foundation; either \r
+# version 2.1 of the License. \r
+# \r
+# This library is distributed in the hope that it will be useful, \r
+# but WITHOUT ANY WARRANTY; without even the implied warranty of \r
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \r
+# Lesser General Public License for more details. \r
+# \r
+# You should have received a copy of the GNU Lesser General Public \r
+# License along with this library; if not, write to the Free Software \r
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA \r
+# \r
+# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org \r
+#\r
+#\r
+#\r
+# File : GEOM_Sketcher.py\r
+# Author : Damien COQUERET, Open CASCADE\r
+# Module : GEOM\r
+# $Header$\r
+\r
+import geompy\r
+\r
+#SKETCHER INFOS\r
+#Init Sketcher\r
+#Create a string beginning by :"Sketcher:"\r
+#Each command must be separated by ":"\r
+#"F x y" : Create first point at X & Y\r
+\r
+#To Make Segment\r
+#"R angle" : Set the direction by angle\r
+#"D dx dy" : Set the direction by DX & DY\r
+\r
+#"TT x y" : Create by point at X & Y\r
+#"T dx dy" : Create by point with DX & DY\r
+#"L length" : Create by direction & Length\r
+#"IX x" : Create by direction & Intersect. X\r
+#"IY y" : Create by direction & Intersect. Y\r
+\r
+#To Make Arc\r
+#"C radius length" : Create by direction, radius and length(in degree)\r
+\r
+#To finish\r
+#"WW" : Close Wire\r
+\r
+#Create Sketcher\r
+Cmd = "Sketch:F 0 0:TT 0 100:C 100 180:WW"\r
+Sketcher = geompy.MakeSketcher(Cmd) #(string)->GEOM_Shape_ptr\r
+\r
+#Add In Study\r
+id_Sketcher = geompy.addToStudy(Sketcher, "Sketcher")\r
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 \
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
# -----------------------------------------------------------------------------
def SetPosition(aContact):
geom.SetPosition(aContact)
-def SetRotation(aContact):
- geom.SetRotation(aContact)
+def SetAngularRange(aContact):
+ geom.SetAngularRange(aContact)
+
+def SetLinearRange(aContact):
+ geom.SetLinearRange(aContact)
-def SetTranslation(aContact):
- geom.SetTranslation(aContact)
+def SetDisplacement(anAnim,aContact):
+ geom.SetDisplacement(anAnim,aContact)
def addAssemblyToStudy(anAss, aName):
myBuilder.NewCommand()
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
# -----------------------------------------------------------------------------
def SetPosition(aContact):
geom.SetPosition(aContact)
-def SetRotation(aContact):
- geom.SetRotation(aContact)
+def SetAngularRange(aContact):
+ geom.SetAngularRange(aContact)
+
+def SetLinearRange(aContact):
+ geom.SetLinearRange(aContact)
-def SetTranslation(aContact):
- geom.SetTranslation(aContact)
+def SetDisplacement(anAnim,aContact):
+ geom.SetDisplacement(anAnim,aContact)
def addAssemblyToStudy(anAss, aName):
myBuilder.NewCommand()
// Module : GEOM
// $Header$
-using namespace std;
#include "GenerationGUI_FillingDlg.h"
+#include "QAD_WaitCursor.h"
#include "QAD_Config.h"
#include <GeomFill_SectionGenerator.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <TopExp_Explorer.hxx>
+#include <TopoDS_Iterator.hxx>
#include <BRep_Tool.hxx>
#include <Precision.hxx>
+#include <Standard_ErrorHandler.hxx>
+
+#include "utilities.h"
+
+using namespace std;
//=================================================================================
// class : GenerationGUI_FillingDlg()
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;
}
//=================================================================================
void GenerationGUI_FillingDlg::MakeFillingSimulationAndDisplay()
{
+ QAD_WaitCursor wc;
+
myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify();
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++ ;
// Module : GEOM
// $Header$
-using namespace std;
#include "GenerationGUI_PipeDlg.h"
#include <TopoDS_Edge.hxx>
#include <BRepAlgoAPI.hxx>
#endif
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : GenerationGUI_PipeDlg()
// purpose : Constructs a GenerationGUI_PipeDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "GenerationGUI_PrismDlg.h"
#include <BRepPrimAPI_MakePrism.hxx>
#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
// Module : GEOM
// $Header$
-using namespace std;
#include "GenerationGUI_RevolDlg.h"
#include <gp_Lin.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepPrimAPI_MakeRevol.hxx>
#include "QAD_Config.h"
+#include <TopExp_Explorer.hxx>
+#include <Standard_ErrorHandler.hxx>
+
+#include "utilities.h"
+
+using namespace std;
//=================================================================================
// class : GenerationGUI_RevolDlg()
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()
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;
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 {
// Module : GEOM
// $Header:
-using namespace std;
#include "Kinematic_Animation.hxx"
#include <Geom_Transformation.hxx>
#include <AIS_Shape.hxx>
#include <unistd.h>
+using namespace std;
+
//=======================================================================
// profile
// command to build a profile
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;
}
//=================================================================================
// function : SetMap()
-// purpose :
+// purpose : Create Kinematic Graph
//=================================================================================
void Kinematic_Animation::SetMap()
{
- list <Kinematic_Contact *> ContactList = myAss->GetContactList();
+ list <Kinematic_Contact *> aContactList = myAss->GetContactList();
Kinematic_Contact* aContact;
- list <Kinematic_Contact *>::const_iterator it = ContactList.begin();
- while(it != ContactList.end()) {
+ list <Kinematic_Contact *>::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 <Kinematic_Contact *> ContactListOfShape;
- TopoDS_Shape myShape = myIndexToShape.FindKey(i);
- while(it != ContactList.end()) {
+ it = aContactList.begin();
+ list <Kinematic_Contact *> 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 <Kinematic_Contact *> aContactList = myAss->GetContactList();
+ list <Kinematic_Contact *>::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"<<endl;
+ list <double> aContactListOfValue;
+
+ cout<<"Kinematic_Animation::InitValuesOnContact : Val = "<<aContact->GetAngularRange().GetMaxValX()<<endl;
+ aContactListOfValue.push_back(aContact->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 <double> Kinematic_Animation::GetDisplacement(int aContact)
+{
+ cout<<"Kinematic_Animation::GetDisplacement"<<endl;
+ Kinematic_Contact * aKContact;
+ list <Kinematic_Contact *> aContactList = myAss->GetContactList();
+
+ list <Kinematic_Contact *>::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"<<endl;
+ InitValuesOnContact(aKContact);
}
+
+ list <double> aContactListOfValue = myStlMapofContactListOfValue[aKContact];
+ return aContactListOfValue;
+}
+
+//=================================================================================
+// function : SetDisplacement()
+// purpose :
+//=================================================================================
+void Kinematic_Animation::SetDisplacement(int aContact, list <double> aList)
+{
+ cout<<"Kinematic_Animation::SetDisplacement"<<endl;
+ Kinematic_Contact * aKContact;
+ list <Kinematic_Contact *> aContactList = myAss->GetContactList();
+
+ list <Kinematic_Contact *>::const_iterator it = aContactList.begin();
+ int i = 0;
+ while(it != aContactList.end()) {
+ if(i == aContact)
+ aKContact = *it;
+ i++;
+ it++;
+ }
+
+ myStlMapofContactListOfValue[aKContact] = aList;
return;
}
gp_Trsf& aLoc, TopoDS_Shape Shape1, double Step)
{
int j = 0;
- list <Kinematic_Contact *> ContactListOfShape;
+ list <Kinematic_Contact *> 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 <Kinematic_Contact *>::const_iterator it = ContactListOfShape.begin();
- while(it != ContactListOfShape.end()) {
+ aContactListOfShape = myStlMapofShapeListOfContact[i];
+ list <Kinematic_Contact *>::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++;
//=================================================================================
-// 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);
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 <double> aValuesList = myStlMapofContactListOfValue[aContact];
+ list <double>::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;
+}
#include <TopTools_IndexedMapOfShape.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_SequenceOfInteractive.hxx>
+#include <gp_Trsf.hxx>
#include <list>
#include <map>
private:
map <int, list <Kinematic_Contact *> > myStlMapofShapeListOfContact;
+ map <Kinematic_Contact *, list <double> > myStlMapofContactListOfValue;
Kinematic_Assembly* myAss;
TopoDS_Shape myFrame;
double myDuration;
int myNbSeq;
public:
- AIS_SequenceOfInteractive ListOfAIS;
+ AIS_SequenceOfInteractive myListOfAIS;
TopTools_IndexedMapOfShape myIndexToShape;
TopTools_IndexedMapOfShape myMovedShape;
bool IsCreated;
bool myIsShading;
void SetMap();
+ void InitValues();
+ void InitValuesOnContact(Kinematic_Contact* aContact);
void GetNextShape(const Handle (AIS_InteractiveContext)& ic,
gp_Trsf& aLoc, TopoDS_Shape Shape1, double Step);
void MoveShape(const Handle(AIS_InteractiveContext)& ic,
gp_Trsf& aLoc, Kinematic_Contact* aContact,
double Step);
- void Assembly(Kinematic_Assembly* Assembly){myAss = Assembly;};
- void Frame(TopoDS_Shape Frame){myFrame = Frame;};
- void Duration(double Duration){myDuration = Duration;};
- void NbSeq(int NbSeq){myNbSeq = NbSeq;};
+ void SetAssembly(Kinematic_Assembly* Assembly){myAss = Assembly;};
+ void SetFrame(TopoDS_Shape Frame){myFrame = Frame;};
+ void SetDuration(double Duration){myDuration = Duration;};
+ void SetNbSeq(int NbSeq){myNbSeq = NbSeq;};
+ void SetDisplacement(int aContact, list <double> aList);
- Kinematic_Assembly* Assembly(){return myAss;};
- TopoDS_Shape& Frame(){return myFrame;};
- double& Duration(){return myDuration;};
- int& NbSeq(){return myNbSeq;};
+ Kinematic_Assembly* GetAssembly(){return myAss;};
+ TopoDS_Shape& GetFrame(){return myFrame;};
+ double& GetDuration(){return myDuration;};
+ int& GetNbSeq(){return myNbSeq;};
+ list <double> GetDisplacement(int aContact);
+ gp_Trsf GetTransformation(Kinematic_Contact* aContact, double Step = 1);
};
// Module : GEOM
// $Header:
-using namespace std;
#include "Kinematic_Assembly.hxx"
+using namespace std;
//=======================================================================
// profile
// command to build a profile
//=======================================================================
-Kinematic_Assembly::Kinematic_Assembly()
-{
-
-}
+Kinematic_Assembly::Kinematic_Assembly() {}
//=================================================================================
// function : ~Kinematic_Assembly()
// purpose : Destroys the object and frees any allocated resources
//=================================================================================
-Kinematic_Assembly::~Kinematic_Assembly()
-{
-}
+Kinematic_Assembly::~Kinematic_Assembly() {}
//=================================================================================
// Module : GEOM
// $Header:
-using namespace std;
#include "Kinematic_Contact.hxx"
+using namespace std;
+
//=======================================================================
// profile
// command to build a profile
//=======================================================================
-Kinematic_Contact::Kinematic_Contact(){}
+Kinematic_Contact::Kinematic_Contact() {}
//=======================================================================
Kinematic_Contact::Kinematic_Contact(TopoDS_Shape Shape1, TopoDS_Shape Shape2,
int type, double step)
{
- myType = type;
- myShape1 = Shape1;
- myShape2 = Shape2;
- myStep = step;
+ SetType(type);
+ SetStep(step);
+ SetShape1(Shape1);
+ SetShape2(Shape2);
gp_Pnt Origin(0, 0, 0);
- gp_Dir DirX(1, 0, 0);
- gp_Dir DirY(0, 1, 0);
- gp_Dir DirZ(0, 0, 1);
+ gp_Vec DirX(1, 0, 0);
+ gp_Vec DirY(0, 1, 0);
+ gp_Vec DirZ(0, 0, 1);
Kinematic_Position Pos(Origin, DirX, DirY, DirZ);
- Kinematic_Rotation Rot(1, 2, 3, 0, 0, 0);
- Kinematic_Translation Trans(0, 0, 0);
+ Kinematic_Range AngularRange(0, 0, 0, 0, 0, 0);
+ Kinematic_Range LinearRange(0, 0, 0, 0, 0, 0);
- myPosition = Pos;
- myRotation = Rot;
- myTranslation = Trans;
+ SetPosition(Pos);
+ SetAngularRange(AngularRange);
+ SetLinearRange(LinearRange);
+
+ return;
}
//=================================================================================
-// function : GetTransformation()
+// function : GetLocation()
// purpose :
//=================================================================================
-gp_Trsf Kinematic_Contact::GetTransformation(double Step)
+TopLoc_Location Kinematic_Contact::GetLocation()
{
- gp_Vec aVect;
- gp_Trsf aTransformation, aRot, aRot1, aRot2, aRot3;
-
- aVect.SetCoord(Step * myTranslation.ValX(), Step * myTranslation.ValY(), Step * myTranslation.ValZ());
- aTransformation.SetTranslation(aVect);
-
- if(myRotation.Rot1() == 1) { //Axe X
- aRot1.SetRotation(myPosition.AxeX(), Step * myRotation.ValX() * PI / 180);
- if(myRotation.Rot2() == 2) {
- aRot2.SetRotation(myPosition.AxeY(), Step * myRotation.ValY() * PI / 180);
- aRot3.SetRotation(myPosition.AxeZ(), Step * myRotation.ValZ() * PI / 180);
- } else {
- aRot2.SetRotation(myPosition.AxeZ(), Step * myRotation.ValZ() * PI / 180);
- aRot3.SetRotation(myPosition.AxeY(), Step * myRotation.ValY() * PI / 180);
- }
- } else if(myRotation.Rot1() == 2) { //Axe Y
- aRot1.SetRotation(myPosition.AxeY(), Step * myRotation.ValY() * PI / 180);
- if(myRotation.Rot2() == 1) {
- aRot2.SetRotation(myPosition.AxeX(), Step * myRotation.ValX() * PI / 180);
- aRot3.SetRotation(myPosition.AxeZ(), Step * myRotation.ValZ() * PI / 180);
- } else {
- aRot2.SetRotation(myPosition.AxeZ(), Step * myRotation.ValZ() * PI / 180);
- aRot3.SetRotation(myPosition.AxeX(), Step * myRotation.ValX() * PI / 180);
- }
- } else if(myRotation.Rot1() == 3) { //Axe Z
- aRot1.SetRotation(myPosition.AxeZ(), Step * myRotation.ValZ() * PI / 180);
- if(myRotation.Rot2() == 1) {
- aRot2.SetRotation(myPosition.AxeX(), Step * myRotation.ValX() * PI / 180);
- aRot3.SetRotation(myPosition.AxeY(), Step * myRotation.ValY() * PI / 180);
- } else {
- aRot2.SetRotation(myPosition.AxeY(), Step * myRotation.ValY() * PI / 180);
- aRot3.SetRotation(myPosition.AxeX(), Step * myRotation.ValX() * PI / 180);
- }
- }
+ gp_Trsf aTrans;
- aRot = aRot1 * aRot2 * aRot3;
- aTransformation = aTransformation * aRot;
+ aTrans.SetTransformation(myPosition.GetAxe3());
+ TopLoc_Location aLoc(aTrans);
- return aTransformation;
+ return aLoc;
}
//=================================================================================
-// function : GetLocation()
+// function : GetTransformation()
// purpose :
//=================================================================================
-TopLoc_Location Kinematic_Contact::GetLocation()
+gp_Trsf Kinematic_Contact::GetTransformation(double Step)
{
- gp_Trsf aTrans;
+ gp_Vec aVect;
+ gp_Trsf aTransformation, aRot, aRot1, aRot2, aRot3;
- aTrans.SetTransformation(myPosition.Axe3());
- TopLoc_Location aLoc(aTrans);
+ double aMinVal = myAngularRange.GetMinValX();
+ double aMaxVal = myAngularRange.GetMaxValX();
+ aRot1.SetRotation(myPosition.GetAxeX(), (Step * (aMaxVal - aMinVal) + aMinVal) * PI / 180);
- return aLoc;
+ aMinVal = myAngularRange.GetMinValY();
+ aMaxVal = myAngularRange.GetMaxValY();
+ aRot2.SetRotation(myPosition.GetAxeY(), (Step * (aMaxVal - aMinVal) + aMinVal) * PI / 180);
+
+ aMinVal = myAngularRange.GetMinValZ();
+ aMaxVal = myAngularRange.GetMaxValZ();
+ aRot3.SetRotation(myPosition.GetAxeZ(), (Step * (aMaxVal - aMinVal) + aMinVal) * PI / 180);
+
+ aVect.SetCoord(Step * (myLinearRange.GetMaxValX() - myLinearRange.GetMinValX()) + myLinearRange.GetMinValX(),
+ Step * (myLinearRange.GetMaxValY() - myLinearRange.GetMinValY()) + myLinearRange.GetMinValY(),
+ Step * (myLinearRange.GetMaxValZ() - myLinearRange.GetMinValZ()) + myLinearRange.GetMinValZ());
+
+ aTransformation.SetTranslation(aVect);
+ aRot = aRot1 * aRot2 * aRot3;
+ aTransformation = aTransformation * aRot;
+
+ return aTransformation;
}
#include <TopoDS_Shape.hxx>
#include <TDF_Label.hxx>
-#include <gp_Trsf.hxx>
#include <TopLoc_Location.hxx>
+#include <gp_Trsf.hxx>
#include "Kinematic_Position.hxx"
-#include "Kinematic_Rotation.hxx"
-#include "Kinematic_Translation.hxx"
+#include "Kinematic_Range.hxx"
class Kinematic_Contact
{
~Kinematic_Contact();
private:
- int myType;
TopoDS_Shape myShape1;
TopoDS_Shape myShape2;
+ int myType;
double myStep;
Kinematic_Position myPosition;
- Kinematic_Rotation myRotation;
- Kinematic_Translation myTranslation;
+ Kinematic_Range myAngularRange;
+ Kinematic_Range myLinearRange;
public:
- gp_Trsf GetTransformation(double Step = 1);
TopLoc_Location GetLocation();
+ gp_Trsf GetTransformation(double Step);
- void Type(int Type){myType = Type;};
- void Shape1(TopoDS_Shape Shape1){myShape1 = Shape1;};
- void Shape2(TopoDS_Shape Shape2){myShape2 = Shape2;};
- void Step(double Step){myStep = Step;};
- void Position(Kinematic_Position& Position){myPosition = Position;};
- void Rotation(Kinematic_Rotation& Rotation){myRotation = Rotation;};
- void Translation(Kinematic_Translation& Translation){myTranslation = Translation;};
+ void SetType(int aValue){myType = aValue;};
+ void SetShape1(TopoDS_Shape aShape){myShape1 = aShape;};
+ void SetShape2(TopoDS_Shape aShape){myShape2 = aShape;};
+ void SetStep(double aValue){myStep = aValue;};
+ void SetPosition(Kinematic_Position& aPosition){myPosition = aPosition;};
+ void SetAngularRange(Kinematic_Range& anAngularRange){myAngularRange = anAngularRange;};
+ void SetLinearRange(Kinematic_Range& aLinearRange){myLinearRange = aLinearRange;};
- int& Type(){return myType;};
- TopoDS_Shape& Shape1(){return myShape1;};
- TopoDS_Shape& Shape2(){return myShape2;};
- double& Step(){return myStep;};
- Kinematic_Position& Position(){return myPosition;};
- Kinematic_Rotation& Rotation(){return myRotation;};
- Kinematic_Translation& Translation(){return myTranslation;};
+ int& GetType(){return myType;};
+ TopoDS_Shape& GetShape1(){return myShape1;};
+ TopoDS_Shape& GetShape2(){return myShape2;};
+ double& GetStep(){return myStep;};
+ Kinematic_Position& GetPosition(){return myPosition;};
+ Kinematic_Range& GetAngularRange(){return myAngularRange;};
+ Kinematic_Range& GetLinearRange(){return myLinearRange;};
};
// Module : GEOM
// $Header:
-using namespace std;
#include "Kinematic_Position.hxx"
+using namespace std;
//=======================================================================
// profile
// command to build a profile
//=======================================================================
-Kinematic_Position::Kinematic_Position(){}
+Kinematic_Position::Kinematic_Position() {}
//=======================================================================
// profile
// command to build a profile
//=======================================================================
-Kinematic_Position::Kinematic_Position(gp_Pnt Origin, gp_Dir DirX, gp_Dir DirY, gp_Dir DirZ)
+Kinematic_Position::Kinematic_Position(gp_Pnt Origin, gp_Vec DirX, gp_Vec DirY, gp_Vec DirZ)
{
- myOrigin = Origin;
- myDirX = DirX;
- myDirY = DirY;
- myDirZ = DirZ;
+ SetOrigin(Origin);
+ SetDirX(DirX);
+ SetDirY(DirY);
+ SetDirZ(DirZ);
+
+ return;
}
//=================================================================================
-// function : AxeX()
+// function : SetOrigin()
+// purpose :
+//=================================================================================
+void Kinematic_Position::SetOrigin(const gp_Pnt& aPnt)
+{
+ myOrigin = aPnt;
+ return;
+}
+
+
+//=================================================================================
+// function : SetDirX()
+// purpose :
+//=================================================================================
+void Kinematic_Position::SetDirX(const gp_Vec& aDir)
+{
+ myDirX = aDir;
+ return;
+}
+
+
+//=================================================================================
+// function : SetDirY()
+// purpose :
+//=================================================================================
+void Kinematic_Position::SetDirY(const gp_Vec& aDir)
+{
+ myDirY = aDir;
+ return;
+}
+
+
+//=================================================================================
+// function : SetDirZ()
+// purpose :
+//=================================================================================
+void Kinematic_Position::SetDirZ(const gp_Vec& aDir)
+{
+ myDirZ = aDir;
+ return;
+}
+
+
+//=================================================================================
+// function : GetAxeX()
// purpose :
//=================================================================================
-gp_Ax1 Kinematic_Position::AxeX()
+gp_Ax1 Kinematic_Position::GetAxeX()
{
gp_Ax1 anAxe;
anAxe.SetLocation(myOrigin);
//=================================================================================
-// function : AxeY()
+// function : GetAxeY()
// purpose :
//=================================================================================
-gp_Ax1 Kinematic_Position::AxeY()
+gp_Ax1 Kinematic_Position::GetAxeY()
{
gp_Ax1 anAxe;
anAxe.SetLocation(myOrigin);
//=================================================================================
-// function : AxeZ()
+// function : GetAxeZ()
// purpose :
//=================================================================================
-gp_Ax1 Kinematic_Position::AxeZ()
+gp_Ax1 Kinematic_Position::GetAxeZ()
{
gp_Ax1 anAxe;
anAxe.SetLocation(myOrigin);
//=================================================================================
-// function : Axe3()
+// function : GetAxe3()
// purpose :
//=================================================================================
-gp_Ax3 Kinematic_Position::Axe3()
+gp_Ax3 Kinematic_Position::GetAxe3()
{
gp_Ax3 anAxe3(myOrigin, myDirZ, myDirX);
return anAxe3;
#define _KINEMATIC_POSITION_HXX
#include <TopoDS_Shape.hxx>
-#include <gp_Dir.hxx>
+#include <gp_Vec.hxx>
#include <gp_Pnt.hxx>
#include <gp_Ax1.hxx>
#include <gp_Ax3.hxx>
{
public:
Kinematic_Position();
- Kinematic_Position(gp_Pnt Origin, gp_Dir DirX, gp_Dir DirY, gp_Dir DirZ);
+ Kinematic_Position(gp_Pnt Origin, gp_Vec DirX, gp_Vec DirY, gp_Vec DirZ);
~Kinematic_Position();
private:
gp_Pnt myOrigin;
- gp_Dir myDirX;
- gp_Dir myDirY;
- gp_Dir myDirZ;
+ gp_Vec myDirX;
+ gp_Vec myDirY;
+ gp_Vec myDirZ;
public:
- void Origin(const gp_Pnt& Origin){myOrigin = Origin;};
- void DirX(const gp_Dir& DirX){myDirX = DirX;};
- void DirY(const gp_Dir& DirY){myDirY = DirY;};
- void DirZ(const gp_Dir& DirZ){myDirZ = DirZ;};
+ void SetOrigin(const gp_Pnt& aPnt);
+ void SetDirX(const gp_Vec& aDir);
+ void SetDirY(const gp_Vec& aDir);
+ void SetDirZ(const gp_Vec& aDir);
- gp_Pnt& Origin(){return myOrigin;};
- gp_Dir& DirX(){return myDirX;};
- gp_Dir& DirY(){return myDirY;};
- gp_Dir& DirZ(){return myDirZ;};
+ gp_Pnt& GetOrigin(){return myOrigin;};
+ gp_Vec& GetDirX(){return myDirX;};
+ gp_Vec& GetDirY(){return myDirY;};
+ gp_Vec& GetDirZ(){return myDirZ;};
- gp_Ax1 AxeX();
- gp_Ax1 AxeY();
- gp_Ax1 AxeZ();
+ gp_Ax1 GetAxeX();
+ gp_Ax1 GetAxeY();
+ gp_Ax1 GetAxeZ();
- gp_Ax3 Axe3();
+ gp_Ax3 GetAxe3();
};
--- /dev/null
+// GEOM KINEMATIC
+//
+// 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 : Kinematic_Range.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#include "Kinematic_Range.hxx"
+
+using namespace std;
+
+//=======================================================================
+// profile
+// command to build a profile
+//=======================================================================
+Kinematic_Range::Kinematic_Range() {}
+
+
+//=======================================================================
+// profile
+// command to build a profile
+//=======================================================================
+Kinematic_Range::Kinematic_Range(double MinValX, double MaxValX,
+ double MinValY, double MaxValY,
+ double MinValZ, double MaxValZ)
+{
+ SetRangeX(MinValX, MaxValX);
+ SetRangeY(MinValY, MaxValY);
+ SetRangeZ(MinValZ, MaxValZ);
+ return;
+}
+
+
+//=================================================================================
+// function : ~Kinematic_Range()
+// purpose : Destroys the object and frees any allocated resources
+//=================================================================================
+Kinematic_Range::~Kinematic_Range() {}
+
+
+//=================================================================================
+// function : SetRangeX()
+// purpose :
+//=================================================================================
+void Kinematic_Range::SetRangeX(double MinVal, double MaxVal)
+{
+ myMinValX = MinVal;
+ myMaxValX = MaxVal;
+ return;
+}
+
+
+//=================================================================================
+// function : SetRangeY()
+// purpose :
+//=================================================================================
+void Kinematic_Range::SetRangeY(double MinVal, double MaxVal)
+{
+ myMinValY = MinVal;
+ myMaxValY = MaxVal;
+ return;
+}
+
+
+//=================================================================================
+// function : SetRangeZ()
+// purpose :
+//=================================================================================
+void Kinematic_Range::SetRangeZ(double MinVal, double MaxVal)
+{
+ myMinValZ = MinVal;
+ myMaxValZ = MaxVal;
+ return;
+}
--- /dev/null
+// GEOM KINEMATIC
+//
+// 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 : Kinematic_Range.hxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef _KINEMATIC_RANGE_HXX
+#define _KINEMATIC_RANGE_HXX
+
+class Kinematic_Range
+{
+public:
+ Kinematic_Range();
+ Kinematic_Range(double MinValX, double MaxValX, double MinValY,
+ double MaxValY, double MinValZ, double MaxValZ);
+ ~Kinematic_Range();
+
+private:
+ double myMinValX, myMaxValX;
+ double myMinValY, myMaxValY;
+ double myMinValZ, myMaxValZ;
+
+public:
+
+ void SetRangeX(double MinVal, double MaxVal);
+ void SetRangeY(double MinVal, double MaxVal);
+ void SetRangeZ(double MinVal, double MaxVal);
+
+ double& GetMinValX(){return myMinValX;};
+ double& GetMaxValX(){return myMaxValX;};
+ double& GetMinValY(){return myMinValY;};
+ double& GetMaxValY(){return myMaxValY;};
+ double& GetMinValZ(){return myMinValZ;};
+ double& GetMaxValZ(){return myMaxValZ;};
+
+};
+
+#endif
+++ /dev/null
-// GEOM KINEMATIC
-//
-// 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 : Kinematic_Rotation.cxx
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header:
-
-using namespace std;
-#include "Kinematic_Rotation.hxx"
-
-
-//=======================================================================
-// profile
-// command to build a profile
-//=======================================================================
-Kinematic_Rotation::Kinematic_Rotation(){}
-
-
-//=======================================================================
-// profile
-// command to build a profile
-//=======================================================================
-Kinematic_Rotation::Kinematic_Rotation(int Rot1, int Rot2, int Rot3, double ValX, double ValY, double ValZ)
-{
- myRot1 = Rot1;
- myRot2 = Rot2;
- myRot3 = Rot3;
-
- myValX = ValX;
- myValY = ValY;
- myValZ = ValZ;
-}
-
-
-//=================================================================================
-// function : ~Kinematic_Rotation()
-// purpose : Destroys the object and frees any allocated resources
-//=================================================================================
-Kinematic_Rotation::~Kinematic_Rotation() {}
+++ /dev/null
-// GEOM KINEMATIC
-//
-// 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 : Kinematic_Rotation.hxx
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header:
-
-#ifndef _KINEMATIC_ROTATION_HXX
-#define _KINEMATIC_ROTATION_HXX
-
-class Kinematic_Rotation
-{
-public:
- Kinematic_Rotation();
- Kinematic_Rotation(int Rot1, int Rot2, int Rot3, double ValX, double ValY, double ValZ);
- ~Kinematic_Rotation();
-
-private:
- int myRot1;
- int myRot2;
- int myRot3;
-
- double myValX;
- double myValY;
- double myValZ;
-
-public:
- void Rot1(int Rot1){myRot1 = Rot1;};
- void Rot2(int Rot2){myRot2 = Rot2;};
- void Rot3(int Rot3){myRot3 = Rot3;};
- void ValX(double ValX){myValX = ValX;};
- void ValY(double ValY){myValY = ValY;};
- void ValZ(double ValZ){myValZ = ValZ;};
-
- int& Rot1(){return myRot1;};
- int& Rot2(){return myRot2;};
- int& Rot3(){return myRot3;};
- double& ValX(){return myValX;};
- double& ValY(){return myValY;};
- double& ValZ(){return myValZ;};
-
-};
-
-#endif
+++ /dev/null
-// GEOM KINEMATIC
-//
-// 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 : Kinematic_Translation.cxx
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header:
-
-using namespace std;
-#include "Kinematic_Translation.hxx"
-
-
-//=======================================================================
-// profile
-// command to build a profile
-//=======================================================================
-Kinematic_Translation::Kinematic_Translation(){}
-
-
-//=======================================================================
-// profile
-// command to build a profile
-//=======================================================================
-Kinematic_Translation::Kinematic_Translation(double ValX, double ValY, double ValZ)
-{
- myValX = ValX;
- myValY = ValY;
- myValZ = ValZ;
-}
-
-
-//=================================================================================
-// function : ~Kinematic_Translation()
-// purpose : Destroys the object and frees any allocated resources
-//=================================================================================
-Kinematic_Translation::~Kinematic_Translation() {}
+++ /dev/null
-// GEOM KINEMATIC
-//
-// 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 : Kinematic_Translation.hxx
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header:
-
-#ifndef _KINEMATIC_TRANSLATION_HXX
-#define _KINEMATIC_TRANSLATION_HXX
-
-class Kinematic_Translation
-{
-public:
- Kinematic_Translation();
- Kinematic_Translation(double ValX, double ValY, double ValZ);
- ~Kinematic_Translation();
-
-private:
- double myValX;
- double myValY;
- double myValZ;
-
-public:
- void ValX(double ValX){myValX = ValX;};
- void ValY(double ValY){myValY = ValY;};
- void ValZ(double ValZ){myValZ = ValZ;};
-
- double& ValX(){return myValX;};
- double& ValY(){return myValY;};
- double& ValZ(){return myValZ;};
-
-};
-
-#endif
# Libraries targets
LIB = libGEOMKinematic.la
LIB_SRC = Kinematic_Position.cxx \
- Kinematic_Rotation.cxx \
- Kinematic_Translation.cxx \
+ Kinematic_Range.cxx \
Kinematic_Contact.cxx \
Kinematic_Assembly.cxx \
Kinematic_Animation.cxx
LIB_CLIENT_IDL =
# header files
-EXPORT_HEADERS = Kinematic_Position.hxx \
- Kinematic_Rotation.hxx \
- Kinematic_Translation.hxx \
- Kinematic_Contact.hxx \
- Kinematic_Assembly.hxx \
- Kinematic_Animation.hxx
+EXPORT_HEADERS = Kinematic_Position.hxx \
+ Kinematic_Range.hxx \
+ Kinematic_Contact.hxx \
+ Kinematic_Assembly.hxx \
+ Kinematic_Animation.hxx
# additionnal information to compil and link file
CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
// Module : GEOM
// $Header:
-using namespace std;
#include "KinematicGUI.h"
#include "QAD_RightFrame.h"
#include <map>
#include "KinematicGUI_ContactDlg.h" // Method CONTACT
-#include "KinematicGUI_ContactHDlg.h" // Method CONTACT HELICOIDAL
#include "KinematicGUI_PositionDlg.h" // Method POSITION
-#include "KinematicGUI_RotationDlg.h" // Method ROTATION
-#include "KinematicGUI_TranslationDlg.h" // Method TRANSLATION
-#include "KinematicGUI_AnimationDlg.h" // Method Create ANIMATION
+#include "KinematicGUI_RangeDlg.h" // Method RANGE
+#include "KinematicGUI_AnimationDlg.h" // Method ANIMATION
+#include "KinematicGUI_AnimValuesDlg.h" // Method SET VALUES
#include "KinematicGUI_AnimDlg.h" // Method Play ANIMATION
+using namespace std;
+
//=======================================================================
// function : KinematicGUI()
// purpose : Constructor
myKinematicGUI->AddNewAssembly();
break;
}
- case 61201: // EMBEDDING
- {
- KinematicGUI_ContactDlg *aDlg = new KinematicGUI_ContactDlg(parent, "", myKinematicGUI, Sel, 0);
- break;
- }
- case 61202: // PIVOT
- {
- KinematicGUI_ContactDlg *aDlg = new KinematicGUI_ContactDlg(parent, "", myKinematicGUI, Sel, 1);
- break;
- }
- case 61203: // SLIDE
- {
- KinematicGUI_ContactDlg *aDlg = new KinematicGUI_ContactDlg(parent, "", myKinematicGUI, Sel, 2);
- break;
- }
- case 61204: // SLIDING PIVOT
- {
- KinematicGUI_ContactDlg *aDlg = new KinematicGUI_ContactDlg(parent, "", myKinematicGUI, Sel, 3);
- break;
- }
- case 61205: // SPHERICAL
- {
- KinematicGUI_ContactDlg *aDlg = new KinematicGUI_ContactDlg(parent, "", myKinematicGUI, Sel, 4);
- break;
- }
- case 61206: // PLANE
- {
- KinematicGUI_ContactDlg *aDlg = new KinematicGUI_ContactDlg(parent, "", myKinematicGUI, Sel, 5);
- break;
- }
- case 61207: // ANNULAR
- {
- KinematicGUI_ContactDlg *aDlg = new KinematicGUI_ContactDlg(parent, "", myKinematicGUI, Sel, 6);
- break;
- }
- case 61208: // RECTILINEAR
- {
- KinematicGUI_ContactDlg *aDlg = new KinematicGUI_ContactDlg(parent, "", myKinematicGUI, Sel, 7);
- break;
- }
- case 61209: // PONCTUAL
+ case 6121: // CONTACT
{
- KinematicGUI_ContactDlg *aDlg = new KinematicGUI_ContactDlg(parent, "", myKinematicGUI, Sel, 8);
+ KinematicGUI_ContactDlg *aDlg = new KinematicGUI_ContactDlg(parent, "", myKinematicGUI, Sel);
break;
}
- case 61210: // HELICOIDAL
+ case 6122: // POSITION
{
- KinematicGUI_ContactHDlg *aDlg = new KinematicGUI_ContactHDlg(parent, "", myKinematicGUI, Sel);
+ KinematicGUI_PositionDlg *aDlg = new KinematicGUI_PositionDlg(parent, "", myKinematicGUI, Sel, true);
break;
}
- case 6131: // ROTATION
+ case 6123: // ANGULAR RANGE
{
- KinematicGUI_PositionDlg *aDlg = new KinematicGUI_PositionDlg(parent, "", myKinematicGUI, Sel, true);
+ KinematicGUI_RangeDlg *aDlg = new KinematicGUI_RangeDlg(parent, "", myKinematicGUI, Sel, 0);
break;
}
- case 6132: // ROTATION
+ case 6124: // LINEAR RANGE
{
- KinematicGUI_RotationDlg *aDlg = new KinematicGUI_RotationDlg(parent, "", myKinematicGUI, Sel, true);
+ KinematicGUI_RangeDlg *aDlg = new KinematicGUI_RangeDlg(parent, "", myKinematicGUI, Sel, 1);
break;
}
- case 6133: // TRANSLATION
+ case 613: // ANIMATION
{
- KinematicGUI_TranslationDlg *aDlg = new KinematicGUI_TranslationDlg(parent, "", myKinematicGUI, Sel, true);
+ KinematicGUI_AnimationDlg *aDlg = new KinematicGUI_AnimationDlg(parent, "", myKinematicGUI, Sel);
break;
}
- case 614: // ANIMATION
+ case 6131: // SET VALUES
{
- KinematicGUI_AnimationDlg *aDlg = new KinematicGUI_AnimationDlg(parent, "", myKinematicGUI, Sel);
+ KinematicGUI_AnimValuesDlg *aDlg = new KinematicGUI_AnimValuesDlg(parent, "", myKinematicGUI, Sel);
break;
}
- case 6141: // RUN ANIMATION
+ case 6132: // RUN ANIMATION
{
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
Handle(AIS_InteractiveContext) ic;
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
ic = v3d->getAISContext();
- KinematicGUI_AnimDlg *aDlg = new KinematicGUI_AnimDlg(parent, "", myKinematicGUI, Sel, ic, true);
+ KinematicGUI_AnimDlg *aDlg = new KinematicGUI_AnimDlg(parent, "", myKinematicGUI, Sel, ic);
}
break;
}
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
TCollection_AsciiString nameG("Assembly_");
- nameG += TCollection_AsciiString(myGeomGUI->GetNbGeom()++) + TCollection_AsciiString("\0");
+ nameG += TCollection_AsciiString(myGeomGUI->myNbGeom++) + TCollection_AsciiString("\0");
// open transaction
QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
TCollection_AsciiString nameG("Contact_");
- nameG += TCollection_AsciiString(myGeomGUI->GetNbGeom()++) + TCollection_AsciiString("\0");
+ nameG += TCollection_AsciiString(myGeomGUI->myNbGeom++) + TCollection_AsciiString("\0");
// open transaction
QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
TCollection_AsciiString nameG("Animation_");
- nameG += TCollection_AsciiString(myGeomGUI->GetNbGeom()++) + TCollection_AsciiString("\0");
+ nameG += TCollection_AsciiString(myGeomGUI->myNbGeom++) + TCollection_AsciiString("\0");
// open transaction
QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
GEOM::DirStruct VX, GEOM::DirStruct VY, GEOM::DirStruct VZ)
{
try {
- GEOM::GEOM_Position_var myGeomPosition = GEOM::GEOM_Position::_narrow(aContact->GetPosition());
- myGeomPosition->SetOrigin(P0);
- myGeomPosition->SetVX(VX);
- myGeomPosition->SetVY(VY);
- myGeomPosition->SetVZ(VZ);
-
+ aContact->SetPosition(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);
myGeom->SetPosition(aContact);
}
catch(const SALOME::SALOME_Exception& S_ex) {
//=======================================================================
-// function : SetRotation()
+// function : SetAngularRange()
// purpose :
//=======================================================================
-void KinematicGUI::SetRotation(GEOM::GEOM_Contact_ptr aContact,
- int Rot1, int Rot2, int Rot3,
- double Val1, double Val2, double Val3)
+void KinematicGUI::SetAngularRange(GEOM::GEOM_Contact_ptr aContact,
+ double MinValX, double MaxValX, double MinValY,
+ double MaxValY, double MinValZ, double MaxValZ)
{
try {
- GEOM::GEOM_Rotation_var myGeomRotation = GEOM::GEOM_Rotation::_narrow(aContact->GetRotation());
- myGeomRotation->SetRotation(Rot1, Rot2, Rot3, Val1, Val2, Val3);
- int type = aContact->GetType();
- if(type == 9) { //HELICOIDAL
- GEOM::GEOM_Translation_var myGeomTranslation = GEOM::GEOM_Translation::_narrow(aContact->GetTranslation());
- double aValY = myGeomTranslation->GetValY();
- double aValZ = myGeomTranslation->GetValZ();
- double aStep = aContact->GetStep();
- double aValX = aStep * Val1 / 360;
- myGeomTranslation->SetTranslation(aValX, aValY, aValZ);
- }
- myGeom->SetRotation(aContact);
+ aContact->SetAngularRange(MinValX, MaxValX, MinValY, MaxValY, MinValZ, MaxValZ);
+ myGeom->SetAngularRange(aContact);
}
catch(const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
//=======================================================================
-// function : SetTranslation()
+// function : SetLinearRange()
// purpose :
//=======================================================================
-void KinematicGUI::SetTranslation(GEOM::GEOM_Contact_ptr aContact,
- double ValX, double ValY, double ValZ)
+void KinematicGUI::SetLinearRange(GEOM::GEOM_Contact_ptr aContact,
+ double MinValX, double MaxValX, double MinValY,
+ double MaxValY, double MinValZ, double MaxValZ)
{
try {
- GEOM::GEOM_Translation_var myGeomTranslation = GEOM::GEOM_Translation::_narrow(aContact->GetTranslation());
- myGeomTranslation->SetTranslation(ValX, ValY, ValZ);
- int type = aContact->GetType();
- if(type == 9) { //HELICOIDAL
- GEOM::GEOM_Rotation_var myGeomRotation = GEOM::GEOM_Rotation::_narrow(aContact->GetRotation());
- int aRot1 = myGeomRotation->GetRot1();
- int aRot2 = myGeomRotation->GetRot2();
- int aRot3 = myGeomRotation->GetRot3();
- double aVal2 = myGeomRotation->GetVal2();
- double aVal3 = myGeomRotation->GetVal3();
- double aStep = aContact->GetStep();
- double aVal1 = 360 * ValX / aStep;
- myGeomRotation->SetRotation(aRot1, aRot2, aRot3, aVal1, aVal2, aVal3);
- }
- myGeom->SetTranslation(aContact);
+ aContact->SetLinearRange(MinValX, MaxValX, MinValY, MaxValY, MinValZ, MaxValZ);
+ myGeom->SetLinearRange(aContact);
+ }
+ catch(const SALOME::SALOME_Exception& S_ex) {
+ QtCatchCorbaException(S_ex);
+ }
+ return;
+}
+
+
+//=======================================================================
+// function : SetDisplacement()
+// purpose :
+//=======================================================================
+void KinematicGUI::SetDisplacement(GEOM::GEOM_Animation_ptr anAnimation,
+ GEOM::GEOM_Contact_ptr aContact,
+ const GEOM::ListOfDouble& aList)
+{
+ try {
+ anAnimation->SetDisplacement(aContact, aList);
+ myGeom->SetDisplacement(anAnimation, aContact);
}
catch(const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
//=====================================================================================
-// function : AddContactInStudy()
+// function : GetNameFromType()
// purpose :
//=====================================================================================
TCollection_AsciiString KinematicGUI::GetNameFromType(int type)
{
GEOM::GEOM_Shape_var myShape1 = aContact->GetShape1();
GEOM::GEOM_Shape_var myShape2 = aContact->GetShape2();
- GEOM::GEOM_Position_var myPosition = aContact->GetPosition();
- GEOM::GEOM_Rotation_var myRotation = aContact->GetRotation();
- GEOM::GEOM_Translation_var myTranslation = aContact->GetTranslation();
int Type = aContact->GetType();
double Step = aContact->GetStep();
+ GEOM::ListOfDouble_var aPosList = aContact->GetPosition();
+ GEOM::ListOfDouble_var aARList = aContact->GetAngularRange();
+ GEOM::ListOfDouble_var aLRList = aContact->GetLinearRange();
TopoDS_Shape aShape1 = myGeomGUI->GetShapeReader().GetShape(myGeom, myShape1);
TopoDS_Shape aShape2 = myGeomGUI->GetShapeReader().GetShape(myGeom, myShape2);
Kinematic_Contact* KContact = new Kinematic_Contact(aShape1, aShape2, Type, Step);
- gp_Pnt Origin(myPosition->GetOrigin().x, myPosition->GetOrigin().y, myPosition->GetOrigin().z);
- gp_Dir aDirX(myPosition->GetVX().PS.x, myPosition->GetVX().PS.y, myPosition->GetVX().PS.z);
- gp_Dir aDirY(myPosition->GetVY().PS.x, myPosition->GetVY().PS.y, myPosition->GetVY().PS.z);
- gp_Dir aDirZ(myPosition->GetVZ().PS.x, myPosition->GetVZ().PS.y, myPosition->GetVZ().PS.z);
-
- KContact->Position().Origin(Origin);
- KContact->Position().DirX(aDirX);
- KContact->Position().DirY(aDirY);
- KContact->Position().DirZ(aDirZ);
-
- KContact->Rotation().Rot1(myRotation->GetRot1());
- KContact->Rotation().Rot2(myRotation->GetRot2());
- KContact->Rotation().Rot3(myRotation->GetRot3());
+ gp_Pnt Center(aPosList[0], aPosList[1], aPosList[2]);
+ gp_Dir aDirX(aPosList[3], aPosList[4], aPosList[5]);
+ gp_Dir aDirY(aPosList[6], aPosList[7], aPosList[8]);
+ gp_Dir aDirZ(aPosList[9], aPosList[10], aPosList[11]);
+ KContact->GetPosition().SetOrigin(Center);
+ KContact->GetPosition().SetDirX(aDirX);
+ KContact->GetPosition().SetDirY(aDirY);
+ KContact->GetPosition().SetDirZ(aDirZ);
- KContact->Rotation().ValX(myRotation->GetVal1());
- KContact->Rotation().ValY(myRotation->GetVal2());
- KContact->Rotation().ValZ(myRotation->GetVal3());
+ KContact->GetAngularRange().SetRangeX(aARList[0], aARList[1]);
+ KContact->GetAngularRange().SetRangeY(aARList[2], aARList[3]);
+ KContact->GetAngularRange().SetRangeZ(aARList[4], aARList[5]);
- KContact->Translation().ValX(myTranslation->GetValX());
- KContact->Translation().ValY(myTranslation->GetValY());
- KContact->Translation().ValZ(myTranslation->GetValZ());
+ KContact->GetLinearRange().SetRangeX(aLRList[0], aLRList[1]);
+ KContact->GetLinearRange().SetRangeY(aLRList[2], aLRList[3]);
+ KContact->GetLinearRange().SetRangeZ(aLRList[4], aLRList[5]);
return KContact;
}
//=======================================================================
-// function : ()
+// function : CreateAnimation()
// purpose :
//=======================================================================
Kinematic_Animation* KinematicGUI::CreateAnimation(GEOM::GEOM_Animation_ptr aAnimation)
TopoDS_Shape myFrame = myGeomGUI->GetShapeReader().GetShape(myGeom, aFrame);
Kinematic_Animation* KAnimation = new Kinematic_Animation(KAssembly, myFrame, Duration, NbSeq);
+
+ GEOM::ListOfContact_var aContactList = myAssembly->GetContactList();
+ for(int i = 0; i < myAssembly->NbContacts(); i++) {
+ GEOM::GEOM_Contact_var aContact = aContactList[i];
+ GEOM::ListOfDouble_var aList = aAnimation->GetDisplacement(aContact);
+ list <double> aKList;
+ for(int k = 0; k < 12; k++)
+ aKList.push_back(aList[k]);
+ KAnimation->SetDisplacement(i, aKList);
+ }
+
return KAnimation;
}
TCollection_AsciiString GetNameFromType(int type);
void SetPosition(GEOM::GEOM_Contact_ptr aContact, GEOM::PointStruct P0,
- GEOM::DirStruct VX, GEOM::DirStruct VY, GEOM::DirStruct VZ);
- void SetRotation(GEOM::GEOM_Contact_ptr aContact,
- int Rot1, int Rot2, int Rot3,
- double Val1, double Val2, double Val3);
- void SetTranslation(GEOM::GEOM_Contact_ptr aContact,
- double ValX, double ValY, double ValZ);
+ GEOM::DirStruct VX, GEOM::DirStruct VY, GEOM::DirStruct VZ);
+ void SetAngularRange(GEOM::GEOM_Contact_ptr aContact,
+ double MinValX, double MaxValX, double MinValY,
+ double MaxValY, double MinValZ, double MaxValZ);
+ void SetLinearRange(GEOM::GEOM_Contact_ptr aContact,
+ double MinValX, double MaxValX, double MinValY,
+ double MaxValY, double MinValZ, double MaxValZ);
+ void SetDisplacement(GEOM::GEOM_Animation_ptr anAnimation,
+ GEOM::GEOM_Contact_ptr aContact,
+ const GEOM::ListOfDouble& aList);
Kinematic_Contact* CreateContact(GEOM::GEOM_Contact_ptr aContact);
Kinematic_Assembly* CreateAssembly(GEOM::GEOM_Assembly_ptr aAssembly);
+++ /dev/null
-// 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 : KinematicGUI_3List3Spin.cxx
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header:
-
-#include "KinematicGUI_3List3Spin.h"
-
-#include <qlayout.h>
-#include <qspinbox.h>
-#include <qgroupbox.h>
-
-/*
- * Constructs a KinematicGUI_3List3Spin 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)
-{
- SpinBox1->close(TRUE);
- SpinBox2->close(TRUE);
- SpinBox3->close(TRUE);
- SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
- SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY");
- 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);
-}
-
-
-/*
- * Destroys the object and frees any allocated resources
- */
-KinematicGUI_3List3Spin::~KinematicGUI_3List3Spin()
-{
- // no need to delete child widgets, Qt does it all for us
-}
+++ /dev/null
-// 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 : KinematicGUI_3List3Spin.h
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header:
-
-#ifndef KINEMATICGUI_3LIST3SPIN_H
-#define KINEMATICGUI_3LIST3SPIN_H
-
-#include "KinematicGUI_3List3Spin_QTD.h"
-#include "DlgRef_SpinBox.h"
-
-class KinematicGUI_3List3Spin : public KinematicGUI_3List3Spin_QTD
-{
- Q_OBJECT
-
-public:
- KinematicGUI_3List3Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
- ~KinematicGUI_3List3Spin();
-
- DlgRef_SpinBox* SpinBox_DX;
- DlgRef_SpinBox* SpinBox_DY;
- DlgRef_SpinBox* SpinBox_DZ;
-
-};
-
-#endif // KINEMATICGUI_3LIST3SPIN_H
+++ /dev/null
-/****************************************************************************
-** Form implementation generated from reading ui file 'KinematicGUI_3List3Spin_QTD.ui'
-**
-** Created: mer fév 4 16:57:37 2004
-** by: The User Interface Compiler (uic)
-**
-** WARNING! All changes made in this file will be lost!
-****************************************************************************/
-#include "KinematicGUI_3List3Spin_QTD.h"
-
-#include <qvariant.h>
-#include <qcombobox.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qspinbox.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
-
-/*
- * Constructs a KinematicGUI_3List3Spin_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 )
- : 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");
-
- GroupBox1 = new QGroupBox( this, "GroupBox1" );
- GroupBox1->setTitle( trUtf8( "" ) );
- GroupBox1->setColumnLayout(0, Qt::Vertical );
- GroupBox1->layout()->setSpacing( 6 );
- GroupBox1->layout()->setMargin( 11 );
- GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
- GroupBox1Layout->setAlignment( Qt::AlignTop );
-
- 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, 0, 2 );
- QSpacerItem* spacer = new QSpacerItem( 0, 100, QSizePolicy::Minimum, QSizePolicy::Expanding );
- Layout1->addItem( spacer, 3, 3 );
-
- SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
- SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->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 );
-
- 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 );
-
- 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 );
-
- ComboBox3 = new QComboBox( FALSE, GroupBox1, "ComboBox3" );
- ComboBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, ComboBox3->sizePolicy().hasHeightForWidth() ) );
-
- Layout1->addWidget( ComboBox3, 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, 3 );
-
- SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" );
- SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) );
-
- 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 );
-}
-
-/*
- * Destroys the object and frees any allocated resources
- */
-KinematicGUI_3List3Spin_QTD::~KinematicGUI_3List3Spin_QTD()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
+++ /dev/null
-/****************************************************************************
-** Form interface generated from reading ui file 'KinematicGUI_3List3Spin_QTD.ui'
-**
-** Created: mer fév 4 16:57:37 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
-
-#include <qvariant.h>
-#include <qwidget.h>
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
-class QComboBox;
-class QGroupBox;
-class QLabel;
-class QSpinBox;
-
-class KinematicGUI_3List3Spin_QTD : public QWidget
-{
- Q_OBJECT
-
-public:
- KinematicGUI_3List3Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
- ~KinematicGUI_3List3Spin_QTD();
-
- QGroupBox* GroupBox1;
- QLabel* TextLabel2;
- QSpinBox* SpinBox1;
- QLabel* TextLabel4;
- QLabel* TextLabel3;
- QLabel* TextLabel1;
- QComboBox* ComboBox3;
- QSpinBox* SpinBox2;
- QSpinBox* SpinBox3;
- QLabel* TextLabel6;
- QComboBox* ComboBox1;
- QComboBox* ComboBox2;
- QLabel* TextLabel5;
-
-
-protected:
- QGridLayout* KinematicGUI_3List3Spin_QTDLayout;
- QGridLayout* GroupBox1Layout;
- QGridLayout* Layout1;
-};
-
-#endif // KINEMATICGUI_3LIST3SPIN_QTD_H
+++ /dev/null
-/****************************************************************************
-** Form implementation generated from reading ui file 'KinematicGUI_3Sel1List_QTD.ui'
-**
-** Created: mer fév 4 13:09:40 2004
-** by: The User Interface Compiler (uic)
-**
-** WARNING! All changes made in this file will be lost!
-****************************************************************************/
-#include "KinematicGUI_3Sel1List_QTD.h"
-
-#include <qvariant.h>
-#include <qcombobox.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
-
-/*
- * Constructs a KinematicGUI_3Sel1List_QTD which is a child of 'parent', with the
- * name 'name' and widget flags set to 'f'.
- */
-KinematicGUI_3Sel1List_QTD::KinematicGUI_3Sel1List_QTD( QWidget* parent, const char* name, WFlags fl )
- : QWidget( parent, name, fl )
-{
- if ( !name )
- setName( "KinematicGUI_3Sel1List_QTD" );
- resize( 129, 145 );
- setCaption( trUtf8( "KinematicGUI_3Sel1List_QTD" ) );
- KinematicGUI_3Sel1List_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "KinematicGUI_3Sel1List_QTDLayout");
-
- GroupBox1 = new QGroupBox( this, "GroupBox1" );
- GroupBox1->setTitle( trUtf8( "" ) );
- GroupBox1->setColumnLayout(0, Qt::Vertical );
- GroupBox1->layout()->setSpacing( 6 );
- GroupBox1->layout()->setMargin( 11 );
- GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
- GroupBox1Layout->setAlignment( Qt::AlignTop );
-
- Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
- QSpacerItem* spacer = new QSpacerItem( 0, 90, QSizePolicy::Minimum, QSizePolicy::Expanding );
- Layout1->addItem( spacer, 4, 2 );
-
- PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
- PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
- PushButton2->setText( trUtf8( "" ) );
-
- Layout1->addWidget( PushButton2, 2, 1 );
-
- 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 );
-
- 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, 3, 0 );
-
- LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
-
- Layout1->addWidget( LineEdit1, 0, 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 );
-
- 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 );
-
- PushButton3 = new QPushButton( GroupBox1, "PushButton3" );
- PushButton3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton3->sizePolicy().hasHeightForWidth() ) );
- PushButton3->setText( trUtf8( "" ) );
-
- Layout1->addWidget( PushButton3, 3, 1 );
-
- ComboBox1 = new QComboBox( FALSE, GroupBox1, "ComboBox1" );
- ComboBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, ComboBox1->sizePolicy().hasHeightForWidth() ) );
-
- Layout1->addWidget( ComboBox1, 1, 2 );
-
- LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
-
- Layout1->addWidget( LineEdit2, 2, 2 );
-
- LineEdit3 = new QLineEdit( GroupBox1, "LineEdit3" );
-
- Layout1->addWidget( LineEdit3, 3, 2 );
-
- 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 );
-
- GroupBox1Layout->addLayout( Layout1, 0, 0 );
-
- KinematicGUI_3Sel1List_QTDLayout->addWidget( GroupBox1, 0, 0 );
-}
-
-/*
- * Destroys the object and frees any allocated resources
- */
-KinematicGUI_3Sel1List_QTD::~KinematicGUI_3Sel1List_QTD()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
+++ /dev/null
-/****************************************************************************
-** Form interface generated from reading ui file 'KinematicGUI_3Sel1List_QTD.ui'
-**
-** Created: mer fév 4 13:09:40 2004
-** by: The User Interface Compiler (uic)
-**
-** WARNING! All changes made in this file will be lost!
-****************************************************************************/
-#ifndef KINEMATICGUI_3SEL1LIST_QTD_H
-#define KINEMATICGUI_3SEL1LIST_QTD_H
-
-#include <qvariant.h>
-#include <qwidget.h>
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
-class QComboBox;
-class QGroupBox;
-class QLabel;
-class QLineEdit;
-class QPushButton;
-
-class KinematicGUI_3Sel1List_QTD : public QWidget
-{
- Q_OBJECT
-
-public:
- KinematicGUI_3Sel1List_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
- ~KinematicGUI_3Sel1List_QTD();
-
- QGroupBox* GroupBox1;
- QPushButton* PushButton2;
- QLabel* TextLabel1;
- QLabel* TextLabel4;
- QLineEdit* LineEdit1;
- QPushButton* PushButton1;
- QLabel* TextLabel3;
- QPushButton* PushButton3;
- QComboBox* ComboBox1;
- QLineEdit* LineEdit2;
- QLineEdit* LineEdit3;
- QLabel* TextLabel2;
-
-
-protected:
- QGridLayout* KinematicGUI_3Sel1List_QTDLayout;
- QGridLayout* GroupBox1Layout;
- QGridLayout* Layout1;
-};
-
-#endif // KINEMATICGUI_3SEL1LIST_QTD_H
+++ /dev/null
-// 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 : KinematicGUI_3Sel1Spin.cxx
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header:
-
-#include "KinematicGUI_3Sel1Spin.h"
-
-#include <qlayout.h>
-#include <qspinbox.h>
-#include <qgroupbox.h>
-
-/*
- * Constructs a KinematicGUI_3Sel1Spin 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)
-{
- SpinBox1->close(TRUE);
- SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
- Layout2->addWidget(SpinBox_DX, 0, 1);
-}
-
-
-/*
- * Destroys the object and frees any allocated resources
- */
-KinematicGUI_3Sel1Spin::~KinematicGUI_3Sel1Spin()
-{
- // no need to delete child widgets, Qt does it all for us
-}
+++ /dev/null
-// 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 : KinematicGUI_3Sel1Spin.h
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header:
-
-#ifndef KINEMATICGUI_3SEL1SPIN_H
-#define KINEMATICGUI_3SEL1SPIN_H
-
-#include "KinematicGUI_3Sel1Spin_QTD.h"
-#include "DlgRef_SpinBox.h"
-
-class KinematicGUI_3Sel1Spin : public KinematicGUI_3Sel1Spin_QTD
-{
- Q_OBJECT
-
-public:
- KinematicGUI_3Sel1Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
- ~KinematicGUI_3Sel1Spin();
-
- DlgRef_SpinBox* SpinBox_DX;
-
-};
-
-#endif // KINEMATICGUI_3SEL1SPIN_H
+++ /dev/null
-/****************************************************************************
-** Form implementation generated from reading ui file 'KinematicGUI_3Sel1Spin_QTD.ui'
-**
-** Created: mer fév 4 13:09:41 2004
-** by: The User Interface Compiler (uic)
-**
-** WARNING! All changes made in this file will be lost!
-****************************************************************************/
-#include "KinematicGUI_3Sel1Spin_QTD.h"
-
-#include <qvariant.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qspinbox.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
-
-/*
- * Constructs a KinematicGUI_3Sel1Spin_QTD which is a child of 'parent', with the
- * name 'name' and widget flags set to 'f'.
- */
-KinematicGUI_3Sel1Spin_QTD::KinematicGUI_3Sel1Spin_QTD( QWidget* parent, const char* name, WFlags fl )
- : QWidget( parent, name, fl )
-{
- if ( !name )
- setName( "KinematicGUI_3Sel1Spin_QTD" );
- resize( 129, 147 );
- setCaption( trUtf8( "KinematicGUI_3Sel1Spin_QTD" ) );
- KinematicGUI_3Sel1Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "KinematicGUI_3Sel1Spin_QTDLayout");
-
- GroupBox1 = new QGroupBox( this, "GroupBox1" );
- GroupBox1->setTitle( trUtf8( "" ) );
- GroupBox1->setColumnLayout(0, Qt::Vertical );
- GroupBox1->layout()->setSpacing( 6 );
- GroupBox1->layout()->setMargin( 11 );
- GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
- GroupBox1Layout->setAlignment( Qt::AlignTop );
-
- Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
-
- LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
-
- Layout1->addWidget( LineEdit1, 0, 2 );
-
- PushButton3 = new QPushButton( GroupBox1, "PushButton3" );
- PushButton3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton3->sizePolicy().hasHeightForWidth() ) );
- PushButton3->setText( trUtf8( "" ) );
-
- Layout1->addWidget( PushButton3, 2, 1 );
-
- Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
-
- TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
- TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
- TextLabel4->setText( trUtf8( "TL4" ) );
-
- Layout2->addWidget( TextLabel4, 0, 0 );
-
- SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
- SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
-
- Layout2->addWidget( SpinBox1, 0, 1 );
-
- Layout1->addMultiCellLayout( Layout2, 3, 3, 0, 2 );
-
- 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 );
-
- LineEdit3 = new QLineEdit( GroupBox1, "LineEdit3" );
-
- Layout1->addWidget( LineEdit3, 2, 2 );
-
- LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
-
- Layout1->addWidget( LineEdit2, 1, 2 );
-
- PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
- PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
- PushButton2->setText( trUtf8( "" ) );
-
- Layout1->addWidget( PushButton2, 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, 1, 0 );
- QSpacerItem* spacer = new QSpacerItem( 0, 100, QSizePolicy::Minimum, QSizePolicy::Expanding );
- Layout1->addItem( spacer, 4, 2 );
-
- 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 );
-
- 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 );
-
- GroupBox1Layout->addLayout( Layout1, 0, 0 );
-
- KinematicGUI_3Sel1Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
-}
-
-/*
- * Destroys the object and frees any allocated resources
- */
-KinematicGUI_3Sel1Spin_QTD::~KinematicGUI_3Sel1Spin_QTD()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
+++ /dev/null
-/****************************************************************************
-** Form interface generated from reading ui file 'KinematicGUI_3Sel1Spin_QTD.ui'
-**
-** Created: mer fév 4 13:09:40 2004
-** 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
-
-#include <qvariant.h>
-#include <qwidget.h>
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
-class QGroupBox;
-class QLabel;
-class QLineEdit;
-class QPushButton;
-class QSpinBox;
-
-class KinematicGUI_3Sel1Spin_QTD : public QWidget
-{
- Q_OBJECT
-
-public:
- KinematicGUI_3Sel1Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
- ~KinematicGUI_3Sel1Spin_QTD();
-
- QGroupBox* GroupBox1;
- QLineEdit* LineEdit1;
- QPushButton* PushButton3;
- QLabel* TextLabel4;
- QSpinBox* SpinBox1;
- QLabel* TextLabel3;
- QLineEdit* LineEdit3;
- QLineEdit* LineEdit2;
- QPushButton* PushButton2;
- QLabel* TextLabel2;
- QLabel* TextLabel1;
- QPushButton* PushButton1;
-
-
-protected:
- QGridLayout* KinematicGUI_3Sel1Spin_QTDLayout;
- QGridLayout* GroupBox1Layout;
- QGridLayout* Layout1;
- QGridLayout* Layout2;
-};
-
-#endif // KINEMATICGUI_3SEL1SPIN_QTD_H
// Module : GEOM
// $Header:
-using namespace std;
#include "KinematicGUI_AnimDlg.h"
+#include <Geom_Transformation.hxx>
+
#include "QAD_RightFrame.h"
#include "OCCViewer_ViewFrame.h"
#include "QAD_FileDlg.h"
#include "QAD_Tools.h"
-//=================================================================================
-// class : MyThread()
-// purpose :
-//=================================================================================
-MyThread::MyThread(Kinematic_Animation* KAnimation, Handle(AIS_InteractiveContext) ic)
-{
- myIC = ic;
- myKAnimation = KAnimation;
- myIsActive = false;
-}
-
-//=================================================================================
-// function : ~MyThread()
-// purpose : Destroys the object and frees any allocated resources
-//=================================================================================
-MyThread::~MyThread() {}
+using namespace std;
//=================================================================================
-// class : run()
-// purpose :
+// class : KinematicGUI_AnimDlg()
+// purpose : Constructs a KinematicGUI_AnimDlg 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.
//=================================================================================
-void MyThread::run()
+KinematicGUI_AnimDlg::KinematicGUI_AnimDlg(QWidget* parent, const char* name, KinematicGUI* theKinematicGUI, SALOME_Selection* Sel, Handle(AIS_InteractiveContext) ic, bool modal, WFlags fl)
+ :KinematicGUI_Skeleton_QTD(parent, name, modal, fl)
{
- qApp->lock();
- while(myIsActive) {
- emit frameChanged();
+ if (!name)
+ setName("KinematicGUI_AnimDlg");
- qApp->syncX();
+ buttonClose->setText(tr("GEOM_BUT_CLOSE"));
+ GroupMedium->close(TRUE);
+ resize(0, 0);
- double Step, Val;
- Step = 1.0 / myKAnimation->NbSeq();
- Val = myValue * Step;
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setTitle( trUtf8( "" ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
- myKAnimation->myMovedShape.Clear();
- myKAnimation->myMovedShape.Add(myKAnimation->Frame());
+ LayoutA = new QGridLayout( 0, 1, 1, 0, 6, "LayoutA");
- myKAnimation->myNbAIS = 0;
- myKAnimation->GetNextShape(myIC, myLoc, myKAnimation->Frame(), Val);
+ LayoutD = new QGridLayout( 0, 1, 1, 0, 6, "LayoutD");
- myIC->UpdateCurrentViewer();
+ PushButton7 = new QPushButton( GroupBox1, "PushButton7" );
+ PushButton7->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton7->sizePolicy().hasHeightForWidth() ) );
+ PushButton7->setText( trUtf8( "" ) );
+
+ LayoutD->addWidget( PushButton7, 0, 1 );
- qApp->unlock();
- usleep((int)(myKAnimation->Duration() / myKAnimation->NbSeq() * 1e6));
- qApp->lock();
+ CheckButton1 = new QRadioButton( GroupBox1, "CheckButton1" );
+ CheckButton1->setText( trUtf8( "" ) );
- if (!myIsActive) break;
- }
+ LayoutD->addWidget( CheckButton1, 0, 0 );
- qApp->unlock();
- emit stopped();
- QThread::exit();
- return;
-}
+ LayoutA->addLayout( LayoutD, 3, 0 );
-//=================================================================================
-// class : InitAnim()
-// purpose :
-//=================================================================================
-void MyThread::InitAnim()
-{
- myKAnimation->myMovedShape.Clear();
- myKAnimation->myMovedShape.Add(myKAnimation->Frame());
+ Slider1 = new QSlider( GroupBox1, "Slider1" );
+ Slider1->setOrientation( QSlider::Horizontal );
- gp_Trsf aLoc;
- myLoc = aLoc;
- if(!myKAnimation->IsCreated)
- myKAnimation->GetNextShape(myIC, myLoc, myKAnimation->Frame(), 1);
- myKAnimation->IsCreated = true;
+ LayoutA->addWidget( Slider1, 1, 0 );
- myAISFrame = new AIS_Shape(TopoDS_Shape());
- myAISFrame->Set(myKAnimation->Frame());
- if(myKAnimation->myIsShading) {
- myAISFrame->SetColor(Quantity_NOC_GOLDENROD);
- myIC->Display(myAISFrame, 1, 1, Standard_False);
- }
- else {
- myAISFrame->SetColor(Quantity_NOC_RED);
- myIC->Display(myAISFrame, 0, 1, Standard_False);
- }
- return;
-}
+ LayoutB = new QGridLayout( 0, 1, 1, 0, 6, "LayoutB");
-//=================================================================================
-// class : ClearAnim()
-// purpose :
-//=================================================================================
-void MyThread::ClearAnim(int ClearPrs)
-{
- myIC->Erase(myAISFrame, Standard_False, Standard_False);
- myIC->ClearPrs(myAISFrame);
-
- if(!myKAnimation->ListOfAIS.IsEmpty()) {
- for(int i = 1; i <= myKAnimation->myNbAIS; i++) {
- Handle(AIS_Shape) myShape = Handle(AIS_Shape)::DownCast(myKAnimation->ListOfAIS.Value(i));
- myIC->Erase(myShape, Standard_False, Standard_False);
- if(ClearPrs)
- myIC->ClearPrs(myShape);
- }
- }
- myIC->UpdateCurrentViewer();
- return;
-}
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
-//=================================================================================
-// class : NextFrame()
-// purpose :
-//=================================================================================
-void MyThread::NextFrame() {
- double Step, Val;
- Step = 1.0 / myKAnimation->NbSeq();
- Val = myValue * Step;
+ LayoutB->addWidget( TextLabel1, 0, 0 );
- myKAnimation->myMovedShape.Clear();
- myKAnimation->myMovedShape.Add(myKAnimation->Frame());
+ PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
+ PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
+ PushButton1->setText( trUtf8( "" ) );
- myKAnimation->myNbAIS = 0;
- myKAnimation->GetNextShape(myIC, myLoc, myKAnimation->Frame(), Val);
+ LayoutB->addWidget( PushButton1, 0, 1 );
- myIC->UpdateCurrentViewer();
- return;
-}
+ LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
-//=================================================================================
-// class : startAnimation()
-// purpose :
-//=================================================================================
-void MyThread::startAnimation() {
- //DCQ : QThread doesn't work...
-// if(!myIsActive) {
-// myIsActive = true;
-// QThread::start();
-// }
+ LayoutB->addWidget( LineEdit1, 0, 2 );
- QApplication::setOverrideCursor(Qt::waitCursor);
- myIsActive = true;
- qApp->lock();
- while(myIsActive) {
- emit frameChanged();
+ LayoutA->addLayout( LayoutB, 0, 0 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 212, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ LayoutA->addItem( spacer, 4, 0 );
- qApp->syncX();
+ LayoutC = new QGridLayout( 0, 1, 1, 0, 6, "LayoutC");
- double Step, Val;
- Step = 1.0 / myKAnimation->NbSeq();
- Val = myValue * Step;
+ PushButton4 = new QPushButton( GroupBox1, "PushButton4" );
+ PushButton4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton4->sizePolicy().hasHeightForWidth() ) );
+ PushButton4->setText( trUtf8( "" ) );
- myKAnimation->myMovedShape.Clear();
- myKAnimation->myMovedShape.Add(myKAnimation->Frame());
+ LayoutC->addWidget( PushButton4, 0, 2 );
- myKAnimation->myNbAIS = 0;
- myKAnimation->GetNextShape(myIC, myLoc, myKAnimation->Frame(), Val);
+ PushButton6 = new QPushButton( GroupBox1, "PushButton6" );
+ PushButton6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton6->sizePolicy().hasHeightForWidth() ) );
+ PushButton6->setText( trUtf8( "" ) );
- myIC->UpdateCurrentViewer();
+ LayoutC->addWidget( PushButton6, 0, 4 );
- qApp->unlock();
- usleep((int)(myKAnimation->Duration() / myKAnimation->NbSeq() * 1e6));
- qApp->lock();
+ PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
+ PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
+ PushButton2->setText( trUtf8( "" ) );
- if (!myIsActive) break;
- }
+ LayoutC->addWidget( PushButton2, 0, 0 );
- QApplication::restoreOverrideCursor();
- qApp->unlock();
- emit stopped();
- return;
-}
+ PushButton5 = new QPushButton( GroupBox1, "PushButton5" );
+ PushButton5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton5->sizePolicy().hasHeightForWidth() ) );
+ PushButton5->setText( trUtf8( "" ) );
-//=================================================================================
-// class : stopAnimation()
-// purpose :
-//=================================================================================
-void MyThread::stopAnimation() {
- myIsActive = false;
- return;
-}
+ LayoutC->addWidget( PushButton5, 0, 3 );
+ PushButton3 = new QPushButton( GroupBox1, "PushButton3" );
+ PushButton3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton3->sizePolicy().hasHeightForWidth() ) );
+ PushButton3->setText( trUtf8( "" ) );
-//=================================================================================
-// class : KinematicGUI_AnimDlg()
-// purpose : Constructs a KinematicGUI_AnimDlg 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.
-//=================================================================================
-KinematicGUI_AnimDlg::KinematicGUI_AnimDlg(QWidget* parent, const char* name, KinematicGUI* theKinematicGUI, SALOME_Selection* Sel, Handle(AIS_InteractiveContext) ic, bool modal, WFlags fl)
- :KinematicGUI_Skeleton_QTD(parent, name, modal, fl)
-{
- if (!name)
- setName("KinematicGUI_AnimDlg");
+ LayoutC->addWidget( PushButton3, 0, 1 );
- buttonClose->setText(tr("GEOM_BUT_CLOSE"));
- GroupMedium->close(TRUE);
- resize(0, 0);
+ LayoutA->addLayout( LayoutC, 2, 0 );
+
+ GroupBox1Layout->addLayout( LayoutA, 0, 0 );
+ /***************************************************************/
setCaption(tr("GEOM_ANIM_TITLE"));
QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIMATION")));
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIM_FIRST")));
QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIM_PREV")));
- QPixmap image3(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIM_STOP")));
- QPixmap image4(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIM_PLAY")));
- QPixmap image5(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIM_NEXT")));
- QPixmap image6(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIM_LAST")));
+ QPixmap image3(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIM_PLAY")));
+ QPixmap image4(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIM_NEXT")));
+ QPixmap image5(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIM_LAST")));
+ QPixmap image6(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
/***************************************************************/
GroupConstructors->setTitle(tr("GEOM_ANIM"));
RadioButton1->setPixmap(image0);
-
- Group1 = new KinematicGUI_Anim_QTD(this, "Group1");
- Group1->PushButton1->setPixmap(image1);
- Group1->PushButton2->setPixmap(image2);
- Group1->PushButton3->setPixmap(image3);
- Group1->PushButton4->setPixmap(image4);
- Group1->PushButton5->setPixmap(image5);
- Group1->PushButton6->setPixmap(image6);
- Group1->PushButton7->setText(tr("GEOM_ANIM_EXPORT"));
- Group1->CheckButton1->setText(tr("GEOM_ANIM_SHADING"));
- Group1->CheckButton2->setText(tr("GEOM_ANIM_INLOOP"));
-
- Layout1->addWidget(Group1, 1, 0);
+ PushButton1->setPixmap(image6);
+ PushButton2->setPixmap(image1);
+ PushButton3->setPixmap(image2);
+ PushButton4->setPixmap(image3);
+ PushButton5->setPixmap(image4);
+ PushButton6->setPixmap(image5);
+ TextLabel1->setText(tr("GEOM_OBJECT"));
+ PushButton7->setText(tr("GEOM_ANIM_EXPORT"));
+ CheckButton1->setText(tr("GEOM_ANIM_SHADING"));
+
+ Layout1->addWidget(GroupBox1, 1, 0);
/***************************************************************/
/* Initialisation */
myKinematicGUI = theKinematicGUI;
+ mySelection = Sel;
+ myIC = ic;
QApplication::setOverrideCursor(Qt::waitCursor);
- Init(Sel, ic);
+ Init();
QApplication::restoreOverrideCursor();
}
KinematicGUI_AnimDlg::~KinematicGUI_AnimDlg()
{
// no need to delete child widgets, Qt does it all for us
- this->destroy(TRUE, TRUE);
}
// function : Init()
// purpose :
//=================================================================================
-void KinematicGUI_AnimDlg::Init(SALOME_Selection* Sel, Handle(AIS_InteractiveContext) ic)
+void KinematicGUI_AnimDlg::Init()
{
/* init variables */
- mySelection = Sel;
-
myGeomBase = new GEOMBase();
myGeomGUI = GEOMContext::GetGeomGUI();
myGeomGUI->SetActiveDialogBox((QDialog*)this);
- myGeom = myGeomGUI->myComponentGeom;
-
- Standard_Boolean testResult;
- Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
- GEOM::GEOM_Animation_var myGeomAnim = myGeomBase->ConvertIOinAnimation(IO, testResult);
- if(!testResult)
- ClickOnCancel();
-
- Kinematic_Animation* KAnimation = myKinematicGUI->CreateAnimation(myGeomAnim);
-
- bool IsOk = false;
- for(int cpt = 1; cpt <= KAnimation->myIndexToShape.Extent(); cpt++) {
- TopoDS_Shape myShape = KAnimation->myIndexToShape.FindKey(cpt);
- if(myShape == KAnimation->Frame())
- IsOk = true;
- }
- if(!IsOk)
- ClickOnCancel();
-
- Group1->CheckButton2->setEnabled(false);
+ RadioButton1->setChecked(TRUE);
+ Slider1->setPageStep(1);
+ Slider1->setValue(0);
- Group1->Slider1->setMaxValue(KAnimation->NbSeq());
- Group1->Slider1->setPageStep(1);
- Group1->Slider1->setValue(0);
+ myDuration = 5.0;
+ myNbSeq = 50;
+ myIsActive = false;
+ myType = 0;
/* signals and slots connections */
connect(buttonClose, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
- connect(Group1->Slider1, SIGNAL(valueChanged(int)), this, SLOT(ClickOnSlider(int)));
- connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(ClickOnFirst()));
- connect(Group1->PushButton2, SIGNAL(clicked()), this, SLOT(ClickOnPrevious()));
- connect(Group1->PushButton3, SIGNAL(clicked()), this, SLOT(ClickOnStop()));
- connect(Group1->PushButton4, SIGNAL(clicked()), this, SLOT(ClickOnPlay()));
- connect(Group1->PushButton5, SIGNAL(clicked()), this, SLOT(ClickOnNext()));
- connect(Group1->PushButton6, SIGNAL(clicked()), this, SLOT(ClickOnLast()));
- connect(Group1->PushButton7, SIGNAL(clicked()), this, SLOT(ClickOnExport()));
- connect(Group1->CheckButton1, SIGNAL(clicked()), this, SLOT(ClickOnShading()));
-
- myAnimator = new MyThread(KAnimation, ic);
- connect(myAnimator, SIGNAL(frameChanged()), this, SLOT(OnNext()));
- connect(myAnimator, SIGNAL(stopped()), this, SLOT(ClickOnStop()));
- myAnimator->InitAnim();
- myAnimator->myValue = 0;
- myAnimator->NextFrame();
+ connect(Slider1, SIGNAL(valueChanged(int)), this, SLOT(ClickOnSlider(int)));
+ connect(PushButton2, SIGNAL(clicked()), this, SLOT(ClickOnFirst()));
+ connect(PushButton3, SIGNAL(clicked()), this, SLOT(ClickOnPrevious()));
+ connect(PushButton4, SIGNAL(clicked()), this, SLOT(ClickOnPlay()));
+ connect(PushButton5, SIGNAL(clicked()), this, SLOT(ClickOnNext()));
+ connect(PushButton6, SIGNAL(clicked()), this, SLOT(ClickOnLast()));
+ connect(PushButton7, SIGNAL(clicked()), this, SLOT(ClickOnExport()));
+ connect(CheckButton1, SIGNAL(clicked()), this, SLOT(ClickOnShading()));
+
+ connect(PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* Move widget on the botton right corner of main widget */
// int x, y;
// this->move(x, y);
/* displays Dialog */
- RadioButton1->setChecked(TRUE);
- Group1->show();
+ this->SelectionIntoArgument();
this->show();
return;
}
+//=================================================================================
+// function : SelectionIntoArgument()
+// purpose : Called when selection has changed
+//=================================================================================
+void KinematicGUI_AnimDlg::SelectionIntoArgument()
+{
+ LineEdit1->setText("");
+ QString aString = "";
+ this->ClearAnim(true);
+ myType = 0;
+
+ int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
+ if(nbSel != 1)
+ return;
+
+ /* nbSel == 1 */
+ Standard_Boolean testResult;
+ Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
+
+ myGeomAnimation = myGeomBase->ConvertIOinAnimation(IO, testResult);
+ if(!testResult) {
+ myGeomContact = myGeomBase->ConvertIOinContact(IO, testResult);
+ if(!testResult)
+ return;
+
+ myKContact = myKinematicGUI->CreateContact(myGeomContact);
+
+ myType = 1;
+ myNbSeq = 50;
+ myDuration = 5.0;
+ }
+ else {
+ myKAnimation = myKinematicGUI->CreateAnimation(myGeomAnimation);
+
+ bool IsOk = false;
+ for(int cpt = 1; cpt <= myKAnimation->myIndexToShape.Extent(); cpt++) {
+ TopoDS_Shape myShape = myKAnimation->myIndexToShape.FindKey(cpt);
+ if(myShape == myKAnimation->GetFrame())
+ IsOk = true;
+ }
+ if(!IsOk)
+ return;
+
+ myType = 2;
+ myNbSeq = myKAnimation->GetNbSeq();
+ myDuration = myKAnimation->GetDuration();
+ myKAnimation->myIsShading = CheckButton1->isChecked();
+ }
+
+ Slider1->setMaxValue(myNbSeq);
+ LineEdit1->setText(aString);
+
+ this->InitAnim();
+ return;
+}
+
+
+//=================================================================================
+// function : SetEditCurrentArgument()
+// purpose :
+//=================================================================================
+void KinematicGUI_AnimDlg::SetEditCurrentArgument()
+{
+ LineEdit1->setFocus();
+ SelectionIntoArgument();
+ return;
+}
+
+
//=================================================================================
// function : ClickOnCancel()
// purpose :
//=================================================================================
void KinematicGUI_AnimDlg::ClickOnCancel()
{
- this->ClickOnStop();
- myAnimator->ClearAnim(true);
+ this->ClearAnim(true);
disconnect(mySelection, 0, this, 0);
reject();
QApplication::restoreOverrideCursor();
//=================================================================================
void KinematicGUI_AnimDlg::DeactivateActiveDialog()
{
+ this->ClearAnim(true);
this->setEnabled(false);
disconnect(mySelection, 0, this, 0);
myGeomGUI->SetActiveDialogBox(0);
this->setEnabled(true);
myGeomGUI->SetActiveDialogBox((QDialog*)this);
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ this->SelectionIntoArgument();
return;
}
//=================================================================================
void KinematicGUI_AnimDlg::ClickOnSlider(int newValue)
{
- myAnimator->myValue = newValue;
- if(!myAnimator->running())
- myAnimator->NextFrame();
+ myValue = newValue;
+ this->NextFrame();
return;
}
//=================================================================================
void KinematicGUI_AnimDlg::ClickOnFirst()
{
- this->ClickOnStop();
- int aVal = Group1->Slider1->value();
+ int aVal = Slider1->value();
if(aVal == 0) {
- myAnimator->myValue = 0;
- myAnimator->NextFrame();
+ myValue = 0;
+ this->NextFrame();
}
else
- Group1->Slider1->setValue(0);
+ Slider1->setValue(0);
return;
}
//=================================================================================
void KinematicGUI_AnimDlg::ClickOnPrevious()
{
- this->ClickOnStop();
- int aVal = Group1->Slider1->value();
+ int aVal = Slider1->value();
if(aVal != 0)
- Group1->Slider1->setValue(aVal - 1);
+ Slider1->setValue(aVal - 1);
return;
}
//=================================================================================
-// function : ClickOnStop()
+// function : ClickOnPlay()
// purpose :
//=================================================================================
-void KinematicGUI_AnimDlg::ClickOnStop()
+void KinematicGUI_AnimDlg::ClickOnPlay()
{
- myAnimator->stopAnimation();
+ QApplication::setOverrideCursor(Qt::waitCursor);
+ myIsActive = true;
+ qApp->lock();
+ while(myIsActive) {
+ this->ClickOnNext();
+ qApp->syncX();
+
+ qApp->unlock();
+ usleep((int)(myDuration / myNbSeq * 1e6));
+ qApp->lock();
+
+ if (!myIsActive) break;
+ }
+
+ QApplication::restoreOverrideCursor();
return;
}
//=================================================================================
-// function : ClickOnPlay()
+// function : ClickOnNext()
// purpose :
//=================================================================================
-void KinematicGUI_AnimDlg::ClickOnPlay()
+void KinematicGUI_AnimDlg::ClickOnNext()
{
- if(!myAnimator->running())
- myAnimator->startAnimation();
+ int aVal = Slider1->value();
+ if(aVal != myNbSeq)
+ Slider1->setValue(aVal + 1);
+ else
+ myIsActive = false;
return;
}
//=================================================================================
-// function : OnNext()
+// function : ClickOnLast()
// purpose :
//=================================================================================
-void KinematicGUI_AnimDlg::OnNext()
+void KinematicGUI_AnimDlg::ClickOnLast()
{
- int aVal = Group1->Slider1->value();
- if(aVal != myAnimator->myKAnimation->NbSeq())
- Group1->Slider1->setValue(aVal + 1);
- else {
- if(Group1->CheckButton2->isChecked())
- Group1->Slider1->setValue(0);
- else
- this->ClickOnStop();
+ int aVal = Slider1->value();
+ if(aVal == myNbSeq) {
+ myValue = myNbSeq;
+ this->NextFrame();
}
+ else
+ Slider1->setValue(myNbSeq);
+
return;
}
//=================================================================================
-// function : ClickOnNext()
-// purpose :
+// class : InitAnim()
+// purpose :
//=================================================================================
-void KinematicGUI_AnimDlg::ClickOnNext()
+void KinematicGUI_AnimDlg::InitAnim()
{
- this->ClickOnStop();
- this->OnNext();
+ if(myType == 0)
+ return;
+
+ myAISFrame = new AIS_Shape(TopoDS_Shape());
+
+ if(myType == 1) { //Contact
+ myAISFrame->Set(myKContact->GetShape1());
+
+ myAISShape = new AIS_Shape(TopoDS_Shape());
+ myAISShape->Set(myKContact->GetShape2());
+
+ if(CheckButton1->isChecked()) { //In Shading
+ myAISShape->SetColor(Quantity_NOC_GOLDENROD);
+ myIC->Display(myAISShape, 1, 1, Standard_False);
+ }
+ else {
+ myAISShape->SetColor(Quantity_NOC_GREEN);
+ myIC->Display(myAISShape, 0, 1, Standard_False);
+ }
+ }
+ else if(myType == 2) { //Assembly
+ myKAnimation->myMovedShape.Clear();
+ myKAnimation->myMovedShape.Add(myKAnimation->GetFrame());
+
+ gp_Trsf aLoc;
+ myLoc = aLoc;
+ if(!myKAnimation->IsCreated)
+ myKAnimation->GetNextShape(myIC, myLoc, myKAnimation->GetFrame(), 1);
+ myKAnimation->IsCreated = true;
+
+ myAISFrame->Set(myKAnimation->GetFrame());
+ }
+
+ if(CheckButton1->isChecked()) { //In Shading
+ myAISFrame->SetColor(Quantity_NOC_GOLDENROD);
+ myIC->Display(myAISFrame, 1, 1, Standard_False);
+ }
+ else {
+ myAISFrame->SetColor(Quantity_NOC_RED);
+ myIC->Display(myAISFrame, 0, 1, Standard_False);
+ }
+
+ this->ClickOnFirst();
+ this->NextFrame();
return;
}
//=================================================================================
-// function : ClickOnLast()
-// purpose :
+// class : ClearAnim()
+// purpose :
//=================================================================================
-void KinematicGUI_AnimDlg::ClickOnLast()
+void KinematicGUI_AnimDlg::ClearAnim(int ClearPrs)
{
- this->ClickOnStop();
- int aVal = Group1->Slider1->value();
- if(aVal == myAnimator->myKAnimation->NbSeq()) {
- myAnimator->myValue = myAnimator->myKAnimation->NbSeq();
- myAnimator->NextFrame();
+ myIC->Erase(myAISFrame, Standard_False, Standard_False);
+ if(ClearPrs)
+ myIC->ClearPrs(myAISFrame);
+
+ if(myType == 1) { //Contact
+ myIC->Erase(myAISShape, Standard_False, Standard_False);
+ if(ClearPrs)
+ myIC->ClearPrs(myAISShape);
}
- else
- Group1->Slider1->setValue(myAnimator->myKAnimation->NbSeq());
+ if(myType == 2) { //Assembly
+ if(!myKAnimation->myListOfAIS.IsEmpty()) {
+ for(int i = 1; i <= myKAnimation->myNbAIS; i++) {
+ Handle(AIS_Shape) myShape = Handle(AIS_Shape)::DownCast(myKAnimation->myListOfAIS.Value(i));
+ myIC->Erase(myShape, Standard_False, Standard_False);
+ if(ClearPrs)
+ myIC->ClearPrs(myShape);
+ }
+ }
+ }
+ myIC->UpdateCurrentViewer();
+ return;
+}
+
+
+//=================================================================================
+// class : NextFrame()
+// purpose :
+//=================================================================================
+void KinematicGUI_AnimDlg::NextFrame() {
+ double Step, Val;
+ Step = 1.0 / myNbSeq;
+ Val = myValue * Step;
+
+ if(myType == 1) { //Contact
+ gp_Trsf aTrans = myKContact->GetTransformation(Val);
+ Handle(Geom_Transformation) aGTrans = new Geom_Transformation();
+ aGTrans->SetTrsf(aTrans);
+ myAISShape->SetTransformation(aGTrans, false, false);
+ if(CheckButton1->isChecked()) { //In Shading
+ myAISShape->SetColor(Quantity_NOC_GOLDENROD);
+ myIC->SetDisplayMode(myAISShape, 1, Standard_False);
+ }
+ else {
+ myAISShape->SetColor(Quantity_NOC_GREEN);
+ myIC->SetDisplayMode(myAISShape, 0, Standard_False);
+ }
+ myIC->Display(myAISShape, Standard_True);
+ }
+ else if(myType == 2) { //Assembly
+ myKAnimation->myMovedShape.Clear();
+ myKAnimation->myMovedShape.Add(myKAnimation->GetFrame());
+
+ myKAnimation->myNbAIS = 0;
+ myKAnimation->GetNextShape(myIC, myLoc, myKAnimation->GetFrame(), Val);
+
+ myIC->UpdateCurrentViewer();
+ }
return;
}
//=================================================================================
void KinematicGUI_AnimDlg::ClickOnShading()
{
+ if(myType == 0)
+ return;
+
QApplication::setOverrideCursor(Qt::waitCursor);
- this->ClickOnStop();
- myAnimator->ClearAnim(false);
- myAnimator->myKAnimation->myIsShading = Group1->CheckButton1->isChecked();
- myAnimator->InitAnim();
- this->ClickOnFirst();
+ this->ClearAnim(false);
+
+ if(myType == 2)
+ myKAnimation->myIsShading = CheckButton1->isChecked();
+
+ this->InitAnim();
QApplication::restoreOverrideCursor();
+
return;
}
//=================================================================================
void KinematicGUI_AnimDlg::ClickOnExport()
{
+ if(myType == 0)
+ return;
+
this->ClickOnFirst();
QString fName = QAD_FileDlg::getFileName(QAD_Application::getDesktop(), QString::null, tr("OCC_IMAGE_FILES"), tr("INF_APP_DUMP_VIEW"), false);
QApplication::setOverrideCursor(Qt::waitCursor);
qApp->processEvents();
- for(int i = 0; i <= myAnimator->myKAnimation->NbSeq(); i++) {
+ for(int i = 0; i <= myNbSeq; i++) {
qApp->processEvents();
QWidget* qw = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewWidget();
QPixmap px = QPixmap::grabWindow(qw->winId());
bool bOk = px.save(fileName, fmt.latin1());
- this->OnNext();
+ this->ClickOnNext();
}
QApplication::restoreOverrideCursor();
#define KINEMATICGUI_ANIMDLG_H
#include "KinematicGUI_Skeleton_QTD.h"
-#include "KinematicGUI_Anim_QTD.h"
#include "KinematicGUI.h"
-#include <qwidget.h>
+#include <qslider.h>
#include <qgroupbox.h>
-#include <qlineedit.h>
#include <qlayout.h>
#include <qradiobutton.h>
+#include <qlineedit.h>
#include <qbuttongroup.h>
-#include <qslider.h>
-#include <qthread.h>
-
-class MyThread : public QObject, public QThread
-{
- Q_OBJECT
-
-public:
- MyThread(Kinematic_Animation* KAnimation = 0, Handle(AIS_InteractiveContext) ic = 0);
- ~MyThread();
-
-private:
- bool myIsActive;
- Handle(AIS_Shape) myAISFrame;
- Handle(AIS_InteractiveContext) myIC; /* Interactive context */
- gp_Trsf myLoc;
-
-public:
- Kinematic_Animation* myKAnimation;
-
- int myValue;
- virtual void run();
- void startAnimation();
- void stopAnimation();
- void InitAnim();
- void ClearAnim(int ClearPrs);
- void NextFrame();
-
-signals:
- void frameChanged();
- void stopped();
-
-};
-
class KinematicGUI_AnimDlg : public KinematicGUI_Skeleton_QTD
{
~KinematicGUI_AnimDlg();
private :
- void Init(SALOME_Selection* Sel, Handle(AIS_InteractiveContext) ic);
+ void Init();
void enterEvent(QEvent * e);
void closeEvent(QCloseEvent* e);
KinematicGUI* myKinematicGUI;
- MyThread* myAnimator;
-
SALOME_Selection* mySelection; /* User shape selection */
- GEOM::GEOM_Gen_var myGeom; /* Current GeomI object */
GEOMBase* myGeomBase;
GEOMContext* myGeomGUI; /* Current GeomGUI object */
- KinematicGUI_Anim_QTD* Group1;
+ GEOM::GEOM_Animation_var myGeomAnimation;
+ GEOM::GEOM_Contact_var myGeomContact;
+ Handle(AIS_InteractiveContext) myIC; /* Interactive context */
+ Handle(AIS_Shape) myAISFrame;
+ Handle(AIS_Shape) myAISShape;
+
+ Kinematic_Animation* myKAnimation;
+ Kinematic_Contact* myKContact;
+ int myType, myValue, myNbSeq;
+ double myDuration;
+ gp_Trsf myLoc;
+ bool myIsActive;
+ void NextFrame();
+ void InitAnim();
+ void ClearAnim(int ClearPrs);
+
+ QGroupBox* GroupBox1;
+ QPushButton* PushButton8;
+ QRadioButton* CheckButton1;
+ QSlider* Slider1;
+ QLabel* TextLabel1;
+ QPushButton* PushButton1;
+ QLineEdit* LineEdit1;
+ QPushButton* PushButton4;
+ QPushButton* PushButton6;
+ QPushButton* PushButton3;
+ QPushButton* PushButton5;
+ QPushButton* PushButton7;
+ QPushButton* PushButton2;
private slots:
void ClickOnCancel();
+ void SetEditCurrentArgument();
+ void SelectionIntoArgument();
void DeactivateActiveDialog();
void ActivateThisDialog();
void ClickOnSlider(int newValue);
void ClickOnFirst();
void ClickOnPrevious();
- void ClickOnStop();
void ClickOnPlay();
- void OnNext();
void ClickOnNext();
void ClickOnLast();
void ClickOnShading();
void ClickOnExport();
+protected:
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* LayoutA;
+ QGridLayout* LayoutB;
+ QGridLayout* LayoutC;
+ QGridLayout* LayoutD;
+
};
#endif // KINEMATICGUI_ANIMDLG_H
--- /dev/null
+// 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 : KinematicGUI_AnimValuesDlg.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#include "KinematicGUI_AnimValuesDlg.h"
+
+using namespace std;
+
+//=================================================================================
+// class : KinematicGUI_AnimValuesDlg()
+// purpose : Constructs a KinematicGUI_AnimValuesDlg 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.
+//=================================================================================
+KinematicGUI_AnimValuesDlg::KinematicGUI_AnimValuesDlg(QWidget* parent, const char* name, KinematicGUI* theKinematicGUI, SALOME_Selection* Sel, bool modal, WFlags fl)
+ :GEOMBase_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+{
+ QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIMATION")));
+ QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
+
+ setCaption(tr("GEOM_ANIMVALUES_TITLE"));
+
+ /***************************************************************/
+ GroupConstructors->setTitle(tr("GEOM_ANIMVALUES"));
+ RadioButton1->setPixmap(image0);
+ RadioButton2->close(TRUE);
+ RadioButton3->close(TRUE);
+
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+ LayoutD = new QGridLayout( 0, 1, 1, 0, 6, "LayoutD");
+ QSpacerItem* spacer = new QSpacerItem( 0, 50, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ LayoutD->addItem( spacer, 2, 1 );
+
+ LayoutC = new QGridLayout( 0, 1, 1, 0, 6, "LayoutC");
+
+ TextLabel8 = new QLabel( GroupBox1, "TextLabel8" );
+ TextLabel8->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel8->sizePolicy().hasHeightForWidth() ) );
+ LayoutC->addWidget( TextLabel8, 5, 0 );
+
+ TextLabel9 = new QLabel( GroupBox1, "TextLabel9" );
+ TextLabel9->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel9->sizePolicy().hasHeightForWidth() ) );
+ LayoutC->addWidget( TextLabel9, 6, 0 );
+
+ TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
+ TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
+ LayoutC->addWidget( TextLabel4, 1, 0 );
+
+ TextLabel5 = new QLabel( GroupBox1, "TextLabel5" );
+ TextLabel5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel5->sizePolicy().hasHeightForWidth() ) );
+ LayoutC->addWidget( TextLabel5, 2, 0 );
+
+ TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
+ TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
+ TextLabel3->setAlignment( int( QLabel::AlignCenter ) );
+ LayoutC->addWidget( TextLabel3, 0, 2 );
+
+ TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
+ TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
+ TextLabel2->setAlignment( int( QLabel::AlignCenter ) );
+ LayoutC->addWidget( TextLabel2, 0, 1 );
+
+ TextLabel6 = new QLabel( GroupBox1, "TextLabel6" );
+ TextLabel6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel6->sizePolicy().hasHeightForWidth() ) );
+ LayoutC->addWidget( TextLabel6, 3, 0 );
+
+ TextLabel10 = new QLabel( GroupBox1, "TextLabel10" );
+ TextLabel10->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel10->sizePolicy().hasHeightForWidth() ) );
+ QFont TextLabel10_font( TextLabel10->font() );
+ TextLabel10_font.setBold( TRUE );
+ TextLabel10->setFont( TextLabel10_font );
+ LayoutC->addWidget( TextLabel10, 0, 0 );
+
+ TextLabel7 = new QLabel( GroupBox1, "TextLabel7" );
+ TextLabel7->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel7->sizePolicy().hasHeightForWidth() ) );
+ LayoutC->addWidget( TextLabel7, 4, 0 );
+
+ SpinBox1 = new DlgRef_SpinBox(GroupBox1, "SpinBox1");
+ LayoutC->addWidget( SpinBox1, 1, 1 );
+
+ SpinBox2 = new DlgRef_SpinBox(GroupBox1, "SpinBox2");
+ LayoutC->addWidget( SpinBox2, 1, 2 );
+
+ SpinBox3 = new DlgRef_SpinBox(GroupBox1, "SpinBox3");
+ LayoutC->addWidget( SpinBox3, 2, 1 );
+
+ SpinBox4 = new DlgRef_SpinBox(GroupBox1, "SpinBox4");
+ LayoutC->addWidget( SpinBox4, 2, 2 );
+
+ SpinBox5 = new DlgRef_SpinBox(GroupBox1, "SpinBox5");
+ LayoutC->addWidget( SpinBox5, 3, 1 );
+
+ SpinBox6 = new DlgRef_SpinBox(GroupBox1, "SpinBox6");
+ LayoutC->addWidget( SpinBox6, 3, 2 );
+
+ SpinBox7 = new DlgRef_SpinBox(GroupBox1, "SpinBox7");
+ LayoutC->addWidget( SpinBox7, 4, 1 );
+
+ SpinBox8 = new DlgRef_SpinBox(GroupBox1, "SpinBox8");
+ LayoutC->addWidget( SpinBox8, 4, 2 );
+
+ SpinBox9 = new DlgRef_SpinBox(GroupBox1, "SpinBox9");
+ LayoutC->addWidget( SpinBox9, 5, 1 );
+
+ SpinBox10 = new DlgRef_SpinBox(GroupBox1, "SpinBox10");
+ LayoutC->addWidget( SpinBox10, 5, 2 );
+
+ SpinBox11 = new DlgRef_SpinBox(GroupBox1, "SpinBox11");
+ LayoutC->addWidget( SpinBox11, 6, 1 );
+
+ SpinBox12 = new DlgRef_SpinBox(GroupBox1, "SpinBox12");
+ LayoutC->addWidget( SpinBox12, 6, 2 );
+
+ LayoutD->addLayout( LayoutC, 1, 1 );
+
+ ListBox1 = new QListBox( GroupBox1, "ListBox1" );
+ ListBox1->insertItem( trUtf8( "New Item" ) );
+ ListBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, ListBox1->sizePolicy().hasHeightForWidth() ) );
+ LayoutD->addMultiCellWidget( ListBox1, 1, 2, 0, 0 );
+
+ LayoutB = new QGridLayout( 0, 1, 1, 0, 6, "LayoutB");
+
+ LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
+ LayoutB->addWidget( LineEdit1, 0, 2 );
+
+ PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
+ PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
+ LayoutB->addWidget( PushButton1, 0, 1 );
+
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ LayoutB->addWidget( TextLabel1, 0, 0 );
+
+ LayoutD->addMultiCellLayout( LayoutB, 0, 0, 0, 1 );
+
+ GroupBox1Layout->addLayout( LayoutD, 0, 0 );
+
+ GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
+ TextLabel1->setText(tr("GEOM_ANIMATION"));
+ TextLabel2->setText(tr("GEOM_BEGIN"));
+ TextLabel3->setText(tr("GEOM_END"));
+ TextLabel4->setText(tr("GEOM_RX"));
+ TextLabel5->setText(tr("GEOM_RY"));
+ TextLabel6->setText(tr("GEOM_RZ"));
+ TextLabel7->setText(tr("GEOM_TX"));
+ TextLabel8->setText(tr("GEOM_TY"));
+ TextLabel9->setText(tr("GEOM_TZ"));
+ PushButton1->setPixmap(image1);
+
+ Layout1->addWidget(GroupBox1, 1, 0);
+ /***************************************************************/
+
+ /* Initialisation */
+ resize(0, 250);
+ myKinematicGUI = theKinematicGUI;
+ Init();
+}
+
+
+//=================================================================================
+// function : ~KinematicGUI_AnimValuesDlg()
+// purpose : Destroys the object and frees any allocated resources
+//=================================================================================
+KinematicGUI_AnimValuesDlg::~KinematicGUI_AnimValuesDlg()
+{
+ /* no need to delete child widgets, Qt does it all for us */
+}
+
+
+
+//=================================================================================
+// function : Init()
+// purpose :
+//=================================================================================
+void KinematicGUI_AnimValuesDlg::Init()
+{
+ /* init variables */
+ myEditCurrentArgument = LineEdit1;
+ myOkAnimation = false;
+
+ /* min, max, step and decimals for spin boxes & initial values */
+ SpinBox1->RangeStepAndValidator(-99999.999, 99999.999, 5.0, 3);
+ SpinBox2->RangeStepAndValidator(-99999.999, 99999.999, 5.0, 3);
+ SpinBox3->RangeStepAndValidator(-99999.999, 99999.999, 5.0, 3);
+ SpinBox4->RangeStepAndValidator(-99999.999, 99999.999, 5.0, 3);
+ SpinBox5->RangeStepAndValidator(-99999.999, 99999.999, 5.0, 3);
+ SpinBox6->RangeStepAndValidator(-99999.999, 99999.999, 5.0, 3);
+ SpinBox7->RangeStepAndValidator(-99999.999, 99999.999, 100.0, 3);
+ SpinBox8->RangeStepAndValidator(-99999.999, 99999.999, 100.0, 3);
+ SpinBox9->RangeStepAndValidator(-99999.999, 99999.999, 100.0, 3);
+ SpinBox10->RangeStepAndValidator(-99999.999, 99999.999, 100.0, 3);
+ SpinBox11->RangeStepAndValidator(-99999.999, 99999.999, 100.0, 3);
+ SpinBox12->RangeStepAndValidator(-99999.999, 99999.999, 100.0, 3);
+
+ SpinBox1->SetValue(0.0);
+ SpinBox2->SetValue(0.0);
+ SpinBox3->SetValue(0.0);
+ SpinBox4->SetValue(0.0);
+ SpinBox5->SetValue(0.0);
+ SpinBox6->SetValue(0.0);
+ SpinBox7->SetValue(0.0);
+ SpinBox8->SetValue(0.0);
+ SpinBox9->SetValue(0.0);
+ SpinBox10->SetValue(0.0);
+ SpinBox11->SetValue(0.0);
+ SpinBox12->SetValue(0.0);
+
+ /* signals and slots connections */
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+
+ connect(PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(ListBox1, SIGNAL(highlighted(int)), this, SLOT(ClickOnListBox(int)));
+
+ connect(SpinBox1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(SpinBox2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(SpinBox3, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(SpinBox4, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(SpinBox5, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(SpinBox6, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(SpinBox7, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(SpinBox8, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(SpinBox9, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(SpinBox10, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(SpinBox11, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(SpinBox12, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), SpinBox1, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), SpinBox2, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), SpinBox3, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), SpinBox4, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), SpinBox5, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), SpinBox6, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), SpinBox7, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), SpinBox8, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), SpinBox9, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), SpinBox10, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), SpinBox11, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), SpinBox12, SLOT(SetStep(double)));
+
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
+ /* displays Dialog */
+ this->SelectionIntoArgument();
+ this->show();
+
+ return;
+}
+
+
+//=================================================================================
+// function : SetEnabledValues()
+// purpose :
+//=================================================================================
+void KinematicGUI_AnimValuesDlg::SetEnabledValues()
+{
+ cout<<"KinematicGUI_AnimValuesDlg::SetEnabledValues"<<endl;
+ int type = myGeomContact->GetType();
+
+ TCollection_AsciiString aTypeName = myKinematicGUI->GetNameFromType(type);
+ TextLabel10->setText(aTypeName.ToCString());
+
+ cout<<"KinematicGUI_AnimValuesDlg::SetEnabledValues : 1"<<endl;
+ SpinBox1->SetValue(myList[0]);
+ SpinBox2->SetValue(myList[1]);
+ SpinBox3->SetValue(myList[2]);
+ SpinBox4->SetValue(myList[3]);
+ SpinBox5->SetValue(myList[4]);
+ SpinBox6->SetValue(myList[5]);
+ SpinBox7->SetValue(myList[6]);
+ SpinBox8->SetValue(myList[7]);
+ SpinBox9->SetValue(myList[8]);
+ SpinBox10->SetValue(myList[9]);
+ SpinBox11->SetValue(myList[10]);
+ SpinBox12->SetValue(myList[11]);
+ cout<<"KinematicGUI_AnimValuesDlg::SetEnabledValues : 2"<<endl;
+
+ SpinBox1->show();
+ SpinBox2->show();
+ TextLabel4->show();
+
+ SpinBox3->show();
+ SpinBox4->show();
+ TextLabel5->show();
+
+ SpinBox5->show();
+ SpinBox6->show();
+ TextLabel6->show();
+
+ SpinBox7->show();
+ SpinBox8->show();
+ TextLabel7->show();
+
+ SpinBox9->show();
+ SpinBox10->show();
+ TextLabel8->show();
+
+ SpinBox11->show();
+ SpinBox12->show();
+ TextLabel9->show();
+
+ if(type == 0 || type == 2 || type == 5) { // RX
+ SpinBox1->hide();
+ SpinBox2->hide();
+ TextLabel4->hide();
+ }
+ if(type == 0 || type == 1 || type == 2 || type == 3 || type == 5 || type == 7 || type == 9) { // RY
+ SpinBox3->hide();
+ SpinBox4->hide();
+ TextLabel5->hide();
+ }
+ if(type == 0 || type == 1 || type == 2 || type == 3 || type == 9) { // RZ
+ SpinBox5->hide();
+ SpinBox6->hide();
+ TextLabel6->hide();
+ }
+ if(type == 0 || type == 1 || type == 4 || type == 8) { // TX
+ SpinBox7->hide();
+ SpinBox8->hide();
+ TextLabel7->hide();
+ }
+ if(type == 0 || type == 1 || type == 2 || type == 3 || type == 4 || type == 6 || type == 9) { // TY
+ SpinBox9->hide();
+ SpinBox10->hide();
+ TextLabel8->hide();
+ }
+ if(type == 0 || type == 1 || type == 2 || type == 3 || type == 4 || type == 5 || type == 6 || type == 7 || type == 9) { // TZ
+ SpinBox11->hide();
+ SpinBox12->hide();
+ TextLabel9->hide();
+ }
+
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnListBox()
+// purpose :
+//=================================================================================
+void KinematicGUI_AnimValuesDlg::ClickOnListBox(int Item)
+{
+ cout<<"KinematicGUI_AnimValuesDlg::ClickOnListBox"<<endl;
+ GEOM::ListOfContact_var aContactList = myGeomAnimation->GetAssembly()->GetContactList();
+ myGeomContact = aContactList[Item];
+ myOkContact = true;
+ myList = myGeomAnimation->GetDisplacement(myGeomContact);
+ this->SetEnabledValues();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnOk()
+// purpose :
+//=================================================================================
+void KinematicGUI_AnimValuesDlg::ClickOnOk()
+{
+ this->ClickOnApply();
+ ClickOnCancel();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnApply()
+// purpose :
+//=================================================================================
+void KinematicGUI_AnimValuesDlg::ClickOnApply()
+{
+ buttonApply->setFocus();
+ QAD_Application::getDesktop()->putInfo(tr(""));
+
+ if(myOkAnimation && myOkContact)
+ myKinematicGUI->SetDisplacement(myGeomAnimation, myGeomContact, myList);
+
+ return;
+}
+
+
+//=================================================================================
+// function : SelectionIntoArgument()
+// purpose : Called when selection has changed
+//=================================================================================
+void KinematicGUI_AnimValuesDlg::SelectionIntoArgument()
+{
+ cout<<"KinematicGUI_AnimValuesDlg::SelectionIntoArgument"<<endl;
+ myEditCurrentArgument->setText("");
+ QString aString = "";
+ myOkAnimation = false;
+ myOkContact = false;
+ ListBox1->clear();
+ TextLabel10->setText("");
+
+ SpinBox1->SetValue(0.0);
+ SpinBox2->SetValue(0.0);
+ SpinBox3->SetValue(0.0);
+ SpinBox4->SetValue(0.0);
+ SpinBox5->SetValue(0.0);
+ SpinBox6->SetValue(0.0);
+ SpinBox7->SetValue(0.0);
+ SpinBox8->SetValue(0.0);
+ SpinBox9->SetValue(0.0);
+ SpinBox10->SetValue(0.0);
+ SpinBox11->SetValue(0.0);
+ SpinBox12->SetValue(0.0);
+
+ int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
+ if(nbSel != 1)
+ return;
+
+ /* nbSel == 1 */
+ Standard_Boolean testResult;
+ Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
+
+ if(myEditCurrentArgument == LineEdit1) {
+ myGeomAnimation = myGeomBase->ConvertIOinAnimation(IO, testResult);
+ if(!testResult)
+ return;
+ LineEdit1->setText(aString);
+ myOkAnimation = true;
+
+ SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
+ GEOM::ListOfContact_var aContactList = myGeomAnimation->GetAssembly()->GetContactList();
+ for(int i = 0; i < myGeomAnimation->GetAssembly()->NbContacts(); i++) {
+ GEOM::GEOM_Contact_var aContact = aContactList[i];
+ SALOMEDS::SObject_var SO = aStudy->FindObjectIOR(aContact->Name());
+ ListBox1->insertItem(SO->GetName());
+ }
+ ListBox1->setSelected(0, true);
+ }
+ return;
+}
+
+
+//=================================================================================
+// function : SetEditCurrentArgument()
+// purpose :
+//=================================================================================
+void KinematicGUI_AnimValuesDlg::SetEditCurrentArgument()
+{
+ QPushButton* send = (QPushButton*)sender();
+
+ if(send == PushButton1) {
+ LineEdit1->setFocus();
+ myEditCurrentArgument = LineEdit1;
+ }
+ SelectionIntoArgument();
+
+ return;
+}
+
+
+//=================================================================================
+// function : ActivateThisDialog()
+// purpose :
+//=================================================================================
+void KinematicGUI_AnimValuesDlg::ActivateThisDialog()
+{
+ GEOMBase_Skeleton::ActivateThisDialog();
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ this->SelectionIntoArgument();
+ return;
+}
+
+
+//=================================================================================
+// function : enterEvent()
+// purpose : when mouse enter onto the QWidget
+//=================================================================================
+void KinematicGUI_AnimValuesDlg::enterEvent(QEvent * e)
+{
+ if (GroupConstructors->isEnabled())
+ return;
+ this->ActivateThisDialog();
+ return;
+}
+
+
+//=================================================================================
+// function : ValueChangedInSpinBox()
+// purpose :
+//=================================================================================
+void KinematicGUI_AnimValuesDlg::ValueChangedInSpinBox(double newValue)
+{
+ DlgRef_SpinBox* send = (DlgRef_SpinBox*)sender();
+
+ if(myOkContact == false)
+ return;
+
+ int type = myGeomContact->GetType();
+ double step = myGeomContact->GetStep();
+ GEOM::ListOfDouble_var aAngList = myGeomContact->GetAngularRange();
+ GEOM::ListOfDouble_var aLinList = myGeomContact->GetLinearRange();
+
+ int i, j;
+ if(send == SpinBox1) {i = 0; j = 0;}
+ else if(send == SpinBox2) {i = 0; j = 1;}
+ else if(send == SpinBox3) {i = 1; j = 0;}
+ else if(send == SpinBox4) {i = 1; j = 1;}
+ else if(send == SpinBox5) {i = 2; j = 0;}
+ else if(send == SpinBox6) {i = 2; j = 1;}
+ else if(send == SpinBox7) {i = 3; j = 0;}
+ else if(send == SpinBox8) {i = 3; j = 1;}
+ else if(send == SpinBox9) {i = 4; j = 0;}
+ else if(send == SpinBox10) {i = 4; j = 1;}
+ else if(send == SpinBox11) {i = 5; j = 0;}
+ else if(send == SpinBox12) {i = 5; j = 1;}
+
+ if(newValue >= aAngList[2*i] && newValue <= aAngList[2*i+1]) {
+ myList[2*i+j] = newValue;
+ if(type == 9) {
+ if(i == 0 && j == 0)
+ SpinBox7->SetValue(newValue * step / 360);
+ else if(i == 0 && j == 1)
+ SpinBox8->SetValue(newValue * step / 360);
+ else if(i == 3 && j == 0)
+ SpinBox1->SetValue(newValue / step * 360);
+ else if(i == 3 && j == 1)
+ SpinBox2->SetValue(newValue / step * 360);
+ }
+ }
+ else
+ send->SetValue(myList[2*i+j]);
+
+ return;
+}
--- /dev/null
+// 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 : KinematicGUI_AnimValuesDlg.h
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef DIALOGBOX_ANIMVALUES_H
+#define DIALOGBOX_ANIMVALUES_H
+
+#include "GEOMBase_Skeleton.h"
+#include "DlgRef_SpinBox.h"
+
+#include "KinematicGUI.h"
+
+#include <qlistbox.h>
+
+//=================================================================================
+// class : KinematicGUI_AnimValuesDlg
+// purpose :
+//=================================================================================
+class KinematicGUI_AnimValuesDlg : public GEOMBase_Skeleton
+{
+ Q_OBJECT
+
+public:
+ KinematicGUI_AnimValuesDlg(QWidget* parent = 0, const char* name = 0, KinematicGUI* theKinematicGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
+ ~KinematicGUI_AnimValuesDlg();
+
+private:
+ void Init();
+ void enterEvent(QEvent * e);
+
+ KinematicGUI* myKinematicGUI;
+
+ GEOM::GEOM_Animation_var myGeomAnimation;
+ GEOM::GEOM_Contact_var myGeomContact;
+ GEOM::ListOfDouble_var myList;
+ bool myOkAnimation;
+ bool myOkContact;
+
+ QGroupBox* GroupBox1;
+ QLabel* TextLabel1;
+ QLabel* TextLabel2;
+ QLabel* TextLabel3;
+ QLabel* TextLabel4;
+ QLabel* TextLabel5;
+ QLabel* TextLabel6;
+ QLabel* TextLabel7;
+ QLabel* TextLabel8;
+ QLabel* TextLabel9;
+ QLabel* TextLabel10;
+ QListBox* ListBox1;
+ QLineEdit* LineEdit1;
+ QPushButton* PushButton1;
+ DlgRef_SpinBox* SpinBox1;
+ DlgRef_SpinBox* SpinBox2;
+ DlgRef_SpinBox* SpinBox3;
+ DlgRef_SpinBox* SpinBox4;
+ DlgRef_SpinBox* SpinBox5;
+ DlgRef_SpinBox* SpinBox6;
+ DlgRef_SpinBox* SpinBox7;
+ DlgRef_SpinBox* SpinBox8;
+ DlgRef_SpinBox* SpinBox9;
+ DlgRef_SpinBox* SpinBox10;
+ DlgRef_SpinBox* SpinBox11;
+ DlgRef_SpinBox* SpinBox12;
+
+private slots:
+ void ClickOnOk();
+ void ClickOnApply();
+ void SetEditCurrentArgument();
+ void SelectionIntoArgument();
+ void ActivateThisDialog();
+ void SetEnabledValues();
+ void ValueChangedInSpinBox(double newValue);
+ void ClickOnListBox(int Item);
+
+protected:
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* LayoutD;
+ QGridLayout* LayoutC;
+ QGridLayout* LayoutB;
+
+};
+
+#endif // DIALOGBOX_CONTACT_H
+++ /dev/null
-/****************************************************************************
-** Form implementation generated from reading ui file 'KinematicGUI_Anim_QTD.ui'
-**
-** Created: jeu mar 4 16:48:10 2004
-** by: The User Interface Compiler (uic)
-**
-** WARNING! All changes made in this file will be lost!
-****************************************************************************/
-#include "KinematicGUI_Anim_QTD.h"
-
-#include <qvariant.h>
-#include <qgroupbox.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qslider.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
-
-/*
- * Constructs a KinematicGUI_Anim_QTD which is a child of 'parent', with the
- * name 'name' and widget flags set to 'f'.
- */
-KinematicGUI_Anim_QTD::KinematicGUI_Anim_QTD( QWidget* parent, const char* name, WFlags fl )
- : QWidget( parent, name, fl )
-{
- if ( !name )
- setName( "KinematicGUI_Anim_QTD" );
- resize( 334, 121 );
- setCaption( trUtf8( "KinematicGUI_Anim_QTD" ) );
- KinematicGUI_Anim_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "KinematicGUI_Anim_QTDLayout");
-
- GroupBox1 = new QGroupBox( this, "GroupBox1" );
- GroupBox1->setTitle( trUtf8( "" ) );
- GroupBox1->setColumnLayout(0, Qt::Vertical );
- GroupBox1->layout()->setSpacing( 6 );
- GroupBox1->layout()->setMargin( 11 );
- GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
- GroupBox1Layout->setAlignment( Qt::AlignTop );
-
- Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
- QSpacerItem* spacer = new QSpacerItem( 0, 156, QSizePolicy::Minimum, QSizePolicy::Expanding );
- Layout1->addItem( spacer, 3, 0 );
-
- Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
-
- PushButton3 = new QPushButton( GroupBox1, "PushButton3" );
- PushButton3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton3->sizePolicy().hasHeightForWidth() ) );
- PushButton3->setText( trUtf8( "" ) );
-
- Layout2->addWidget( PushButton3, 0, 2 );
-
- PushButton5 = new QPushButton( GroupBox1, "PushButton5" );
- PushButton5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton5->sizePolicy().hasHeightForWidth() ) );
- PushButton5->setText( trUtf8( "" ) );
-
- Layout2->addWidget( PushButton5, 0, 4 );
-
- PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
- PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
- PushButton2->setText( trUtf8( "" ) );
-
- Layout2->addWidget( PushButton2, 0, 1 );
-
- PushButton4 = new QPushButton( GroupBox1, "PushButton4" );
- PushButton4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton4->sizePolicy().hasHeightForWidth() ) );
- PushButton4->setText( trUtf8( "" ) );
-
- Layout2->addWidget( PushButton4, 0, 3 );
-
- PushButton6 = new QPushButton( GroupBox1, "PushButton6" );
- PushButton6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton6->sizePolicy().hasHeightForWidth() ) );
- PushButton6->setText( trUtf8( "" ) );
-
- Layout2->addWidget( PushButton6, 0, 5 );
-
- PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
- PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
- PushButton1->setText( trUtf8( "" ) );
-
- Layout2->addWidget( PushButton1, 0, 0 );
-
- Layout1->addLayout( Layout2, 1, 0 );
-
- Slider1 = new QSlider( GroupBox1, "Slider1" );
- Slider1->setOrientation( QSlider::Horizontal );
-
- Layout1->addWidget( Slider1, 0, 0 );
-
- Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3");
-
- CheckButton1 = new QRadioButton( GroupBox1, "CheckButton1" );
- CheckButton1->setText( trUtf8( "" ) );
-
- Layout3->addWidget( CheckButton1, 0, 0 );
-
- PushButton7 = new QPushButton( GroupBox1, "PushButton7" );
- PushButton7->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton7->sizePolicy().hasHeightForWidth() ) );
- PushButton7->setText( trUtf8( "" ) );
-
- Layout3->addWidget( PushButton7, 0, 2 );
-
- CheckButton2 = new QRadioButton( GroupBox1, "CheckButton2" );
- CheckButton2->setText( trUtf8( "" ) );
-
- Layout3->addWidget( CheckButton2, 0, 1 );
-
- Layout1->addLayout( Layout3, 2, 0 );
-
- GroupBox1Layout->addLayout( Layout1, 0, 0 );
-
- KinematicGUI_Anim_QTDLayout->addWidget( GroupBox1, 0, 0 );
-}
-
-/*
- * Destroys the object and frees any allocated resources
- */
-KinematicGUI_Anim_QTD::~KinematicGUI_Anim_QTD()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
+++ /dev/null
-/****************************************************************************
-** Form interface generated from reading ui file 'KinematicGUI_Anim_QTD.ui'
-**
-** Created: jeu mar 4 16:48:10 2004
-** by: The User Interface Compiler (uic)
-**
-** WARNING! All changes made in this file will be lost!
-****************************************************************************/
-#ifndef KINEMATICGUI_ANIM_QTD_H
-#define KINEMATICGUI_ANIM_QTD_H
-
-#include <qvariant.h>
-#include <qwidget.h>
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
-class QGroupBox;
-class QPushButton;
-class QRadioButton;
-class QSlider;
-
-class KinematicGUI_Anim_QTD : public QWidget
-{
- Q_OBJECT
-
-public:
- KinematicGUI_Anim_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
- ~KinematicGUI_Anim_QTD();
-
- QGroupBox* GroupBox1;
- QPushButton* PushButton3;
- QPushButton* PushButton5;
- QPushButton* PushButton2;
- QPushButton* PushButton4;
- QPushButton* PushButton6;
- QPushButton* PushButton1;
- QSlider* Slider1;
- QRadioButton* CheckButton1;
- QPushButton* PushButton7;
- QRadioButton* CheckButton2;
-
-
-protected:
- QGridLayout* KinematicGUI_Anim_QTDLayout;
- QGridLayout* GroupBox1Layout;
- QGridLayout* Layout1;
- QGridLayout* Layout2;
- QGridLayout* Layout3;
-};
-
-#endif // KINEMATICGUI_ANIM_QTD_H
// Module : GEOM
// $Header:
-using namespace std;
#include "KinematicGUI_AnimationDlg.h"
+using namespace std;
+
//=================================================================================
// class : KinematicGUI_AnimationDlg()
// purpose : Constructs a KinematicGUI_AnimationDlg which is a child of 'parent', with the
//=================================================================================
void KinematicGUI_AnimationDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkAssembly && myOkShape1)
if(send == Group1->SpinBox_DX)
myDuration = newValue;
else if(send == Group1->SpinBox_DY)
- myNbSeq = newValue;
+ myNbSeq = int(newValue);
return;
}
bool myOkAssembly;
bool myOkShape1; /* to check when arguments are defined */
double myDuration;
- int myNbSeq;
+ int myNbSeq;
DlgRef_2Sel2Spin* Group1;
// Module : GEOM
// $Header:
-using namespace std;
#include "KinematicGUI_ContactDlg.h"
+using namespace std;
+
//=================================================================================
// class : KinematicGUI_ContactDlg()
// purpose : Constructs a KinematicGUI_ContactDlg which is a child of 'parent', with the
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-KinematicGUI_ContactDlg::KinematicGUI_ContactDlg(QWidget* parent, const char* name, KinematicGUI* theKinematicGUI, SALOME_Selection* Sel, int type, bool modal, WFlags fl)
+KinematicGUI_ContactDlg::KinematicGUI_ContactDlg(QWidget* parent, const char* name, KinematicGUI* theKinematicGUI, SALOME_Selection* Sel, bool modal, WFlags fl)
:GEOMBase_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_CONTACT")));
RadioButton2->close(TRUE);
RadioButton3->close(TRUE);
- Group1 = new KinematicGUI_3Sel1List_QTD(this, "Group1");
- Group1->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
- Group1->TextLabel1->setText(tr("GEOM_ASSEMBLY"));
- Group1->TextLabel2->setText(tr("GEOM_TYPE"));
- Group1->TextLabel3->setText(tr("GEOM_OBJECT_I").arg("1"));
- Group1->TextLabel4->setText(tr("GEOM_OBJECT_I").arg("2"));
- Group1->PushButton1->setPixmap(image1);
- Group1->PushButton2->setPixmap(image1);
- Group1->PushButton3->setPixmap(image1);
-
- Layout1->addWidget(Group1, 1, 0);
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setTitle( trUtf8( "" ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+ LayoutA = new QGridLayout( 0, 1, 1, 0, 6, "LayoutA");
+
+ LineEdit3 = new QLineEdit( GroupBox1, "LineEdit3" );
+
+ LayoutA->addWidget( LineEdit3, 3, 2 );
+
+ TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
+ TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
+ TextLabel4->setText( trUtf8( "TL4" ) );
+
+ LayoutA->addWidget( TextLabel4, 3, 0 );
+
+ LayoutB = new QGridLayout( 0, 1, 1, 0, 6, "LayoutB");
+
+ TextLabel5 = new QLabel( GroupBox1, "TextLabel5" );
+ TextLabel5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel5->sizePolicy().hasHeightForWidth() ) );
+ TextLabel5->setText( trUtf8( "TL5" ) );
+
+ LayoutB->addWidget( TextLabel5, 0, 0 );
+
+ SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
+ LayoutB->addWidget( SpinBox_DX, 0, 1 );
+
+ LayoutA->addMultiCellLayout( LayoutB, 4, 4, 0, 2 );
+
+ PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
+ PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
+ PushButton2->setText( trUtf8( "" ) );
+
+ LayoutA->addWidget( PushButton2, 2, 1 );
+
+ LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
+
+ LayoutA->addWidget( LineEdit1, 0, 2 );
+
+ PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
+ PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
+ PushButton1->setText( trUtf8( "" ) );
+
+ LayoutA->addWidget( PushButton1, 0, 1 );
+
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
+
+ LayoutA->addWidget( TextLabel1, 0, 0 );
+
+ LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
+
+ LayoutA->addWidget( LineEdit2, 2, 2 );
+
+ TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
+ TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
+ TextLabel3->setText( trUtf8( "TL3" ) );
+
+ LayoutA->addWidget( TextLabel3, 2, 0 );
+
+ LayoutB = new QGridLayout( 0, 1, 1, 0, 6, "LayoutB");
+
+ TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
+ TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
+ TextLabel2->setText( trUtf8( "TL2" ) );
+
+ LayoutB->addWidget( TextLabel2, 0, 0 );
+
+ ComboBox1 = new QComboBox( FALSE, GroupBox1, "ComboBox1" );
+ ComboBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, ComboBox1->sizePolicy().hasHeightForWidth() ) );
+
+ LayoutB->addWidget( ComboBox1, 0, 1 );
+
+ LayoutA->addMultiCellLayout( LayoutB, 1, 1, 0, 2 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 90, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ LayoutA->addItem( spacer, 5, 2 );
+
+ PushButton3 = new QPushButton( GroupBox1, "PushButton3" );
+ PushButton3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton3->sizePolicy().hasHeightForWidth() ) );
+ PushButton3->setText( trUtf8( "" ) );
+
+ LayoutA->addWidget( PushButton3, 3, 1 );
+
+ GroupBox1Layout->addLayout( LayoutA, 0, 0 );
+
+ GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
+ TextLabel1->setText(tr("GEOM_ASSEMBLY"));
+ TextLabel2->setText(tr("GEOM_TYPE"));
+ TextLabel3->setText(tr("GEOM_OBJECT_I").arg("1"));
+ TextLabel4->setText(tr("GEOM_OBJECT_I").arg("2"));
+ TextLabel5->setText(tr("GEOM_STEP"));
+ PushButton1->setPixmap(image1);
+ PushButton2->setPixmap(image1);
+ PushButton3->setPixmap(image1);
+
+ Layout1->addWidget(GroupBox1, 1, 0);
/***************************************************************/
/* Initialisation */
myKinematicGUI = theKinematicGUI;
- myType = type;
Init();
}
void KinematicGUI_ContactDlg::Init()
{
/* init variables */
- myEditCurrentArgument = Group1->LineEdit1;
+ myEditCurrentArgument = LineEdit1;
myOkAssembly = myOkShape1 = myOkShape2 = false;
+ myType = 0;
+ myStep = 0.0;
+
+ /* min, max, step and decimals for spin boxes & initial values */
+ SpinBox_DX->RangeStepAndValidator(0.0, 999.999, 0.1, 3);
+ SpinBox_DX->SetValue(myStep);
+ SpinBox_DX->setEnabled(false);
/* type for sub shape selection */
- Group1->ComboBox1->insertItem("Embedding");
- Group1->ComboBox1->insertItem("Pivot");
- Group1->ComboBox1->insertItem("Slide");
- Group1->ComboBox1->insertItem("Sliding Pivot");
- Group1->ComboBox1->insertItem("Spherical");
- Group1->ComboBox1->insertItem("Plane");
- Group1->ComboBox1->insertItem("Annular");
- Group1->ComboBox1->insertItem("Rectilinear");
- Group1->ComboBox1->insertItem("Ponctual");
-
- Group1->ComboBox1->setCurrentItem(myType);
+ ComboBox1->insertItem("Embedding");
+ ComboBox1->insertItem("Pivot");
+ ComboBox1->insertItem("Slide");
+ ComboBox1->insertItem("Sliding Pivot");
+ ComboBox1->insertItem("Spherical");
+ ComboBox1->insertItem("Plane");
+ ComboBox1->insertItem("Annular");
+ ComboBox1->insertItem("Rectilinear");
+ ComboBox1->insertItem("Ponctual");
+ ComboBox1->insertItem("Helicoidal");
+
+ ComboBox1->setCurrentItem(myType);
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
- connect(Group1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(Group1->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(Group1->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect(LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect(LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect(LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(Group1->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(Group1->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(Group1->ComboBox1, SIGNAL(activated(int)), this, SLOT(ComboTextChanged()));
+ connect(SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), SpinBox_DX, SLOT(SetStep(double)));
+
+ connect(ComboBox1, SIGNAL(activated(int)), this, SLOT(ComboTextChanged()));
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* displays Dialog */
- Group1->show();
+ this->SelectionIntoArgument();
this->show();
return;
//=================================================================================
void KinematicGUI_ContactDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkAssembly && myOkShape1 && myOkShape2)
- myKinematicGUI->AddContact(myGeomAssembly, myGeomShape1, myGeomShape2, myType);
+ myKinematicGUI->AddContact(myGeomAssembly, myGeomShape1, myGeomShape2, myType, myStep);
return;
}
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
if(nbSel != 1) {
- if(myEditCurrentArgument == Group1->LineEdit1)
+ if(myEditCurrentArgument == LineEdit1)
myOkAssembly = false;
- else if( myEditCurrentArgument == Group1->LineEdit2)
+ else if( myEditCurrentArgument == LineEdit2)
myOkShape1 = false;
- else if( myEditCurrentArgument == Group1->LineEdit3)
+ else if( myEditCurrentArgument == LineEdit3)
myOkShape2 = false;
return;
}
Standard_Boolean testResult;
Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
- if(myEditCurrentArgument == Group1->LineEdit1) {
+ if(myEditCurrentArgument == LineEdit1) {
myGeomAssembly = myGeomBase->ConvertIOinAssembly(IO, testResult);
if(!testResult)
return;
- Group1->LineEdit1->setText(aString);
+ LineEdit1->setText(aString);
myOkAssembly = true;
}
else {
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
return;
- if(myEditCurrentArgument == Group1->LineEdit2) {
+ if(myEditCurrentArgument == LineEdit2) {
myGeomShape1 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult)
return;
- Group1->LineEdit2->setText(aString);
+ LineEdit2->setText(aString);
myOkShape1 = true;
}
- else if(myEditCurrentArgument == Group1->LineEdit3) {
+ else if(myEditCurrentArgument == LineEdit3) {
myGeomShape2 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult)
return;
- Group1->LineEdit3->setText(aString);
+ LineEdit3->setText(aString);
myOkShape2 = true;
}
}
{
QPushButton* send = (QPushButton*)sender();
- if(send == Group1->PushButton1) {
- Group1->LineEdit1->setFocus();
- myEditCurrentArgument = Group1->LineEdit1;
+ if(send == PushButton1) {
+ LineEdit1->setFocus();
+ myEditCurrentArgument = LineEdit1;
}
- else if(send == Group1->PushButton2) {
- Group1->LineEdit2->setFocus();
- myEditCurrentArgument = Group1->LineEdit2;
+ else if(send == PushButton2) {
+ LineEdit2->setFocus();
+ myEditCurrentArgument = LineEdit2;
}
- else if(send == Group1->PushButton3) {
- Group1->LineEdit3->setFocus();
- myEditCurrentArgument = Group1->LineEdit3;
+ else if(send == PushButton3) {
+ LineEdit3->setFocus();
+ myEditCurrentArgument = LineEdit3;
}
SelectionIntoArgument();
void KinematicGUI_ContactDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
- if(send == Group1->LineEdit1)
- myEditCurrentArgument = Group1->LineEdit1;
- else if(send == Group1->LineEdit2)
- myEditCurrentArgument = Group1->LineEdit2;
- else if(send == Group1->LineEdit3)
- myEditCurrentArgument = Group1->LineEdit3;
+ if(send == LineEdit1)
+ myEditCurrentArgument = LineEdit1;
+ else if(send == LineEdit2)
+ myEditCurrentArgument = LineEdit2;
+ else if(send == LineEdit3)
+ myEditCurrentArgument = LineEdit3;
else
return;
//=================================================================================
void KinematicGUI_ContactDlg::ComboTextChanged()
{
- myType = Group1->ComboBox1->currentItem();
+ myType = ComboBox1->currentItem();
+ if(myType == 9) {
+ SpinBox_DX->SetValue(1.0);
+ SpinBox_DX->setEnabled(true);
+ }
+ else {
+ SpinBox_DX->SetValue(0.0);
+ SpinBox_DX->setEnabled(false);
+ }
+
+ return;
+}
+
+
+//=================================================================================
+// function : ValueChangedInSpinBox()
+// purpose :
+//=================================================================================
+void KinematicGUI_ContactDlg::ValueChangedInSpinBox(double newValue)
+{
+ myStep = newValue;
return;
}
#define DIALOGBOX_CONTACT_H
#include "GEOMBase_Skeleton.h"
-#include "KinematicGUI_3Sel1List_QTD.h"
+#include "DlgRef_SpinBox.h"
#include "KinematicGUI.h"
Q_OBJECT
public:
- KinematicGUI_ContactDlg(QWidget* parent = 0, const char* name = 0, KinematicGUI* theKinematicGUI = 0, SALOME_Selection* Sel = 0, int type = 0, bool modal = FALSE, WFlags fl = 0);
+ KinematicGUI_ContactDlg(QWidget* parent = 0, const char* name = 0, KinematicGUI* theKinematicGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
~KinematicGUI_ContactDlg();
private:
bool myOkShape1;
bool myOkShape2; /* to check when arguments are defined */
int myType;
+ double myStep;
+
+ QGroupBox* GroupBox1;
+ QLabel* TextLabel1;
+ QLabel* TextLabel3;
+ QLabel* TextLabel2;
+ QLabel* TextLabel4;
+ QLabel* TextLabel5;
+ QPushButton* PushButton1;
+ QPushButton* PushButton2;
+ QPushButton* PushButton3;
+ QLineEdit* LineEdit1;
+ QLineEdit* LineEdit2;
+ QLineEdit* LineEdit3;
+ QComboBox* ComboBox1;
+ DlgRef_SpinBox* SpinBox_DX;
- KinematicGUI_3Sel1List_QTD* Group1;
private slots:
void ClickOnOk();
void LineEditReturnPressed();
void ActivateThisDialog();
void ComboTextChanged();
+ void ValueChangedInSpinBox(double newValue);
+
+protected:
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* LayoutA;
+ QGridLayout* LayoutB;
+ QGridLayout* LayoutC;
};
+++ /dev/null
-// 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 : KinematicGUI_ContactHDlg.cxx
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header:
-
-using namespace std;
-#include "KinematicGUI_ContactHDlg.h"
-
-//=================================================================================
-// class : KinematicGUI_ContactHDlg()
-// purpose : Constructs a KinematicGUI_ContactHDlg 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.
-//=================================================================================
-KinematicGUI_ContactHDlg::KinematicGUI_ContactHDlg(QWidget* parent, const char* name, KinematicGUI* theKinematicGUI, SALOME_Selection* Sel, bool modal, WFlags fl)
- :GEOMBase_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
-{
- QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_CONTACT")));
- QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
-
- setCaption(tr("GEOM_CONTACT_TITLE"));
-
- /***************************************************************/
- GroupConstructors->setTitle(tr("GEOM_CONTACT"));
- RadioButton1->setPixmap(image0);
- RadioButton2->close(TRUE);
- RadioButton3->close(TRUE);
-
- Group1 = new KinematicGUI_3Sel1Spin(this, "Group1");
- Group1->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
- Group1->TextLabel1->setText(tr("GEOM_ASSEMBLY"));
- Group1->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("1"));
- Group1->TextLabel3->setText(tr("GEOM_OBJECT_I").arg("2"));
- Group1->TextLabel4->setText(tr("GEOM_STEP"));
- Group1->PushButton1->setPixmap(image1);
- Group1->PushButton2->setPixmap(image1);
- Group1->PushButton3->setPixmap(image1);
-
- Layout1->addWidget(Group1, 1, 0);
- /***************************************************************/
-
- /* Initialisation */
- myKinematicGUI = theKinematicGUI;
- Init();
-}
-
-
-//=================================================================================
-// function : ~KinematicGUI_ContactHDlg()
-// purpose : Destroys the object and frees any allocated resources
-//=================================================================================
-KinematicGUI_ContactHDlg::~KinematicGUI_ContactHDlg()
-{
- /* no need to delete child widgets, Qt does it all for us */
-}
-
-
-
-//=================================================================================
-// function : Init()
-// purpose :
-//=================================================================================
-void KinematicGUI_ContactHDlg::Init()
-{
- /* init variables */
- myEditCurrentArgument = Group1->LineEdit1;
- myOkAssembly = myOkShape1 = myOkShape2 = false;
-
- myStep = 1.0;
- /* min, max, step and decimals for spin boxes & initial values */
- Group1->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, 0.1, 3);
- Group1->SpinBox_DX->SetValue(myStep);
-
- /* signals and slots connections */
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
-
- connect(Group1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(Group1->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(Group1->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
-
- connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(Group1->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(Group1->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-
- connect(Group1->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DX, SLOT(SetStep(double)));
-
- connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-
- /* displays Dialog */
- Group1->show();
- this->show();
-
- return;
-}
-
-
-//=================================================================================
-// function : ClickOnOk()
-// purpose :
-//=================================================================================
-void KinematicGUI_ContactHDlg::ClickOnOk()
-{
- this->ClickOnApply();
- ClickOnCancel();
- return ;
-}
-
-
-//=================================================================================
-// function : ClickOnApply()
-// purpose :
-//=================================================================================
-void KinematicGUI_ContactHDlg::ClickOnApply()
-{
- QAD_Application::getDesktop()->putInfo(tr(""));
-
- if(myOkAssembly && myOkShape1 && myOkShape2)
- myKinematicGUI->AddContact(myGeomAssembly, myGeomShape1, myGeomShape2, 9, myStep);
-
- return;
-}
-
-
-//=================================================================================
-// function : SelectionIntoArgument()
-// purpose : Called when selection has changed
-//=================================================================================
-void KinematicGUI_ContactHDlg::SelectionIntoArgument()
-{
- myEditCurrentArgument->setText("");
- QString aString = "";
-
- int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
- if(nbSel != 1) {
- if(myEditCurrentArgument == Group1->LineEdit1)
- myOkAssembly = false;
- else if( myEditCurrentArgument == Group1->LineEdit2)
- myOkShape1 = false;
- else if( myEditCurrentArgument == Group1->LineEdit3)
- myOkShape2 = false;
- return;
- }
-
- /* nbSel == 1 */
- Standard_Boolean testResult;
- Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
-
- if(myEditCurrentArgument == Group1->LineEdit1) {
- myGeomAssembly = myGeomBase->ConvertIOinAssembly(IO, testResult);
- if(!testResult)
- return;
- Group1->LineEdit1->setText(aString);
- myOkAssembly = true;
- }
- else {
- TopoDS_Shape S;
- if(!myGeomBase->GetTopoFromSelection(mySelection, S))
- return;
-
- if(myEditCurrentArgument == Group1->LineEdit2) {
- myGeomShape1 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
- if(!testResult)
- return;
- Group1->LineEdit2->setText(aString);
- myOkShape1 = true;
- }
- else if(myEditCurrentArgument == Group1->LineEdit3) {
- myGeomShape2 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
- if(!testResult)
- return;
- Group1->LineEdit3->setText(aString);
- myOkShape2 = true;
- }
- }
- return;
-}
-
-
-//=================================================================================
-// function : SetEditCurrentArgument()
-// purpose :
-//=================================================================================
-void KinematicGUI_ContactHDlg::SetEditCurrentArgument()
-{
- QPushButton* send = (QPushButton*)sender();
-
- if(send == Group1->PushButton1) {
- Group1->LineEdit1->setFocus();
- myEditCurrentArgument = Group1->LineEdit1;
- }
- else if(send == Group1->PushButton2) {
- Group1->LineEdit2->setFocus();
- myEditCurrentArgument = Group1->LineEdit2;
- }
- else if(send == Group1->PushButton3) {
- Group1->LineEdit3->setFocus();
- myEditCurrentArgument = Group1->LineEdit3;
- }
- SelectionIntoArgument();
-
- return;
-}
-
-
-
-//=================================================================================
-// function : LineEditReturnPressed()
-// purpose :
-//=================================================================================
-void KinematicGUI_ContactHDlg::LineEditReturnPressed()
-{
- QLineEdit* send = (QLineEdit*)sender();
- if(send == Group1->LineEdit1)
- myEditCurrentArgument = Group1->LineEdit1;
- else if(send == Group1->LineEdit2)
- myEditCurrentArgument = Group1->LineEdit2;
- else if(send == Group1->LineEdit3)
- myEditCurrentArgument = Group1->LineEdit3;
- else
- return;
-
- GEOMBase_Skeleton::LineEditReturnPressed();
- return;
-}
-
-
-//=================================================================================
-// function : ActivateThisDialog()
-// purpose :
-//=================================================================================
-void KinematicGUI_ContactHDlg::ActivateThisDialog()
-{
- GEOMBase_Skeleton::ActivateThisDialog();
- connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
- return;
-}
-
-
-//=================================================================================
-// function : enterEvent()
-// purpose : when mouse enter onto the QWidget
-//=================================================================================
-void KinematicGUI_ContactHDlg::enterEvent(QEvent * e)
-{
- if (GroupConstructors->isEnabled())
- return;
- this->ActivateThisDialog();
- return;
-}
-
-
-//=================================================================================
-// function : ValueChangedInSpinBox()
-// purpose :
-//=================================================================================
-void KinematicGUI_ContactHDlg::ValueChangedInSpinBox(double newValue)
-{
- myStep = newValue;
- return;
-}
+++ /dev/null
-// 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 : KinematicGUI_ContactHDlg.h
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header:
-
-#ifndef DIALOGBOX_CONTACTH_H
-#define DIALOGBOX_CONTACTH_H
-
-#include "GEOMBase_Skeleton.h"
-#include "KinematicGUI_3Sel1Spin.h"
-
-#include "KinematicGUI.h"
-
-//=================================================================================
-// class : KinematicGUI_ContactHDlg
-// purpose :
-//=================================================================================
-class KinematicGUI_ContactHDlg : public GEOMBase_Skeleton
-{
- Q_OBJECT
-
-public:
- KinematicGUI_ContactHDlg(QWidget* parent = 0, const char* name = 0, KinematicGUI* theKinematicGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
- ~KinematicGUI_ContactHDlg();
-
-private:
- void Init();
- void enterEvent(QEvent * e);
-
- KinematicGUI* myKinematicGUI;
-
- GEOM::GEOM_Assembly_var myGeomAssembly;
- GEOM::GEOM_Shape_var myGeomShape1; /* is myShape1 */
- GEOM::GEOM_Shape_var myGeomShape2; /* is myShape2 */
- bool myOkAssembly;
- bool myOkShape1;
- bool myOkShape2; /* to check when arguments are defined */
- double myStep;
-
- KinematicGUI_3Sel1Spin* Group1;
-
-private slots:
- void ClickOnOk();
- void ClickOnApply();
- void SetEditCurrentArgument();
- void SelectionIntoArgument();
- void LineEditReturnPressed();
- void ActivateThisDialog();
- void ValueChangedInSpinBox(double newValue);
-
-};
-
-#endif // DIALOGBOX_CONTACT_H
if(!testResult)
ClickOnCancel();
- myGeomPosition = GEOM::GEOM_Position::_narrow(myGeomContact->GetPosition());
-
- P0 = myGeomPosition->GetOrigin();
- VX = myGeomPosition->GetVX();
- VY = myGeomPosition->GetVY();
- VZ = myGeomPosition->GetVZ();
+ GEOM::ListOfDouble_var aList = myGeomContact->GetPosition();
+
+ P0.x = aList[0];
+ P0.y = aList[1];
+ P0.z = aList[2];
+ VX.PS.x = aList[3];
+ VX.PS.y = aList[4];
+ VX.PS.z = aList[5];
+ VY.PS.x = aList[6];
+ VY.PS.y = aList[7];
+ VY.PS.z = aList[8];
+ VZ.PS.x = aList[9];
+ VZ.PS.y = aList[10];
+ VZ.PS.z = aList[11];
Group1->SpinBox_11->SetValue(P0.x);
Group1->SpinBox_12->SetValue(P0.y);
//=================================================================================
-// function : InitValues()
+// function : SetEnabledValues()
// purpose :
//=================================================================================
void KinematicGUI_PositionDlg::SetEnabledValues()
int type = myGeomContact->GetType();
if(type == 0) { //EMBEDDING
- Group1->SpinBox_21->setEnabled(false);
- Group1->SpinBox_22->setEnabled(false);
- Group1->SpinBox_23->setEnabled(false);
- Group1->SpinBox_31->setEnabled(false);
- Group1->SpinBox_32->setEnabled(false);
- Group1->SpinBox_33->setEnabled(false);
- Group1->SpinBox_41->setEnabled(false);
- Group1->SpinBox_42->setEnabled(false);
- Group1->SpinBox_43->setEnabled(false);
- Group1->TextLabel5->setEnabled(false);
- Group1->TextLabel6->setEnabled(false);
- Group1->TextLabel7->setEnabled(false);
- Group1->TextLabel8->setEnabled(false);
- Group1->TextLabel9->setEnabled(false);
- Group1->TextLabel10->setEnabled(false);
- Group1->TextLabel11->setEnabled(false);
- Group1->TextLabel12->setEnabled(false);
- Group1->TextLabel13->setEnabled(false);
- Group1->TextLabel14->setEnabled(false);
- Group1->TextLabel15->setEnabled(false);
- Group1->TextLabel16->setEnabled(false);
+ Group1->SpinBox_21->hide();
+ Group1->SpinBox_22->hide();
+ Group1->SpinBox_23->hide();
+ Group1->TextLabel5->hide();
+ Group1->TextLabel6->hide();
+ Group1->TextLabel7->hide();
+ Group1->TextLabel8->hide();
}
- else if(type == 1 || type == 3 || type == 5 || type == 9) { //PIVOT || SLIDING PIVOT || PLANE || HELICOIDAL
- Group1->SpinBox_31->setEnabled(false);
- Group1->SpinBox_32->setEnabled(false);
- Group1->SpinBox_33->setEnabled(false);
- Group1->SpinBox_41->setEnabled(false);
- Group1->SpinBox_42->setEnabled(false);
- Group1->SpinBox_43->setEnabled(false);
- Group1->TextLabel9->setEnabled(false);
- Group1->TextLabel10->setEnabled(false);
- Group1->TextLabel11->setEnabled(false);
- Group1->TextLabel12->setEnabled(false);
- Group1->TextLabel13->setEnabled(false);
- Group1->TextLabel14->setEnabled(false);
- Group1->TextLabel15->setEnabled(false);
- Group1->TextLabel16->setEnabled(false);
+
+ if(type == 0 || type == 1 || type == 3 || type == 5 || type == 9) { //EMBEDDING || PIVOT || SLIDING PIVOT || PLANE || HELICOIDAL
+ Group1->SpinBox_31->hide();
+ Group1->SpinBox_32->hide();
+ Group1->SpinBox_33->hide();
+ Group1->TextLabel9->hide();
+ Group1->TextLabel10->hide();
+ Group1->TextLabel11->hide();
+ Group1->TextLabel12->hide();
}
- else if(type == 7) { //RECTILINEAR
- Group1->SpinBox_41->setEnabled(false);
- Group1->SpinBox_42->setEnabled(false);
- Group1->SpinBox_43->setEnabled(false);
- Group1->TextLabel13->setEnabled(false);
- Group1->TextLabel14->setEnabled(false);
- Group1->TextLabel15->setEnabled(false);
- Group1->TextLabel16->setEnabled(false);
+
+ if(type == 0 || type == 1 || type == 3 || type == 5 || type == 7 || type == 9) { //EMBEDDING || PIVOT || SLIDING PIVOT || PLANE || RECTILINEAR || HELICOIDAL
+ Group1->SpinBox_41->hide();
+ Group1->SpinBox_42->hide();
+ Group1->SpinBox_43->hide();
+ Group1->TextLabel13->hide();
+ Group1->TextLabel14->hide();
+ Group1->TextLabel15->hide();
+ Group1->TextLabel16->hide();
}
return;
KinematicGUI* myKinematicGUI;
GEOM::GEOM_Contact_var myGeomContact;
- GEOM::GEOM_Position_var myGeomPosition;
GEOM::PointStruct P0;
GEOM::DirStruct VX;
--- /dev/null
+// 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 : KinematicGUI_RangeDlg.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#include "KinematicGUI_RangeDlg.h"
+
+using namespace std;
+
+//=================================================================================
+// class : KinematicGUI_RangeDlg()
+// purpose : Constructs a KinematicGUI_RangeDlg 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.
+//=================================================================================
+KinematicGUI_RangeDlg::KinematicGUI_RangeDlg(QWidget* parent, const char* name, KinematicGUI* theKinematicGUI, SALOME_Selection* Sel, int type, bool modal, WFlags fl)
+ :GEOMBase_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+{
+ QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
+
+ setCaption(tr("GEOM_RANGE_TITLE"));
+
+ /***************************************************************/
+ if(type == 0)
+ GroupConstructors->setTitle(tr("GEOM_ANG_RANGE"));
+ else if(type == 1)
+ GroupConstructors->setTitle(tr("GEOM_LIN_RANGE"));
+ RadioButton1->setText(tr("GEOM_RANGE_X"));
+ RadioButton2->setText(tr("GEOM_RANGE_Y"));
+ RadioButton3->setText(tr("GEOM_RANGE_Z"));
+
+ Group1 = new DlgRef_1Sel2Spin(this, "Group1");
+ Group1->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
+ Group1->TextLabel1->setText(tr("GEOM_CONTACT"));
+ Group1->TextLabel2->setText(tr("GEOM_MIN"));
+ Group1->TextLabel3->setText(tr("GEOM_MAX"));
+ Group1->PushButton1->setPixmap(image0);
+
+ Layout1->addWidget(Group1, 1, 0);
+ /***************************************************************/
+
+ /* Initialisation */
+ myType = type;
+ myKinematicGUI = theKinematicGUI;
+ Init();
+}
+
+
+//=================================================================================
+// function : ~KinematicGUI_RangeDlg()
+// purpose : Destroys the object and frees any allocated resources
+//=================================================================================
+KinematicGUI_RangeDlg::~KinematicGUI_RangeDlg()
+{
+ /* no need to delete child widgets, Qt does it all for us */
+}
+
+
+
+//=================================================================================
+// function : Init()
+// purpose :
+//=================================================================================
+void KinematicGUI_RangeDlg::Init()
+{
+ /* init variables */
+ myConstructorId = 0;
+ myEditCurrentArgument = Group1->LineEdit1;
+ myOkShape = false;
+
+ myMinValX = 0.0;
+ myMaxValX = 0.0;
+ myMinValY = 0.0;
+ myMaxValY = 0.0;
+ myMinValZ = 0.0;
+ myMaxValZ = 0.0;
+
+ double step = 5.0;
+ Group1->SpinBox_DX->RangeStepAndValidator(-99999.999, 99999.999, step, 3);
+ Group1->SpinBox_DY->RangeStepAndValidator(-99999.999, 99999.999, step, 3);
+
+ Group1->SpinBox_DX->SetValue(myMinValX);
+ Group1->SpinBox_DY->SetValue(myMaxValX);
+
+ /* signals and slots connections */
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
+
+ connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(Group1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+
+ connect(Group1->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group1->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DX, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DY, SLOT(SetStep(double)));
+
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
+ /* displays Dialog */
+ this->SelectionIntoArgument();
+ Group1->show();
+ this->show();
+
+ return;
+}
+
+
+//=================================================================================
+// function : SetEnabledValues()
+// purpose :
+//=================================================================================
+void KinematicGUI_RangeDlg::SetEnabledValues()
+{
+ bool IsOk = true;
+ int aType = myGeomContact->GetType();
+
+ GEOM::ListOfDouble_var aList;
+ if(myType == 0) /* Angular */
+ aList = myGeomContact->GetAngularRange();
+ else if(myType == 1) /* Linear */
+ aList = myGeomContact->GetLinearRange();
+
+ myMinValX = aList[0];
+ myMaxValX = aList[1];
+ myMinValY = aList[2];
+ myMaxValY = aList[3];
+ myMinValZ = aList[4];
+ myMaxValZ = aList[5];
+
+ if(myConstructorId == 0) { // X
+ Group1->SpinBox_DX->SetValue(aList[0]);
+ Group1->SpinBox_DY->SetValue(aList[1]);
+ }
+ else if(myConstructorId == 1) { // Y
+ Group1->SpinBox_DX->SetValue(aList[2]);
+ Group1->SpinBox_DY->SetValue(aList[3]);
+ }
+ else if(myConstructorId == 2) { // Z
+ Group1->SpinBox_DX->SetValue(aList[4]);
+ Group1->SpinBox_DY->SetValue(aList[5]);
+ }
+
+ if(myType == 0) { //ANGULAR
+ if(myConstructorId == 0 && (aType == 2 || aType == 5)) // X
+ IsOk = false;
+ else if(myConstructorId == 1 && (aType == 1 || aType == 2 || aType == 3 || aType == 5 || aType == 7 || aType == 9)) // Y
+ IsOk = false;
+ else if(myConstructorId == 2 && (aType == 1 || aType == 2 || aType == 3 || aType == 9)) // Z
+ IsOk = false;
+ }
+ else if(myType == 1) { //LINEAR
+ if(myConstructorId == 0 && (aType == 1 || aType == 4 || aType == 8)) // X
+ IsOk = false;
+ else if(myConstructorId == 1 && (aType == 1 || aType == 2 || aType == 3 || aType == 4 || aType == 6 || aType == 9)) // Y
+ IsOk = false;
+ else if(myConstructorId == 2 && (aType == 1 || aType == 2 || aType == 3 || aType == 4 || aType == 5 || aType == 6 || aType == 7 || aType == 9)) // Z
+ IsOk = false;
+ }
+
+ if(aType == 0)
+ IsOk = false;
+
+ Group1->TextLabel2->setEnabled(IsOk);
+ Group1->TextLabel3->setEnabled(IsOk);
+ Group1->SpinBox_DX->setEnabled(IsOk);
+ Group1->SpinBox_DY->setEnabled(IsOk);
+
+ return;
+}
+
+
+//=================================================================================
+// function : ConstructorsClicked()
+// purpose : Radio button management
+//=================================================================================
+void KinematicGUI_RangeDlg::ConstructorsClicked(int constructorId)
+{
+ myConstructorId = constructorId;
+ this->SelectionIntoArgument();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnOk()
+// purpose :
+//=================================================================================
+void KinematicGUI_RangeDlg::ClickOnOk()
+{
+ this->ClickOnApply();
+ ClickOnCancel();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnApply()
+// purpose :
+//=================================================================================
+void KinematicGUI_RangeDlg::ClickOnApply()
+{
+ buttonApply->setFocus();
+ QAD_Application::getDesktop()->putInfo(tr(""));
+
+ if(myType == 0 && myOkShape) /* Angular */
+ myKinematicGUI->SetAngularRange(myGeomContact, myMinValX, myMaxValX,
+ myMinValY, myMaxValY, myMinValZ, myMaxValZ);
+ else if(myType == 1 && myOkShape) /* Linear */
+ myKinematicGUI->SetLinearRange(myGeomContact, myMinValX, myMaxValX,
+ myMinValY, myMaxValY, myMinValZ, myMaxValZ);
+
+ return;
+}
+
+
+//=================================================================================
+// function : SelectionIntoArgument()
+// purpose : Called when selection has changed
+//=================================================================================
+void KinematicGUI_RangeDlg::SelectionIntoArgument()
+{
+ myEditCurrentArgument->setText("");
+ QString aString = ""; /* name of selection */
+
+ myMinValX = 0.0;
+ myMaxValX = 0.0;
+ myMinValY = 0.0;
+ myMaxValY = 0.0;
+ myMinValZ = 0.0;
+ myMaxValZ = 0.0;
+ Group1->SpinBox_DX->SetValue(0.0);
+ Group1->SpinBox_DY->SetValue(0.0);
+
+ int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
+ if(nbSel != 1) {
+ myOkShape = false;
+ return;
+ }
+
+ /* nbSel == 1 */
+ Standard_Boolean testResult;
+ Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
+
+ myGeomContact = myGeomBase->ConvertIOinContact(IO, testResult);
+ if(!testResult)
+ return;
+
+ Group1->LineEdit1->setText(aString);
+ myOkShape = true;
+ this->SetEnabledValues();
+ return;
+}
+
+
+//=================================================================================
+// function : SetEditCurrentArgument()
+// purpose :
+//=================================================================================
+void KinematicGUI_RangeDlg::SetEditCurrentArgument()
+{
+ QPushButton* send = (QPushButton*)sender();
+
+ if(send == Group1->PushButton1)
+ Group1->LineEdit1->setFocus();
+
+ this->SelectionIntoArgument();
+ return;
+}
+
+
+//=================================================================================
+// function : ActivateThisDialog()
+// purpose :
+//=================================================================================
+void KinematicGUI_RangeDlg::ActivateThisDialog()
+{
+ GEOMBase_Skeleton::ActivateThisDialog();
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ return;
+}
+
+
+//=================================================================================
+// function : enterEvent()
+// purpose :
+//=================================================================================
+void KinematicGUI_RangeDlg::enterEvent(QEvent* e)
+{
+ if(GroupConstructors->isEnabled())
+ return;
+ this->ActivateThisDialog();
+ return;
+}
+
+
+//=================================================================================
+// function : ValueChangedInSpinBox()
+// purpose :
+//=================================================================================
+void KinematicGUI_RangeDlg::ValueChangedInSpinBox(double newValue)
+{
+ DlgRef_SpinBox* send = (DlgRef_SpinBox*)sender();
+
+ if(myConstructorId == 0) {
+ if(send == Group1->SpinBox_DX) {
+ if(newValue <= myMaxValX)
+ myMinValX = newValue;
+ else
+ Group1->SpinBox_DX->SetValue(myMinValX);
+ }
+ else if(send == Group1->SpinBox_DY) {
+ if(newValue >= myMinValX)
+ myMaxValX = newValue;
+ else
+ Group1->SpinBox_DY->SetValue(myMaxValX);
+ }
+ }
+ else if(myConstructorId == 1) {
+ if(send == Group1->SpinBox_DX) {
+ if(newValue <= myMaxValY)
+ myMinValY = newValue;
+ else
+ Group1->SpinBox_DX->SetValue(myMinValY);
+ }
+ else if(send == Group1->SpinBox_DY) {
+ if(newValue >= myMinValY)
+ myMaxValY = newValue;
+ else
+ Group1->SpinBox_DY->SetValue(myMaxValY);
+ }
+ }
+ else if(myConstructorId == 2) {
+ if(send == Group1->SpinBox_DX) {
+ if(newValue <= myMaxValZ)
+ myMinValZ = newValue;
+ else
+ Group1->SpinBox_DX->SetValue(myMinValZ);
+ }
+ else if(send == Group1->SpinBox_DY) {
+ if(newValue >= myMinValZ)
+ myMaxValZ = newValue;
+ else
+ Group1->SpinBox_DY->SetValue(myMaxValZ);
+ }
+ }
+
+ return;
+}
--- /dev/null
+// 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 : KinematicGUI_RangeDlg.h
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef DIALOGBOX_RANGE_H
+#define DIALOGBOX_RANGE_H
+
+#include "GEOMBase_Skeleton.h"
+#include "DlgRef_1Sel2Spin.h"
+
+#include "KinematicGUI.h"
+
+//=================================================================================
+// class : KinematicGUI_RangeDlg
+// purpose :
+//=================================================================================
+class KinematicGUI_RangeDlg : public GEOMBase_Skeleton
+{
+ Q_OBJECT
+
+public:
+ KinematicGUI_RangeDlg(QWidget* parent = 0, const char* name = 0, KinematicGUI* theKinematicGUI = 0, SALOME_Selection* Sel = 0, int type = 0, bool modal = FALSE, WFlags fl = 0);
+ ~KinematicGUI_RangeDlg();
+
+private:
+ void Init();
+ void SetEnabledValues();
+ void enterEvent(QEvent* e);
+
+ KinematicGUI* myKinematicGUI;
+
+ int myConstructorId; /* Current constructor id = radio button id */
+
+ GEOM::GEOM_Contact_var myGeomContact;
+ bool myOkShape;
+ int myType;
+ double myMinValX;
+ double myMaxValX;
+ double myMinValY;
+ double myMaxValY;
+ double myMinValZ;
+ double myMaxValZ;
+
+ DlgRef_1Sel2Spin* Group1;
+
+private slots:
+ void ClickOnOk();
+ void ClickOnApply();
+ void ActivateThisDialog();
+ void SelectionIntoArgument();
+ void SetEditCurrentArgument();
+ void ValueChangedInSpinBox(double newValue);
+ void ConstructorsClicked(int constructorId);
+
+};
+
+#endif // DIALOGBOX_RANGE_H
+++ /dev/null
-// 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 : KinematicGUI_RotationDlg.cxx
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header:
-
-using namespace std;
-#include "KinematicGUI_RotationDlg.h"
-
-//=================================================================================
-// class : KinematicGUI_RotationDlg()
-// purpose : Constructs a KinematicGUI_RotationDlg 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.
-//=================================================================================
-KinematicGUI_RotationDlg::KinematicGUI_RotationDlg(QWidget* parent, const char* name, KinematicGUI* theKinematicGUI, SALOME_Selection* Sel, bool modal, WFlags fl)
- :GEOMBase_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
-{
- QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_CONTACT")));
-
- setCaption(tr("GEOM_KROTATION_TITLE"));
-
- /***************************************************************/
- GroupConstructors->setTitle(tr("GEOM_KROTATION"));
- RadioButton1->setPixmap(image0);
- RadioButton2->close(TRUE);
- RadioButton3->close(TRUE);
-
- Group1 = new KinematicGUI_3List3Spin(this, "Group1");
- Group1->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
- Group1->TextLabel1->setText(tr("GEOM_1ROT"));
- Group1->TextLabel2->setText(tr("GEOM_VALUE"));
- Group1->TextLabel3->setText(tr("GEOM_2ROT"));
- Group1->TextLabel4->setText(tr("GEOM_VALUE"));
- Group1->TextLabel5->setText(tr("GEOM_3ROT"));
- Group1->TextLabel6->setText(tr("GEOM_VALUE"));
-
- Layout1->addWidget(Group1, 1, 0);
- /***************************************************************/
-
- /* Initialisation */
- myKinematicGUI = theKinematicGUI;
- Init();
-}
-
-
-//=================================================================================
-// function : ~KinematicGUI_RotationDlg()
-// purpose : Destroys the object and frees any allocated resources
-//=================================================================================
-KinematicGUI_RotationDlg::~KinematicGUI_RotationDlg()
-{
- /* no need to delete child widgets, Qt does it all for us */
-}
-
-
-
-//=================================================================================
-// function : Init()
-// purpose :
-//=================================================================================
-void KinematicGUI_RotationDlg::Init()
-{
- double step = 5.0;
-
- Group1->SpinBox_DX->RangeStepAndValidator(-99999.999, 99999.999, step, 3);
- Group1->SpinBox_DY->RangeStepAndValidator(-99999.999, 99999.999, step, 3);
- Group1->SpinBox_DZ->RangeStepAndValidator(-99999.999, 99999.999, step, 3);
-
- Standard_Boolean testResult;
- Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
- myGeomContact = myGeomBase->ConvertIOinContact(IO, testResult);
- if(!testResult)
- ClickOnCancel();
-
- myGeomRotation = GEOM::GEOM_Rotation::_narrow(myGeomContact->GetRotation());
-
- myVal1 = myGeomRotation->GetVal1();
- myVal2 = myGeomRotation->GetVal2();
- myVal3 = myGeomRotation->GetVal3();
-
- Group1->SpinBox_DX->SetValue(myVal1);
- Group1->SpinBox_DY->SetValue(myVal2);
- Group1->SpinBox_DZ->SetValue(myVal3);
-
- myRot1 = myGeomRotation->GetRot1();
- myRot2 = myGeomRotation->GetRot2();
- myRot3 = myGeomRotation->GetRot3();
-
- Group1->ComboBox1->insertItem("X");
- Group1->ComboBox1->insertItem("Y");
- Group1->ComboBox1->insertItem("Z");
- Group1->ComboBox2->insertItem("Y");
- Group1->ComboBox2->insertItem("Z");
- Group1->ComboBox3->insertItem("Z");
-
- Group1->ComboBox1->setCurrentItem(myRot1 - 1);
-
- InitValues();
- SetEnabledValues();
-
- /* signals and slots connections */
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
-
- connect(Group1->ComboBox1, SIGNAL(activated(int)), this, SLOT(ComboTextChanged()));
- connect(Group1->ComboBox2, SIGNAL(activated(int)), this, SLOT(ComboTextChanged()));
- connect(Group1->ComboBox3, SIGNAL(activated(int)), this, SLOT(ComboTextChanged()));
-
- connect(Group1->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
- connect(Group1->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
- connect(Group1->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DX, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DY, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DZ, SLOT(SetStep(double)));
-
- /* displays Dialog */
- Group1->show();
- this->show();
-
- return;
-}
-
-
-//=================================================================================
-// function : InitValues()
-// purpose :
-//=================================================================================
-void KinematicGUI_RotationDlg::InitValues()
-{
- if(myRot1 == 1) {
- Group1->ComboBox2->changeItem("Y", 0);
- Group1->ComboBox2->changeItem("Z", 1);
- if(myRot2 == 2) {
- Group1->ComboBox3->changeItem("Z", 0);
- Group1->ComboBox2->setCurrentItem(0);
- }
- else if(myRot2 == 3) {
- Group1->ComboBox3->changeItem("Y", 0);
- Group1->ComboBox2->setCurrentItem(1);
- }
- }
- else if(myRot1 == 2) {
- Group1->ComboBox2->changeItem("X", 0);
- Group1->ComboBox2->changeItem("Z", 1);
- if(myRot2 == 1) {
- Group1->ComboBox3->changeItem("Z", 0);
- Group1->ComboBox2->setCurrentItem(0);
- }
- else if(myRot2 == 3) {
- Group1->ComboBox3->changeItem("X", 0);
- Group1->ComboBox2->setCurrentItem(1);
- }
- }
- else if(myRot1 == 3) {
- Group1->ComboBox2->changeItem("X", 0);
- Group1->ComboBox2->changeItem("Y", 1);
- if(myRot2 == 1) {
- Group1->ComboBox3->changeItem("Y", 0);
- Group1->ComboBox2->setCurrentItem(0);
- }
- else if(myRot2 == 2) {
- Group1->ComboBox3->changeItem("X", 0);
- Group1->ComboBox2->setCurrentItem(1);
- }
- }
- return;
-}
-
-
-//=================================================================================
-// function : InitValues()
-// purpose :
-//=================================================================================
-void KinematicGUI_RotationDlg::SetEnabledValues()
-{
- int type = myGeomContact->GetType();
-
- if(type == 1 || type == 3 || type == 5 || type == 9) { //PIVOT || SLIDING PIVOT || PLANE || HELICOIDAL
- Group1->TextLabel3->setEnabled(false);
- Group1->ComboBox2->setEnabled(false);
- Group1->TextLabel4->setEnabled(false);
- Group1->SpinBox_DY->setEnabled(false);
- Group1->TextLabel5->setEnabled(false);
- Group1->ComboBox3->setEnabled(false);
- Group1->TextLabel6->setEnabled(false);
- Group1->SpinBox_DZ->setEnabled(false);
- }
- else if(type == 7) { //RECTILINEAR
- Group1->TextLabel5->setEnabled(false);
- Group1->ComboBox3->setEnabled(false);
- Group1->TextLabel6->setEnabled(false);
- Group1->SpinBox_DZ->setEnabled(false);
- }
-
- return;
-}
-
-
-//=================================================================================
-// function : ClickOnOk()
-// purpose :
-//=================================================================================
-void KinematicGUI_RotationDlg::ClickOnOk()
-{
- this->ClickOnApply();
- ClickOnCancel();
- return;
-}
-
-
-//=================================================================================
-// function : ClickOnApply()
-// purpose :
-//=================================================================================
-void KinematicGUI_RotationDlg::ClickOnApply()
-{
- QAD_Application::getDesktop()->putInfo(tr(""));
-
- myKinematicGUI->SetRotation(myGeomContact, myRot1, myRot2, myRot3,
- myVal1, myVal2, myVal3);
-
- return;
-}
-
-
-//=================================================================================
-// function : ComboTextChanged()
-// purpose :
-//=================================================================================
-void KinematicGUI_RotationDlg::ComboTextChanged()
-{
- QComboBox* send = (QComboBox*)sender();
-
- if(send == Group1->ComboBox1) {
- myRot1 = Group1->ComboBox1->currentItem() + 1;
- if(myRot1 == 1) { //X
- myRot2 = 2; //Y
- myRot3 = 3; //Z
- } else if(myRot1 == 2) { //Y
- myRot2 = 1;//X
- myRot3 = 3;//Z
- } else if(myRot1 == 3) { //Z
- myRot2 = 1;//X
- myRot3 = 2;//Y
- }
- } else if(send == Group1->ComboBox2) {
- if(myRot1 == 1) {
- if(Group1->ComboBox2->currentItem() == 0) {
- myRot2 = 2;
- myRot3 = 3;
- } else if(Group1->ComboBox2->currentItem() == 1) {
- myRot2 = 3;
- myRot3 = 2;
- }
- } else if(myRot1 == 2) {
- if(Group1->ComboBox2->currentItem() == 0) {
- myRot2 = 1;
- myRot3 = 3;
- } else if(Group1->ComboBox2->currentItem() == 1) {
- myRot2 = 3;
- myRot3 = 1;
- }
- } else if(myRot1 == 3) {
- if(Group1->ComboBox2->currentItem() == 0) {
- myRot2 = 1;
- myRot3 = 2;
- } else if(Group1->ComboBox2->currentItem() == 1) {
- myRot2 = 2;
- myRot3 = 1;
- }
- }
- }
-
- InitValues();
- return;
-}
-
-
-//=================================================================================
-// function : ValueChangedInSpinBox()
-// purpose :
-//=================================================================================
-void KinematicGUI_RotationDlg::ValueChangedInSpinBox(double newValue)
-{
- DlgRef_SpinBox* send = (DlgRef_SpinBox*)sender();
-
- if(send == Group1->SpinBox_DX)
- myVal1 = newValue;
- else if(send == Group1->SpinBox_DY)
- myVal2 = newValue;
- else if(send == Group1->SpinBox_DZ)
- myVal3 = newValue;
-
- return;
-}
+++ /dev/null
-// 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 : KinematicGUI_RotationDlg.h
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header:
-
-#ifndef DIALOGBOX_ROTATION_H
-#define DIALOGBOX_ROTATION_H
-
-#include "GEOMBase_Skeleton.h"
-#include "KinematicGUI_3List3Spin.h"
-
-#include "KinematicGUI.h"
-
-//=================================================================================
-// class : KinematicGUI_RotationDlg
-// purpose :
-//=================================================================================
-class KinematicGUI_RotationDlg : public GEOMBase_Skeleton
-{
- Q_OBJECT
-
-public:
- KinematicGUI_RotationDlg(QWidget* parent = 0, const char* name = 0, KinematicGUI* theKinematicGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
- ~KinematicGUI_RotationDlg();
-
-private:
- void Init();
- void InitValues();
- void SetEnabledValues();
-
- KinematicGUI* myKinematicGUI;
-
- GEOM::GEOM_Contact_var myGeomContact;
- GEOM::GEOM_Rotation_var myGeomRotation;
-
- int myRot1;
- int myRot2;
- int myRot3;
-
- double myVal1;
- double myVal2;
- double myVal3;
-
- KinematicGUI_3List3Spin* Group1;
-
-private slots:
- void ClickOnOk();
- void ClickOnApply();
- void ComboTextChanged();
- void ValueChangedInSpinBox(double newValue);
-
-};
-
-#endif // DIALOGBOX_ROTATION_H
/****************************************************************************
** Form implementation generated from reading ui file 'KinematicGUI_Skeleton_QTD.ui'
**
-** Created: mer mar 3 16:54:07 2004
+** Created: mer avr 28 10:43:40 2004
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
/****************************************************************************
** Form interface generated from reading ui file 'KinematicGUI_Skeleton_QTD.ui'
**
-** Created: mer mar 3 16:54:07 2004
+** Created: mer avr 28 10:43:40 2004
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
+++ /dev/null
-// 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 : KinematicGUI_TranslationDlg.cxx
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header:
-
-using namespace std;
-#include "KinematicGUI_TranslationDlg.h"
-
-//=================================================================================
-// class : KinematicGUI_TranslationDlg()
-// purpose : Constructs a KinematicGUI_TranslationDlg 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.
-//=================================================================================
-KinematicGUI_TranslationDlg::KinematicGUI_TranslationDlg(QWidget* parent, const char* name, KinematicGUI* theKinematicGUI, SALOME_Selection* Sel, bool modal, WFlags fl)
- :GEOMBase_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
-{
- QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_CONTACT")));
-
- setCaption(tr("GEOM_KTRANSLATION_TITLE"));
-
- /***************************************************************/
- GroupConstructors->setTitle(tr("GEOM_KTRANSLATION"));
- RadioButton1->setPixmap(image0);
- RadioButton2->close(TRUE);
- RadioButton3->close(TRUE);
-
- Group1 = new DlgRef_3Spin(this, "Group1");
- Group1->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
- Group1->TextLabel1->setText(tr("GEOM_X"));
- Group1->TextLabel2->setText(tr("GEOM_Y"));
- Group1->TextLabel3->setText(tr("GEOM_Z"));
-
- Layout1->addWidget(Group1, 1, 0);
- /***************************************************************/
-
- /* Initialisation */
- myKinematicGUI = theKinematicGUI;
- Init();
-}
-
-
-//=================================================================================
-// function : ~KinematicGUI_TranslationDlg()
-// purpose : Destroys the object and frees any allocated resources
-//=================================================================================
-KinematicGUI_TranslationDlg::~KinematicGUI_TranslationDlg()
-{
- /* no need to delete child widgets, Qt does it all for us */
-}
-
-
-
-//=================================================================================
-// function : Init()
-// purpose :
-//=================================================================================
-void KinematicGUI_TranslationDlg::Init()
-{
- /* Get setting of step value from file configuration */
- QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
- double step = St.toDouble();
-
- Group1->SpinBox_DX->RangeStepAndValidator(-99999.999, 99999.999, step, 3);
- Group1->SpinBox_DY->RangeStepAndValidator(-99999.999, 99999.999, step, 3);
- Group1->SpinBox_DZ->RangeStepAndValidator(-99999.999, 99999.999, step, 3);
-
- Standard_Boolean testResult;
- Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
- myGeomContact = myGeomBase->ConvertIOinContact(IO, testResult);
- if(!testResult)
- ClickOnCancel();
-
- myGeomTranslation = GEOM::GEOM_Translation::_narrow(myGeomContact->GetTranslation());
-
- myValX = myGeomTranslation->GetValX();
- myValY = myGeomTranslation->GetValY();
- myValZ = myGeomTranslation->GetValZ();
-
- Group1->SpinBox_DX->SetValue(myValX);
- Group1->SpinBox_DY->SetValue(myValY);
- Group1->SpinBox_DZ->SetValue(myValZ);
-
- SetEnabledValues();
-
- /* signals and slots connections */
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
-
- connect(Group1->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
- connect(Group1->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
- connect(Group1->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DX, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DY, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DZ, SLOT(SetStep(double)));
-
- /* displays Dialog */
- Group1->show();
- this->show();
-
- return;
-}
-
-
-//=================================================================================
-// function : InitValues()
-// purpose :
-//=================================================================================
-void KinematicGUI_TranslationDlg::SetEnabledValues()
-{
- int type = myGeomContact->GetType();
-
- if(type == 2 || type == 3 || type == 6 || type == 9) { //SLIDE || SLIDING PIVOT || ANNULAR || HELICOIDAL
- Group1->TextLabel2->setEnabled(false);
- Group1->SpinBox_DY->setEnabled(false);
- Group1->TextLabel3->setEnabled(false);
- Group1->SpinBox_DZ->setEnabled(false);
- }
- else if(type == 7) { //RECTILINEAR
- Group1->TextLabel2->setEnabled(false);
- Group1->SpinBox_DY->setEnabled(false);
- }
- else if(type == 5 || type == 8) { //PLANE || PONCTUAL
- Group1->TextLabel1->setEnabled(false);
- Group1->SpinBox_DX->setEnabled(false);
- }
-
- return;
-}
-
-
-//=================================================================================
-// function : ClickOnOk()
-// purpose :
-//=================================================================================
-void KinematicGUI_TranslationDlg::ClickOnOk()
-{
- this->ClickOnApply();
- ClickOnCancel();
- return ;
-}
-
-
-//=================================================================================
-// function : ClickOnApply()
-// purpose :
-//=================================================================================
-void KinematicGUI_TranslationDlg::ClickOnApply()
-{
- QAD_Application::getDesktop()->putInfo(tr(""));
-
- myKinematicGUI->SetTranslation(myGeomContact, myValX, myValY, myValZ);
-
- return;
-}
-
-
-//=================================================================================
-// function : ValueChangedInSpinBox()
-// purpose :
-//=================================================================================
-void KinematicGUI_TranslationDlg::ValueChangedInSpinBox(double newValue)
-{
- DlgRef_SpinBox* send = (DlgRef_SpinBox*)sender();
-
- if(send == Group1->SpinBox_DX)
- myValX = newValue;
- else if(send == Group1->SpinBox_DY)
- myValY = newValue;
- else if(send == Group1->SpinBox_DZ)
- myValZ = newValue;
-
- return;
-}
+++ /dev/null
-// 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 : KinematicGUI_TranslationDlg.h
-// Author : Damien COQUERET
-// Module : GEOM
-// $Header:
-
-#ifndef DIALOGBOX_TRANSLATION_H
-#define DIALOGBOX_TRANSLATION_H
-
-#include "GEOMBase_Skeleton.h"
-#include "DlgRef_3Spin.h"
-
-#include "KinematicGUI.h"
-
-//=================================================================================
-// class : KinematicGUI_TranslationDlg
-// purpose :
-//=================================================================================
-class KinematicGUI_TranslationDlg : public GEOMBase_Skeleton
-{
- Q_OBJECT
-
-public:
- KinematicGUI_TranslationDlg(QWidget* parent = 0, const char* name = 0, KinematicGUI* theKinematicGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
- ~KinematicGUI_TranslationDlg();
-
-private:
- void Init();
- void SetEnabledValues();
-
- KinematicGUI* myKinematicGUI;
-
- GEOM::GEOM_Contact_var myGeomContact;
- GEOM::GEOM_Translation_var myGeomTranslation;
-
- double myValX;
- double myValY;
- double myValZ;
-
- DlgRef_3Spin* Group1;
-
-private slots:
- void ClickOnOk();
- void ClickOnApply();
- void ValueChangedInSpinBox(double newValue);
-
-};
-
-#endif // DIALOGBOX_TRANSLATION_H
LIB = libKinematicGUI.la
LIB_SRC = KinematicGUI.cxx \
- KinematicGUI_3Sel1List_QTD.cxx \
- KinematicGUI_3Sel1Spin_QTD.cxx \
- KinematicGUI_3List3Spin_QTD.cxx \
- KinematicGUI_12Spin_QTD.cxx \
KinematicGUI_Skeleton_QTD.cxx \
- KinematicGUI_Anim_QTD.cxx \
- KinematicGUI_3Sel1Spin.cxx \
- KinematicGUI_3List3Spin.cxx \
+ KinematicGUI_12Spin_QTD.cxx \
KinematicGUI_12Spin.cxx \
KinematicGUI_ContactDlg.cxx \
- KinematicGUI_ContactHDlg.cxx \
KinematicGUI_PositionDlg.cxx \
- KinematicGUI_RotationDlg.cxx \
- KinematicGUI_TranslationDlg.cxx \
- KinematicGUI_AnimDlg.cxx \
- KinematicGUI_AnimationDlg.cxx
+ KinematicGUI_RangeDlg.cxx \
+ KinematicGUI_AnimationDlg.cxx \
+ KinematicGUI_AnimValuesDlg.cxx \
+ KinematicGUI_AnimDlg.cxx
LIB_MOC = \
KinematicGUI.h \
- KinematicGUI_3Sel1List_QTD.h \
- KinematicGUI_3Sel1Spin_QTD.h \
- KinematicGUI_3List3Spin_QTD.h \
- KinematicGUI_12Spin_QTD.h \
KinematicGUI_Skeleton_QTD.h \
- KinematicGUI_Anim_QTD.h \
- KinematicGUI_3Sel1Spin.h \
- KinematicGUI_3List3Spin.h \
+ KinematicGUI_12Spin_QTD.h \
KinematicGUI_12Spin.h \
KinematicGUI_ContactDlg.h \
- KinematicGUI_ContactHDlg.h \
KinematicGUI_PositionDlg.h \
- KinematicGUI_RotationDlg.h \
- KinematicGUI_TranslationDlg.h \
- KinematicGUI_AnimDlg.h \
- KinematicGUI_AnimationDlg.h
+ KinematicGUI_RangeDlg.h \
+ KinematicGUI_AnimationDlg.h \
+ KinematicGUI_AnimValuesDlg.h \
+ KinematicGUI_AnimDlg.h
LIB_CLIENT_IDL = GEOM_Kinematic.idl
--- /dev/null
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>DlgRef_3Spin_QTD</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>DlgRef_3Spin_QTD</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>124</width>
+ <height>111</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>DlgRef_3Spin_QTD</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QSpinBox" row="1" column="1">
+ <property name="name">
+ <cstring>SpinBox2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL3</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>SpinBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="2" column="1">
+ <property name="name">
+ <cstring>SpinBox3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL1</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL2</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
+++ /dev/null
-<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
-<class>KinematicGUI_3List3Spin_QTD</class>
-<widget class="QWidget">
- <property name="name">
- <cstring>KinematicGUI_3List3Spin_QTD</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>279</width>
- <height>111</height>
- </rect>
- </property>
- <property name="minimumSize">
- <size>
- <width>100</width>
- <height>0</height>
- </size>
- </property>
- <property name="caption">
- <string>KinematicGUI_3List3Spin_QTD</string>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <widget class="QGroupBox" row="0" column="0">
- <property name="name">
- <cstring>GroupBox1</cstring>
- </property>
- <property name="title">
- <string></string>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>11</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <widget class="QLayoutWidget" row="0" column="0">
- <property name="name">
- <cstring>Layout1</cstring>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <widget class="QLabel" row="0" column="2">
- <property name="name">
- <cstring>TextLabel2</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>TL2</string>
- </property>
- </widget>
- <spacer row="3" column="3">
- <property name="name">
- <cstring>Spacer7</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>0</width>
- <height>100</height>
- </size>
- </property>
- </spacer>
- <widget class="QSpinBox" row="0" column="3">
- <property name="name">
- <cstring>SpinBox1</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- <widget class="QLabel" row="1" column="2">
- <property name="name">
- <cstring>TextLabel4</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>TL4</string>
- </property>
- </widget>
- <widget class="QLabel" row="1" column="0">
- <property name="name">
- <cstring>TextLabel3</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>TL3</string>
- </property>
- </widget>
- <widget class="QLabel" row="0" column="0">
- <property name="name">
- <cstring>TextLabel1</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>TL1</string>
- </property>
- </widget>
- <widget class="QComboBox" row="2" column="1">
- <property name="name">
- <cstring>ComboBox3</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- <widget class="QSpinBox" row="1" column="3">
- <property name="name">
- <cstring>SpinBox2</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- <widget class="QSpinBox" row="2" column="3">
- <property name="name">
- <cstring>SpinBox3</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- <widget class="QLabel" row="2" column="2">
- <property name="name">
- <cstring>TextLabel6</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>TL6</string>
- </property>
- </widget>
- <widget class="QComboBox" row="0" column="1">
- <property name="name">
- <cstring>ComboBox1</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- <widget class="QComboBox" row="1" column="1">
- <property name="name">
- <cstring>ComboBox2</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- <widget class="QLabel" row="2" column="0">
- <property name="name">
- <cstring>TextLabel5</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>TL5</string>
- </property>
- </widget>
- </grid>
- </widget>
- </grid>
- </widget>
- </grid>
-</widget>
-<layoutdefaults spacing="6" margin="11"/>
-</UI>
<rect>
<x>0</x>
<y>0</y>
- <width>129</width>
- <height>145</height>
+ <width>329</width>
+ <height>226</height>
</rect>
</property>
<property name="caption">
<property name="spacing">
<number>6</number>
</property>
- <spacer row="4" column="2">
+ <widget class="QLineEdit" row="3" column="2">
<property name="name">
- <cstring>Spacer5</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>0</width>
- <height>90</height>
- </size>
+ <cstring>LineEdit3</cstring>
</property>
- </spacer>
- <widget class="QPushButton" row="2" column="1">
+ </widget>
+ <widget class="QLabel" row="3" column="0">
<property name="name">
- <cstring>PushButton2</cstring>
+ <cstring>TextLabel4</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
</sizepolicy>
</property>
<property name="text">
- <string></string>
+ <string>TL4</string>
</property>
</widget>
- <widget class="QLabel" row="0" column="0">
+ <widget class="QLayoutWidget" row="4" column="0" rowspan="1" colspan="3">
<property name="name">
- <cstring>TextLabel1</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>TL1</string>
+ <cstring>Layout3</cstring>
</property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel5</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL5</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>SpinBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </grid>
</widget>
- <widget class="QLabel" row="3" column="0">
+ <widget class="QPushButton" row="2" column="1">
<property name="name">
- <cstring>TextLabel4</cstring>
+ <cstring>PushButton2</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
</sizepolicy>
</property>
<property name="text">
- <string>TL4</string>
+ <string></string>
</property>
</widget>
<widget class="QLineEdit" row="0" column="2">
<string></string>
</property>
</widget>
- <widget class="QLabel" row="2" column="0">
+ <widget class="QLabel" row="0" column="0">
<property name="name">
- <cstring>TextLabel3</cstring>
+ <cstring>TextLabel1</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
</sizepolicy>
</property>
<property name="text">
- <string>TL3</string>
+ <string>TL1</string>
</property>
</widget>
- <widget class="QPushButton" row="3" column="1">
+ <widget class="QLineEdit" row="2" column="2">
<property name="name">
- <cstring>PushButton3</cstring>
+ <cstring>LineEdit2</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
</sizepolicy>
</property>
<property name="text">
- <string></string>
+ <string>TL3</string>
</property>
</widget>
- <widget class="QComboBox" row="1" column="2">
+ <widget class="QLayoutWidget" row="1" column="0" rowspan="1" colspan="3">
<property name="name">
- <cstring>ComboBox1</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <cstring>Layout2</cstring>
</property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL2</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>ComboBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </grid>
</widget>
- <widget class="QLineEdit" row="2" column="2">
+ <spacer row="5" column="2">
<property name="name">
- <cstring>LineEdit2</cstring>
+ <cstring>Spacer5</cstring>
</property>
- </widget>
- <widget class="QLineEdit" row="3" column="2">
- <property name="name">
- <cstring>LineEdit3</cstring>
+ <property name="orientation">
+ <enum>Vertical</enum>
</property>
- </widget>
- <widget class="QLabel" row="1" column="0">
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>90</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="3" column="1">
<property name="name">
- <cstring>TextLabel2</cstring>
+ <cstring>PushButton3</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
</sizepolicy>
</property>
<property name="text">
- <string>TL2</string>
+ <string></string>
</property>
</widget>
</grid>
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'KinematicGUI_AnimValues_QTD.ui'
+**
+** Created: lun mai 3 09:48:44 2004
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "KinematicGUI_AnimValues_QTD.h"
+
+#include <qvariant.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qlistbox.h>
+#include <qpushbutton.h>
+#include <qspinbox.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a KinematicGUI_AnimValues_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+KinematicGUI_AnimValues_QTD::KinematicGUI_AnimValues_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "KinematicGUI_AnimValues_QTD" );
+ resize( 469, 249 );
+ setCaption( trUtf8( "KinematicGUI_AnimValues_QTD" ) );
+ KinematicGUI_AnimValues_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "KinematicGUI_AnimValues_QTDLayout");
+
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setTitle( trUtf8( "" ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+ LayoutD = new QGridLayout( 0, 1, 1, 0, 6, "LayoutD");
+ QSpacerItem* spacer = new QSpacerItem( 0, 50, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ LayoutD->addItem( spacer, 2, 1 );
+
+ LayoutC = new QGridLayout( 0, 1, 1, 0, 6, "LayoutC");
+
+ TextLabel8 = new QLabel( GroupBox1, "TextLabel8" );
+ TextLabel8->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel8->sizePolicy().hasHeightForWidth() ) );
+ TextLabel8->setText( trUtf8( "TL8" ) );
+
+ LayoutC->addWidget( TextLabel8, 5, 0 );
+
+ SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
+ SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
+
+ LayoutC->addMultiCellWidget( SpinBox1, 1, 1, 1, 2 );
+
+ TextLabel9 = new QLabel( GroupBox1, "TextLabel9" );
+ TextLabel9->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel9->sizePolicy().hasHeightForWidth() ) );
+ TextLabel9->setText( trUtf8( "TL9" ) );
+
+ LayoutC->addWidget( TextLabel9, 6, 0 );
+
+ SpinBox6 = new QSpinBox( GroupBox1, "SpinBox6" );
+ SpinBox6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox6->sizePolicy().hasHeightForWidth() ) );
+
+ LayoutC->addWidget( SpinBox6, 3, 3 );
+
+ SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
+ SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
+
+ LayoutC->addWidget( SpinBox2, 1, 3 );
+
+ TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
+ TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
+ TextLabel4->setText( trUtf8( "TL4" ) );
+
+ LayoutC->addWidget( TextLabel4, 1, 0 );
+
+ SpinBox12 = new QSpinBox( GroupBox1, "SpinBox12" );
+ SpinBox12->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox12->sizePolicy().hasHeightForWidth() ) );
+
+ LayoutC->addWidget( SpinBox12, 6, 3 );
+
+ SpinBox9 = new QSpinBox( GroupBox1, "SpinBox9" );
+ SpinBox9->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox9->sizePolicy().hasHeightForWidth() ) );
+
+ LayoutC->addMultiCellWidget( SpinBox9, 5, 5, 1, 2 );
+
+ SpinBox5 = new QSpinBox( GroupBox1, "SpinBox5" );
+ SpinBox5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox5->sizePolicy().hasHeightForWidth() ) );
+
+ LayoutC->addMultiCellWidget( SpinBox5, 3, 3, 1, 2 );
+
+ TextLabel5 = new QLabel( GroupBox1, "TextLabel5" );
+ TextLabel5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel5->sizePolicy().hasHeightForWidth() ) );
+ TextLabel5->setText( trUtf8( "TL5" ) );
+
+ LayoutC->addWidget( TextLabel5, 2, 0 );
+
+ TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
+ TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
+ TextLabel3->setText( trUtf8( "TL3" ) );
+ TextLabel3->setAlignment( int( QLabel::AlignCenter ) );
+
+ LayoutC->addWidget( TextLabel3, 0, 3 );
+
+ SpinBox8 = new QSpinBox( GroupBox1, "SpinBox8" );
+ SpinBox8->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox8->sizePolicy().hasHeightForWidth() ) );
+
+ LayoutC->addWidget( SpinBox8, 4, 3 );
+
+ TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
+ TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
+ TextLabel2->setText( trUtf8( "TL2" ) );
+ TextLabel2->setAlignment( int( QLabel::AlignCenter ) );
+
+ LayoutC->addWidget( TextLabel2, 0, 2 );
+
+ SpinBox7 = new QSpinBox( GroupBox1, "SpinBox7" );
+ SpinBox7->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox7->sizePolicy().hasHeightForWidth() ) );
+
+ LayoutC->addMultiCellWidget( SpinBox7, 4, 4, 1, 2 );
+
+ TextLabel6 = new QLabel( GroupBox1, "TextLabel6" );
+ TextLabel6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel6->sizePolicy().hasHeightForWidth() ) );
+ TextLabel6->setText( trUtf8( "TL6" ) );
+
+ LayoutC->addWidget( TextLabel6, 3, 0 );
+
+ TextLabel10 = new QLabel( GroupBox1, "TextLabel10" );
+ TextLabel10->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel10->sizePolicy().hasHeightForWidth() ) );
+ QFont TextLabel10_font( TextLabel10->font() );
+ TextLabel10_font.setBold( TRUE );
+ TextLabel10->setFont( TextLabel10_font );
+ TextLabel10->setText( trUtf8( "TL10" ) );
+
+ LayoutC->addMultiCellWidget( TextLabel10, 0, 0, 0, 1 );
+
+ SpinBox10 = new QSpinBox( GroupBox1, "SpinBox10" );
+ SpinBox10->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox10->sizePolicy().hasHeightForWidth() ) );
+
+ LayoutC->addWidget( SpinBox10, 5, 3 );
+
+ TextLabel7 = new QLabel( GroupBox1, "TextLabel7" );
+ TextLabel7->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel7->sizePolicy().hasHeightForWidth() ) );
+ TextLabel7->setText( trUtf8( "TL7" ) );
+
+ LayoutC->addWidget( TextLabel7, 4, 0 );
+
+ SpinBox11 = new QSpinBox( GroupBox1, "SpinBox11" );
+ SpinBox11->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox11->sizePolicy().hasHeightForWidth() ) );
+
+ LayoutC->addMultiCellWidget( SpinBox11, 6, 6, 1, 2 );
+
+ SpinBox4 = new QSpinBox( GroupBox1, "SpinBox4" );
+ SpinBox4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox4->sizePolicy().hasHeightForWidth() ) );
+
+ LayoutC->addWidget( SpinBox4, 2, 3 );
+
+ SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" );
+ SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) );
+
+ LayoutC->addMultiCellWidget( SpinBox3, 2, 2, 1, 2 );
+
+ LayoutD->addLayout( LayoutC, 1, 1 );
+
+ ListBox1 = new QListBox( GroupBox1, "ListBox1" );
+ ListBox1->insertItem( trUtf8( "New Item" ) );
+ ListBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, ListBox1->sizePolicy().hasHeightForWidth() ) );
+
+ LayoutD->addMultiCellWidget( ListBox1, 1, 2, 0, 0 );
+
+ LayoutB = new QGridLayout( 0, 1, 1, 0, 6, "LayoutB");
+
+ LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
+
+ LayoutB->addWidget( LineEdit1, 0, 2 );
+
+ PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
+ PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
+ PushButton1->setText( trUtf8( "" ) );
+
+ LayoutB->addWidget( PushButton1, 0, 1 );
+
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
+
+ LayoutB->addWidget( TextLabel1, 0, 0 );
+
+ LayoutD->addMultiCellLayout( LayoutB, 0, 0, 0, 1 );
+
+ GroupBox1Layout->addLayout( LayoutD, 0, 0 );
+
+ KinematicGUI_AnimValues_QTDLayout->addWidget( GroupBox1, 0, 0 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+KinematicGUI_AnimValues_QTD::~KinematicGUI_AnimValues_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'KinematicGUI_AnimValues_QTD.ui'
+**
+** Created: lun mai 3 09:48:44 2004
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef KINEMATICGUI_ANIMVALUES_QTD_H
+#define KINEMATICGUI_ANIMVALUES_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QGroupBox;
+class QLabel;
+class QLineEdit;
+class QListBox;
+class QListBoxItem;
+class QPushButton;
+class QSpinBox;
+
+class KinematicGUI_AnimValues_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ KinematicGUI_AnimValues_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~KinematicGUI_AnimValues_QTD();
+
+ QGroupBox* GroupBox1;
+ QLabel* TextLabel8;
+ QSpinBox* SpinBox1;
+ QLabel* TextLabel9;
+ QSpinBox* SpinBox6;
+ QSpinBox* SpinBox2;
+ QLabel* TextLabel4;
+ QSpinBox* SpinBox12;
+ QSpinBox* SpinBox9;
+ QSpinBox* SpinBox5;
+ QLabel* TextLabel5;
+ QLabel* TextLabel3;
+ QSpinBox* SpinBox8;
+ QLabel* TextLabel2;
+ QSpinBox* SpinBox7;
+ QLabel* TextLabel6;
+ QLabel* TextLabel10;
+ QSpinBox* SpinBox10;
+ QLabel* TextLabel7;
+ QSpinBox* SpinBox11;
+ QSpinBox* SpinBox4;
+ QSpinBox* SpinBox3;
+ QListBox* ListBox1;
+ QLineEdit* LineEdit1;
+ QPushButton* PushButton1;
+ QLabel* TextLabel1;
+
+
+protected:
+ QGridLayout* KinematicGUI_AnimValues_QTDLayout;
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* LayoutD;
+ QGridLayout* LayoutC;
+ QGridLayout* LayoutB;
+};
+
+#endif // KINEMATICGUI_ANIMVALUES_QTD_H
--- /dev/null
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>KinematicGUI_AnimValues_QTD</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KinematicGUI_AnimValues_QTD</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>426</width>
+ <height>249</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>KinematicGUI_AnimValues_QTD</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>LayoutD</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>50</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget" row="1" column="1">
+ <property name="name">
+ <cstring>LayoutC</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="5" column="0">
+ <property name="name">
+ <cstring>TextLabel8</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL8</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="1" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>SpinBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="6" column="0">
+ <property name="name">
+ <cstring>TextLabel9</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL9</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="3" column="3">
+ <property name="name">
+ <cstring>SpinBox6</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="1" column="3">
+ <property name="name">
+ <cstring>SpinBox2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL4</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="6" column="3">
+ <property name="name">
+ <cstring>SpinBox12</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="5" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>SpinBox9</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="3" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>SpinBox5</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel5</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL5</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="3">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL3</string>
+ </property>
+ <property name="alignment">
+ <set>AlignCenter</set>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="4" column="3">
+ <property name="name">
+ <cstring>SpinBox8</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="2">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL2</string>
+ </property>
+ <property name="alignment">
+ <set>AlignCenter</set>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="4" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>SpinBox7</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>TextLabel6</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL6</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>TextLabel10</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>TL10</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="5" column="3">
+ <property name="name">
+ <cstring>SpinBox10</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>TextLabel7</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL7</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="6" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>SpinBox11</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="2" column="3">
+ <property name="name">
+ <cstring>SpinBox4</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="2" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>SpinBox3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QListBox" row="1" column="0" rowspan="2" colspan="1">
+ <item>
+ <property name="text">
+ <string>New Item</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>ListBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>LayoutB</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLineEdit" row="0" column="2">
+ <property name="name">
+ <cstring>LineEdit1</cstring>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL1</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
<rect>
<x>0</x>
<y>0</y>
- <width>334</width>
- <height>121</height>
+ <width>349</width>
+ <height>250</height>
</rect>
</property>
<property name="caption">
</property>
<widget class="QLayoutWidget" row="0" column="0">
<property name="name">
- <cstring>Layout1</cstring>
+ <cstring>LayoutA</cstring>
</property>
<grid>
<property name="name">
<property name="spacing">
<number>6</number>
</property>
- <spacer row="3" column="0">
+ <widget class="QLayoutWidget" row="3" column="0">
<property name="name">
- <cstring>Spacer5</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>0</width>
- <height>156</height>
- </size>
- </property>
- </spacer>
- <widget class="QLayoutWidget" row="1" column="0">
- <property name="name">
- <cstring>Layout2</cstring>
+ <cstring>LayoutD</cstring>
</property>
<grid>
<property name="name">
<property name="spacing">
<number>6</number>
</property>
- <widget class="QPushButton" row="0" column="2">
+ <widget class="QPushButton" row="0" column="1">
<property name="name">
- <cstring>PushButton3</cstring>
+ <cstring>PushButton7</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<string></string>
</property>
</widget>
- <widget class="QPushButton" row="0" column="4">
+ <widget class="QRadioButton" row="0" column="0">
<property name="name">
- <cstring>PushButton5</cstring>
+ <cstring>CheckButton1</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QSlider" row="1" column="0">
+ <property name="name">
+ <cstring>Slider1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>LayoutB</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
</sizepolicy>
</property>
<property name="text">
- <string></string>
+ <string>TL1</string>
</property>
</widget>
<widget class="QPushButton" row="0" column="1">
<property name="name">
- <cstring>PushButton2</cstring>
+ <cstring>PushButton1</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<string></string>
</property>
</widget>
- <widget class="QPushButton" row="0" column="3">
+ <widget class="QLineEdit" row="0" column="2">
+ <property name="name">
+ <cstring>LineEdit1</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer row="4" column="0">
+ <property name="name">
+ <cstring>Spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>212</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget" row="2" column="0">
+ <property name="name">
+ <cstring>LayoutC</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton" row="0" column="2">
<property name="name">
<cstring>PushButton4</cstring>
</property>
<string></string>
</property>
</widget>
- <widget class="QPushButton" row="0" column="5">
+ <widget class="QPushButton" row="0" column="4">
<property name="name">
<cstring>PushButton6</cstring>
</property>
</widget>
<widget class="QPushButton" row="0" column="0">
<property name="name">
- <cstring>PushButton1</cstring>
+ <cstring>PushButton2</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<string></string>
</property>
</widget>
- </grid>
- </widget>
- <widget class="QSlider" row="0" column="0">
- <property name="name">
- <cstring>Slider1</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- </widget>
- <widget class="QLayoutWidget" row="2" column="0">
- <property name="name">
- <cstring>Layout3</cstring>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- <widget class="QRadioButton" row="0" column="0">
- <property name="name">
- <cstring>CheckButton1</cstring>
- </property>
- <property name="text">
- <string></string>
- </property>
- </widget>
- <widget class="QPushButton" row="0" column="2">
+ <widget class="QPushButton" row="0" column="3">
<property name="name">
- <cstring>PushButton7</cstring>
+ <cstring>PushButton5</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<string></string>
</property>
</widget>
- <widget class="QRadioButton" row="0" column="1">
+ <widget class="QPushButton" row="0" column="1">
<property name="name">
- <cstring>CheckButton2</cstring>
+ <cstring>PushButton3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
<property name="text">
<string></string>
#uic -o KinematicGUI_2Sel2Spin2Check_QTD.h KinematicGUI_2Sel2Spin2Check_QTD.ui
#uic -o KinematicGUI_2Sel2Spin2Check_QTD.cxx -impl KinematicGUI_2Sel2Spin2Check_QTD.h KinematicGUI_2Sel2Spin2Check_QTD.ui
-uic -o KinematicGUI_Anim_QTD.h KinematicGUI_Anim_QTD.ui
-uic -o KinematicGUI_Anim_QTD.cxx -impl KinematicGUI_Anim_QTD.h KinematicGUI_Anim_QTD.ui
+#uic -o KinematicGUI_Anim_QTD.h KinematicGUI_Anim_QTD.ui
+#uic -o KinematicGUI_Anim_QTD.cxx -impl KinematicGUI_Anim_QTD.h KinematicGUI_Anim_QTD.ui
+
+uic -o KinematicGUI_AnimValues_QTD.h KinematicGUI_AnimValues_QTD.ui
+uic -o KinematicGUI_AnimValues_QTD.cxx -impl KinematicGUI_AnimValues_QTD.h KinematicGUI_AnimValues_QTD.ui
#uic -o KinematicGUI_Skeleton_QTD.h KinematicGUI_Skeleton_QTD.ui
#uic -o KinematicGUI_Skeleton_QTD.cxx -impl KinematicGUI_Skeleton_QTD.h KinematicGUI_Skeleton_QTD.ui
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_BndBoxDlg.h"
#include <BRepPrimAPI_MakeBox.hxx>
#include <BRepBndLib.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_BndBoxDlg()
// purpose : Constructs a MeasureGUI_BndBoxDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_CenterMassDlg.h"
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <GProp_GProps.hxx>
#include <GProp_PrincipalProps.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_CenterMassDlg()
// purpose : Constructs a MeasureGUI_CenterMassDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_CheckShapeDlg.h"
#include <BRepCheck_Analyzer.hxx>
#include <qtextedit.h>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_CheckShapeDlg()
// purpose : Constructs a MeasureGUI_CheckShapeDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_DistanceDlg.h"
#include "QAD_RightFrame.h"
#include <gce_MakePln.hxx>
#include <Precision.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_DistanceDlg()
// purpose : Constructs a MeasureGUI_DistanceDlg which is a child of 'parent', with the
gp_Pln gp_P = gce_MP.Value();
Handle(Geom_Plane) P = new Geom_Plane(gp_P);
- Handle(AIS_LengthDimension) Distance = new AIS_LengthDimension(V1, V2, P, Dist, TCollection_ExtendedString(strdup(S)));
+ char* aCopyS = CORBA::string_dup(S);
+ Handle(AIS_LengthDimension) Distance = new AIS_LengthDimension(V1, V2, P, Dist, TCollection_ExtendedString(aCopyS));
+ delete(aCopyS);
GroupC1->LineEdit3->setText(S);
// Author : Lucien PIGNOLONI
// Module : GEOM
-using namespace std;
#include "MeasureGUI_InertiaDlg.h"
#include <BRepGProp.hxx>
#include <GProp_GProps.hxx>
#include <GProp_PrincipalProps.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_InertiaDlg()
// purpose : Constructs a MeasureGUI_InertiaDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_MaxToleranceDlg.h"
#include <TopoDS_Vertex.hxx>
#include <TopExp_Explorer.hxx>
#include <BRep_Tool.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_MaxToleranceDlg()
// purpose : Constructs a MeasureGUI_MaxToleranceDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_PropertiesDlg.h"
#include <TopExp_Explorer.hxx>
#include <GProp_GProps.hxx>
#include <GProp_PrincipalProps.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_PropertiesDlg()
// purpose : Constructs a MeasureGUI_PropertiesDlg which is a child of 'parent', with the
#include <qlayout.h>
#include <qradiobutton.h>
#include <qbuttongroup.h>
+#include <qpushbutton.h>
class MeasureGUI_Skeleton : public MeasureGUI_Skeleton_QTD
{
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_WhatisDlg.h"
#include <TopTools_MapOfShape.hxx>
#include <BRep_Tool.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_WhatisDlg()
// purpose : Constructs a MeasureGUI_WhatisDlg which is a child of 'parent', with the
if ( S.ShapeType() == TopAbs_EDGE ) {
if( BRep_Tool::Degenerated(TopoDS::Edge(S)) ) {
- Astr = Astr + " " + strdup(SelectedName.latin1()) + " is a degenerated edge \n";
+ Astr = Astr + " " + CORBA::string_dup(SelectedName.latin1()) + " is a degenerated edge \n";
}
}
- Astr = Astr + " Number of shapes in " + strdup(SelectedName.latin1()) + " : \n";
+ Astr = Astr + " Number of shapes in " + CORBA::string_dup(SelectedName.latin1()) + " : \n";
try {
int iType, nbTypes [TopAbs_SHAPE];
#endif
#ifndef _Prs3d_Presentation_HeaderFile
#include <Prs3d_Presentation.hxx>
-#endif
\ No newline at end of file
+#endif
#include "DisplayGUI.h"
#include "QAD_MessageBox.h"
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
#include <AIS_InteractiveContext.hxx>
#include <BRepFilletAPI_MakeChamfer.hxx>
#include <BRepTools.hxx>
#include "DisplayGUI.h"
#include "QAD_MessageBox.h"
+#include <TopoDS_Edge.hxx>
#include <AIS_InteractiveContext.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepFilletAPI_MakeFillet.hxx>
// Module : GEOM
// $Header$
-using namespace std;
#include "PrimitiveGUI_ConeDlg.h"
#include <gp_Lin.hxx>
#include <Precision.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : PrimitiveGUI_ConeDlg()
// purpose : Constructs a PrimitiveGUI_ConeDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "PrimitiveGUI_CylinderDlg.h"
#include <gp_Lin.hxx>
#include <Precision.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : PrimitiveGUI_CylinderDlg()
// purpose : Constructs a PrimitiveGUI_CylinderDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "PrimitiveGUI_TorusDlg.h"
#include <gp_Lin.hxx>
#include <BRepAdaptor_Curve.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : PrimitiveGUI_TorusDlg()
// purpose : Constructs a PrimitiveGUI_TorusDlg which is a child of 'parent', with the
// Module : GEOM
// $Header:
-using namespace std;
#include "RepairGUI.h"
#include "QAD_RightFrame.h"
#include "RepairGUI_SuppressFacesDlg.h" // Method SUPPRESS FACES
#include "RepairGUI_SuppressHoleDlg.h" // Method SUPPRESS HOLE
+#include "utilities.h"
+
+using namespace std;
+
//=======================================================================
// function : RepairGUI()
// purpose : Constructor
// Module : GEOM
// $Header$
-using namespace std;
#include "RepairGUI_OrientationDlg.h"
#include <Precision.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <TopExp_Explorer.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : RepairGUI_OrientationDlg()
// purpose : Constructs a RepairGUI_OrientationDlg which is a child of 'parent', with the
+++ /dev/null
-// GEOM SKETCHER : basic sketcher
-//
-// 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.cxx
-// Author : Nicolas REJNERI
-// Module : GEOM
-// $Header$
-
-using namespace std;
-#include "GEOM_Sketcher.h"
-#include "utilities.h"
-
-#include <qstring.h>
-
-#include <Geom_Axis1Placement.hxx>
-#include <Geom_Circle.hxx>
-#include <Geom_Line.hxx>
-#include <Geom_CartesianPoint.hxx>
-#include <BRep_Tool.hxx>
-#include <BRepBuilderAPI_MakeEdge2d.hxx>
-#include <BRepBuilderAPI_MakeEdge.hxx>
-#include <BRepBuilderAPI_MakeVertex.hxx>
-#include <gp_Lin2d.hxx>
-#include <gp_Pln.hxx>
-#include <gp_Lin.hxx>
-#include <gp_Dir.hxx>
-#include <gp_Circ2d.hxx>
-#include <gp_Vec2d.hxx>
-#include <IntAna_IntConicQuad.hxx>
-#include <BRepLib.hxx>
-#include <TopExp.hxx>
-#include <ProjLib.hxx>
-#include <Precision.hxx>
-#include <ElSLib.hxx>
-#include <BRepTools_WireExplorer.hxx>
-#include <GccAna_Pnt2dBisec.hxx>
-#include <GeomAPI.hxx>
-#include <Geom2dAPI_ProjectPointOnCurve.hxx>
-#include <Geom2d_TrimmedCurve.hxx>
-#include <Geom2d_Circle.hxx>
-#include <gce_MakeCirc2d.hxx>
-#include <GccAna_Circ2d2TanRad.hxx>
-#include <GccAna_Circ2d2TanOn.hxx>
-#include <GccEnt.hxx>
-#include <GccEnt_QualifiedLin.hxx>
-#include <GccEnt_QualifiedCirc.hxx>
-#include <GccAna_Lin2dTanPer.hxx>
-#include <GccAna_Lin2dTanObl.hxx>
-#include <gce_MakeLin2d.hxx>
-#include <GCE2d_MakeArcOfCircle.hxx>
-#include <Precision.hxx>
-#include <ElCLib.hxx>
-#include <AIS_Point.hxx>
-#include <TColgp_HArray1OfPnt2d.hxx>
-#include <Geom2dAPI_Interpolate.hxx>
-#include <TColgp_Array1OfVec2d.hxx>
-#include <TColStd_HArray1OfBoolean.hxx>
-#include <GeomAPI_ProjectPointOnCurve.hxx>
-#include <DsgPrs_ArrowSide.hxx>
-#include <BRepBuilderAPI_Transform.hxx>
-
-#include <AIS_Drawer.hxx>
-#include <Prs3d_TextAspect.hxx>
-#include <Prs3d_LineAspect.hxx>
-#include <Graphic3d_NameOfFont.hxx>
-
-#include <TopoDS_Wire.hxx>
-
-/*!
- \class GEOM_Sketcher GEOM_Sketcher.h
- \brief ...
-*/
-
-Standard_Real resol = 1.0;
-
-/*!
- Constructor.
-*/
-Sketch::Sketch()
-{
-
-}
-
-/*!
- Destructor.
-*/
-Sketch::~Sketch()
-{
-
-}
-
-
-/*!
- Constructor.
-
- \param V3d_Viewer
-*/
-Sketch::Sketch(const Handle(V3d_Viewer)& aViewer) :
-myInteractiveContext(new AIS_InteractiveContext(aViewer)),
-myAxisColor(Quantity_Color(Quantity_NOC_YELLOW)),
-myCurrentColor(Quantity_Color(Quantity_NOC_GREEN)),
-myWireColor(Quantity_Color(Quantity_NOC_RED))
-{
- Init();
-}
-
-/*!
- Constructor.
-
- \param V3d_Viewer
- \param Quantity_Color
- \param Quantity_Color
- \param Quantity_Color
-*/
-Sketch::Sketch(const Handle(V3d_Viewer)& aViewer,
- const Quantity_Color& anAxisColor,
- const Quantity_Color& aCurrentColor,
- const Quantity_Color& aWireColor):
-myInteractiveContext(new AIS_InteractiveContext(aViewer)),
-myAxisColor(anAxisColor),
-myCurrentColor(aCurrentColor),
-myWireColor(aWireColor)
-{
- Init();
-}
-
-/*!
- Build the current edge in a graphic mode.
- The first signature with view coordinates is used to connect to the move event from the user interface.
- The second signature is used when the current point is known by 2d real coordinates.
-
- \param Xp
- \param Yp
- \param V3d_View
-*/
-void Sketch::MakeCurrentEdge(const Standard_Integer Xp ,
- const Standard_Integer Yp ,
- const Handle(V3d_View)& aView )
-{
- /* 3d coordinates of the picked point */
- Standard_Real Xv,Yv,Zv;
- aView->Convert(Xp,Yp,Xv,Yv,Zv);
- /* computation of real 2d coordinates in plane of sketch */
- Standard_Real Vx,Vy,Vz;
- aView->Proj(Vx,Vy,Vz);
- gp_Dir D(Vx,Vy,Vz);
- gp_Pnt P(Xv,Yv,Zv);
- gp_Lin L(P,D);
- Standard_Real X,Y;
- gp_Pnt Sol;
- IntAna_IntConicQuad Int(L,myPlane->Pln(),Precision::Angular());
- if (Int.IsDone()) {
- if (!Int.IsParallel()) {
- if (Int.NbPoints() > 0 ) {
- Sol = Int.Point(1);
- ElSLib::Parameters(myPlane->Pln(),Sol,X,Y);
- }
- }
- }
- MakeCurrentEdge(X,Y);
-}
-
-/*!
- Build the current edge in a graphic mode.
- The first signature with view coordinates is used to connect to the move event from the user interface.
- The second signature is used when the current point is known by 2d real coordinates.
-
- \param X
- \param Y
-*/
-void Sketch::MakeCurrentEdge(const Standard_Real X, const Standard_Real Y)
-{
- /* Create the current edge depending on the active mode */
- switch (myCurrentStatus) {
- case BEGIN_SKETCH:
- myCurrentEdge = BRepBuilderAPI_MakeVertex(ElCLib::To3d(myPlane->Pln().Position().Ax2(),gp_Pnt2d(X,Y)));
- break;
- case SEGMENT:
- MakeCurrentSegment(X,Y);
- break;
- case ARC_CHORD:
- MakeCurrentSegment(X,Y);
- break;
- case ARC_CHORD_END:
- MakeCurrentArc(X,Y);
- break;
- }
- DisplayCurrentEdge();
-}
-
-/*!
- Build the current edge in a graphic mode.
- Function to connect to the input event from the user interface.
-*/
-void Sketch::ValidateEdge()
-{
- gp_Pnt pt;
- gp_Pnt2d pt2d;
- switch (myCurrentStatus) {
- case BEGIN_SKETCH:
- {
- myFirstPointSketch = TopoDS::Vertex(myCurrentEdge);
- myPresentableWire = new AIS_Shape(myFirstPointSketch);
- myPresentableWire->SetColor(myWireColor.Name());
- myInteractiveContext->Display(myPresentableWire);
- pt = BRep_Tool::Pnt(myFirstPointSketch);
- pt2d = ProjLib::Project(myPlane->Pln(),pt);
- myLastX = pt2d.X();
- myLastY = pt2d.Y();
- myCurrentStatus = SEGMENT;
- break;
- }
- case SEGMENT:
- {
- Standard_Real first,last;
- TopLoc_Location L;
- Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(TopoDS::Edge(myCurrentEdge),myPlane,L,first,last);
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(Handle(Geom2d_Line)::DownCast(C)->Lin2d(),0.,myLengthDimension->Value());
- if (myTransitionStatus == ANGLE ||
- myTransitionStatus == LENGTH_FIXED ||
- myTransitionStatus == X_FIXED ||
- myTransitionStatus == Y_FIXED)
- myTransitionStatus = NOCONSTRAINT;
- AddEdgeToWire();
- break;
- }
- case ARC_CHORD:
- {
- myInteractiveContext->CloseLocalContext();
- myInteractiveContext->OpenLocalContext();
- gp_Pnt2d p1 (myLastX,myLastY);
- pt = BRep_Tool::Pnt(TopExp::LastVertex(TopoDS::Edge(myCurrentEdge)));
- gp_Pnt2d p2 = ProjLib::Project(myPlane->Pln(),pt);
- GccAna_Pnt2dBisec ComputeMediatrice(p1,p2);
- if (ComputeMediatrice.HasSolution()) {
- myMediatrice = new Geom2d_Line(ComputeMediatrice.ThisSolution());
- Handle(Geom_Curve) aMediatrice3d = GeomAPI::To3d(myMediatrice,myPlane->Pln());
- myPresentableMediatrice = new AIS_Axis(Handle(Geom_Line)::DownCast(aMediatrice3d));
- myInteractiveContext->Display(myPresentableMediatrice);
- }
- TopoDS_Edge e = BRepBuilderAPI_MakeEdge2d(gce_MakeCirc2d(gp_Pnt2d(0.,0),1.));
- BRepLib::BuildCurve3d(e);
- myLengthDimension->SetText(TCollection_ExtendedString());
- myInteractiveContext->Redisplay(myLengthDimension,Standard_False);
- if (myEdgesNumber == 0)
- myPreviousEdge = TopoDS::Edge(myCurrentEdge);
- pt2d = ProjLib::Project(myPlane->Pln(),pt);
- myLastX = pt2d.X();
- myLastY = pt2d.Y();
- myTransitionStatus = NOCONSTRAINT;
- myCurrentStatus = ARC_CHORD_END;
- break;
- }
- case ARC_CHORD_END:
- myCurrentStatus = ARC_CHORD;
- AddEdgeToWire();
- break;
- }
-}
-
-/*!
- Add edge to current wire on an edge validation .
-*/
-void Sketch::AddEdgeToWire()
-{
- myPreviousEdge = TopoDS::Edge(myCurrentEdge);
- BRepLib::BuildCurve3d(myPreviousEdge);
- myCurrentWire.Add(TopoDS::Edge(myPreviousEdge));
- myEdgesNumber++;
- myPresentableWire->Set( myCurrentWire.Wire() );
- myInteractiveContext->Redisplay(myPresentableWire);
- myConstructionMode.Append(myCurrentStatus);
- myConstraintMode.Append(myTransitionStatus);
- myInteractiveContext->CloseLocalContext();
- gp_Pnt pt;
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD )
- pt = BRep_Tool::Pnt(TopExp::LastVertex(TopoDS::Edge(myPreviousEdge)));
- else
- pt = BRep_Tool::Pnt(TopExp::FirstVertex(TopoDS::Edge(myPreviousEdge)));
- gp_Pnt2d pt2d= ProjLib::Project(myPlane->Pln(),pt);
- myLastX = pt2d.X();
- myLastY = pt2d.Y();
-}
-
-/*!
- Set the numeric dimension for the current edge and validate creation.
-
- \param aValue
- \return Standard_Boolean
-*/
-Standard_Boolean Sketch::SetDimension(Standard_Real& aValue)
-{
- fitInResol(aValue);
- if (myCurrentStatus == SEGMENT ||
- myCurrentStatus == ARC_CHORD){
- Standard_Real first,last;
- TopLoc_Location L;
- Handle(Geom2d_Curve) C =
- BRep_Tool::CurveOnSurface(TopoDS::Edge(myCurrentEdge),myPlane,L,first,last);
- myCurrentEdge =
- BRepBuilderAPI_MakeEdge2d(Handle(Geom2d_Line)::DownCast(C)->Lin2d(),0.,aValue);
- DisplayCurrentEdge();
- if (myTransitionStatus == NOCONSTRAINT) {
- mySegmentLength = aValue;
- myTransitionStatus = LENGTH_FIXED;
- }
- else
- ValidateEdge();
- return Standard_True;
- }
-
- else if( myCurrentStatus == ARC_CHORD_END){
- if (myTransitionStatus == TANGENT) return Standard_False;
- gp_Pnt2d p;
- if (myEdgesNumber > 0) {
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopExp::LastVertex(myPreviousEdge)));
- else
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopExp::FirstVertex(myPreviousEdge)));
- }
- else
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(myFirstPointSketch));
- GccAna_Circ2d2TanRad aSol(p, gp_Pnt2d(myLastX,myLastY),aValue,Precision::Confusion());
- Standard_Real dist = RealLast();
- if (aSol.NbSolutions() > 0) {
- gp_Circ2d CirSol;
- gp_Pnt2d pc = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopoDS::Vertex(myCenterCircle->Shape())));
- for (Standard_Integer i =1; i<= aSol.NbSolutions(); i++) {
- if (pc.Distance(aSol.ThisSolution(i).Location()) < dist)
- CirSol = aSol.ThisSolution(i);
- }
- if (myCurrentEdge.Orientation() == TopAbs_FORWARD)
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(aSol.ThisSolution(1),p,gp_Pnt2d(myLastX,myLastY));
- else {
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(aSol.ThisSolution(1),gp_Pnt2d(myLastX,myLastY),p);
- myCurrentEdge.Reverse();
- }
- DisplayCurrentEdge();
- ValidateEdge();
- return Standard_True;
- }
- }
-
- return Standard_False;
-}
-
-/*!
- Set the numeric dimension for the current edge and validate creation.
-
- \param deltaX
- \param deltaY
-*/
-void Sketch::SetDimension(Standard_Real& deltaX, Standard_Real& deltaY)
-{
- fitInResol(deltaX);
- fitInResol(deltaY);
- Standard_Real X = myLastX + deltaX;
- Standard_Real Y = myLastY + deltaY;
- MakeCurrentEdge(X,Y);
- ValidateEdge();
-}
-
-/*!
- Set the numeric value of the X coordinate of current point giving a deltaX relative to previous point.
-
- \param deltaX
-*/
-void Sketch::SetXDimension(Standard_Real& deltaX)
-{
- fitInResol(deltaX);
- Standard_Real X = myLastX + deltaX;
- Standard_Real Y = myLastY;
- if ( deltaX == 0. )
- Y = Y + 100.0 * Precision::Confusion();
-
- if (myTransitionStatus == NOCONSTRAINT) {
- MakeCurrentEdge(X,Y);
- myTransitionStatus = X_FIXED;
- mySegmentX = X;
- }
- else if (myTransitionStatus == Y_FIXED) {
- myTransitionStatus = NOCONSTRAINT;
- MakeCurrentEdge(X,mySegmentY);
- ValidateEdge();
- }
- else if (myTransitionStatus == ANGLE) {
- myTransitionStatus = NOCONSTRAINT;
- Standard_Real angle;
- if (0 <= mySegmentAngle && mySegmentAngle<= PI )
- angle = PI - mySegmentAngle;
- else
- angle = mySegmentAngle - PI;
- Y = X*Tan(angle);
- MakeCurrentEdge(X,Y);
- ValidateEdge();
- }
- else
- myTransitionStatus = NOCONSTRAINT;
-}
-
-/*!
- Set the numeric value of the Y coordinate of current point giving a deltaY relative to previous point.
-
- \param deltaY
-*/
-void Sketch::SetYDimension(Standard_Real& deltaY)
-{
- fitInResol(deltaY);
- Standard_Real X = myLastX;
- Standard_Real Y = myLastY + deltaY;
-
- if ( deltaY == 0. )
- X = X + 100.0 * Precision::Confusion();
-
- if (myTransitionStatus == NOCONSTRAINT) {
- MakeCurrentEdge(X,Y);
- myTransitionStatus = Y_FIXED;
- mySegmentY = Y;
- }
- else if (myTransitionStatus == X_FIXED) {
- myTransitionStatus = NOCONSTRAINT;
- MakeCurrentEdge(mySegmentX,Y);
- ValidateEdge();
- }
- else if (myTransitionStatus == ANGLE) {
- myTransitionStatus = NOCONSTRAINT;
- Standard_Real angle;
- if (0 <= mySegmentAngle && mySegmentAngle<= PI )
- angle = PI - mySegmentAngle;
- else
- angle = mySegmentAngle - PI;
- X = Y/Tan(angle);
- MakeCurrentEdge(X,Y);
- ValidateEdge();
- }
- else
- myTransitionStatus = NOCONSTRAINT;
-}
-
-/*!
- Set the numeric value of angle between 2 segments.
-
- \param aValue
-*/
-void Sketch::SetSegmentAngle(Standard_Real& aValue)
-{
- if (myEdgesNumber > 0) {
- Standard_Real First,Last;
- TopLoc_Location L;
- Standard_Real angle;
- if (0 <= aValue && aValue<= PI )
- angle = PI - aValue;
- else
- angle = aValue - PI;
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,First,Last);
- if (PreviousCurve->IsKind(STANDARD_TYPE(Geom2d_Line))) {
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(TopoDS::Edge(myPreviousEdge),myPlane,L,First,Last);
-
- GccAna_Lin2dTanObl aSol(gp_Pnt2d(myLastX,myLastY),Handle(Geom2d_Line)::DownCast(PreviousCurve)->Lin2d(),angle);
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(aSol.ThisSolution(1),0.,myLengthDimension->Value());
- }
- if (myTransitionStatus == LENGTH_FIXED) {
- ValidateEdge();
- }
- else if (myTransitionStatus == X_FIXED) {
- Standard_Real length = mySegmentX/Cos(angle);
- SetDimension(length);
- ValidateEdge();
- }
- else if (myTransitionStatus == Y_FIXED) {
- Standard_Real length = mySegmentY/Sin(angle);
- SetDimension(length);
- ValidateEdge();
- }
- else {
- mySegmentAngle = aValue;
- myTransitionStatus = ANGLE;
- }
- }
-}
-
-/*!
- Get the angle value between 2 segments.
-
- \return Standard_Real
-*/
-Standard_Real Sketch::GetSegmentAngle()
-{
- return mySegmentAngle;
-}
-
-/*!
- Close automatically an open sketch.
-
- \return TopoDS_Wire. Return null shape if not possible.
-*/
-TopoDS_Wire Sketch::Close()
-{
- myCurrentStatus = END_SKETCH;
- myInteractiveContext->CloseAllContexts();
- myInteractiveContext->EraseAll(Standard_False);
- if (myEdgesNumber >= 2) {
- BRepTools_WireExplorer Ex(myCurrentWire.Wire());
- TopoDS_Vertex V1;
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- V1 = TopExp::LastVertex(myPreviousEdge);
- else
- V1 = TopExp::FirstVertex(myPreviousEdge);
- myCurrentWire.Add(BRepBuilderAPI_MakeEdge(V1,myFirstPointSketch).Edge());
- myEdgesNumber++;
- return myCurrentWire.Wire();
- }
- else
- return TopoDS_Wire();
-}
-
-
-
-/*!
- Clear sketch presentation.
-*/
-void Sketch::Clear()
-{
- myCurrentStatus = END_SKETCH;
- myInteractiveContext->CloseAllContexts();
- myInteractiveContext->EraseAll(Standard_False);
-}
-
-/*!
- Terminate sketch without closing.
-
- \return TopoDS_Wire. Return null shape if not possible.
-*/
-TopoDS_Wire Sketch::End()
-{
- myCurrentStatus = END_SKETCH;
- myInteractiveContext->CloseAllContexts();
- myInteractiveContext->EraseAll(Standard_False);
- if (myCurrentWire.IsDone()) {
- return myCurrentWire.Wire();
- }
- else
- return TopoDS_Wire();
-}
-
-
-/*!
- Delete current edge.
-*/
-Standard_Boolean Sketch::Delete()
-{
- myInteractiveContext->Erase(myAngleDimension,Standard_True,Standard_False);
- myInteractiveContext->Erase(myLengthDimension,Standard_True,Standard_False);
- myInteractiveContext->Erase(myRadiusDimension,Standard_True,Standard_False);
- myInteractiveContext->Erase(myCenterCircle,Standard_True,Standard_False);
- myInteractiveContext->Erase(myXDimension,Standard_True,Standard_False);
- myInteractiveContext->Erase(myYDimension,Standard_True,Standard_False);
-
- if (myCurrentStatus == BEGIN_SKETCH) {
- myCurrentStatus = END_SKETCH;
- myInteractiveContext->CloseAllContexts();
- myInteractiveContext->EraseAll(Standard_False);
- return true;
- }
- else if(myCurrentStatus == SEGMENT ||
- myCurrentStatus == ARC_CHORD ) {
- RemoveLastEdge();
- }
- else if(myCurrentStatus == ARC_CHORD_END) {
- myCurrentStatus = ARC_CHORD;
- myInteractiveContext->CloseAllContexts();
- }
- gp_Pnt pt;
- if (myEdgesNumber == 0) {
- //myInteractiveContext->EraseAll(Standard_False);
- ChangeMode(BEGIN_SKETCH); // DCQ
- pt = BRep_Tool::Pnt(myFirstPointSketch);
- }
- else {
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD )
- pt = BRep_Tool::Pnt(TopExp::LastVertex(TopoDS::Edge(myPreviousEdge)));
- else
- pt = BRep_Tool::Pnt(TopExp::FirstVertex(TopoDS::Edge(myPreviousEdge)));
- }
- gp_Pnt2d pt2d= ProjLib::Project(myPlane->Pln(),pt);
- myLastX = pt2d.X();
- myLastY = pt2d.Y();
-
- return false;
-}
-
-/*!
- Set a specific plane for sketch.
-
- \param GeomyPlane
-*/
-void Sketch::SetPlane(const Handle(Geom_Plane)& aPlane)
-{
- myPlane = aPlane;
-}
-
-/*!
- Set display parameters.
-
- \param aColor
-*/
-void Sketch::SetWireColor(const Quantity_Color& aColor)
-{
- myWireColor = aColor;
-}
-
-/*!
- Set display parameters.
-
- \param aColor
-*/
-void Sketch::SetCurrentColor(const Quantity_Color& aColor)
-{
- myCurrentColor = aColor;
-}
-
-/*!
- Set display parameters.
-
- \param aColor
-*/
-void Sketch::SetAxisColor(const Quantity_Color& aColor)
-{
- myAxisColor = aColor;
-}
-
-
-/*!
- Change mode of construction line.
-
- \param aMode : SEGMENT, ARC_CHORD.
-*/
-void Sketch::ChangeMode(const SketchStatus aMode)
-{
- gp_Pnt2d p;
- if (myEdgesNumber > 0) {
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopExp::LastVertex(myPreviousEdge)));
- else
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopExp::FirstVertex(myPreviousEdge)));
- myLastX = p.X();
- myLastY = p.Y();
- myInteractiveContext->CloseLocalContext(myInteractiveContext->IndexOfCurrentLocal());
- }
- if (!myCurrentStatus == BEGIN_SKETCH)
- myCurrentStatus = aMode; /* change the mode only when the sketch is not in state BEGIN_SKETCH, i.d. fist point has been fixed */
-
-}
-
-/*!
- Set transition constraint between consecutive edges.
-
- \param aStatus : NOCONSTRAINT, TANGENT, PERPENDICULAR, ANGLE, LENGTH_FIXED, X_FIXED, Y_FIXED.
-*/
-void Sketch::SetTransitionStatus(const TransitionStatus aStatus)
-{
- myTransitionStatus = aStatus;
-}
-
-/*!
- Set or unset the display of dimensions.
-
- \param atype
- \param OnOff
-*/
-void Sketch::SetParameterVisibility(const TypeOfParameter atype, const Standard_Boolean OnOff)
-{
- switch (atype) {
- case ANGLE_PARAMETER:
- myIsAngleDimensionVisible = OnOff;
- if (!myIsAngleDimensionVisible && !myAngleDimension.IsNull())
- myInteractiveContext->Erase(myAngleDimension,Standard_True,Standard_False);
- //else DCQ
- // DisplayCurrentEdge();
- break;
- case LENGTH_PARAMETER:
- myIsLengthDimensionVisible = OnOff;
- if (!myIsLengthDimensionVisible&& !myLengthDimension.IsNull())
- myInteractiveContext->Erase(myLengthDimension,Standard_True,Standard_False);
- //else DCQ
- // DisplayCurrentEdge();
- break;
- case RADIUS_PARAMETER:
- myIsRadiusDimensionVisible = OnOff;
- if (!myIsRadiusDimensionVisible&& !myRadiusDimension.IsNull()){
- myInteractiveContext->Erase(myRadiusDimension,Standard_True,Standard_False);
- myInteractiveContext->Erase(myCenterCircle,Standard_True,Standard_False);
- }
- //else DCQ
- // DisplayCurrentEdge();
- break;
- case XVALUE_PARAMETER:
- myIsXDimensionVisible = OnOff;
- if (!myIsXDimensionVisible&& !myXDimension.IsNull())
- myInteractiveContext->Erase(myXDimension,Standard_True,Standard_False);
- break;
- case YVALUE_PARAMETER:
- myIsYDimensionVisible = OnOff;
- if (!myIsYDimensionVisible&& !myYDimension.IsNull())
- myInteractiveContext->Erase(myYDimension,Standard_True,Standard_False);
- break;
- }
-}
-
-/*!
- Hilight parameters.
-
- \param atype
- \param acolor
-*/
-void Sketch::HiligthWithColor(const TypeOfParameter atype, const Quantity_NameOfColor acolor)
-{
- switch (atype) {
- case ANGLE_PARAMETER:
- myInteractiveContext->HilightWithColor(myAngleDimension, acolor);
- break;
- case LENGTH_PARAMETER:
- myInteractiveContext->HilightWithColor(myLengthDimension, acolor);
- break;
- case RADIUS_PARAMETER:
- myInteractiveContext->HilightWithColor(myRadiusDimension, acolor);
- break;
- case XVALUE_PARAMETER:
- myInteractiveContext->HilightWithColor(myXDimension, acolor);
- break;
- case YVALUE_PARAMETER:
- myInteractiveContext->HilightWithColor(myYDimension, acolor);
- break;
- }
-}
-
-
-/*!
- Unhilight parameters.
-
- \param atype
-*/
-void Sketch::Unhiligth(const TypeOfParameter atype)
-{
- switch (atype) {
- case ANGLE_PARAMETER:
- myInteractiveContext->Unhilight(myAngleDimension);
- break;
- case LENGTH_PARAMETER:
- myInteractiveContext->Unhilight(myLengthDimension);
- break;
- case RADIUS_PARAMETER:
- myInteractiveContext->Unhilight(myRadiusDimension);
- break;
- case XVALUE_PARAMETER:
- myInteractiveContext->Unhilight(myXDimension);
- break;
- case YVALUE_PARAMETER:
- myInteractiveContext->Unhilight(myYDimension);
- break;
- }
-}
-
-/*!
- Check if the edition of a type of parameter is relevant depending on sketch current status.
-
- \param atype
- \return Standard_Boolean
-*/
-Standard_Boolean Sketch::IsValidCurrentParameter(const TypeOfParameter atype)
-{
- switch (atype) {
- case ANGLE_PARAMETER:
- if (myCurrentStatus != SEGMENT && myCurrentStatus != ARC_CHORD)
- return Standard_False;
- else if (myTransitionStatus == TANGENT || myTransitionStatus == PERPENDICULAR)
- return Standard_False;
- else if (myEdgesNumber < 1)
- return Standard_False;
- else {
- TopLoc_Location L;
- Standard_Real First,Last;
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,First,Last);
- if (!PreviousCurve->IsKind(STANDARD_TYPE(Geom2d_Line)))
- return Standard_False;
- }
- break;
- case LENGTH_PARAMETER:
- if (myCurrentStatus != SEGMENT &&
- myCurrentStatus != ARC_CHORD /*&&
- myCurrentStatus != CURVE_POINTS*/
- )
- return Standard_False;
- else if (myTransitionStatus == LENGTH_FIXED)
- return Standard_False;
- break;
- case RADIUS_PARAMETER:
- if (myCurrentStatus != ARC_CHORD_END)
- return Standard_False;
- break;
- case XVALUE_PARAMETER:
- if (myCurrentStatus != SEGMENT &&
- myCurrentStatus != ARC_CHORD /*&&
- myCurrentStatus != CURVE_POINTS*/
- )
- return Standard_False;
- else if (myTransitionStatus == X_FIXED)
- return Standard_False;
- break;
- case YVALUE_PARAMETER:
- if (myCurrentStatus != SEGMENT &&
- myCurrentStatus != ARC_CHORD /*&&
- myCurrentStatus != CURVE_POINTS*/
- )
- return Standard_False;
- else if (myTransitionStatus == Y_FIXED)
- return Standard_False;
- break;
- }
- return Standard_True;
-}
-
-/*!
- Set a parameter value.
-
- \param atype
- \param aValue
-*/
-void Sketch::SetParameterValue(const TypeOfParameter atype, Standard_Real aValue)
-{
- switch (atype) {
- case ANGLE_PARAMETER:
- SetSegmentAngle(aValue);
- break;
- case LENGTH_PARAMETER:
- SetDimension(aValue);
- break;
- case RADIUS_PARAMETER:
- SetDimension(aValue);
- break;
- case XVALUE_PARAMETER:
- SetXDimension(aValue);
- break;
- case YVALUE_PARAMETER:
- SetYDimension(aValue);
- break;
- }
-}
-
-/*!
- Initialisation of sketch parameters or options.
-*/
-void Sketch::Init()
-{
- myPlane = new Geom_Plane (0.,0.,1.,0.);
- CreateConstraints();
- BRepLib::Plane(myPlane);
- myEdgesNumber = 0;
- myCurrentStatus = BEGIN_SKETCH;
- /* In order to update the visulisation of current objects by using Redisplay method from InteractiveContext */
- myCurrentEdge = BRepBuilderAPI_MakeVertex(gp_Pnt(0.,0.,0.));
- myPresentableEdge = new AIS_Shape(myCurrentEdge);
- myPresentableEdge->SetColor(myCurrentColor.Name());
- myInteractiveContext->Display(myPresentableEdge);
- myTransitionStatus = NOCONSTRAINT;
- /* Init for display objects */
- TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.,0.,0.));
- TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(gp_Pnt(10.,0.,0.));
- myLengthDimension = new AIS_LengthDimension (V1,V2,myPlane,0.,TCollection_ExtendedString());
- myXDimension = new AIS_LengthDimension (V1,V2,myPlane,0.,TCollection_ExtendedString(),gp_Pnt(),DsgPrs_AS_NONE,
- AIS_TOD_Horizontal);
- myYDimension = new AIS_LengthDimension (V1,V2,myPlane,0.,TCollection_ExtendedString(),gp_Pnt(),DsgPrs_AS_NONE,
- AIS_TOD_Vertical);
- myRadiusDimension = new AIS_LengthDimension (V1,V2,myPlane,0.,TCollection_ExtendedString());
- myCenterCircle = new AIS_Shape(V1);
- myIsLengthDimensionVisible = Standard_False;
- myIsXDimensionVisible = Standard_False;
- myIsYDimensionVisible = Standard_False;
- myIsRadiusDimensionVisible = Standard_False;
-}
-
-/*!
- Build the current segment.
-
- \param X
- \param Y
-*/
-void Sketch::MakeCurrentSegment(Standard_Real X, Standard_Real Y)
-{
- if (myTransitionStatus == NOCONSTRAINT)
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(gp_Pnt2d(myLastX,myLastY), gp_Pnt2d(X,Y));
- else if (myTransitionStatus == X_FIXED)
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(gp_Pnt2d(myLastX,myLastY),gp_Pnt2d(mySegmentX,Y));
- else if (myTransitionStatus == Y_FIXED)
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(gp_Pnt2d(myLastX,myLastY),gp_Pnt2d(X,mySegmentY));
- else if (myTransitionStatus == TANGENT && myEdgesNumber > 0) {
- Standard_Real first,last;
- TopLoc_Location L;
- Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,first,last);
- gp_Pnt2d p1;
- gp_Vec2d Vt;
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- C->D1(last,p1,Vt);
- else
- C->D1(first,p1,Vt);
- gp_Lin2d aline(p1,Vt);
- Geom2dAPI_ProjectPointOnCurve proj(gp_Pnt2d(X,Y),new Geom2d_Line(aline));
- if (proj.NbPoints() > 0)
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(p1,proj.Point(1));
- }
- else if (myTransitionStatus == PERPENDICULAR && myEdgesNumber > 0) {
- Standard_Real first,last;
- TopLoc_Location L;
- Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,first,last);
- gp_Pnt2d p1;
- gp_Lin2d perpen;
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- C->D0(last,p1);
- else
- C->D0(first,p1);
- if (C->IsKind(STANDARD_TYPE(Geom2d_Line))) {
- GccAna_Lin2dTanPer aSol(p1,Handle(Geom2d_Line)::DownCast(C)->Lin2d());
- perpen = aSol.ThisSolution(1);
- }
- else if (C->IsKind(STANDARD_TYPE(Geom2d_Circle))) {
- GccAna_Lin2dTanPer aSol(p1,Handle(Geom2d_Circle)::DownCast(C)->Circ2d());
- perpen = aSol.ThisSolution(1);
- }
- Geom2dAPI_ProjectPointOnCurve proj(gp_Pnt2d(X,Y),new Geom2d_Line(perpen));
- if (proj.NbPoints() > 0)
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(p1,proj.Point(1));
- }
- else if (myTransitionStatus == ANGLE && myEdgesNumber > 0) {
- Standard_Real First,Last;
- TopLoc_Location L;
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,First,Last);
- if (PreviousCurve->IsKind(STANDARD_TYPE(Geom2d_Line))) {
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(TopoDS::Edge(myPreviousEdge),myPlane,L,First,Last);
- Standard_Real angle;
- if (0 <= mySegmentAngle && mySegmentAngle<= PI )
- angle = PI - mySegmentAngle;
- else
- angle = mySegmentAngle - PI;
- GccAna_Lin2dTanObl aSol(gp_Pnt2d(myLastX,myLastY),Handle(Geom2d_Line)::DownCast(PreviousCurve)->Lin2d(),angle);
- Standard_Real dist = RealLast();
- gp_Pnt2d pt(X,Y),ptproj;
- for (Standard_Integer i =1; i<=aSol.NbSolutions(); i++) {
- Geom2dAPI_ProjectPointOnCurve proj(pt,new Geom2d_Line(aSol.ThisSolution(i)));
- if (pt.Distance(proj.Point(1)) < dist) {
- dist = pt.Distance(proj.Point(1));
- ptproj = proj.Point(1);
- }
- }
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(gp_Pnt2d(myLastX,myLastY),ptproj);
- }
- }
- else if (myTransitionStatus == LENGTH_FIXED && myEdgesNumber > 0) {
- Standard_Real First,Last;
- TopLoc_Location L;
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,First,Last);
- if (PreviousCurve->IsKind(STANDARD_TYPE(Geom2d_Line))) {
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(TopoDS::Edge(myPreviousEdge),myPlane,L,First,Last);
- gp_Lin2d aline = gce_MakeLin2d(gp_Pnt2d(myLastX,myLastY), gp_Pnt2d(X,Y));
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(aline,0.,mySegmentLength);
- }
- }
-}
-
-/*!
- Build the current arc.
-
- \param X
- \param Y
-*/
-void Sketch::MakeCurrentArc(Standard_Real X, Standard_Real Y)
-{
- gp_Circ2d CircSol;
- Standard_Boolean OK(Standard_False);
-
- if (myTransitionStatus == NOCONSTRAINT) {
- GccAna_Circ2d2TanOn aSol(gp_Pnt2d(myLastX,myLastY), gp_Pnt2d(X,Y),myMediatrice->Lin2d(),Precision::Confusion());
- if (aSol.NbSolutions() > 0){
- CircSol = aSol.ThisSolution(1);
- OK = Standard_True;
- }
- }
- /* Tangency with previous edge */
- else if (myTransitionStatus == TANGENT && myEdgesNumber > 0) {
- Standard_Real first,last;
- TopLoc_Location L;
- Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,first,last);
- if (C->IsKind(STANDARD_TYPE(Geom2d_Line))){
- GccAna_Circ2d2TanOn aSol(GccEnt::Unqualified(Handle(Geom2d_Line)::DownCast(C)->Lin2d()), gp_Pnt2d(myLastX,myLastY),myMediatrice->Lin2d(),Precision::Confusion());
- if (aSol.NbSolutions() > 0){
- CircSol = aSol.ThisSolution(1);
- OK = Standard_True;
- }
- }
- else if (C->IsKind(STANDARD_TYPE(Geom2d_Circle))) {
- GccAna_Circ2d2TanOn aSol(GccEnt::Unqualified(Handle(Geom2d_Circle)::DownCast(C)->Circ2d()), gp_Pnt2d(myLastX,myLastY),myMediatrice->Lin2d(),Precision::Confusion());
- if (aSol.NbSolutions() > 0){
- CircSol = aSol.ThisSolution(1);
- OK = Standard_True;
- }
- }
- else if(C->IsKind(STANDARD_TYPE(Geom2d_BSplineCurve))) {
- gp_Pnt2d pc;
- gp_Vec2d Vt;
- C->D1(last,pc,Vt);
- gp_Lin2d alin2d(pc,gp_Dir2d(Vt));
- GccAna_Circ2d2TanOn aSol(GccEnt::Unqualified(alin2d), gp_Pnt2d(myLastX,myLastY),myMediatrice->Lin2d(),Precision::Confusion());
- if (aSol.NbSolutions() > 0){
- CircSol = aSol.ThisSolution(1);
- OK = Standard_True;
- }
- }
- }
- /* Tangency with the perpendicular to the previous edge */
- else if (myTransitionStatus == PERPENDICULAR && myEdgesNumber > 0) {
- Standard_Real first,last;
- TopLoc_Location L;
- Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,first,last);
- gp_Pnt2d p1;
- gp_Lin2d perpen;
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- C->D0(last,p1);
- else
- C->D0(first,p1);
- if (C->IsKind(STANDARD_TYPE(Geom2d_Line))) {
- GccAna_Lin2dTanPer aSol(p1,Handle(Geom2d_Line)::DownCast(C)->Lin2d());
- perpen = aSol.ThisSolution(1);
- }
- else if (C->IsKind(STANDARD_TYPE(Geom2d_Circle))) {
- GccAna_Lin2dTanPer aSol(p1,Handle(Geom2d_Circle)::DownCast(C)->Circ2d());
- perpen = aSol.ThisSolution(1);
- }
- GccAna_Circ2d2TanOn aSol(GccEnt::Unqualified(perpen), gp_Pnt2d(myLastX,myLastY),myMediatrice->Lin2d(),Precision::Confusion());
- if (aSol.NbSolutions() > 0){
- CircSol = aSol.ThisSolution(1);
- OK = Standard_True;
- }
- }
-
- gp_Pnt2d p;
- if (myEdgesNumber > 0) {
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopExp::LastVertex(myPreviousEdge)));
- else
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopExp::FirstVertex(myPreviousEdge)));
- }
- else
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(myFirstPointSketch));
- if (OK){
- gp_Vec2d V1(p,gp_Pnt2d(X,Y));
- gp_Vec2d V2(p,gp_Pnt2d(myLastX,myLastY));
- if (V1.Angle(V2) > 0 )
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(CircSol,p,gp_Pnt2d(myLastX,myLastY));
- else {
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(CircSol,gp_Pnt2d(myLastX,myLastY),p);
- myCurrentEdge.Reverse();
- }
- }
- else {
- myCurrentStatus = ARC_CHORD;
- myLastX = p.X();
- myLastY = p.Y();
- myInteractiveContext->CloseLocalContext();
- }
-
-}
-
-/*!
- Display the current edge under construction with it's dimension.
-*/
-void Sketch::DisplayCurrentEdge()
-{
- myPresentableEdge->Set(myCurrentEdge);
- myInteractiveContext->Redisplay(myPresentableEdge);
- if (myCurrentStatus == SEGMENT ||
- myCurrentStatus == ARC_CHORD ) {
- /* Length dimension */
- TopoDS_Vertex V1 = TopExp::FirstVertex(TopoDS::Edge(myCurrentEdge));
- TopoDS_Vertex V2 = TopExp::LastVertex(TopoDS::Edge(myCurrentEdge));
- DisplayLengthDimension(V1,V2);
- /* Angular dimension */
- DisplayAngleDimension();
- DisplayXDimension(V1,V2);
- DisplayYDimension(V1,V2);
- }
- else if (myCurrentStatus == ARC_CHORD_END )
- DisplayRadiusDimension();
- else {
- TopoDS_Vertex V1 = TopoDS::Vertex(myCurrentEdge);
- TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.,0.,0.));
- DisplayXDimension(V1,V2);
- DisplayYDimension(V1,V2);
- }
-
-}
-
-/*!
- Display the current length dimension.
-
- \param V1
- \param V2
-*/
-void Sketch::DisplayLengthDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2)
-{
- gp_Pnt p1 = BRep_Tool::Pnt(TopoDS::Vertex(V1));
- gp_Pnt p2 = BRep_Tool::Pnt(TopoDS::Vertex(V2));
- Standard_Real length = p1.Distance(p2);
- if (length <= Precision::Confusion()) return;
- myLengthDimension->SetFirstShape(V1);
- myLengthDimension->SetSecondShape(V2);
- fitInResol(length);
- myLengthDimension->SetValue(length);
- QString S;
- S.sprintf("%.1f",length);
- myLengthDimension->SetText(TCollection_ExtendedString(strdup(S)));
- if (myIsLengthDimensionVisible) {
- if (myInteractiveContext->IsDisplayed(myLengthDimension))
- myInteractiveContext->Redisplay(myLengthDimension);
- else
- myInteractiveContext->Display(myLengthDimension);
- }
-}
-
-/*!
- Display the current X dimension.
-
- \param V1
- \param V2
-*/
-void Sketch::DisplayXDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2)
-{
- if (myTransitionStatus != X_FIXED) {
- gp_Pnt p1 = BRep_Tool::Pnt(TopoDS::Vertex(V1));
- gp_Pnt p2 = BRep_Tool::Pnt(TopoDS::Vertex(V2));
-
- gp_Lin aline(p1,myPlane->Pln().XAxis().Direction());
- GeomAPI_ProjectPointOnCurve proj(p2,new Geom_Line(aline));
-
- gp_Pnt pb = p1;
-
- if (proj.NbPoints() > 0) {
- Standard_Real length = p1.Distance(proj.Point(1));
- if (length <= Precision::Confusion()) return;
- myXDimension->SetFirstShape(V1);
- myXDimension->SetSecondShape(V2);
- fitInResol(length);
- myXDimension->SetValue(length);
- QString S;
- S.sprintf("%.1f",length);
- myXDimension->SetText(TCollection_ExtendedString(strdup(S)));
- // myXDimension->SetPosition(proj.Point(1));
- pb.BaryCenter(5,proj.Point(1),5);
- myXDimension->SetPosition(pb);
- if (myIsXDimensionVisible) {
- if (myInteractiveContext->IsDisplayed(myXDimension))
- myInteractiveContext->Redisplay(myXDimension);
- else
- myInteractiveContext->Display(myXDimension);
- }
- }
- } else
- myInteractiveContext->Erase(myXDimension,Standard_True,Standard_False);
-}
-
-/*!
- Display the current Y dimension.
-
- \param V1
- \param V2
-*/
-void Sketch::DisplayYDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2)
-{
- if (myTransitionStatus != Y_FIXED) {
-
- gp_Pnt p1 = BRep_Tool::Pnt(TopoDS::Vertex(V1));
- gp_Pnt p2 = BRep_Tool::Pnt(TopoDS::Vertex(V2));
- gp_Lin aline(p2 /*p1*/, myPlane->Pln().YAxis().Direction());
- gp_Pnt pb = p2 /*p1*/;
- GeomAPI_ProjectPointOnCurve proj(p1 /*p2*/,new Geom_Line(aline));
- if (proj.NbPoints() > 0) {
- Standard_Real length = /*p1*/ p2.Distance(proj.Point(1));
- if (length <= Precision::Confusion()) return;
- myYDimension->SetFirstShape(V1);
- myYDimension->SetSecondShape(V2);
- fitInResol(length);
- myYDimension->SetValue(length);
- QString S;
- S.sprintf("%.1f",length);
- myYDimension->SetText(TCollection_ExtendedString(strdup(S)));
- pb.BaryCenter(5,proj.Point(1),5);
- myYDimension->SetPosition(pb);
- // myYDimension->SetPosition(p2);
- if (myIsYDimensionVisible) {
- if (myInteractiveContext->IsDisplayed(myYDimension))
- myInteractiveContext->Redisplay(myYDimension);
- else
- myInteractiveContext->Display(myYDimension);
- }
- }
- } else
- myInteractiveContext->Erase(myYDimension,Standard_True,Standard_False);
-}
-
-/*!
- Display the current angle dimension.
-*/
-void Sketch::DisplayAngleDimension()
-{
- if (!myIsAngleDimensionVisible)
- return;
- if (myEdgesNumber > 0) {
- Standard_Real First,Last;
- TopLoc_Location L;
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,First,Last);
- Handle (Geom2d_Curve) CurrentCurve = BRep_Tool::CurveOnSurface(TopoDS::Edge(myCurrentEdge),myPlane,L,First,Last);
- if (PreviousCurve->IsKind(STANDARD_TYPE(Geom2d_Line)) && CurrentCurve->IsKind(STANDARD_TYPE(Geom2d_Line))) {
- Standard_Real angle = Handle(Geom2d_Line)::DownCast(PreviousCurve)->Lin2d().Angle(Handle(Geom2d_Line)::DownCast(CurrentCurve)->Lin2d());
- gp_Pnt2d apos;
- if (0 <= angle && angle<= PI)
- angle = PI - angle;
- else
- angle = PI + angle;
- CurrentCurve->D0((First+Last)/5.,apos);
- gp_Pnt apos3d = ElCLib::To3d(myPlane->Pln().Position().Ax2(),apos);
- Standard_Real angtext = angle*180./PI;
- mySegmentAngle = angle;
- BRepLib::BuildCurve3d(TopoDS::Edge(myCurrentEdge));
- fitInResol(angtext);
-
- QString S;
- S.sprintf("%.1f",angtext);
- if (myInteractiveContext->IndexOfCurrentLocal() == 0) {
- myInteractiveContext->OpenLocalContext();
- myAngleDimension = new AIS_AngleDimension(myPreviousEdge,TopoDS::Edge(myCurrentEdge),myPlane,angle,
- TCollection_ExtendedString(strdup(S)));
- myInteractiveContext->Display(myAngleDimension);
- }
- else {
- myAngleDimension->SetSecondShape(myCurrentEdge);
- myAngleDimension->SetValue(angle);
- myAngleDimension->SetPosition(apos3d);
- myAngleDimension->SetText(TCollection_ExtendedString(strdup(S)));
- myInteractiveContext->Redisplay(myAngleDimension);
- }
- }
- }
-}
-
-/*!
- Display the current radius dimension.
-*/
-void Sketch::DisplayRadiusDimension()
-{
- if (! myIsRadiusDimensionVisible)
- return;
- BRepLib::BuildCurve3d(TopoDS::Edge(myCurrentEdge));
- Standard_Real First,Last;
- Handle (Geom_Circle) C = Handle (Geom_Circle)::DownCast(BRep_Tool::Curve(TopoDS::Edge(myCurrentEdge),First,Last));
- if (!C.IsNull()) {
- Standard_Real R = C->Radius();
- TopoDS_Shape V1 = BRepBuilderAPI_MakeVertex(C->Location());
- gp_Pnt MidlePoint ;
- C->D0((First+Last)/2.,MidlePoint);
- TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(MidlePoint);
- myRadiusDimension->SetFirstShape(V1);
- myRadiusDimension->SetSecondShape(V2);
- myRadiusDimension->SetValue(R);
- fitInResol(R);
- QString S;
- S.sprintf("%.1f",R);
- myRadiusDimension->SetText(TCollection_ExtendedString(strdup(S)));
- if (myInteractiveContext->IsDisplayed(myRadiusDimension))
- myInteractiveContext->Redisplay(myRadiusDimension);
- else
- myInteractiveContext->Display(myRadiusDimension);
- myCenterCircle->Set(V1);
- if (myInteractiveContext->IsDisplayed(myCenterCircle))
- myInteractiveContext->Redisplay(myCenterCircle);
- else
- myInteractiveContext->Display(myCenterCircle);
- }
-}
-
-/*!
- Remove last edge from the current wire.
-*/
-void Sketch::RemoveLastEdge()
-{
- if (myEdgesNumber == 0) {
- myCurrentStatus = END_SKETCH;
- myInteractiveContext->CloseAllContexts();
- myInteractiveContext->EraseAll(Standard_False);
- return;
- }
- else {
- BRepTools_WireExplorer Ex;
- BRepBuilderAPI_MakeWire MW;
- Standard_Integer index = 1;
- myCurrentEdge = myPreviousEdge;
- for (Ex.Init(myCurrentWire.Wire());Ex.More();Ex.Next()){
- if (index <= myEdgesNumber-1) {
- MW.Add(Ex.Current());
- myPreviousEdge = Ex.Current();
- index++;
- }
- }
- myCurrentWire = MW;
- myCurrentStatus = (SketchStatus)myConstructionMode(myEdgesNumber);
- myTransitionStatus = (TransitionStatus)myConstraintMode(myEdgesNumber);
- myEdgesNumber--;
- myConstructionMode.Remove(index);
- myConstraintMode.Remove(index);
- if (myEdgesNumber == 0)
- myPresentableWire->Set(myFirstPointSketch);
- else
- myPresentableWire->Set(myCurrentWire.Wire());
- myInteractiveContext->Redisplay(myPresentableWire);
- myInteractiveContext->CloseLocalContext();
- myPresentableEdge->Set(myCurrentEdge);
- myInteractiveContext->Redisplay(myPresentableEdge);
- }
-}
-
-/*!
- Create initial constraints.
-*/
-void Sketch::CreateConstraints()
-{
- Handle(Geom_Axis1Placement) xAxis = new Geom_Axis1Placement(myPlane->Pln().XAxis());
- Handle(Geom_Axis1Placement) yAxis = new Geom_Axis1Placement(myPlane->Pln().YAxis());
- myHAxis = new AIS_Axis(xAxis);
- myVAxis = new AIS_Axis(yAxis);
- myAngularAxis = myVAxis;
- myHAxis->SetColor(myAxisColor.Name());
- myVAxis->SetColor(myAxisColor.Name());
- myAngularAxis->SetColor(myAxisColor.Name());
-}
-
-/*!
- fitInResol.
-
- \param toFit
- \param minIsResol
-*/
-void Sketch::fitInResol(Standard_Real &toFit, Standard_Boolean minIsResol)
-{
- Standard_Real sign = (toFit < 0) ? -1. : +1.;
- Standard_Real value = toFit + sign * resol/2.0; /* why "+ resol/2.0" ? because if resol = 0.5, 3.3 is rounded to 3.5 */
- int nTimesResol = int(value/resol);
- if ((nTimesResol == 0) && (minIsResol)) nTimesResol = 1;
- toFit = nTimesResol*resol;
-}
-
-SketchStatus Sketch::GetCurrentStatus()
-{
- return myCurrentStatus;
-}
-
-Standard_Integer Sketch::GetmyEdgesNumber()
-{
- return myEdgesNumber;
-}
-
-
-
+++ /dev/null
-// GEOM SKETCHER : basic sketcher
-//
-// 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.h
-// Author : Nicolas REJNERI
-// Module : GEOM
-// $Header$
-
-#include "GEOM_SketcherStatus.h"
-
-#include <V3d_Viewer.hxx>
-#include <V3d_View.hxx>
-#include <BRepBuilderAPI_MakeWire.hxx>
-#include <Geom_Plane.hxx>
-#include <AIS_InteractiveContext.hxx>
-#include <AIS_Shape.hxx>
-#include <AIS_Axis.hxx>
-#include <TopoDS_Edge.hxx>
-#include <AIS_LengthDimension.hxx>
-#include <AIS_RadiusDimension.hxx>
-#include <AIS_AngleDimension.hxx>
-#include <Geom2d_Line.hxx>
-#include <TColStd_SequenceOfInteger.hxx>
-#include <TColgp_SequenceOfPnt2d.hxx>
-#include <gp_Vec2d.hxx>
-
-class Sketch
-{
-public:
- Sketch();
- ~Sketch();
- Sketch(const Handle(V3d_Viewer)& aViewer);
- Sketch(const Handle(V3d_Viewer)& aViewer,
- const Quantity_Color& anAxisColor,
- const Quantity_Color& aCurrentColor,
- const Quantity_Color& aWireColor);
-
- static void fitInResol(Standard_Real &toFit,
- Standard_Boolean minIsResol = Standard_False);
-
- void MakeCurrentEdge(const Standard_Integer Xp ,
- const Standard_Integer Yp ,
- const Handle(V3d_View)& aView );
-
- void MakeCurrentEdge(const Standard_Real X, const Standard_Real Y);
-
- Standard_Boolean SetDimension(Standard_Real& aValue);
- void SetDimension(Standard_Real& deltaX,Standard_Real& deltaY);
-
- void SetXDimension(Standard_Real& deltaX);
- void SetYDimension(Standard_Real& deltaY);
-
- void SetSegmentAngle(Standard_Real& aValue);
- Standard_Real GetSegmentAngle();
-
- void ValidateEdge();
-
- TopoDS_Wire Close();
- TopoDS_Wire End();
-
- void Clear();
-
- Standard_Boolean Delete();
-
- void SetPlane(const Handle(Geom_Plane)& aPlane);
-
- void SetWireColor(const Quantity_Color& aColor);
- void SetCurrentColor(const Quantity_Color& aColor);
- void SetAxisColor(const Quantity_Color& aColor);
-
- void SetParameterVisibility(const TypeOfParameter atype,
- const Standard_Boolean OnOff);
-
- void HiligthWithColor(const TypeOfParameter atype,
- const Quantity_NameOfColor acolor);
- void Unhiligth(const TypeOfParameter atype);
-
- Standard_Boolean IsValidCurrentParameter(const TypeOfParameter atype);
-
- void SetParameterValue(const TypeOfParameter atype, Standard_Real aValue);
-
- void ChangeMode(const SketchStatus aMode);
-
- void SetTransitionStatus(const TransitionStatus aStatus);
-
- SketchStatus GetCurrentStatus();
- Standard_Integer GetmyEdgesNumber();
-
-private :
-
- void Init();
-
- void MakeCurrentSegment(Standard_Real X, Standard_Real Y);
-
- void MakeCurrentArc(Standard_Real X, Standard_Real Y);
-
- void DisplayCurrentEdge();
-
- void DisplayLengthDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
- void DisplayXDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
- void DisplayYDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
- void DisplayAngleDimension();
- void DisplayRadiusDimension();
-
- void AddEdgeToWire();
-
- void RemoveLastEdge();
-
- void CreateConstraints();
-
-private:
- // Current status of construction
- SketchStatus myCurrentStatus;
- // Transition status between arcs and segments
- TransitionStatus myTransitionStatus;
- // Current wire
- BRepBuilderAPI_MakeWire myCurrentWire;
- // Current presentable wire
- Handle_AIS_Shape myPresentableWire;
- // Number of edges into the current wire
- Standard_Integer myEdgesNumber;
- // Store for each edge how it has been built i.d the value of myCurrentStatus
- TColStd_SequenceOfInteger myConstructionMode;
- // Store for each edge how it has been built i.d the value of myTransitionStatus
- TColStd_SequenceOfInteger myConstraintMode;
- // Current edge
- TopoDS_Shape myCurrentEdge;
- // Previous edge
- TopoDS_Edge myPreviousEdge;
- // List of points to interpolate when computing a curve by interpolation
- TColgp_SequenceOfPnt2d myPointsToInterpolate;
- // Tangent vector at beginning of curve
- gp_Vec2d myTangentVector;
- // Tangent flag at beginning og curve
- Standard_Boolean myTangentFlag;
-
- // Origin of sketch
- TopoDS_Vertex myFirstPointSketch;
- // Last x coordinate of end point of previous edge or picked point
- Standard_Real myLastX;
- // Last y coordinate of end point of previous edge or picked point
- Standard_Real myLastY;
- // angle between 2 segments when an ANGLE TransitionStatus is set.
- Standard_Real mySegmentAngle;
- // Length of segment when the length of the segment is fixed before the angle
- Standard_Real mySegmentLength;
- // Value of X fixed coordinate
- Standard_Real mySegmentX;
- // Value of Y fixed Coordinate
- Standard_Real mySegmentY;
- Handle_AIS_Shape myPresentableEdge; // Current presentable edge
- Handle_AIS_LengthDimension myLengthDimension;// For display of current length segment dimension
- Handle_AIS_LengthDimension myXDimension; // For display of current X segment dimension
- Handle_AIS_LengthDimension myYDimension; // For display of current Y segment dimension
- Handle_AIS_LengthDimension myRadiusDimension;// For display of current radius dimension
- Handle_AIS_AngleDimension myAngleDimension; // For display of current angle dimension
- Standard_Boolean myIsLengthDimensionVisible; // Visibility flag for LengthDimension
- Standard_Boolean myIsXDimensionVisible; // Visibility flag for X Dimension
- Standard_Boolean myIsYDimensionVisible; // Visibility flag for Y Dimension
- Standard_Boolean myIsRadiusDimensionVisible; // Visibility flag for RadiusDimension
- Standard_Boolean myIsAngleDimensionVisible; // Visibility flag for AngleDimension
- Handle_AIS_Axis myPresentableMediatrice; // Chord mediatrice of current circle as a presentable object
- Handle_Geom2d_Line myMediatrice; // Chord mediatrice of current circle as a 2d line
- Handle_AIS_Shape myCenterCircle; // to visualise center of current arc
-
- Handle_AIS_Axis myHAxis; // Horizontal axis
- Handle_AIS_Axis myVAxis; // Vertical axis
- Handle_AIS_Axis myAngularAxis; // Axis making a predefined angle with the previous edge
-
- Quantity_Color myWireColor; // Color of wire and of build edges
- Quantity_Color myCurrentColor; // Color of edge under construction
- Quantity_Color myAxisColor; // Color for axis
- Handle_AIS_InteractiveContext myInteractiveContext; // Interactive context for display management
-
- Handle_Geom_Plane myPlane; // Plane of sketch
-
- BRepBuilderAPI_MakeWire myPasteWire;
- Standard_Integer myPasteEdgesNumber;
- TColStd_SequenceOfInteger myPasteConstructionMode;
- TColStd_SequenceOfInteger myPasteConstraintMode;
-};
+++ /dev/null
-// GEOM SKETCHER : basic sketcher
-//
-// 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_SketcherStatus.h
-// Author : Nicolas REJNERI
-// Module : GEOM
-// $Header$
-
-enum TransitionStatus {
- NOCONSTRAINT, // no constraint between consecutive edges
- TANGENT, // arc and segment are tangent
- PERPENDICULAR,// arc is tangent to the perpendicular to the segment
- ANGLE, // Angular constraint between 2 segments
- LENGTH_FIXED, // Length of segment has been fixed
- X_FIXED, // X coordinate for segment has been fixed
- Y_FIXED // Y coordinate for segment has been fixed
- };
-
-enum TypeOfParameter {
- ANGLE_PARAMETER,
- LENGTH_PARAMETER,
- RADIUS_PARAMETER,
- XVALUE_PARAMETER,
- YVALUE_PARAMETER
- };
-
-enum SketchStatus {
- BEGIN_SKETCH, // Begin sketch; no edges created yet
- SEGMENT, // Current mode for creation is segment
- ARC_CHORD, // Current mode for creation is arc by chord
- ARC_CHORD_END,// Chord validated, waiting for radius or center
- END_SKETCH // End sketch
-};
# Libraries targets
LIB = libGEOMSketcher.la
-LIB_SRC = GEOM_Sketcher.cxx
+LIB_SRC = Sketcher_Profile.cxx
LIB_CLIENT_IDL = SALOME_Component.idl SALOMEDS.idl SALOME_Exception.idl GEOM_Shape.idl GEOM_Gen.idl GEOM_Kinematic.idl
# header files
-EXPORT_HEADERS= GEOM_Sketcher.h \
- GEOM_SketcherStatus.h
+EXPORT_HEADERS= Sketcher_Profile.hxx
# additionnal information to compil and link file
-CPPFLAGS += $(OCC_INCLUDES) $(QT_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
-CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
-LDFLAGS += $(QT_LIBS) $(CAS_LDPATH) -lTKTopAlgo -L${KERNEL_ROOT_DIR}/lib/salome
-
-# additional file to be cleaned
-MOSTLYCLEAN =
-CLEAN =
-DISTCLEAN =
+CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
+CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
+LDFLAGS += $(OCC_KERNEL_LIBS) $(OCC_MODELER_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome
@CONCLUDE@
--- /dev/null
+// GEOM SKETCHER : basic sketcher
+//
+// 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 : Sketcher_Profile.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+using namespace std;
+#include "Sketcher_Profile.hxx"
+
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Face.hxx>
+#include <gp_Pln.hxx>
+#include <gp_Ax2.hxx>
+#include <BRepLib.hxx>
+#include <BRepBuilderAPI_MakeVertex.hxx>
+#include <BRepBuilderAPI_MakeEdge.hxx>
+#include <BRepBuilderAPI_MakeWire.hxx>
+#include <BRepBuilderAPI_MakeFace.hxx>
+#include <Geom2d_Line.hxx>
+#include <Geom2d_Circle.hxx>
+#include <Geom_Surface.hxx>
+#include <Precision.hxx>
+#include <GeomAPI.hxx>
+
+#include <TCollection_AsciiString.hxx>
+
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SALOMEDS)
+
+//=======================================================================
+// profile
+// command to build a profile
+//=======================================================================
+Sketcher_Profile::Sketcher_Profile()
+{
+}
+
+
+//=======================================================================
+// profile
+// command to build a profile
+//=======================================================================
+Sketcher_Profile::Sketcher_Profile(const char* aCmd)
+{
+ enum {line, circle, point, none} move;
+
+ Standard_Integer i = 1;
+ Standard_Real x0, y0, x, y, dx, dy;
+ x0 = y0 = x = y = dy = 0;
+ dx = 1;
+
+ Standard_Boolean first, stayfirst, face, close;
+ first = Standard_True;
+ stayfirst = face = close = Standard_False;
+
+ TopoDS_Shape S;
+ TopoDS_Vertex MP;
+ BRepBuilderAPI_MakeWire MW;
+ gp_Ax3 DummyHP(gp::XOY());
+ gp_Pln P(DummyHP);
+ TopLoc_Location TheLocation;
+ Handle(Geom_Surface) Surface;
+
+ myOK = Standard_False;
+
+ TCollection_AsciiString aCommand(CORBA::string_dup(aCmd));
+ TCollection_AsciiString aToken = aCommand.Token(":", 1);
+ int n = 0;
+ TCollection_AsciiString aTab[aCommand.Length()];
+ while(aToken.Length() != 0) {
+ if(aCommand.Token(":", n + 1).Length() > 0)
+ aTab[n] = aCommand.Token(":", n + 1);
+ aToken = aCommand.Token(":", ++n);
+ }
+ n = n - 1;
+
+ while(i < n) {
+ Standard_Real length = 0, radius = 0, angle = 0;
+ move = point;
+
+ int n1 = 0;
+ TCollection_AsciiString a[aTab[0].Length()];
+ aToken = aTab[i].Token(" ", 1);
+ while(aToken.Length() != 0) {
+ if(aTab[i].Token(" ", n1 + 1).Length() > 0)
+ a[n1] = aTab[i].Token(" ", n1 + 1);
+ aToken = aTab[i].Token(" ", ++n1);
+ }
+ n1 = n1 - 1;
+
+ switch(a[0].Value(1))
+ {
+ case 'F':
+ {
+ if (n1 != 3) goto badargs;
+ if (!first) {
+ cout<<"profile : The F instruction must precede all moves"<<endl;
+ return;
+ }
+ x0 = x = a[1].RealValue();
+ y0 = y = a[2].RealValue();
+ stayfirst = Standard_True;
+ break;
+ }
+ case 'O':
+ {
+ if (n1 != 4) goto badargs;
+ P.SetLocation(gp_Pnt(a[1].RealValue(), a[2].RealValue(), a[3].RealValue()));
+ stayfirst = Standard_True;
+ break;
+ }
+ case 'P':
+ {
+ if (n1 != 7) goto badargs;
+ gp_Vec vn(a[1].RealValue(), a[2].RealValue(), a[3].RealValue());
+ gp_Vec vx(a[4].RealValue(), a[5].RealValue(), a[6].RealValue());
+ if (vn.Magnitude() <= Precision::Confusion() || vx.Magnitude() <= Precision::Confusion()) {
+ cout<<"profile : null direction"<<endl;
+ return;
+ }
+ gp_Ax2 ax(P.Location(), vn, vx);
+ P.SetPosition(ax);
+ stayfirst = Standard_True;
+ break;
+ }
+ case 'X':
+ {
+ if (n1 != 2) goto badargs;
+ length = a[1].RealValue();
+ if (a[0] == "XX")
+ length -= x;
+ dx = 1; dy = 0;
+ move = line;
+ break;
+ }
+ case 'Y':
+ {
+ if (n1 != 2) goto badargs;
+ length = a[1].RealValue();
+ if (a[0] == "YY")
+ length -= y;
+ dx = 0; dy = 1;
+ move = line;
+ break;
+ }
+ case 'L':
+ {
+ if (n1 != 2) goto badargs;
+ length = a[1].RealValue();
+ if (Abs(length) > Precision::Confusion())
+ move = line;
+ else
+ move = none;
+ break;
+ }
+ case 'T':
+ {
+ if (n1 != 3) goto badargs;
+ Standard_Real vx = a[1].RealValue();
+ Standard_Real vy = a[2].RealValue();
+ if (a[0] == "TT") {
+ vx -= x;
+ vy -= y;
+ }
+ length = Sqrt(vx * vx + vy * vy);
+ if (length > Precision::Confusion()) {
+ move = line;
+ dx = vx / length;
+ dy = vy / length;
+ }
+ else
+ move = none;
+ break;
+ }
+ case 'R':
+ {
+ if (n1 != 2) goto badargs;
+ angle = a[1].RealValue() * PI180;
+ if (a[0] == "RR") {
+ dx = Cos(angle);
+ dy = Sin(angle);
+ }
+ else {
+ Standard_Real c = Cos(angle);
+ Standard_Real s = Sin(angle);
+ Standard_Real t = c * dx - s * dy;
+ dy = s * dx + c * dy;
+ dx = t;
+ }
+ break;
+ }
+ case 'D':
+ {
+ if (n1 != 3) goto badargs;
+ Standard_Real vx = a[1].RealValue();
+ Standard_Real vy = a[2].RealValue();
+ length = Sqrt(vx * vx + vy * vy);
+ if (length > Precision::Confusion()) {
+ dx = vx / length;
+ dy = vy / length;
+ }
+ else
+ move = none;
+ break;
+ }
+ case 'C':
+ {
+ if (n1 != 3) goto badargs;
+ radius = a[1].RealValue();
+ if (Abs(radius) > Precision::Confusion()) {
+ angle = a[2].RealValue() * PI180;
+ move = circle;
+ }
+ else
+ move = none;
+ break;
+ }
+ case 'I':
+ {
+ if (n1 != 2) goto badargs;
+ length = a[1].RealValue();
+ if (a[0] == "IX") {
+ if (Abs(dx) < Precision::Confusion()) {
+ cout<<"profile : cannot intersect, arg "<<i-1<<endl;
+ return;
+ }
+ length = (length - x) / dx;
+ }
+ else if (a[0] == "IY") {
+ if (Abs(dy) < Precision::Confusion()) {
+ cout<<"profile : cannot intersect, arg "<<i-1<<endl;
+ return;
+ }
+ length = (length - y) / dy;
+ }
+ if (Abs(length) > Precision::Confusion())
+ move = line;
+ else
+ move = none;
+ break;
+ }
+ case 'W':
+ {
+ if (a[0] == "WW")
+ close = Standard_True;
+ else if(a[0] == "WF") {
+ close = Standard_True;
+ face = Standard_True;
+ }
+ i = n - 1;
+ break;
+ }
+ default:
+ {
+ cout<<"profile : unknown code "<<a[i]<<endl;
+ return;
+ }
+ }
+
+ again :
+ switch (move)
+ {
+ case line :
+ {
+ if (length < 0) {
+ length = -length;
+ dx = -dx;
+ dy = -dy;
+ }
+ Handle(Geom2d_Line) l = new Geom2d_Line(gp_Pnt2d(x,y),gp_Dir2d(dx,dy));
+ MW.Add(BRepBuilderAPI_MakeEdge(GeomAPI::To3d(l,P),0,length));
+ x += length*dx;
+ y += length*dy;
+ break;
+ }
+ case circle :
+ {
+ Standard_Boolean sense = Standard_True;
+ if (radius < 0) {
+ radius = -radius;
+ sense = !sense;
+ dx = -dx;
+ dy = -dy;
+ }
+ gp_Ax2d ax(gp_Pnt2d(x-radius*dy,y+radius*dx),gp_Dir2d(dy,-dx));
+ if (angle < 0) {
+ angle = -angle;
+ sense = !sense;
+ }
+ Handle(Geom2d_Circle) c = new Geom2d_Circle(ax,radius,sense);
+ MW.Add(BRepBuilderAPI_MakeEdge(GeomAPI::To3d(c,P),0,angle));
+ gp_Pnt2d p;
+ gp_Vec2d v;
+ c->D1(angle,p,v);
+ x = p.X();
+ y = p.Y();
+ dx = v.X() / radius;
+ dy = v.Y() / radius;
+ break;
+ }
+ case point:
+ {
+ MP = BRepBuilderAPI_MakeVertex(gp_Pnt(x, y, 0.0));
+ break;
+ }
+ case none:
+ {
+ i = n - 1;
+ break;
+ }
+ }
+
+ // update first
+ first = stayfirst;
+ stayfirst = Standard_False;
+
+ if(!(dx == 0 && dy == 0))
+ myLastDir.SetCoord(dx, dy, 0.0);
+ else
+ return;
+ myLastPoint.SetX(x);
+ myLastPoint.SetY(y);
+
+ // next segment....
+ i++;
+ if ((i == n) && close) {
+ // the closing segment
+ dx = x0 - x;
+ dy = y0 - y;
+ length = Sqrt(dx * dx + dy * dy);
+ move = line;
+ if (length > Precision::Confusion()) {
+ dx = dx / length;
+ dy = dy / length;
+ goto again;
+ }
+ }
+ }
+
+ // get the result, face or wire
+ if (move == none)
+ return;
+ else if (move == point)
+ S = MP;
+ else if (face)
+ S = BRepBuilderAPI_MakeFace(P, MW.Wire());
+ else
+ S = MW;
+
+ if(!TheLocation.IsIdentity())
+ S.Move(TheLocation);
+
+ myShape = S;
+ myOK = true;
+ return;
+
+ badargs :
+ cout<<"profile : bad number of arguments"<<endl;
+ return;
+}
--- /dev/null
+// GEOM SKETCHER : basic sketcher
+//
+// 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 : Sketcher_Profile.h
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#include <gp_Pnt.hxx>
+#include <gp_Dir.hxx>
+#include <TopoDS_Shape.hxx>
+
+class Sketcher_Profile
+{
+
+public:
+ Sketcher_Profile();
+ Sketcher_Profile(const char* aCmd);
+
+private:
+ gp_Pnt myLastPoint;
+ gp_Dir myLastDir;
+
+ TopoDS_Shape myShape;
+ bool myOK;
+
+public:
+ gp_Pnt GetLastPoint(){return myLastPoint;};
+ gp_Dir GetLastDir(){return myLastDir;};
+
+ const TopoDS_Shape& GetShape(){return myShape;};
+ bool IsDone(){return myOK;};
+
+};
// Module : GEOM
// $Header$
-using namespace std;
#include "TransformationGUI_MirrorDlg.h"
#include <BRepBuilderAPI_Transform.hxx>
#include <Geom_Plane.hxx>
#include <BRep_Tool.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : TransformationGUI_MirrorDlg()
// purpose : Constructs a TransformationGUI_MirrorDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "TransformationGUI_MultiRotationDlg.h"
#include <gp_Lin.hxx>
#include <BRepBuilderAPI_Transform.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : TransformationGUI_MultiRotationDlg()
// purpose : Constructs a TransformationGUI_MultiRotationDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "TransformationGUI_MultiTranslationDlg.h"
#include <gp_Lin.hxx>
#include <TopoDS_Compound.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : TransformationGUI_MultiTranslationDlg()
// purpose : Constructs a TransformationGUI_MultiTranslationDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "TransformationGUI_RotationDlg.h"
#include <gp_Lin.hxx>
#include <BRepBuilderAPI_Transform.hxx>
#include <BRepAdaptor_Curve.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : TransformationGUI_RotationDlg()
// purpose : Constructs a TransformationGUI_RotationDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "TransformationGUI_ScaleDlg.h"
#include <BRepBuilderAPI_Transform.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : TransformationGUI_ScaleDlg()
// purpose : Constructs a TransformationGUI_ScaleDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "TransformationGUI_TranslationDlg.h"
#include <BRepBuilderAPI_Transform.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : TransformationGUI_TranslationDlg()
// purpose : Constructs a TransformationGUI_TranslationDlg which is a child of 'parent', with the