DCQ: Kinematic...

This commit is contained in:
dcq 2004-05-18 13:40:50 +00:00
parent c122201d99
commit 26eae87995
147 changed files with 8035 additions and 6272 deletions

View File

@ -8,8 +8,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>307</width> <width>321</width>
<height>147</height> <height>295</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -51,6 +51,22 @@
<number>6</number> <number>6</number>
</property> </property>
<widget class="QGroupBox" row="2" column="0"> <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"> <property name="name">
<cstring>GroupButtons</cstring> <cstring>GroupButtons</cstring>
</property> </property>
@ -203,19 +219,51 @@
</widget> </widget>
<widget class="QGroupBox" row="1" column="0"> <widget class="QGroupBox" row="1" column="0">
<property name="name"> <property name="name">
<cstring>GroupMedium</cstring> <cstring>GroupBoxName</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="title"> <property name="title">
<string></string> <string>Result name</string>
</property> </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> </widget>
</grid> </grid>
</widget> </widget>

View File

@ -26,7 +26,6 @@
// Module : GEOM // Module : GEOM
// $Header: // $Header:
using namespace std;
#include "EntityGUI.h" #include "EntityGUI.h"
#include "QAD_RightFrame.h" #include "QAD_RightFrame.h"
@ -36,18 +35,18 @@ using namespace std;
#include "SALOMEGUI_ImportOperation.h" #include "SALOMEGUI_ImportOperation.h"
#include "SALOMEGUI_QtCatchCorbaException.hxx" #include "SALOMEGUI_QtCatchCorbaException.hxx"
#include <BRepTools_WireExplorer.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Compound.hxx> #include <TopoDS_Compound.hxx>
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx> #include <BRep_Builder.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx> #include <TopExp_Explorer.hxx>
#include <Geom_Circle.hxx>
#include <Precision.hxx>
#include "DisplayGUI.h" #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() // function : EntityGUI()
@ -59,6 +58,9 @@ EntityGUI::EntityGUI() :
myGeomBase = new GEOMBase(); myGeomBase = new GEOMBase();
myGeomGUI = GEOMContext::GetGeomGUI(); myGeomGUI = GEOMContext::GetGeomGUI();
myGeom = myGeomGUI->myComponentGeom; myGeom = myGeomGUI->myComponentGeom;
mySimulationShape1 = new AIS_Shape(TopoDS_Shape());
mySimulationShape2 = new AIS_Shape(TopoDS_Shape());
} }
@ -81,126 +83,12 @@ bool EntityGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
myEntityGUI->myGeomGUI->EmitSignalDeactivateDialog(); myEntityGUI->myGeomGUI->EmitSignalDeactivateDialog();
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection()); SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
switch (theCommandID) switch (theCommandID)
{ {
case 404: // SKETCHER case 404: // SKETCHER
{ {
((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->onViewTop(); // DCQ : 28/02/2002 ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->onViewTop(); // DCQ : 28/02/2002
EntityGUI_SketcherDlg* aDlg = new EntityGUI_SketcherDlg(parent, "", myEntityGUI, Sel);
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));
break; break;
} }
case 407: // EXPLODE : use ic case 407: // EXPLODE : use ic
@ -223,258 +111,101 @@ bool EntityGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
} }
//=======================================================================
// function : OnSketchSetAngle()
// purpose :
//=======================================================================
void EntityGUI::OnSketchSetAngle()
{
Standard_Real anAngle = myGeomGUI->GetSketcher().GetSegmentAngle()/PI180;
Sketch::fitInResol(anAngle);
Standard_Boolean res = false;
QString Value = QString("%1").arg(anAngle);
anAngle = myGeomBase->Parameter(res, Value, tr("GEOM_MEN_ANGLE"), tr("GEOM_MEN_ENTER_ANGLE"),
-180.0, +180.0, 6) * PI180;
if(res) {
myGeomGUI->GetSketcher().SetSegmentAngle(anAngle);
QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
Mb->setItemChecked(4052, false);
Mb->setItemChecked(4053, false);
}
return;
}
//=======================================================================
// function : OnSketchSetx()
// purpose :
//=======================================================================
void EntityGUI::OnSketchSetx()
{
Standard_Boolean res = false;
double X = myGeomBase->Parameter(res, "0.", tr("GEOM_MEN_X"), tr("GEOM_MEN_SKETCHER_X"),
2.0 * Precision::Confusion(), 1E6, 6);
if(res)
myGeomGUI->GetSketcher().SetXDimension(X);
QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
Mb->setItemChecked(4052, false);
Mb->setItemChecked(4053, false);
return;
}
//=======================================================================
// function : OnSketchSety()
// purpose :
//=======================================================================
void EntityGUI::OnSketchSety()
{
Standard_Boolean res = false;
double Y = myGeomBase->Parameter(res, "0.", tr("GEOM_MEN_Y"), tr("GEOM_MEN_SKETCHER_Y"), 2.0 * Precision::Confusion(), 1E6, 6);
if(res)
myGeomGUI->GetSketcher().SetYDimension(Y);
QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
Mb->setItemChecked(4052, false);
Mb->setItemChecked(4053, false);
return;
}
//=======================================================================
// function : OnSketchDelete()
// purpose :
//=======================================================================
void EntityGUI::OnSketchDelete()
{
if(myGeomGUI->GetSketcher().GetmyEdgesNumber() == 1) {
QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
Mb->setItemEnabled(405, false); // SKETCH CONTRAINTS
myGeomGUI->GetSketcher().SetTransitionStatus(NOCONSTRAINT);
}
if(myGeomGUI->GetSketcher().Delete())
myGeomGUI->myState = -1;
return;
}
//=======================================================================
// function : OnSketchClose()
// purpose :
//=======================================================================
void EntityGUI::OnSketchClose()
{
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
Handle(AIS_InteractiveContext) myContext = v3d->getAISContext();
TopoDS_Wire W = myGeomGUI->GetSketcher().Close();
if(!W.IsNull()) {
GEOM::GEOM_Gen::ListOfIOR_var listShapes = new GEOM::GEOM_Gen::ListOfIOR;
listShapes->length(0);
unsigned int i = 0;
BRepTools_WireExplorer Ex(W);
while(Ex.More()) {
TopoDS_Edge E = Ex.Current();
gp_Pnt pt1, pt2;
pt1 = BRep_Tool::Pnt(TopExp::FirstVertex(E));
pt2 = BRep_Tool::Pnt(TopExp::LastVertex(E));
gp_Pnt CenterPoint;
Handle(Geom_Curve) Curve;
Handle(Geom_Circle) Circle;
gp_Circ Circ;
Standard_Real First,Last;
Curve = BRep_Tool::Curve(E,First,Last);
if(Curve->IsKind(STANDARD_TYPE(Geom_Circle))) {
Circle = Handle(Geom_Circle)::DownCast(Curve); // pointer on geom_circ
Circ = Circle->Circ(); // gp_Circ
Curve->D0((First + Last) / 2., CenterPoint);
GEOM::PointStruct pI = myGeom->MakePointStruct(pt1.X(), pt1.Y(), pt1.Z());
GEOM::PointStruct pC = myGeom->MakePointStruct(CenterPoint.X(), CenterPoint.Y(), CenterPoint.Z());
GEOM::PointStruct pE = myGeom->MakePointStruct(pt2.X(), pt2.Y(), pt2.Z());
GEOM::GEOM_Shape_var arc;
try {
arc = myGeom->MakeArc(pI, pC, pE);
}
catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
}
listShapes->length(i+1);
listShapes[i] = strdup(arc->Name());
i++;
}
else {
GEOM::PointStruct pI = myGeom->MakePointStruct(pt1.X(), pt1.Y(), pt1.Z());
GEOM::PointStruct pE = myGeom->MakePointStruct(pt2.X(), pt2.Y(), pt2.Z());
GEOM::GEOM_Shape_var segment;
try {
segment = myGeom->MakeEdge(pI,pE);
}
catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
}
listShapes->length(i+1);
listShapes[i] = strdup(segment->Name());
i++;
}
Ex.Next();
}
GEOM::GEOM_Shape_var Wire = myGeom->MakeWire(listShapes);
TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, Wire);
Standard_CString type;
myGeomBase->GetShapeTypeString(S,type);
Wire->NameType(type);
if(myGeomBase->Display(Wire))
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
}
myGeomGUI->myState = -1;
QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
Mb->setItemEnabled(405, false); // SKETCH CONTRAINTS
myGeomGUI->GetSketcher().SetTransitionStatus(NOCONSTRAINT);
return;
}
//======================================================================= //=======================================================================
// function : OnSketchEnd() // function : OnSketchEnd()
// purpose : // purpose :
//======================================================================= //=======================================================================
void EntityGUI::OnSketchEnd() void EntityGUI::OnSketchEnd(const char *Cmd)
{ {
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); try {
Handle (AIS_InteractiveContext) myContext = v3d->getAISContext(); GEOM::GEOM_Shape_var result = myGeom->MakeSketcher(Cmd);
if(result->_is_nil()) {
TopoDS_Wire W = myGeomGUI->GetSketcher().End(); QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
if(!W.IsNull()) { return;
GEOM::GEOM_Gen::ListOfIOR_var listShapes = new GEOM::GEOM_Gen::ListOfIOR;
listShapes->length(0);
unsigned int i = 0;
BRepTools_WireExplorer Ex(W);
while(Ex.More()) {
TopoDS_Edge E = TopoDS::Edge(Ex.Current());
gp_Pnt pt1, pt2;
pt1 = BRep_Tool::Pnt(TopExp::FirstVertex(E));
pt2 = BRep_Tool::Pnt(TopExp::LastVertex(E));
gp_Pnt CenterPoint;
Handle(Geom_Curve) Curve;
Handle(Geom_Circle) Circle;
gp_Circ Circ;
Standard_Real First,Last;
Curve = BRep_Tool::Curve(E,First,Last);
if(Curve->IsKind(STANDARD_TYPE(Geom_Circle))) {
Circle = Handle(Geom_Circle)::DownCast(Curve); // pointer on geom_circ
Circ = Circle->Circ(); // gp_Circ
Curve->D0((First + Last) / 2., CenterPoint);
GEOM::PointStruct pI = myGeom->MakePointStruct(pt1.X(), pt1.Y(), pt1.Z());
GEOM::PointStruct pC = myGeom->MakePointStruct(CenterPoint.X(), CenterPoint.Y(), CenterPoint.Z());
GEOM::PointStruct pE = myGeom->MakePointStruct(pt2.X(), pt2.Y(), pt2.Z());
GEOM::GEOM_Shape_var arc;
try {
arc = myGeom->MakeArc(pI, pC, pE);
}
catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
}
listShapes->length(i+1);
listShapes[i] = strdup(arc->Name());
i++;
} else {
GEOM::PointStruct pI = myGeom->MakePointStruct(pt1.X(), pt1.Y(), pt1.Z());
GEOM::PointStruct pE = myGeom->MakePointStruct(pt2.X(), pt2.Y(), pt2.Z());
GEOM::GEOM_Shape_var segment;
try {
segment = myGeom->MakeEdge(pI,pE);
}
catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
}
listShapes->length(i+1);
listShapes[i] = strdup(segment->Name());
i++;
}
Ex.Next();
} }
result->NameType(tr("GEOM_WIRE"));
GEOM::GEOM_Shape_var Wire = myGeom->MakeWire(listShapes); if(myGeomBase->Display(result))
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")); QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
} }
myGeomGUI->myState = -1; catch(const SALOME::SALOME_Exception& S_ex) {
QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar(); QtCatchCorbaException(S_ex);
Mb->setItemEnabled(405, false); // SKETCH CONTRAINTS }
myGeomGUI->GetSketcher().SetTransitionStatus(NOCONSTRAINT);
return; return;
} }
//=====================================================================================
// function : DisplaySimulationShape()
// purpose : Displays 'this->mySimulationShape' a pure graphical shape from a TopoDS_Shape
//=====================================================================================
void EntityGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2)
{
//NRI DEBUG : 14/02/2002
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
return;
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
try {
if(!S1.IsNull()) {
/* erase any previous */
ic->Erase(mySimulationShape1, Standard_True, Standard_False);
ic->ClearPrs(mySimulationShape1);
mySimulationShape1 = new AIS_Shape(TopoDS_Shape());
mySimulationShape1->Set(S1);
mySimulationShape1->SetColor(Quantity_NOC_RED);
ic->Deactivate(mySimulationShape1);
ic->Display(mySimulationShape1, Standard_False);
mySimulationShape1->UnsetColor();
}
if(!S2.IsNull()) {
ic->Erase(mySimulationShape2, Standard_True, Standard_False);
ic->ClearPrs(mySimulationShape2);
mySimulationShape2 = new AIS_Shape(TopoDS_Shape());
mySimulationShape2->Set(S2);
mySimulationShape2->SetColor(Quantity_NOC_VIOLET);
ic->Deactivate(mySimulationShape2);
ic->Display(mySimulationShape2, Standard_False);
mySimulationShape2->UnsetColor();
}
ic->UpdateCurrentViewer();
}
catch(Standard_Failure) {
MESSAGE("Exception catched in EntityGUI::DisplaySimulationShape ");
}
return;
}
//==================================================================================
// function : EraseSimulationShape()
// purpose : Clears the display of 'mySimulationShape' a pure graphical shape
//==================================================================================
void EntityGUI::EraseSimulationShape(int Sh)
{
int count = QAD_Application::getDesktop()->getActiveStudy()->getStudyFramesCount();
for(int i = 0; i < count; i++) {
if(QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i)->getTypeView() == VIEW_OCC) {
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i)->getRightFrame()->getViewFrame())->getViewer();
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
if(Sh < 1) {
ic->Erase(mySimulationShape1, Standard_True, Standard_False);
ic->ClearPrs(mySimulationShape1);
}
if(Sh <= 1) {
ic->Erase(mySimulationShape2, Standard_True, Standard_False);
ic->ClearPrs(mySimulationShape2);
}
ic->UpdateCurrentViewer();
}
}
}
//===================================================================================== //=====================================================================================
// function : SObjectExist() // function : SObjectExist()
// purpose : // purpose :

View File

@ -45,14 +45,10 @@ public :
static bool OnGUIEvent(int theCommandID, QAD_Desktop* parent); static bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
/* Sketcher management */ void OnSketchEnd(const char *Cmd);
void OnSketchSetAngle();
void OnSketchSetx();
void OnSketchSety();
void OnSketchDelete(); void DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2);
void OnSketchClose(); void EraseSimulationShape(int Sh = 0);
void OnSketchEnd();
/* Methods for sub shapes explode */ /* Methods for sub shapes explode */
bool SObjectExist(SALOMEDS::SObject_ptr theFatherObject, const char* IOR); bool SObjectExist(SALOMEDS::SObject_ptr theFatherObject, const char* IOR);
@ -60,6 +56,10 @@ public :
bool OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType, bool OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType,
Standard_Integer& aLocalContextId, bool& myUseLocalContext); Standard_Integer& aLocalContextId, bool& myUseLocalContext);
/* AIS shape used only during topo/geom simulations */
Handle(AIS_Shape) mySimulationShape1;
Handle(AIS_Shape) mySimulationShape2;
GEOMBase* myGeomBase; GEOMBase* myGeomBase;
GEOMContext* myGeomGUI; GEOMContext* myGeomGUI;
GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */ GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */

View File

@ -0,0 +1,94 @@
/****************************************************************************
** Form implementation generated from reading ui file 'EntityGUI_1Sel_QTD.ui'
**
** Created: Fri Apr 30 11:23:36 2004
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "EntityGUI_1Sel_QTD.h"
#include <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
}

View File

@ -0,0 +1,46 @@
/****************************************************************************
** Form interface generated from reading ui file 'EntityGUI_1Sel_QTD.ui'
**
** Created: Fri Apr 30 11:23:32 2004
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef ENTITYGUI_1SEL_QTD_H
#define ENTITYGUI_1SEL_QTD_H
#include <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

View File

@ -21,34 +21,36 @@
// //
// //
// //
// File : KinematicGUI_3Sel1Spin.cxx // File : EntityGUI_1Spin.cxx
// Author : Damien COQUERET // Author : Damien COQUERET
// Module : GEOM // Module : GEOM
// $Header: // $Header:
#include "KinematicGUI_3Sel1Spin.h" #include "EntityGUI_1Spin.h"
#include <qlayout.h> #include <qlayout.h>
#include <qspinbox.h> #include <qspinbox.h>
#include <qgroupbox.h> #include <qgroupbox.h>
/* /*
* Constructs a KinematicGUI_3Sel1Spin which is a child of 'parent', with the * Constructs a EntityGUI_1Spin which is a child of 'parent', with the
* name 'name' and widget flags set to 'f' * name 'name' and widget flags set to 'f'
*/ */
KinematicGUI_3Sel1Spin::KinematicGUI_3Sel1Spin(QWidget* parent, const char* name, WFlags fl) EntityGUI_1Spin::EntityGUI_1Spin(QWidget* parent, const char* name, WFlags fl)
:KinematicGUI_3Sel1Spin_QTD(parent, name, fl) :EntityGUI_1Spin_QTD(parent, name, fl)
{ {
SpinBox1->close(TRUE); SpinBox1->close(TRUE);
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX"); SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
Layout2->addWidget(SpinBox_DX, 0, 1); Layout1->addWidget(SpinBox_DX, 0, 1);
} }
/* /*
* Destroys the object and frees any allocated resources * Destroys the object and frees any allocated resources
*/ */
KinematicGUI_3Sel1Spin::~KinematicGUI_3Sel1Spin() EntityGUI_1Spin::~EntityGUI_1Spin()
{ {
// no need to delete child widgets, Qt does it all for us // no need to delete child widgets, Qt does it all for us
} }

View File

@ -21,27 +21,27 @@
// //
// //
// //
// File : KinematicGUI_3Sel1Spin.h // File : EntityGUI_1Spin.h
// Author : Damien COQUERET // Author : Damien COQUERET
// Module : GEOM // Module : GEOM
// $Header: // $Header:
#ifndef KINEMATICGUI_3SEL1SPIN_H #ifndef ENTITYGUI_1SPIN_H
#define KINEMATICGUI_3SEL1SPIN_H #define ENTITYGUI_1SPIN_H
#include "KinematicGUI_3Sel1Spin_QTD.h" #include "EntityGUI_1Spin_QTD.h"
#include "DlgRef_SpinBox.h" #include "DlgRef_SpinBox.h"
class KinematicGUI_3Sel1Spin : public KinematicGUI_3Sel1Spin_QTD class EntityGUI_1Spin : public EntityGUI_1Spin_QTD
{ {
Q_OBJECT Q_OBJECT
public: public:
KinematicGUI_3Sel1Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); EntityGUI_1Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
~KinematicGUI_3Sel1Spin(); ~EntityGUI_1Spin();
DlgRef_SpinBox* SpinBox_DX; DlgRef_SpinBox* SpinBox_DX;
}; };
#endif // KINEMATICGUI_3SEL1SPIN_H #endif // ENTITYGUI_1SPIN_H

View File

@ -0,0 +1,88 @@
/****************************************************************************
** Form implementation generated from reading ui file 'EntityGUI_1Spin_QTD.ui'
**
** Created: ven déc 12 11:17:10 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "EntityGUI_1Spin_QTD.h"
#include <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
}

View File

@ -0,0 +1,45 @@
/****************************************************************************
** Form interface generated from reading ui file 'EntityGUI_1Spin_QTD.ui'
**
** Created: ven déc 12 11:17:10 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef ENTITYGUI_1SPIN_QTD_H
#define ENTITYGUI_1SPIN_QTD_H
#include <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

View File

@ -0,0 +1,60 @@
// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
// File : EntityGUI_2Spin.cxx
// Author : Damien COQUERET
// Module : GEOM
// $Header:
#include "EntityGUI_2Spin.h"
#include <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
}

View File

@ -0,0 +1,48 @@
// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
// File : EntityGUI_2Spin.h
// Author : Damien COQUERET
// Module : GEOM
// $Header:
#ifndef ENTITYGUI_2SPIN_H
#define ENTITYGUI_2SPIN_H
#include "EntityGUI_2Spin_QTD.h"
#include "DlgRef_SpinBox.h"
class EntityGUI_2Spin : public EntityGUI_2Spin_QTD
{
Q_OBJECT
public:
EntityGUI_2Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
~EntityGUI_2Spin();
DlgRef_SpinBox* SpinBox_DX;
DlgRef_SpinBox* SpinBox_DY;
};
#endif // ENTITYGUI_2SPIN_H

View File

@ -0,0 +1,99 @@
/****************************************************************************
** Form implementation generated from reading ui file 'EntityGUI_2Spin_QTD.ui'
**
** Created: ven déc 12 11:17:11 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "EntityGUI_2Spin_QTD.h"
#include <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
}

View File

@ -0,0 +1,47 @@
/****************************************************************************
** Form interface generated from reading ui file 'EntityGUI_2Spin_QTD.ui'
**
** Created: ven déc 12 11:17:10 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef ENTITYGUI_2SPIN_QTD_H
#define ENTITYGUI_2SPIN_QTD_H
#include <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

View File

@ -21,40 +21,43 @@
// //
// //
// //
// File : KinematicGUI_3List3Spin.cxx // File : EntityGUI_3Spin.cxx
// Author : Damien COQUERET // Author : Damien COQUERET
// Module : GEOM // Module : GEOM
// $Header: // $Header:
#include "KinematicGUI_3List3Spin.h" #include "EntityGUI_3Spin.h"
#include <qlayout.h> #include <qlayout.h>
#include <qspinbox.h> #include <qspinbox.h>
#include <qgroupbox.h> #include <qgroupbox.h>
/* /*
* Constructs a KinematicGUI_3List3Spin which is a child of 'parent', with the * Constructs a EntityGUI_3Spin which is a child of 'parent', with the
* name 'name' and widget flags set to 'f' * name 'name' and widget flags set to 'f'
*/ */
KinematicGUI_3List3Spin::KinematicGUI_3List3Spin(QWidget* parent, const char* name, WFlags fl) EntityGUI_3Spin::EntityGUI_3Spin(QWidget* parent, const char* name, WFlags fl)
:KinematicGUI_3List3Spin_QTD(parent, name, fl) :EntityGUI_3Spin_QTD(parent, name, fl)
{ {
SpinBox1->close(TRUE); SpinBox1->close(TRUE);
SpinBox2->close(TRUE); SpinBox2->close(TRUE);
SpinBox3->close(TRUE); SpinBox3->close(TRUE);
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX"); SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
Layout1->addWidget(SpinBox_DX, 0, 1);
SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY"); SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY");
Layout1->addWidget(SpinBox_DY, 1, 1);
SpinBox_DZ = new DlgRef_SpinBox(GroupBox1, "SpinBox_DZ"); SpinBox_DZ = new DlgRef_SpinBox(GroupBox1, "SpinBox_DZ");
Layout1->addWidget(SpinBox_DX, 0, 3); Layout1->addWidget(SpinBox_DZ, 2, 1);
Layout1->addWidget(SpinBox_DY, 1, 3);
Layout1->addWidget(SpinBox_DZ, 2, 3);
} }
/* /*
* Destroys the object and frees any allocated resources * Destroys the object and frees any allocated resources
*/ */
KinematicGUI_3List3Spin::~KinematicGUI_3List3Spin() EntityGUI_3Spin::~EntityGUI_3Spin()
{ {
// no need to delete child widgets, Qt does it all for us // no need to delete child widgets, Qt does it all for us
} }

View File

@ -21,24 +21,24 @@
// //
// //
// //
// File : KinematicGUI_3List3Spin.h // File : EntityGUI_3Spin.h
// Author : Damien COQUERET // Author : Damien COQUERET
// Module : GEOM // Module : GEOM
// $Header: // $Header:
#ifndef KINEMATICGUI_3LIST3SPIN_H #ifndef ENTITYGUI_3SPIN_H
#define KINEMATICGUI_3LIST3SPIN_H #define ENTITYGUI_3SPIN_H
#include "KinematicGUI_3List3Spin_QTD.h" #include "EntityGUI_3Spin_QTD.h"
#include "DlgRef_SpinBox.h" #include "DlgRef_SpinBox.h"
class KinematicGUI_3List3Spin : public KinematicGUI_3List3Spin_QTD class EntityGUI_3Spin : public EntityGUI_3Spin_QTD
{ {
Q_OBJECT Q_OBJECT
public: public:
KinematicGUI_3List3Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); EntityGUI_3Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~KinematicGUI_3List3Spin(); ~EntityGUI_3Spin();
DlgRef_SpinBox* SpinBox_DX; DlgRef_SpinBox* SpinBox_DX;
DlgRef_SpinBox* SpinBox_DY; DlgRef_SpinBox* SpinBox_DY;
@ -46,4 +46,4 @@ public:
}; };
#endif // KINEMATICGUI_3LIST3SPIN_H #endif // ENTITYGUI_3SPIN_H

View File

@ -0,0 +1,110 @@
/****************************************************************************
** Form implementation generated from reading ui file 'EntityGUI_3Spin_QTD.ui'
**
** Created: ven déc 12 11:17:11 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "EntityGUI_3Spin_QTD.h"
#include <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
}

View File

@ -1,13 +1,13 @@
/**************************************************************************** /****************************************************************************
** Form interface generated from reading ui file 'KinematicGUI_3Sel1Spin_QTD.ui' ** Form interface generated from reading ui file 'EntityGUI_3Spin_QTD.ui'
** **
** Created: mer fév 4 13:09:40 2004 ** Created: ven déc 12 11:17:11 2003
** by: The User Interface Compiler (uic) ** by: The User Interface Compiler (uic)
** **
** WARNING! All changes made in this file will be lost! ** WARNING! All changes made in this file will be lost!
****************************************************************************/ ****************************************************************************/
#ifndef KINEMATICGUI_3SEL1SPIN_QTD_H #ifndef ENTITYGUI_3SPIN_QTD_H
#define KINEMATICGUI_3SEL1SPIN_QTD_H #define ENTITYGUI_3SPIN_QTD_H
#include <qvariant.h> #include <qvariant.h>
#include <qwidget.h> #include <qwidget.h>
@ -16,37 +16,34 @@ class QHBoxLayout;
class QGridLayout; class QGridLayout;
class QGroupBox; class QGroupBox;
class QLabel; class QLabel;
class QLineEdit;
class QPushButton; class QPushButton;
class QSpinBox; class QSpinBox;
class KinematicGUI_3Sel1Spin_QTD : public QWidget class EntityGUI_3Spin_QTD : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
KinematicGUI_3Sel1Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); EntityGUI_3Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~KinematicGUI_3Sel1Spin_QTD(); ~EntityGUI_3Spin_QTD();
QGroupBox* GroupBox1; QGroupBox* GroupBox1;
QLineEdit* LineEdit1; QPushButton* buttonUndo;
QPushButton* PushButton3; QPushButton* buttonApply;
QLabel* TextLabel4;
QSpinBox* SpinBox1;
QLabel* TextLabel3;
QLineEdit* LineEdit3;
QLineEdit* LineEdit2;
QPushButton* PushButton2;
QLabel* TextLabel2; QLabel* TextLabel2;
QLabel* TextLabel1; QLabel* TextLabel1;
QPushButton* PushButton1; QSpinBox* SpinBox1;
QSpinBox* SpinBox2;
QLabel* TextLabel3;
QSpinBox* SpinBox3;
protected: protected:
QGridLayout* KinematicGUI_3Sel1Spin_QTDLayout; QGridLayout* EntityGUI_3Spin_QTDLayout;
QGridLayout* GroupBox1Layout; QGridLayout* GroupBox1Layout;
QGridLayout* Layout1; QGridLayout* Layout3;
QGridLayout* Layout2; QGridLayout* Layout2;
QGridLayout* Layout1;
}; };
#endif // KINEMATICGUI_3SEL1SPIN_QTD_H #endif // ENTITYGUI_3SPIN_QTD_H

View File

@ -0,0 +1,67 @@
// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
// File : EntityGUI_4Spin.cxx
// Author : Damien COQUERET
// Module : GEOM
// $Header:
#include "EntityGUI_4Spin.h"
#include <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
}

View File

@ -0,0 +1,50 @@
// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
// File : EntityGUI_4Spin.h
// Author : Damien COQUERET
// Module : GEOM
// $Header:
#ifndef ENTITYGUI_4SPIN_H
#define ENTITYGUI_4SPIN_H
#include "EntityGUI_4Spin_QTD.h"
#include "DlgRef_SpinBox.h"
class EntityGUI_4Spin : public EntityGUI_4Spin_QTD
{
Q_OBJECT
public:
EntityGUI_4Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~EntityGUI_4Spin();
DlgRef_SpinBox* SpinBox_DX;
DlgRef_SpinBox* SpinBox_DY;
DlgRef_SpinBox* SpinBox_DZ;
DlgRef_SpinBox* SpinBox_DS;
};
#endif // ENTITYGUI_4SPIN_H

View File

@ -1,15 +1,14 @@
/**************************************************************************** /****************************************************************************
** Form implementation generated from reading ui file 'KinematicGUI_3List3Spin_QTD.ui' ** Form implementation generated from reading ui file 'EntityGUI_4Spin_QTD.ui'
** **
** Created: mer fév 4 16:57:37 2004 ** Created: Fri Apr 30 10:56:21 2004
** by: The User Interface Compiler (uic) ** by: The User Interface Compiler (uic)
** **
** WARNING! All changes made in this file will be lost! ** WARNING! All changes made in this file will be lost!
****************************************************************************/ ****************************************************************************/
#include "KinematicGUI_3List3Spin_QTD.h" #include "EntityGUI_4Spin_QTD.h"
#include <qvariant.h> #include <qvariant.h>
#include <qcombobox.h>
#include <qgroupbox.h> #include <qgroupbox.h>
#include <qlabel.h> #include <qlabel.h>
#include <qpushbutton.h> #include <qpushbutton.h>
@ -19,53 +18,79 @@
#include <qwhatsthis.h> #include <qwhatsthis.h>
/* /*
* Constructs a KinematicGUI_3List3Spin_QTD which is a child of 'parent', with the * Constructs a EntityGUI_4Spin_QTD which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'. * name 'name' and widget flags set to 'f'.
*/ */
KinematicGUI_3List3Spin_QTD::KinematicGUI_3List3Spin_QTD( QWidget* parent, const char* name, WFlags fl ) EntityGUI_4Spin_QTD::EntityGUI_4Spin_QTD( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl ) : QWidget( parent, name, fl )
{ {
if ( !name ) if ( !name )
setName( "KinematicGUI_3List3Spin_QTD" ); setName( "EntityGUI_4Spin_QTD" );
resize( 279, 111 ); resize( 176, 154 );
setMinimumSize( QSize( 100, 0 ) ); setCaption( trUtf8( "EntityGUI_4Spin_QTD" ) );
setCaption( trUtf8( "KinematicGUI_3List3Spin_QTD" ) ); EntityGUI_4Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_4Spin_QTDLayout");
KinematicGUI_3List3Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "KinematicGUI_3List3Spin_QTDLayout");
GroupBox1 = new QGroupBox( this, "GroupBox1" ); GroupBox1 = new QGroupBox( this, "GroupBox1" );
GroupBox1->setTitle( trUtf8( "" ) ); GroupBox1->setTitle( trUtf8( "Values" ) );
GroupBox1->setColumnLayout(0, Qt::Vertical ); GroupBox1->setColumnLayout(0, Qt::Vertical );
GroupBox1->layout()->setSpacing( 6 ); GroupBox1->layout()->setSpacing( 6 );
GroupBox1->layout()->setMargin( 11 ); GroupBox1->layout()->setMargin( 11 );
GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
GroupBox1Layout->setAlignment( Qt::AlignTop ); 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"); 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 = new QLabel( GroupBox1, "TextLabel2" );
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) ); TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
TextLabel2->setText( trUtf8( "TL2" ) ); TextLabel2->setText( trUtf8( "TL2" ) );
Layout1->addWidget( TextLabel2, 0, 2 ); Layout1->addWidget( TextLabel2, 1, 0 );
QSpacerItem* spacer = new QSpacerItem( 0, 100, QSizePolicy::Minimum, QSizePolicy::Expanding ); QSpacerItem* spacer_2 = new QSpacerItem( 0, 70, QSizePolicy::Minimum, QSizePolicy::Expanding );
Layout1->addItem( spacer, 3, 3 ); Layout1->addItem( spacer_2, 4, 1 );
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" ); SpinBox4 = new QSpinBox( GroupBox1, "SpinBox4" );
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) ); SpinBox4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox4->sizePolicy().hasHeightForWidth() ) );
Layout1->addWidget( SpinBox1, 0, 3 ); Layout1->addWidget( SpinBox4, 3, 1 );
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 = new QLabel( GroupBox1, "TextLabel3" );
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) ); TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
TextLabel3->setText( trUtf8( "TL3" ) ); TextLabel3->setText( trUtf8( "TL3" ) );
Layout1->addWidget( TextLabel3, 1, 0 ); Layout1->addWidget( TextLabel3, 2, 0 );
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
Layout1->addWidget( SpinBox1, 0, 1 );
TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) ); TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
@ -73,52 +98,30 @@ KinematicGUI_3List3Spin_QTD::KinematicGUI_3List3Spin_QTD( QWidget* parent, cons
Layout1->addWidget( TextLabel1, 0, 0 ); Layout1->addWidget( TextLabel1, 0, 0 );
ComboBox3 = new QComboBox( FALSE, GroupBox1, "ComboBox3" ); TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
ComboBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, ComboBox3->sizePolicy().hasHeightForWidth() ) ); TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
TextLabel4->setText( trUtf8( "TL4" ) );
Layout1->addWidget( ComboBox3, 2, 1 ); Layout1->addWidget( TextLabel4, 3, 0 );
SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" ); Layout3->addLayout( Layout1, 0, 0 );
SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
Layout1->addWidget( SpinBox2, 1, 3 ); GroupBox1Layout->addLayout( Layout3, 0, 0 );
SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" ); EntityGUI_4Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) );
Layout1->addWidget( SpinBox3, 2, 3 ); // tab order
setTabOrder( buttonUndo, buttonApply );
TextLabel6 = new QLabel( GroupBox1, "TextLabel6" ); setTabOrder( buttonApply, SpinBox1 );
TextLabel6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel6->sizePolicy().hasHeightForWidth() ) ); setTabOrder( SpinBox1, SpinBox2 );
TextLabel6->setText( trUtf8( "TL6" ) ); setTabOrder( SpinBox2, SpinBox3 );
setTabOrder( SpinBox3, SpinBox4 );
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 * Destroys the object and frees any allocated resources
*/ */
KinematicGUI_3List3Spin_QTD::~KinematicGUI_3List3Spin_QTD() EntityGUI_4Spin_QTD::~EntityGUI_4Spin_QTD()
{ {
// no need to delete child widgets, Qt does it all for us // no need to delete child widgets, Qt does it all for us
} }

View File

@ -1,51 +1,51 @@
/**************************************************************************** /****************************************************************************
** Form interface generated from reading ui file 'KinematicGUI_3List3Spin_QTD.ui' ** Form interface generated from reading ui file 'EntityGUI_4Spin_QTD.ui'
** **
** Created: mer fév 4 16:57:37 2004 ** Created: Fri Apr 30 10:56:17 2004
** by: The User Interface Compiler (uic) ** by: The User Interface Compiler (uic)
** **
** WARNING! All changes made in this file will be lost! ** WARNING! All changes made in this file will be lost!
****************************************************************************/ ****************************************************************************/
#ifndef KINEMATICGUI_3LIST3SPIN_QTD_H #ifndef ENTITYGUI_4SPIN_QTD_H
#define KINEMATICGUI_3LIST3SPIN_QTD_H #define ENTITYGUI_4SPIN_QTD_H
#include <qvariant.h> #include <qvariant.h>
#include <qwidget.h> #include <qwidget.h>
class QVBoxLayout; class QVBoxLayout;
class QHBoxLayout; class QHBoxLayout;
class QGridLayout; class QGridLayout;
class QComboBox;
class QGroupBox; class QGroupBox;
class QLabel; class QLabel;
class QPushButton;
class QSpinBox; class QSpinBox;
class KinematicGUI_3List3Spin_QTD : public QWidget class EntityGUI_4Spin_QTD : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
KinematicGUI_3List3Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); EntityGUI_4Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~KinematicGUI_3List3Spin_QTD(); ~EntityGUI_4Spin_QTD();
QGroupBox* GroupBox1; QGroupBox* GroupBox1;
QLabel* TextLabel2; QPushButton* buttonUndo;
QSpinBox* SpinBox1; QPushButton* buttonApply;
QLabel* TextLabel4;
QLabel* TextLabel3;
QLabel* TextLabel1;
QComboBox* ComboBox3;
QSpinBox* SpinBox2;
QSpinBox* SpinBox3; QSpinBox* SpinBox3;
QLabel* TextLabel6; QSpinBox* SpinBox2;
QComboBox* ComboBox1; QLabel* TextLabel2;
QComboBox* ComboBox2; QSpinBox* SpinBox4;
QLabel* TextLabel5; QLabel* TextLabel3;
QSpinBox* SpinBox1;
QLabel* TextLabel1;
QLabel* TextLabel4;
protected: protected:
QGridLayout* KinematicGUI_3List3Spin_QTDLayout; QGridLayout* EntityGUI_4Spin_QTDLayout;
QGridLayout* GroupBox1Layout; QGridLayout* GroupBox1Layout;
QGridLayout* Layout3;
QGridLayout* Layout2;
QGridLayout* Layout1; QGridLayout* Layout1;
}; };
#endif // KINEMATICGUI_3LIST3SPIN_QTD_H #endif // ENTITYGUI_4SPIN_QTD_H

View File

@ -0,0 +1,80 @@
/****************************************************************************
** Form implementation generated from reading ui file 'EntityGUI_Dir1_QTD.ui'
**
** Created: ven déc 12 11:17:09 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "EntityGUI_Dir1_QTD.h"
#include <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
}

View File

@ -0,0 +1,41 @@
/****************************************************************************
** Form interface generated from reading ui file 'EntityGUI_Dir1_QTD.ui'
**
** Created: ven déc 12 11:17:09 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef ENTITYGUI_DIR1_QTD_H
#define ENTITYGUI_DIR1_QTD_H
#include <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

View File

@ -0,0 +1,76 @@
/****************************************************************************
** Form implementation generated from reading ui file 'EntityGUI_Dir2_QTD.ui'
**
** Created: ven déc 12 11:17:10 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "EntityGUI_Dir2_QTD.h"
#include <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
}

View File

@ -0,0 +1,40 @@
/****************************************************************************
** Form interface generated from reading ui file 'EntityGUI_Dir2_QTD.ui'
**
** Created: ven déc 12 11:17:09 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef ENTITYGUI_DIR2_QTD_H
#define ENTITYGUI_DIR2_QTD_H
#include <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

View File

@ -0,0 +1,74 @@
/****************************************************************************
** Form implementation generated from reading ui file 'EntityGUI_Point_QTD.ui'
**
** Created: ven déc 12 11:17:08 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "EntityGUI_Point_QTD.h"
#include <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
}

View File

@ -0,0 +1,40 @@
/****************************************************************************
** Form interface generated from reading ui file 'EntityGUI_Point_QTD.ui'
**
** Created: ven déc 12 11:17:08 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef ENTITYGUI_POINT_QTD_H
#define ENTITYGUI_POINT_QTD_H
#include <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

View File

@ -0,0 +1,176 @@
/****************************************************************************
** Form implementation generated from reading ui file 'EntityGUI_Skeleton_QTD.ui'
**
** Created: ven déc 12 11:17:08 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "EntityGUI_Skeleton_QTD.h"
#include <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
}

View File

@ -0,0 +1,61 @@
/****************************************************************************
** Form interface generated from reading ui file 'EntityGUI_Skeleton_QTD.ui'
**
** Created: ven déc 12 11:17:07 2003
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef ENTITYGUI_SKELETON_QTD_H
#define ENTITYGUI_SKELETON_QTD_H
#include <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

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,149 @@
// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
// File : EntityGUI_SketcherDlg.h
// Author : Damine COQUERET
// Module : GEOM
// $Header:
#ifndef ENTITYGUI_SKETCHERDLG_H
#define ENTITYGUI_SKETCHERDLG_H
#include "EntityGUI_Skeleton_QTD.h"
#include "EntityGUI_Point_QTD.h"
#include "EntityGUI_Dir1_QTD.h"
#include "EntityGUI_Dir2_QTD.h"
#include "EntityGUI_1Sel_QTD.h"
#include "EntityGUI_1Spin.h"
#include "EntityGUI_2Spin.h"
#include "EntityGUI_3Spin.h"
#include "EntityGUI_4Spin.h"
#include "EntityGUI.h"
#include "GEOM_ShapeTypeFilter.hxx"
#include <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

View File

@ -41,10 +41,38 @@ LIB = libEntityGUI.la
EXPORT_HEADERS= EXPORT_HEADERS=
LIB_SRC = EntityGUI.cxx \ 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 EntityGUI_SubShapeDlg.cxx
LIB_MOC = \ LIB_MOC = \
EntityGUI.h \ 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 EntityGUI_SubShapeDlg.h
LIB_CLIENT_IDL = GEOM_Kinematic.idl LIB_CLIENT_IDL = GEOM_Kinematic.idl
@ -56,6 +84,6 @@ LIB_SERVER_IDL =
CPPFLAGS += $(QT_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome CPPFLAGS += $(QT_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
LDFLAGS += -lGEOMFiltersSelection -lDisplayGUI LDFLAGS += -lGEOMFiltersSelection -lDisplayGUI -lGEOMSketcher
@CONCLUDE@ @CONCLUDE@

View File

@ -26,16 +26,16 @@
// Module : GEOM // Module : GEOM
// $Header$ // $Header$
using namespace std;
#include "GEOM_Animation_i.hh" #include "GEOM_Animation_i.hh"
using namespace std;
//================================================================================= //=================================================================================
// function : GEOM_Animation_i() constructor (no arguments) // function : GEOM_Animation_i() constructor (no arguments)
// purpose : for what now ? // purpose : for what now ?
//================================================================================= //=================================================================================
GEOM_Animation_i::GEOM_Animation_i() GEOM_Animation_i::GEOM_Animation_i() {}
{
}
//================================================================================= //=================================================================================
@ -64,46 +64,6 @@ GEOM_Animation_i::GEOM_Animation_i(Kinematic_Animation* Animation,
GEOM_Animation_i::~GEOM_Animation_i() { delete &_Animation; } 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) // function : Name (set method)
// purpose : to set the attribute 'name'. // purpose : to set the attribute 'name'.
@ -116,32 +76,12 @@ void GEOM_Animation_i::Name(const char* name)
} }
//=================================================================================
// function : Name (get method)
// purpose : to get the attribute 'name' of this shape
//=================================================================================
char* GEOM_Animation_i::Name() { return strdup(_name); }
//=================================================================================
// function : ShapeId
// purpose : to get the id of this shape from GEOM (OCAF entry)
//=================================================================================
char* GEOM_Animation_i::ShapeId() { return strdup(_shapeid); }
//================================================================================= //=================================================================================
// function : ShapeId (set method) // function : ShapeId (set method)
// purpose : to set the id of this shape in GEOM/OCAF doc // purpose : to set the id of this shape in GEOM/OCAF doc
//================================================================================= //=================================================================================
void GEOM_Animation_i::ShapeId(const char * shapeid) { _shapeid = strdup(shapeid); } void GEOM_Animation_i::ShapeId(const char * shapeid)
{ _shapeid = strdup(shapeid); }
//=================================================================================
// function : StudyShapeId (get method)
// purpose : to get the id of this shape from the study document (OCAF entry)
//=================================================================================
char* GEOM_Animation_i::StudyShapeId() { return strdup(_studyshapeid) ; }
//================================================================================= //=================================================================================
@ -150,3 +90,61 @@ char* GEOM_Animation_i::StudyShapeId() { return strdup(_studyshapeid) ; }
//================================================================================= //=================================================================================
void GEOM_Animation_i::StudyShapeId(const char * studyshapeid) void GEOM_Animation_i::StudyShapeId(const char * studyshapeid)
{ _studyshapeid = strdup(studyshapeid); } { _studyshapeid = strdup(studyshapeid); }
//=================================================================================
// function : GetDisplacement()
// purpose :
//=================================================================================
GEOM::ListOfDouble* GEOM_Animation_i::GetDisplacement(GEOM::GEOM_Contact_ptr aContact)
throw(SALOME::SALOME_Exception)
{
cout<<"GEOM_Animation_i::GetDisplacement"<<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 : SetDisplacement()
// purpose :
//=================================================================================
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]);
_Animation->SetDisplacement(aKContact, aKList);
return;
}

View File

@ -62,25 +62,32 @@ private:
char* _studyshapeid; // exists only if added in the study document char* _studyshapeid; // exists only if added in the study document
public: public:
GEOM::GEOM_Assembly_ptr GetAssembly() GEOM::GEOM_Assembly_ptr GetAssembly() throw (SALOME::SALOME_Exception)
{return GEOM::GEOM_Assembly::_duplicate(_Ass);};
GEOM::GEOM_Shape_ptr GetFrame() throw (SALOME::SALOME_Exception)
{return GEOM::GEOM_Shape::_duplicate(_Frame);};
CORBA::Double GetDuration() throw (SALOME::SALOME_Exception)
{return _Animation->GetDuration();};
CORBA::Long GetNbSeq() throw (SALOME::SALOME_Exception)
{return _Animation->GetNbSeq();};
GEOM::ListOfDouble* GetDisplacement(GEOM::GEOM_Contact_ptr aContact)
throw (SALOME::SALOME_Exception); throw (SALOME::SALOME_Exception);
GEOM::GEOM_Shape_ptr GetFrame() void SetDisplacement(GEOM::GEOM_Contact_ptr aContact,
const GEOM::ListOfDouble& aList)
throw (SALOME::SALOME_Exception); throw (SALOME::SALOME_Exception);
CORBA::Double GetDuration() char* Name() {return strdup(_name);};
throw (SALOME::SALOME_Exception);
CORBA::Long GetNbSeq()
throw (SALOME::SALOME_Exception);
char* Name();
void Name(const char* name); void Name(const char* name);
char* ShapeId(); char* ShapeId() {return strdup(_shapeid);};
void ShapeId(const char* shapeid); void ShapeId(const char* shapeid);
char* StudyShapeId(); char* StudyShapeId() {return strdup(_studyshapeid);};
void StudyShapeId(const char* studyshapeid); void StudyShapeId(const char* studyshapeid);
}; };

View File

@ -26,16 +26,15 @@
// Module : GEOM // Module : GEOM
// $Header$ // $Header$
using namespace std;
#include "GEOM_Assembly_i.hh" #include "GEOM_Assembly_i.hh"
using namespace std;
//================================================================================= //=================================================================================
// function : GEOM_Assembly_i() constructor (no arguments) // function : GEOM_Assembly_i() constructor (no arguments)
// purpose : for what now ? // purpose : for what now ?
//================================================================================= //=================================================================================
GEOM_Assembly_i::GEOM_Assembly_i() GEOM_Assembly_i::GEOM_Assembly_i() {}
{
}
//================================================================================= //=================================================================================
@ -63,6 +62,34 @@ GEOM_Assembly_i::GEOM_Assembly_i(Kinematic_Assembly* Ass)
GEOM_Assembly_i::~GEOM_Assembly_i() { delete &_Ass; } GEOM_Assembly_i::~GEOM_Assembly_i() { delete &_Ass; }
//=================================================================================
// function : Name (set method)
// purpose : to set the attribute 'name'.
// : WARNING : Register to naming service actually removed !
//=================================================================================
void GEOM_Assembly_i::Name(const char* name)
{
_name = strdup(name);
GEOM::GEOM_Assembly_ptr g = GEOM::GEOM_Assembly::_narrow(_this());
}
//=================================================================================
// function : ShapeId (set method)
// purpose : to set the id of this shape in GEOM/OCAF doc
//=================================================================================
void GEOM_Assembly_i::ShapeId(const char * shapeid)
{ _shapeid = strdup(shapeid); }
//=================================================================================
// function : StudyShapeId (set method)
// purpose : to set the id of this shape in the Study document (OCAF entry)
//=================================================================================
void GEOM_Assembly_i::StudyShapeId(const char * studyshapeid)
{ _studyshapeid = strdup(studyshapeid); }
//================================================================================= //=================================================================================
// function : AddContact() // function : AddContact()
// purpose : // purpose :
@ -84,66 +111,8 @@ GEOM::ListOfContact* GEOM_Assembly_i::GetContactList() throw(SALOME::SALOME_Exce
{ {
GEOM::ListOfContact_var aContactList = new GEOM::ListOfContact; GEOM::ListOfContact_var aContactList = new GEOM::ListOfContact;
aContactList->length(_aContactList.length()); aContactList->length(_aContactList.length());
for(int i = 0; i < _NbContact; i++) { for(int i = 0; i < _NbContact; i++)
aContactList[i] = GEOM::GEOM_Contact::_duplicate(_aContactList[i]); aContactList[i] = GEOM::GEOM_Contact::_duplicate(_aContactList[i]);
}
return aContactList._retn(); return aContactList._retn();
} }
//=================================================================================
// function : NbContacts()
// purpose :
//=================================================================================
CORBA::Long GEOM_Assembly_i::NbContacts() throw(SALOME::SALOME_Exception)
{
return _NbContact;
}
//=================================================================================
// function : Name (set method)
// purpose : to set the attribute 'name'.
// : WARNING : Register to naming service actually removed !
//=================================================================================
void GEOM_Assembly_i::Name(const char* name)
{
_name = strdup(name);
GEOM::GEOM_Assembly_ptr g = GEOM::GEOM_Assembly::_narrow(_this());
}
//=================================================================================
// function : Name (get method)
// purpose : to get the attribute 'name' of this shape
//=================================================================================
char* GEOM_Assembly_i::Name() { return strdup(_name); }
//=================================================================================
// function : ShapeId
// purpose : to get the id of this shape from GEOM (OCAF entry)
//=================================================================================
char* GEOM_Assembly_i::ShapeId() { return strdup(_shapeid); }
//=================================================================================
// function : ShapeId (set method)
// purpose : to set the id of this shape in GEOM/OCAF doc
//=================================================================================
void GEOM_Assembly_i::ShapeId(const char * shapeid) { _shapeid = strdup(shapeid); }
//=================================================================================
// function : StudyShapeId (get method)
// purpose : to get the id of this shape from the study document (OCAF entry)
//=================================================================================
char* GEOM_Assembly_i::StudyShapeId() { return strdup(_studyshapeid) ; }
//=================================================================================
// function : StudyShapeId (set method)
// purpose : to set the id of this shape in the Study document (OCAF entry)
//=================================================================================
void GEOM_Assembly_i::StudyShapeId(const char * studyshapeid)
{ _studyshapeid = strdup(studyshapeid); }

View File

@ -66,16 +66,16 @@ public:
GEOM::ListOfContact* GetContactList() GEOM::ListOfContact* GetContactList()
throw (SALOME::SALOME_Exception); throw (SALOME::SALOME_Exception);
CORBA::Long NbContacts() CORBA::Long NbContacts() throw (SALOME::SALOME_Exception)
throw (SALOME::SALOME_Exception); {return _NbContact;};
char* Name(); char* Name() {return strdup(_name);};
void Name(const char* name); void Name(const char* name);
char* ShapeId(); char* ShapeId() {return strdup(_shapeid);};
void ShapeId(const char* shapeid); void ShapeId(const char* shapeid);
char* StudyShapeId(); char* StudyShapeId() {return strdup(_studyshapeid);};
void StudyShapeId(const char* studyshapeid); void StudyShapeId(const char* studyshapeid);
}; };

View File

@ -26,19 +26,17 @@
// Module : GEOM // Module : GEOM
// $Header$ // $Header$
using namespace std;
#include "GEOM_Contact_i.hh" #include "GEOM_Contact_i.hh"
#include "GEOM_Position_i.hh"
#include "GEOM_Rotation_i.hh" #include "utilities.h"
#include "GEOM_Translation_i.hh"
using namespace std;
//================================================================================= //=================================================================================
// function : GEOM_Contact_i() constructor (no arguments) // function : GEOM_Contact_i() constructor (no arguments)
// purpose : for what now ? // purpose : for what now ?
//================================================================================= //=================================================================================
GEOM_Contact_i::GEOM_Contact_i() GEOM_Contact_i::GEOM_Contact_i() {}
{
}
//================================================================================= //=================================================================================
@ -47,45 +45,17 @@ GEOM_Contact_i::GEOM_Contact_i()
//================================================================================= //=================================================================================
GEOM_Contact_i::GEOM_Contact_i(Kinematic_Contact* Contact, GEOM_Contact_i::GEOM_Contact_i(Kinematic_Contact* Contact,
GEOM::GEOM_Shape_ptr Shape1, GEOM::GEOM_Shape_ptr Shape1,
GEOM::GEOM_Shape_ptr Shape2, GEOM::GEOM_Shape_ptr Shape2)
GEOM::GEOM_Gen_ptr engine)
{ {
_Contact = Contact; _Contact = Contact;
_Shape1 = GEOM::GEOM_Shape::_duplicate(Shape1); _Shape1 = GEOM::GEOM_Shape::_duplicate(Shape1);
_Shape2 = GEOM::GEOM_Shape::_duplicate(Shape2); _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 = ""; _shapeid = "";
_studyshapeid = ""; _studyshapeid = "";
_name = ""; _name = "";
return;
} }
@ -96,76 +66,6 @@ GEOM_Contact_i::GEOM_Contact_i(Kinematic_Contact* Contact,
GEOM_Contact_i::~GEOM_Contact_i() { delete &_Contact; } GEOM_Contact_i::~GEOM_Contact_i() { delete &_Contact; }
//=================================================================================
// function : GetType()
// purpose :
//=================================================================================
CORBA::Long GEOM_Contact_i::GetType() throw(SALOME::SALOME_Exception)
{
return _Contact->Type();
}
//=================================================================================
// function : GetShape1()
// purpose :
//=================================================================================
GEOM::GEOM_Shape_ptr GEOM_Contact_i::GetShape1() throw(SALOME::SALOME_Exception)
{
return GEOM::GEOM_Shape::_duplicate(_Shape1);
}
//=================================================================================
// function : GetShape2()
// purpose :
//=================================================================================
GEOM::GEOM_Shape_ptr GEOM_Contact_i::GetShape2() throw(SALOME::SALOME_Exception)
{
return GEOM::GEOM_Shape::_duplicate(_Shape2);
}
//=================================================================================
// function : GetPosition()
// purpose :
//=================================================================================
GEOM::GEOM_Position_ptr GEOM_Contact_i::GetPosition() throw(SALOME::SALOME_Exception)
{
return GEOM::GEOM_Position::_duplicate(_Position);
}
//=================================================================================
// function : GetRotation()
// purpose :
//=================================================================================
GEOM::GEOM_Rotation_ptr GEOM_Contact_i::GetRotation() throw(SALOME::SALOME_Exception)
{
return GEOM::GEOM_Rotation::_duplicate(_Rotation);
}
//=================================================================================
// function : GetTranslation()
// purpose :
//=================================================================================
GEOM::GEOM_Translation_ptr GEOM_Contact_i::GetTranslation() throw(SALOME::SALOME_Exception)
{
return GEOM::GEOM_Translation::_duplicate(_Translation);
}
//=================================================================================
// function : GetStep()
// purpose :
//=================================================================================
CORBA::Double GEOM_Contact_i::GetStep() throw(SALOME::SALOME_Exception)
{
return _Contact->Step();
}
//================================================================================= //=================================================================================
// function : Name (set method) // function : Name (set method)
// purpose : to set the attribute 'name'. // purpose : to set the attribute 'name'.
@ -178,32 +78,12 @@ void GEOM_Contact_i::Name(const char* name)
} }
//=================================================================================
// function : Name (get method)
// purpose : to get the attribute 'name' of this shape
//=================================================================================
char* GEOM_Contact_i::Name() { return strdup(_name); }
//=================================================================================
// function : ShapeId
// purpose : to get the id of this shape from GEOM (OCAF entry)
//=================================================================================
char* GEOM_Contact_i::ShapeId() { return strdup(_shapeid); }
//================================================================================= //=================================================================================
// function : ShapeId (set method) // function : ShapeId (set method)
// purpose : to set the id of this shape in GEOM/OCAF doc // purpose : to set the id of this shape in GEOM/OCAF doc
//================================================================================= //=================================================================================
void GEOM_Contact_i::ShapeId(const char * shapeid) { _shapeid = strdup(shapeid); } void GEOM_Contact_i::ShapeId(const char * shapeid)
{ _shapeid = strdup(shapeid); }
//=================================================================================
// function : StudyShapeId (get method)
// purpose : to get the id of this shape from the study document (OCAF entry)
//=================================================================================
char* GEOM_Contact_i::StudyShapeId() { return strdup(_studyshapeid) ; }
//================================================================================= //=================================================================================
@ -212,3 +92,162 @@ char* GEOM_Contact_i::StudyShapeId() { return strdup(_studyshapeid) ; }
//================================================================================= //=================================================================================
void GEOM_Contact_i::StudyShapeId(const char * studyshapeid) void GEOM_Contact_i::StudyShapeId(const char * studyshapeid)
{ _studyshapeid = strdup(studyshapeid); } { _studyshapeid = strdup(studyshapeid); }
//=================================================================================
// function : GetPosition()
// purpose :
//=================================================================================
GEOM::ListOfDouble* GEOM_Contact_i::GetPosition() throw(SALOME::SALOME_Exception)
{
GEOM::ListOfDouble_var aPositionList = new GEOM::ListOfDouble;
aPositionList->length(12);
aPositionList[0] = _Contact->GetPosition().GetOrigin().X();
aPositionList[1] = _Contact->GetPosition().GetOrigin().Y();
aPositionList[2] = _Contact->GetPosition().GetOrigin().Z();
aPositionList[3] = _Contact->GetPosition().GetDirX().X();
aPositionList[4] = _Contact->GetPosition().GetDirX().Y();
aPositionList[5] = _Contact->GetPosition().GetDirX().Z();
aPositionList[6] = _Contact->GetPosition().GetDirY().X();
aPositionList[7] = _Contact->GetPosition().GetDirY().Y();
aPositionList[8] = _Contact->GetPosition().GetDirY().Z();
aPositionList[9] = _Contact->GetPosition().GetDirZ().X();
aPositionList[10] = _Contact->GetPosition().GetDirZ().Y();
aPositionList[11] = _Contact->GetPosition().GetDirZ().Z();
return aPositionList._retn();
}
//=================================================================================
// function : GetAngularRange()
// purpose :
//=================================================================================
GEOM::ListOfDouble* GEOM_Contact_i::GetAngularRange() throw(SALOME::SALOME_Exception)
{
GEOM::ListOfDouble_var anAngularRangeList = new GEOM::ListOfDouble;
anAngularRangeList->length(6);
anAngularRangeList[0] = _Contact->GetAngularRange().GetMinValX();
anAngularRangeList[1] = _Contact->GetAngularRange().GetMaxValX();
anAngularRangeList[2] = _Contact->GetAngularRange().GetMinValY();
anAngularRangeList[3] = _Contact->GetAngularRange().GetMaxValY();
anAngularRangeList[4] = _Contact->GetAngularRange().GetMinValZ();
anAngularRangeList[5] = _Contact->GetAngularRange().GetMaxValZ();
return anAngularRangeList._retn();
}
//=================================================================================
// function : GetLinearRange()
// purpose :
//=================================================================================
GEOM::ListOfDouble* GEOM_Contact_i::GetLinearRange() throw(SALOME::SALOME_Exception)
{
GEOM::ListOfDouble_var aLinearRangeList = new GEOM::ListOfDouble;
aLinearRangeList->length(6);
aLinearRangeList[0] = _Contact->GetLinearRange().GetMinValX();
aLinearRangeList[1] = _Contact->GetLinearRange().GetMaxValX();
aLinearRangeList[2] = _Contact->GetLinearRange().GetMinValY();
aLinearRangeList[3] = _Contact->GetLinearRange().GetMaxValY();
aLinearRangeList[4] = _Contact->GetLinearRange().GetMinValZ();
aLinearRangeList[5] = _Contact->GetLinearRange().GetMaxValZ();
return aLinearRangeList._retn();
}
//=================================================================================
// function : SetPosition()
// purpose :
//=================================================================================
void GEOM_Contact_i::SetPosition(double P0x, double P0y, double P0z,
double VXx, double VXy, double VXz,
double VYx, double VYy, double VYz,
double VZx, double VZy, double VZz)
throw(SALOME::SALOME_Exception)
{
gp_Pnt Center(P0x, P0y, P0z);
_Contact->GetPosition().SetOrigin(Center);
if(VXx == 0 && VXy == 0 && VXz == 0) {
MESSAGE("Null Vector in Contact Position (SetVX)."<<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 : SetAngularRange()
// purpose :
//=================================================================================
void GEOM_Contact_i::SetAngularRange(double MinValX, double MaxValX,
double MinValY, double MaxValY,
double MinValZ, double MaxValZ)
throw(SALOME::SALOME_Exception)
{
_Contact->GetAngularRange().SetRangeX(MinValX, MaxValX);
_Contact->GetAngularRange().SetRangeY(MinValY, MaxValY);
_Contact->GetAngularRange().SetRangeZ(MinValZ, MaxValZ);
if(_Contact->GetType() == 9) { //HELICOIDAL
double p = _Contact->GetStep() / 360;
_Contact->GetLinearRange().SetRangeX(p * MinValX, p * MaxValX);
_Contact->GetLinearRange().SetRangeY(p * MinValY, p * MaxValY);
_Contact->GetLinearRange().SetRangeZ(p * MinValZ, p * MaxValZ);
}
return;
}
//=================================================================================
// function : SetLinearRange()
// purpose :
//=================================================================================
void GEOM_Contact_i::SetLinearRange(double MinValX, double MaxValX,
double MinValY, double MaxValY,
double MinValZ, double MaxValZ)
throw(SALOME::SALOME_Exception)
{
_Contact->GetLinearRange().SetRangeX(MinValX, MaxValX);
_Contact->GetLinearRange().SetRangeY(MinValY, MaxValY);
_Contact->GetLinearRange().SetRangeZ(MinValZ, MaxValZ);
if(_Contact->GetType() == 9) { //HELICOIDAL
double p = 360 / _Contact->GetStep();
_Contact->GetAngularRange().SetRangeX(p * MinValX, p * MaxValX);
_Contact->GetAngularRange().SetRangeY(p * MinValY, p * MaxValY);
_Contact->GetAngularRange().SetRangeZ(p * MinValZ, p * MaxValZ);
}
return;
}

View File

@ -48,8 +48,7 @@ public:
GEOM_Contact_i(); GEOM_Contact_i();
GEOM_Contact_i(Kinematic_Contact* Contact, GEOM_Contact_i(Kinematic_Contact* Contact,
GEOM::GEOM_Shape_ptr Shape1, GEOM::GEOM_Shape_ptr Shape1,
GEOM::GEOM_Shape_ptr Shape2, GEOM::GEOM_Shape_ptr Shape2);
GEOM::GEOM_Gen_ptr engine);
~GEOM_Contact_i(); ~GEOM_Contact_i();
@ -57,43 +56,51 @@ private:
Kinematic_Contact* _Contact; Kinematic_Contact* _Contact;
GEOM::GEOM_Shape_ptr _Shape1; GEOM::GEOM_Shape_ptr _Shape1;
GEOM::GEOM_Shape_ptr _Shape2; GEOM::GEOM_Shape_ptr _Shape2;
GEOM::GEOM_Position_ptr _Position;
GEOM::GEOM_Rotation_ptr _Rotation;
GEOM::GEOM_Translation_ptr _Translation;
char* _name; char* _name;
char* _shapeid; char* _shapeid;
char* _studyshapeid; // exists only if added in the study document char* _studyshapeid; // exists only if added in the study document
public: public:
CORBA::Long GetType() CORBA::Long GetType() throw (SALOME::SALOME_Exception)
{return _Contact->GetType();};
CORBA::Double GetStep() throw (SALOME::SALOME_Exception)
{return _Contact->GetStep();};
GEOM::GEOM_Shape_ptr GetShape1() throw (SALOME::SALOME_Exception)
{return GEOM::GEOM_Shape::_duplicate(_Shape1);};
GEOM::GEOM_Shape_ptr GetShape2() throw (SALOME::SALOME_Exception)
{return GEOM::GEOM_Shape::_duplicate(_Shape2);};
GEOM::ListOfDouble* GetPosition()
throw (SALOME::SALOME_Exception);
GEOM::ListOfDouble* GetAngularRange()
throw (SALOME::SALOME_Exception);
GEOM::ListOfDouble* GetLinearRange()
throw (SALOME::SALOME_Exception); throw (SALOME::SALOME_Exception);
GEOM::GEOM_Shape_ptr GetShape1() void SetPosition(double P0x, double P0y, double P0z,
double VXx, double VXy, double VXz,
double VYx, double VYy, double VYz,
double VZx, double VZy, double VZz)
throw (SALOME::SALOME_Exception); throw (SALOME::SALOME_Exception);
GEOM::GEOM_Shape_ptr GetShape2() void SetAngularRange(double MinValX, double MaxValX,
double MinValY, double MaxValY,
double MinValZ, double MaxValZ)
throw (SALOME::SALOME_Exception); throw (SALOME::SALOME_Exception);
GEOM::GEOM_Position_ptr GetPosition() void SetLinearRange(double MinValX, double MaxValX,
double MinValY, double MaxValY,
double MinValZ, double MaxValZ)
throw (SALOME::SALOME_Exception); throw (SALOME::SALOME_Exception);
GEOM::GEOM_Rotation_ptr GetRotation() char* Name() {return strdup(_name);};
throw (SALOME::SALOME_Exception);
GEOM::GEOM_Translation_ptr GetTranslation()
throw (SALOME::SALOME_Exception);
CORBA::Double GetStep()
throw (SALOME::SALOME_Exception);
char* Name();
void Name(const char* name); void Name(const char* name);
char* ShapeId(); char* ShapeId() {return strdup(_shapeid);};
void ShapeId(const char* shapeid); void ShapeId(const char* shapeid);
char* StudyShapeId(); char* StudyShapeId() {return strdup(_studyshapeid) ;};
void StudyShapeId(const char* studyshapeid); void StudyShapeId(const char* studyshapeid);
}; };

View File

@ -31,6 +31,7 @@ using namespace std;
#include "Partition_Spliter.hxx" #include "Partition_Spliter.hxx"
#include "Archimede_VolumeSection.hxx" #include "Archimede_VolumeSection.hxx"
#include "Sketcher_Profile.hxx"
#include "Utils_CorbaException.hxx" #include "Utils_CorbaException.hxx"
#include "utilities.h" #include "utilities.h"
@ -215,7 +216,7 @@ char* GEOM_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
{ {
GEOM::GEOM_Shape_var aShape = GEOM::GEOM_Shape::_narrow(_orb->string_to_object(IORString)); GEOM::GEOM_Shape_var aShape = GEOM::GEOM_Shape::_narrow(_orb->string_to_object(IORString));
if (!CORBA::is_nil(aShape)) { 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)); GEOM::GEOM_Assembly_var aAssembly = GEOM::GEOM_Assembly::_narrow(_orb->string_to_object(IORString));
if (!CORBA::is_nil(aAssembly)) { if (!CORBA::is_nil(aAssembly)) {
@ -407,8 +408,7 @@ char* GEOM_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
} }
/* Create the CORBA servant holding the TopoDS_Shape */ /* 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);
GEOM_Contact_i * Contact_servant = new GEOM_Contact_i(Contact, aShape1, aShape2, engine);
GEOM::GEOM_Contact_var result = GEOM::GEOM_Contact::_narrow(Contact_servant->_this()); GEOM::GEOM_Contact_var result = GEOM::GEOM_Contact::_narrow(Contact_servant->_this());
/* Create and set the name (IOR of shape converted into a string) */ /* Create and set the name (IOR of shape converted into a string) */
@ -476,6 +476,7 @@ char* GEOM_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
result->ShapeId(aPersRefString); result->ShapeId(aPersRefString);
return result->Name(); return result->Name();
} }
return 0 ;
} }
//============================================================================ //============================================================================
@ -562,7 +563,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy,
aShapeName = "Vertex_"; aShapeName = "Vertex_";
} }
if (strlen(theName) == 0) aShapeName += TCollection_AsciiString(aResultSO->Tag()); 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 //Set a name of the added shape
anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeName"); anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeName");
@ -645,7 +646,7 @@ CORBA::Boolean GEOM_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.ToCString(), aSeq.in(), true); if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.ToCString(), aSeq.in(), true);
SALOMEDS::Study_var Study = theComponent->GetStudy(); SALOMEDS::Study_var Study = theComponent->GetStudy();
TCollection_AsciiString name( strdup(Study->Name()) ); TCollection_AsciiString name( Study->Name() );
int StudyID = Study->StudyId(); int StudyID = Study->StudyId();
myStudyIDToDoc.Bind( StudyID, myCurrentOCAFDoc ); myStudyIDToDoc.Bind( StudyID, myCurrentOCAFDoc );
@ -673,7 +674,7 @@ CORBA::Boolean GEOM_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
// void GEOM_Gen_i::Save(const char *IORSComponent, const char *aUrlOfFile) // 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"); // TCollection_ExtendedString pathWithExt = path + TCollection_ExtendedString(".sgd");
// myOCAFApp->SaveAs(myCurrentOCAFDoc,pathWithExt); // myOCAFApp->SaveAs(myCurrentOCAFDoc,pathWithExt);
// } // }
@ -686,14 +687,14 @@ CORBA::Boolean GEOM_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
// void GEOM_Gen_i::Load(const char *IORSComponent, const char *aUrlOfFile) // 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"); // TCollection_ExtendedString pathWithExt = path + TCollection_ExtendedString(".sgd");
// myOCAFApp->Open(pathWithExt,myCurrentOCAFDoc); // myOCAFApp->Open(pathWithExt,myCurrentOCAFDoc);
// SALOMEDS::SComponent_var SC = SALOMEDS::SComponent::_narrow(_orb->string_to_object(IORSComponent)); // SALOMEDS::SComponent_var SC = SALOMEDS::SComponent::_narrow(_orb->string_to_object(IORSComponent));
// SALOMEDS::Study_var Study = SC->GetStudy(); // SALOMEDS::Study_var Study = SC->GetStudy();
// TCollection_AsciiString name( strdup(Study->Name()) ); // TCollection_AsciiString name( Study->Name() );
// int StudyID = Study->StudyId(); // int StudyID = Study->StudyId();
// myStudyIDToDoc.Bind( StudyID, myCurrentOCAFDoc ); // myStudyIDToDoc.Bind( StudyID, myCurrentOCAFDoc );
@ -840,7 +841,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream,
//============================================================================ //============================================================================
char* GEOM_Gen_i::ComponentDataType() char* GEOM_Gen_i::ComponentDataType()
{ {
return strdup("GEOM"); return CORBA::string_dup("GEOM");
} }
//============================================================================ //============================================================================
@ -850,7 +851,7 @@ char* GEOM_Gen_i::ComponentDataType()
void GEOM_Gen_i::register_name(char * name) void GEOM_Gen_i::register_name(char * name)
{ {
GEOM::GEOM_Gen_ptr g = GEOM::GEOM_Gen::_narrow(POA_GEOM::GEOM_Gen::_this()); GEOM::GEOM_Gen_ptr g = GEOM::GEOM_Gen::_narrow(POA_GEOM::GEOM_Gen::_this());
name_service->Register(g, strdup(name)); name_service->Register(g, name);
} }
@ -889,7 +890,7 @@ TopoDS_Shape GEOM_Gen_i::GetTopoShape(GEOM::GEOM_Shape_ptr shape_ptr)
TDF_Label lab ; TDF_Label lab ;
Handle(TDF_Data) D = myCurrentOCAFDoc->GetData() ; 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 ; Handle(TNaming_NamedShape) NamedShape ;
bool res = lab.FindAttribute(TNaming_NamedShape::GetID(), NamedShape) ; bool res = lab.FindAttribute(TNaming_NamedShape::GetID(), NamedShape) ;
@ -939,7 +940,7 @@ const char * GEOM_Gen_i::InsertInLabel(TopoDS_Shape S, const char *mystr, Handle
{ {
GEOMDS_Commands GC(OCAFDoc->Main()); GEOMDS_Commands GC(OCAFDoc->Main());
/* add attributs S and mystr in a new label */ /* 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; TCollection_AsciiString entry;
TDF_Tool::Entry(Lab,entry); TDF_Tool::Entry(Lab,entry);
@ -967,7 +968,7 @@ const char * GEOM_Gen_i::InsertInLabelDependentShape( TopoDS_Shape S,
TDF_Tool::Label(OCAFDoc->GetData(), mainshape_ptr->ShapeId(), mainRefLab); TDF_Tool::Label(OCAFDoc->GetData(), mainshape_ptr->ShapeId(), mainRefLab);
/* add attributs : S, nameIor and ref to main */ /* 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; TCollection_AsciiString entry;
TDF_Tool::Entry(Lab, entry); TDF_Tool::Entry(Lab, entry);
@ -3003,7 +3004,6 @@ throw (SALOME::SALOME_Exception)
GEOM::GEOM_Shape_var aShape = GetIORFromString( ListTools[ind] ); GEOM::GEOM_Shape_var aShape = GetIORFromString( ListTools[ind] );
TopoDS_Shape Shape = GetTopoShape(aShape); TopoDS_Shape Shape = GetTopoShape(aShape);
if(Shape.IsNull() ) { if(Shape.IsNull() ) {
//MESSAGE ( "In Partition a tool shape is null" );
THROW_SALOME_CORBA_EXCEPTION("In Partition a shape is null", SALOME::BAD_PARAM); THROW_SALOME_CORBA_EXCEPTION("In Partition a shape is null", SALOME::BAD_PARAM);
} }
if ( !ShapesMap.Contains( Shape ) && ToolsMap.Add( Shape )) if ( !ShapesMap.Contains( Shape ) && ToolsMap.Add( Shape ))
@ -3038,7 +3038,9 @@ throw (SALOME::SALOME_Exception)
PS.AddShape(Shape); PS.AddShape(Shape);
} }
//MESSAGE ( "Partition::Compute() " );
PS.Compute ((TopAbs_ShapeEnum) Limit); PS.Compute ((TopAbs_ShapeEnum) Limit);
//MESSAGE ( "Partition::Compute() - END" );
// suppress result outside of shapes in KInsideMap // suppress result outside of shapes in KInsideMap
for (ind = 0; ind < ListKeepInside.length(); ind++) { for (ind = 0; ind < ListKeepInside.length(); ind++) {
@ -3164,6 +3166,7 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeFilling(GEOM::GEOM_Shape_ptr myShape,
THROW_SALOME_CORBA_EXCEPTION("Initial shape doesn't contain only edges !", SALOME::BAD_PARAM); THROW_SALOME_CORBA_EXCEPTION("Initial shape doesn't contain only edges !", SALOME::BAD_PARAM);
} }
C = BRep_Tool::Curve(TopoDS::Edge(Scurrent), First, Last); C = BRep_Tool::Curve(TopoDS::Edge(Scurrent), First, Last);
if (C.IsNull()) continue;
C = new Geom_TrimmedCurve(C, First, Last); C = new Geom_TrimmedCurve(C, First, Last);
Section.AddCurve(C) ; Section.AddCurve(C) ;
i++ ; i++ ;
@ -3637,7 +3640,7 @@ GEOM::GEOM_Gen::ListOfIOR* GEOM_Gen_i::GetReferencedObjects(GEOM::GEOM_Shape_ptr
Handle(TDataStd_Name) Att; Handle(TDataStd_Name) Att;
L.FindAttribute(TDataStd_Name::GetID(),Att); L.FindAttribute(TDataStd_Name::GetID(),Att);
TCollection_AsciiString nameIOR (Att->Get()) ; TCollection_AsciiString nameIOR (Att->Get()) ;
aList[i] = strdup( nameIOR.ToCString() ); aList[i] = CORBA::string_dup( nameIOR.ToCString() );
i++; i++;
} }
@ -3687,7 +3690,7 @@ GEOM::GEOM_Gen::ListOfIOR* GEOM_Gen_i::GetObjects(GEOM::GEOM_Shape_ptr shape)
if (!Att->Get().IsEqual(TCollection_ExtendedString("Arguments")) ) { if (!Att->Get().IsEqual(TCollection_ExtendedString("Arguments")) ) {
TCollection_AsciiString nameIOR (Att->Get()); TCollection_AsciiString nameIOR (Att->Get());
aList[i] = strdup( nameIOR.ToCString() ); aList[i] = CORBA::string_dup( nameIOR.ToCString() );
i++; i++;
} }
ChildIterator1.Next(); ChildIterator1.Next();
@ -3709,7 +3712,9 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::ImportBREP(const char* filename)
try { try {
BRep_Builder aBuilder; BRep_Builder aBuilder;
BRepTools::Read(tds, strdup(filename), aBuilder) ; char* aCopyfilename = strdup(filename);
BRepTools::Read(tds, aCopyfilename, aBuilder) ;
free(aCopyfilename);
if (tds.IsNull()) { if (tds.IsNull()) {
THROW_SALOME_CORBA_EXCEPTION("Import BRep aborted", SALOME::BAD_PARAM); THROW_SALOME_CORBA_EXCEPTION("Import BRep aborted", SALOME::BAD_PARAM);
} }
@ -3863,10 +3868,21 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeFaces(const GEOM::GEOM_Gen::ListOfIOR& List
FR.Perform(); FR.Perform();
if(FR.IsDone()) { if(FR.IsDone()) {
for(; FR.More(); FR.Next()) int k = 0;
aBuilder.Add(C, FR.Current().Oriented(OriF)); TopoDS_Shape aFace;
result = CreateObject(C); for(; FR.More(); FR.Next()) {
InsertInLabelMoreArguments(C, result, ListShapes, myCurrentOCAFDoc); aFace = FR.Current().Oriented(OriF);
aBuilder.Add(C, aFace);
k++;
}
if(k == 1) {
result = CreateObject(aFace);
InsertInLabelMoreArguments(aFace, result, ListShapes, myCurrentOCAFDoc);
}
else {
result = CreateObject(C);
InsertInLabelMoreArguments(C, result, ListShapes, myCurrentOCAFDoc);
}
} }
} }
} }
@ -4144,7 +4160,34 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeArc(const GEOM::PointStruct& pInit,
return result ; 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() // function : MakeTranslation()
@ -5303,10 +5346,10 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakePanel(GEOM::GEOM_Shape_ptr shape,
GEOM::GEOM_Gen::ListOfIOR_var aList = new GEOM::GEOM_Gen::ListOfIOR; GEOM::GEOM_Gen::ListOfIOR_var aList = new GEOM::GEOM_Gen::ListOfIOR;
aList->length(4); aList->length(4);
aList[0]=strdup(Edge1->Name()); aList[0]=CORBA::string_dup(Edge1->Name());
aList[1]=strdup(Edge2->Name()); aList[1]=CORBA::string_dup(Edge2->Name());
aList[2]=strdup(Edge3->Name()); aList[2]=CORBA::string_dup(Edge3->Name());
aList[3]=strdup(Edge4->Name()); aList[3]=CORBA::string_dup(Edge4->Name());
GEOM::GEOM_Shape_ptr aWire = MakeWire( aList ); GEOM::GEOM_Shape_ptr aWire = MakeWire( aList );
GEOM::GEOM_Shape_ptr aFace = MakeFace( aWire, true ) ; GEOM::GEOM_Shape_ptr aFace = MakeFace( aWire, true ) ;
@ -5467,6 +5510,7 @@ GEOM::GEOM_Contact_ptr GEOM_Gen_i::AddContact(GEOM::GEOM_Assembly_ptr Ass,
CORBA::Double step) CORBA::Double step)
throw (SALOME::SALOME_Exception) throw (SALOME::SALOME_Exception)
{ {
cout<<"GEOM_Gen_i::AddContact"<<endl;
Kinematic_Contact* tds; Kinematic_Contact* tds;
TDF_Label mainRefLab; TDF_Label mainRefLab;
TDF_Tool::Label(myCurrentOCAFDoc->GetData(), Ass->ShapeId(), mainRefLab); TDF_Tool::Label(myCurrentOCAFDoc->GetData(), Ass->ShapeId(), mainRefLab);
@ -5480,8 +5524,7 @@ GEOM::GEOM_Contact_ptr GEOM_Gen_i::AddContact(GEOM::GEOM_Assembly_ptr Ass,
THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::AddContact", SALOME::BAD_PARAM); THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::AddContact", SALOME::BAD_PARAM);
/* Create the CORBA servant holding the TopoDS_Shape */ /* 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);
GEOM_Contact_i * Contact_servant = new GEOM_Contact_i(tds, Shape1, Shape2, engine);
GEOM::GEOM_Contact_var Contact = GEOM::GEOM_Contact::_narrow(Contact_servant->_this()); GEOM::GEOM_Contact_var Contact = GEOM::GEOM_Contact::_narrow(Contact_servant->_this());
/* Create and set the name (IOR of shape converted into a string) */ /* Create and set the name (IOR of shape converted into a string) */
@ -5511,6 +5554,7 @@ GEOM::GEOM_Animation_ptr GEOM_Gen_i::AddAnimation(GEOM::GEOM_Assembly_ptr Ass,
const short NbSeq) const short NbSeq)
throw (SALOME::SALOME_Exception) throw (SALOME::SALOME_Exception)
{ {
cout<<"GEOM_Gen_i::AddAnimation"<<endl;
Kinematic_Animation* tds; Kinematic_Animation* tds;
TDF_Label mainRefLab; TDF_Label mainRefLab;
TDF_Tool::Label(myCurrentOCAFDoc->GetData(), Ass->ShapeId(), mainRefLab); TDF_Tool::Label(myCurrentOCAFDoc->GetData(), Ass->ShapeId(), mainRefLab);
@ -5538,9 +5582,8 @@ GEOM::GEOM_Animation_ptr GEOM_Gen_i::AddAnimation(GEOM::GEOM_Assembly_ptr Ass,
TCollection_AsciiString entry; TCollection_AsciiString entry;
TDF_Tool::Entry(Lab, entry); TDF_Tool::Entry(Lab, entry);
const char *ent = entry.ToCString(); Animation->ShapeId(entry.ToCString());
Animation->ShapeId(ent);
return Animation; return Animation;
} }
@ -5557,16 +5600,12 @@ void GEOM_Gen_i::SetPosition(GEOM::GEOM_Contact_ptr Contact)
TDF_Tool::Label(myCurrentOCAFDoc->GetData(), Contact->ShapeId(), mainRefLab); TDF_Tool::Label(myCurrentOCAFDoc->GetData(), Contact->ShapeId(), mainRefLab);
GEOMDS_Commands GC(myCurrentOCAFDoc->Main()); GEOMDS_Commands GC(myCurrentOCAFDoc->Main());
GEOM::GEOM_Position_var myGeomPosition = GEOM::GEOM_Position::_narrow(Contact->GetPosition()); GEOM::ListOfDouble_var aList = Contact->GetPosition();
GEOM::PointStruct P0 = myGeomPosition->GetOrigin();
GEOM::DirStruct VX = myGeomPosition->GetVX();
GEOM::DirStruct VY = myGeomPosition->GetVY();
GEOM::DirStruct VZ = myGeomPosition->GetVZ();
GC.SetPosition(mainRefLab, P0.x, P0.y, P0.z, GC.SetPosition(mainRefLab, aList[0], aList[1], aList[2],
VX.PS.x, VX.PS.y, VX.PS.z, aList[3], aList[4], aList[5],
VY.PS.x, VY.PS.y, VY.PS.z, aList[6], aList[7], aList[8],
VZ.PS.x, VZ.PS.y, VZ.PS.z); aList[9], aList[10], aList[11]);
} }
catch(Standard_Failure) catch(Standard_Failure)
THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::SetPosition", SALOME::BAD_PARAM); THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::SetPosition", SALOME::BAD_PARAM);
@ -5576,10 +5615,10 @@ void GEOM_Gen_i::SetPosition(GEOM::GEOM_Contact_ptr Contact)
//================================================================================= //=================================================================================
// function : SetRotation() // function : SetAngularRange()
// purpose : // 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) throw (SALOME::SALOME_Exception)
{ {
try { try {
@ -5587,28 +5626,23 @@ void GEOM_Gen_i::SetRotation(GEOM::GEOM_Contact_ptr Contact)
TDF_Tool::Label(myCurrentOCAFDoc->GetData(), Contact->ShapeId(), mainRefLab); TDF_Tool::Label(myCurrentOCAFDoc->GetData(), Contact->ShapeId(), mainRefLab);
GEOMDS_Commands GC(myCurrentOCAFDoc->Main()); GEOMDS_Commands GC(myCurrentOCAFDoc->Main());
GEOM::GEOM_Rotation_var myGeomRotation = GEOM::GEOM_Rotation::_narrow(Contact->GetRotation()); GEOM::ListOfDouble_var aList = Contact->GetAngularRange();
int aRot1 = myGeomRotation->GetRot1();
int aRot2 = myGeomRotation->GetRot2();
int aRot3 = myGeomRotation->GetRot3();
double aVal1 = myGeomRotation->GetVal1();
double aVal2 = myGeomRotation->GetVal2();
double aVal3 = myGeomRotation->GetVal3();
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) 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; return;
} }
//================================================================================= //=================================================================================
// function : SetTranslation() // function : SetLinearRange()
// purpose : // 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) throw (SALOME::SALOME_Exception)
{ {
try { try {
@ -5616,15 +5650,46 @@ void GEOM_Gen_i::SetTranslation(GEOM::GEOM_Contact_ptr Contact)
TDF_Tool::Label(myCurrentOCAFDoc->GetData(), Contact->ShapeId(), mainRefLab); TDF_Tool::Label(myCurrentOCAFDoc->GetData(), Contact->ShapeId(), mainRefLab);
GEOMDS_Commands GC(myCurrentOCAFDoc->Main()); GEOMDS_Commands GC(myCurrentOCAFDoc->Main());
GEOM::GEOM_Translation_var myGeomTranslation = GEOM::GEOM_Translation::_narrow(Contact->GetTranslation()); GEOM::ListOfDouble_var aList = Contact->GetLinearRange();
double aValX = myGeomTranslation->GetValX();
double aValY = myGeomTranslation->GetValY();
double aValZ = myGeomTranslation->GetValZ();
GC.SetTranslation(mainRefLab, aValX, aValY, aValZ); GC.SetLinearRange(mainRefLab, aList[0], aList[1], aList[2],
aList[3], aList[4], aList[5]);
} }
catch(Standard_Failure) catch(Standard_Failure)
THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::SetTranslation", SALOME::BAD_PARAM); THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::SetLinearRange", SALOME::BAD_PARAM);
return;
}
//=================================================================================
// function : SetDisplacement()
// purpose :
//=================================================================================
void GEOM_Gen_i::SetDisplacement(GEOM::GEOM_Animation_ptr Animation, GEOM::GEOM_Contact_ptr Contact)
throw (SALOME::SALOME_Exception)
{
cout<<"GEOM_Gen_i::SetDisplacement"<<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;
}
GEOM::ListOfDouble_var aList = Animation->GetDisplacement(Contact);
GC.SetDisplacement(mainRefLab, aKContact,
aList[0], aList[1], aList[2], aList[3], aList[4], aList[5],
aList[6], aList[7], aList[8], aList[9], aList[10], aList[11]);
}
catch(Standard_Failure)
THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::SetDisplacement", SALOME::BAD_PARAM);
return; return;
} }

View File

@ -392,6 +392,7 @@ class GEOM_Gen_i: public POA_GEOM::GEOM_Gen,
GEOM::GEOM_Shape_ptr MakePlacedBox(CORBA::Double x1, CORBA::Double y1, CORBA::Double z1, GEOM::GEOM_Shape_ptr MakePlacedBox(CORBA::Double x1, CORBA::Double y1, CORBA::Double z1,
CORBA::Double delta1, CORBA::Double delta2, CORBA::Double delta3) CORBA::Double delta1, CORBA::Double delta2, CORBA::Double delta3)
throw (SALOME::SALOME_Exception) ; throw (SALOME::SALOME_Exception) ;
GEOM::GEOM_Shape_ptr MakePanel(GEOM::GEOM_Shape_ptr shape, GEOM::GEOM_Shape_ptr MakePanel(GEOM::GEOM_Shape_ptr shape,
CORBA::Short directiontype, CORBA::Short directiontype,
CORBA::Double delta) CORBA::Double delta)
@ -401,17 +402,17 @@ class GEOM_Gen_i: public POA_GEOM::GEOM_Gen,
// Transformations Operations // // Transformations Operations //
//---------------------------------------------------------------------// //---------------------------------------------------------------------//
// Copy // Copy
GEOM::GEOM_Shape_ptr MakeCopy(GEOM::GEOM_Shape_ptr shape) GEOM::GEOM_Shape_ptr MakeCopy( GEOM::GEOM_Shape_ptr shape)
throw (SALOME::SALOME_Exception) ; throw (SALOME::SALOME_Exception) ;
// Translation // 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 x,
CORBA::Double y, CORBA::Double y,
CORBA::Double z) CORBA::Double z)
throw (SALOME::SALOME_Exception) ; throw (SALOME::SALOME_Exception) ;
// Rotation // 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, const GEOM::AxisStruct& axis,
CORBA::Double angle) CORBA::Double angle)
throw (SALOME::SALOME_Exception) ; throw (SALOME::SALOME_Exception) ;
@ -587,6 +588,14 @@ class GEOM_Gen_i: public POA_GEOM::GEOM_Gen,
const GEOM::PointStruct& pEnd) const GEOM::PointStruct& pEnd)
throw (SALOME::SALOME_Exception) ; 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) GEOM::GEOM_Shape_ptr MakeCompound (const GEOM::GEOM_Gen::ListOfIOR& ListShapes)
throw (SALOME::SALOME_Exception) ; throw (SALOME::SALOME_Exception) ;
GEOM::GEOM_Shape_ptr MakeWire (const GEOM::GEOM_Gen::ListOfIOR& ListShapes) GEOM::GEOM_Shape_ptr MakeWire (const GEOM::GEOM_Gen::ListOfIOR& ListShapes)
@ -632,9 +641,12 @@ class GEOM_Gen_i: public POA_GEOM::GEOM_Gen,
throw (SALOME::SALOME_Exception) ; throw (SALOME::SALOME_Exception) ;
void SetPosition(GEOM::GEOM_Contact_ptr Contact) void SetPosition(GEOM::GEOM_Contact_ptr Contact)
throw (SALOME::SALOME_Exception) ; throw (SALOME::SALOME_Exception) ;
void SetRotation(GEOM::GEOM_Contact_ptr Contact) void SetAngularRange(GEOM::GEOM_Contact_ptr Contact)
throw (SALOME::SALOME_Exception) ; throw (SALOME::SALOME_Exception) ;
void SetTranslation(GEOM::GEOM_Contact_ptr Contact) void SetLinearRange(GEOM::GEOM_Contact_ptr Contact)
throw (SALOME::SALOME_Exception) ;
void SetDisplacement(GEOM::GEOM_Animation_ptr Animation,
GEOM::GEOM_Contact_ptr Contact)
throw (SALOME::SALOME_Exception) ; throw (SALOME::SALOME_Exception) ;
}; };

View File

@ -1,147 +0,0 @@
// GEOM GEOM :
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
// File : GEOM_Position_i.cc
// Author : Damien COQUERET
// Module : GEOM
// $Header$
using namespace std;
#include "GEOM_Position_i.hh"
//=================================================================================
// function : GEOM_Position_i() constructor (no arguments)
// purpose : for what now ?
//=================================================================================
GEOM_Position_i::GEOM_Position_i()
{
}
//=================================================================================
// function : constructor
// purpose : constructor for servant creation
//=================================================================================
GEOM_Position_i::GEOM_Position_i(const GEOM::PointStruct& P0, const GEOM::DirStruct& VX,
const GEOM::DirStruct& VY, const GEOM::DirStruct& VZ)
{
SetOrigin(P0);
SetVX(VX);
SetVY(VY);
SetVZ(VZ);
return;
}
//=================================================================================
// function : destructor
// purpose :
//=================================================================================
GEOM_Position_i::~GEOM_Position_i() {}
//=================================================================================
// function : SetOrigin()
// purpose :
//=================================================================================
void GEOM_Position_i::SetOrigin(const GEOM::PointStruct& P0)
throw(SALOME::SALOME_Exception)
{
_P0 = P0;
return;
}
//=================================================================================
// function : SetVX()
// purpose :
//=================================================================================
void GEOM_Position_i::SetVX(const GEOM::DirStruct& Vect)
throw(SALOME::SALOME_Exception)
{
_VX = Vect;
return;
}
//=================================================================================
// function : SetVY()
// purpose :
//=================================================================================
void GEOM_Position_i::SetVY(const GEOM::DirStruct& Vect)
throw(SALOME::SALOME_Exception)
{
_VY = Vect;
return;
}
//=================================================================================
// function : SetVZ()
// purpose :
//=================================================================================
void GEOM_Position_i::SetVZ(const GEOM::DirStruct& Vect)
throw(SALOME::SALOME_Exception)
{
_VZ = Vect;
return;
}
//=================================================================================
// function : GetOrigin()
// purpose :
//=================================================================================
GEOM::PointStruct GEOM_Position_i::GetOrigin()
throw(SALOME::SALOME_Exception)
{
return _P0;
}
//=================================================================================
// function : GetVX()
// purpose :
//=================================================================================
GEOM::DirStruct GEOM_Position_i::GetVX()
throw(SALOME::SALOME_Exception)
{
return _VX;
}
//=================================================================================
// function : GetVY()
// purpose :
//=================================================================================
GEOM::DirStruct GEOM_Position_i::GetVY()
throw(SALOME::SALOME_Exception)
{
return _VY;
}
//=================================================================================
// function : GetVZ()
// purpose :
//=================================================================================
GEOM::DirStruct GEOM_Position_i::GetVZ()
throw(SALOME::SALOME_Exception)
{
return _VZ;
}

View File

@ -1,84 +0,0 @@
// GEOM GEOM :
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
// File : GEOM_Position_i.hh
// Author : Damien COQUERET
// Module : GEOM
// $Header$
#ifndef __GEOM_POSITION_I_H__
#define __GEOM_POSITION_I_H__
// IDL headers
#include <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

View File

@ -1,135 +0,0 @@
// GEOM GEOM :
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
// File : GEOM_Rotation_i.cc
// Author : Damien COQUERET
// Module : GEOM
// $Header$
using namespace std;
#include "GEOM_Rotation_i.hh"
//=================================================================================
// function : GEOM_Rotation_i() constructor (no arguments)
// purpose : for what now ?
//=================================================================================
GEOM_Rotation_i::GEOM_Rotation_i()
{
}
//=================================================================================
// function : constructor
// purpose : constructor for servant creation
//=================================================================================
GEOM_Rotation_i::GEOM_Rotation_i(CORBA::Long Rot1, CORBA::Long Rot2, CORBA::Long Rot3,
CORBA::Double Val1, CORBA::Double Val2, CORBA::Double Val3)
{
SetRotation(Rot1, Rot2, Rot3, Val1, Val2, Val3);
return;
}
//=================================================================================
// function : destructor
// purpose :
//=================================================================================
GEOM_Rotation_i::~GEOM_Rotation_i() {}
//=================================================================================
// function : SetRotation()
// purpose :
//=================================================================================
void GEOM_Rotation_i::SetRotation(CORBA::Long Rot1, CORBA::Long Rot2, CORBA::Long Rot3,
CORBA::Double Val1, CORBA::Double Val2, CORBA::Double Val3)
throw(SALOME::SALOME_Exception)
{
_Rot1 = Rot1;
_Rot2 = Rot2;
_Rot3 = Rot3;
_Val1 = Val1;
_Val2 = Val2;
_Val3 = Val3;
return;
}
//=================================================================================
// function : GetRot1()
// purpose :
//=================================================================================
CORBA::Long GEOM_Rotation_i::GetRot1() throw(SALOME::SALOME_Exception)
{
return _Rot1;
}
//=================================================================================
// function : GetRot2()
// purpose :
//=================================================================================
CORBA::Long GEOM_Rotation_i::GetRot2() throw(SALOME::SALOME_Exception)
{
return _Rot2;
}
//=================================================================================
// function : GetRot3()
// purpose :
//=================================================================================
CORBA::Long GEOM_Rotation_i::GetRot3() throw(SALOME::SALOME_Exception)
{
return _Rot3;
}
//=================================================================================
// function : GetVal1()
// purpose :
//=================================================================================
CORBA::Double GEOM_Rotation_i::GetVal1() throw(SALOME::SALOME_Exception)
{
return _Val1;
}
//=================================================================================
// function : GetVal2()
// purpose :
//=================================================================================
CORBA::Double GEOM_Rotation_i::GetVal2() throw(SALOME::SALOME_Exception)
{
return _Val2;
}
//=================================================================================
// function : GetVal3()
// purpose :
//=================================================================================
CORBA::Double GEOM_Rotation_i::GetVal3() throw(SALOME::SALOME_Exception)
{
return _Val3;
}

View File

@ -1,85 +0,0 @@
// GEOM GEOM :
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
// File : GEOM_Rotation_i.hh
// Author : Damien COQUERET
// Module : GEOM
// $Header$
#ifndef __GEOM_ROTATION_I_H__
#define __GEOM_ROTATION_I_H__
// IDL headers
#include <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

View File

@ -26,13 +26,16 @@
// Module : GEOM // Module : GEOM
// $Header$ // $Header$
using namespace std;
#include <BRepTools_ShapeSet.hxx>
#include "GEOM_Shape_i.hh"
#include "SALOME_NamingService.hxx"
#include <fstream.h> #include <fstream.h>
#include <strstream>
#include <BRepTools_ShapeSet.hxx>
#include <BRepTools.hxx> #include <BRepTools.hxx>
#include "GEOM_Shape_i.hh"
#include "SALOME_NamingService.hxx"
using namespace std;
//================================================================================= //=================================================================================
@ -84,7 +87,7 @@ GEOM_Shape_i::~GEOM_Shape_i() { delete &_geom; }
// : WARNING : Register to naming service actually removed ! // : WARNING : Register to naming service actually removed !
//================================================================================= //=================================================================================
void GEOM_Shape_i::Name(const char* name) { 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()); GEOM::GEOM_Shape_ptr g = GEOM::GEOM_Shape::_narrow(_this());
// Removed declaration of shapes to naming service // Removed declaration of shapes to naming service
@ -97,14 +100,14 @@ void GEOM_Shape_i::Name(const char* name) {
// function : Name (get method) // function : Name (get method)
// purpose : to get the attribute 'name' of this shape // 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) // function : MainName (set method)
// purpose : to set the attribute 'name' of this mainshape. // purpose : to set the attribute 'name' of this mainshape.
//================================================================================= //=================================================================================
void GEOM_Shape_i::MainName(const char* name) { void GEOM_Shape_i::MainName(const char* name) {
_mainname = strdup(name); _mainname = CORBA::string_dup(name);
} }
@ -112,7 +115,7 @@ void GEOM_Shape_i::MainName(const char* name) {
// function : MainName (get method) // function : MainName (get method)
// purpose : to get the attribute 'name' of this shape // 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 : IsMainShape (get method)
@ -132,14 +135,14 @@ void GEOM_Shape_i::IsMainShape(const bool abool) { _ismain = abool ; }
// function : ShapeId // function : ShapeId
// purpose : to get the id of this shape from GEOM (OCAF entry) // 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) // function : ShapeId (set method)
// purpose : to set the id of this shape in GEOM/OCAF doc // purpose : to set the id of this shape in GEOM/OCAF doc
//================================================================================= //=================================================================================
void GEOM_Shape_i::ShapeId(const char * shapeid) { _shapeid = strdup(shapeid) ; } void GEOM_Shape_i::ShapeId(const char * shapeid) { _shapeid = CORBA::string_dup(shapeid) ; }
@ -147,7 +150,7 @@ void GEOM_Shape_i::ShapeId(const char * shapeid) { _shapeid = strdup(shapeid) ;
// function : StudyShapeId (get method) // function : StudyShapeId (get method)
// purpose : to get the id of this shape from the study document (OCAF entry) // purpose : to get the id of this shape from the study document (OCAF entry)
//================================================================================= //=================================================================================
char* GEOM_Shape_i::StudyShapeId() { return strdup(_studyshapeid) ; } char* GEOM_Shape_i::StudyShapeId() { return CORBA::string_dup(_studyshapeid) ; }
//================================================================================= //=================================================================================
@ -155,7 +158,7 @@ char* GEOM_Shape_i::StudyShapeId() { return strdup(_studyshapeid) ; }
// purpose : to set the id of this shape in the Study document (OCAF entry) // purpose : to set the id of this shape in the Study document (OCAF entry)
//================================================================================= //=================================================================================
void GEOM_Shape_i::StudyShapeId(const char * studyshapeid) void GEOM_Shape_i::StudyShapeId(const char * studyshapeid)
{ _studyshapeid = strdup(studyshapeid) ; } { _studyshapeid = CORBA::string_dup(studyshapeid) ; }
@ -209,7 +212,7 @@ void GEOM_Shape_i::NameType(const char* name) {
// function : NameType (get method) // function : NameType (get method)
// purpose : to get the attribute 'nametype' of this shape // 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 // function : GetShapeStream

View File

@ -1,70 +0,0 @@
// GEOM GEOM :
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
// File : GEOM_Translation_i.hh
// Author : Damien COQUERET
// Module : GEOM
// $Header$
#ifndef __GEOM_TRANSLATION_I_H__
#define __GEOM_TRANSLATION_I_H__
// IDL headers
#include <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

View File

@ -37,7 +37,7 @@ VPATH=.:@srcdir@:@top_srcdir@/idl
# Libraries targets # Libraries targets
LIB = libGEOMEngine.la 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 LIB_SERVER_IDL = SALOME_Component.idl SALOMEDS.idl SALOME_Exception.idl GEOM_Gen.idl GEOM_Shape.idl GEOM_Kinematic.idl
# Executables targets # Executables targets
@ -46,12 +46,12 @@ BIN_SRC =
BIN_CLIENT_IDL = BIN_CLIENT_IDL =
BIN_SERVER_IDL = BIN_SERVER_IDL =
EXPORT_HEADERS = EXPORT_HEADERS = GEOM_Assembly_i.hh
# additionnal information to compil and link file # additionnal information to compil and link file
CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
CXXFLAGS += $(OCC_CXXFLAGS) -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 # additional file to be cleaned
MOSTLYCLEAN = MOSTLYCLEAN =

View File

@ -219,9 +219,9 @@ bool GEOMBase::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString
GEOM::GEOM_Contact_ptr myGeomContact = myGeomBase->ConvertIOinContact(IO, testResult); GEOM::GEOM_Contact_ptr myGeomContact = myGeomBase->ConvertIOinContact(IO, testResult);
int type = myGeomContact->GetType(); int type = myGeomContact->GetType();
if(type == 0 || type == 2) //EMBEDDING || SLIDE 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 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_DisplayOnly_Popup_ID);
popup->removeItem(QAD_Display_Popup_ID); popup->removeItem(QAD_Display_Popup_ID);
popup->removeItem(QAD_Erase_Popup_ID); popup->removeItem(QAD_Erase_Popup_ID);
@ -382,9 +382,9 @@ bool GEOMBase::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString
GEOM::GEOM_Contact_ptr myGeomContact = myGeomBase->ConvertIOinContact(IO, testResult); GEOM::GEOM_Contact_ptr myGeomContact = myGeomBase->ConvertIOinContact(IO, testResult);
int type = myGeomContact->GetType(); int type = myGeomContact->GetType();
if(type == 0 || type == 2) //EMBEDDING || SLIDE 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 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_DisplayOnly_Popup_ID);
popup->removeItem(QAD_Display_Popup_ID); popup->removeItem(QAD_Display_Popup_ID);
popup->removeItem(QAD_Erase_Popup_ID); popup->removeItem(QAD_Erase_Popup_ID);
@ -717,11 +717,17 @@ bool GEOMBase::AddInStudy(bool selection, const Handle(SALOME_InteractiveObject)
QString Name = SALOMEGUI_NameDlg::getName(QAD_Application::getDesktop(), anIO->getName()); QString Name = SALOMEGUI_NameDlg::getName(QAD_Application::getDesktop(), anIO->getName());
if(!Name.isEmpty()) { if(!Name.isEmpty()) {
// VTK // VTK
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
GActor->setName(strdup(Name.latin1())); char* aCopy = CORBA::string_dup(Name.latin1());
GActor->setName(aCopy);
delete(aCopy);
}
// OCC // OCC
else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
GAISShape->setName(strdup(Name.latin1())); char* aCopy = CORBA::string_dup(Name.latin1());
GAISShape->setName(aCopy);
delete(aCopy);
}
} }
else else
return false; return false;
@ -958,55 +964,55 @@ bool GEOMBase::GetShapeTypeString(const TopoDS_Shape& aShape, Standard_CString&
{ {
case TopAbs_COMPOUND: case TopAbs_COMPOUND:
{ {
aTypeString = strdup(tr("GEOM_COMPOUND")); aTypeString = CORBA::string_dup(tr("GEOM_COMPOUND"));
return true; return true;
} }
case TopAbs_COMPSOLID: case TopAbs_COMPSOLID:
{ {
aTypeString = strdup(tr("GEOM_COMPOUNDSOLID")) ; aTypeString = CORBA::string_dup(tr("GEOM_COMPOUNDSOLID")) ;
return true ; return true ;
} }
case TopAbs_SOLID: case TopAbs_SOLID:
{ {
aTypeString = strdup(tr("GEOM_SOLID")) ; aTypeString = CORBA::string_dup(tr("GEOM_SOLID")) ;
return true ; return true ;
} }
case TopAbs_SHELL: case TopAbs_SHELL:
{ {
aTypeString = strdup(tr("GEOM_SHELL")) ; aTypeString = CORBA::string_dup(tr("GEOM_SHELL")) ;
return true ; return true ;
} }
case TopAbs_FACE: case TopAbs_FACE:
{ {
BRepAdaptor_Surface surf(TopoDS::Face(aShape)); BRepAdaptor_Surface surf(TopoDS::Face(aShape));
if(surf.GetType() == GeomAbs_Plane) { if(surf.GetType() == GeomAbs_Plane) {
aTypeString = strdup(tr("GEOM_PLANE")); aTypeString = CORBA::string_dup(tr("GEOM_PLANE"));
return true; return true;
} }
else if(surf.GetType() == GeomAbs_Cylinder) { else if(surf.GetType() == GeomAbs_Cylinder) {
aTypeString = strdup(tr("GEOM_SURFCYLINDER")); aTypeString = CORBA::string_dup(tr("GEOM_SURFCYLINDER"));
return true; return true;
} }
else if(surf.GetType() == GeomAbs_Sphere) { else if(surf.GetType() == GeomAbs_Sphere) {
aTypeString = strdup(tr("GEOM_SURFSPHERE")); aTypeString = CORBA::string_dup(tr("GEOM_SURFSPHERE"));
return true ; return true ;
} }
else if(surf.GetType() == GeomAbs_Torus) { else if(surf.GetType() == GeomAbs_Torus) {
aTypeString = strdup(tr("GEOM_SURFTORUS")); aTypeString = CORBA::string_dup(tr("GEOM_SURFTORUS"));
return true ; return true ;
} }
else if(surf.GetType() == GeomAbs_Cone) { else if(surf.GetType() == GeomAbs_Cone) {
aTypeString = strdup(tr("GEOM_SURFCONE")); aTypeString = CORBA::string_dup(tr("GEOM_SURFCONE"));
return true ; return true ;
} }
else { else {
aTypeString = strdup(tr("GEOM_FACE")); aTypeString = CORBA::string_dup(tr("GEOM_FACE"));
return true; return true;
} }
} }
case TopAbs_WIRE: case TopAbs_WIRE:
{ {
aTypeString = strdup(tr("GEOM_WIRE")); aTypeString = CORBA::string_dup(tr("GEOM_WIRE"));
return true; return true;
} }
case TopAbs_EDGE: case TopAbs_EDGE:
@ -1014,31 +1020,31 @@ bool GEOMBase::GetShapeTypeString(const TopoDS_Shape& aShape, Standard_CString&
BRepAdaptor_Curve curv(TopoDS::Edge(aShape)); BRepAdaptor_Curve curv(TopoDS::Edge(aShape));
if(curv.GetType() == GeomAbs_Line) { if(curv.GetType() == GeomAbs_Line) {
if((Abs(curv.FirstParameter()) >= 1E6) || (Abs(curv.LastParameter()) >= 1E6)) if((Abs(curv.FirstParameter()) >= 1E6) || (Abs(curv.LastParameter()) >= 1E6))
aTypeString = strdup(tr("GEOM_LINE")); aTypeString = CORBA::string_dup(tr("GEOM_LINE"));
else else
aTypeString = strdup(tr("GEOM_EDGE")); aTypeString = CORBA::string_dup(tr("GEOM_EDGE"));
return true; return true;
} }
else if(curv.GetType() == GeomAbs_Circle) { else if(curv.GetType() == GeomAbs_Circle) {
if(curv.IsClosed()) if(curv.IsClosed())
aTypeString = strdup(tr("GEOM_CIRCLE")); aTypeString = CORBA::string_dup(tr("GEOM_CIRCLE"));
else else
aTypeString = strdup(tr("GEOM_ARC")); aTypeString = CORBA::string_dup(tr("GEOM_ARC"));
return true; return true;
} }
else { else {
aTypeString = strdup(tr("GEOM_EDGE")); aTypeString = CORBA::string_dup(tr("GEOM_EDGE"));
return true; return true;
} }
} }
case TopAbs_VERTEX: case TopAbs_VERTEX:
{ {
aTypeString = strdup(tr("GEOM_VERTEX")); aTypeString = CORBA::string_dup(tr("GEOM_VERTEX"));
return true; return true;
} }
case TopAbs_SHAPE: case TopAbs_SHAPE:
{ {
aTypeString = strdup(tr("GEOM_SHAPE")); aTypeString = CORBA::string_dup(tr("GEOM_SHAPE"));
return true; return true;
} }
} }
@ -1349,7 +1355,7 @@ void GEOMBase::ConvertListOfIOInListOfIOR(const SALOME_ListIO& aList, GEOM::GEOM
CORBA::String_var theValue = anIOR->Value(); CORBA::String_var theValue = anIOR->Value();
CORBA::Object_var theObj = _orb->string_to_object(theValue); CORBA::Object_var theObj = _orb->string_to_object(theValue);
if(theObj->_is_a("IDL:GEOM/GEOM_Shape:1.0")) { if(theObj->_is_a("IDL:GEOM/GEOM_Shape:1.0")) {
listIOR[j] = strdup(theValue); listIOR[j] = CORBA::string_dup(theValue);
j++; j++;
} }
} }
@ -1357,7 +1363,7 @@ void GEOMBase::ConvertListOfIOInListOfIOR(const SALOME_ListIO& aList, GEOM::GEOM
else if(IObject->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject))) { else if(IObject->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject))) {
Handle(GEOM_InteractiveObject) GIObject = Handle(GEOM_InteractiveObject)::DownCast(IObject); Handle(GEOM_InteractiveObject) GIObject = Handle(GEOM_InteractiveObject)::DownCast(IObject);
Standard_CString ior = GIObject->getIOR(); Standard_CString ior = GIObject->getIOR();
listIOR[j] = strdup(ior); listIOR[j] = CORBA::string_dup(ior);
j++; j++;
} }
} }
@ -1593,7 +1599,9 @@ bool GEOMBase::SelectionByNameInDialogs(QWidget* aWidget, const QString& objectU
SALOMEDS::SObject_var theObj = listSO[0]; SALOMEDS::SObject_var theObj = listSO[0];
/* Create a SALOME_InteractiveObject with a SALOME::SObject */ /* Create a SALOME_InteractiveObject with a SALOME::SObject */
Standard_CString anEntry = theObj->GetID(); 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 */ /* Add as a selected object */
/* Clear any previous selection : */ /* Clear any previous selection : */
@ -1617,6 +1625,23 @@ bool GEOMBase::DefineDlgPosition(QWidget* aDlg, int& x, int& y)
return true; 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 // EXPORTED METHODS

View File

@ -116,6 +116,9 @@ public :
bool SelectionByNameInDialogs(QWidget* aWidget, const QString& userObjectName, SALOME_Selection *Sel); bool SelectionByNameInDialogs(QWidget* aWidget, const QString& userObjectName, SALOME_Selection *Sel);
bool DefineDlgPosition(QWidget* aDlg, int& x, int& y); 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; GEOMContext* myGeomGUI;
GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */ GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */

View File

@ -39,6 +39,7 @@
#include <qlayout.h> #include <qlayout.h>
#include <qradiobutton.h> #include <qradiobutton.h>
#include <qbuttongroup.h> #include <qbuttongroup.h>
#include <qpushbutton.h>
class GEOMBase_Skeleton : public DlgRef_Skeleton_QTD class GEOMBase_Skeleton : public DlgRef_Skeleton_QTD
{ {

View File

@ -81,6 +81,7 @@ GEOMContext* GEOMContext::GetOrCreateGeomGUI(QAD_Desktop* desktop)
/* GetCurrentStudy */ /* GetCurrentStudy */
int studyId = desktop->getActiveStudy()->getStudyId(); int studyId = desktop->getActiveStudy()->getStudyId();
GeomGUI->myComponentGeom->GetCurrentStudy(studyId); GeomGUI->myComponentGeom->GetCurrentStudy(studyId);
GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels(); GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels();
} }
@ -88,7 +89,7 @@ GEOMContext* GEOMContext::GetOrCreateGeomGUI(QAD_Desktop* desktop)
int studyId = desktop->getActiveStudy()->getStudyId(); int studyId = desktop->getActiveStudy()->getStudyId();
GeomGUI->myComponentGeom->GetCurrentStudy(studyId); GeomGUI->myComponentGeom->GetCurrentStudy(studyId);
//GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels(); GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels();
return GeomGUI; return GeomGUI;
} }

View File

@ -31,7 +31,6 @@
#include "QAD_Desktop.h" #include "QAD_Desktop.h"
#include "GEOM_Client.hxx" #include "GEOM_Client.hxx"
#include "GEOM_Sketcher.h"
#include <OSD_SharedLibrary.hxx> #include <OSD_SharedLibrary.hxx>
#include <qapplication.h> #include <qapplication.h>
@ -51,7 +50,6 @@ private :
QDialog* myActiveDialogBox; /* Unique active dialog box */ QDialog* myActiveDialogBox; /* Unique active dialog box */
GEOM_Client myShapeReader; GEOM_Client myShapeReader;
Standard_CString myFatherior; Standard_CString myFatherior;
Sketch mySketcher;
public : public :
int myNbGeom; /* Unique name for a geom entity */ int myNbGeom; /* Unique name for a geom entity */
@ -68,7 +66,6 @@ public :
int& GetNbGeom(){return myNbGeom;}; int& GetNbGeom(){return myNbGeom;};
GEOM_Client& GetShapeReader(){return myShapeReader;}; GEOM_Client& GetShapeReader(){return myShapeReader;};
Standard_CString& GetFatherior(){return myFatherior;}; Standard_CString& GetFatherior(){return myFatherior;};
Sketch& GetSketcher(){return mySketcher;};
bool LoadLibrary(QString GUILibrary); bool LoadLibrary(QString GUILibrary);

View File

@ -410,10 +410,6 @@ msgstr "anim_prev.png"
msgid "ICON_ANIM_PLAY" msgid "ICON_ANIM_PLAY"
msgstr "anim_play.png" msgstr "anim_play.png"
#:
msgid "ICON_ANIM_STOP"
msgstr "anim_stop.png"
#: #:
msgid "ICON_ANIM_NEXT" msgid "ICON_ANIM_NEXT"
msgstr "anim_next.png" msgstr "anim_next.png"

View File

@ -1314,6 +1314,24 @@ msgstr "Fillet can't be computed with radius %1"
msgid "GEOM_CHAMFER_ABORT" msgid "GEOM_CHAMFER_ABORT"
msgstr "Chamfer can't be computed with %1 and %2" 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" msgid "GEOM_CONTACT_TITLE"
msgstr "Add Contact" msgstr "Add Contact"
@ -1398,6 +1416,36 @@ msgstr "Animation"
msgid "GEOM_ANIM_INLOOP" msgid "GEOM_ANIM_INLOOP"
msgstr "In Loop" 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" msgid "GEOM_POSITION"
msgstr "Position" msgstr "Position"

View File

@ -1315,6 +1315,24 @@ msgstr "Le congé ne peut-être realisé avec un rayon de %1 "
msgid "GEOM_CHAMFER_ABORT" msgid "GEOM_CHAMFER_ABORT"
msgstr "Le chanfrein ne peut-être realisé avec %1 et %2 " 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" msgid "GEOM_CONTACT_TITLE"
msgstr "Nouveau Contact" msgstr "Nouveau Contact"
@ -1399,6 +1417,36 @@ msgstr "Animation"
msgid "GEOM_ANIM_INLOOP" msgid "GEOM_ANIM_INLOOP"
msgstr "En boucle" 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" msgid "GEOM_POSITION"
msgstr "Position" msgstr "Position"

View File

@ -60,6 +60,6 @@ LIB_SERVER_IDL =
CPPFLAGS += $(QT_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome CPPFLAGS += $(QT_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
CXXFLAGS += -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@ @CONCLUDE@

View File

@ -342,56 +342,56 @@ TDF_Label GEOMDS_Commands::AddContact(Kinematic_Contact& KContact,
TDataStd_Integer::Set(LabContactType, 2); TDataStd_Integer::Set(LabContactType, 2);
TDF_Label LabType = LabContact.NewChild(); TDF_Label LabType = LabContact.NewChild();
TDataStd_Integer::Set(LabType, KContact.Type()); TDataStd_Integer::Set(LabType, KContact.GetType());
int ret; int ret;
TDF_Label NewLab1 = LabContact.NewChild(); TDF_Label NewLab1 = LabContact.NewChild();
TNaming_Builder B1(NewLab1); TNaming_Builder B1(NewLab1);
B1.Select(KContact.Shape1(), KContact.Shape1()); B1.Select(KContact.GetShape1(), KContact.GetShape1());
TDF_Label RefLab1 = TNaming_Tool::Label(myLab, KContact.Shape1(), ret); TDF_Label RefLab1 = TNaming_Tool::Label(myLab, KContact.GetShape1(), ret);
TDF_Reference::Set(NewLab1, RefLab1); TDF_Reference::Set(NewLab1, RefLab1);
TDF_Label NewLab2 = LabContact.NewChild(); TDF_Label NewLab2 = LabContact.NewChild();
TNaming_Builder B2(NewLab2); TNaming_Builder B2(NewLab2);
B2.Select(KContact.Shape2(), KContact.Shape2()); B2.Select(KContact.GetShape2(), KContact.GetShape2());
TDF_Label RefLab2 = TNaming_Tool::Label(myLab, KContact.Shape2(), ret); TDF_Label RefLab2 = TNaming_Tool::Label(myLab, KContact.GetShape2(), ret);
TDF_Reference::Set(NewLab2, RefLab2); TDF_Reference::Set(NewLab2, RefLab2);
TDF_Label LabPosition = LabContact.NewChild(); TDF_Label LabPosition = LabContact.NewChild();
Handle(TDataStd_RealArray) RealArrayP = TDataStd_RealArray::Set(LabPosition, 1, 12); Handle(TDataStd_RealArray) RealArrayP = TDataStd_RealArray::Set(LabPosition, 1, 12);
RealArrayP->SetValue(1, KContact.Position().Origin().X()); RealArrayP->SetValue(1, KContact.GetPosition().GetOrigin().X());
RealArrayP->SetValue(2, KContact.Position().Origin().Y()); RealArrayP->SetValue(2, KContact.GetPosition().GetOrigin().Y());
RealArrayP->SetValue(3, KContact.Position().Origin().Z()); RealArrayP->SetValue(3, KContact.GetPosition().GetOrigin().Z());
RealArrayP->SetValue(4, KContact.Position().DirX().X()); RealArrayP->SetValue(4, KContact.GetPosition().GetDirX().X());
RealArrayP->SetValue(5, KContact.Position().DirX().Y()); RealArrayP->SetValue(5, KContact.GetPosition().GetDirX().Y());
RealArrayP->SetValue(6, KContact.Position().DirX().Z()); RealArrayP->SetValue(6, KContact.GetPosition().GetDirX().Z());
RealArrayP->SetValue(7, KContact.Position().DirY().X()); RealArrayP->SetValue(7, KContact.GetPosition().GetDirY().X());
RealArrayP->SetValue(8, KContact.Position().DirY().Y()); RealArrayP->SetValue(8, KContact.GetPosition().GetDirY().Y());
RealArrayP->SetValue(9, KContact.Position().DirY().Z()); RealArrayP->SetValue(9, KContact.GetPosition().GetDirY().Z());
RealArrayP->SetValue(10, KContact.Position().DirZ().X()); RealArrayP->SetValue(10, KContact.GetPosition().GetDirZ().X());
RealArrayP->SetValue(11, KContact.Position().DirZ().Y()); RealArrayP->SetValue(11, KContact.GetPosition().GetDirZ().Y());
RealArrayP->SetValue(12, KContact.Position().DirZ().Z()); RealArrayP->SetValue(12, KContact.GetPosition().GetDirZ().Z());
TDF_Label LabRotation1 = LabContact.NewChild(); TDF_Label LabAngularRange = LabContact.NewChild();
Handle(TDataStd_IntegerArray) IntegerArrayR = TDataStd_IntegerArray::Set(LabRotation1, 1, 3); Handle(TDataStd_RealArray) RealArrayR = TDataStd_RealArray::Set(LabAngularRange, 1, 6);
IntegerArrayR->SetValue(1, KContact.Rotation().Rot1()); RealArrayR->SetValue(1, KContact.GetAngularRange().GetMinValX());
IntegerArrayR->SetValue(2, KContact.Rotation().Rot2()); RealArrayR->SetValue(2, KContact.GetAngularRange().GetMaxValX());
IntegerArrayR->SetValue(3, KContact.Rotation().Rot3()); RealArrayR->SetValue(3, KContact.GetAngularRange().GetMinValY());
RealArrayR->SetValue(4, KContact.GetAngularRange().GetMaxValY());
RealArrayR->SetValue(5, KContact.GetAngularRange().GetMinValZ());
RealArrayR->SetValue(6, KContact.GetAngularRange().GetMaxValZ());
TDF_Label LabRotation2 = LabContact.NewChild(); TDF_Label LabLinearRange = LabContact.NewChild();
Handle(TDataStd_RealArray) RealArrayR = TDataStd_RealArray::Set(LabRotation2, 1, 3); Handle(TDataStd_RealArray) RealArrayT = TDataStd_RealArray::Set(LabLinearRange, 1, 6);
RealArrayR->SetValue(1, KContact.Rotation().ValX()); RealArrayT->SetValue(1, KContact.GetLinearRange().GetMinValX());
RealArrayR->SetValue(2, KContact.Rotation().ValY()); RealArrayT->SetValue(2, KContact.GetLinearRange().GetMaxValX());
RealArrayR->SetValue(3, KContact.Rotation().ValZ()); RealArrayT->SetValue(3, KContact.GetLinearRange().GetMinValY());
RealArrayT->SetValue(4, KContact.GetLinearRange().GetMaxValY());
TDF_Label LabTranslation = LabContact.NewChild(); RealArrayT->SetValue(5, KContact.GetLinearRange().GetMinValZ());
Handle(TDataStd_RealArray) RealArrayT = TDataStd_RealArray::Set(LabTranslation, 1, 3); RealArrayT->SetValue(6, KContact.GetLinearRange().GetMaxValZ());
RealArrayT->SetValue(1, KContact.Translation().ValX());
RealArrayT->SetValue(2, KContact.Translation().ValY());
RealArrayT->SetValue(3, KContact.Translation().ValZ());
TDF_Label LabStep = LabContact.NewChild(); TDF_Label LabStep = LabContact.NewChild();
TDataStd_Real::Set(LabStep, KContact.Step()); TDataStd_Real::Set(LabStep, KContact.GetStep());
return LabContact; return LabContact;
} }
@ -405,6 +405,7 @@ TDF_Label GEOMDS_Commands::AddAnimation(Kinematic_Animation& KAnimation,
const TDF_Label& AssLab, const TDF_Label& AssLab,
const TCollection_ExtendedString& Name) const TCollection_ExtendedString& Name)
{ {
cout<<"GEOMDS_Commands::AddAnimation"<<endl;
TDF_Label LabAnimation = myLab.NewChild(); TDF_Label LabAnimation = myLab.NewChild();
TDataStd_Name::Set(LabAnimation, Name); TDataStd_Name::Set(LabAnimation, Name);
@ -417,16 +418,38 @@ TDF_Label GEOMDS_Commands::AddAnimation(Kinematic_Animation& KAnimation,
int ret; int ret;
TDF_Label LabFrame = LabAnimation.NewChild(); TDF_Label LabFrame = LabAnimation.NewChild();
TNaming_Builder B1(LabFrame); TNaming_Builder B1(LabFrame);
B1.Select(KAnimation.Frame(), KAnimation.Frame()); B1.Select(KAnimation.GetFrame(), KAnimation.GetFrame());
TDF_Label RefLab = TNaming_Tool::Label(myLab, KAnimation.Frame(), ret); TDF_Label RefLab = TNaming_Tool::Label(myLab, KAnimation.GetFrame(), ret);
TDF_Reference::Set(LabFrame, RefLab); TDF_Reference::Set(LabFrame, RefLab);
TDF_Label LabDuration = LabAnimation.NewChild(); TDF_Label LabDuration = LabAnimation.NewChild();
Standard_Real duration = double(KAnimation.Duration()); Standard_Real duration = double(KAnimation.GetDuration());
TDataStd_Real::Set(LabDuration, duration); TDataStd_Real::Set(LabDuration, duration);
TDF_Label LabNbSeq = LabAnimation.NewChild(); 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; return LabAnimation;
} }
@ -480,7 +503,6 @@ Standard_Boolean GEOMDS_Commands::GetContact(const TDF_Label& aLabel,
Handle(TDataStd_Integer) anAttInteger1; Handle(TDataStd_Integer) anAttInteger1;
Handle(TDataStd_Integer) anAttInteger2; Handle(TDataStd_Integer) anAttInteger2;
Handle(TDataStd_Real) anAttReal; Handle(TDataStd_Real) anAttReal;
Handle(TDataStd_IntegerArray) anAttIntegerArrayR;
Handle(TDataStd_RealArray) anAttRealArrayP; Handle(TDataStd_RealArray) anAttRealArrayP;
Handle(TDataStd_RealArray) anAttRealArrayR; Handle(TDataStd_RealArray) anAttRealArrayR;
Handle(TDataStd_RealArray) anAttRealArrayT; Handle(TDataStd_RealArray) anAttRealArrayT;
@ -492,41 +514,36 @@ Standard_Boolean GEOMDS_Commands::GetContact(const TDF_Label& aLabel,
} }
} }
if(i == 2 && L.FindAttribute(TDataStd_Integer::GetID(), anAttInteger2)) { 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)) { 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)) { 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)) { if(i == 5 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayP)) {
gp_Pnt Center(anAttRealArrayP->Value(1), anAttRealArrayP->Value(2), anAttRealArrayP->Value(3)); 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 aDirX(anAttRealArrayP->Value(4), anAttRealArrayP->Value(5), anAttRealArrayP->Value(6));
gp_Dir aDirY(anAttRealArrayP->Value(7), anAttRealArrayP->Value(8), anAttRealArrayP->Value(9)); gp_Dir aDirY(anAttRealArrayP->Value(7), anAttRealArrayP->Value(8), anAttRealArrayP->Value(9));
gp_Dir aDirZ(anAttRealArrayP->Value(10), anAttRealArrayP->Value(11), anAttRealArrayP->Value(12)); gp_Dir aDirZ(anAttRealArrayP->Value(10), anAttRealArrayP->Value(11), anAttRealArrayP->Value(12));
Contact->Position().Origin(Center); Contact->GetPosition().SetOrigin(Center);
Contact->Position().DirX(aDirX); Contact->GetPosition().SetDirX(aDirX);
Contact->Position().DirY(aDirY); Contact->GetPosition().SetDirY(aDirY);
Contact->Position().DirZ(aDirZ); Contact->GetPosition().SetDirZ(aDirZ);
} }
if(i == 6 && L.FindAttribute(TDataStd_IntegerArray::GetID(), anAttIntegerArrayR)) { if(i == 6 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayR)) {
Contact->Rotation().Rot1(anAttIntegerArrayR->Value(1)); Contact->GetAngularRange().SetRangeX(anAttRealArrayR->Value(1), anAttRealArrayR->Value(2));
Contact->Rotation().Rot2(anAttIntegerArrayR->Value(2)); Contact->GetAngularRange().SetRangeY(anAttRealArrayR->Value(3), anAttRealArrayR->Value(4));
Contact->Rotation().Rot3(anAttIntegerArrayR->Value(3)); Contact->GetAngularRange().SetRangeZ(anAttRealArrayR->Value(5), anAttRealArrayR->Value(6));
} }
if(i == 7 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayR)) { if(i == 7 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayT)) {
Contact->Rotation().ValX(anAttRealArrayR->Value(1)); Contact->GetLinearRange().SetRangeX(anAttRealArrayT->Value(1), anAttRealArrayT->Value(2));
Contact->Rotation().ValY(anAttRealArrayR->Value(2)); Contact->GetLinearRange().SetRangeY(anAttRealArrayT->Value(3), anAttRealArrayT->Value(4));
Contact->Rotation().ValZ(anAttRealArrayR->Value(3)); Contact->GetLinearRange().SetRangeZ(anAttRealArrayT->Value(5), anAttRealArrayT->Value(6));
} }
if(i == 8 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayT)) { if(i == 8 && L.FindAttribute(TDataStd_Real::GetID(), anAttReal)) {
Contact->Translation().ValX(anAttRealArrayT->Value(1)); Contact->SetStep(anAttReal->Get());
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());
} }
i++; i++;
} }
@ -542,16 +559,19 @@ Standard_Boolean GEOMDS_Commands::GetContact(const TDF_Label& aLabel,
Standard_Boolean GEOMDS_Commands::GetAnimation(const TDF_Label& aLabel, Standard_Boolean GEOMDS_Commands::GetAnimation(const TDF_Label& aLabel,
Kinematic_Animation& returnAnim) Kinematic_Animation& returnAnim)
{ {
cout<<"GEOMDS_Commands::GetAnimation"<<endl;
Kinematic_Animation* Anim = new Kinematic_Animation(); Kinematic_Animation* Anim = new Kinematic_Animation();
TDF_ChildIterator it; TDF_ChildIterator it;
int i = 1; int i = 1;
int k = 0;
for(it.Initialize(aLabel, Standard_False); it.More(); it.Next()) { for(it.Initialize(aLabel, Standard_False); it.More(); it.Next()) {
TDF_Label L = it.Value(); TDF_Label L = it.Value();
Handle(TNaming_NamedShape) anAttTopo; Handle(TNaming_NamedShape) anAttTopo;
Handle(TDataStd_Real) anAttReal; Handle(TDataStd_Real) anAttReal;
Handle(TDataStd_Integer) anAttInteger; Handle(TDataStd_Integer) anAttInteger;
Handle(TDataStd_Integer) anAttInteger1; Handle(TDataStd_Integer) anAttInteger1;
Handle(TDataStd_RealArray) anAttRealArrayP;
if(i == 1 && L.FindAttribute(TDataStd_Integer::GetID(), anAttInteger)) { if(i == 1 && L.FindAttribute(TDataStd_Integer::GetID(), anAttInteger)) {
if(anAttInteger->Get() != 3) { if(anAttInteger->Get() != 3) {
@ -562,16 +582,23 @@ Standard_Boolean GEOMDS_Commands::GetAnimation(const TDF_Label& aLabel,
if(i == 2) { if(i == 2) {
Kinematic_Assembly* aAss = new Kinematic_Assembly(); Kinematic_Assembly* aAss = new Kinematic_Assembly();
Standard_Boolean test = GetAssembly(L, *aAss); Standard_Boolean test = GetAssembly(L, *aAss);
Anim->Assembly(aAss); Anim->SetAssembly(aAss);
} }
if(i == 3 && L.FindAttribute(TNaming_NamedShape::GetID(), anAttTopo)) { 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)) { 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)) { 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++; i++;
} }
@ -619,29 +646,27 @@ void GEOMDS_Commands::SetPosition(const TDF_Label& aLabel,
//======================================================================= //=======================================================================
// function : SetRotation() // function : SetAngularRange()
// purpose : // purpose :
//======================================================================= //=======================================================================
void GEOMDS_Commands::SetRotation(const TDF_Label& aLabel, void GEOMDS_Commands::SetAngularRange(const TDF_Label& aLabel,
int Rot1, int Rot2, int Rot3, double MinValX, double MaxValX,
double Val1, double Val2, double Val3) double MinValY, double MaxValY,
double MinValZ, double MaxValZ)
{ {
TDF_ChildIterator it; TDF_ChildIterator it;
int i = 1; int i = 1;
for(it.Initialize(aLabel, Standard_False); it.More(); it.Next()) { for(it.Initialize(aLabel, Standard_False); it.More(); it.Next()) {
TDF_Label L = it.Value(); TDF_Label L = it.Value();
Handle(TDataStd_IntegerArray) anAttIntegerArrayR;
Handle(TDataStd_RealArray) anAttRealArrayR; Handle(TDataStd_RealArray) anAttRealArrayR;
if(i == 6 && L.FindAttribute(TDataStd_IntegerArray::GetID(), anAttIntegerArrayR)) { if(i == 6 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayR)) {
anAttIntegerArrayR->SetValue(1, Rot1); anAttRealArrayR->SetValue(1, MinValX);
anAttIntegerArrayR->SetValue(2, Rot2); anAttRealArrayR->SetValue(2, MaxValX);
anAttIntegerArrayR->SetValue(3, Rot3); anAttRealArrayR->SetValue(3, MinValY);
} anAttRealArrayR->SetValue(4, MaxValY);
if(i == 7 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayR)) { anAttRealArrayR->SetValue(5, MinValZ);
anAttRealArrayR->SetValue(1, Val1); anAttRealArrayR->SetValue(6, MaxValZ);
anAttRealArrayR->SetValue(2, Val2);
anAttRealArrayR->SetValue(3, Val3);
return; return;
} }
i++; i++;
@ -651,11 +676,13 @@ void GEOMDS_Commands::SetRotation(const TDF_Label& aLabel,
//======================================================================= //=======================================================================
// function : SetTranslation() // function : SetLinearRange()
// purpose : // purpose :
//======================================================================= //=======================================================================
void GEOMDS_Commands::SetTranslation(const TDF_Label& aLabel, void GEOMDS_Commands::SetLinearRange(const TDF_Label& aLabel,
double Val1, double Val2, double Val3) double MinValX, double MaxValX,
double MinValY, double MaxValY,
double MinValZ, double MaxValZ)
{ {
TDF_ChildIterator it; TDF_ChildIterator it;
int i = 1; int i = 1;
@ -663,13 +690,56 @@ void GEOMDS_Commands::SetTranslation(const TDF_Label& aLabel,
TDF_Label L = it.Value(); TDF_Label L = it.Value();
Handle(TDataStd_RealArray) anAttRealArrayT; Handle(TDataStd_RealArray) anAttRealArrayT;
if(i == 8 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayT)) { if(i == 7 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayT)) {
anAttRealArrayT->SetValue(1, Val1); anAttRealArrayT->SetValue(1, MinValX);
anAttRealArrayT->SetValue(2, Val2); anAttRealArrayT->SetValue(2, MaxValX);
anAttRealArrayT->SetValue(3, Val3); anAttRealArrayT->SetValue(3, MinValY);
anAttRealArrayT->SetValue(4, MaxValY);
anAttRealArrayT->SetValue(5, MinValZ);
anAttRealArrayT->SetValue(6, MaxValZ);
return; return;
} }
i++; i++;
} }
return; 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;
}

View File

@ -146,10 +146,21 @@ public:
double VXx, double VXy, double VXz, double VXx, double VXy, double VXz,
double VYx, double VYy, double VYz, double VYx, double VYy, double VYz,
double VZx, double VZy, double VZz) ; double VZx, double VZy, double VZz) ;
Standard_EXPORT void SetRotation(const TDF_Label& aLabel, int Rot1, int Rot2, int Rot3, Standard_EXPORT void SetAngularRange(const TDF_Label& aLabel,
double Val1, double Val2, double Val3) ; double MinValX, double MaxValX,
Standard_EXPORT void SetTranslation(const TDF_Label& aLabel, double MinValY, double MaxValY,
double Val1, double Val2, double Val3) ; 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: protected:

View File

@ -63,10 +63,9 @@ typedef bool CP(QAD_Desktop*, QPopupMenu*, const QString&,
// function : GeometryGUI() // function : GeometryGUI()
// purpose : Constructor // purpose : Constructor
//======================================================================= //=======================================================================
GeometryGUI::GeometryGUI() : GeometryGUI::GeometryGUI( const QString& theName, QObject* theParent ) :
QObject() SALOMEGUI( theName, theParent )
{ {}
}
//======================================================================= //=======================================================================
@ -109,7 +108,6 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
return false; return false;
Mb->setItemEnabled(404, ViewOCC);//SKETCHER Mb->setItemEnabled(404, ViewOCC);//SKETCHER
Mb->setItemEnabled(406, ViewOCC);//SKETCHER
Mb->setItemEnabled(603, ViewOCC);//SuppressFace Mb->setItemEnabled(603, ViewOCC);//SuppressFace
Mb->setItemEnabled(604, ViewOCC);//SuppressHole Mb->setItemEnabled(604, ViewOCC);//SuppressHole
@ -117,168 +115,133 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
Mb->setItemEnabled(413, ViewOCC);// ShadingColor Settings Mb->setItemEnabled(413, ViewOCC);// ShadingColor Settings
Mb->setItemEnabled(414, ViewOCC);// Isos Settings Mb->setItemEnabled(414, ViewOCC);// Isos Settings
if(theCommandID == 4041 || // SKETCHER - POPUP VIEWER - SEGMENT if(theCommandID == 111 || // MENU FILE - IMPORT BREP
theCommandID == 4042 || // SKETCHER - POPUP VIEWER - ARC theCommandID == 112 || // MENU FILE - IMPORT IGES
theCommandID == 4043 || // SKETCHER - POPUP VIEWER - SET ANGLE theCommandID == 113 || // MENU FILE - IMPORT STEP
theCommandID == 4044 || // SKETCHER - POPUP VIEWER - SET X theCommandID == 121 || // MENU FILE - EXPORT BREP
theCommandID == 4045 || // SKETCHER - POPUP VIEWER - SET Y theCommandID == 122 || // MENU FILE - EXPORT IGES
theCommandID == 4046 || // SKETCHER - POPUP VIEWER - DELETE theCommandID == 123 || // MENU FILE - EXPORT STEP
theCommandID == 4047 || // SKETCHER - POPUP VIEWER - END theCommandID == 31 || // MENU EDIT - COPY
theCommandID == 4048 || // SKETCHER - POPUP VIEWER - CLOSE theCommandID == 33 || // MENU EDIT - DELETE
theCommandID == 4051 || // SKETCHER - MENU - SET PLANE theCommandID == 411 || // MENU SETTINGS - ADD IN STUDY
theCommandID == 4052 || // SKETCHER - MENU - TANGENT theCommandID == 412 || // MENU SETTINGS - SHADING COLOR
theCommandID == 4053 || // SKETCHER - MENU - PERPENDICULAR theCommandID == 413 || // MENU SETTINGS - ISOS
theCommandID == 4061 || // SKETCHER - MENU - LENGTH theCommandID == 414 || // MENU SETTINGS - STEP VALUE FOR SPIN BOXES
theCommandID == 4062 || // SKETCHER - MENU - ANGLE theCommandID == 5103 || // MENU TOOLS - CHECK GEOMETRY
theCommandID == 4063 || // SKETCHER - MENU - RADIUS theCommandID == 5104 || // MENU TOOLS - LOAD SCRIPT
theCommandID == 4064 || // SKETCHER - MENU - X theCommandID == 8032 || // POPUP VIEWER - COLOR
theCommandID == 4065) { // SKETCHER - MENU - Y 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")) if(!GeomGUI->LoadLibrary("libEntityGUI.so"))
return false; return false;
} }
else { else if(theCommandID == 4081 || // MENU BUILD - EDGE
if(GeomGUI->myState == 2) { theCommandID == 4082 || // MENU BUILD - WIRE
Mb->setItemEnabled(405, false);//SKETCHER theCommandID == 4083 || // MENU BUILD - FACE
GeomGUI->GetSketcher().Clear(); theCommandID == 4084 || // MENU BUILD - SHELL
GeomGUI->myState = -1; theCommandID == 4085 || // MENU BUILD - SOLID
} theCommandID == 4086) { // MENU BUILD - COMPUND
if(!GeomGUI->LoadLibrary("libBuildGUI.so"))
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
return false; 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 //Load Function OnGUIEvent
OSD_Function osdF = GeomGUI->myGUILibrary.DlSymb("OnGUIEvent"); OSD_Function osdF = GeomGUI->myGUILibrary.DlSymb("OnGUIEvent");
@ -319,12 +282,7 @@ bool GeometryGUI::OnMouseMove(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFra
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC) if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
return false; return false;
else
if(GeomGUI->myState == 2) {
OCCViewer_ViewPort* vp = ((OCCViewer_ViewFrame*)studyFrame->getRightFrame()->getViewFrame())->getViewPort();
GeomGUI->GetSketcher().MakeCurrentEdge(pe->x(), pe->y(), ((OCCViewer_ViewPort3d*)vp)->getView());
}
return true; return true;
} }
@ -340,14 +298,7 @@ bool GeometryGUI::OnMousePress(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFr
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC) if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
return false; return false;
if(GeomGUI->myState == 2) { if(GeomGUI->myState == 0) {
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->LoadLibrary("libBasicGUI.so")) if(!GeomGUI->LoadLibrary("libBasicGUI.so"))
return false; return false;
@ -451,8 +402,6 @@ bool GeometryGUI::SetSettings(QAD_Desktop* parent)
} }
Mb->setItemEnabled(404, ViewOCC);//SKETCHER Mb->setItemEnabled(404, ViewOCC);//SKETCHER
Mb->setItemEnabled(405, false);//SKETCHER
Mb->setItemEnabled(406, ViewOCC);//SKETCHER
Mb->setItemEnabled(603, ViewOCC);//SuppressFace Mb->setItemEnabled(603, ViewOCC);//SuppressFace
Mb->setItemEnabled(604, ViewOCC);//SuppressHole Mb->setItemEnabled(604, ViewOCC);//SuppressHole
@ -480,11 +429,8 @@ void GeometryGUI::DefinePopup(QString & theContext, QString & theParent, QString
theObject = ""; theObject = "";
theContext = ""; theContext = "";
if((theParent.compare("Viewer") == 0)) { if((theParent.compare("Viewer") == 0)) {
if(GeomGUI->myState == 2) if(Sel->IObjectCount() == 0)
theContext = "Sketch";
else if(Sel->IObjectCount() == 0)
theContext = "NothingSelected"; theContext = "NothingSelected";
} }
@ -531,24 +477,6 @@ bool GeometryGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QStr
{ {
GeometryGUI::GetOrCreateGeometryGUI(parent); 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")) if(!GeomGUI->LoadLibrary("libGEOMBase.so"))
return false; return false;
@ -571,25 +499,17 @@ bool GeometryGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QStr
// function : activeStudyChanged() // function : activeStudyChanged()
// purpose : static // purpose : static
//================================================================================= //=================================================================================
void GeometryGUI::activeStudyChanged(QAD_Desktop* parent) bool GeometryGUI::ActiveStudyChanged(QAD_Desktop* parent)
{ {
GeometryGUI::GetOrCreateGeometryGUI(parent); GeometryGUI::GetOrCreateGeometryGUI(parent);
if(GeomGUI != 0) { if(GeomGUI != 0) {
QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar(); 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; bool ViewOCC = false;
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
ViewOCC = true; ViewOCC = true;
Mb->setItemEnabled(404, ViewOCC);//SKETCHER Mb->setItemEnabled(404, ViewOCC);//SKETCHER
Mb->setItemEnabled(406, ViewOCC);//SKETCHER
Mb->setItemEnabled(603, ViewOCC);//SuppressFace Mb->setItemEnabled(603, ViewOCC);//SuppressFace
Mb->setItemEnabled(604, ViewOCC);//SuppressHole Mb->setItemEnabled(604, ViewOCC);//SuppressHole
@ -604,7 +524,7 @@ void GeometryGUI::activeStudyChanged(QAD_Desktop* parent)
// PAL5356: update VTK selection // PAL5356: update VTK selection
::UpdateVtkSelection(parent); ::UpdateVtkSelection(parent);
return; return true;
} }
@ -630,49 +550,23 @@ void GeometryGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theI
} }
//================================================================================= void GeometryGUI::SupportedViewType(int* buffer, int bufferSize)
// EXPORTED METHODS {
//================================================================================= if(!buffer || !bufferSize) return;
buffer[0] = (int)VIEW_OCC;
if (--bufferSize) buffer[1] = (int)VIEW_VTK;
}
void GeometryGUI::Deactivate()
{
if ( GeomGUI )
GeomGUI->EmitSignalCloseAllDialogs();
}
static GeometryGUI aGUI("");
extern "C" extern "C"
{ {
bool OnGUIEvent(int theCommandID, QAD_Desktop* parent) Standard_EXPORT SALOMEGUI* GetComponentGUI() {
{return GeometryGUI::OnGUIEvent(theCommandID, parent);} return &aGUI;
bool OnKeyPress(QKeyEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame)
{return GeometryGUI::OnKeyPress(pe, parent, studyFrame);}
bool OnMousePress(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame)
{return GeometryGUI::OnMousePress(pe, parent, studyFrame);}
bool OnMouseMove(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame)
{return GeometryGUI::OnMouseMove(pe, parent, studyFrame);}
bool SetSettings(QAD_Desktop* parent)
{return GeometryGUI::SetSettings(parent);}
bool customPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString & theContext,
const QString & theParent, const QString & theObject)
{return GeometryGUI::CustomPopup(parent, popup, theContext, theParent, theObject);}
void definePopup(QString & theContext, QString & parent, QString & theObject)
{GeometryGUI::DefinePopup(theContext, parent, theObject);}
bool activeStudyChanged(QAD_Desktop* parent)
{GeometryGUI::activeStudyChanged(parent);}
void buildPresentation(const Handle(SALOME_InteractiveObject)& theIO)
{GeometryGUI::BuildPresentation(theIO);}
void supportedViewType(int* buffer, int bufferSize)
{
if(!buffer || !bufferSize) return;
buffer[0] = (int)VIEW_OCC;
if (--bufferSize) buffer[1] = (int)VIEW_VTK;
}
void deactivate()
{
if ( GeomGUI )
GeomGUI->EmitSignalCloseAllDialogs();
} }
} }

View File

@ -29,34 +29,36 @@
#ifndef GEOMETRYGUI_H #ifndef GEOMETRYGUI_H
#define GEOMETRYGUI_H #define GEOMETRYGUI_H
#include "SALOMEGUI.h"
#include "GEOMContext.h" #include "GEOMContext.h"
//================================================================================= //=================================================================================
// class : GeometryGUI // class : GeometryGUI
// purpose : // purpose :
//================================================================================= //=================================================================================
class GeometryGUI : public QObject class GeometryGUI : public SALOMEGUI
{ {
Q_OBJECT /* for QT compatibility */ Q_OBJECT /* for QT compatibility */
public : public :
GeometryGUI(); GeometryGUI( const QString& name = "", QObject* parent = 0 );
~GeometryGUI(); ~GeometryGUI();
static GEOMContext* GetOrCreateGeometryGUI(QAD_Desktop* desktop); 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);
/* 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 #endif

View File

@ -264,6 +264,7 @@ const char* GEOM_Swig::getShapeTypeString(const char* IOR)
case TopAbs_SHAPE: case TopAbs_SHAPE:
{ return "Shape" ;} { return "Shape" ;}
} }
return 0;
} }

View File

@ -26,7 +26,6 @@
// Module : GEOM // Module : GEOM
// $Header: // $Header:
using namespace std;
#include "GEOMToolsGUI.h" #include "GEOMToolsGUI.h"
#include "QAD_Config.h" #include "QAD_Config.h"
@ -34,6 +33,7 @@ using namespace std;
#include "QAD_Tools.h" #include "QAD_Tools.h"
#include "QAD_MessageBox.h" #include "QAD_MessageBox.h"
#include "QAD_RightFrame.h" #include "QAD_RightFrame.h"
#include "QAD_PyEditor.h"
#include "OCCViewer_Viewer3d.h" #include "OCCViewer_Viewer3d.h"
#include "VTKViewer_ViewFrame.h" #include "VTKViewer_ViewFrame.h"
@ -60,6 +60,10 @@ using namespace std;
#include "GEOMToolsGUI_NbIsosDlg.h" // Method ISOS adjustement #include "GEOMToolsGUI_NbIsosDlg.h" // Method ISOS adjustement
#include "GEOMToolsGUI_TransparencyDlg.h" // Method TRANSPARENCY adjustement #include "GEOMToolsGUI_TransparencyDlg.h" // Method TRANSPARENCY adjustement
#include "utilities.h"
using namespace std;
//======================================================================= //=======================================================================
// function : GEOMToolsGUI() // function : GEOMToolsGUI()
// purpose : Constructor // purpose : Constructor
@ -791,7 +795,7 @@ bool GEOMToolsGUI::Import(int aState)
QString nameShape = QAD_Tools::getFileNameFromPath(file,false) + QString("_%1").arg(myGeomGUI->myNbGeom++); 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()->getActiveStudy()->setMessage( tr("GEOM_INF_LOADED").arg(QAD_Tools::getFileNameFromPath( file )) );
QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_READY")); QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_READY"));
} }
@ -839,7 +843,7 @@ bool GEOMToolsGUI::Export(int aState)
QApplication::setOverrideCursor( Qt::waitCursor ); QApplication::setOverrideCursor( Qt::waitCursor );
// Standard_Boolean result = BRepTools::Write(Shape->Shape(), strdup(file.latin1()) ); // Standard_Boolean result = BRepTools::Write(Shape->Shape(), strdup(file.latin1()) );
try { try {
myGeom->ExportBREP(strdup( file.latin1()), aShape); myGeom->ExportBREP((char*)file.latin1(), aShape);
} }
catch (const SALOME::SALOME_Exception& S_ex) { catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex); QtCatchCorbaException(S_ex);
@ -866,7 +870,7 @@ bool GEOMToolsGUI::Export(int aState)
if ( !file.isEmpty() && !aShape->_is_nil() ) { if ( !file.isEmpty() && !aShape->_is_nil() ) {
QApplication::setOverrideCursor( Qt::waitCursor ); QApplication::setOverrideCursor( Qt::waitCursor );
try { try {
myGeom->ExportIGES(strdup( file.latin1()), aShape); myGeom->ExportIGES((char*)file.latin1(), aShape);
} }
catch (const SALOME::SALOME_Exception& S_ex) { catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex); QtCatchCorbaException(S_ex);
@ -912,7 +916,7 @@ bool GEOMToolsGUI::Export(int aState)
QApplication::setOverrideCursor( Qt::waitCursor ) ; QApplication::setOverrideCursor( Qt::waitCursor ) ;
try { try {
myGeom->ExportSTEP(strdup( file.latin1()), aShape); myGeom->ExportSTEP((char*)file.latin1(), aShape);
} }
catch (const SALOME::SALOME_Exception& S_ex) { catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex); QtCatchCorbaException(S_ex);
@ -938,6 +942,7 @@ bool GEOMToolsGUI::Export(int aState)
} }
QApplication::restoreOverrideCursor() ; QApplication::restoreOverrideCursor() ;
return true;
} }

View File

@ -0,0 +1,105 @@
# GEOM GEOM_SWIG : binding of C++ omplementaion with Python
#
# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
#
#
#
# File : GEOM_Kinematic.py
# Author : Damien COQUERET, Open CASCADE
# Module : GEOM
# $Header:
import salome
import geompy
import math
geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
myBuilder = salome.myStudy.NewBuilder()
#Varaibles
TypeShape = 8 #Explode In Shape
Pivot = 1
Step = 0.
Duration = 5.
NbSeq = 50
#Import Shapes : Robot
Robot = geompy.ImportBREP("/home/dcq/robot.brep")
Id_Robot = geompy.addToStudy(Robot, "Robot")
#Decompose objects
SubShape = []
SubShape = geompy.SubShapeAll(Robot, TypeShape)
for Shape in SubShape :
name = geompy.SubShapeName(Shape._get_Name(), Robot._get_Name())
# Id_SubShape = geompy.addToStudy(Shape, "Shape")
Id_SubShape = geompy.addToStudyInFather(Robot, Shape, name)
#Kinematic
anAss = geompy.InitAssembly()
Id_Ass = geompy.addAssemblyToStudy(anAss, "Robot_Assembly")
aContact1 = geompy.AddContact(anAss, SubShape[0], SubShape[1], Pivot, Step)
aContact1.SetPosition(0., 0., 0., 0., 0., 1., 1., 0., 0., 0., 1., 0.)
geompy.SetPosition(aContact1)
aContact1.SetAngularRange(0., 45., 0., 0., 0., 0.)
geompy.SetAngularRange(aContact1)
Id_Contact1 = geompy.addContactToStudy(anAss, aContact1, "Robot_Contact1")
aContact2 = geompy.AddContact(anAss, SubShape[1], SubShape[2], Pivot, Step)
aContact2.SetPosition(0., 0., 900., 0., 1., 0., 0., 0., 1., 1., 0., 0.)
geompy.SetPosition(aContact2)
aContact2.SetAngularRange(0., 30., 0., 0., 0., 0.)
geompy.SetAngularRange(aContact2)
Id_Contact2 = geompy.addContactToStudy(anAss, aContact2, "Robot_Contact2")
aContact3 = geompy.AddContact(anAss, SubShape[2], SubShape[3], Pivot, Step)
aContact3.SetPosition(565.7, 0., 1465.7, 0., 1., 0., 0., 0., 1., 1., 0., 0.)
geompy.SetPosition(aContact3)
aContact3.SetAngularRange(-180., 0., 0., 0., 0., 0.)
geompy.SetAngularRange(aContact3)
Id_Contact3 = geompy.addContactToStudy(anAss, aContact3, "Robot_Contact3")
aContact4 = geompy.AddContact(anAss, SubShape[3], SubShape[4], Pivot, Step)
aContact4.SetPosition(1132.5, 0., 901.1, 0., 1., 0., 0., 0., 1., 1., 0., 0.)
geompy.SetPosition(aContact4)
aContact4.SetAngularRange(0., 180., 0., 0., 0., 0.)
geompy.SetAngularRange(aContact4)
Id_Contact4 = geompy.addContactToStudy(anAss, aContact4, "Robot_Contact4")
aContact5 = geompy.AddContact(anAss, SubShape[4], SubShape[5], Pivot, Step)
aContact5.SetPosition(0., 0., 900., 1., 0., 0., 0., 1., 0., 0., 0., 1.)
geompy.SetPosition(aContact5)
aContact5.SetAngularRange(0., 180., 0., 0., 0., 0.)
geompy.SetAngularRange(aContact5)
Id_Contact5 = geompy.addContactToStudy(anAss, aContact5, "Robot_Contact5")
anAnim = geompy.AddAnimation(anAss, SubShape[0], Duration, NbSeq)
aList = []
aList.append(0.)
aList.append(-180.)
i = 0
while i <= 9 :
aList.append(0.)
i = i + 1
anAnim.SetDisplacement(aContact3, aList)
geompy.SetDisplacement(anAnim, aContact3)
Id_Anim = geompy.addAnimationToStudy(anAnim, "Robot_Animation")

View File

@ -0,0 +1,58 @@
# GEOM GEOM_SWIG : binding of C++ omplementaion with Python
#
# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
#
#
#
# File : GEOM_Sketcher.py
# Author : Damien COQUERET, Open CASCADE
# Module : GEOM
# $Header$
import geompy
#SKETCHER INFOS
#Init Sketcher
#Create a string beginning by :"Sketcher:"
#Each command must be separated by ":"
#"F x y" : Create first point at X & Y
#To Make Segment
#"R angle" : Set the direction by angle
#"D dx dy" : Set the direction by DX & DY
#"TT x y" : Create by point at X & Y
#"T dx dy" : Create by point with DX & DY
#"L length" : Create by direction & Length
#"IX x" : Create by direction & Intersect. X
#"IY y" : Create by direction & Intersect. Y
#To Make Arc
#"C radius length" : Create by direction, radius and length(in degree)
#To finish
#"WW" : Close Wire
#Create Sketcher
Cmd = "Sketch:F 0 0:TT 0 100:C 100 180:WW"
Sketcher = geompy.MakeSketcher(Cmd) #(string)->GEOM_Shape_ptr
#Add In Study
id_Sketcher = geompy.addToStudy(Sketcher, "Sketcher")

View File

@ -45,13 +45,15 @@ EXPORT_PYSCRIPTS = libGEOM_Swig.py geompy.py batchmode_geompy.py \
GEOM_example2.py \ GEOM_example2.py \
GEOM_example3.py \ GEOM_example3.py \
GEOM_example4.py \ GEOM_example4.py \
GEOM_Kinematic.py \
GEOM_moteur.py \ GEOM_moteur.py \
GEOM_usinggeom.py \ GEOM_usinggeom.py \
GEOM_Partition1.py \ GEOM_Partition1.py \
GEOM_Partition2.py \ GEOM_Partition2.py \
GEOM_Partition3.py \ GEOM_Partition3.py \
GEOM_Partition4.py \ GEOM_Partition4.py \
GEOM_Partition5.py GEOM_Partition5.py \
GEOM_Sketcher.py
LIB_CLIENT_IDL = SALOMEDS.idl \ LIB_CLIENT_IDL = SALOMEDS.idl \
SALOMEDS_Attributes.idl \ SALOMEDS_Attributes.idl \

View File

@ -164,6 +164,12 @@ def MakePlane(p1,d1,trimsize):
anObj._set_Name(ior) anObj._set_Name(ior)
return anObj return anObj
def MakeSketcher(Cmd):
anObj = geom.MakeSketcher(Cmd)
ior = orb.object_to_string(anObj)
anObj._set_Name(ior)
return anObj
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Create Geometry 3D # Create Geometry 3D
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@ -487,11 +493,14 @@ def AddAnimation(Ass,Frame,Duration,NbSeq):
def SetPosition(aContact): def SetPosition(aContact):
geom.SetPosition(aContact) geom.SetPosition(aContact)
def SetRotation(aContact): def SetAngularRange(aContact):
geom.SetRotation(aContact) geom.SetAngularRange(aContact)
def SetTranslation(aContact): def SetLinearRange(aContact):
geom.SetTranslation(aContact) geom.SetLinearRange(aContact)
def SetDisplacement(anAnim,aContact):
geom.SetDisplacement(anAnim,aContact)
def addAssemblyToStudy(anAss, aName): def addAssemblyToStudy(anAss, aName):
myBuilder.NewCommand() myBuilder.NewCommand()

View File

@ -190,6 +190,12 @@ def MakePlane(p1,d1,trimsize):
anObj._set_Name(ior) anObj._set_Name(ior)
return anObj 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 # Create Geometry 3D
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@ -513,11 +519,14 @@ def AddAnimation(Ass,Frame,Duration,NbSeq):
def SetPosition(aContact): def SetPosition(aContact):
geom.SetPosition(aContact) geom.SetPosition(aContact)
def SetRotation(aContact): def SetAngularRange(aContact):
geom.SetRotation(aContact) geom.SetAngularRange(aContact)
def SetTranslation(aContact): def SetLinearRange(aContact):
geom.SetTranslation(aContact) geom.SetLinearRange(aContact)
def SetDisplacement(anAnim,aContact):
geom.SetDisplacement(anAnim,aContact)
def addAssemblyToStudy(anAss, aName): def addAssemblyToStudy(anAss, aName):
myBuilder.NewCommand() myBuilder.NewCommand()

View File

@ -26,9 +26,9 @@
// Module : GEOM // Module : GEOM
// $Header$ // $Header$
using namespace std;
#include "GenerationGUI_FillingDlg.h" #include "GenerationGUI_FillingDlg.h"
#include "QAD_WaitCursor.h"
#include "QAD_Config.h" #include "QAD_Config.h"
#include <GeomFill_SectionGenerator.hxx> #include <GeomFill_SectionGenerator.hxx>
@ -38,8 +38,14 @@ using namespace std;
#include <Geom_TrimmedCurve.hxx> #include <Geom_TrimmedCurve.hxx>
#include <BRepBuilderAPI_MakeFace.hxx> #include <BRepBuilderAPI_MakeFace.hxx>
#include <TopExp_Explorer.hxx> #include <TopExp_Explorer.hxx>
#include <TopoDS_Iterator.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <Precision.hxx> #include <Precision.hxx>
#include <Standard_ErrorHandler.hxx>
#include "utilities.h"
using namespace std;
//================================================================================= //=================================================================================
// class : GenerationGUI_FillingDlg() // class : GenerationGUI_FillingDlg()
@ -210,10 +216,14 @@ void GenerationGUI_FillingDlg::SelectionIntoArgument()
return; return;
if(myEditCurrentArgument == GroupPoints->LineEdit1 && mySectionShape.ShapeType() == TopAbs_COMPOUND) { if(myEditCurrentArgument == GroupPoints->LineEdit1 && mySectionShape.ShapeType() == TopAbs_COMPOUND) {
myEditCurrentArgument->setText(aString);
myGeomShape = myGeomBase->ConvertIOinGEOMShape(IO, testResult); myGeomShape = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult) if(!testResult)
return; 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; myOkSectionShape = true;
} }
@ -319,6 +329,8 @@ void GenerationGUI_FillingDlg::ValueChangedInSpinBox(double newValue)
//================================================================================= //=================================================================================
void GenerationGUI_FillingDlg::MakeFillingSimulationAndDisplay() void GenerationGUI_FillingDlg::MakeFillingSimulationAndDisplay()
{ {
QAD_WaitCursor wc;
myGeomBase->EraseSimulationShape(); myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify(); mySimulationTopoDs.Nullify();
@ -336,6 +348,7 @@ void GenerationGUI_FillingDlg::MakeFillingSimulationAndDisplay()
if( Scurrent.IsNull() || Scurrent.ShapeType() != TopAbs_EDGE) if( Scurrent.IsNull() || Scurrent.ShapeType() != TopAbs_EDGE)
return; return;
C = BRep_Tool::Curve(TopoDS::Edge(Scurrent), First, Last); C = BRep_Tool::Curve(TopoDS::Edge(Scurrent), First, Last);
if (C.IsNull()) continue;
C = new Geom_TrimmedCurve(C, First, Last); C = new Geom_TrimmedCurve(C, First, Last);
Section.AddCurve(C) ; Section.AddCurve(C) ;
i++ ; i++ ;

View File

@ -26,7 +26,6 @@
// Module : GEOM // Module : GEOM
// $Header$ // $Header$
using namespace std;
#include "GenerationGUI_PipeDlg.h" #include "GenerationGUI_PipeDlg.h"
#include <TopoDS_Edge.hxx> #include <TopoDS_Edge.hxx>
@ -38,6 +37,10 @@ using namespace std;
#include <BRepAlgoAPI.hxx> #include <BRepAlgoAPI.hxx>
#endif #endif
#include "utilities.h"
using namespace std;
//================================================================================= //=================================================================================
// class : GenerationGUI_PipeDlg() // class : GenerationGUI_PipeDlg()
// purpose : Constructs a GenerationGUI_PipeDlg which is a child of 'parent', with the // purpose : Constructs a GenerationGUI_PipeDlg which is a child of 'parent', with the

View File

@ -26,12 +26,15 @@
// Module : GEOM // Module : GEOM
// $Header$ // $Header$
using namespace std;
#include "GenerationGUI_PrismDlg.h" #include "GenerationGUI_PrismDlg.h"
#include <BRepPrimAPI_MakePrism.hxx> #include <BRepPrimAPI_MakePrism.hxx>
#include "QAD_Config.h" #include "QAD_Config.h"
#include "utilities.h"
using namespace std;
//================================================================================= //=================================================================================
// class : GenerationGUI_PrismDlg() // class : GenerationGUI_PrismDlg()
// purpose : Constructs a GenerationGUI_PrismDlg which is a child of 'parent', with the // purpose : Constructs a GenerationGUI_PrismDlg which is a child of 'parent', with the

View File

@ -26,13 +26,18 @@
// Module : GEOM // Module : GEOM
// $Header$ // $Header$
using namespace std;
#include "GenerationGUI_RevolDlg.h" #include "GenerationGUI_RevolDlg.h"
#include <gp_Lin.hxx> #include <gp_Lin.hxx>
#include <BRepAdaptor_Curve.hxx> #include <BRepAdaptor_Curve.hxx>
#include <BRepPrimAPI_MakeRevol.hxx> #include <BRepPrimAPI_MakeRevol.hxx>
#include "QAD_Config.h" #include "QAD_Config.h"
#include <TopExp_Explorer.hxx>
#include <Standard_ErrorHandler.hxx>
#include "utilities.h"
using namespace std;
//================================================================================= //=================================================================================
// class : GenerationGUI_RevolDlg() // class : GenerationGUI_RevolDlg()
@ -157,6 +162,32 @@ void GenerationGUI_RevolDlg::ClickOnApply()
return; 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() // function : SelectionIntoArgument()
@ -189,8 +220,7 @@ void GenerationGUI_RevolDlg::SelectionIntoArgument()
myGeomShape = myGeomBase->ConvertIOinGEOMShape(IO, testResult); myGeomShape = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult) if(!testResult)
return; return;
TopAbs_ShapeEnum aType = S.ShapeType(); if( !isAcceptableBase( S ))
if(aType != TopAbs_VERTEX && aType != TopAbs_EDGE && aType != TopAbs_WIRE && aType != TopAbs_FACE && aType != TopAbs_SHELL && aType != TopAbs_COMPOUND)
return; return;
myEditCurrentArgument->setText(aString); myEditCurrentArgument->setText(aString);
myOkBase = true; myOkBase = true;
@ -318,8 +348,7 @@ void GenerationGUI_RevolDlg::MakeRevolutionSimulationAndDisplay()
myGeomBase->EraseSimulationShape(); myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify(); mySimulationTopoDs.Nullify();
TopAbs_ShapeEnum aType = myBase.ShapeType(); if (!isAcceptableBase( myBase ))
if(aType != TopAbs_VERTEX && aType != TopAbs_EDGE && aType != TopAbs_WIRE && aType != TopAbs_FACE && aType != TopAbs_SHELL && aType !=TopAbs_COMPOUND)
return; return;
try { try {

View File

@ -26,13 +26,14 @@
// Module : GEOM // Module : GEOM
// $Header: // $Header:
using namespace std;
#include "Kinematic_Animation.hxx" #include "Kinematic_Animation.hxx"
#include <Geom_Transformation.hxx> #include <Geom_Transformation.hxx>
#include <AIS_Shape.hxx> #include <AIS_Shape.hxx>
#include <unistd.h> #include <unistd.h>
using namespace std;
//======================================================================= //=======================================================================
// profile // profile
// command to build a profile // command to build a profile
@ -53,14 +54,16 @@ Kinematic_Animation::Kinematic_Animation()
Kinematic_Animation::Kinematic_Animation(Kinematic_Assembly* Ass, TopoDS_Shape frame, Kinematic_Animation::Kinematic_Animation(Kinematic_Assembly* Ass, TopoDS_Shape frame,
double duration, int nbseq) double duration, int nbseq)
{ {
myAss = Ass;
myFrame = frame;
myDuration = duration;
myNbSeq = nbseq;
myIsShading = false; myIsShading = false;
IsCreated = false; IsCreated = false;
myNbAIS = 0; myNbAIS = 0;
SetAssembly(Ass);
SetFrame(frame);
SetDuration(duration);
SetNbSeq(nbseq);
this->SetMap(); this->SetMap();
this->InitValues();
return; return;
} }
@ -74,42 +77,141 @@ Kinematic_Animation::~Kinematic_Animation() {}
//================================================================================= //=================================================================================
// function : SetMap() // function : SetMap()
// purpose : // purpose : Create Kinematic Graph
//================================================================================= //=================================================================================
void Kinematic_Animation::SetMap() void Kinematic_Animation::SetMap()
{ {
list <Kinematic_Contact *> ContactList = myAss->GetContactList(); list <Kinematic_Contact *> aContactList = myAss->GetContactList();
Kinematic_Contact* aContact; Kinematic_Contact* aContact;
list <Kinematic_Contact *>::const_iterator it = ContactList.begin(); list <Kinematic_Contact *>::const_iterator it = aContactList.begin();
while(it != ContactList.end()) { while(it != aContactList.end()) {
aContact = *it; aContact = *it;
if(!myIndexToShape.Contains(aContact->Shape1())) if(!myIndexToShape.Contains(aContact->GetShape1()))
myIndexToShape.Add(aContact->Shape1()); myIndexToShape.Add(aContact->GetShape1());
if(!myIndexToShape.Contains(aContact->Shape2())) if(!myIndexToShape.Contains(aContact->GetShape2()))
myIndexToShape.Add(aContact->Shape2()); myIndexToShape.Add(aContact->GetShape2());
it++; it++;
} }
for(int i = 1; i <= myIndexToShape.Extent(); i++) { for(int i = 1; i <= myIndexToShape.Extent(); i++) {
it = ContactList.begin(); it = aContactList.begin();
list <Kinematic_Contact *> ContactListOfShape; list <Kinematic_Contact *> aContactListOfShape;
TopoDS_Shape myShape = myIndexToShape.FindKey(i); TopoDS_Shape aShape = myIndexToShape.FindKey(i);
while(it != ContactList.end()) { while(it != aContactList.end()) {
aContact = *it; aContact = *it;
if(myShape == aContact->Shape1() || myShape == aContact->Shape2()) if(aShape == aContact->GetShape1() || aShape == aContact->GetShape2())
ContactListOfShape.push_back(aContact); aContactListOfShape.push_back(aContact);
it++; it++;
} }
myStlMapofShapeListOfContact[i] = ContactListOfShape; myStlMapofShapeListOfContact[i] = aContactListOfShape;
} }
return; 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;
}
//================================================================================= //=================================================================================
// function : GetNextShape() // function : GetNextShape()
// purpose : // purpose :
@ -118,36 +220,36 @@ void Kinematic_Animation::GetNextShape(const Handle(AIS_InteractiveContext)& ic,
gp_Trsf& aLoc, TopoDS_Shape Shape1, double Step) gp_Trsf& aLoc, TopoDS_Shape Shape1, double Step)
{ {
int j = 0; int j = 0;
list <Kinematic_Contact *> ContactListOfShape; list <Kinematic_Contact *> aContactListOfShape;
Kinematic_Contact* aContact; Kinematic_Contact* aContact;
TopoDS_Shape myShape, myShape2, aNewShape; TopoDS_Shape aShape, aShape2, aNewShape;
for(int i = 1; i <= myIndexToShape.Extent(); i++) { for(int i = 1; i <= myIndexToShape.Extent(); i++) {
myShape = myIndexToShape.FindKey(i); aShape = myIndexToShape.FindKey(i);
if(myShape == Shape1) { if(aShape == Shape1) {
gp_Trsf aNewLoc = aLoc; gp_Trsf aNewLoc = aLoc;
ContactListOfShape = myStlMapofShapeListOfContact[i]; aContactListOfShape = myStlMapofShapeListOfContact[i];
list <Kinematic_Contact *>::const_iterator it = ContactListOfShape.begin(); list <Kinematic_Contact *>::const_iterator it = aContactListOfShape.begin();
while(it != ContactListOfShape.end()) { while(it != aContactListOfShape.end()) {
aContact = *it; aContact = *it;
if(aContact->Shape1() == Shape1) if(aContact->GetShape1() == Shape1)
myShape2 = aContact->Shape2(); aShape2 = aContact->GetShape2();
else if(aContact->Shape2() == Shape1) else if(aContact->GetShape2() == Shape1)
myShape2 = aContact->Shape1(); aShape2 = aContact->GetShape1();
if(!myMovedShape.Contains(myShape2)) { if(!myMovedShape.Contains(aShape2)) {
myMovedShape.Add(myShape2); myMovedShape.Add(aShape2);
if(!IsCreated) { if(!IsCreated) {
Handle(AIS_Shape) mySimulationShape; Handle(AIS_Shape) mySimulationShape;
mySimulationShape = new AIS_Shape(TopoDS_Shape()); mySimulationShape = new AIS_Shape(TopoDS_Shape());
mySimulationShape->Set(myShape2); mySimulationShape->Set(aShape2);
ListOfAIS.Append(mySimulationShape); myListOfAIS.Append(mySimulationShape);
} }
else else
MoveShape(ic, aLoc, aContact, Step); MoveShape(ic, aLoc, aContact, Step);
GetNextShape(ic, aLoc, myShape2, Step); GetNextShape(ic, aLoc, aShape2, Step);
} }
aLoc = aNewLoc; aLoc = aNewLoc;
it++; it++;
@ -160,18 +262,18 @@ void Kinematic_Animation::GetNextShape(const Handle(AIS_InteractiveContext)& ic,
//================================================================================= //=================================================================================
// function : CreateShape() // function : MoveShape()
// purpose : // purpose :
//================================================================================= //=================================================================================
void Kinematic_Animation::MoveShape(const Handle(AIS_InteractiveContext)& ic, void Kinematic_Animation::MoveShape(const Handle(AIS_InteractiveContext)& ic,
gp_Trsf& aLoc, Kinematic_Contact* aContact, gp_Trsf& aLoc, Kinematic_Contact* aContact,
double Step) double Step)
{ {
gp_Trsf aTrans = aContact->GetTransformation(Step); gp_Trsf aTrans = GetTransformation(aContact, Step);
aLoc = aLoc * aTrans; aLoc = aLoc * aTrans;
myNbAIS++; 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(); Handle(Geom_Transformation) aGTrans = new Geom_Transformation();
aGTrans->SetTrsf(aLoc); aGTrans->SetTrsf(aLoc);
mySimulationShape->SetTransformation(aGTrans, false, false); mySimulationShape->SetTransformation(aGTrans, false, false);
@ -187,3 +289,39 @@ void Kinematic_Animation::MoveShape(const Handle(AIS_InteractiveContext)& ic,
ic->Display(mySimulationShape, Standard_False); ic->Display(mySimulationShape, Standard_False);
return; 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;
}

View File

@ -36,6 +36,7 @@
#include <TopTools_IndexedMapOfShape.hxx> #include <TopTools_IndexedMapOfShape.hxx>
#include <AIS_InteractiveContext.hxx> #include <AIS_InteractiveContext.hxx>
#include <AIS_SequenceOfInteractive.hxx> #include <AIS_SequenceOfInteractive.hxx>
#include <gp_Trsf.hxx>
#include <list> #include <list>
#include <map> #include <map>
@ -50,13 +51,14 @@ public:
private: private:
map <int, list <Kinematic_Contact *> > myStlMapofShapeListOfContact; map <int, list <Kinematic_Contact *> > myStlMapofShapeListOfContact;
map <Kinematic_Contact *, list <double> > myStlMapofContactListOfValue;
Kinematic_Assembly* myAss; Kinematic_Assembly* myAss;
TopoDS_Shape myFrame; TopoDS_Shape myFrame;
double myDuration; double myDuration;
int myNbSeq; int myNbSeq;
public: public:
AIS_SequenceOfInteractive ListOfAIS; AIS_SequenceOfInteractive myListOfAIS;
TopTools_IndexedMapOfShape myIndexToShape; TopTools_IndexedMapOfShape myIndexToShape;
TopTools_IndexedMapOfShape myMovedShape; TopTools_IndexedMapOfShape myMovedShape;
bool IsCreated; bool IsCreated;
@ -64,21 +66,26 @@ public:
bool myIsShading; bool myIsShading;
void SetMap(); void SetMap();
void InitValues();
void InitValuesOnContact(Kinematic_Contact* aContact);
void GetNextShape(const Handle (AIS_InteractiveContext)& ic, void GetNextShape(const Handle (AIS_InteractiveContext)& ic,
gp_Trsf& aLoc, TopoDS_Shape Shape1, double Step); gp_Trsf& aLoc, TopoDS_Shape Shape1, double Step);
void MoveShape(const Handle(AIS_InteractiveContext)& ic, void MoveShape(const Handle(AIS_InteractiveContext)& ic,
gp_Trsf& aLoc, Kinematic_Contact* aContact, gp_Trsf& aLoc, Kinematic_Contact* aContact,
double Step); double Step);
void Assembly(Kinematic_Assembly* Assembly){myAss = Assembly;}; void SetAssembly(Kinematic_Assembly* Assembly){myAss = Assembly;};
void Frame(TopoDS_Shape Frame){myFrame = Frame;}; void SetFrame(TopoDS_Shape Frame){myFrame = Frame;};
void Duration(double Duration){myDuration = Duration;}; void SetDuration(double Duration){myDuration = Duration;};
void NbSeq(int NbSeq){myNbSeq = NbSeq;}; void SetNbSeq(int NbSeq){myNbSeq = NbSeq;};
void SetDisplacement(int aContact, list <double> aList);
Kinematic_Assembly* Assembly(){return myAss;}; Kinematic_Assembly* GetAssembly(){return myAss;};
TopoDS_Shape& Frame(){return myFrame;}; TopoDS_Shape& GetFrame(){return myFrame;};
double& Duration(){return myDuration;}; double& GetDuration(){return myDuration;};
int& NbSeq(){return myNbSeq;}; int& GetNbSeq(){return myNbSeq;};
list <double> GetDisplacement(int aContact);
gp_Trsf GetTransformation(Kinematic_Contact* aContact, double Step = 1);
}; };

View File

@ -26,27 +26,22 @@
// Module : GEOM // Module : GEOM
// $Header: // $Header:
using namespace std;
#include "Kinematic_Assembly.hxx" #include "Kinematic_Assembly.hxx"
using namespace std;
//======================================================================= //=======================================================================
// profile // profile
// command to build a profile // command to build a profile
//======================================================================= //=======================================================================
Kinematic_Assembly::Kinematic_Assembly() Kinematic_Assembly::Kinematic_Assembly() {}
{
}
//================================================================================= //=================================================================================
// function : ~Kinematic_Assembly() // function : ~Kinematic_Assembly()
// purpose : Destroys the object and frees any allocated resources // purpose : Destroys the object and frees any allocated resources
//================================================================================= //=================================================================================
Kinematic_Assembly::~Kinematic_Assembly() Kinematic_Assembly::~Kinematic_Assembly() {}
{
}
//================================================================================= //=================================================================================

View File

@ -26,14 +26,15 @@
// Module : GEOM // Module : GEOM
// $Header: // $Header:
using namespace std;
#include "Kinematic_Contact.hxx" #include "Kinematic_Contact.hxx"
using namespace std;
//======================================================================= //=======================================================================
// profile // profile
// command to build a profile // command to build a profile
//======================================================================= //=======================================================================
Kinematic_Contact::Kinematic_Contact(){} Kinematic_Contact::Kinematic_Contact() {}
//======================================================================= //=======================================================================
@ -43,23 +44,25 @@ Kinematic_Contact::Kinematic_Contact(){}
Kinematic_Contact::Kinematic_Contact(TopoDS_Shape Shape1, TopoDS_Shape Shape2, Kinematic_Contact::Kinematic_Contact(TopoDS_Shape Shape1, TopoDS_Shape Shape2,
int type, double step) int type, double step)
{ {
myType = type; SetType(type);
myShape1 = Shape1; SetStep(step);
myShape2 = Shape2; SetShape1(Shape1);
myStep = step; SetShape2(Shape2);
gp_Pnt Origin(0, 0, 0); gp_Pnt Origin(0, 0, 0);
gp_Dir DirX(1, 0, 0); gp_Vec DirX(1, 0, 0);
gp_Dir DirY(0, 1, 0); gp_Vec DirY(0, 1, 0);
gp_Dir DirZ(0, 0, 1); gp_Vec DirZ(0, 0, 1);
Kinematic_Position Pos(Origin, DirX, DirY, DirZ); Kinematic_Position Pos(Origin, DirX, DirY, DirZ);
Kinematic_Rotation Rot(1, 2, 3, 0, 0, 0); Kinematic_Range AngularRange(0, 0, 0, 0, 0, 0);
Kinematic_Translation Trans(0, 0, 0); Kinematic_Range LinearRange(0, 0, 0, 0, 0, 0);
myPosition = Pos; SetPosition(Pos);
myRotation = Rot; SetAngularRange(AngularRange);
myTranslation = Trans; SetLinearRange(LinearRange);
return;
} }
@ -70,6 +73,21 @@ Kinematic_Contact::Kinematic_Contact(TopoDS_Shape Shape1, TopoDS_Shape Shape2,
Kinematic_Contact::~Kinematic_Contact() {} Kinematic_Contact::~Kinematic_Contact() {}
//=================================================================================
// function : GetLocation()
// purpose :
//=================================================================================
TopLoc_Location Kinematic_Contact::GetLocation()
{
gp_Trsf aTrans;
aTrans.SetTransformation(myPosition.GetAxe3());
TopLoc_Location aLoc(aTrans);
return aLoc;
}
//================================================================================= //=================================================================================
// function : GetTransformation() // function : GetTransformation()
// purpose : // purpose :
@ -79,55 +97,25 @@ gp_Trsf Kinematic_Contact::GetTransformation(double Step)
gp_Vec aVect; gp_Vec aVect;
gp_Trsf aTransformation, aRot, aRot1, aRot2, aRot3; gp_Trsf aTransformation, aRot, aRot1, aRot2, aRot3;
aVect.SetCoord(Step * myTranslation.ValX(), Step * myTranslation.ValY(), Step * myTranslation.ValZ()); double aMinVal = myAngularRange.GetMinValX();
double aMaxVal = myAngularRange.GetMaxValX();
aRot1.SetRotation(myPosition.GetAxeX(), (Step * (aMaxVal - aMinVal) + aMinVal) * PI / 180);
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); 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);
}
}
aRot = aRot1 * aRot2 * aRot3; aRot = aRot1 * aRot2 * aRot3;
aTransformation = aTransformation * aRot; aTransformation = aTransformation * aRot;
return aTransformation; return aTransformation;
} }
//=================================================================================
// function : GetLocation()
// purpose :
//=================================================================================
TopLoc_Location Kinematic_Contact::GetLocation()
{
gp_Trsf aTrans;
aTrans.SetTransformation(myPosition.Axe3());
TopLoc_Location aLoc(aTrans);
return aLoc;
}

View File

@ -31,12 +31,11 @@
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <TDF_Label.hxx> #include <TDF_Label.hxx>
#include <gp_Trsf.hxx>
#include <TopLoc_Location.hxx> #include <TopLoc_Location.hxx>
#include <gp_Trsf.hxx>
#include "Kinematic_Position.hxx" #include "Kinematic_Position.hxx"
#include "Kinematic_Rotation.hxx" #include "Kinematic_Range.hxx"
#include "Kinematic_Translation.hxx"
class Kinematic_Contact class Kinematic_Contact
{ {
@ -47,33 +46,33 @@ public:
~Kinematic_Contact(); ~Kinematic_Contact();
private: private:
int myType;
TopoDS_Shape myShape1; TopoDS_Shape myShape1;
TopoDS_Shape myShape2; TopoDS_Shape myShape2;
int myType;
double myStep; double myStep;
Kinematic_Position myPosition; Kinematic_Position myPosition;
Kinematic_Rotation myRotation; Kinematic_Range myAngularRange;
Kinematic_Translation myTranslation; Kinematic_Range myLinearRange;
public: public:
gp_Trsf GetTransformation(double Step = 1);
TopLoc_Location GetLocation(); TopLoc_Location GetLocation();
gp_Trsf GetTransformation(double Step);
void Type(int Type){myType = Type;}; void SetType(int aValue){myType = aValue;};
void Shape1(TopoDS_Shape Shape1){myShape1 = Shape1;}; void SetShape1(TopoDS_Shape aShape){myShape1 = aShape;};
void Shape2(TopoDS_Shape Shape2){myShape2 = Shape2;}; void SetShape2(TopoDS_Shape aShape){myShape2 = aShape;};
void Step(double Step){myStep = Step;}; void SetStep(double aValue){myStep = aValue;};
void Position(Kinematic_Position& Position){myPosition = Position;}; void SetPosition(Kinematic_Position& aPosition){myPosition = aPosition;};
void Rotation(Kinematic_Rotation& Rotation){myRotation = Rotation;}; void SetAngularRange(Kinematic_Range& anAngularRange){myAngularRange = anAngularRange;};
void Translation(Kinematic_Translation& Translation){myTranslation = Translation;}; void SetLinearRange(Kinematic_Range& aLinearRange){myLinearRange = aLinearRange;};
int& Type(){return myType;}; int& GetType(){return myType;};
TopoDS_Shape& Shape1(){return myShape1;}; TopoDS_Shape& GetShape1(){return myShape1;};
TopoDS_Shape& Shape2(){return myShape2;}; TopoDS_Shape& GetShape2(){return myShape2;};
double& Step(){return myStep;}; double& GetStep(){return myStep;};
Kinematic_Position& Position(){return myPosition;}; Kinematic_Position& GetPosition(){return myPosition;};
Kinematic_Rotation& Rotation(){return myRotation;}; Kinematic_Range& GetAngularRange(){return myAngularRange;};
Kinematic_Translation& Translation(){return myTranslation;}; Kinematic_Range& GetLinearRange(){return myLinearRange;};
}; };

View File

@ -26,27 +26,29 @@
// Module : GEOM // Module : GEOM
// $Header: // $Header:
using namespace std;
#include "Kinematic_Position.hxx" #include "Kinematic_Position.hxx"
using namespace std;
//======================================================================= //=======================================================================
// profile // profile
// command to build a profile // command to build a profile
//======================================================================= //=======================================================================
Kinematic_Position::Kinematic_Position(){} Kinematic_Position::Kinematic_Position() {}
//======================================================================= //=======================================================================
// profile // profile
// command to build a 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; SetOrigin(Origin);
myDirX = DirX; SetDirX(DirX);
myDirY = DirY; SetDirY(DirY);
myDirZ = DirZ; SetDirZ(DirZ);
return;
} }
@ -58,10 +60,54 @@ Kinematic_Position::~Kinematic_Position() {}
//================================================================================= //=================================================================================
// function : AxeX() // function : SetOrigin()
// purpose : // purpose :
//================================================================================= //=================================================================================
gp_Ax1 Kinematic_Position::AxeX() 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::GetAxeX()
{ {
gp_Ax1 anAxe; gp_Ax1 anAxe;
anAxe.SetLocation(myOrigin); anAxe.SetLocation(myOrigin);
@ -71,10 +117,10 @@ gp_Ax1 Kinematic_Position::AxeX()
//================================================================================= //=================================================================================
// function : AxeY() // function : GetAxeY()
// purpose : // purpose :
//================================================================================= //=================================================================================
gp_Ax1 Kinematic_Position::AxeY() gp_Ax1 Kinematic_Position::GetAxeY()
{ {
gp_Ax1 anAxe; gp_Ax1 anAxe;
anAxe.SetLocation(myOrigin); anAxe.SetLocation(myOrigin);
@ -84,10 +130,10 @@ gp_Ax1 Kinematic_Position::AxeY()
//================================================================================= //=================================================================================
// function : AxeZ() // function : GetAxeZ()
// purpose : // purpose :
//================================================================================= //=================================================================================
gp_Ax1 Kinematic_Position::AxeZ() gp_Ax1 Kinematic_Position::GetAxeZ()
{ {
gp_Ax1 anAxe; gp_Ax1 anAxe;
anAxe.SetLocation(myOrigin); anAxe.SetLocation(myOrigin);
@ -97,10 +143,10 @@ gp_Ax1 Kinematic_Position::AxeZ()
//================================================================================= //=================================================================================
// function : Axe3() // function : GetAxe3()
// purpose : // purpose :
//================================================================================= //=================================================================================
gp_Ax3 Kinematic_Position::Axe3() gp_Ax3 Kinematic_Position::GetAxe3()
{ {
gp_Ax3 anAxe3(myOrigin, myDirZ, myDirX); gp_Ax3 anAxe3(myOrigin, myDirZ, myDirX);
return anAxe3; return anAxe3;

View File

@ -30,7 +30,7 @@
#define _KINEMATIC_POSITION_HXX #define _KINEMATIC_POSITION_HXX
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <gp_Dir.hxx> #include <gp_Vec.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <gp_Ax1.hxx> #include <gp_Ax1.hxx>
#include <gp_Ax3.hxx> #include <gp_Ax3.hxx>
@ -39,31 +39,31 @@ class Kinematic_Position
{ {
public: public:
Kinematic_Position(); 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(); ~Kinematic_Position();
private: private:
gp_Pnt myOrigin; gp_Pnt myOrigin;
gp_Dir myDirX; gp_Vec myDirX;
gp_Dir myDirY; gp_Vec myDirY;
gp_Dir myDirZ; gp_Vec myDirZ;
public: public:
void Origin(const gp_Pnt& Origin){myOrigin = Origin;}; void SetOrigin(const gp_Pnt& aPnt);
void DirX(const gp_Dir& DirX){myDirX = DirX;}; void SetDirX(const gp_Vec& aDir);
void DirY(const gp_Dir& DirY){myDirY = DirY;}; void SetDirY(const gp_Vec& aDir);
void DirZ(const gp_Dir& DirZ){myDirZ = DirZ;}; void SetDirZ(const gp_Vec& aDir);
gp_Pnt& Origin(){return myOrigin;}; gp_Pnt& GetOrigin(){return myOrigin;};
gp_Dir& DirX(){return myDirX;}; gp_Vec& GetDirX(){return myDirX;};
gp_Dir& DirY(){return myDirY;}; gp_Vec& GetDirY(){return myDirY;};
gp_Dir& DirZ(){return myDirZ;}; gp_Vec& GetDirZ(){return myDirZ;};
gp_Ax1 AxeX(); gp_Ax1 GetAxeX();
gp_Ax1 AxeY(); gp_Ax1 GetAxeY();
gp_Ax1 AxeZ(); gp_Ax1 GetAxeZ();
gp_Ax3 Axe3(); gp_Ax3 GetAxe3();
}; };

View File

@ -1,4 +1,4 @@
// GEOM GEOM : // GEOM KINEMATIC
// //
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@ -21,81 +21,75 @@
// //
// //
// //
// File : GEOM_Translation_i.cc // File : Kinematic_Range.cxx
// Author : Damien COQUERET // Author : Damien COQUERET
// Module : GEOM // Module : GEOM
// $Header$ // $Header:
#include "Kinematic_Range.hxx"
using namespace std; using namespace std;
#include "GEOM_Translation_i.hh"
//================================================================================= //=======================================================================
// function : GEOM_Translation_i() constructor (no arguments) // profile
// purpose : for what now ? // command to build a profile
//================================================================================= //=======================================================================
GEOM_Translation_i::GEOM_Translation_i() 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);
//=================================================================================
// 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; return;
} }
//================================================================================= //=================================================================================
// function : destructor // function : ~Kinematic_Range()
// purpose : // purpose : Destroys the object and frees any allocated resources
//================================================================================= //=================================================================================
GEOM_Translation_i::~GEOM_Translation_i() {} Kinematic_Range::~Kinematic_Range() {}
//================================================================================= //=================================================================================
// function : SetTranslation() // function : SetRangeX()
// purpose : // purpose :
//================================================================================= //=================================================================================
void GEOM_Translation_i::SetTranslation(CORBA::Double ValX, CORBA::Double ValY, CORBA::Double ValZ) void Kinematic_Range::SetRangeX(double MinVal, double MaxVal)
throw(SALOME::SALOME_Exception)
{ {
myMinValX = MinVal;
_ValX = ValX; myMaxValX = MaxVal;
_ValY = ValY;
_ValZ = ValZ;
return; return;
} }
//================================================================================= //=================================================================================
// function : GetValX() // function : SetRangeY()
// purpose : // purpose :
//================================================================================= //=================================================================================
CORBA::Double GEOM_Translation_i::GetValX() throw(SALOME::SALOME_Exception) void Kinematic_Range::SetRangeY(double MinVal, double MaxVal)
{ {
return _ValX; myMinValY = MinVal;
myMaxValY = MaxVal;
return;
} }
//=================================================================================
// function : GetValY()
// purpose :
//=================================================================================
CORBA::Double GEOM_Translation_i::GetValY() throw(SALOME::SALOME_Exception)
{
return _ValY;
}
//================================================================================= //=================================================================================
// function : GetValZ() // function : SetRangeZ()
// purpose : // purpose :
//================================================================================= //=================================================================================
CORBA::Double GEOM_Translation_i::GetValZ() throw(SALOME::SALOME_Exception) void Kinematic_Range::SetRangeZ(double MinVal, double MaxVal)
{ {
return _ValZ; myMinValZ = MinVal;
myMaxValZ = MaxVal;
return;
} }

View File

@ -21,44 +21,39 @@
// //
// //
// //
// File : Kinematic_Rotation.hxx // File : Kinematic_Range.hxx
// Author : Damien COQUERET // Author : Damien COQUERET
// Module : GEOM // Module : GEOM
// $Header: // $Header:
#ifndef _KINEMATIC_ROTATION_HXX #ifndef _KINEMATIC_RANGE_HXX
#define _KINEMATIC_ROTATION_HXX #define _KINEMATIC_RANGE_HXX
class Kinematic_Rotation class Kinematic_Range
{ {
public: public:
Kinematic_Rotation(); Kinematic_Range();
Kinematic_Rotation(int Rot1, int Rot2, int Rot3, double ValX, double ValY, double ValZ); Kinematic_Range(double MinValX, double MaxValX, double MinValY,
~Kinematic_Rotation(); double MaxValY, double MinValZ, double MaxValZ);
~Kinematic_Range();
private: private:
int myRot1; double myMinValX, myMaxValX;
int myRot2; double myMinValY, myMaxValY;
int myRot3; double myMinValZ, myMaxValZ;
double myValX;
double myValY;
double myValZ;
public: 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;}; void SetRangeX(double MinVal, double MaxVal);
int& Rot2(){return myRot2;}; void SetRangeY(double MinVal, double MaxVal);
int& Rot3(){return myRot3;}; void SetRangeZ(double MinVal, double MaxVal);
double& ValX(){return myValX;};
double& ValY(){return myValY;}; double& GetMinValX(){return myMinValX;};
double& ValZ(){return myValZ;}; double& GetMaxValX(){return myMaxValX;};
double& GetMinValY(){return myMinValY;};
double& GetMaxValY(){return myMaxValY;};
double& GetMinValZ(){return myMinValZ;};
double& GetMaxValZ(){return myMaxValZ;};
}; };

View File

@ -1,60 +0,0 @@
// 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() {}

View File

@ -1,56 +0,0 @@
// 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() {}

View File

@ -37,8 +37,7 @@ VPATH=.:@srcdir@:@top_srcdir@/idl
# Libraries targets # Libraries targets
LIB = libGEOMKinematic.la LIB = libGEOMKinematic.la
LIB_SRC = Kinematic_Position.cxx \ LIB_SRC = Kinematic_Position.cxx \
Kinematic_Rotation.cxx \ Kinematic_Range.cxx \
Kinematic_Translation.cxx \
Kinematic_Contact.cxx \ Kinematic_Contact.cxx \
Kinematic_Assembly.cxx \ Kinematic_Assembly.cxx \
Kinematic_Animation.cxx Kinematic_Animation.cxx
@ -46,12 +45,11 @@ LIB_SRC = Kinematic_Position.cxx \
LIB_CLIENT_IDL = LIB_CLIENT_IDL =
# header files # header files
EXPORT_HEADERS = Kinematic_Position.hxx \ EXPORT_HEADERS = Kinematic_Position.hxx \
Kinematic_Rotation.hxx \ Kinematic_Range.hxx \
Kinematic_Translation.hxx \ Kinematic_Contact.hxx \
Kinematic_Contact.hxx \ Kinematic_Assembly.hxx \
Kinematic_Assembly.hxx \ Kinematic_Animation.hxx
Kinematic_Animation.hxx
# additionnal information to compil and link file # additionnal information to compil and link file
CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome

View File

@ -26,7 +26,6 @@
// Module : GEOM // Module : GEOM
// $Header: // $Header:
using namespace std;
#include "KinematicGUI.h" #include "KinematicGUI.h"
#include "QAD_RightFrame.h" #include "QAD_RightFrame.h"
@ -38,13 +37,14 @@ using namespace std;
#include <map> #include <map>
#include "KinematicGUI_ContactDlg.h" // Method CONTACT #include "KinematicGUI_ContactDlg.h" // Method CONTACT
#include "KinematicGUI_ContactHDlg.h" // Method CONTACT HELICOIDAL
#include "KinematicGUI_PositionDlg.h" // Method POSITION #include "KinematicGUI_PositionDlg.h" // Method POSITION
#include "KinematicGUI_RotationDlg.h" // Method ROTATION #include "KinematicGUI_RangeDlg.h" // Method RANGE
#include "KinematicGUI_TranslationDlg.h" // Method TRANSLATION #include "KinematicGUI_AnimationDlg.h" // Method ANIMATION
#include "KinematicGUI_AnimationDlg.h" // Method Create ANIMATION #include "KinematicGUI_AnimValuesDlg.h" // Method SET VALUES
#include "KinematicGUI_AnimDlg.h" // Method Play ANIMATION #include "KinematicGUI_AnimDlg.h" // Method Play ANIMATION
using namespace std;
//======================================================================= //=======================================================================
// function : KinematicGUI() // function : KinematicGUI()
// purpose : Constructor // purpose : Constructor
@ -84,83 +84,43 @@ bool KinematicGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
myKinematicGUI->AddNewAssembly(); myKinematicGUI->AddNewAssembly();
break; break;
} }
case 61201: // EMBEDDING case 6121: // CONTACT
{ {
KinematicGUI_ContactDlg *aDlg = new KinematicGUI_ContactDlg(parent, "", myKinematicGUI, Sel, 0); KinematicGUI_ContactDlg *aDlg = new KinematicGUI_ContactDlg(parent, "", myKinematicGUI, Sel);
break; break;
} }
case 61202: // PIVOT case 6122: // POSITION
{
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
{
KinematicGUI_ContactDlg *aDlg = new KinematicGUI_ContactDlg(parent, "", myKinematicGUI, Sel, 8);
break;
}
case 61210: // HELICOIDAL
{
KinematicGUI_ContactHDlg *aDlg = new KinematicGUI_ContactHDlg(parent, "", myKinematicGUI, Sel);
break;
}
case 6131: // ROTATION
{ {
KinematicGUI_PositionDlg *aDlg = new KinematicGUI_PositionDlg(parent, "", myKinematicGUI, Sel, true); KinematicGUI_PositionDlg *aDlg = new KinematicGUI_PositionDlg(parent, "", myKinematicGUI, Sel, true);
break; break;
} }
case 6132: // ROTATION case 6123: // ANGULAR RANGE
{ {
KinematicGUI_RotationDlg *aDlg = new KinematicGUI_RotationDlg(parent, "", myKinematicGUI, Sel, true); KinematicGUI_RangeDlg *aDlg = new KinematicGUI_RangeDlg(parent, "", myKinematicGUI, Sel, 0);
break; break;
} }
case 6133: // TRANSLATION case 6124: // LINEAR RANGE
{ {
KinematicGUI_TranslationDlg *aDlg = new KinematicGUI_TranslationDlg(parent, "", myKinematicGUI, Sel, true); KinematicGUI_RangeDlg *aDlg = new KinematicGUI_RangeDlg(parent, "", myKinematicGUI, Sel, 1);
break; break;
} }
case 614: // ANIMATION case 613: // ANIMATION
{ {
KinematicGUI_AnimationDlg *aDlg = new KinematicGUI_AnimationDlg(parent, "", myKinematicGUI, Sel); KinematicGUI_AnimationDlg *aDlg = new KinematicGUI_AnimationDlg(parent, "", myKinematicGUI, Sel);
break; break;
} }
case 6141: // RUN ANIMATION case 6131: // SET VALUES
{
KinematicGUI_AnimValuesDlg *aDlg = new KinematicGUI_AnimValuesDlg(parent, "", myKinematicGUI, Sel);
break;
}
case 6132: // RUN ANIMATION
{ {
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) { if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
Handle(AIS_InteractiveContext) ic; Handle(AIS_InteractiveContext) ic;
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
ic = v3d->getAISContext(); 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; break;
} }
@ -285,7 +245,7 @@ bool KinematicGUI::AddAssemblyInStudy(GEOM::GEOM_Assembly_ptr aAssembly)
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry()); SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
TCollection_AsciiString nameG("Assembly_"); TCollection_AsciiString nameG("Assembly_");
nameG += TCollection_AsciiString(myGeomGUI->GetNbGeom()++) + TCollection_AsciiString("\0"); nameG += TCollection_AsciiString(myGeomGUI->myNbGeom++) + TCollection_AsciiString("\0");
// open transaction // open transaction
QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy()); QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
@ -341,7 +301,7 @@ bool KinematicGUI::AddContactInStudy(GEOM::GEOM_Assembly_ptr Ass, GEOM::GEOM_Con
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry()); SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
TCollection_AsciiString nameG("Contact_"); TCollection_AsciiString nameG("Contact_");
nameG += TCollection_AsciiString(myGeomGUI->GetNbGeom()++) + TCollection_AsciiString("\0"); nameG += TCollection_AsciiString(myGeomGUI->myNbGeom++) + TCollection_AsciiString("\0");
// open transaction // open transaction
QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy()); QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
@ -423,7 +383,7 @@ bool KinematicGUI::AddAnimationInStudy(GEOM::GEOM_Animation_ptr aAnimation)
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry()); SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
TCollection_AsciiString nameG("Animation_"); TCollection_AsciiString nameG("Animation_");
nameG += TCollection_AsciiString(myGeomGUI->GetNbGeom()++) + TCollection_AsciiString("\0"); nameG += TCollection_AsciiString(myGeomGUI->myNbGeom++) + TCollection_AsciiString("\0");
// open transaction // open transaction
QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy()); QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
@ -482,12 +442,8 @@ void KinematicGUI::SetPosition(GEOM::GEOM_Contact_ptr aContact, GEOM::PointStruc
GEOM::DirStruct VX, GEOM::DirStruct VY, GEOM::DirStruct VZ) GEOM::DirStruct VX, GEOM::DirStruct VY, GEOM::DirStruct VZ)
{ {
try { try {
GEOM::GEOM_Position_var myGeomPosition = GEOM::GEOM_Position::_narrow(aContact->GetPosition()); aContact->SetPosition(P0.x, P0.y, P0.z, VX.PS.x, VX.PS.y, VX.PS.z,
myGeomPosition->SetOrigin(P0); VY.PS.x, VY.PS.y, VY.PS.z, VZ.PS.x, VZ.PS.y, VZ.PS.z);
myGeomPosition->SetVX(VX);
myGeomPosition->SetVY(VY);
myGeomPosition->SetVZ(VZ);
myGeom->SetPosition(aContact); myGeom->SetPosition(aContact);
} }
catch(const SALOME::SALOME_Exception& S_ex) { catch(const SALOME::SALOME_Exception& S_ex) {
@ -498,26 +454,16 @@ void KinematicGUI::SetPosition(GEOM::GEOM_Contact_ptr aContact, GEOM::PointStruc
//======================================================================= //=======================================================================
// function : SetRotation() // function : SetAngularRange()
// purpose : // purpose :
//======================================================================= //=======================================================================
void KinematicGUI::SetRotation(GEOM::GEOM_Contact_ptr aContact, void KinematicGUI::SetAngularRange(GEOM::GEOM_Contact_ptr aContact,
int Rot1, int Rot2, int Rot3, double MinValX, double MaxValX, double MinValY,
double Val1, double Val2, double Val3) double MaxValY, double MinValZ, double MaxValZ)
{ {
try { try {
GEOM::GEOM_Rotation_var myGeomRotation = GEOM::GEOM_Rotation::_narrow(aContact->GetRotation()); aContact->SetAngularRange(MinValX, MaxValX, MinValY, MaxValY, MinValZ, MaxValZ);
myGeomRotation->SetRotation(Rot1, Rot2, Rot3, Val1, Val2, Val3); myGeom->SetAngularRange(aContact);
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);
} }
catch(const SALOME::SALOME_Exception& S_ex) { catch(const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex); QtCatchCorbaException(S_ex);
@ -527,28 +473,35 @@ void KinematicGUI::SetRotation(GEOM::GEOM_Contact_ptr aContact,
//======================================================================= //=======================================================================
// function : SetTranslation() // function : SetLinearRange()
// purpose : // purpose :
//======================================================================= //=======================================================================
void KinematicGUI::SetTranslation(GEOM::GEOM_Contact_ptr aContact, void KinematicGUI::SetLinearRange(GEOM::GEOM_Contact_ptr aContact,
double ValX, double ValY, double ValZ) double MinValX, double MaxValX, double MinValY,
double MaxValY, double MinValZ, double MaxValZ)
{ {
try { try {
GEOM::GEOM_Translation_var myGeomTranslation = GEOM::GEOM_Translation::_narrow(aContact->GetTranslation()); aContact->SetLinearRange(MinValX, MaxValX, MinValY, MaxValY, MinValZ, MaxValZ);
myGeomTranslation->SetTranslation(ValX, ValY, ValZ); myGeom->SetLinearRange(aContact);
int type = aContact->GetType(); }
if(type == 9) { //HELICOIDAL catch(const SALOME::SALOME_Exception& S_ex) {
GEOM::GEOM_Rotation_var myGeomRotation = GEOM::GEOM_Rotation::_narrow(aContact->GetRotation()); QtCatchCorbaException(S_ex);
int aRot1 = myGeomRotation->GetRot1(); }
int aRot2 = myGeomRotation->GetRot2(); return;
int aRot3 = myGeomRotation->GetRot3(); }
double aVal2 = myGeomRotation->GetVal2();
double aVal3 = myGeomRotation->GetVal3();
double aStep = aContact->GetStep(); //=======================================================================
double aVal1 = 360 * ValX / aStep; // function : SetDisplacement()
myGeomRotation->SetRotation(aRot1, aRot2, aRot3, aVal1, aVal2, aVal3); // purpose :
} //=======================================================================
myGeom->SetTranslation(aContact); 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) { catch(const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex); QtCatchCorbaException(S_ex);
@ -558,7 +511,7 @@ void KinematicGUI::SetTranslation(GEOM::GEOM_Contact_ptr aContact,
//===================================================================================== //=====================================================================================
// function : AddContactInStudy() // function : GetNameFromType()
// purpose : // purpose :
//===================================================================================== //=====================================================================================
TCollection_AsciiString KinematicGUI::GetNameFromType(int type) TCollection_AsciiString KinematicGUI::GetNameFromType(int type)
@ -601,38 +554,33 @@ Kinematic_Contact* KinematicGUI::CreateContact(GEOM::GEOM_Contact_ptr aContact)
{ {
GEOM::GEOM_Shape_var myShape1 = aContact->GetShape1(); GEOM::GEOM_Shape_var myShape1 = aContact->GetShape1();
GEOM::GEOM_Shape_var myShape2 = aContact->GetShape2(); 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(); int Type = aContact->GetType();
double Step = aContact->GetStep(); 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 aShape1 = myGeomGUI->GetShapeReader().GetShape(myGeom, myShape1);
TopoDS_Shape aShape2 = myGeomGUI->GetShapeReader().GetShape(myGeom, myShape2); TopoDS_Shape aShape2 = myGeomGUI->GetShapeReader().GetShape(myGeom, myShape2);
Kinematic_Contact* KContact = new Kinematic_Contact(aShape1, aShape2, Type, Step); Kinematic_Contact* KContact = new Kinematic_Contact(aShape1, aShape2, Type, Step);
gp_Pnt Origin(myPosition->GetOrigin().x, myPosition->GetOrigin().y, myPosition->GetOrigin().z); gp_Pnt Center(aPosList[0], aPosList[1], aPosList[2]);
gp_Dir aDirX(myPosition->GetVX().PS.x, myPosition->GetVX().PS.y, myPosition->GetVX().PS.z); gp_Dir aDirX(aPosList[3], aPosList[4], aPosList[5]);
gp_Dir aDirY(myPosition->GetVY().PS.x, myPosition->GetVY().PS.y, myPosition->GetVY().PS.z); gp_Dir aDirY(aPosList[6], aPosList[7], aPosList[8]);
gp_Dir aDirZ(myPosition->GetVZ().PS.x, myPosition->GetVZ().PS.y, myPosition->GetVZ().PS.z); 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->Position().Origin(Origin); KContact->GetAngularRange().SetRangeX(aARList[0], aARList[1]);
KContact->Position().DirX(aDirX); KContact->GetAngularRange().SetRangeY(aARList[2], aARList[3]);
KContact->Position().DirY(aDirY); KContact->GetAngularRange().SetRangeZ(aARList[4], aARList[5]);
KContact->Position().DirZ(aDirZ);
KContact->Rotation().Rot1(myRotation->GetRot1()); KContact->GetLinearRange().SetRangeX(aLRList[0], aLRList[1]);
KContact->Rotation().Rot2(myRotation->GetRot2()); KContact->GetLinearRange().SetRangeY(aLRList[2], aLRList[3]);
KContact->Rotation().Rot3(myRotation->GetRot3()); KContact->GetLinearRange().SetRangeZ(aLRList[4], aLRList[5]);
KContact->Rotation().ValX(myRotation->GetVal1());
KContact->Rotation().ValY(myRotation->GetVal2());
KContact->Rotation().ValZ(myRotation->GetVal3());
KContact->Translation().ValX(myTranslation->GetValX());
KContact->Translation().ValY(myTranslation->GetValY());
KContact->Translation().ValZ(myTranslation->GetValZ());
return KContact; return KContact;
} }
@ -658,7 +606,7 @@ Kinematic_Assembly* KinematicGUI::CreateAssembly(GEOM::GEOM_Assembly_ptr aAssemb
//======================================================================= //=======================================================================
// function : () // function : CreateAnimation()
// purpose : // purpose :
//======================================================================= //=======================================================================
Kinematic_Animation* KinematicGUI::CreateAnimation(GEOM::GEOM_Animation_ptr aAnimation) Kinematic_Animation* KinematicGUI::CreateAnimation(GEOM::GEOM_Animation_ptr aAnimation)
@ -672,6 +620,17 @@ Kinematic_Animation* KinematicGUI::CreateAnimation(GEOM::GEOM_Animation_ptr aAni
TopoDS_Shape myFrame = myGeomGUI->GetShapeReader().GetShape(myGeom, aFrame); TopoDS_Shape myFrame = myGeomGUI->GetShapeReader().GetShape(myGeom, aFrame);
Kinematic_Animation* KAnimation = new Kinematic_Animation(KAssembly, myFrame, Duration, NbSeq); 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; return KAnimation;
} }

View File

@ -67,12 +67,16 @@ public :
TCollection_AsciiString GetNameFromType(int type); TCollection_AsciiString GetNameFromType(int type);
void SetPosition(GEOM::GEOM_Contact_ptr aContact, GEOM::PointStruct P0, void SetPosition(GEOM::GEOM_Contact_ptr aContact, GEOM::PointStruct P0,
GEOM::DirStruct VX, GEOM::DirStruct VY, GEOM::DirStruct VZ); GEOM::DirStruct VX, GEOM::DirStruct VY, GEOM::DirStruct VZ);
void SetRotation(GEOM::GEOM_Contact_ptr aContact, void SetAngularRange(GEOM::GEOM_Contact_ptr aContact,
int Rot1, int Rot2, int Rot3, double MinValX, double MaxValX, double MinValY,
double Val1, double Val2, double Val3); double MaxValY, double MinValZ, double MaxValZ);
void SetTranslation(GEOM::GEOM_Contact_ptr aContact, void SetLinearRange(GEOM::GEOM_Contact_ptr aContact,
double ValX, double ValY, double ValZ); 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_Contact* CreateContact(GEOM::GEOM_Contact_ptr aContact);
Kinematic_Assembly* CreateAssembly(GEOM::GEOM_Assembly_ptr aAssembly); Kinematic_Assembly* CreateAssembly(GEOM::GEOM_Assembly_ptr aAssembly);

View File

@ -1,117 +0,0 @@
/****************************************************************************
** 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
}

View File

@ -1,51 +0,0 @@
/****************************************************************************
** 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

View File

@ -1,121 +0,0 @@
/****************************************************************************
** 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
}

View File

@ -26,189 +26,16 @@
// Module : GEOM // Module : GEOM
// $Header: // $Header:
using namespace std;
#include "KinematicGUI_AnimDlg.h" #include "KinematicGUI_AnimDlg.h"
#include <Geom_Transformation.hxx>
#include "QAD_RightFrame.h" #include "QAD_RightFrame.h"
#include "OCCViewer_ViewFrame.h" #include "OCCViewer_ViewFrame.h"
#include "QAD_FileDlg.h" #include "QAD_FileDlg.h"
#include "QAD_Tools.h" #include "QAD_Tools.h"
//================================================================================= using namespace std;
// 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() {}
//=================================================================================
// class : run()
// purpose :
//=================================================================================
void MyThread::run()
{
qApp->lock();
while(myIsActive) {
emit frameChanged();
qApp->syncX();
double Step, Val;
Step = 1.0 / myKAnimation->NbSeq();
Val = myValue * Step;
myKAnimation->myMovedShape.Clear();
myKAnimation->myMovedShape.Add(myKAnimation->Frame());
myKAnimation->myNbAIS = 0;
myKAnimation->GetNextShape(myIC, myLoc, myKAnimation->Frame(), Val);
myIC->UpdateCurrentViewer();
qApp->unlock();
usleep((int)(myKAnimation->Duration() / myKAnimation->NbSeq() * 1e6));
qApp->lock();
if (!myIsActive) break;
}
qApp->unlock();
emit stopped();
QThread::exit();
return;
}
//=================================================================================
// class : InitAnim()
// purpose :
//=================================================================================
void MyThread::InitAnim()
{
myKAnimation->myMovedShape.Clear();
myKAnimation->myMovedShape.Add(myKAnimation->Frame());
gp_Trsf aLoc;
myLoc = aLoc;
if(!myKAnimation->IsCreated)
myKAnimation->GetNextShape(myIC, myLoc, myKAnimation->Frame(), 1);
myKAnimation->IsCreated = true;
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;
}
//=================================================================================
// 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;
}
//=================================================================================
// class : NextFrame()
// purpose :
//=================================================================================
void MyThread::NextFrame() {
double Step, Val;
Step = 1.0 / myKAnimation->NbSeq();
Val = myValue * Step;
myKAnimation->myMovedShape.Clear();
myKAnimation->myMovedShape.Add(myKAnimation->Frame());
myKAnimation->myNbAIS = 0;
myKAnimation->GetNextShape(myIC, myLoc, myKAnimation->Frame(), Val);
myIC->UpdateCurrentViewer();
return;
}
//=================================================================================
// class : startAnimation()
// purpose :
//=================================================================================
void MyThread::startAnimation() {
//DCQ : QThread doesn't work...
// if(!myIsActive) {
// myIsActive = true;
// QThread::start();
// }
QApplication::setOverrideCursor(Qt::waitCursor);
myIsActive = true;
qApp->lock();
while(myIsActive) {
emit frameChanged();
qApp->syncX();
double Step, Val;
Step = 1.0 / myKAnimation->NbSeq();
Val = myValue * Step;
myKAnimation->myMovedShape.Clear();
myKAnimation->myMovedShape.Add(myKAnimation->Frame());
myKAnimation->myNbAIS = 0;
myKAnimation->GetNextShape(myIC, myLoc, myKAnimation->Frame(), Val);
myIC->UpdateCurrentViewer();
qApp->unlock();
usleep((int)(myKAnimation->Duration() / myKAnimation->NbSeq() * 1e6));
qApp->lock();
if (!myIsActive) break;
}
QApplication::restoreOverrideCursor();
qApp->unlock();
emit stopped();
return;
}
//=================================================================================
// class : stopAnimation()
// purpose :
//=================================================================================
void MyThread::stopAnimation() {
myIsActive = false;
return;
}
//================================================================================= //=================================================================================
// class : KinematicGUI_AnimDlg() // class : KinematicGUI_AnimDlg()
@ -227,38 +54,127 @@ KinematicGUI_AnimDlg::KinematicGUI_AnimDlg(QWidget* parent, const char* name, Ki
GroupMedium->close(TRUE); GroupMedium->close(TRUE);
resize(0, 0); resize(0, 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");
LayoutD = new QGridLayout( 0, 1, 1, 0, 6, "LayoutD");
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 );
CheckButton1 = new QRadioButton( GroupBox1, "CheckButton1" );
CheckButton1->setText( trUtf8( "" ) );
LayoutD->addWidget( CheckButton1, 0, 0 );
LayoutA->addLayout( LayoutD, 3, 0 );
Slider1 = new QSlider( GroupBox1, "Slider1" );
Slider1->setOrientation( QSlider::Horizontal );
LayoutA->addWidget( Slider1, 1, 0 );
LayoutB = new QGridLayout( 0, 1, 1, 0, 6, "LayoutB");
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 );
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 );
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
LayoutB->addWidget( LineEdit1, 0, 2 );
LayoutA->addLayout( LayoutB, 0, 0 );
QSpacerItem* spacer = new QSpacerItem( 0, 212, QSizePolicy::Minimum, QSizePolicy::Expanding );
LayoutA->addItem( spacer, 4, 0 );
LayoutC = new QGridLayout( 0, 1, 1, 0, 6, "LayoutC");
PushButton4 = new QPushButton( GroupBox1, "PushButton4" );
PushButton4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton4->sizePolicy().hasHeightForWidth() ) );
PushButton4->setText( trUtf8( "" ) );
LayoutC->addWidget( PushButton4, 0, 2 );
PushButton6 = new QPushButton( GroupBox1, "PushButton6" );
PushButton6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton6->sizePolicy().hasHeightForWidth() ) );
PushButton6->setText( trUtf8( "" ) );
LayoutC->addWidget( PushButton6, 0, 4 );
PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
PushButton2->setText( trUtf8( "" ) );
LayoutC->addWidget( PushButton2, 0, 0 );
PushButton5 = new QPushButton( GroupBox1, "PushButton5" );
PushButton5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton5->sizePolicy().hasHeightForWidth() ) );
PushButton5->setText( trUtf8( "" ) );
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( "" ) );
LayoutC->addWidget( PushButton3, 0, 1 );
LayoutA->addLayout( LayoutC, 2, 0 );
GroupBox1Layout->addLayout( LayoutA, 0, 0 );
/***************************************************************/
setCaption(tr("GEOM_ANIM_TITLE")); setCaption(tr("GEOM_ANIM_TITLE"));
QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIMATION"))); QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIMATION")));
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIM_FIRST"))); QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIM_FIRST")));
QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIM_PREV"))); QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIM_PREV")));
QPixmap image3(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIM_STOP"))); QPixmap image3(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIM_PLAY")));
QPixmap image4(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_NEXT"))); QPixmap image5(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIM_LAST")));
QPixmap image6(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_ANIM_LAST"))); QPixmap image6(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
/***************************************************************/ /***************************************************************/
GroupConstructors->setTitle(tr("GEOM_ANIM")); GroupConstructors->setTitle(tr("GEOM_ANIM"));
RadioButton1->setPixmap(image0); RadioButton1->setPixmap(image0);
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"));
Group1 = new KinematicGUI_Anim_QTD(this, "Group1"); Layout1->addWidget(GroupBox1, 1, 0);
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);
/***************************************************************/ /***************************************************************/
/* Initialisation */ /* Initialisation */
myKinematicGUI = theKinematicGUI; myKinematicGUI = theKinematicGUI;
mySelection = Sel;
myIC = ic;
QApplication::setOverrideCursor(Qt::waitCursor); QApplication::setOverrideCursor(Qt::waitCursor);
Init(Sel, ic); Init();
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
} }
@ -270,7 +186,6 @@ KinematicGUI_AnimDlg::KinematicGUI_AnimDlg(QWidget* parent, const char* name, Ki
KinematicGUI_AnimDlg::~KinematicGUI_AnimDlg() KinematicGUI_AnimDlg::~KinematicGUI_AnimDlg()
{ {
// no need to delete child widgets, Qt does it all for us // no need to delete child widgets, Qt does it all for us
this->destroy(TRUE, TRUE);
} }
@ -278,61 +193,38 @@ KinematicGUI_AnimDlg::~KinematicGUI_AnimDlg()
// function : Init() // function : Init()
// purpose : // purpose :
//================================================================================= //=================================================================================
void KinematicGUI_AnimDlg::Init(SALOME_Selection* Sel, Handle(AIS_InteractiveContext) ic) void KinematicGUI_AnimDlg::Init()
{ {
/* init variables */ /* init variables */
mySelection = Sel;
myGeomBase = new GEOMBase(); myGeomBase = new GEOMBase();
myGeomGUI = GEOMContext::GetGeomGUI(); myGeomGUI = GEOMContext::GetGeomGUI();
myGeomGUI->SetActiveDialogBox((QDialog*)this); myGeomGUI->SetActiveDialogBox((QDialog*)this);
myGeom = myGeomGUI->myComponentGeom;
RadioButton1->setChecked(TRUE);
Slider1->setPageStep(1);
Slider1->setValue(0);
Standard_Boolean testResult; myDuration = 5.0;
Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject(); myNbSeq = 50;
GEOM::GEOM_Animation_var myGeomAnim = myGeomBase->ConvertIOinAnimation(IO, testResult); myIsActive = false;
if(!testResult) myType = 0;
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);
Group1->Slider1->setMaxValue(KAnimation->NbSeq());
Group1->Slider1->setPageStep(1);
Group1->Slider1->setValue(0);
/* signals and slots connections */ /* signals and slots connections */
connect(buttonClose, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); connect(buttonClose, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
connect(Group1->Slider1, SIGNAL(valueChanged(int)), this, SLOT(ClickOnSlider(int))); connect(Slider1, SIGNAL(valueChanged(int)), this, SLOT(ClickOnSlider(int)));
connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(ClickOnFirst())); connect(PushButton2, SIGNAL(clicked()), this, SLOT(ClickOnFirst()));
connect(Group1->PushButton2, SIGNAL(clicked()), this, SLOT(ClickOnPrevious())); connect(PushButton3, SIGNAL(clicked()), this, SLOT(ClickOnPrevious()));
connect(Group1->PushButton3, SIGNAL(clicked()), this, SLOT(ClickOnStop())); connect(PushButton4, SIGNAL(clicked()), this, SLOT(ClickOnPlay()));
connect(Group1->PushButton4, SIGNAL(clicked()), this, SLOT(ClickOnPlay())); connect(PushButton5, SIGNAL(clicked()), this, SLOT(ClickOnNext()));
connect(Group1->PushButton5, SIGNAL(clicked()), this, SLOT(ClickOnNext())); connect(PushButton6, SIGNAL(clicked()), this, SLOT(ClickOnLast()));
connect(Group1->PushButton6, SIGNAL(clicked()), this, SLOT(ClickOnLast())); connect(PushButton7, SIGNAL(clicked()), this, SLOT(ClickOnExport()));
connect(Group1->PushButton7, SIGNAL(clicked()), this, SLOT(ClickOnExport())); connect(CheckButton1, SIGNAL(clicked()), this, SLOT(ClickOnShading()));
connect(Group1->CheckButton1, SIGNAL(clicked()), this, SLOT(ClickOnShading()));
myAnimator = new MyThread(KAnimation, ic); connect(PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(myAnimator, SIGNAL(frameChanged()), this, SLOT(OnNext())); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
connect(myAnimator, SIGNAL(stopped()), this, SLOT(ClickOnStop()));
myAnimator->InitAnim();
myAnimator->myValue = 0;
myAnimator->NextFrame();
/* Move widget on the botton right corner of main widget */ /* Move widget on the botton right corner of main widget */
// int x, y; // int x, y;
@ -340,22 +232,89 @@ void KinematicGUI_AnimDlg::Init(SALOME_Selection* Sel, Handle(AIS_InteractiveCon
// this->move(x, y); // this->move(x, y);
/* displays Dialog */ /* displays Dialog */
RadioButton1->setChecked(TRUE); this->SelectionIntoArgument();
Group1->show();
this->show(); this->show();
return; 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() // function : ClickOnCancel()
// purpose : // purpose :
//================================================================================= //=================================================================================
void KinematicGUI_AnimDlg::ClickOnCancel() void KinematicGUI_AnimDlg::ClickOnCancel()
{ {
this->ClickOnStop(); this->ClearAnim(true);
myAnimator->ClearAnim(true);
disconnect(mySelection, 0, this, 0); disconnect(mySelection, 0, this, 0);
reject(); reject();
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
@ -369,6 +328,7 @@ void KinematicGUI_AnimDlg::ClickOnCancel()
//================================================================================= //=================================================================================
void KinematicGUI_AnimDlg::DeactivateActiveDialog() void KinematicGUI_AnimDlg::DeactivateActiveDialog()
{ {
this->ClearAnim(true);
this->setEnabled(false); this->setEnabled(false);
disconnect(mySelection, 0, this, 0); disconnect(mySelection, 0, this, 0);
myGeomGUI->SetActiveDialogBox(0); myGeomGUI->SetActiveDialogBox(0);
@ -387,6 +347,7 @@ void KinematicGUI_AnimDlg::ActivateThisDialog()
this->setEnabled(true); this->setEnabled(true);
myGeomGUI->SetActiveDialogBox((QDialog*)this); myGeomGUI->SetActiveDialogBox((QDialog*)this);
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
this->SelectionIntoArgument();
return; return;
} }
@ -422,9 +383,8 @@ void KinematicGUI_AnimDlg::enterEvent(QEvent * e)
//================================================================================= //=================================================================================
void KinematicGUI_AnimDlg::ClickOnSlider(int newValue) void KinematicGUI_AnimDlg::ClickOnSlider(int newValue)
{ {
myAnimator->myValue = newValue; myValue = newValue;
if(!myAnimator->running()) this->NextFrame();
myAnimator->NextFrame();
return; return;
} }
@ -435,14 +395,13 @@ void KinematicGUI_AnimDlg::ClickOnSlider(int newValue)
//================================================================================= //=================================================================================
void KinematicGUI_AnimDlg::ClickOnFirst() void KinematicGUI_AnimDlg::ClickOnFirst()
{ {
this->ClickOnStop(); int aVal = Slider1->value();
int aVal = Group1->Slider1->value();
if(aVal == 0) { if(aVal == 0) {
myAnimator->myValue = 0; myValue = 0;
myAnimator->NextFrame(); this->NextFrame();
} }
else else
Group1->Slider1->setValue(0); Slider1->setValue(0);
return; return;
} }
@ -453,21 +412,9 @@ void KinematicGUI_AnimDlg::ClickOnFirst()
//================================================================================= //=================================================================================
void KinematicGUI_AnimDlg::ClickOnPrevious() void KinematicGUI_AnimDlg::ClickOnPrevious()
{ {
this->ClickOnStop(); int aVal = Slider1->value();
int aVal = Group1->Slider1->value();
if(aVal != 0) if(aVal != 0)
Group1->Slider1->setValue(aVal - 1); Slider1->setValue(aVal - 1);
return;
}
//=================================================================================
// function : ClickOnStop()
// purpose :
//=================================================================================
void KinematicGUI_AnimDlg::ClickOnStop()
{
myAnimator->stopAnimation();
return; return;
} }
@ -478,27 +425,21 @@ void KinematicGUI_AnimDlg::ClickOnStop()
//================================================================================= //=================================================================================
void KinematicGUI_AnimDlg::ClickOnPlay() void KinematicGUI_AnimDlg::ClickOnPlay()
{ {
if(!myAnimator->running()) QApplication::setOverrideCursor(Qt::waitCursor);
myAnimator->startAnimation(); myIsActive = true;
return; qApp->lock();
} while(myIsActive) {
this->ClickOnNext();
qApp->syncX();
qApp->unlock();
usleep((int)(myDuration / myNbSeq * 1e6));
qApp->lock();
//================================================================================= if (!myIsActive) break;
// function : OnNext()
// purpose :
//=================================================================================
void KinematicGUI_AnimDlg::OnNext()
{
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();
} }
QApplication::restoreOverrideCursor();
return; return;
} }
@ -509,8 +450,11 @@ void KinematicGUI_AnimDlg::OnNext()
//================================================================================= //=================================================================================
void KinematicGUI_AnimDlg::ClickOnNext() void KinematicGUI_AnimDlg::ClickOnNext()
{ {
this->ClickOnStop(); int aVal = Slider1->value();
this->OnNext(); if(aVal != myNbSeq)
Slider1->setValue(aVal + 1);
else
myIsActive = false;
return; return;
} }
@ -521,32 +465,158 @@ void KinematicGUI_AnimDlg::ClickOnNext()
//================================================================================= //=================================================================================
void KinematicGUI_AnimDlg::ClickOnLast() void KinematicGUI_AnimDlg::ClickOnLast()
{ {
this->ClickOnStop(); int aVal = Slider1->value();
int aVal = Group1->Slider1->value(); if(aVal == myNbSeq) {
if(aVal == myAnimator->myKAnimation->NbSeq()) { myValue = myNbSeq;
myAnimator->myValue = myAnimator->myKAnimation->NbSeq(); this->NextFrame();
myAnimator->NextFrame();
} }
else else
Group1->Slider1->setValue(myAnimator->myKAnimation->NbSeq()); Slider1->setValue(myNbSeq);
return; return;
} }
//=================================================================================
// class : InitAnim()
// purpose :
//=================================================================================
void KinematicGUI_AnimDlg::InitAnim()
{
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;
}
//=================================================================================
// class : ClearAnim()
// purpose :
//=================================================================================
void KinematicGUI_AnimDlg::ClearAnim(int ClearPrs)
{
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);
}
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;
}
//================================================================================= //=================================================================================
// function : ClickOnShading() // function : ClickOnShading()
// purpose : // purpose :
//================================================================================= //=================================================================================
void KinematicGUI_AnimDlg::ClickOnShading() void KinematicGUI_AnimDlg::ClickOnShading()
{ {
if(myType == 0)
return;
QApplication::setOverrideCursor(Qt::waitCursor); QApplication::setOverrideCursor(Qt::waitCursor);
this->ClickOnStop(); this->ClearAnim(false);
myAnimator->ClearAnim(false);
myAnimator->myKAnimation->myIsShading = Group1->CheckButton1->isChecked(); if(myType == 2)
myAnimator->InitAnim(); myKAnimation->myIsShading = CheckButton1->isChecked();
this->ClickOnFirst();
this->InitAnim();
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
return; return;
} }
@ -557,6 +627,9 @@ void KinematicGUI_AnimDlg::ClickOnShading()
//================================================================================= //=================================================================================
void KinematicGUI_AnimDlg::ClickOnExport() void KinematicGUI_AnimDlg::ClickOnExport()
{ {
if(myType == 0)
return;
this->ClickOnFirst(); this->ClickOnFirst();
QString fName = QAD_FileDlg::getFileName(QAD_Application::getDesktop(), QString::null, tr("OCC_IMAGE_FILES"), tr("INF_APP_DUMP_VIEW"), false); QString fName = QAD_FileDlg::getFileName(QAD_Application::getDesktop(), QString::null, tr("OCC_IMAGE_FILES"), tr("INF_APP_DUMP_VIEW"), false);
@ -568,7 +641,7 @@ void KinematicGUI_AnimDlg::ClickOnExport()
QApplication::setOverrideCursor(Qt::waitCursor); QApplication::setOverrideCursor(Qt::waitCursor);
qApp->processEvents(); qApp->processEvents();
for(int i = 0; i <= myAnimator->myKAnimation->NbSeq(); i++) { for(int i = 0; i <= myNbSeq; i++) {
qApp->processEvents(); qApp->processEvents();
QWidget* qw = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewWidget(); QWidget* qw = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewWidget();
QPixmap px = QPixmap::grabWindow(qw->winId()); QPixmap px = QPixmap::grabWindow(qw->winId());
@ -588,7 +661,7 @@ void KinematicGUI_AnimDlg::ClickOnExport()
bool bOk = px.save(fileName, fmt.latin1()); bool bOk = px.save(fileName, fmt.latin1());
this->OnNext(); this->ClickOnNext();
} }
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();

View File

@ -30,50 +30,15 @@
#define KINEMATICGUI_ANIMDLG_H #define KINEMATICGUI_ANIMDLG_H
#include "KinematicGUI_Skeleton_QTD.h" #include "KinematicGUI_Skeleton_QTD.h"
#include "KinematicGUI_Anim_QTD.h"
#include "KinematicGUI.h" #include "KinematicGUI.h"
#include <qwidget.h> #include <qslider.h>
#include <qgroupbox.h> #include <qgroupbox.h>
#include <qlineedit.h>
#include <qlayout.h> #include <qlayout.h>
#include <qradiobutton.h> #include <qradiobutton.h>
#include <qlineedit.h>
#include <qbuttongroup.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 class KinematicGUI_AnimDlg : public KinematicGUI_Skeleton_QTD
{ {
@ -84,36 +49,68 @@ public:
~KinematicGUI_AnimDlg(); ~KinematicGUI_AnimDlg();
private : private :
void Init(SALOME_Selection* Sel, Handle(AIS_InteractiveContext) ic); void Init();
void enterEvent(QEvent * e); void enterEvent(QEvent * e);
void closeEvent(QCloseEvent* e); void closeEvent(QCloseEvent* e);
KinematicGUI* myKinematicGUI; KinematicGUI* myKinematicGUI;
MyThread* myAnimator;
SALOME_Selection* mySelection; /* User shape selection */ SALOME_Selection* mySelection; /* User shape selection */
GEOM::GEOM_Gen_var myGeom; /* Current GeomI object */
GEOMBase* myGeomBase; GEOMBase* myGeomBase;
GEOMContext* myGeomGUI; /* Current GeomGUI object */ 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: private slots:
void ClickOnCancel(); void ClickOnCancel();
void SetEditCurrentArgument();
void SelectionIntoArgument();
void DeactivateActiveDialog(); void DeactivateActiveDialog();
void ActivateThisDialog(); void ActivateThisDialog();
void ClickOnSlider(int newValue); void ClickOnSlider(int newValue);
void ClickOnFirst(); void ClickOnFirst();
void ClickOnPrevious(); void ClickOnPrevious();
void ClickOnStop();
void ClickOnPlay(); void ClickOnPlay();
void OnNext();
void ClickOnNext(); void ClickOnNext();
void ClickOnLast(); void ClickOnLast();
void ClickOnShading(); void ClickOnShading();
void ClickOnExport(); void ClickOnExport();
protected:
QGridLayout* GroupBox1Layout;
QGridLayout* LayoutA;
QGridLayout* LayoutB;
QGridLayout* LayoutC;
QGridLayout* LayoutD;
}; };
#endif // KINEMATICGUI_ANIMDLG_H #endif // KINEMATICGUI_ANIMDLG_H

View File

@ -0,0 +1,557 @@
// 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;
}

View File

@ -0,0 +1,108 @@
// 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

View File

@ -1,122 +0,0 @@
/****************************************************************************
** 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
}

View File

@ -1,51 +0,0 @@
/****************************************************************************
** 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

View File

@ -26,9 +26,10 @@
// Module : GEOM // Module : GEOM
// $Header: // $Header:
using namespace std;
#include "KinematicGUI_AnimationDlg.h" #include "KinematicGUI_AnimationDlg.h"
using namespace std;
//================================================================================= //=================================================================================
// class : KinematicGUI_AnimationDlg() // class : KinematicGUI_AnimationDlg()
// purpose : Constructs a KinematicGUI_AnimationDlg which is a child of 'parent', with the // purpose : Constructs a KinematicGUI_AnimationDlg which is a child of 'parent', with the
@ -141,6 +142,7 @@ void KinematicGUI_AnimationDlg::ClickOnOk()
//================================================================================= //=================================================================================
void KinematicGUI_AnimationDlg::ClickOnApply() void KinematicGUI_AnimationDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkAssembly && myOkShape1) if(myOkAssembly && myOkShape1)
@ -274,7 +276,7 @@ void KinematicGUI_AnimationDlg::ValueChangedInSpinBox(double newValue)
if(send == Group1->SpinBox_DX) if(send == Group1->SpinBox_DX)
myDuration = newValue; myDuration = newValue;
else if(send == Group1->SpinBox_DY) else if(send == Group1->SpinBox_DY)
myNbSeq = newValue; myNbSeq = int(newValue);
return; return;
} }

View File

@ -57,7 +57,7 @@ private:
bool myOkAssembly; bool myOkAssembly;
bool myOkShape1; /* to check when arguments are defined */ bool myOkShape1; /* to check when arguments are defined */
double myDuration; double myDuration;
int myNbSeq; int myNbSeq;
DlgRef_2Sel2Spin* Group1; DlgRef_2Sel2Spin* Group1;

View File

@ -26,9 +26,10 @@
// Module : GEOM // Module : GEOM
// $Header: // $Header:
using namespace std;
#include "KinematicGUI_ContactDlg.h" #include "KinematicGUI_ContactDlg.h"
using namespace std;
//================================================================================= //=================================================================================
// class : KinematicGUI_ContactDlg() // class : KinematicGUI_ContactDlg()
// purpose : Constructs a KinematicGUI_ContactDlg which is a child of 'parent', with the // purpose : Constructs a KinematicGUI_ContactDlg which is a child of 'parent', with the
@ -36,7 +37,7 @@ using namespace std;
// The dialog will by default be modeless, unless you set 'modal' to // The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog. // 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) :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 image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_CONTACT")));
@ -50,22 +51,111 @@ KinematicGUI_ContactDlg::KinematicGUI_ContactDlg(QWidget* parent, const char* na
RadioButton2->close(TRUE); RadioButton2->close(TRUE);
RadioButton3->close(TRUE); RadioButton3->close(TRUE);
Group1 = new KinematicGUI_3Sel1List_QTD(this, "Group1"); GroupBox1 = new QGroupBox( this, "GroupBox1" );
Group1->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); GroupBox1->setTitle( trUtf8( "" ) );
Group1->TextLabel1->setText(tr("GEOM_ASSEMBLY")); GroupBox1->setColumnLayout(0, Qt::Vertical );
Group1->TextLabel2->setText(tr("GEOM_TYPE")); GroupBox1->layout()->setSpacing( 6 );
Group1->TextLabel3->setText(tr("GEOM_OBJECT_I").arg("1")); GroupBox1->layout()->setMargin( 11 );
Group1->TextLabel4->setText(tr("GEOM_OBJECT_I").arg("2")); GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
Group1->PushButton1->setPixmap(image1); GroupBox1Layout->setAlignment( Qt::AlignTop );
Group1->PushButton2->setPixmap(image1);
Group1->PushButton3->setPixmap(image1);
Layout1->addWidget(Group1, 1, 0); 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 */ /* Initialisation */
myKinematicGUI = theKinematicGUI; myKinematicGUI = theKinematicGUI;
myType = type;
Init(); Init();
} }
@ -88,40 +178,51 @@ KinematicGUI_ContactDlg::~KinematicGUI_ContactDlg()
void KinematicGUI_ContactDlg::Init() void KinematicGUI_ContactDlg::Init()
{ {
/* init variables */ /* init variables */
myEditCurrentArgument = Group1->LineEdit1; myEditCurrentArgument = LineEdit1;
myOkAssembly = myOkShape1 = myOkShape2 = false; 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 */ /* type for sub shape selection */
Group1->ComboBox1->insertItem("Embedding"); ComboBox1->insertItem("Embedding");
Group1->ComboBox1->insertItem("Pivot"); ComboBox1->insertItem("Pivot");
Group1->ComboBox1->insertItem("Slide"); ComboBox1->insertItem("Slide");
Group1->ComboBox1->insertItem("Sliding Pivot"); ComboBox1->insertItem("Sliding Pivot");
Group1->ComboBox1->insertItem("Spherical"); ComboBox1->insertItem("Spherical");
Group1->ComboBox1->insertItem("Plane"); ComboBox1->insertItem("Plane");
Group1->ComboBox1->insertItem("Annular"); ComboBox1->insertItem("Annular");
Group1->ComboBox1->insertItem("Rectilinear"); ComboBox1->insertItem("Rectilinear");
Group1->ComboBox1->insertItem("Ponctual"); ComboBox1->insertItem("Ponctual");
ComboBox1->insertItem("Helicoidal");
Group1->ComboBox1->setCurrentItem(myType); ComboBox1->setCurrentItem(myType);
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(Group1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); connect(LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group1->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); connect(LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group1->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); connect(LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect(PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group1->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect(PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group1->PushButton3, 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())); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* displays Dialog */ /* displays Dialog */
Group1->show(); this->SelectionIntoArgument();
this->show(); this->show();
return; return;
@ -146,10 +247,11 @@ void KinematicGUI_ContactDlg::ClickOnOk()
//================================================================================= //=================================================================================
void KinematicGUI_ContactDlg::ClickOnApply() void KinematicGUI_ContactDlg::ClickOnApply()
{ {
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr("")); QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkAssembly && myOkShape1 && myOkShape2) if(myOkAssembly && myOkShape1 && myOkShape2)
myKinematicGUI->AddContact(myGeomAssembly, myGeomShape1, myGeomShape2, myType); myKinematicGUI->AddContact(myGeomAssembly, myGeomShape1, myGeomShape2, myType, myStep);
return; return;
} }
@ -166,11 +268,11 @@ void KinematicGUI_ContactDlg::SelectionIntoArgument()
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString); int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
if(nbSel != 1) { if(nbSel != 1) {
if(myEditCurrentArgument == Group1->LineEdit1) if(myEditCurrentArgument == LineEdit1)
myOkAssembly = false; myOkAssembly = false;
else if( myEditCurrentArgument == Group1->LineEdit2) else if( myEditCurrentArgument == LineEdit2)
myOkShape1 = false; myOkShape1 = false;
else if( myEditCurrentArgument == Group1->LineEdit3) else if( myEditCurrentArgument == LineEdit3)
myOkShape2 = false; myOkShape2 = false;
return; return;
} }
@ -179,11 +281,11 @@ void KinematicGUI_ContactDlg::SelectionIntoArgument()
Standard_Boolean testResult; Standard_Boolean testResult;
Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject(); Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
if(myEditCurrentArgument == Group1->LineEdit1) { if(myEditCurrentArgument == LineEdit1) {
myGeomAssembly = myGeomBase->ConvertIOinAssembly(IO, testResult); myGeomAssembly = myGeomBase->ConvertIOinAssembly(IO, testResult);
if(!testResult) if(!testResult)
return; return;
Group1->LineEdit1->setText(aString); LineEdit1->setText(aString);
myOkAssembly = true; myOkAssembly = true;
} }
else { else {
@ -191,18 +293,18 @@ void KinematicGUI_ContactDlg::SelectionIntoArgument()
if(!myGeomBase->GetTopoFromSelection(mySelection, S)) if(!myGeomBase->GetTopoFromSelection(mySelection, S))
return; return;
if(myEditCurrentArgument == Group1->LineEdit2) { if(myEditCurrentArgument == LineEdit2) {
myGeomShape1 = myGeomBase->ConvertIOinGEOMShape(IO, testResult); myGeomShape1 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult) if(!testResult)
return; return;
Group1->LineEdit2->setText(aString); LineEdit2->setText(aString);
myOkShape1 = true; myOkShape1 = true;
} }
else if(myEditCurrentArgument == Group1->LineEdit3) { else if(myEditCurrentArgument == LineEdit3) {
myGeomShape2 = myGeomBase->ConvertIOinGEOMShape(IO, testResult); myGeomShape2 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult) if(!testResult)
return; return;
Group1->LineEdit3->setText(aString); LineEdit3->setText(aString);
myOkShape2 = true; myOkShape2 = true;
} }
} }
@ -218,17 +320,17 @@ void KinematicGUI_ContactDlg::SetEditCurrentArgument()
{ {
QPushButton* send = (QPushButton*)sender(); QPushButton* send = (QPushButton*)sender();
if(send == Group1->PushButton1) { if(send == PushButton1) {
Group1->LineEdit1->setFocus(); LineEdit1->setFocus();
myEditCurrentArgument = Group1->LineEdit1; myEditCurrentArgument = LineEdit1;
} }
else if(send == Group1->PushButton2) { else if(send == PushButton2) {
Group1->LineEdit2->setFocus(); LineEdit2->setFocus();
myEditCurrentArgument = Group1->LineEdit2; myEditCurrentArgument = LineEdit2;
} }
else if(send == Group1->PushButton3) { else if(send == PushButton3) {
Group1->LineEdit3->setFocus(); LineEdit3->setFocus();
myEditCurrentArgument = Group1->LineEdit3; myEditCurrentArgument = LineEdit3;
} }
SelectionIntoArgument(); SelectionIntoArgument();
@ -244,12 +346,12 @@ void KinematicGUI_ContactDlg::SetEditCurrentArgument()
void KinematicGUI_ContactDlg::LineEditReturnPressed() void KinematicGUI_ContactDlg::LineEditReturnPressed()
{ {
QLineEdit* send = (QLineEdit*)sender(); QLineEdit* send = (QLineEdit*)sender();
if(send == Group1->LineEdit1) if(send == LineEdit1)
myEditCurrentArgument = Group1->LineEdit1; myEditCurrentArgument = LineEdit1;
else if(send == Group1->LineEdit2) else if(send == LineEdit2)
myEditCurrentArgument = Group1->LineEdit2; myEditCurrentArgument = LineEdit2;
else if(send == Group1->LineEdit3) else if(send == LineEdit3)
myEditCurrentArgument = Group1->LineEdit3; myEditCurrentArgument = LineEdit3;
else else
return; return;
@ -289,6 +391,26 @@ void KinematicGUI_ContactDlg::enterEvent(QEvent * e)
//================================================================================= //=================================================================================
void KinematicGUI_ContactDlg::ComboTextChanged() 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; return;
} }

View File

@ -30,7 +30,7 @@
#define DIALOGBOX_CONTACT_H #define DIALOGBOX_CONTACT_H
#include "GEOMBase_Skeleton.h" #include "GEOMBase_Skeleton.h"
#include "KinematicGUI_3Sel1List_QTD.h" #include "DlgRef_SpinBox.h"
#include "KinematicGUI.h" #include "KinematicGUI.h"
@ -43,7 +43,7 @@ class KinematicGUI_ContactDlg : public GEOMBase_Skeleton
Q_OBJECT Q_OBJECT
public: 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(); ~KinematicGUI_ContactDlg();
private: private:
@ -59,8 +59,23 @@ private:
bool myOkShape1; bool myOkShape1;
bool myOkShape2; /* to check when arguments are defined */ bool myOkShape2; /* to check when arguments are defined */
int myType; 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: private slots:
void ClickOnOk(); void ClickOnOk();
@ -70,6 +85,13 @@ private slots:
void LineEditReturnPressed(); void LineEditReturnPressed();
void ActivateThisDialog(); void ActivateThisDialog();
void ComboTextChanged(); void ComboTextChanged();
void ValueChangedInSpinBox(double newValue);
protected:
QGridLayout* GroupBox1Layout;
QGridLayout* LayoutA;
QGridLayout* LayoutB;
QGridLayout* LayoutC;
}; };

View File

@ -1,286 +0,0 @@
// 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;
}

View File

@ -118,12 +118,20 @@ void KinematicGUI_PositionDlg::Init()
if(!testResult) if(!testResult)
ClickOnCancel(); ClickOnCancel();
myGeomPosition = GEOM::GEOM_Position::_narrow(myGeomContact->GetPosition()); GEOM::ListOfDouble_var aList = myGeomContact->GetPosition();
P0 = myGeomPosition->GetOrigin(); P0.x = aList[0];
VX = myGeomPosition->GetVX(); P0.y = aList[1];
VY = myGeomPosition->GetVY(); P0.z = aList[2];
VZ = myGeomPosition->GetVZ(); 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_11->SetValue(P0.x);
Group1->SpinBox_12->SetValue(P0.y); Group1->SpinBox_12->SetValue(P0.y);
@ -177,7 +185,7 @@ void KinematicGUI_PositionDlg::Init()
//================================================================================= //=================================================================================
// function : InitValues() // function : SetEnabledValues()
// purpose : // purpose :
//================================================================================= //=================================================================================
void KinematicGUI_PositionDlg::SetEnabledValues() void KinematicGUI_PositionDlg::SetEnabledValues()
@ -185,52 +193,33 @@ void KinematicGUI_PositionDlg::SetEnabledValues()
int type = myGeomContact->GetType(); int type = myGeomContact->GetType();
if(type == 0) { //EMBEDDING if(type == 0) { //EMBEDDING
Group1->SpinBox_21->setEnabled(false); Group1->SpinBox_21->hide();
Group1->SpinBox_22->setEnabled(false); Group1->SpinBox_22->hide();
Group1->SpinBox_23->setEnabled(false); Group1->SpinBox_23->hide();
Group1->SpinBox_31->setEnabled(false); Group1->TextLabel5->hide();
Group1->SpinBox_32->setEnabled(false); Group1->TextLabel6->hide();
Group1->SpinBox_33->setEnabled(false); Group1->TextLabel7->hide();
Group1->SpinBox_41->setEnabled(false); Group1->TextLabel8->hide();
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);
} }
else if(type == 1 || type == 3 || type == 5 || type == 9) { //PIVOT || SLIDING PIVOT || PLANE || HELICOIDAL
Group1->SpinBox_31->setEnabled(false); if(type == 0 || type == 1 || type == 3 || type == 5 || type == 9) { //EMBEDDING || PIVOT || SLIDING PIVOT || PLANE || HELICOIDAL
Group1->SpinBox_32->setEnabled(false); Group1->SpinBox_31->hide();
Group1->SpinBox_33->setEnabled(false); Group1->SpinBox_32->hide();
Group1->SpinBox_41->setEnabled(false); Group1->SpinBox_33->hide();
Group1->SpinBox_42->setEnabled(false); Group1->TextLabel9->hide();
Group1->SpinBox_43->setEnabled(false); Group1->TextLabel10->hide();
Group1->TextLabel9->setEnabled(false); Group1->TextLabel11->hide();
Group1->TextLabel10->setEnabled(false); Group1->TextLabel12->hide();
Group1->TextLabel11->setEnabled(false);
Group1->TextLabel12->setEnabled(false);
Group1->TextLabel13->setEnabled(false);
Group1->TextLabel14->setEnabled(false);
Group1->TextLabel15->setEnabled(false);
Group1->TextLabel16->setEnabled(false);
} }
else if(type == 7) { //RECTILINEAR
Group1->SpinBox_41->setEnabled(false); if(type == 0 || type == 1 || type == 3 || type == 5 || type == 7 || type == 9) { //EMBEDDING || PIVOT || SLIDING PIVOT || PLANE || RECTILINEAR || HELICOIDAL
Group1->SpinBox_42->setEnabled(false); Group1->SpinBox_41->hide();
Group1->SpinBox_43->setEnabled(false); Group1->SpinBox_42->hide();
Group1->TextLabel13->setEnabled(false); Group1->SpinBox_43->hide();
Group1->TextLabel14->setEnabled(false); Group1->TextLabel13->hide();
Group1->TextLabel15->setEnabled(false); Group1->TextLabel14->hide();
Group1->TextLabel16->setEnabled(false); Group1->TextLabel15->hide();
Group1->TextLabel16->hide();
} }
return; return;

Some files were not shown because too many files have changed in this diff Show More