Salome HOME
Merge branch 'V9_9_BR'
[modules/smesh.git] / src / StdMeshers_I / StdMeshers_ProjectionSource3D_i.cxx
index 062602d89f4f2dce0f7a8db94a482b313f0cb0b8..dc62345b50562c314e3764e56216edfa68b93a03 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -74,7 +74,6 @@ StdMeshers_ProjectionSource3D_i::~StdMeshers_ProjectionSource3D_i()
 //=============================================================================
 
 void StdMeshers_ProjectionSource3D_i::SetSource3DShape(GEOM::GEOM_Object_ptr shape)
-  throw ( SALOME::SALOME_Exception )
 {
   ASSERT( myBaseImpl );
   try {
@@ -97,7 +96,6 @@ void StdMeshers_ProjectionSource3D_i::SetSource3DShape(GEOM::GEOM_Object_ptr sha
 //=============================================================================
 
 void StdMeshers_ProjectionSource3D_i::SetSourceMesh(SMESH::SMESH_Mesh_ptr theMesh)
-  throw ( SALOME::SALOME_Exception )
 {
   ASSERT( myBaseImpl );
 
@@ -148,7 +146,6 @@ void StdMeshers_ProjectionSource3D_i::SetVertexAssociation(GEOM::GEOM_Object_ptr
                                                            GEOM::GEOM_Object_ptr sourceVertex2,
                                                            GEOM::GEOM_Object_ptr targetVertex1,
                                                            GEOM::GEOM_Object_ptr targetVertex2)
-  throw ( SALOME::SALOME_Exception )
 {
   ASSERT( myBaseImpl );
   try {
@@ -312,3 +309,48 @@ void StdMeshers_ProjectionSource3D_i::LoadFrom( const char* theStream )
     str >> myShapeEntries[ i ];
 }
 
+//================================================================================
+/*!
+ * \brief Return geometry this hypothesis depends on. Return false if there is no geometry parameter
+ */
+//================================================================================
+
+bool
+StdMeshers_ProjectionSource3D_i::getObjectsDependOn( std::vector< std::string > & entryArray,
+                                                     std::vector< int >         & /*subIDArray*/ ) const
+{
+  for ( int i = 0; i < NB_SHAPES; ++i )
+    entryArray.push_back( myShapeEntries[ i ]);
+
+  return true;
+}
+
+//================================================================================
+/*!
+ * \brief Set new geometry instead of that returned by getObjectsDependOn()
+ */
+//================================================================================
+
+bool
+StdMeshers_ProjectionSource3D_i::setObjectsDependOn( std::vector< std::string > & entryArray,
+                                                     std::vector< int >         & /*subIDArray*/ )
+{
+  TopoDS_Shape shapes[ NB_SHAPES ];
+  for ( int i = 0; i < NB_SHAPES; ++i )
+  {
+    myShapeEntries[ i ] = entryArray[ i ];
+    shapes[ i ] = StdMeshers_ObjRefUlils::EntryToShape( entryArray[ i ]);
+  }
+
+  try {
+    GetImpl()->SetSource3DShape    ( shapes[ SRC_SHAPE3D ] );
+    GetImpl()->SetVertexAssociation( shapes[ SRC_VERTEX1 ],
+                                     shapes[ SRC_VERTEX2 ],
+                                     shapes[ TGT_VERTEX1 ],
+                                     shapes[ TGT_VERTEX2 ]);
+  }
+  catch (...) {
+    return false;
+  }
+  return true;
+}