]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Introduce two new signals: for clearing a triangulation, and for any_change, a catch...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 3 Jun 2011 01:39:28 +0000 (01:39 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 3 Jun 2011 01:39:28 +0000 (01:39 +0000)
git-svn-id: https://svn.dealii.org/trunk@23778 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/grid/tria.h
deal.II/source/fe/fe_values.cc
deal.II/source/grid/tria.cc

index 78e2033a6bfaf06ee4c8f02be42aae497c6caaaf..71860e83a40dd9ea63ae853f4ce91c3ed88ff057 100644 (file)
@@ -1239,6 +1239,12 @@ namespace internal
  *     the signal is copied by another triangulation using
  *     Triangulation::copy_triangulation (i.e. it is triggered on the <i>old</i>
  *     triangulation, but the new one is passed as a argument).
+ *   - clear: This signal is triggered whenever the Trianagultion::clear 
+ *     function is called.
+ *   - any_change: This is a catch-all signal that is triggered whenever the
+ *     create, post_refinement, or clear signals are triggered. In effect, it
+ *     can be used to indicate to an object connected to the signal that the
+ *     triangulation has been changed, whatever the exact cause of the change.
  * 
  * 
  *   <h3>Technical details</h3>
@@ -2195,6 +2201,8 @@ class Triangulation : public Subscriptor
       boost::signals2::signal<void ()> pre_refinement;
       boost::signals2::signal<void ()> post_refinement;
       boost::signals2::signal<void (const Triangulation<dim, spacedim> &original_tria)> copy;
+      boost::signals2::signal<void ()> clear;
+      boost::signals2::signal<void ()> any_change;
     };
     
     /**
index 6b0860fe18a97fca3802fccd457b8b4889cfdde9..fc38ad5f80651e18f65fbb6509131fd535dac200 100644 (file)
@@ -3269,7 +3269,7 @@ maybe_invalidate_previous_present_cell (const typename Triangulation<dim,spacedi
        tria_listener.disconnect ();
        invalidate_present_cell();
        tria_listener = 
-         cell->get_triangulation().signals.post_refinement.connect
+         cell->get_triangulation().signals.any_change.connect
          (std_cxx1x::bind (&FEValuesBase<dim,spacedim>::invalidate_present_cell,
                            std_cxx1x::ref(static_cast<FEValuesBase<dim,spacedim>&>(*this))));
       }
index 1846793630f0ec3d3fd9c35bb06369cc31c16735..611fee0721086682578a688d4469caba19dcd1d9 100644 (file)
@@ -9384,6 +9384,11 @@ Triangulation (const MeshSmoothing smooth_grid,
                                   // possible components
   for (unsigned int i=0;i<255;++i)
     boundary[i] = &straight_boundary;
+  
+  // connect the any_change signal to the other signals
+  signals.create.connect (signals.any_change);
+  signals.post_refinement.connect (signals.any_change);
+  signals.clear.connect (signals.any_change);
 }
 
 
@@ -9417,6 +9422,7 @@ template <int dim, int spacedim>
 void Triangulation<dim, spacedim>::clear ()
 {
   clear_despite_subscriptions();
+  signals.clear();
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.