diff --git a/INSTALL b/INSTALL
index 2b4b66d6e..6fe7d777b 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,3 +1,3 @@
-This is the version 1.3.0 of GEOM
+This is the version 1.4.0 of GEOM
Compatible with :
- - KERNEL 1.3.0
+ - KERNEL 1.4.0
diff --git a/Makefile.in b/Makefile.in
index 3657e2248..65bc47c44 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -21,8 +21,10 @@ GEOM_en.xml \
GEOM_fr.xml \
GEOMCatalog.xml \
GEOMDS_Resources \
+animation.png \
arc.png \
archimede.png \
+assembly.png \
axisinertia.png \
basicproperties.png \
bounding.png \
@@ -47,6 +49,7 @@ common.png \
cone.png \
conedxyz.png \
conepointvector.png \
+contact.png \
cut.png \
cylinder.png \
cylinderdxyz.png \
@@ -109,8 +112,11 @@ torus.png \
torusdxyz.png \
toruspointvector.png \
translation.png \
+tree_animation.png \
+tree_assembly.png \
tree_compound.png \
tree_compsolid.png \
+tree_contact.png \
tree_edge.png \
tree_face.png \
tree_shape.png \
diff --git a/bin/VERSION b/bin/VERSION
index 6156fe3ca..1b77509ae 100755
--- a/bin/VERSION
+++ b/bin/VERSION
@@ -1 +1 @@
-THIS IS SALOME - GEOM VERSION: 1.3.0
+THIS IS SALOME - GEOM VERSION: 1.4.0
diff --git a/doc/html/INPUT/doxyfile b/doc/html/INPUT/doxyfile
index 90395f67f..2a891be10 100755
--- a/doc/html/INPUT/doxyfile
+++ b/doc/html/INPUT/doxyfile
@@ -3,7 +3,7 @@
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "SALOME - GEOM - v.1.3.0"
+PROJECT_NAME = "SALOME - GEOM - v.1.4.0"
PROJECT_NUMBER = id#1.1
OUTPUT_DIRECTORY = ../
OUTPUT_LANGUAGE = English
diff --git a/doc/html/INPUT/sources/static/tree.js b/doc/html/INPUT/sources/static/tree.js
index c744f4641..3fb69102c 100755
--- a/doc/html/INPUT/sources/static/tree.js
+++ b/doc/html/INPUT/sources/static/tree.js
@@ -1,4 +1,4 @@
-foldersTree = gFld("SALOME v.1.3.0 ", "", "")
+foldersTree = gFld("SALOME v.1.4.0 ", "", "")
insDoc(foldersTree, gLnk("Main Page", "", "main.html"))
aux1 = insFld(foldersTree, gFld("TUI Reference Guide", ""))
diff --git a/doc/html/Makefile.in b/doc/html/Makefile.in
index 9a87b93ab..135b2daef 100644
--- a/doc/html/Makefile.in
+++ b/doc/html/Makefile.in
@@ -32,6 +32,7 @@ distclean: clean
rm -rf INPUT
install:
+ $(INSTALL) -d $(docdir); \
cp -rf html $(docdir)
uninstall:
diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl
index 12eff04d7..b9374bfc7 100644
--- a/idl/GEOM_Gen.idl
+++ b/idl/GEOM_Gen.idl
@@ -29,6 +29,7 @@
#include "SALOME_Component.idl"
#include "SALOMEDS.idl"
#include "GEOM_Shape.idl"
+#include "GEOM_Kinematic.idl"
module GEOM
{
@@ -315,11 +316,29 @@ module GEOM
void ExportIGES(in string filename,in GEOM_Shape theShape) raises (SALOME::SALOME_Exception) ;
void ExportBREP(in string filename,in GEOM_Shape theShape) raises (SALOME::SALOME_Exception) ;
void ExportSTEP(in string filename,in GEOM_Shape theShape) raises (SALOME::SALOME_Exception) ;
+
//-----------------------------------------------------------//
// Check Shape //
//-----------------------------------------------------------//
boolean CheckShape(in GEOM_Shape shape) raises (SALOME::SALOME_Exception) ;
+ //-----------------------------------------------------------//
+ // Kinematic //
+ //-----------------------------------------------------------//
+ GEOM_Assembly InitAssembly() raises (SALOME::SALOME_Exception) ;
+
+ GEOM_Contact AddContact(in GEOM_Assembly Ass,
+ in GEOM_Shape Shape1,
+ in GEOM_Shape Shape2,
+ in short type,
+ in double step) raises (SALOME::SALOME_Exception) ;
+
+ GEOM_Animation AddAnimation(in GEOM_Assembly Ass,
+ in GEOM_Shape Shape1,
+ in double Duration,
+ in short NbSeq,
+ in boolean IsInLoop) raises (SALOME::SALOME_Exception) ;
+
};
};
diff --git a/idl/GEOM_Kinematic.idl b/idl/GEOM_Kinematic.idl
new file mode 100644
index 000000000..671597ac1
--- /dev/null
+++ b/idl/GEOM_Kinematic.idl
@@ -0,0 +1,195 @@
+// 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.idl
+// Author : Damien COQUERET
+
+#ifndef __GEOM_Kinematic__
+#define __GEOM_Kinematic__
+
+#include "SALOME_Exception.idl"
+#include "GEOM_Shape.idl"
+
+module GEOM
+{
+
+ interface GEOM_Contact;
+ typedef sequence ListOfContact;
+
+ //-----------------------------------------------------------------//
+ // interface GEOM_Position methods //
+ //-----------------------------------------------------------------//
+ interface GEOM_Position {
+
+ void SetOrigin(in GEOM::PointStruct P0)
+ raises (SALOME::SALOME_Exception);
+
+ void SetVX(in GEOM::DirStruct Vect)
+ raises (SALOME::SALOME_Exception);
+
+ void SetVY(in GEOM::DirStruct Vect)
+ raises (SALOME::SALOME_Exception);
+
+ void SetVZ(in GEOM::DirStruct Vect)
+ raises (SALOME::SALOME_Exception);
+
+ GEOM::PointStruct GetOrigin()
+ raises (SALOME::SALOME_Exception);
+
+ GEOM::DirStruct GetVX()
+ raises (SALOME::SALOME_Exception);
+
+ GEOM::DirStruct GetVY()
+ raises (SALOME::SALOME_Exception);
+
+ GEOM::DirStruct GetVZ()
+ raises (SALOME::SALOME_Exception);
+
+ };
+
+ //-----------------------------------------------------------------//
+ // interface GEOM_Rotation methods //
+ //-----------------------------------------------------------------//
+ interface GEOM_Rotation {
+
+ void SetRotation(in long Rot1, in long Rot2, in long Rot3,
+ in double Val1, in double Val2, in double Val3)
+ raises (SALOME::SALOME_Exception);
+
+ long GetRot1()
+ raises (SALOME::SALOME_Exception);
+ long GetRot2()
+ raises (SALOME::SALOME_Exception);
+ long GetRot3()
+ raises (SALOME::SALOME_Exception);
+
+ double GetVal1()
+ raises (SALOME::SALOME_Exception);
+ double GetVal2()
+ raises (SALOME::SALOME_Exception);
+ double GetVal3()
+ raises (SALOME::SALOME_Exception);
+
+ };
+
+ //-----------------------------------------------------------------//
+ // interface GEOM_Translation methods //
+ //-----------------------------------------------------------------//
+ interface GEOM_Translation {
+
+ void SetTranslation(in double Val1, in double Val2, in double Val3)
+ raises (SALOME::SALOME_Exception);
+
+ double GetVal1()
+ raises (SALOME::SALOME_Exception);
+ double GetVal2()
+ raises (SALOME::SALOME_Exception);
+ double GetVal3()
+ raises (SALOME::SALOME_Exception);
+
+ };
+
+ //-----------------------------------------------------------------//
+ // interface GEOM_Assembly methods //
+ //-----------------------------------------------------------------//
+ interface GEOM_Assembly {
+
+ void AddContact(in GEOM::GEOM_Contact aContact)
+ raises (SALOME::SALOME_Exception);
+
+ GEOM::ListOfContact GetContactList()
+ raises (SALOME::SALOME_Exception);
+
+ long NbContacts()
+ raises (SALOME::SALOME_Exception);
+
+ attribute string Name;
+ attribute string ShapeId;
+ attribute string StudyShapeId;
+
+ GEOM_Gen Engine();
+
+ };
+
+ //-----------------------------------------------------------------//
+ // interface GEOM_Contact methods //
+ //-----------------------------------------------------------------//
+ interface GEOM_Contact {
+
+ long GetType()
+ raises (SALOME::SALOME_Exception);
+
+ GEOM::GEOM_Shape GetShape1()
+ raises (SALOME::SALOME_Exception);
+
+ GEOM::GEOM_Shape GetShape2()
+ raises (SALOME::SALOME_Exception);
+
+ double GetStep()
+ raises (SALOME::SALOME_Exception);
+
+ GEOM::GEOM_Position GetPosition()
+ raises (SALOME::SALOME_Exception);
+
+ GEOM::GEOM_Rotation GetRotation()
+ raises (SALOME::SALOME_Exception);
+
+ GEOM::GEOM_Translation GetTranslation()
+ raises (SALOME::SALOME_Exception);
+
+ attribute string Name;
+ attribute string ShapeId;
+ attribute string StudyShapeId;
+
+ GEOM_Gen Engine();
+
+ };
+
+ //-----------------------------------------------------------------//
+ // interface GEOM_Animation methods //
+ //-----------------------------------------------------------------//
+ interface GEOM_Animation {
+
+ GEOM::GEOM_Assembly GetAssembly()
+ raises (SALOME::SALOME_Exception);
+
+ GEOM::GEOM_Shape GetFrame()
+ raises (SALOME::SALOME_Exception);
+
+ double GetDuration()
+ raises (SALOME::SALOME_Exception);
+
+ long GetNbSeq()
+ raises (SALOME::SALOME_Exception);
+
+ boolean GetIsInLoop()
+ raises (SALOME::SALOME_Exception);
+
+ attribute string Name;
+ attribute string ShapeId;
+ attribute string StudyShapeId;
+
+ GEOM_Gen Engine();
+
+ };
+
+};
+#endif
diff --git a/idl/Makefile.in b/idl/Makefile.in
index 1d0b5c6cc..802d6f857 100644
--- a/idl/Makefile.in
+++ b/idl/Makefile.in
@@ -12,6 +12,7 @@ VPATH=.:$(srcdir):${KERNEL_ROOT_DIR}/idl/salome
IDL_FILES = \
GEOM_Shape.idl \
+ GEOM_Kinematic.idl \
GEOM_Gen.idl
PY_CLIENT_IDL = $(IDL_FILES)
diff --git a/resources/GEOM_en.xml b/resources/GEOM_en.xml
index 1b6fdcc20..4a0727573 100644
--- a/resources/GEOM_en.xml
+++ b/resources/GEOM_en.xml
@@ -136,8 +136,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -155,6 +176,7 @@
+
@@ -175,6 +197,7 @@
+
@@ -257,6 +280,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/resources/animation.png b/resources/animation.png
new file mode 100644
index 000000000..545ac6c70
Binary files /dev/null and b/resources/animation.png differ
diff --git a/resources/assembly.png b/resources/assembly.png
new file mode 100644
index 000000000..87c6bdd52
Binary files /dev/null and b/resources/assembly.png differ
diff --git a/resources/contact.png b/resources/contact.png
new file mode 100644
index 000000000..4ae105f9e
Binary files /dev/null and b/resources/contact.png differ
diff --git a/resources/tree_animation.png b/resources/tree_animation.png
new file mode 100644
index 000000000..874f02f18
Binary files /dev/null and b/resources/tree_animation.png differ
diff --git a/resources/tree_assembly.png b/resources/tree_assembly.png
new file mode 100644
index 000000000..7fa72374b
Binary files /dev/null and b/resources/tree_assembly.png differ
diff --git a/resources/tree_contact.png b/resources/tree_contact.png
new file mode 100644
index 000000000..be3238d27
Binary files /dev/null and b/resources/tree_contact.png differ
diff --git a/src/BasicGUI/Makefile.in b/src/BasicGUI/Makefile.in
index 2dc8edf1b..0c1125f60 100644
--- a/src/BasicGUI/Makefile.in
+++ b/src/BasicGUI/Makefile.in
@@ -61,7 +61,7 @@ LIB_MOC = \
BasicGUI_PlaneDlg.h \
BasicGUI_WorkingPlaneDlg.h
-LIB_CLIENT_IDL =
+LIB_CLIENT_IDL = GEOM_Kinematic.idl
LIB_SERVER_IDL =
diff --git a/src/BooleanGUI/BooleanGUI_CommonDlg.cxx b/src/BooleanGUI/BooleanGUI_CommonDlg.cxx
index 7e881536f..db7b47d14 100644
--- a/src/BooleanGUI/BooleanGUI_CommonDlg.cxx
+++ b/src/BooleanGUI/BooleanGUI_CommonDlg.cxx
@@ -85,9 +85,6 @@ void BooleanGUI_CommonDlg::Init()
{
/* init variables */
myEditCurrentArgument = GroupCommon->LineEdit1;
-
- myShape1.Nullify();
- myShape2.Nullify();
myOkShape1 = myOkShape2 = false;
/* signals and slots connections */
@@ -167,7 +164,6 @@ void BooleanGUI_CommonDlg::SelectionIntoArgument()
myGeomShape1 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult)
return;
- myShape1 = S;
GroupCommon->LineEdit1->setText(aString);
myOkShape1 = true;
}
@@ -175,7 +171,6 @@ void BooleanGUI_CommonDlg::SelectionIntoArgument()
myGeomShape2 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult)
return;
- myShape2 = S;
GroupCommon->LineEdit2->setText(aString);
myOkShape2 = true;
}
diff --git a/src/BooleanGUI/BooleanGUI_CommonDlg.h b/src/BooleanGUI/BooleanGUI_CommonDlg.h
index f592e6df0..cb3b805f5 100644
--- a/src/BooleanGUI/BooleanGUI_CommonDlg.h
+++ b/src/BooleanGUI/BooleanGUI_CommonDlg.h
@@ -54,8 +54,6 @@ private:
BooleanGUI* myBooleanGUI;
- TopoDS_Shape myShape1; /* topology used */
- TopoDS_Shape myShape2; /* topology used */
GEOM::GEOM_Shape_var myGeomShape1; /* is myShape1 */
GEOM::GEOM_Shape_var myGeomShape2; /* is myShape2 */
bool myOkShape1;
diff --git a/src/BooleanGUI/BooleanGUI_CutDlg.cxx b/src/BooleanGUI/BooleanGUI_CutDlg.cxx
index d3aaf9785..1cc08269d 100644
--- a/src/BooleanGUI/BooleanGUI_CutDlg.cxx
+++ b/src/BooleanGUI/BooleanGUI_CutDlg.cxx
@@ -84,9 +84,6 @@ void BooleanGUI_CutDlg::Init()
{
/* init variables */
myEditCurrentArgument = GroupCut->LineEdit1;
-
- myShape1.Nullify();
- myShape2.Nullify();
myOkShape1 = myOkShape2 = false;
/* signals and slots connections */
@@ -166,7 +163,6 @@ void BooleanGUI_CutDlg::SelectionIntoArgument()
myGeomShape1 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult)
return;
- myShape1 = S;
GroupCut->LineEdit1->setText(aString);
myOkShape1 = true;
}
@@ -174,7 +170,6 @@ void BooleanGUI_CutDlg::SelectionIntoArgument()
myGeomShape2 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult)
return;
- myShape2 = S;
GroupCut->LineEdit2->setText(aString);
myOkShape2 = true;
}
diff --git a/src/BooleanGUI/BooleanGUI_CutDlg.h b/src/BooleanGUI/BooleanGUI_CutDlg.h
index 46738f7f3..212bdb176 100644
--- a/src/BooleanGUI/BooleanGUI_CutDlg.h
+++ b/src/BooleanGUI/BooleanGUI_CutDlg.h
@@ -54,8 +54,6 @@ private:
BooleanGUI* myBooleanGUI;
- TopoDS_Shape myShape1; /* topology used to fuse */
- TopoDS_Shape myShape2; /* topology used to fuse */
GEOM::GEOM_Shape_var myGeomShape1; /* is myShape1 */
GEOM::GEOM_Shape_var myGeomShape2; /* is myShape2 */
bool myOkShape1; /* to check when arguments are defined */
diff --git a/src/BooleanGUI/BooleanGUI_FuseDlg.cxx b/src/BooleanGUI/BooleanGUI_FuseDlg.cxx
index 14a741cc3..ea9ae1b3a 100644
--- a/src/BooleanGUI/BooleanGUI_FuseDlg.cxx
+++ b/src/BooleanGUI/BooleanGUI_FuseDlg.cxx
@@ -84,9 +84,6 @@ void BooleanGUI_FuseDlg::Init()
{
/* init variables */
myEditCurrentArgument = GroupFuse->LineEdit1;
-
- myShape1.Nullify();
- myShape2.Nullify();
myOkShape1 = myOkShape2 = false;
/* signals and slots connections */
@@ -166,7 +163,6 @@ void BooleanGUI_FuseDlg::SelectionIntoArgument()
myGeomShape1 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult)
return;
- myShape1 = S;
GroupFuse->LineEdit1->setText(aString);
myOkShape1 = true;
}
@@ -174,7 +170,6 @@ void BooleanGUI_FuseDlg::SelectionIntoArgument()
myGeomShape2 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult)
return;
- myShape2 = S;
GroupFuse->LineEdit2->setText(aString);
myOkShape2 = true;
}
diff --git a/src/BooleanGUI/BooleanGUI_FuseDlg.h b/src/BooleanGUI/BooleanGUI_FuseDlg.h
index 799eb0b9d..6898e64aa 100644
--- a/src/BooleanGUI/BooleanGUI_FuseDlg.h
+++ b/src/BooleanGUI/BooleanGUI_FuseDlg.h
@@ -54,8 +54,6 @@ private:
BooleanGUI* myBooleanGUI;
- TopoDS_Shape myShape1; /* topology used to fuse */
- TopoDS_Shape myShape2; /* topology used to fuse */
GEOM::GEOM_Shape_var myGeomShape1; /* is myShape1 */
GEOM::GEOM_Shape_var myGeomShape2; /* is myShape2 */
bool myOkShape1; /* to check when arguments are defined */
diff --git a/src/BooleanGUI/BooleanGUI_SectionDlg.cxx b/src/BooleanGUI/BooleanGUI_SectionDlg.cxx
index d2c1c6a4a..51bae1f9e 100644
--- a/src/BooleanGUI/BooleanGUI_SectionDlg.cxx
+++ b/src/BooleanGUI/BooleanGUI_SectionDlg.cxx
@@ -85,9 +85,6 @@ void BooleanGUI_SectionDlg::Init()
{
/* init variables */
myEditCurrentArgument = GroupSection->LineEdit1;
-
- myShape1.Nullify();
- myShape2.Nullify();
myOkShape1 = myOkShape2 = false;
/* signals and slots connections */
@@ -167,7 +164,6 @@ void BooleanGUI_SectionDlg::SelectionIntoArgument()
myGeomShape1 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult)
return;
- myShape1 = S;
GroupSection->LineEdit1->setText(aString);
myOkShape1 = true;
}
@@ -175,7 +171,6 @@ void BooleanGUI_SectionDlg::SelectionIntoArgument()
myGeomShape2 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult)
return;
- myShape2 = S;
GroupSection->LineEdit2->setText(aString);
myOkShape2 = true;
}
diff --git a/src/BooleanGUI/BooleanGUI_SectionDlg.h b/src/BooleanGUI/BooleanGUI_SectionDlg.h
index badf2afdf..ef1f35282 100644
--- a/src/BooleanGUI/BooleanGUI_SectionDlg.h
+++ b/src/BooleanGUI/BooleanGUI_SectionDlg.h
@@ -54,8 +54,6 @@ private:
BooleanGUI* myBooleanGUI;
- TopoDS_Shape myShape1; /* topology used to fuse */
- TopoDS_Shape myShape2; /* topology used to fuse */
GEOM::GEOM_Shape_var myGeomShape1; /* is myShape1 */
GEOM::GEOM_Shape_var myGeomShape2; /* is myShape2 */
bool myOkShape1; /* to check when arguments are defined */
diff --git a/src/BooleanGUI/Makefile.in b/src/BooleanGUI/Makefile.in
index 92de526ff..ae4412ecc 100644
--- a/src/BooleanGUI/Makefile.in
+++ b/src/BooleanGUI/Makefile.in
@@ -53,7 +53,7 @@ LIB_MOC = \
BooleanGUI_CutDlg.h \
BooleanGUI_SectionDlg.h
-LIB_CLIENT_IDL =
+LIB_CLIENT_IDL = GEOM_Kinematic.idl
LIB_SERVER_IDL =
diff --git a/src/BuildGUI/Makefile.in b/src/BuildGUI/Makefile.in
index 3b29f7b59..e85330400 100644
--- a/src/BuildGUI/Makefile.in
+++ b/src/BuildGUI/Makefile.in
@@ -57,7 +57,7 @@ LIB_MOC = \
BuildGUI_SolidDlg.h \
BuildGUI_CompoundDlg.h
-LIB_CLIENT_IDL =
+LIB_CLIENT_IDL = GEOM_Kinematic.idl
LIB_SERVER_IDL =
diff --git a/src/DisplayGUI/DisplayGUI.cxx b/src/DisplayGUI/DisplayGUI.cxx
index b42972f89..45dc97b16 100644
--- a/src/DisplayGUI/DisplayGUI.cxx
+++ b/src/DisplayGUI/DisplayGUI.cxx
@@ -232,6 +232,11 @@ void DisplayGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theIO
if(theIO.IsNull())
MESSAGE("BuildPresentation(): null SALOME_InteractiveObject passed")
+ Standard_Boolean testResult;
+ GEOM::GEOM_Shape_var myGeomShape = myDisplayGUI->myGeomBase->ConvertIOinGEOMShape(theIO, testResult);
+ if(!testResult)
+ return;
+
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
// VTK
@@ -440,6 +445,7 @@ void DisplayGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theIO
}
Handle(GEOM_AISShape) aSh = new GEOM_AISShape(Shape, aName->Value());
aSh->SetShadingColor(myDisplayGUI->myGeomBase->myShadingColor);
+ aSh->SetInfiniteState(Shape.Infinite());
Handle(GEOM_InteractiveObject) IO = new GEOM_InteractiveObject(anIOR->Value(), myDisplayGUI->myGeomGUI->GetFatherior(), "GEOM");
IO->setEntry(obj->GetID());
aSh->setIO(IO);
diff --git a/src/DisplayGUI/Makefile.in b/src/DisplayGUI/Makefile.in
index d1cd6aa6a..8be49b7af 100644
--- a/src/DisplayGUI/Makefile.in
+++ b/src/DisplayGUI/Makefile.in
@@ -45,7 +45,7 @@ LIB_SRC = DisplayGUI.cxx
LIB_MOC = \
DisplayGUI.h
-LIB_CLIENT_IDL = SALOME_Exception.idl
+LIB_CLIENT_IDL = SALOME_Exception.idl GEOM_Kinematic.idl
LIB_SERVER_IDL =
diff --git a/src/EntityGUI/EntityGUI_SubShapeDlg.cxx b/src/EntityGUI/EntityGUI_SubShapeDlg.cxx
index 28923363f..b782a2bd2 100644
--- a/src/EntityGUI/EntityGUI_SubShapeDlg.cxx
+++ b/src/EntityGUI/EntityGUI_SubShapeDlg.cxx
@@ -198,7 +198,7 @@ void EntityGUI_SubShapeDlg::ClickOnApply()
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
/* Reset all arguments and local context to allow user a new selection ...*/
- this->ResetStateOfDialog();
+ //this->ResetStateOfDialog();
return;
}
diff --git a/src/EntityGUI/Makefile.in b/src/EntityGUI/Makefile.in
index 3883eebab..7a82dddd1 100644
--- a/src/EntityGUI/Makefile.in
+++ b/src/EntityGUI/Makefile.in
@@ -47,7 +47,7 @@ LIB_MOC = \
EntityGUI.h \
EntityGUI_SubShapeDlg.h
-LIB_CLIENT_IDL =
+LIB_CLIENT_IDL = GEOM_Kinematic.idl
LIB_SERVER_IDL =
diff --git a/src/GEOM/GEOM_Animation_i.cc b/src/GEOM/GEOM_Animation_i.cc
new file mode 100644
index 000000000..2710a7fb4
--- /dev/null
+++ b/src/GEOM/GEOM_Animation_i.cc
@@ -0,0 +1,174 @@
+// 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_Animation_i.cc
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header$
+
+using namespace std;
+#include "GEOM_Animation_i.hh"
+
+//=================================================================================
+// function : GEOM_Animation_i() constructor (no arguments)
+// purpose : for what now ?
+//=================================================================================
+GEOM_Animation_i::GEOM_Animation_i()
+{
+}
+
+
+//=================================================================================
+// function : constructor
+// purpose : constructor for servant creation
+//=================================================================================
+GEOM_Animation_i::GEOM_Animation_i(Kinematic_Animation* Animation,
+ GEOM::GEOM_Assembly_ptr Ass,
+ GEOM::GEOM_Shape_ptr Frame,
+ CORBA::ORB_ptr orb,
+ GEOM::GEOM_Gen_ptr engine)
+{
+ _Animation = Animation;
+ _Ass = GEOM::GEOM_Assembly::_duplicate(Ass);
+ _Frame = GEOM::GEOM_Shape::_duplicate(Frame);
+
+ _orb = orb;
+ _engine = engine;
+
+ _shapeid = "";
+ _studyshapeid = "";
+
+ _name = "";
+}
+
+
+//=================================================================================
+// function : destructor
+// purpose :
+//=================================================================================
+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 : GetDuration()
+// purpose :
+//=================================================================================
+CORBA::Long GEOM_Animation_i::GetNbSeq() throw(SALOME::SALOME_Exception)
+{
+ return _Animation->NbSeq();
+}
+
+
+//=================================================================================
+// function : GetDuration()
+// purpose :
+//=================================================================================
+CORBA::Boolean GEOM_Animation_i::GetIsInLoop() throw(SALOME::SALOME_Exception)
+{
+ return _Animation->IsInLoop();
+}
+
+
+//=================================================================================
+// function : Name (set method)
+// purpose : to set the attribute 'name'.
+// : WARNING : Register to naming service actually removed !
+//=================================================================================
+void GEOM_Animation_i::Name(const char* name)
+{
+ _name = strdup(name);
+ GEOM::GEOM_Animation_ptr g = GEOM::GEOM_Animation::_narrow(_this());
+}
+
+
+//=================================================================================
+// function : Name (get method)
+// purpose : to get the attribute 'name' of this shape
+//=================================================================================
+char* GEOM_Animation_i::Name() { return strdup(_name); }
+
+
+//=================================================================================
+// function : ShapeId
+// purpose : to get the id of this shape from GEOM (OCAF entry)
+//=================================================================================
+char* GEOM_Animation_i::ShapeId() { return strdup(_shapeid); }
+
+
+//=================================================================================
+// function : ShapeId (set method)
+// purpose : to set the id of this shape in GEOM/OCAF doc
+//=================================================================================
+void GEOM_Animation_i::ShapeId(const char * shapeid) { _shapeid = strdup(shapeid); }
+
+
+//=================================================================================
+// function : StudyShapeId (get method)
+// purpose : to get the id of this shape from the study document (OCAF entry)
+//=================================================================================
+char* GEOM_Animation_i::StudyShapeId() { return strdup(_studyshapeid) ; }
+
+
+//=================================================================================
+// function : StudyShapeId (set method)
+// purpose : to set the id of this shape in the Study document (OCAF entry)
+//=================================================================================
+void GEOM_Animation_i::StudyShapeId(const char * studyshapeid)
+{ _studyshapeid = strdup(studyshapeid); }
+
+
+//=======================================================================
+//function : Engine
+//purpose : return generator engine
+//=======================================================================
+GEOM::GEOM_Gen_ptr GEOM_Animation_i::Engine() { return _engine; }
diff --git a/src/GEOM/GEOM_Animation_i.hh b/src/GEOM/GEOM_Animation_i.hh
new file mode 100644
index 000000000..24f6a1113
--- /dev/null
+++ b/src/GEOM/GEOM_Animation_i.hh
@@ -0,0 +1,97 @@
+// 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_Animation_i.hh
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header$
+
+#ifndef __GEOM_ANIMATION_I_H__
+#define __GEOM_ANIMATION_I_H__
+
+// IDL headers
+#include
+#include CORBA_SERVER_HEADER(GEOM_Gen)
+#include CORBA_SERVER_HEADER(GEOM_Shape)
+#include CORBA_SERVER_HEADER(GEOM_Kinematic)
+
+#include "GEOM_Shape_i.hh"
+#include "Kinematic_Animation.hxx"
+
+//=====================================================================
+// GEOM_Animation_i : class definition
+//=====================================================================
+class GEOM_Animation_i:
+ public POA_GEOM::GEOM_Animation
+{
+public:
+ GEOM_Animation_i();
+ GEOM_Animation_i(Kinematic_Animation* Animation,
+ GEOM::GEOM_Assembly_ptr Ass,
+ GEOM::GEOM_Shape_ptr Frame,
+ CORBA::ORB_ptr orb,
+ GEOM::GEOM_Gen_ptr engine);
+
+ ~GEOM_Animation_i();
+
+private:
+ Kinematic_Animation* _Animation;
+ GEOM::GEOM_Assembly_ptr _Ass;
+ GEOM::GEOM_Shape_ptr _Frame;
+ CORBA::ORB_ptr _orb;
+ GEOM::GEOM_Gen_ptr _engine;
+
+ char* _name;
+ char* _shapeid;
+ char* _studyshapeid; // exists only if added in the study document
+
+public:
+ GEOM::GEOM_Assembly_ptr GetAssembly()
+ throw (SALOME::SALOME_Exception);
+
+ GEOM::GEOM_Shape_ptr GetFrame()
+ throw (SALOME::SALOME_Exception);
+
+ CORBA::Double GetDuration()
+ throw (SALOME::SALOME_Exception);
+
+ CORBA::Long GetNbSeq()
+ throw (SALOME::SALOME_Exception);
+
+ CORBA::Boolean GetIsInLoop()
+ throw (SALOME::SALOME_Exception);
+
+ char* Name();
+ void Name(const char* name);
+
+ char* ShapeId();
+ void ShapeId(const char* shapeid);
+
+ char* StudyShapeId();
+ void StudyShapeId(const char* studyshapeid);
+
+ GEOM::GEOM_Gen_ptr Engine();
+
+};
+
+#endif
diff --git a/src/GEOM/GEOM_Assembly_i.cc b/src/GEOM/GEOM_Assembly_i.cc
new file mode 100644
index 000000000..45dac4868
--- /dev/null
+++ b/src/GEOM/GEOM_Assembly_i.cc
@@ -0,0 +1,160 @@
+// 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_Assembly_i.cc
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header$
+
+using namespace std;
+#include "GEOM_Assembly_i.hh"
+
+//=================================================================================
+// function : GEOM_Assembly_i() constructor (no arguments)
+// purpose : for what now ?
+//=================================================================================
+GEOM_Assembly_i::GEOM_Assembly_i()
+{
+}
+
+
+//=================================================================================
+// function : constructor
+// purpose : constructor for servant creation
+//=================================================================================
+GEOM_Assembly_i::GEOM_Assembly_i(Kinematic_Assembly* Ass,
+ CORBA::ORB_ptr orb,
+ GEOM::GEOM_Gen_ptr engine)
+{
+ _Ass = Ass;
+ _orb = orb;
+ _engine = engine;
+
+ _aContactList.length(0);
+ _NbContact = 0;
+
+ _shapeid = "";
+ _studyshapeid = "";
+
+ _name = "";
+}
+
+
+//=================================================================================
+// function : destructor
+// purpose :
+//=================================================================================
+GEOM_Assembly_i::~GEOM_Assembly_i() { delete &_Ass; }
+
+
+//=================================================================================
+// function : AddContact()
+// purpose :
+//=================================================================================
+void GEOM_Assembly_i::AddContact(GEOM::GEOM_Contact_ptr aContact) throw(SALOME::SALOME_Exception)
+{
+ _aContactList.length(_NbContact + 1);
+ _aContactList[_NbContact] = GEOM::GEOM_Contact::_duplicate(aContact);
+ _NbContact++;
+
+ return;
+}
+
+//=================================================================================
+// function : GetContactList()
+// purpose :
+//=================================================================================
+GEOM::ListOfContact* GEOM_Assembly_i::GetContactList() throw(SALOME::SALOME_Exception)
+{
+ GEOM::ListOfContact_var aContactList = new GEOM::ListOfContact;
+ aContactList->length(_aContactList.length());
+ for(int i = 0; i < _NbContact; i++) {
+ aContactList[i] = GEOM::GEOM_Contact::_duplicate(_aContactList[i]);
+ }
+ return aContactList._retn();
+}
+
+
+//=================================================================================
+// function : NbContacts()
+// purpose :
+//=================================================================================
+CORBA::Long GEOM_Assembly_i::NbContacts() throw(SALOME::SALOME_Exception)
+{
+ return _NbContact;
+}
+
+
+//=================================================================================
+// function : Name (set method)
+// purpose : to set the attribute 'name'.
+// : 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); }
+
+
+//=======================================================================
+//function : Engine
+//purpose : return generator engine
+//=======================================================================
+GEOM::GEOM_Gen_ptr GEOM_Assembly_i::Engine() { return _engine; }
diff --git a/src/GEOM/GEOM_Assembly_i.hh b/src/GEOM/GEOM_Assembly_i.hh
new file mode 100644
index 000000000..c6348f890
--- /dev/null
+++ b/src/GEOM/GEOM_Assembly_i.hh
@@ -0,0 +1,89 @@
+// 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_Assembly_i.hh
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header$
+
+#ifndef __GEOM_ASSEMBLY_I_H__
+#define __GEOM_ASSEMBLY_I_H__
+
+// IDL headers
+#include
+#include CORBA_SERVER_HEADER(GEOM_Gen)
+#include CORBA_SERVER_HEADER(GEOM_Shape)
+#include CORBA_SERVER_HEADER(GEOM_Kinematic)
+
+#include "Kinematic_Assembly.hxx"
+
+//=====================================================================
+// GEOM_Assembly_i : class definition
+//=====================================================================
+class GEOM_Assembly_i:
+ public POA_GEOM::GEOM_Assembly
+{
+public:
+ GEOM_Assembly_i();
+ GEOM_Assembly_i(Kinematic_Assembly* Ass,
+ CORBA::ORB_ptr orb,
+ GEOM::GEOM_Gen_ptr engine);
+
+ ~GEOM_Assembly_i();
+
+private:
+ Kinematic_Assembly* _Ass;
+ CORBA::ORB_ptr _orb;
+ GEOM::GEOM_Gen_ptr _engine;
+
+ GEOM::ListOfContact _aContactList;
+ CORBA::Long _NbContact;
+
+ char* _name;
+ char* _shapeid;
+ char* _studyshapeid; // exists only if added in the study document
+
+public:
+ void AddContact(GEOM::GEOM_Contact_ptr aContact)
+ throw (SALOME::SALOME_Exception);
+
+ GEOM::ListOfContact* GetContactList()
+ throw (SALOME::SALOME_Exception);
+
+ CORBA::Long NbContacts()
+ throw (SALOME::SALOME_Exception);
+
+ char* Name();
+ void Name(const char* name);
+
+ char* ShapeId();
+ void ShapeId(const char* shapeid);
+
+ char* StudyShapeId();
+ void StudyShapeId(const char* studyshapeid);
+
+ GEOM::GEOM_Gen_ptr Engine();
+
+};
+
+#endif
diff --git a/src/GEOM/GEOM_Contact_i.cc b/src/GEOM/GEOM_Contact_i.cc
new file mode 100644
index 000000000..72fea1773
--- /dev/null
+++ b/src/GEOM/GEOM_Contact_i.cc
@@ -0,0 +1,212 @@
+// 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_Contact_i.cc
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header$
+
+using namespace std;
+#include "GEOM_Contact_i.hh"
+#include "GEOM_Position_i.hh"
+#include "GEOM_Rotation_i.hh"
+#include "GEOM_Translation_i.hh"
+
+//=================================================================================
+// function : GEOM_Contact_i() constructor (no arguments)
+// purpose : for what now ?
+//=================================================================================
+GEOM_Contact_i::GEOM_Contact_i()
+{
+}
+
+
+//=================================================================================
+// function : constructor
+// purpose : constructor for servant creation
+//=================================================================================
+GEOM_Contact_i::GEOM_Contact_i(Kinematic_Contact* Contact,
+ GEOM::GEOM_Shape_ptr Shape1,
+ GEOM::GEOM_Shape_ptr Shape2,
+ CORBA::ORB_ptr orb,
+ GEOM::GEOM_Gen_ptr engine)
+{
+ _Contact = Contact;
+ _Shape1 = GEOM::GEOM_Shape::_duplicate(Shape1);
+ _Shape2 = GEOM::GEOM_Shape::_duplicate(Shape2);
+
+ GEOM::PointStruct p0 = engine->MakePointStruct(0, 0, 0);
+ GEOM::PointStruct pX = engine->MakePointStruct(1, 0, 0);
+ GEOM::PointStruct pY = engine->MakePointStruct(0, 1, 0);
+ GEOM::PointStruct pZ = engine->MakePointStruct(0, 0, 1);
+ 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(1, 2, 3, 0, 0, 0);
+ _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());
+
+ _orb = orb;
+ _engine = engine;
+
+ _shapeid = "";
+ _studyshapeid = "";
+
+ _name = "";
+}
+
+
+//=================================================================================
+// function : destructor
+// purpose :
+//=================================================================================
+GEOM_Contact_i::~GEOM_Contact_i() { delete &_Contact; }
+
+
+//=================================================================================
+// function : GetType()
+// purpose :
+//=================================================================================
+CORBA::Long GEOM_Contact_i::GetType() throw(SALOME::SALOME_Exception)
+{
+ return _Contact->Type();
+}
+
+
+//=================================================================================
+// function : GetShape1()
+// purpose :
+//=================================================================================
+GEOM::GEOM_Shape_ptr GEOM_Contact_i::GetShape1() throw(SALOME::SALOME_Exception)
+{
+ return GEOM::GEOM_Shape::_duplicate(_Shape1);
+}
+
+
+//=================================================================================
+// function : GetShape2()
+// purpose :
+//=================================================================================
+GEOM::GEOM_Shape_ptr GEOM_Contact_i::GetShape2() throw(SALOME::SALOME_Exception)
+{
+ return GEOM::GEOM_Shape::_duplicate(_Shape2);
+}
+
+
+//=================================================================================
+// function : GetPosition()
+// purpose :
+//=================================================================================
+GEOM::GEOM_Position_ptr GEOM_Contact_i::GetPosition() throw(SALOME::SALOME_Exception)
+{
+ return GEOM::GEOM_Position::_duplicate(_Position);
+}
+
+
+//=================================================================================
+// function : GetRotation()
+// purpose :
+//=================================================================================
+GEOM::GEOM_Rotation_ptr GEOM_Contact_i::GetRotation() throw(SALOME::SALOME_Exception)
+{
+ return GEOM::GEOM_Rotation::_duplicate(_Rotation);
+}
+
+
+//=================================================================================
+// function : GetTranslation()
+// purpose :
+//=================================================================================
+GEOM::GEOM_Translation_ptr GEOM_Contact_i::GetTranslation() throw(SALOME::SALOME_Exception)
+{
+ return GEOM::GEOM_Translation::_duplicate(_Translation);
+}
+
+
+//=================================================================================
+// function : GetStep()
+// purpose :
+//=================================================================================
+CORBA::Double GEOM_Contact_i::GetStep() throw(SALOME::SALOME_Exception)
+{
+ return _Contact->Step();
+}
+
+
+//=================================================================================
+// function : Name (set method)
+// purpose : to set the attribute 'name'.
+// : WARNING : Register to naming service actually removed !
+//=================================================================================
+void GEOM_Contact_i::Name(const char* name)
+{
+ _name = strdup(name);
+ GEOM::GEOM_Contact_ptr g = GEOM::GEOM_Contact::_narrow(_this());
+}
+
+
+//=================================================================================
+// function : Name (get method)
+// purpose : to get the attribute 'name' of this shape
+//=================================================================================
+char* GEOM_Contact_i::Name() { return strdup(_name); }
+
+
+//=================================================================================
+// function : ShapeId
+// purpose : to get the id of this shape from GEOM (OCAF entry)
+//=================================================================================
+char* GEOM_Contact_i::ShapeId() { return strdup(_shapeid); }
+
+
+//=================================================================================
+// function : ShapeId (set method)
+// purpose : to set the id of this shape in GEOM/OCAF doc
+//=================================================================================
+void GEOM_Contact_i::ShapeId(const char * shapeid) { _shapeid = strdup(shapeid); }
+
+
+//=================================================================================
+// function : StudyShapeId (get method)
+// purpose : to get the id of this shape from the study document (OCAF entry)
+//=================================================================================
+char* GEOM_Contact_i::StudyShapeId() { return strdup(_studyshapeid) ; }
+
+
+//=================================================================================
+// function : StudyShapeId (set method)
+// purpose : to set the id of this shape in the Study document (OCAF entry)
+//=================================================================================
+void GEOM_Contact_i::StudyShapeId(const char * studyshapeid)
+{ _studyshapeid = strdup(studyshapeid); }
+
+
+//=======================================================================
+//function : Engine
+//purpose : return generator engine
+//=======================================================================
+GEOM::GEOM_Gen_ptr GEOM_Contact_i::Engine() { return _engine; }
diff --git a/src/GEOM/GEOM_Contact_i.hh b/src/GEOM/GEOM_Contact_i.hh
new file mode 100644
index 000000000..e60008405
--- /dev/null
+++ b/src/GEOM/GEOM_Contact_i.hh
@@ -0,0 +1,106 @@
+// 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_Contact_i.hh
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header$
+
+#ifndef __GEOM_CONTACT_I_H__
+#define __GEOM_CONTACT_I_H__
+
+// IDL headers
+#include
+#include CORBA_SERVER_HEADER(GEOM_Gen)
+#include CORBA_SERVER_HEADER(GEOM_Shape)
+#include CORBA_SERVER_HEADER(GEOM_Kinematic)
+
+#include "GEOM_Shape_i.hh"
+#include "Kinematic_Contact.hxx"
+
+//=====================================================================
+// GEOM_Contact_i : class definition
+//=====================================================================
+class GEOM_Contact_i:
+ public POA_GEOM::GEOM_Contact
+{
+public:
+ GEOM_Contact_i();
+ GEOM_Contact_i(Kinematic_Contact* Contact,
+ GEOM::GEOM_Shape_ptr Shape1,
+ GEOM::GEOM_Shape_ptr Shape2,
+ CORBA::ORB_ptr orb,
+ GEOM::GEOM_Gen_ptr engine);
+
+ ~GEOM_Contact_i();
+
+private:
+ Kinematic_Contact* _Contact;
+ GEOM::GEOM_Shape_ptr _Shape1;
+ GEOM::GEOM_Shape_ptr _Shape2;
+ GEOM::GEOM_Position_ptr _Position;
+ GEOM::GEOM_Rotation_ptr _Rotation;
+ GEOM::GEOM_Translation_ptr _Translation;
+ CORBA::ORB_ptr _orb;
+ GEOM::GEOM_Gen_ptr _engine;
+
+ char* _name;
+ char* _shapeid;
+ char* _studyshapeid; // exists only if added in the study document
+
+public:
+ CORBA::Long GetType()
+ throw (SALOME::SALOME_Exception);
+
+ GEOM::GEOM_Shape_ptr GetShape1()
+ throw (SALOME::SALOME_Exception);
+
+ GEOM::GEOM_Shape_ptr GetShape2()
+ throw (SALOME::SALOME_Exception);
+
+ GEOM::GEOM_Position_ptr GetPosition()
+ throw (SALOME::SALOME_Exception);
+
+ GEOM::GEOM_Rotation_ptr GetRotation()
+ throw (SALOME::SALOME_Exception);
+
+ GEOM::GEOM_Translation_ptr GetTranslation()
+ throw (SALOME::SALOME_Exception);
+
+ CORBA::Double GetStep()
+ throw (SALOME::SALOME_Exception);
+
+ char* Name();
+ void Name(const char* name);
+
+ char* ShapeId();
+ void ShapeId(const char* shapeid);
+
+ char* StudyShapeId();
+ void StudyShapeId(const char* studyshapeid);
+
+ GEOM::GEOM_Gen_ptr Engine();
+
+};
+
+#endif
diff --git a/src/GEOM/GEOM_Gen_i.cc b/src/GEOM/GEOM_Gen_i.cc
index 3816897ae..f53710189 100644
--- a/src/GEOM/GEOM_Gen_i.cc
+++ b/src/GEOM/GEOM_Gen_i.cc
@@ -145,6 +145,8 @@ using namespace std;
#include
#include
#include
+#include
+#include
#include
#include
#include
@@ -452,7 +454,9 @@ SALOMEDS::TMPFile* GEOM_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent,
SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames;
aSeq->length(1);
// Prepare a file name to open
- TCollection_AsciiString aNameWithExt(SALOMEDS_Tool::GetNameFromPath(theComponent->GetStudy()->URL()));
+ TCollection_AsciiString aNameWithExt("");
+ if (isMultiFile)
+ aNameWithExt = TCollection_AsciiString(SALOMEDS_Tool::GetNameFromPath(theComponent->GetStudy()->URL()));
aNameWithExt += TCollection_AsciiString("_GEOM.sgd");
aSeq[0] = CORBA::string_dup(aNameWithExt.ToCString());
// Build a full file name of temporary file
@@ -493,7 +497,10 @@ CORBA::Boolean GEOM_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
isMultiFile);
// Prepare a file name to open
- TCollection_AsciiString aNameWithExt(aSeq[0]);
+ TCollection_AsciiString aNameWithExt("");
+ if (isMultiFile)
+ aNameWithExt = TCollection_AsciiString(SALOMEDS_Tool::GetNameFromPath(theComponent->GetStudy()->URL()));
+ aNameWithExt += TCollection_AsciiString("_GEOM.sgd");
TCollection_AsciiString aFullName = aTmpDir + aNameWithExt;
// Open document
@@ -5025,6 +5032,132 @@ void GEOM_Gen_i::ExportSTEP(const char* filename,GEOM::GEOM_Shape_ptr theShape)
}
+//=================================================================================
+// function : InitAssembly()
+// purpose :
+//=================================================================================
+GEOM::GEOM_Assembly_ptr GEOM_Gen_i::InitAssembly() throw (SALOME::SALOME_Exception)
+{
+ Kinematic_Assembly* tds;
+
+ try {
+ tds = new Kinematic_Assembly();
+ }
+ catch(Standard_Failure)
+ THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::InitAssembly", SALOME::BAD_PARAM);
+
+ /* Create the CORBA servant holding the TopoDS_Shape */
+ GEOM::GEOM_Gen_ptr engine = POA_GEOM::GEOM_Gen::_this();
+ GEOM_Assembly_i * Assembly_servant = new GEOM_Assembly_i(tds, _orb, engine);
+ GEOM::GEOM_Assembly_var Assembly = GEOM::GEOM_Assembly::_narrow(Assembly_servant->_this());
+
+ /* Create and set the name (IOR of shape converted into a string) */
+ string name_ior = _orb->object_to_string(Assembly);
+ Assembly->Name(name_ior.c_str());
+
+ GEOMDS_Commands GC(myCurrentOCAFDoc->Main());
+ /* add attributs S and mystr in a new label */
+ TDF_Label Lab = GC.AddAssembly(*tds, Assembly->Name());
+
+ TCollection_AsciiString entry;
+ TDF_Tool::Entry(Lab, entry);
+ const char *ent = entry.ToCString();
+
+ Assembly->ShapeId(ent);
+ return Assembly;
+}
+
+
+//=================================================================================
+// function : AddContact()
+// purpose :
+//=================================================================================
+GEOM::GEOM_Contact_ptr GEOM_Gen_i::AddContact(GEOM::GEOM_Assembly_ptr Ass,
+ GEOM::GEOM_Shape_ptr Shape1,
+ GEOM::GEOM_Shape_ptr Shape2,
+ const short type,
+ CORBA::Double step)
+ throw (SALOME::SALOME_Exception)
+{
+ Kinematic_Contact* tds;
+ TDF_Label mainRefLab;
+ TDF_Tool::Label(myCurrentOCAFDoc->GetData(), Ass->ShapeId(), mainRefLab);
+
+ try {
+ TopoDS_Shape aShape1 = GetTopoShape(Shape1);
+ TopoDS_Shape aShape2 = GetTopoShape(Shape2);
+ tds = new Kinematic_Contact(aShape1, aShape2, type, step);
+ }
+ catch(Standard_Failure)
+ THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::AddContact", SALOME::BAD_PARAM);
+
+ /* Create the CORBA servant holding the TopoDS_Shape */
+ GEOM::GEOM_Gen_ptr engine = POA_GEOM::GEOM_Gen::_this();
+ GEOM_Contact_i * Contact_servant = new GEOM_Contact_i(tds, Shape1, Shape2, _orb, engine);
+ GEOM::GEOM_Contact_var Contact = GEOM::GEOM_Contact::_narrow(Contact_servant->_this());
+
+ /* Create and set the name (IOR of shape converted into a string) */
+ string name_ior = _orb->object_to_string(Contact);
+ Contact->Name(name_ior.c_str());
+
+ GEOMDS_Commands GC(myCurrentOCAFDoc->Main());
+ /* add attributs S and mystr in a new label */
+ TDF_Label LabContact = GC.AddContact(*tds, mainRefLab, Contact->Name());
+
+ TCollection_AsciiString entry;
+ TDF_Tool::Entry(LabContact, entry);
+ Contact->ShapeId(entry.ToCString());
+
+ return Contact;
+}
+
+
+//=================================================================================
+// function : AddAnimation()
+// purpose :
+//=================================================================================
+GEOM::GEOM_Animation_ptr GEOM_Gen_i::AddAnimation(GEOM::GEOM_Assembly_ptr Ass,
+ GEOM::GEOM_Shape_ptr Shape1,
+ CORBA::Double Duration,
+ const short NbSeq,
+ CORBA::Boolean IsInLoop)
+ throw (SALOME::SALOME_Exception)
+{
+ Kinematic_Animation* tds;
+ TDF_Label mainRefLab;
+ TDF_Tool::Label(myCurrentOCAFDoc->GetData(), Ass->ShapeId(), mainRefLab);
+ GEOMDS_Commands GC(myCurrentOCAFDoc->Main());
+
+ try {
+ Kinematic_Assembly* aAss = new Kinematic_Assembly();
+ Standard_Boolean test = GC.GetAssembly(mainRefLab, *aAss);
+ TopoDS_Shape aShape1 = GetTopoShape(Shape1);
+ tds = new Kinematic_Animation(aAss, aShape1, Duration, NbSeq, IsInLoop);
+ }
+ catch(Standard_Failure)
+ THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::AddAnimation", SALOME::BAD_PARAM);
+
+ /* Create the CORBA servant holding the TopoDS_Shape */
+ GEOM::GEOM_Gen_ptr engine = POA_GEOM::GEOM_Gen::_this();
+ GEOM_Animation_i * Animation_servant = new GEOM_Animation_i(tds, Ass, Shape1, _orb, engine);
+ GEOM::GEOM_Animation_var Animation = GEOM::GEOM_Animation::_narrow(Animation_servant->_this());
+
+ /* Create and set the name (IOR of shape converted into a string) */
+ string name_ior = _orb->object_to_string(Animation);
+ Animation->Name(name_ior.c_str());
+
+ /* add attributs S and mystr in a new label */
+ TDF_Label Lab = GC.AddAnimation(*tds, Animation->Name());
+
+ TCollection_AsciiString entry;
+ TDF_Tool::Entry(Lab, entry);
+ const char *ent = entry.ToCString();
+
+ Animation->ShapeId(ent);
+ return Animation;
+}
+
+
//=====================================================================================
// EXPORTED METHODS
//=====================================================================================
diff --git a/src/GEOM/GEOM_Gen_i.hh b/src/GEOM/GEOM_Gen_i.hh
index 753e98e89..1a5aed19f 100644
--- a/src/GEOM/GEOM_Gen_i.hh
+++ b/src/GEOM/GEOM_Gen_i.hh
@@ -44,10 +44,14 @@
#include
#include CORBA_SERVER_HEADER(GEOM_Gen)
#include CORBA_SERVER_HEADER(GEOM_Shape)
+#include CORBA_SERVER_HEADER(GEOM_Kinematic)
#include CORBA_SERVER_HEADER(SALOMEDS)
#include "SALOME_Component_i.hxx"
#include "GEOM_Shape_i.hh"
+#include "GEOM_Assembly_i.hh"
+#include "GEOM_Contact_i.hh"
+#include "GEOM_Animation_i.hh"
#include "SALOME_NamingService.hxx"
#include
@@ -601,6 +605,24 @@ class GEOM_Gen_i: public POA_GEOM::GEOM_Gen,
CORBA::Double aMeshingDeflection)
throw (SALOME::SALOME_Exception) ;
+ //-------------------------------------------------------------------//
+ // Specific method Kinematic //
+ //-------------------------------------------------------------------//
+ GEOM::GEOM_Assembly_ptr InitAssembly()
+ throw (SALOME::SALOME_Exception) ;
+ GEOM::GEOM_Contact_ptr AddContact(GEOM::GEOM_Assembly_ptr Ass,
+ GEOM::GEOM_Shape_ptr Shape1,
+ GEOM::GEOM_Shape_ptr Shape2,
+ const short type,
+ CORBA::Double step)
+ throw (SALOME::SALOME_Exception) ;
+ GEOM::GEOM_Animation_ptr AddAnimation(GEOM::GEOM_Assembly_ptr Ass,
+ GEOM::GEOM_Shape_ptr Shape1,
+ CORBA::Double Duration,
+ const short NbSeq,
+ CORBA::Boolean IsInLoop)
+ throw (SALOME::SALOME_Exception) ;
+
};
#endif
diff --git a/src/GEOM/GEOM_Position_i.cc b/src/GEOM/GEOM_Position_i.cc
new file mode 100644
index 000000000..3db2cf744
--- /dev/null
+++ b/src/GEOM/GEOM_Position_i.cc
@@ -0,0 +1,147 @@
+// GEOM GEOM :
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : GEOM_Position_i.cc
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header$
+
+using namespace std;
+#include "GEOM_Position_i.hh"
+
+//=================================================================================
+// function : GEOM_Position_i() constructor (no arguments)
+// purpose : for what now ?
+//=================================================================================
+GEOM_Position_i::GEOM_Position_i()
+{
+}
+
+
+//=================================================================================
+// function : constructor
+// purpose : constructor for servant creation
+//=================================================================================
+GEOM_Position_i::GEOM_Position_i(const GEOM::PointStruct& P0, const GEOM::DirStruct& VX,
+ const GEOM::DirStruct& VY, const GEOM::DirStruct& VZ)
+{
+
+ SetOrigin(P0);
+ SetVX(VX);
+ SetVY(VY);
+ SetVZ(VZ);
+ return;
+
+}
+
+
+//=================================================================================
+// function : destructor
+// purpose :
+//=================================================================================
+GEOM_Position_i::~GEOM_Position_i() {}
+
+
+//=================================================================================
+// function : SetOrigin()
+// purpose :
+//=================================================================================
+void GEOM_Position_i::SetOrigin(const GEOM::PointStruct& P0)
+ throw(SALOME::SALOME_Exception)
+{
+ _P0 = P0;
+ return;
+}
+
+//=================================================================================
+// function : SetVX()
+// purpose :
+//=================================================================================
+void GEOM_Position_i::SetVX(const GEOM::DirStruct& Vect)
+ throw(SALOME::SALOME_Exception)
+{
+ _VX = Vect;
+ return;
+}
+
+//=================================================================================
+// function : SetVY()
+// purpose :
+//=================================================================================
+void GEOM_Position_i::SetVY(const GEOM::DirStruct& Vect)
+ throw(SALOME::SALOME_Exception)
+{
+ _VY = Vect;
+ return;
+}
+
+//=================================================================================
+// function : SetVZ()
+// purpose :
+//=================================================================================
+void GEOM_Position_i::SetVZ(const GEOM::DirStruct& Vect)
+ throw(SALOME::SALOME_Exception)
+{
+ _VZ = Vect;
+ return;
+}
+
+//=================================================================================
+// function : GetOrigin()
+// purpose :
+//=================================================================================
+GEOM::PointStruct GEOM_Position_i::GetOrigin()
+ throw(SALOME::SALOME_Exception)
+{
+ return _P0;
+}
+
+//=================================================================================
+// function : GetVX()
+// purpose :
+//=================================================================================
+GEOM::DirStruct GEOM_Position_i::GetVX()
+ throw(SALOME::SALOME_Exception)
+{
+ return _VX;
+}
+
+//=================================================================================
+// function : GetVY()
+// purpose :
+//=================================================================================
+GEOM::DirStruct GEOM_Position_i::GetVY()
+ throw(SALOME::SALOME_Exception)
+{
+ return _VY;
+}
+
+//=================================================================================
+// function : GetVZ()
+// purpose :
+//=================================================================================
+GEOM::DirStruct GEOM_Position_i::GetVZ()
+ throw(SALOME::SALOME_Exception)
+{
+ return _VZ;
+}
diff --git a/src/GEOM/GEOM_Position_i.hh b/src/GEOM/GEOM_Position_i.hh
new file mode 100644
index 000000000..57b66a0f0
--- /dev/null
+++ b/src/GEOM/GEOM_Position_i.hh
@@ -0,0 +1,84 @@
+// GEOM GEOM :
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : GEOM_Position_i.hh
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header$
+
+#ifndef __GEOM_POSITION_I_H__
+#define __GEOM_POSITION_I_H__
+
+// IDL headers
+#include
+#include CORBA_SERVER_HEADER(GEOM_Gen)
+#include CORBA_SERVER_HEADER(GEOM_Shape)
+#include CORBA_SERVER_HEADER(GEOM_Kinematic)
+
+//=====================================================================
+// GEOM_Position_i : class definition
+//=====================================================================
+class GEOM_Position_i:
+ public POA_GEOM::GEOM_Position
+{
+public:
+ GEOM_Position_i();
+ GEOM_Position_i(const GEOM::PointStruct& P0, const GEOM::DirStruct& VX,
+ const GEOM::DirStruct& VY, const GEOM::DirStruct& VZ);
+
+ ~GEOM_Position_i();
+
+private:
+ GEOM::PointStruct _P0;
+ GEOM::DirStruct _VX;
+ GEOM::DirStruct _VY;
+ GEOM::DirStruct _VZ;
+
+public:
+ void SetOrigin(const GEOM::PointStruct& P0)
+ throw (SALOME::SALOME_Exception);
+
+ void SetVX(const GEOM::DirStruct& Vect)
+ throw (SALOME::SALOME_Exception);
+
+ void SetVY(const GEOM::DirStruct& Vect)
+ throw (SALOME::SALOME_Exception);
+
+ void SetVZ(const GEOM::DirStruct& Vect)
+ throw (SALOME::SALOME_Exception);
+
+ GEOM::PointStruct GetOrigin()
+ throw (SALOME::SALOME_Exception);
+
+ GEOM::DirStruct GetVX()
+ throw (SALOME::SALOME_Exception);
+
+ GEOM::DirStruct GetVY()
+ throw (SALOME::SALOME_Exception);
+
+ GEOM::DirStruct GetVZ()
+ throw (SALOME::SALOME_Exception);
+
+};
+
+#endif
diff --git a/src/GEOM/GEOM_Rotation_i.cc b/src/GEOM/GEOM_Rotation_i.cc
new file mode 100644
index 000000000..c0fa00432
--- /dev/null
+++ b/src/GEOM/GEOM_Rotation_i.cc
@@ -0,0 +1,135 @@
+// GEOM GEOM :
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : GEOM_Rotation_i.cc
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header$
+
+using namespace std;
+#include "GEOM_Rotation_i.hh"
+
+//=================================================================================
+// function : GEOM_Rotation_i() constructor (no arguments)
+// purpose : for what now ?
+//=================================================================================
+GEOM_Rotation_i::GEOM_Rotation_i()
+{
+}
+
+
+//=================================================================================
+// function : constructor
+// purpose : constructor for servant creation
+//=================================================================================
+GEOM_Rotation_i::GEOM_Rotation_i(CORBA::Long Rot1, CORBA::Long Rot2, CORBA::Long Rot3,
+ CORBA::Double Val1, CORBA::Double Val2, CORBA::Double Val3)
+{
+
+ SetRotation(Rot1, Rot2, Rot3, Val1, Val2, Val3);
+ return;
+
+}
+
+
+//=================================================================================
+// function : destructor
+// purpose :
+//=================================================================================
+GEOM_Rotation_i::~GEOM_Rotation_i() {}
+
+
+//=================================================================================
+// function : SetRotation()
+// purpose :
+//=================================================================================
+void GEOM_Rotation_i::SetRotation(CORBA::Long Rot1, CORBA::Long Rot2, CORBA::Long Rot3,
+ CORBA::Double Val1, CORBA::Double Val2, CORBA::Double Val3)
+ throw(SALOME::SALOME_Exception)
+{
+
+ _Rot1 = Rot1;
+ _Rot2 = Rot2;
+ _Rot3 = Rot3;
+
+ _Val1 = Val1;
+ _Val2 = Val2;
+ _Val3 = Val3;
+
+ return;
+
+}
+
+//=================================================================================
+// function : GetRot1()
+// purpose :
+//=================================================================================
+CORBA::Long GEOM_Rotation_i::GetRot1() throw(SALOME::SALOME_Exception)
+{
+ return _Rot1;
+}
+
+//=================================================================================
+// function : GetRot2()
+// purpose :
+//=================================================================================
+CORBA::Long GEOM_Rotation_i::GetRot2() throw(SALOME::SALOME_Exception)
+{
+ return _Rot2;
+}
+
+//=================================================================================
+// function : GetRot3()
+// purpose :
+//=================================================================================
+CORBA::Long GEOM_Rotation_i::GetRot3() throw(SALOME::SALOME_Exception)
+{
+ return _Rot3;
+}
+
+//=================================================================================
+// function : GetVal1()
+// purpose :
+//=================================================================================
+CORBA::Double GEOM_Rotation_i::GetVal1() throw(SALOME::SALOME_Exception)
+{
+ return _Val1;
+}
+
+//=================================================================================
+// function : GetVal2()
+// purpose :
+//=================================================================================
+CORBA::Double GEOM_Rotation_i::GetVal2() throw(SALOME::SALOME_Exception)
+{
+ return _Val2;
+}
+
+//=================================================================================
+// function : GetVal3()
+// purpose :
+//=================================================================================
+CORBA::Double GEOM_Rotation_i::GetVal3() throw(SALOME::SALOME_Exception)
+{
+ return _Val3;
+}
diff --git a/src/GEOM/GEOM_Rotation_i.hh b/src/GEOM/GEOM_Rotation_i.hh
new file mode 100644
index 000000000..598073005
--- /dev/null
+++ b/src/GEOM/GEOM_Rotation_i.hh
@@ -0,0 +1,85 @@
+// GEOM GEOM :
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : GEOM_Rotation_i.hh
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header$
+
+#ifndef __GEOM_ROTATION_I_H__
+#define __GEOM_ROTATION_I_H__
+
+// IDL headers
+#include
+#include CORBA_SERVER_HEADER(GEOM_Gen)
+#include CORBA_SERVER_HEADER(GEOM_Shape)
+#include CORBA_SERVER_HEADER(GEOM_Kinematic)
+
+//=====================================================================
+// GEOM_Rotation_i : class definition
+//=====================================================================
+class GEOM_Rotation_i:
+ public POA_GEOM::GEOM_Rotation
+{
+public:
+ GEOM_Rotation_i();
+ GEOM_Rotation_i(CORBA::Long Rot1, CORBA::Long Rot2, CORBA::Long Rot3,
+ CORBA::Double Val1, CORBA::Double Val2, CORBA::Double Val3);
+
+ ~GEOM_Rotation_i();
+
+private:
+ CORBA::Long _Rot1;
+ CORBA::Long _Rot2;
+ CORBA::Long _Rot3;
+
+ CORBA::Double _Val1;
+ CORBA::Double _Val2;
+ CORBA::Double _Val3;
+
+public:
+ void SetRotation(CORBA::Long Rot1, CORBA::Long Rot2, CORBA::Long Rot3,
+ CORBA::Double Val1, CORBA::Double Val2, CORBA::Double Val3)
+ throw (SALOME::SALOME_Exception);
+
+ CORBA::Long GetRot1()
+ throw (SALOME::SALOME_Exception);
+
+ CORBA::Long GetRot2()
+ throw (SALOME::SALOME_Exception);
+
+ CORBA::Long GetRot3()
+ throw (SALOME::SALOME_Exception);
+
+ CORBA::Double GetVal1()
+ throw (SALOME::SALOME_Exception);
+
+ CORBA::Double GetVal2()
+ throw (SALOME::SALOME_Exception);
+
+ CORBA::Double GetVal3()
+ throw (SALOME::SALOME_Exception);
+
+};
+
+#endif
diff --git a/src/GEOM/GEOM_Translation_i.cc b/src/GEOM/GEOM_Translation_i.cc
new file mode 100644
index 000000000..2c25166da
--- /dev/null
+++ b/src/GEOM/GEOM_Translation_i.cc
@@ -0,0 +1,101 @@
+// GEOM GEOM :
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : GEOM_Translation_i.cc
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header$
+
+using namespace std;
+#include "GEOM_Translation_i.hh"
+
+//=================================================================================
+// function : GEOM_Translation_i() constructor (no arguments)
+// purpose : for what now ?
+//=================================================================================
+GEOM_Translation_i::GEOM_Translation_i()
+{
+}
+
+
+//=================================================================================
+// function : constructor
+// purpose : constructor for servant creation
+//=================================================================================
+GEOM_Translation_i::GEOM_Translation_i(CORBA::Double Val1, CORBA::Double Val2, CORBA::Double Val3)
+{
+
+ SetTranslation(Val1, Val2, Val3);
+ return;
+
+}
+
+
+//=================================================================================
+// function : destructor
+// purpose :
+//=================================================================================
+GEOM_Translation_i::~GEOM_Translation_i() {}
+
+
+//=================================================================================
+// function : SetTranslation()
+// purpose :
+//=================================================================================
+void GEOM_Translation_i::SetTranslation(CORBA::Double Val1, CORBA::Double Val2, CORBA::Double Val3)
+ throw(SALOME::SALOME_Exception)
+{
+
+ _Val1 = Val1;
+ _Val2 = Val2;
+ _Val3 = Val3;
+ return;
+
+}
+
+//=================================================================================
+// function : GetVal1()
+// purpose :
+//=================================================================================
+CORBA::Double GEOM_Translation_i::GetVal1() throw(SALOME::SALOME_Exception)
+{
+ return _Val1;
+}
+
+//=================================================================================
+// function : GetVal2()
+// purpose :
+//=================================================================================
+CORBA::Double GEOM_Translation_i::GetVal2() throw(SALOME::SALOME_Exception)
+{
+ return _Val2;
+}
+
+//=================================================================================
+// function : GetVal3()
+// purpose :
+//=================================================================================
+CORBA::Double GEOM_Translation_i::GetVal3() throw(SALOME::SALOME_Exception)
+{
+ return _Val3;
+}
diff --git a/src/GEOM/GEOM_Translation_i.hh b/src/GEOM/GEOM_Translation_i.hh
new file mode 100644
index 000000000..45cea50bf
--- /dev/null
+++ b/src/GEOM/GEOM_Translation_i.hh
@@ -0,0 +1,70 @@
+// GEOM GEOM :
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : GEOM_Translation_i.hh
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header$
+
+#ifndef __GEOM_TRANSLATION_I_H__
+#define __GEOM_TRANSLATION_I_H__
+
+// IDL headers
+#include
+#include CORBA_SERVER_HEADER(GEOM_Gen)
+#include CORBA_SERVER_HEADER(GEOM_Shape)
+#include CORBA_SERVER_HEADER(GEOM_Kinematic)
+
+//=====================================================================
+// GEOM_Translation_i : class definition
+//=====================================================================
+class GEOM_Translation_i:
+ public POA_GEOM::GEOM_Translation
+{
+public:
+ GEOM_Translation_i();
+ GEOM_Translation_i(CORBA::Double Val1, CORBA::Double Val2, CORBA::Double Val3);
+
+ ~GEOM_Translation_i();
+
+private:
+ CORBA::Double _Val1;
+ CORBA::Double _Val2;
+ CORBA::Double _Val3;
+
+public:
+ void SetTranslation(CORBA::Double Val1, CORBA::Double Val2, CORBA::Double Val3)
+ throw (SALOME::SALOME_Exception);
+
+ CORBA::Double GetVal1()
+ throw (SALOME::SALOME_Exception);
+
+ CORBA::Double GetVal2()
+ throw (SALOME::SALOME_Exception);
+
+ CORBA::Double GetVal3()
+ throw (SALOME::SALOME_Exception);
+
+};
+
+#endif
diff --git a/src/GEOM/Makefile.in b/src/GEOM/Makefile.in
index 738e9ae64..33ba31328 100644
--- a/src/GEOM/Makefile.in
+++ b/src/GEOM/Makefile.in
@@ -37,8 +37,8 @@ VPATH=.:@srcdir@:@top_srcdir@/idl
# Libraries targets
LIB = libGEOMEngine.la
-LIB_SRC = GEOM_Shape_i.cc GEOM_Gen_i.cc
-LIB_SERVER_IDL = SALOME_Component.idl SALOMEDS.idl SALOME_Exception.idl GEOM_Gen.idl GEOM_Shape.idl
+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_SERVER_IDL = SALOME_Component.idl SALOMEDS.idl SALOME_Exception.idl GEOM_Gen.idl GEOM_Shape.idl GEOM_Kinematic.idl
# Executables targets
BIN =
@@ -46,12 +46,12 @@ BIN_SRC =
BIN_CLIENT_IDL =
BIN_SERVER_IDL =
-EXPORT_HEADERS =
+EXPORT_HEADERS =
# additionnal information to compil and link file
CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
-LDFLAGS += -lGEOMDS -lTOOLSDS -lSalomeNS -lSalomeContainer -lGEOMPartition -lGEOMArchimede $(CAS_LDPATH) -lTKIGES -lTKSTEP -lTKFillet -lTKOffset -L${KERNEL_ROOT_DIR}/lib/salome
+LDFLAGS += -lGEOMDS -lTOOLSDS -lSalomeNS -lSalomeContainer -lGEOMPartition -lGEOMArchimede -lGEOMKinematic $(CAS_LDPATH) -lTKIGES -lTKSTEP -lTKFillet -lTKOffset -L${KERNEL_ROOT_DIR}/lib/salome
# additional file to be cleaned
MOSTLYCLEAN =
diff --git a/src/GEOMBase/GEOMBase.cxx b/src/GEOMBase/GEOMBase.cxx
index 438a1e541..bcc6dd11b 100644
--- a/src/GEOMBase/GEOMBase.cxx
+++ b/src/GEOMBase/GEOMBase.cxx
@@ -206,7 +206,28 @@ bool GEOMBase::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString
int id = popup->idAt(0); // separator
if(id < 0)
popup->removeItem(id);
-
+
+ if(theObject.compare("Assembly") == 0 || theObject.compare("Animation") == 0) {
+ popup->removeItem(QAD_DisplayOnly_Popup_ID);
+ popup->removeItem(QAD_Display_Popup_ID);
+ popup->removeItem(QAD_Erase_Popup_ID);
+ return true;
+ }
+ else if(theObject.compare("Contact") == 0) {
+ Standard_Boolean testResult;
+ Handle(SALOME_InteractiveObject) IO = Sel->firstIObject();
+ GEOM::GEOM_Contact_ptr myGeomContact = myGeomBase->ConvertIOinContact(IO, testResult);
+ int type = myGeomContact->GetType();
+ if(type == 0 || type == 2) //EMBEDDING || SLIDE
+ popup->removeItem(6132); //ROTATION
+ if(type == 0 || type == 1 || type == 4) //EMBEDDING || PIVOT || SPHERICAL
+ popup->removeItem(6133); //TRANSLATION
+ popup->removeItem(QAD_DisplayOnly_Popup_ID);
+ popup->removeItem(QAD_Display_Popup_ID);
+ popup->removeItem(QAD_Erase_Popup_ID);
+ return true;
+ }
+
// checking for GEOM label in the selected list
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
Handle(SALOME_InteractiveObject) anIObject;
@@ -348,6 +369,27 @@ bool GEOMBase::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString
if(id < 0)
popup->removeItem(id);
+ if(theObject.compare("Assembly") == 0 || theObject.compare("Animation") == 0) {
+ popup->removeItem(QAD_DisplayOnly_Popup_ID);
+ popup->removeItem(QAD_Display_Popup_ID);
+ popup->removeItem(QAD_Erase_Popup_ID);
+ return true;
+ }
+ else if(theObject.compare("Contact") == 0) {
+ Standard_Boolean testResult;
+ Handle(SALOME_InteractiveObject) IO = Sel->firstIObject();
+ GEOM::GEOM_Contact_ptr myGeomContact = myGeomBase->ConvertIOinContact(IO, testResult);
+ int type = myGeomContact->GetType();
+ if(type == 0 || type == 2) //EMBEDDING || SLIDE
+ popup->removeItem(6132); //ROTATION
+ if(type == 0 || type == 1 || type == 4) //EMBEDDING || PIVOT || SPHERICAL
+ popup->removeItem(6133); //TRANSLATION
+ popup->removeItem(QAD_DisplayOnly_Popup_ID);
+ popup->removeItem(QAD_Display_Popup_ID);
+ popup->removeItem(QAD_Erase_Popup_ID);
+ return true;
+ }
+
// checking for GEOM label in the selected list
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
Handle(SALOME_InteractiveObject) anIObject;
@@ -490,13 +532,13 @@ bool GEOMBase::Display(GEOM::GEOM_Shape_ptr aShape, Standard_CString name)
anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributePixMap");
aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
aPixmap->SetPixMap("ICON_OBJBROWSER_Geometry");
+ aStudyBuilder->DefineComponentInstance(father, myGeom);
QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser();
if(aLocked)
aStudy->GetProperties()->SetLocked(true);
op->finish();
}
- aStudyBuilder->DefineComponentInstance(father, myGeom);
father->ComponentIOR(myGeomGUI->GetFatherior());
TCollection_AsciiString nameG("");
@@ -540,6 +582,7 @@ bool GEOMBase::Display(GEOM::GEOM_Shape_ptr aShape, Standard_CString name)
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
Handle(GEOM_AISShape) theResult = new GEOM_AISShape(shape, nameG.ToCString());
+ theResult->SetInfiniteState(shape.Infinite());
theResult->SetShadingColor(myShadingColor);
IO = new GEOM_InteractiveObject(aShape->Name(), myGeomGUI->GetFatherior(), "GEOM");
theResult->setIO(IO);
@@ -595,12 +638,12 @@ bool GEOMBase::AddInStudy(bool selection, const Handle(SALOME_InteractiveObject)
anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributePixMap");
aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
aPixmap->SetPixMap("ICON_OBJBROWSER_Geometry");
+ aStudyBuilder->DefineComponentInstance(father, myGeom);
if (aLocked)
aStudy->GetProperties()->SetLocked(true);
op->finish();
}
- aStudyBuilder->DefineComponentInstance(father, myGeom);
father->ComponentIOR(myGeomGUI->GetFatherior());
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
@@ -1184,6 +1227,102 @@ GEOM::GEOM_Shape_ptr GEOMBase::ConvertIOinGEOMShape(const Handle(SALOME_Interact
}
+//=======================================================================
+// function : ConvertIOinAssembly()
+// purpose :
+//=======================================================================
+GEOM::GEOM_Assembly_ptr GEOMBase::ConvertIOinAssembly(const Handle(SALOME_InteractiveObject)& IO, Standard_Boolean& testResult)
+{
+ GEOM::GEOM_Assembly_var aAss;
+ testResult = false;
+
+ /* case SObject */
+ if(IO->hasEntry()) {
+ SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
+ SALOMEDS::SObject_var obj = aStudy->FindObjectID(IO->getEntry());
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributeIOR_var anIOR;
+ if(!obj->_is_nil()) {
+ if(obj->FindAttribute(anAttr, "AttributeIOR")) {
+ anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
+ if(strcmp(anIOR->Value(),"") != 0){
+ CORBA::Object_var anObject = aStudy->ConvertIORToObject(anIOR->Value());
+ if(!CORBA::is_nil(anObject))
+ aAss = GEOM::GEOM_Assembly::_narrow(anObject.in());
+ }
+ if(!CORBA::is_nil(aAss))
+ testResult = true;
+ }
+ }
+ }
+ return aAss._retn();
+}
+
+
+//=======================================================================
+// function : ConvertIOinContact()
+// purpose :
+//=======================================================================
+GEOM::GEOM_Contact_ptr GEOMBase::ConvertIOinContact(const Handle(SALOME_InteractiveObject)& IO, Standard_Boolean& testResult)
+{
+ GEOM::GEOM_Contact_var aContact;
+ testResult = false;
+
+ /* case SObject */
+ if(IO->hasEntry()) {
+ SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
+ SALOMEDS::SObject_var obj = aStudy->FindObjectID(IO->getEntry());
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributeIOR_var anIOR;
+ if(!obj->_is_nil()) {
+ if(obj->FindAttribute(anAttr, "AttributeIOR")) {
+ anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
+ if(strcmp(anIOR->Value(),"") != 0){
+ CORBA::Object_var anObject = aStudy->ConvertIORToObject(anIOR->Value());
+ if(!CORBA::is_nil(anObject))
+ aContact = GEOM::GEOM_Contact::_narrow(anObject.in());
+ }
+ if(!CORBA::is_nil(aContact))
+ testResult = true;
+ }
+ }
+ }
+ return aContact._retn();
+}
+
+
+//=======================================================================
+// function : ConvertIOinContact()
+// purpose :
+//=======================================================================
+GEOM::GEOM_Animation_ptr GEOMBase::ConvertIOinAnimation(const Handle(SALOME_InteractiveObject)& IO, Standard_Boolean& testResult)
+{
+ GEOM::GEOM_Animation_var aAnimation;
+ testResult = false;
+
+ /* case SObject */
+ if(IO->hasEntry()) {
+ SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
+ SALOMEDS::SObject_var obj = aStudy->FindObjectID(IO->getEntry());
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributeIOR_var anIOR;
+ if(!obj->_is_nil()) {
+ if(obj->FindAttribute(anAttr, "AttributeIOR")) {
+ anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
+ if(strcmp(anIOR->Value(),"") != 0){
+ CORBA::Object_var anObject = aStudy->ConvertIORToObject(anIOR->Value());
+ if(!CORBA::is_nil(anObject))
+ aAnimation = GEOM::GEOM_Animation::_narrow(anObject.in());
+ }
+ if(!CORBA::is_nil(aAnimation))
+ testResult = true;
+ }
+ }
+ }
+ return aAnimation._retn();
+}
+
+
//=======================================================================
// function : ConvertListOfIOInListOfIOR()
// purpose :
diff --git a/src/GEOMBase/GEOMBase.h b/src/GEOMBase/GEOMBase.h
index db3bb1daa..12cbd728f 100644
--- a/src/GEOMBase/GEOMBase.h
+++ b/src/GEOMBase/GEOMBase.h
@@ -72,6 +72,12 @@ public :
bool GetShapeTypeString(const TopoDS_Shape& aShape, Standard_CString& aTypeString);
/* Convertions */
+ GEOM::GEOM_Assembly_ptr ConvertIOinAssembly(const Handle(SALOME_InteractiveObject)& IO,
+ Standard_Boolean& testResult);
+ GEOM::GEOM_Contact_ptr ConvertIOinContact(const Handle(SALOME_InteractiveObject)& IO,
+ Standard_Boolean& testResult);
+ GEOM::GEOM_Animation_ptr ConvertIOinAnimation(const Handle(SALOME_InteractiveObject)& IO,
+ Standard_Boolean& testResult);
GEOM::GEOM_Shape_ptr ConvertIOinGEOMShape(const Handle(SALOME_InteractiveObject)& IO,
Standard_Boolean& testResult);
Handle(GEOM_AISShape) ConvertIOinGEOMAISShape(const Handle(SALOME_InteractiveObject)& IO,
diff --git a/src/GEOMBase/Makefile.in b/src/GEOMBase/Makefile.in
index 42082e5fe..0ce139cad 100644
--- a/src/GEOMBase/Makefile.in
+++ b/src/GEOMBase/Makefile.in
@@ -52,7 +52,8 @@ LIB_MOC = \
LIB_CLIENT_IDL = SALOME_Exception.idl \
SALOMEDS.idl \
- SALOMEDS_Attributes.idl
+ SALOMEDS_Attributes.idl \
+ GEOM_Kinematic.idl
LIB_SERVER_IDL =
diff --git a/src/GEOMClient/Makefile.in b/src/GEOMClient/Makefile.in
index 32db3e220..726c35a98 100644
--- a/src/GEOMClient/Makefile.in
+++ b/src/GEOMClient/Makefile.in
@@ -42,7 +42,7 @@ EXPORT_HEADERS = \
LIB = libGEOMClient.la
LIB_SRC = GEOM_Client.cxx
-LIB_SERVER_IDL = SALOME_Component.idl SALOMEDS.idl SALOME_Exception.idl GEOM_Shape.idl GEOM_Gen.idl
+LIB_SERVER_IDL = SALOME_Component.idl SALOMEDS.idl SALOME_Exception.idl GEOM_Shape.idl GEOM_Gen.idl GEOM_Kinematic.idl
# Executables targets
BIN =
diff --git a/src/GEOMContext/GEOM_icons.po b/src/GEOMContext/GEOM_icons.po
index ed64a379c..bea2c564c 100644
--- a/src/GEOMContext/GEOM_icons.po
+++ b/src/GEOMContext/GEOM_icons.po
@@ -18,6 +18,30 @@ msgstr "select1.png"
msgid "ICON_OBJBROWSER_Geometry"
msgstr "geometry.png"
+#:
+msgid "ICON_ANIMATION"
+msgstr "animation.png"
+
+#:
+msgid "ICON_ASSEMBLY"
+msgstr "assembly.png"
+
+#:
+msgid "ICON_CONTACT"
+msgstr "contact.png"
+
+#:
+msgid "ICON_OBJBROWSER_ANIMATION"
+msgstr "tree_animation.png"
+
+#:
+msgid "ICON_OBJBROWSER_ASSEMBLY"
+msgstr "tree_assembly.png"
+
+#:
+msgid "ICON_OBJBROWSER_CONTACT"
+msgstr "tree_contact.png"
+
#: QAD_ObjectBrowser.cxx:140
msgid "ICON_OBJBROWSER_COMPOUND"
msgstr "tree_compound.png"
diff --git a/src/GEOMContext/GEOM_msg_en.po b/src/GEOMContext/GEOM_msg_en.po
index 1b91d57f8..895143100 100644
--- a/src/GEOMContext/GEOM_msg_en.po
+++ b/src/GEOMContext/GEOM_msg_en.po
@@ -1299,3 +1299,75 @@ msgstr "Values"
msgid "GEOM_SKETCHER_TYPE"
msgstr "Type"
+
+msgid "GEOM_CONTACT_TITLE"
+msgstr "Add Contact"
+
+msgid "GEOM_ASSEMBLY"
+msgstr "Assembly"
+
+msgid "GEOM_CONTACT"
+msgstr "Contact"
+
+msgid "GEOM_TYPE"
+msgstr "Type"
+
+msgid "GEOM_KROTATION_TITLE"
+msgstr "Edit Rotation"
+
+msgid "GEOM_KTRANSLATION_TITLE"
+msgstr "Edit Translation"
+
+msgid "GEOM_KROTATION"
+msgstr "Rotation"
+
+msgid "GEOM_KTRANSLATION"
+msgstr "Translation"
+
+msgid "GEOM_VALUE"
+msgstr "Value"
+
+msgid "GEOM_1ROT"
+msgstr "1st Rot."
+
+msgid "GEOM_2ROT"
+msgstr "2nd Rot."
+
+msgid "GEOM_3ROT"
+msgstr "3rd Rot."
+
+msgid "GEOM_KPOSITION_TITLE"
+msgstr "Set Position"
+
+msgid "GEOM_KPOSITION"
+msgstr "Position"
+
+msgid "GEOM_POS"
+msgstr "Position :"
+
+msgid "GEOM_VX"
+msgstr "VX :"
+
+msgid "GEOM_VY"
+msgstr "VY :"
+
+msgid "GEOM_VZ"
+msgstr "VZ :"
+
+msgid "GEOM_ANIMATION_TITLE"
+msgstr "Add Animation"
+
+msgid "GEOM_ANIMATION"
+msgstr "Animation"
+
+msgid "GEOM_FRAME"
+msgstr "Frame"
+
+msgid "GEOM_DURATION"
+msgstr "Duration"
+
+msgid "GEOM_NBSEQ"
+msgstr "Nb. Sequences"
+
+msgid "GEOM_IS_IN_LOOP"
+msgstr "In Loop"
diff --git a/src/GEOMContext/Makefile.in b/src/GEOMContext/Makefile.in
index ffb273015..9215429ea 100644
--- a/src/GEOMContext/Makefile.in
+++ b/src/GEOMContext/Makefile.in
@@ -51,7 +51,7 @@ LIB_SRC = GEOMContext.cxx
LIB_MOC = \
GEOMContext.h
-LIB_CLIENT_IDL = SALOME_Exception.idl
+LIB_CLIENT_IDL = SALOME_Exception.idl GEOM_Kinematic.idl
LIB_SERVER_IDL =
diff --git a/src/GEOMDS/GEOMDS_Commands.cxx b/src/GEOMDS/GEOMDS_Commands.cxx
index 17f7e5764..b2f0b52ca 100644
--- a/src/GEOMDS/GEOMDS_Commands.cxx
+++ b/src/GEOMDS/GEOMDS_Commands.cxx
@@ -34,9 +34,16 @@ using namespace std;
#include
#include
#include
+#include
+#include
+#include
#include
#include
#include
+#include
+
+#include "Kinematic_Contact.hxx"
+#include "Kinematic_Animation.hxx"
//=======================================================================
@@ -300,3 +307,202 @@ Standard_Boolean GEOMDS_Commands::ReturnNameIOR(const TDF_Label& aLabel,
return true ;
}
}
+
+
+//=======================================================================
+// function : AddAssembly()
+// purpose :
+//=======================================================================
+TDF_Label GEOMDS_Commands::AddAssembly(Kinematic_Assembly& KAss,
+ const TCollection_ExtendedString& Name)
+{
+ TDF_Label LabAssembly = myLab.NewChild();
+ TDataStd_Name::Set(LabAssembly, Name);
+ return LabAssembly;
+}
+
+
+//=======================================================================
+// function : AddContact()
+// purpose :
+//=======================================================================
+TDF_Label GEOMDS_Commands::AddContact(Kinematic_Contact& KContact,
+ const TDF_Label& mainRefLab,
+ const TCollection_ExtendedString& Name)
+{
+ TDF_Label LabContact = mainRefLab.NewChild();
+ TDataStd_Name::Set(LabContact, Name);
+
+ TDF_Label LabType = LabContact.NewChild();
+ TDataStd_Integer::Set(LabType, KContact.Type());
+
+ TDF_Label NewLab1 = LabContact.NewChild();
+ TNaming_Builder B1(NewLab1);
+ B1.Select(KContact.Shape1(), KContact.Shape1());
+// TDF_Label RefLab1 = TNaming_Tool::Label(myLab, KContact.Shape1());
+// TDF_Reference::Set(NewLab1, RefLab1);
+
+ TDF_Label NewLab2 = LabContact.NewChild();
+ TNaming_Builder B2(NewLab2);
+ B2.Select(KContact.Shape2(), KContact.Shape2());
+// TDF_Label RefLab2 = TNaming_Tool::Label(myLab, KContact.Shape2());
+// TDF_Reference::Set(NewLab2, RefLab2);
+
+ TDF_Label LabPosition = LabContact.NewChild();
+ Handle(TDataStd_RealArray) RealArrayP = TDataStd_RealArray::Set(LabPosition, 1, 12);
+ RealArrayP->SetValue(1, KContact.Position().Origin().X());
+ RealArrayP->SetValue(2, KContact.Position().Origin().Y());
+ RealArrayP->SetValue(3, KContact.Position().Origin().Z());
+ RealArrayP->SetValue(4, KContact.Position().DirX().X());
+ RealArrayP->SetValue(5, KContact.Position().DirX().Y());
+ RealArrayP->SetValue(6, KContact.Position().DirX().Z());
+ RealArrayP->SetValue(7, KContact.Position().DirY().X());
+ RealArrayP->SetValue(8, KContact.Position().DirY().Y());
+ RealArrayP->SetValue(9, KContact.Position().DirY().Z());
+ RealArrayP->SetValue(10, KContact.Position().DirZ().X());
+ RealArrayP->SetValue(11, KContact.Position().DirZ().Y());
+ RealArrayP->SetValue(12, KContact.Position().DirZ().Z());
+
+ TDF_Label LabRotation1 = LabContact.NewChild();
+ Handle(TDataStd_IntegerArray) IntegerArrayR = TDataStd_IntegerArray::Set(LabRotation1, 1, 3);
+ IntegerArrayR->SetValue(1, KContact.Rotation().Rot1());
+ IntegerArrayR->SetValue(2, KContact.Rotation().Rot2());
+ IntegerArrayR->SetValue(3, KContact.Rotation().Rot3());
+
+ TDF_Label LabRotation2 = LabContact.NewChild();
+ Handle(TDataStd_RealArray) RealArrayR = TDataStd_RealArray::Set(LabRotation2, 1, 3);
+ RealArrayR->SetValue(1, KContact.Rotation().ValX());
+ RealArrayR->SetValue(2, KContact.Rotation().ValY());
+ RealArrayR->SetValue(3, KContact.Rotation().ValZ());
+
+ TDF_Label LabTranslation = LabContact.NewChild();
+ Handle(TDataStd_RealArray) RealArrayT = TDataStd_RealArray::Set(LabTranslation, 1, 3);
+ RealArrayT->SetValue(1, KContact.Translation().ValX());
+ RealArrayT->SetValue(2, KContact.Translation().ValY());
+ RealArrayT->SetValue(3, KContact.Translation().ValZ());
+
+ TDF_Label LabStep = LabContact.NewChild();
+ TDataStd_Real::Set(LabStep, KContact.Step());
+
+ return LabContact;
+}
+
+
+//=======================================================================
+// function : AddAnimation()
+// purpose :
+//=======================================================================
+TDF_Label GEOMDS_Commands::AddAnimation(Kinematic_Animation& KAnimation,
+ const TCollection_ExtendedString& Name)
+{
+ TDF_Label LabAnimation = myLab.NewChild();
+ TDataStd_Name::Set(LabAnimation, Name);
+
+ Standard_Real duration = double(KAnimation.Duration());
+
+ TDF_Label LabDuration = LabAnimation.NewChild();
+ TDataStd_Real::Set(LabDuration, duration);
+
+ TDF_Label LabNbSeq = LabAnimation.NewChild();
+ TDataStd_Integer::Set(LabNbSeq, KAnimation.NbSeq());
+
+ TDF_Label LabIsInLoop = LabAnimation.NewChild();
+ TDataStd_Integer::Set(LabIsInLoop, KAnimation.IsInLoop());
+
+ return LabAnimation;
+}
+
+
+//=======================================================================
+// function : GetAssembly()
+// purpose :
+//=======================================================================
+Standard_Boolean GEOMDS_Commands::GetAssembly(const TDF_Label& aLabel,
+ Kinematic_Assembly& returnAss)
+{
+ Kinematic_Assembly* Ass = new Kinematic_Assembly();
+ Handle(TDataStd_Name) anAttName;
+ if(!aLabel.FindAttribute(TDataStd_Name::GetID(), anAttName))
+ return false;
+ else {
+ TDF_ChildIterator it;
+ for(it.Initialize(aLabel, Standard_False); it.More(); it.Next()) {
+ TDF_Label L = it.Value();
+ Kinematic_Contact* aContact = new Kinematic_Contact();
+ Standard_Boolean test = GetContact(L, *aContact);
+ Ass->AddContact(aContact);
+ }
+ returnAss = *Ass;
+ return true;
+ }
+}
+
+
+//=======================================================================
+// function : GetContact()
+// purpose :
+//=======================================================================
+Standard_Boolean GEOMDS_Commands::GetContact(const TDF_Label& aLabel,
+ Kinematic_Contact& returnContact)
+{
+ Kinematic_Contact* Contact = new Kinematic_Contact();
+ Handle(TDataStd_Name) anAttName;
+ if(!aLabel.FindAttribute(TDataStd_Name::GetID(), anAttName))
+ return false;
+ else {
+ TDF_ChildIterator it;
+ int i = 1;
+ for(it.Initialize(aLabel, Standard_False); it.More(); it.Next()) {
+ TDF_Label L = it.Value();
+ Handle(TNaming_NamedShape) anAttTopo1;
+ Handle(TNaming_NamedShape) anAttTopo2;
+ Handle(TDataStd_Integer) anAttInteger;
+ Handle(TDataStd_Real) anAttReal;
+ Handle(TDataStd_IntegerArray) anAttIntegerArrayR;
+ Handle(TDataStd_RealArray) anAttRealArrayP;
+ Handle(TDataStd_RealArray) anAttRealArrayR;
+ Handle(TDataStd_RealArray) anAttRealArrayT;
+
+ if(i == 1 && L.FindAttribute(TDataStd_Integer::GetID(), anAttInteger)) {
+ Contact->Type(anAttInteger->Get());
+ }
+ if(i == 2 && L.FindAttribute(TNaming_NamedShape::GetID(), anAttTopo1)) {
+ Contact->Shape1(TNaming_Tool::GetShape(anAttTopo1));
+ }
+ if(i == 3 && L.FindAttribute(TNaming_NamedShape::GetID(), anAttTopo2)) {
+ Contact->Shape2(TNaming_Tool::GetShape(anAttTopo2));
+ }
+ if(i == 4 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayP)) {
+ gp_Pnt Center(anAttRealArrayP->Value(1), anAttRealArrayP->Value(2), anAttRealArrayP->Value(3));
+ gp_Dir aDirX(anAttRealArrayP->Value(4), anAttRealArrayP->Value(5), anAttRealArrayP->Value(6));
+ gp_Dir aDirY(anAttRealArrayP->Value(7), anAttRealArrayP->Value(8), anAttRealArrayP->Value(9));
+ gp_Dir aDirZ(anAttRealArrayP->Value(10), anAttRealArrayP->Value(11), anAttRealArrayP->Value(12));
+ Contact->Position().Origin(Center);
+ Contact->Position().DirX(aDirX);
+ Contact->Position().DirY(aDirY);
+ Contact->Position().DirZ(aDirZ);
+ }
+ if(i == 5 && L.FindAttribute(TDataStd_IntegerArray::GetID(), anAttIntegerArrayR)) {
+ Contact->Rotation().Rot1(anAttIntegerArrayR->Value(1));
+ Contact->Rotation().Rot2(anAttIntegerArrayR->Value(2));
+ Contact->Rotation().Rot3(anAttIntegerArrayR->Value(3));
+ }
+ if(i == 6 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayR)) {
+ Contact->Rotation().ValX(anAttRealArrayR->Value(1));
+ Contact->Rotation().ValY(anAttRealArrayR->Value(2));
+ Contact->Rotation().ValZ(anAttRealArrayR->Value(3));
+ }
+ if(i == 7 && L.FindAttribute(TDataStd_RealArray::GetID(), anAttRealArrayT)) {
+ Contact->Translation().ValX(anAttRealArrayT->Value(1));
+ Contact->Translation().ValY(anAttRealArrayT->Value(2));
+ Contact->Translation().ValZ(anAttRealArrayT->Value(3));
+ }
+ if(i == 8 && L.FindAttribute(TDataStd_Real::GetID(), anAttReal)) {
+ Contact->Step(anAttReal->Get());
+ }
+ i++;
+ }
+ returnContact = *Contact;
+ return true;
+ }
+}
diff --git a/src/GEOMDS/GEOMDS_Commands.hxx b/src/GEOMDS/GEOMDS_Commands.hxx
index 0e2403920..5602028c8 100644
--- a/src/GEOMDS/GEOMDS_Commands.hxx
+++ b/src/GEOMDS/GEOMDS_Commands.hxx
@@ -34,6 +34,9 @@
#endif
class TDF_Label;
class TopoDS_Shape;
+class Kinematic_Assembly;
+class Kinematic_Contact;
+class Kinematic_Animation;
class TCollection_ExtendedString;
@@ -123,6 +126,19 @@ public:
Standard_EXPORT Standard_Boolean ReturnNameIOR(const TDF_Label& aLabel,
TCollection_ExtendedString& returnNameIOR) ;
+ /* Kinematic */
+ Standard_EXPORT TDF_Label AddAssembly(Kinematic_Assembly& KAss,
+ const TCollection_ExtendedString& Name) ;
+ Standard_EXPORT TDF_Label AddContact(Kinematic_Contact& KContact,
+ const TDF_Label& mainRefLab,
+ const TCollection_ExtendedString& Name) ;
+ Standard_EXPORT TDF_Label AddAnimation(Kinematic_Animation& KAnimation,
+ const TCollection_ExtendedString& Name) ;
+ Standard_EXPORT Standard_Boolean GetAssembly(const TDF_Label& aLabel,
+ Kinematic_Assembly& returnAss) ;
+ Standard_EXPORT Standard_Boolean GetContact(const TDF_Label& aLabel,
+ Kinematic_Contact& returnContact) ;
+
protected:
// Methods PROTECTED
diff --git a/src/GEOMDS/GEOMDS_Commands.jxx b/src/GEOMDS/GEOMDS_Commands.jxx
index 017dcd329..8d4cccf10 100644
--- a/src/GEOMDS/GEOMDS_Commands.jxx
+++ b/src/GEOMDS/GEOMDS_Commands.jxx
@@ -35,4 +35,4 @@
#endif
#ifndef _GEOMDS_Commands_HeaderFile
#include "GEOMDS_Commands.hxx"
-#endif
\ No newline at end of file
+#endif
diff --git a/src/GEOMFiltersSelection/Makefile.in b/src/GEOMFiltersSelection/Makefile.in
index 851695357..99a6ed3a8 100644
--- a/src/GEOMFiltersSelection/Makefile.in
+++ b/src/GEOMFiltersSelection/Makefile.in
@@ -41,7 +41,7 @@ LIB_SRC = GEOM_ShapeTypeFilter.cxx \
GEOM_FaceFilter.cxx \
GEOM_EdgeFilter.cxx
-LIB_CLIENT_IDL = SALOME_Component.idl SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Exception.idl GEOM_Shape.idl GEOM_Gen.idl
+LIB_CLIENT_IDL = SALOME_Component.idl SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Exception.idl GEOM_Shape.idl GEOM_Gen.idl GEOM_Kinematic.idl
# header files
EXPORT_HEADERS= GEOM_ShapeTypeFilter.hxx \
diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx
index 357507e17..d0521d3cb 100644
--- a/src/GEOMGUI/GeometryGUI.cxx
+++ b/src/GEOMGUI/GeometryGUI.cxx
@@ -43,6 +43,11 @@ using namespace std;
#include "SALOME_Selection.h"
+// IDL Headers
+#include
+#include CORBA_SERVER_HEADER(SALOMEDS)
+#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
+
/* The object itself created in the static method 'GetOrCreateGEOMBase()' */
static GEOMContext* GeomGUI = 0;
@@ -238,6 +243,25 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
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
@@ -443,7 +467,23 @@ void GeometryGUI::DefinePopup(QString & theContext, QString & theParent, QString
if(strcmp(scomp->GetID(), IO->getEntry()) == 0) {
// component is selected
theObject = "Component";
+ return;
}
+
+ SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributeComment_var aType;
+ anAttr = aStudyBuilder->FindOrCreateAttribute(sobj, "AttributeComment");
+ aType = SALOMEDS::AttributeComment::_narrow(anAttr);
+ QString val = QString(strdup(aType->Value()));
+ if(val == "Kinematic_Assembly")
+ theObject = "Assembly";
+ else if(val == "Kinematic_Contact")
+ theObject = "Contact";
+ else if(val == "Kinematic_Animation")
+ theObject = "Animation";
+ return;
}
}
}
diff --git a/src/GEOMGUI/Makefile.in b/src/GEOMGUI/Makefile.in
index 9576c2d35..1a1f35d64 100644
--- a/src/GEOMGUI/Makefile.in
+++ b/src/GEOMGUI/Makefile.in
@@ -48,7 +48,8 @@ LIB_MOC = \
LIB_CLIENT_IDL = SALOME_Exception.idl \
SALOMEDS.idl \
- SALOMEDS_Attributes.idl
+ SALOMEDS_Attributes.idl \
+ GEOM_Kinematic.idl
LIB_SERVER_IDL =
diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.cxx b/src/GEOMToolsGUI/GEOMToolsGUI.cxx
index fe0e3cc9c..8f19eee04 100644
--- a/src/GEOMToolsGUI/GEOMToolsGUI.cxx
+++ b/src/GEOMToolsGUI/GEOMToolsGUI.cxx
@@ -21,7 +21,7 @@
//
//
//
-// File : GEOMBase_Tools.cxx
+// File : GEOMToolsGUI.cxx
// Author : Damien COQUERET
// Module : GEOM
// $Header:
@@ -213,7 +213,7 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
else
IsoV = "1";
- GEOMBase_NbIsosDlg* NbIsosDlg = new GEOMBase_NbIsosDlg(QAD_Application::getDesktop(), tr("GEOM_MEN_ISOS"), TRUE);
+ GEOMToolsGUI_NbIsosDlg* NbIsosDlg = new GEOMToolsGUI_NbIsosDlg(QAD_Application::getDesktop(), tr("GEOM_MEN_ISOS"), TRUE);
int UIso = IsoU.toInt();
int VIso = IsoV.toInt();
@@ -313,7 +313,7 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
{
QAD_PyEditor* PyEditor = QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getPyEditor();
PyEditor->setText("from GEOM_usinggeom import *\n");
- PyEditor->setText(">>> ");
+ //PyEditor->setText(">>> ");
PyEditor->handleReturn();
break;
}
@@ -396,13 +396,12 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
}
case 8033: // TRANSPARENCY - POPUP VIEWER
{
- OCCViewer_Viewer3d* v3d;
Handle(AIS_InteractiveContext) ic;
- if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC) {
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
- Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
+ ic = v3d->getAISContext();
}
- GEOMBase_TransparencyDlg *aDlg = new GEOMBase_TransparencyDlg(parent, "", Sel, ic);
+ GEOMToolsGUI_TransparencyDlg *aDlg = new GEOMToolsGUI_TransparencyDlg(parent, "", Sel, ic);
break;
}
case 8034: // ISOS - POPUP VIEWER
@@ -428,8 +427,8 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
else
IsoV = "1";
- GEOMBase_NbIsosDlg * NbIsosDlg =
- new GEOMBase_NbIsosDlg(QAD_Application::getDesktop(), tr("GEOM_MEN_ISOS"), TRUE);
+ GEOMToolsGUI_NbIsosDlg * NbIsosDlg =
+ new GEOMToolsGUI_NbIsosDlg(QAD_Application::getDesktop(), tr("GEOM_MEN_ISOS"), TRUE);
NbIsosDlg->SpinBoxU->setValue(IsoU.toInt());
NbIsosDlg->SpinBoxV->setValue(IsoV.toInt());
@@ -533,6 +532,9 @@ void GEOMToolsGUI::OnEditDelete()
SALOMEDS::AttributeIOR_var anIOR;
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
+ QAD_Operation* op = new SALOMEGUI_ImportOperation( QAD_Application::getDesktop()->getActiveStudy() );
+ op->start();
+ Standard_Boolean deleted = false;
for(;It.More();It.Next()) {
Handle(SALOME_InteractiveObject) IObject = It.Value();
if(IObject->hasEntry()) {
@@ -598,15 +600,16 @@ void GEOMToolsGUI::OnEditDelete()
/* Erase objects in Study */
SALOMEDS::SObject_var obj = aStudy->FindObjectID(IObject->getEntry());
if(!obj->_is_nil()) {
- QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
- op->start();
aStudyBuilder->RemoveObject(obj);
- op->finish();
+ deleted = true;
}
} /* IObject->hasEntry() */
} /* more/next */
+ if (deleted) op->finish();
+ else op->abort();
+
/* Clear any previous selection */
Sel->ClearIObjects();
QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser();
@@ -742,11 +745,11 @@ bool GEOMToolsGUI::Import(int aState)
anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributePixMap");
aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
aPixmap->SetPixMap( "ICON_OBJBROWSER_Geometry" );
+ aStudyBuilder->DefineComponentInstance( father, myGeom );
if (aLocked) aStudy->GetProperties()->SetLocked(true);
op->finish();
}
// if (aLocked) return false;
- aStudyBuilder->DefineComponentInstance( father, myGeom );
father->ComponentIOR(myGeomGUI->GetFatherior());
QString nameShape = QAD_Tools::getFileNameFromPath(file,false) + QString("_%1").arg(myGeomGUI->GetNbGeom()++);
diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.cxx
index 5ef80f650..842332015 100644
--- a/src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.cxx
+++ b/src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.cxx
@@ -21,7 +21,7 @@
//
//
//
-// File : GEOMBase_NbIsosDlg.cxx
+// File : GEOMToolsGUI_NbIsosDlg.cxx
// Author :
// Module : GEOM
// $Header:
@@ -37,17 +37,17 @@ using namespace std;
#include
//=================================================================================
-// class : GEOMBase_NbIsosDlg()
-// purpose : Constructs a GEOMBase_NbIsosDlg which is a child of 'parent', with the
+// class : GEOMToolsGUI_NbIsosDlg()
+// purpose : Constructs a GEOMToolsGUI_NbIsosDlg 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.
//=================================================================================
-GEOMBase_NbIsosDlg::GEOMBase_NbIsosDlg(QWidget* parent, const char* name, bool modal, WFlags fl)
+GEOMToolsGUI_NbIsosDlg::GEOMToolsGUI_NbIsosDlg(QWidget* parent, const char* name, bool modal, WFlags fl)
:QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
if( !name )
- setName("GEOMBase_NbIsosDlg");
+ setName("GEOMToolsGUI_NbIsosDlg");
setCaption(name);
setSizeGripEnabled(TRUE);
QGridLayout* MyDialogLayout = new QGridLayout(this);
@@ -122,10 +122,10 @@ GEOMBase_NbIsosDlg::GEOMBase_NbIsosDlg(QWidget* parent, const char* name, bool m
//=================================================================================
-// function : ~GEOMBase_NbIsosDlg()
+// function : ~GEOMToolsGUI_NbIsosDlg()
// purpose : Destroys the object and frees any allocated resources
//=================================================================================
-GEOMBase_NbIsosDlg::~GEOMBase_NbIsosDlg()
+GEOMToolsGUI_NbIsosDlg::~GEOMToolsGUI_NbIsosDlg()
{
// no need to delete child widgets, Qt does it all for us
}
diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.h b/src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.h
index 48c70c563..07e471200 100644
--- a/src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.h
+++ b/src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.h
@@ -21,13 +21,13 @@
//
//
//
-// File : GEOMBase_NbIsosDlg.h
+// File : GEOMToolsGUI_NbIsosDlg.h
// Author :
// Module : GEOM
// $Header:
-#ifndef GEOMBASE_NBISOSDLG_H
-#define GEOMBASE_NBISOSDLG_H
+#ifndef GEOMTOOLSGUI_NBISOSDLG_H
+#define GEOMTOOLSGUI_NBISOSDLG_H
#include
@@ -36,16 +36,16 @@ class QSpinBox;
class QPushButton;
//=================================================================================
-// class : GEOMBase_NbIsosDlg
+// class : GEOMToolsGUI_NbIsosDlg
// purpose :
//=================================================================================
-class GEOMBase_NbIsosDlg : public QDialog
+class GEOMToolsGUI_NbIsosDlg : public QDialog
{
Q_OBJECT
public:
- GEOMBase_NbIsosDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0);
- ~GEOMBase_NbIsosDlg();
+ GEOMToolsGUI_NbIsosDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0);
+ ~GEOMToolsGUI_NbIsosDlg();
QPushButton* buttonOk;
QPushButton* buttonCancel;
@@ -56,4 +56,4 @@ public:
};
-#endif // GEOMETRYGUI_NBISOSDLG_H
+#endif // GEOMTOOLSGUI_NBISOSDLG_H
diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx
index 6fab217a5..c524a0b3d 100644
--- a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx
+++ b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx
@@ -21,7 +21,7 @@
//
//
//
-// File : GEOMBase_TransparencyDlg.cxx
+// File : GEOMToolsGUI_TransparencyDlg.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
@@ -30,6 +30,7 @@ using namespace std;
#include "QAD_RightFrame.h"
#include "SALOME_ListIteratorOfListIO.hxx"
+#include "OCCViewer_Viewer3d.h"
#include
#include
@@ -47,24 +48,24 @@ using namespace std;
#include "VTKViewer_RenderWindowInteractor.h"
//=================================================================================
-// class : GEOMBase_TransparencyDlg()
+// class : GEOMToolsGUI_TransparencyDlg()
// purpose : Constructs a GEOMBase_SUBSHAPE which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'.
//
// : WARNING : this dialog is modal !
//
//=================================================================================
-GEOMBase_TransparencyDlg::GEOMBase_TransparencyDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, const Handle(AIS_InteractiveContext)& ic, bool modal, WFlags fl)
+GEOMToolsGUI_TransparencyDlg::GEOMToolsGUI_TransparencyDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, const Handle(AIS_InteractiveContext)& ic, bool modal, WFlags fl)
:QDialog(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
if(!name)
- setName("GEOMBase_TransparencyDlg");
+ setName("GEOMToolsGUI_TransparencyDlg");
resize(152, 107);
setCaption(tr("GEOM_TRANSPARENCY_TITLE"));
setSizeGripEnabled(TRUE);
- GEOMBase_TransparencyDlgLayout = new QGridLayout(this);
- GEOMBase_TransparencyDlgLayout->setSpacing(6);
- GEOMBase_TransparencyDlgLayout->setMargin(11);
+ GEOMToolsGUI_TransparencyDlgLayout = new QGridLayout(this);
+ GEOMToolsGUI_TransparencyDlgLayout->setSpacing(6);
+ GEOMToolsGUI_TransparencyDlgLayout->setMargin(11);
/*************************************************************************/
QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
@@ -111,8 +112,8 @@ GEOMBase_TransparencyDlg::GEOMBase_TransparencyDlg(QWidget* parent, const char*
GroupC1Layout->addMultiCellWidget( Slider1, 1, 1, 0, 2 );
/*************************************************************************/
- GEOMBase_TransparencyDlgLayout->addWidget(GroupC1, 0, 0);
- GEOMBase_TransparencyDlgLayout->addWidget(GroupButtons, 1, 0);
+ GEOMToolsGUI_TransparencyDlgLayout->addWidget(GroupC1, 0, 0);
+ GEOMToolsGUI_TransparencyDlgLayout->addWidget(GroupButtons, 1, 0);
/* Initialisations */
this->myGeomGUI = GEOMContext::GetGeomGUI();
@@ -140,10 +141,10 @@ GEOMBase_TransparencyDlg::GEOMBase_TransparencyDlg(QWidget* parent, const char*
//=================================================================================
-// function : ~GEOMBase_TransparencyDlg()
+// function : ~GEOMToolsGUI_TransparencyDlg()
// purpose :
//=================================================================================
-GEOMBase_TransparencyDlg::~GEOMBase_TransparencyDlg()
+GEOMToolsGUI_TransparencyDlg::~GEOMToolsGUI_TransparencyDlg()
{
// no need to delete child widgets, Qt does it all for us
}
@@ -153,7 +154,7 @@ GEOMBase_TransparencyDlg::~GEOMBase_TransparencyDlg()
// function : ClickOnOk()
// purpose :
//=======================================================================
-void GEOMBase_TransparencyDlg::ClickOnOk()
+void GEOMToolsGUI_TransparencyDlg::ClickOnOk()
{
accept();
return;
@@ -164,7 +165,7 @@ void GEOMBase_TransparencyDlg::ClickOnOk()
// function : ClickOnClose()
// purpose :
//=======================================================================
-void GEOMBase_TransparencyDlg::ClickOnClose()
+void GEOMToolsGUI_TransparencyDlg::ClickOnClose()
{
accept();
return;
@@ -176,7 +177,7 @@ void GEOMBase_TransparencyDlg::ClickOnClose()
// purpose : Called when value of slider change
// : or the first time as initilisation
//=================================================================================
-void GEOMBase_TransparencyDlg::ValueHasChanged(int newValue)
+void GEOMToolsGUI_TransparencyDlg::ValueHasChanged(int newValue)
{
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
// VTK
@@ -221,6 +222,8 @@ void GEOMBase_TransparencyDlg::ValueHasChanged(int newValue)
}
QApplication::setOverrideCursor(Qt::waitCursor);
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
for(;It.More(); It.Next()) {
Handle(SALOME_InteractiveObject) IObject = It.Value();
Standard_Boolean found;
@@ -229,10 +232,10 @@ void GEOMBase_TransparencyDlg::ValueHasChanged(int newValue)
QApplication::restoreOverrideCursor();
return;
}
- this->myIc->SetTransparency(Shape, newValue / 10.0, false);
- myIc->Redisplay(Shape, Standard_False, Standard_True);
+ ic->SetTransparency(Shape, newValue / 10.0, false);
+ ic->Redisplay(Shape, Standard_False, Standard_True);
}
- myIc->UpdateCurrentViewer();
+ ic->UpdateCurrentViewer();
}
QApplication::restoreOverrideCursor();
return;
diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.h b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.h
index fbcc4efcd..8ae122d1b 100644
--- a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.h
+++ b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.h
@@ -21,7 +21,7 @@
//
//
//
-// File : GEOMBase_TransparencyDlg.h
+// File : GEOMToolsGUI_TransparencyDlg.h
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
@@ -51,23 +51,23 @@ class QSlider;
//=================================================================================
-// class : GEOMBase_TransparencyDlg
+// class : GEOMToolsGUI_TransparencyDlg
// purpose :
// : WARNING : that is a MODAL dialog.
//=================================================================================
-class GEOMBase_TransparencyDlg : public QDialog
+class GEOMToolsGUI_TransparencyDlg : public QDialog
{
Q_OBJECT
public:
- GEOMBase_TransparencyDlg( QWidget* parent = 0,
+ GEOMToolsGUI_TransparencyDlg( QWidget* parent = 0,
const char* name = 0,
SALOME_Selection* Sel = 0,
const Handle(AIS_InteractiveContext)& ic = 0,
bool modal = TRUE,
WFlags fl = 0 );
- ~GEOMBase_TransparencyDlg();
+ ~GEOMToolsGUI_TransparencyDlg();
private :
@@ -89,7 +89,7 @@ public slots:
void ValueHasChanged( int newValue ) ;
protected:
- QGridLayout* GEOMBase_TransparencyDlgLayout;
+ QGridLayout* GEOMToolsGUI_TransparencyDlgLayout;
QHBoxLayout* Layout1;
QHBoxLayout* Layout2;
};
diff --git a/src/GEOMToolsGUI/Makefile.in b/src/GEOMToolsGUI/Makefile.in
index 95cc8b8f8..45aae6e3a 100644
--- a/src/GEOMToolsGUI/Makefile.in
+++ b/src/GEOMToolsGUI/Makefile.in
@@ -49,7 +49,7 @@ LIB_MOC = \
GEOMToolsGUI_NbIsosDlg.h \
GEOMToolsGUI_TransparencyDlg.h
-LIB_CLIENT_IDL = SALOMEDS_Attributes.idl
+LIB_CLIENT_IDL = SALOMEDS_Attributes.idl GEOM_Kinematic.idl
LIB_SERVER_IDL =
diff --git a/src/GEOM_SWIG/Makefile.in b/src/GEOM_SWIG/Makefile.in
index 6ea27169e..5984c7dce 100644
--- a/src/GEOM_SWIG/Makefile.in
+++ b/src/GEOM_SWIG/Makefile.in
@@ -58,6 +58,7 @@ LIB_CLIENT_IDL = SALOMEDS.idl \
SALOME_Exception.idl \
GEOM_Gen.idl \
GEOM_Shape.idl \
+ GEOM_Kinematic.idl \
SALOME_Component.idl
EXPORT_SHAREDPYSCRIPTS=\
diff --git a/src/GEOM_SWIG/geompy.py b/src/GEOM_SWIG/geompy.py
index 1e74b2938..4cfc0184f 100644
--- a/src/GEOM_SWIG/geompy.py
+++ b/src/GEOM_SWIG/geompy.py
@@ -115,7 +115,7 @@ def addToStudy(aShape, aName):
#NRI : BugID 1682 : sg = SALOMEGUI_Swig()
#NRI : BugID 1682 : sg.updateObjBrowser(0)
- salome.sg.updateObjBrowser(0)
+# salome.sg.updateObjBrowser(0)
return id
def addToStudyInFather(aFather, aShape, aName):
@@ -141,7 +141,7 @@ def addToStudyInFather(aFather, aShape, aName):
addArguments( aShape )
#NRI : BugID 1682 : sg.updateObjBrowser(0)
- salome.sg.updateObjBrowser(0)
+# salome.sg.updateObjBrowser(0)
return id
# -----------------------------------------------------------------------------
diff --git a/src/GenerationGUI/Makefile.in b/src/GenerationGUI/Makefile.in
index 06eb796c0..f0da705f0 100644
--- a/src/GenerationGUI/Makefile.in
+++ b/src/GenerationGUI/Makefile.in
@@ -53,7 +53,7 @@ LIB_MOC = \
GenerationGUI_FillingDlg.h \
GenerationGUI_PipeDlg.h
-LIB_CLIENT_IDL =
+LIB_CLIENT_IDL = GEOM_Kinematic.idl
LIB_SERVER_IDL =
diff --git a/src/KINEMATIC/Kinematic_Animation.cxx b/src/KINEMATIC/Kinematic_Animation.cxx
new file mode 100644
index 000000000..4b397f5f1
--- /dev/null
+++ b/src/KINEMATIC/Kinematic_Animation.cxx
@@ -0,0 +1,240 @@
+// 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_Animation.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+using namespace std;
+#include "Kinematic_Animation.hxx"
+
+#include
+#include
+#include
+
+//=======================================================================
+// profile
+// command to build a profile
+//=======================================================================
+Kinematic_Animation::Kinematic_Animation(){}
+
+
+//=======================================================================
+// profile
+// command to build a profile
+//=======================================================================
+Kinematic_Animation::Kinematic_Animation(Kinematic_Assembly* Ass, TopoDS_Shape frame,
+ double duration, int nbseq, bool isinloop)
+{
+ myAss = Ass;
+ myFrame = frame;
+ myDuration = duration;
+ myNbSeq = nbseq;
+ myIsInLoop = isinloop;
+ IsCreated = false;
+ myNbAIS = 1;
+ this->SetMap();
+
+ return;
+}
+
+
+//=================================================================================
+// function : ~Kinematic_Animation()
+// purpose : Destroys the object and frees any allocated resources
+//=================================================================================
+Kinematic_Animation::~Kinematic_Animation() {}
+
+
+//=================================================================================
+// function : SetMap()
+// purpose :
+//=================================================================================
+void Kinematic_Animation::SetMap()
+{
+ list ContactList = myAss->GetContactList();
+ Kinematic_Contact* aContact;
+
+ list ::const_iterator it = ContactList.begin();
+ while(it != ContactList.end()) {
+ aContact = *it;
+ if(!myIndexToShape.Contains(aContact->Shape1()))
+ myIndexToShape.Add(aContact->Shape1());
+
+ if(!myIndexToShape.Contains(aContact->Shape2()))
+ myIndexToShape.Add(aContact->Shape2());
+
+ it++;
+ }
+
+ for(int i = 1; i <= myIndexToShape.Extent(); i++) {
+ it = ContactList.begin();
+ list ContactListOfShape;
+ TopoDS_Shape myShape = myIndexToShape.FindKey(i);
+ while(it != ContactList.end()) {
+ aContact = *it;
+ if(myShape == aContact->Shape1() || myShape == aContact->Shape2())
+ ContactListOfShape.push_back(aContact);
+ it++;
+ }
+ myStlMapofShapeListOfContact[i] = ContactListOfShape;
+ }
+
+ return;
+}
+
+
+//=================================================================================
+// function : Animate()
+// purpose :
+//=================================================================================
+void Kinematic_Animation::Animate(const Handle(AIS_InteractiveContext)& ic)
+{
+ bool IsOk = false;
+ for(int cpt = 1; cpt <= myIndexToShape.Extent(); cpt++) {
+ TopoDS_Shape myShape = myIndexToShape.FindKey(cpt);
+ if(myShape == myFrame)
+ IsOk = true;
+ }
+ if(!IsOk)
+ return;
+
+ myMovedShape.Clear();
+ myMovedShape.Add(myFrame);
+
+ IsCreated = false;
+ gp_Trsf aLoc;
+ GetNextShape(ic, aLoc, myFrame, 1);
+ IsCreated = true;
+
+ Handle(AIS_Shape) mySimulationShape;
+ mySimulationShape = new AIS_Shape(TopoDS_Shape());
+ mySimulationShape->Set(myFrame);
+ mySimulationShape->SetColor(Quantity_NOC_RED);
+ ic->Deactivate(mySimulationShape);
+ ic->Display(mySimulationShape, Standard_False);
+ ic->UpdateCurrentViewer();
+
+ double Step, Val;
+ Step = 1.0 / myNbSeq;
+ for(int i = 0; i <= myNbSeq; i++) {
+ Val = i * Step;
+
+ myMovedShape.Clear();
+ myMovedShape.Add(myFrame);
+
+ myNbAIS = 1;
+ GetNextShape(ic, aLoc, myFrame, Val);
+
+ ic->UpdateCurrentViewer();
+ usleep(myDuration / myNbSeq * 1e6);
+ }
+
+ ic->Erase(mySimulationShape, Standard_True, Standard_False);
+ ic->ClearPrs(mySimulationShape);
+
+ for(int i = 1; i <= myNbAIS; i++) {
+ Handle(AIS_Shape) myShape = Handle(AIS_Shape)::DownCast(ListOfAIS.Value(i));
+ ic->Erase(myShape, Standard_True, Standard_False);
+ ic->ClearPrs(myShape);
+ }
+
+ ic->UpdateCurrentViewer();
+
+ return;
+}
+
+
+//=================================================================================
+// function : GetNextShape()
+// purpose :
+//=================================================================================
+void Kinematic_Animation::GetNextShape(const Handle(AIS_InteractiveContext)& ic,
+ gp_Trsf& aLoc, TopoDS_Shape Shape1, double Step)
+{
+ int j = 0;
+ list ContactListOfShape;
+ Kinematic_Contact* aContact;
+ TopoDS_Shape myShape, myShape2, aNewShape;
+
+ for(int i = 1; i <= myIndexToShape.Extent(); i++) {
+ myShape = myIndexToShape.FindKey(i);
+ if(myShape == Shape1) {
+ gp_Trsf aNewLoc = aLoc;
+ ContactListOfShape = myStlMapofShapeListOfContact[i];
+ list ::const_iterator it = ContactListOfShape.begin();
+ while(it != ContactListOfShape.end()) {
+ aContact = *it;
+ if(aContact->Shape1() == Shape1)
+ myShape2 = aContact->Shape2();
+ else if(aContact->Shape2() == Shape1)
+ myShape2 = aContact->Shape1();
+
+ if(!myMovedShape.Contains(myShape2)) {
+ myMovedShape.Add(myShape2);
+
+ if(!IsCreated) {
+ Handle(AIS_Shape) mySimulationShape;
+ mySimulationShape = new AIS_Shape(TopoDS_Shape());
+ mySimulationShape->Set(myShape2);
+ mySimulationShape->SetColor(Quantity_NOC_GREEN);
+ ic->Deactivate(mySimulationShape);
+ ListOfAIS.Append(mySimulationShape);
+ }
+ else
+ MoveShape(ic, aLoc, aContact, Step);
+
+ GetNextShape(ic, aLoc, myShape2, Step);
+ }
+ aLoc = aNewLoc;
+ it++;
+ }
+ return;
+ }
+ }
+ return;
+}
+
+
+//=================================================================================
+// function : CreateShape()
+// purpose :
+//=================================================================================
+void Kinematic_Animation::MoveShape(const Handle(AIS_InteractiveContext)& ic,
+ gp_Trsf& aLoc, Kinematic_Contact* aContact,
+ double Step)
+{
+ gp_Trsf aTrans = aContact->GetTransformation(Step);
+ aLoc = aLoc * aTrans;
+
+ Handle(AIS_Shape) mySimulationShape = Handle(AIS_Shape)::DownCast(ListOfAIS.Value(myNbAIS));
+ Handle(Geom_Transformation) aGTrans = new Geom_Transformation();
+ aGTrans->SetTrsf(aLoc);
+ mySimulationShape->SetTransformation(aGTrans, false, false);
+
+ ic->Display(mySimulationShape, Standard_False);
+
+ myNbAIS++;
+ return;
+}
diff --git a/src/KINEMATIC/Kinematic_Animation.hxx b/src/KINEMATIC/Kinematic_Animation.hxx
new file mode 100644
index 000000000..8bac2acc6
--- /dev/null
+++ b/src/KINEMATIC/Kinematic_Animation.hxx
@@ -0,0 +1,80 @@
+// 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_Animation.hxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef _KINEMATIC_ANIMATION_HXX
+#define _KINEMATIC_ANIMATION_HXX
+
+#include "Kinematic_Assembly.hxx"
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include