title
Graph Drawing Toolkit

An object-oriented C++ library for handling and drawing graphs

rm3_constraints.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002 +
00003 +  rm3_constraints.h
00004 +
00005 +  This file is part of GDToolkit. It can be 
00006 +  used free of charge in academic research and teaching. 
00007 +  Any direct or indirect commercial use of this software is illegal 
00008 +  without a written authorization of
00009 +  the Dipartimento di Informatica e Automazione
00010 +  Universita' di Roma Tre, Roma, ITALIA
00011 +  
00012 *******************************************************************************/
00016 #ifndef RM3_CONSTRAINTS_H
00017 #define RM3_CONSTRAINTS_H
00018 
00019 #if !defined(ROOT_INCL_ID)
00020 #define ROOT_INCL_ID 34014
00021 #endif
00022 
00023 #include <fstream>
00024 #include <GDT/gdtlist.h>
00025 #include <GDT/gdt_graph_array.h>
00026 #include <GDT/gdtgeometry.h>
00027 #include <GDT/rm3_global.h>
00028 
00029         typedef enum
00030         {
00031         UNCROSSABLE_EDGES,
00032         NUMBER_OF_BENDS_ON_EDGE,
00033         BEND_DIRECTION_ON_EDGE,
00034         SAME_FACE_NODES,
00035         SAME_FACE_ORDERED_NODES,
00036         NODE_WIDTH,
00037         NODE_HEIGHT,
00038         ANGLE_SWEEP,
00039         EDGE_ATTACHMENT_WRT_PREVIOUS_CORNER,
00040         MIN_TIEING
00041         }
00042 constraint_type;
00043 
00044 class undi_graph;                                       // forward declaration
00045 class orth_plan_undi_graph;                             // forward declaration
00046 class upwa_plan_undi_graph;                             // forward declaration
00047 class struct_constraint;                                // forward declaration
00048 class struct_constraint_uncrossable_edge;               // forward declaration
00049 class struct_constraint_number_of_bends_on_edge;        // forward declaration
00050 class struct_constraint_bend_direction_on_edge;         // forward declaration
00051 class struct_constraint_same_face_node;                 // forward declaration
00052 class struct_constraint_same_face_ordered_nodes;        // forward declaration
00053 class struct_constraint_node_width;                     // forward declaration
00054 class struct_constraint_node_height;                    // forward declaration
00055 class struct_constraint_angle_sweep;                    // forward declaration
00056 class struct_constraint_edge_attachment_wrt_previous_corner;    // forward declaration
00057 class struct_constraint_min_tieing;                     // forward declaration
00058 
00059         typedef struct_constraint* 
00060 constraint;
00061 
00062         typedef struct_constraint_uncrossable_edge* 
00063 constraint_uncrossable_edge;
00064 
00065         typedef struct_constraint_number_of_bends_on_edge*
00066 constraint_number_of_bends_on_edge;
00067 
00068         typedef struct_constraint_bend_direction_on_edge*
00069 constraint_bend_direction_on_edge;
00070 
00071         typedef struct_constraint_same_face_node*
00072 constraint_same_face_node;
00073 
00074         typedef struct_constraint_same_face_ordered_nodes*
00075 constraint_same_face_ordered_nodes;
00076 
00077         typedef struct_constraint_node_width* 
00078 constraint_node_width;
00079 
00080         typedef struct_constraint_node_height* 
00081 constraint_node_height;
00082 
00083         typedef struct_constraint_angle_sweep* 
00084 constraint_angle_sweep;
00085 
00086         typedef struct_constraint_edge_attachment_wrt_previous_corner* 
00087 constraint_edge_attachment_wrt_previous_corner;
00088 
00089         typedef struct_constraint_min_tieing*
00090 constraint_min_tieing;
00091 
00092 
00093 //-----------------------------------------------------------------------------
00094 // struct_constraint: abstract class for all constraints of undi_graph class
00095 //
00096 // (1998)
00097 //-----------------------------------------------------------------------------
00098 
00099 
00100 /* WARNING: 
00101         THE FOLLOWING COMMENTS COULD BE USEFUL IF ANY RE-DESIGN WILL BE UNDERTAKEN IN THE FUTURE.
00102         
00103         We recognize a very bad programming practice here.
00104         struct_constraint and its descendants directely access undi_graph internal structure.
00105         See for example the destructors and undi_graph::local_del
00106         This is an unnecessary coupling, since deletion of constraints is only performed by undi_graph.
00107         Pizzo & PJ
00108 */
00109 
00110         class GDT_NONSTANDARD_DECL
00111 struct_constraint      // ABSTRACT CLASS
00112         {
00113         friend class undi_graph;                
00114         
00115         private:
00116 
00117                 // -----------------
00118                 // private variables
00119                 // -----------------
00120 
00121                 
00122                 constraint_type type;                           // type of constraint
00123                 undi_graph*     owner_graph;                    // graph whome the constraint belongs to
00124                 gdt::list_item       pos_in_owner_graph_list;   // position in owner graph constraint list
00125 
00126                 // ---------------
00127                 // private methods
00128                 // ---------------
00129 
00130                 void set_id                     (const int);                    // assign constraint-identifier with int
00131                 void set_type                   (const constraint_type);        // assign type of constraint with constraint_type
00132                 void set_owner_graph            (undi_graph&);                  // assign the graph whome the constraint belongs to
00133                 void set_pos_in_owner_graph_list(const gdt::list_item);         // assign the graph whome the constraint belongs to
00134                         
00135                 
00136         protected: 
00137                 
00138                 int             id;                             // constraint-identifier
00139                 
00140                 // ----------------------
00141                 // protected constructors
00142                 // ----------------------
00143         
00144                 struct_constraint (constraint_type, undi_graph&);       // create new struct_constraint, and put it in owner_graph constraint list
00145                 
00146                 void remove_from_owner_graph_list();                    // remove constraint from the owner graph constraint list
00147                 void remove_from_edge_list       (gdtedge);             // remove constraint from the gdtedge constraint list
00148                 void remove_from_node_list       (gdtnode);             // remove constraint from the gdtnode constraint list
00149                 
00150                 gdt::list_item add_to_edge_list  (gdtedge);             // add constraint to the gdtedge constraint list
00151                 gdt::list_item add_to_node_list  (gdtnode);             // add constraint to the gdtnode constraint list
00152                 
00153                 // ------------------------------------------------------------
00154                 // Updating operations (intelligent handling of constraints)
00155                 // 
00156                 // all methods below must be reimplemented for each constraint
00157                 // ------------------------------------------------------------
00158                 
00159         virtual bool update_after_del_edge (gdtedge e) = 0;                     // update constraint after gdtedge e is deleted and return true if the constraint can be deleted after updating
00160         virtual bool update_after_del_node (gdtnode e) = 0;                     // update constraint after gdtnode v is deleted and return true if the constraint can be deleted after updating
00161         
00162         virtual bool update_after_split_edge (gdtedge e, gdtedge e1, gdtedge e2) = 0;   // update constraint after gdtedge e is splitted into two new edges e1, e2 and return true if the constraint can be deleted after updating
00163         virtual bool update_after_split_node (gdtnode v, gdtnode v1, gdtnode v2) = 0;   // update constraint after gdtnode v is splitted into two new nodes v1, ve and return true if the constraint can be deleted after updating
00164                 
00165         virtual bool update_after_merge_edges (gdtedge e1, gdtedge e2, gdtedge e) = 0;  // update constraint after edges e1, e2 are merged into an gdtedge e, and return true if the constraint can be deleted after updating
00166         virtual bool update_after_merge_nodes (gdtnode v1, gdtnode v2, gdtnode v) = 0;  // update constraint after nodes v1, v2 are merged into a gdtnode v, and return true if the constraint can be deleted after updating
00167         
00168         virtual void update_after_edge_translation 
00169                         (
00170                         gdtedge e  , 
00171                         gdtnode ve1, 
00172                         gdtnode ve2, 
00173                         gdtedge d  ,
00174                         gdtnode vd1,
00175                         gdtnode vd2
00176                         ) = 0;                                                  // see below..
00177                         
00178                         // --------------------------------------------------
00179                         // translate the constraint from gdtedge e to gdtedge d.
00180                         // vd1 and vd2 are the extremal nodes of d that 
00181                         // replace the extremal nodes ve1 and ve2 of e, 
00182                         // respectively.
00183                         // --------------------------------------------------
00184                         
00185 
00186                 
00187         virtual void update_on_path_replacing_edge
00188                         (
00189                         gdtedge e,
00190                         gdt::gdtlist<gdtedge> path,
00191                         undi_graph& ug
00192                         ) = 0;                                                  // see below..
00193                 
00194                 // ---------------------------------------------------------------------------------------
00195                 // generate new constraints for path, which replaces gdtedge e. based on this constraint.
00196                 // If gdtedge e is not present in constraint, nothing to do.
00197                 // NOTICE: - path is a sequence of edges of ug;
00198                 //         - e is an gdtedge of owner_graph of c (not necessarily ug) 
00199                 //         - the extremal nodes of e must have the same id than the extremal nodes of path
00200                 // ---------------------------------------------------------------------------------------
00201         
00202                 
00203         public: 
00204 
00205                 // --------------------------
00206                 // Constructors and Operators
00207                 // --------------------------
00208                 
00209                 
00210                 virtual         ~struct_constraint();                                   // destructor
00211         
00212                 // -----------------
00213                 // Access operations
00214                 // -----------------
00215                 
00216                 int             get_id  () const;                       // return constraint-identifier
00217                 constraint_type get_type() const;                       // return type of constraint
00218                 undi_graph&     get_owner_graph() const;                // return type of constraint
00219                 gdt::list_item  get_pos_in_owner_graph_list() const;    // return type of constraint
00220                 
00221                 // --------------------
00222                 // Translate operations
00223                 // --------------------
00224 
00225                 virtual         constraint copy(undi_graph&) = 0;       // copy current constraint from owner_graph to undi_graph if it is possible
00226                                                                         // and return pointer to new constraint (NULL_CONSTRAINT if constraint is not copied)
00227 
00228                 // -------------------------
00229                 // Input / output operations
00230                 // -------------------------
00231 
00232                 virtual   void print (std::ostream& os=std::cout) const = 0;
00233         };
00234 
00235 
00236 
00237 //-----------------------------------------------------------------------------
00238 // UNCROSSABLE_EDGES constraint: planarization constraint specifying that the
00239 //                               gdtedge can not be crossed
00240 //
00241 // (1998)
00242 //-----------------------------------------------------------------------------
00243 
00244         class GDT_NONSTANDARD_DECL
00245 struct_constraint_uncrossable_edge: public struct_constraint
00246         {
00247 
00248         friend class undi_graph;
00249                 
00250         private:
00251 
00252                 // -----------------
00253                 // private variables
00254                 // -----------------
00255 
00256                 gdtedge uncrossable_edge;
00257 
00258                 // ---------------
00259                 // private methods
00260                 // ---------------
00261 
00262                 void set_uncrossable_edge(gdtedge);
00263         
00264         
00265                 // --------------------
00266                 // private constructors
00267                 // --------------------
00268 
00269                 struct_constraint_uncrossable_edge(gdtedge, undi_graph&);
00270 
00271 
00272         protected:
00273         
00274                 // ---------------------------------------------------------
00275                 // Updating operations (intelligent handling of constraints)
00276                 // ---------------------------------------------------------
00277                 
00278                 bool update_after_del_edge (gdtedge e);                         // update constraint after gdtedge e is deleted and return true if the constraint can be deleted after updating
00279                 bool update_after_del_node (gdtnode v);                         // update constraint after gdtnode v is deleted and return true if the constraint can be deleted after updating         
00280                 
00281                 bool update_after_split_edge (gdtedge e, gdtedge e1, gdtedge e2);       // update constraint after gdtedge e is splitted into two new edges e1, e2 and return true if the constraint can be deleted after updating
00282                 bool update_after_split_node (gdtnode v, gdtnode v1, gdtnode v2);       // update constraint after gdtnode v is splitted into two new nodes v1, ve and return true if the constraint can be deleted after updating
00283                 
00284                 bool update_after_merge_edges (gdtedge e1, gdtedge e2, gdtedge e);      // update constraint after edges e1, e2 are merged into an gdtedge e, and return true if the constraint can be deleted after updating
00285                 bool update_after_merge_nodes (gdtnode v1, gdtnode v2, gdtnode v);      // update constraint after nodes v1, v2 are merged into a gdtnode v, and return true if the constraint can be deleted after updating
00286 
00287                 void update_after_edge_translation 
00288                         (
00289                         gdtedge e  , 
00290                         gdtnode ve1, 
00291                         gdtnode ve2, 
00292                         gdtedge d  ,
00293                         gdtnode vd1,
00294                         gdtnode vd2
00295                         );                                                      // see below..
00296                         
00297                         // --------------------------------------------------
00298                         // translate the constraint from gdtedge e to gdtedge d.
00299                         // vd1 and vd2 are the extremal nodes of d that 
00300                         // replace the extremal nodes ve1 and ve2 of e, 
00301                         // respectively.
00302                         // --------------------------------------------------
00303                         
00304                 
00305                 void update_on_path_replacing_edge
00306                         (
00307                         gdtedge e,
00308                         gdt::gdtlist<gdtedge> path,
00309                         undi_graph& ug
00310                         );                                                      // see below..
00311                 
00312                 // ---------------------------------------------------------------------------------------
00313                 // generate new constraints for path, which replaces gdtedge e, based on this constraint.
00314                 // If gdtedge e is not present in constraint, nothing to do.
00315                 // NOTICE: - path is a sequence of edges of ug;
00316                 //         - e is an gdtedge of owner_graph of c (not necessarily ug) 
00317                 //         - the extremal nodes of e must have the same id than the extremal nodes of path
00318                 // ---------------------------------------------------------------------------------------
00319         
00320         
00321 
00322 
00323         public: 
00324 
00325                 // --------------------------
00326                 // Constructors and Operators
00327                 // --------------------------
00328 
00329                  ~struct_constraint_uncrossable_edge();
00330 
00331                 // -----------------
00332                 // Access operations
00333                 // -----------------
00334 
00335                  gdtedge get_uncrossable_edge() const;
00336 
00337                 // --------------------
00338                 // Translate operations
00339                 // --------------------
00340                 
00341                  constraint copy(undi_graph&);  // copy current constraint from owner_graph to undi_graph, if it is possible,
00342                                                 // and the new constraint (NULL_CONSTRAINT if constraint is not copied)
00343 
00344                 // -------------------------
00345                 // Input / output operations
00346                 // -------------------------
00347 
00348                  void print (std::ostream& os=std::cout) const;
00349 
00350         };
00351 
00352 
00353 //-----------------------------------------------------------------------------
00354 // NUMBER_OF_BENDS_ON_EDGE constraints: constraint on the number of bends on an
00355 //                                      an gdtedge of an orthogonal drawing or an
00356 //                                      upward drawing.
00357 //                                      Possible constraints are
00358 //                                      NONE    = no bends on gdtedge (straight gdtedge);
00359 //                                      ANY     = any number of bends;
00360 //
00361 // (1998)
00362 //-----------------------------------------------------------------------------
00363 
00364 
00365 // ----------------------------------------------------------------------
00366 // enumerate types for gdtedge-bend constraints in planar drawing algorithms
00367 // ----------------------------------------------------------------------
00368 
00369         typedef enum
00370         {
00371         NONE,                   // no bend on gdtedge
00372         ANY,                    // any number of bends on gdtedge
00373         MINIMAL                 // a minimal number of bends on the total of edges (default in flow algorithms)
00374                                 // NOTICE: this value can not be used for setting new constraints
00375         }
00376 bend_constraint;
00377 
00378 
00379         class GDT_NONSTANDARD_DECL
00380 struct_constraint_number_of_bends_on_edge: public struct_constraint
00381         {
00382 
00383         friend class undi_graph;
00384         friend class orth_plan_undi_graph;
00385         friend class upwa_plan_undi_graph;
00386                 
00387         private:
00388 
00389                 // -----------------
00390                 // private variables
00391                 // -----------------
00392 
00393                 gdtedge                 edge_with_nbc;          // gdtedge with bend_constraint
00394                 bend_constraint nbc;                    // number_of_bends constraint
00395 
00396                 // ---------------
00397                 // private methods
00398                 // ---------------
00399 
00400                 void set_edge_with_nbc  (gdtedge);                      
00401                 void set_nbc            (bend_constraint);      
00402                 
00403 
00404                 // --------------------
00405                 // private constructors
00406                 // --------------------
00407 
00408                 struct_constraint_number_of_bends_on_edge (gdtedge, bend_constraint, undi_graph&);
00409                 
00410                 
00411         protected:
00412 
00413                 // ---------------------------------------------------------
00414                 // Updating operations (intelligent handling of constraints)
00415                 // ---------------------------------------------------------
00416                 
00417                 bool update_after_del_edge (gdtedge e);                         // update constraint after gdtedge e is deleted and return true if the constraint can be deleted after updating
00418                 bool update_after_del_node (gdtnode v);                         // update constraint after gdtnode v is deleted and return true if the constraint can be deleted after updating         
00419                 
00420                 bool update_after_split_edge (gdtedge e, gdtedge e1, gdtedge e2);       // update constraint after gdtedge e is splitted into two new edges e1, e2 and return true if the constraint can be deleted after updating
00421                 bool update_after_split_node (gdtnode v, gdtnode v1, gdtnode v2);       // update constraint after gdtnode v is splitted into two new nodes v1, ve and return true if the constraint can be deleted after updating
00422                 
00423                 bool update_after_merge_edges (gdtedge e1, gdtedge e2, gdtedge e);      // update constraint after edges e1, e2 are merged into an gdtedge e, and return true if the constraint can be deleted after updating
00424                 bool update_after_merge_nodes (gdtnode v1, gdtnode v2, gdtnode v);      // update constraint after nodes v1, v2 are merged into a gdtnode v, and return true if the constraint can be deleted after updating
00425 
00426                 void update_after_edge_translation 
00427                         (
00428                         gdtedge e  , 
00429                         gdtnode ve1, 
00430                         gdtnode ve2, 
00431                         gdtedge d  ,
00432                         gdtnode vd1,
00433                         gdtnode vd2
00434                         );                                                      // see below..
00435                         
00436                         // --------------------------------------------------
00437                         // translate the constraint from gdtedge e to gdtedge d.
00438                         // vd1 and vd2 are the extremal nodes of d that 
00439                         // replace the extremal nodes ve1 and ve2 of e, 
00440                         // respectively.
00441                         // --------------------------------------------------
00442                 
00443                 void update_on_path_replacing_edge
00444                         (
00445                         gdtedge e,
00446                         gdt::gdtlist<gdtedge> path,
00447                         undi_graph& ug
00448                         );                                                      // see below..
00449                 
00450                 // ---------------------------------------------------------------------------------------
00451                 // generate new constraints for path, which replaces gdtedge e, based on this constraint.
00452                 // If gdtedge e is not present in constraint, nothing to do.
00453                 // NOTICE: - path is a sequence of edges of ug;
00454                 //         - e is an gdtedge of owner_graph of c (not necessarily ug) 
00455                 //         - the extremal nodes of e must have the same id than the extremal nodes of path
00456                 // ---------------------------------------------------------------------------------------
00457         
00458 
00459         public: 
00460 
00461                 // --------------------------
00462                 // Constructors and Operators
00463                 // --------------------------
00464 
00465                  ~struct_constraint_number_of_bends_on_edge();
00466 
00467                 // -----------------
00468                 // Access operations
00469                 // -----------------
00470 
00471                  gdtedge                get_edge_with_nbc () const;     
00472                  bend_constraint        get_nbc           () const;
00473 
00474                 // --------------------
00475                 // Translate operations
00476                 // --------------------
00477                 
00478                  constraint copy(undi_graph&);  // copy current constraint from owner_graph to undi_graph, if it is possible,
00479                                                 // and return the new constraint (NULL_CONSTRAINT if constraint is not copied)
00480                 
00481                 
00482                 // -------------------------
00483                 // Input / output operations
00484                 // -------------------------
00485 
00486                  void print (std::ostream& os=std::cout) const;
00487 
00488         };
00489 
00490 //--------------------------------------------------------------------------------
00491 // BEND_DIRECTION_ON_EDGE constraints:  constraint on the bend direction on
00492 //                                      an gdtedge of an orthogonal drawing or an
00493 //                                      upward drawing.
00494 //                                      Constraint is specified by two parameters:
00495 //                                      gdtedge e, gdtnode v, and it indicates that gdtedge e
00496 //                                      can be spiralize only from the left face
00497 //                                      to the right face, moving along gdtedge e
00498 //                                      starting from gdtnode v.
00499 //                                      Obiouvsly, v must be an extremal gdtnode of e
00500 // (1998)
00501 //--------------------------------------------------------------------------------
00502 
00503 
00504         class GDT_NONSTANDARD_DECL
00505 struct_constraint_bend_direction_on_edge: public struct_constraint
00506         {
00507         friend class undi_graph;
00508         friend class orth_plan_undi_graph;
00509         friend class upwa_plan_undi_graph;
00510                 
00511         private:
00512 
00513                 // -----------------
00514                 // private variables
00515                 // -----------------
00516 
00517                 gdtedge edge_with_bdc;          // gdtedge with bend_direction constraint
00518                 gdtnode start_node;             // start gdtnode for evaluating direction
00519 
00520                 // ---------------
00521                 // private methods
00522                 // ---------------
00523 
00524                 void set_edge_with_bdc  (gdtedge);                      
00525                 void set_start_node     (gdtnode);      
00526 
00527                 // --------------------
00528                 // private constructors
00529                 // --------------------
00530 
00531                 struct_constraint_bend_direction_on_edge (gdtedge, gdtnode, undi_graph&);
00532                 
00533         protected:
00534         
00535                 // ---------------------------------------------------------
00536                 // Updating operations (intelligent handling of constraints)
00537                 // ---------------------------------------------------------
00538                 
00539                 bool update_after_del_edge (gdtedge e);                         // update constraint after gdtedge e is deleted and return true if the constraint can be deleted after updating
00540                 bool update_after_del_node (gdtnode v);                         // update constraint after gdtnode v is deleted and return true if the constraint can be deleted after updating         
00541                 
00542                 bool update_after_split_edge (gdtedge e, gdtedge e1, gdtedge e2);       // update constraint after gdtedge e is splitted into two new edges e1, e2 and return true if the constraint can be deleted after updating
00543                 bool update_after_split_node (gdtnode v, gdtnode v1, gdtnode v2);       // update constraint after gdtnode v is splitted into two new nodes v1, ve and return true if the constraint can be deleted after updating
00544                 
00545                 bool update_after_merge_edges (gdtedge e1, gdtedge e2, gdtedge e);      // update constraint after edges e1, e2 are merged into an gdtedge e, and return true if the constraint can be deleted after updating
00546                 bool update_after_merge_nodes (gdtnode v1, gdtnode v2, gdtnode v);      // update constraint after nodes v1, v2 are merged into a gdtnode v, and return true if the constraint can be deleted after updating
00547 
00548                 void update_after_edge_translation 
00549                         (
00550                         gdtedge e  , 
00551                         gdtnode ve1, 
00552                         gdtnode ve2, 
00553                         gdtedge d  ,
00554                         gdtnode vd1,
00555                         gdtnode vd2
00556                         );                                                      // see below..
00557                         
00558                         // --------------------------------------------------
00559                         // translate the constraint from gdtedge e to gdtedge d.
00560                         // vd1 and vd2 are the extremal nodes of d that 
00561                         // replace the extremal nodes ve1 and ve2 of e, 
00562                         // respectively.
00563                         // --------------------------------------------------
00564 
00565                 void update_on_path_replacing_edge
00566                         (
00567                         gdtedge e,
00568                         gdt::gdtlist<gdtedge> path,
00569                         undi_graph& ug
00570                         );                                                      // see below..
00571                 
00572                 // ---------------------------------------------------------------------------------------
00573                 // generate new constraints for path, which replaces gdtedge e, based on this constraint.
00574                 // If gdtedge e is not present in constraint, nothing to do.
00575                 // NOTICE: - path is a sequence of edges of ug;
00576                 //         - e is an gdtedge of owner_graph of c (not necessarily ug) 
00577                 //         - the extremal nodes of e must have the same id than the extremal nodes of path
00578                 // ---------------------------------------------------------------------------------------
00579                 
00580 
00581         public: 
00582 
00583                 // --------------------------
00584                 // Constructors and Operators
00585                 // --------------------------
00586 
00587                  ~struct_constraint_bend_direction_on_edge();
00588 
00589                 // -----------------
00590                 // Access operations
00591                 // -----------------
00592 
00593                  gdtedge        get_edge_with_bdc () const;     
00594                  gdtnode        get_start_node    () const;
00595 
00596                 // --------------------
00597                 // Translate operations
00598                 // --------------------
00599                 
00600                  constraint copy(undi_graph&);  // copy current constraint from owner_graph to undi_graph, if it is possible,
00601                                                 // and return the new constraint (NULL_CONSTRAINT if constraint is not copied)
00602 
00603                 // -------------------------
00604                 // Input / output operations
00605                 // -------------------------
00606 
00607                  void print (std::ostream& os=std::cout) const;
00608 
00609         };
00610 
00611 
00612 //-----------------------------------------------------------------------------
00613 // SAME_FACE_NODES constraint: planarization constraint specifying that the
00614 //                             gdtnode must belong to the same face of other nodes
00615 //                             that have the same face-label
00616 //
00617 // (1998)
00618 //-----------------------------------------------------------------------------
00619 
00620         class GDT_NONSTANDARD_DECL
00621 struct_constraint_same_face_node: public struct_constraint
00622         {
00623 
00624         friend class undi_graph;
00625 
00626         private:
00627 
00628                 // -----------------
00629                 // private variables
00630                 // -----------------
00631 
00632                 gdtnode same_face_node;
00633                 int  face_label;
00634 
00635                 // ---------------
00636                 // private methods
00637                 // ---------------
00638 
00639                 void set_same_face_node(gdtnode);
00640                 void set_face_label(int);
00641         
00642         
00643                 // --------------------
00644                 // private constructors
00645                 // --------------------
00646 
00647                 struct_constraint_same_face_node(gdtnode, undi_graph&, int);
00648                 
00649         protected:
00650         
00651                 // ---------------------------------------------------------
00652                 // Updating operations (intelligent handling of constraints)
00653                 // ---------------------------------------------------------
00654                 
00655                 bool update_after_del_edge (gdtedge e);                         // update constraint after gdtedge e is deleted and return true if the constraint can be deleted after updating
00656                 bool update_after_del_node (gdtnode v);                         // update constraint after gdtnode v is deleted and return true if the constraint can be deleted after updating         
00657                 
00658                 bool update_after_split_edge (gdtedge e, gdtedge e1, gdtedge e2);       // update constraint after gdtedge e is splitted into two new edges e1, e2 and return true if the constraint can be deleted after updating
00659                 bool update_after_split_node (gdtnode v, gdtnode v1, gdtnode v2);       // update constraint after gdtnode v is splitted into two new nodes v1, ve and return true if the constraint can be deleted after updating
00660                 
00661                 bool update_after_merge_edges (gdtedge e1, gdtedge e2, gdtedge e);      // update constraint after edges e1, e2 are merged into an gdtedge e, and return true if the constraint can be deleted after updating
00662                 bool update_after_merge_nodes (gdtnode v1, gdtnode v2, gdtnode v);      // update constraint after nodes v1, v2 are merged into a gdtnode v, and return true if the constraint can be deleted after updating
00663 
00664                 void update_after_edge_translation 
00665                         (
00666                         gdtedge e  , 
00667                         gdtnode ve1, 
00668                         gdtnode ve2, 
00669                         gdtedge d  ,
00670                         gdtnode vd1,
00671                         gdtnode vd2
00672                         );                                                      // see below..
00673                         
00674                         // --------------------------------------------------
00675                         // translate the constraint from gdtedge e to gdtedge d.
00676                         // vd1 and vd2 are the extremal nodes of d that 
00677                         // replace the extremal nodes ve1 and ve2 of e, 
00678                         // respectively.
00679                         // --------------------------------------------------
00680 
00681                 
00682                 void update_on_path_replacing_edge
00683                         (
00684                         gdtedge e,
00685                         gdt::gdtlist<gdtedge> path,
00686                         undi_graph& ug
00687                         );                                                      // see below..
00688                 
00689                 // ---------------------------------------------------------------------------------------
00690                 // generate new constraints for path, which replaces gdtedge e, based on this constraint.
00691                 // If gdtedge e is not present in constraint, nothing to do.
00692                 // NOTICE: - path is a sequence of edges of ug;
00693                 //         - e is an gdtedge of owner_graph of c (not necessarily ug) 
00694                 //         - the extremal nodes of e must have the same id than the extremal nodes of path
00695                 // ---------------------------------------------------------------------------------------
00696         
00697         
00698 
00699 
00700         public: 
00701 
00702                 // --------------------------
00703                 // Constructors and Operators
00704                 // --------------------------
00705 
00706                  struct_constraint_same_face_node();
00707                  ~struct_constraint_same_face_node();
00708 
00709                 // -----------------
00710                 // Access operations
00711                 // -----------------
00712 
00713                 gdtnode get_same_face_node() const;
00714                 int  get_face_label() const;
00715 
00716                 // --------------------
00717                 // Translate operations
00718                 // --------------------
00719                 
00720                  constraint copy(undi_graph&);  // copy current constraint from owner_graph to undi_graph, if it is possible,
00721                                                 // and the new constraint (NULL_CONSTRAINT if constraint is not copied)
00722 
00723                 // -------------------------
00724                 // Input / output operations
00725                 // -------------------------
00726 
00727                  void print (std::ostream& os=std::cout) const;
00728 
00729         };
00730 
00731 
00732 //-----------------------------------------------------------------------------
00733 // SAME_FACE_ORDERED_NODES constraint: planarization constraint specifying that
00734 //               the given nodes must belong to the same face in the order they
00735 //               are specified
00736 //-----------------------------------------------------------------------------
00737 
00738         class GDT_NONSTANDARD_DECL
00739 struct_constraint_same_face_ordered_nodes: public struct_constraint
00740         {
00741 
00742         friend class undi_graph;
00743 
00744         private:
00745 
00746                 // -----------------
00747                 // private variables
00748                 // -----------------
00749 
00750                 gdt::gdtlist<gdtnode> node_list;
00751 
00752                 // ---------------
00753                 // private methods
00754                 // ---------------
00755 
00756                 void set_node_list(gdt::gdtlist<gdtnode>&);
00757         
00758                 // --------------------
00759                 // private constructors
00760                 // --------------------
00761 
00762                 struct_constraint_same_face_ordered_nodes(gdt::gdtlist<gdtnode>, undi_graph&);
00763 
00764         protected:
00765         
00766                 // ---------------------------------------------------------
00767                 // Updating operations (intelligent handling of constraints)
00768                 // ---------------------------------------------------------
00769                 
00770                 bool update_after_del_edge (gdtedge e);                         // update constraint after gdtedge e is deleted and return true if the constraint can be deleted after updating
00771                 bool update_after_del_node (gdtnode v);                         // update constraint after gdtnode v is deleted and return true if the constraint can be deleted after updating         
00772                 
00773                 bool update_after_split_edge (gdtedge e, gdtedge e1, gdtedge e2);       // update constraint after gdtedge e is splitted into two new edges e1, e2 and return true if the constraint can be deleted after updating
00774                 bool update_after_split_node (gdtnode v, gdtnode v1, gdtnode v2);       // update constraint after gdtnode v is splitted into two new nodes v1, ve and return true if the constraint can be deleted after updating
00775                 
00776                 bool update_after_merge_edges (gdtedge e1, gdtedge e2, gdtedge e);      // update constraint after edges e1, e2 are merged into an gdtedge e, and return true if the constraint can be deleted after updating
00777                 bool update_after_merge_nodes (gdtnode v1, gdtnode v2, gdtnode v);      // update constraint after nodes v1, v2 are merged into a gdtnode v, and return true if the constraint can be deleted after updating
00778 
00779                 void update_after_edge_translation 
00780                         (
00781                         gdtedge e  , 
00782                         gdtnode ve1, 
00783                         gdtnode ve2, 
00784                         gdtedge d  ,
00785                         gdtnode vd1,
00786                         gdtnode vd2
00787                         );                                                      // see below..
00788                         
00789                         // --------------------------------------------------
00790                         // translate the constraint from gdtedge e to gdtedge d.
00791                         // vd1 and vd2 are the extremal nodes of d that 
00792                         // replace the extremal nodes ve1 and ve2 of e, 
00793                         // respectively.
00794                         // --------------------------------------------------
00795                         
00796                 
00797                 void update_on_path_replacing_edge
00798                         (
00799                         gdtedge e,
00800                         gdt::gdtlist<gdtedge> path,
00801                         undi_graph& ug
00802                         );                                                      // see below..
00803                 
00804                 // ---------------------------------------------------------------------------------------
00805                 // generate new constraints for path, which replaces gdtedge e. based on this constraint.
00806                 // If gdtedge e is not present in constraint, nothing to do.
00807                 // NOTICE: - path is a sequence of edges of ug;
00808                 //         - e is an gdtedge of owner_graph of c (not necessarily ug) 
00809                 //         - the extremal nodes of e must have the same id than the extremal nodes of path
00810                 // ---------------------------------------------------------------------------------------
00811         
00812         
00813 
00814         public: 
00815 
00816                 // --------------------------
00817                 // Constructors and Operators
00818                 // --------------------------
00819 
00820                  ~struct_constraint_same_face_ordered_nodes();
00821 
00822                 // -----------------
00823                 // Access operations
00824                 // -----------------
00825 
00826                 gdt::gdtlist<gdtnode> get_node_list() const;
00827 
00828                 // --------------------
00829                 // Translate operations
00830                 // --------------------
00831                 
00832                  constraint copy(undi_graph&);  // copy current constraint from owner_graph to undi_graph, if it is possible,
00833                                                 // and the new constraint (NULL_CONSTRAINT if constraint is not copied)
00834                 
00835 
00836                 // -------------------------
00837                 // Input / output operations
00838                 // -------------------------
00839 
00840                  void print (std::ostream& os=std::cout) const;
00841         
00842         };
00843 
00844 
00845 //-----------------------------------------------------------------------------
00846 // NODE_WIDTH constraint: fixes the width of a gdtnode in the final drawing
00847 //-----------------------------------------------------------------------------
00848 
00849         class GDT_NONSTANDARD_DECL
00850 struct_constraint_node_width: public struct_constraint
00851         {
00852 
00853         friend class undi_graph;
00854                 
00855         private:
00856 
00857                 // -----------------
00858                 // private variables
00859                 // -----------------
00860 
00861                 gdtnode         constrained_node;
00862                 double  value;
00863 
00864                 // ---------------
00865                 // private methods
00866                 // ---------------
00867 
00868                 void set_constrained_node(gdtnode);
00869                 void set_value(double);
00870         
00871                 // --------------------
00872                 // private constructors
00873                 // --------------------
00874 
00875                 struct_constraint_node_width(gdtnode, double, undi_graph&);   
00876 
00877 
00878         protected:
00879         
00880                 // ---------------------------------------------------------
00881                 // Updating operations (intelligent handling of constraints)
00882                 // ---------------------------------------------------------
00883                 
00884                 bool update_after_del_edge (gdtedge e);                         // update constraint after gdtedge e is deleted and return true if the constraint can be deleted after updating
00885                 bool update_after_del_node (gdtnode v);                         // update constraint after gdtnode v is deleted and return true if the constraint can be deleted after updating         
00886                 
00887                 bool update_after_split_edge (gdtedge e, gdtedge e1, gdtedge e2);       // update constraint after gdtedge e is splitted into two new edges e1, e2 and return true if the constraint can be deleted after updating
00888                 bool update_after_split_node (gdtnode v, gdtnode v1, gdtnode v2);       // update constraint after gdtnode v is splitted into two new nodes v1, ve and return true if the constraint can be deleted after updating
00889                 
00890                 bool update_after_merge_edges (gdtedge e1, gdtedge e2, gdtedge e);      // update constraint after edges e1, e2 are merged into an gdtedge e, and return true if the constraint can be deleted after updating
00891                 bool update_after_merge_nodes (gdtnode v1, gdtnode v2, gdtnode v);      // update constraint after nodes v1, v2 are merged into a gdtnode v, and return true if the constraint can be deleted after updating
00892 
00893                 void update_after_edge_translation 
00894                         (
00895                         gdtedge e  , 
00896                         gdtnode ve1, 
00897                         gdtnode ve2, 
00898                         gdtedge d  ,
00899                         gdtnode vd1,
00900                         gdtnode vd2
00901                         );                                                      // see below..
00902                         
00903                         // --------------------------------------------------
00904                         // translate the constraint from gdtedge e to gdtedge d.
00905                         // vd1 and vd2 are the extremal nodes of d that 
00906                         // replace the extremal nodes ve1 and ve2 of e, 
00907                         // respectively.
00908                         // --------------------------------------------------
00909                         
00910                 
00911                 void update_on_path_replacing_edge
00912                         (
00913                         gdtedge e,
00914                         gdt::gdtlist<gdtedge> path,
00915                         undi_graph& ug
00916                         );                                                      // see below..
00917                 
00918                 // ---------------------------------------------------------------------------------------
00919                 // generate new constraints for path, which replaces gdtedge e, based on this constraint.
00920                 // If gdtedge e is not present in constraint, nothing to do.
00921                 // NOTICE: - path is a sequence of edges of ug;
00922                 //         - e is an gdtedge of owner_graph of c (not necessarily ug) 
00923                 //         - the extremal nodes of e must have the same id than the extremal nodes of path
00924                 // ---------------------------------------------------------------------------------------
00925 
00926         public: 
00927 
00928                 // --------------------------
00929                 // Constructors and Operators
00930                 // --------------------------
00931 
00932                  ~struct_constraint_node_width();
00933 
00934                 // -----------------
00935                 // Access operations
00936                 // -----------------
00937 
00938                  gdtnode        get_constrained_node() const;
00939                  double get_value() const;
00940 
00941                 // --------------------
00942                 // Translate operations
00943                 // --------------------
00944                 
00945                  constraint copy(undi_graph&);  // copy current constraint from owner_graph to undi_graph, if it is possible,
00946                                                 // and the new constraint (NULL_CONSTRAINT if constraint is not copied)
00947 
00948                 // -------------------------
00949                 // Input / output operations
00950                 // -------------------------
00951 
00952                  void print (std::ostream& os=std::cout) const;
00953         
00954         };
00955 
00956 
00957 //-----------------------------------------------------------------------------
00958 // NODE_HEIGHT constraint: fixes the height of a gdtnode in the final drawing
00959 //-----------------------------------------------------------------------------
00960 
00961         class GDT_NONSTANDARD_DECL
00962 struct_constraint_node_height: public struct_constraint
00963         {
00964 
00965         friend class undi_graph;
00966                 
00967         private:
00968 
00969                 // -----------------
00970                 // private variables
00971                 // -----------------
00972 
00973                 gdtnode         constrained_node;
00974                 double  value;
00975 
00976                 // ---------------
00977                 // private methods
00978                 // ---------------
00979 
00980                 void set_constrained_node(gdtnode);
00981                 void set_value(double);
00982         
00983                 // --------------------
00984                 // private constructors
00985                 // --------------------
00986 
00987                 struct_constraint_node_height(gdtnode, double, undi_graph&);   
00988 
00989 
00990         protected:
00991         
00992                 // ---------------------------------------------------------
00993                 // Updating operations (intelligent handling of constraints)
00994                 // ---------------------------------------------------------
00995                 
00996                 bool update_after_del_edge (gdtedge e);                         // update constraint after gdtedge e is deleted and return true if the constraint can be deleted after updating
00997                 bool update_after_del_node (gdtnode v);                         // update constraint after gdtnode v is deleted and return true if the constraint can be deleted after updating         
00998                 
00999                 bool update_after_split_edge (gdtedge e, gdtedge e1, gdtedge e2);       // update constraint after gdtedge e is splitted into two new edges e1, e2 and return true if the constraint can be deleted after updating
01000                 bool update_after_split_node (gdtnode v, gdtnode v1, gdtnode v2);       // update constraint after gdtnode v is splitted into two new nodes v1, ve and return true if the constraint can be deleted after updating
01001                 
01002                 bool update_after_merge_edges (gdtedge e1, gdtedge e2, gdtedge e);      // update constraint after edges e1, e2 are merged into an gdtedge e, and return true if the constraint can be deleted after updating
01003                 bool update_after_merge_nodes (gdtnode v1, gdtnode v2, gdtnode v);      // update constraint after nodes v1, v2 are merged into a gdtnode v, and return true if the constraint can be deleted after updating
01004 
01005                 void update_after_edge_translation 
01006                         (
01007                         gdtedge e  , 
01008                         gdtnode ve1, 
01009                         gdtnode ve2, 
01010                         gdtedge d  ,
01011                         gdtnode vd1,
01012                         gdtnode vd2
01013                         );                                                      // see below..
01014                         
01015                         // --------------------------------------------------
01016                         // translate the constraint from gdtedge e to gdtedge d.
01017                         // vd1 and vd2 are the extremal nodes of d that 
01018                         // replace the extremal nodes ve1 and ve2 of e, 
01019                         // respectively.
01020                         // --------------------------------------------------
01021                         
01022                 
01023                 void update_on_path_replacing_edge
01024                         (
01025                         gdtedge e,
01026                         gdt::gdtlist<gdtedge> path,
01027                         undi_graph& ug
01028                         );                                                      // see below..
01029 
01030                 // ---------------------------------------------------------------------------------------
01031                 // generate new constraints for path, which replaces gdtedge e, based on this constraint.
01032                 // If gdtedge e is not present in constraint, nothing to do.
01033                 // NOTICE: - path is a sequence of edges of ug;
01034                 //         - e is an gdtedge of owner_graph of c (not necessarily ug)
01035                 //         - the extremal nodes of e must have the same id than the extremal nodes of path
01036                 // ---------------------------------------------------------------------------------------
01037 
01038         public:
01039 
01040                 // --------------------------
01041                 // Constructors and Operators
01042                 // --------------------------
01043 
01044                  ~struct_constraint_node_height();
01045 
01046                 // -----------------
01047                 // Access operations
01048                 // -----------------
01049 
01050                  gdtnode        get_constrained_node() const;
01051                  double get_value() const;
01052 
01053                 // --------------------
01054                 // Translate operations
01055                 // --------------------
01056 
01057                  constraint copy(undi_graph&);  // copy current constraint from owner_graph to undi_graph, if it is possible,
01058                                                 // and the new constraint (NULL_CONSTRAINT if constraint is not copied)
01059 
01060                 // -------------------------
01061                 // Input / output operations
01062                 // -------------------------
01063 
01064                  void print (std::ostream& os=std::cout) const;
01065 
01066         };
01067 
01068 
01069 //-----------------------------------------------------------------------------
01070 // ANGLE_SWEEP constraint: fixes an angle at vertex to the right of an gdtedge
01071 //-----------------------------------------------------------------------------
01072 
01073         class GDT_NONSTANDARD_DECL
01074 struct_constraint_angle_sweep: public struct_constraint
01075         {
01076         friend class undi_graph;
01077                 
01078         private:
01079 
01080                 // -----------------
01081                 // private variables
01082                 // -----------------
01083 
01084                 gdtnode                 ref_node;
01085                 gdtedge                 ref_edge;
01086                 angle_type      angle_value;
01087 
01088                 // ---------------
01089                 // private methods
01090                 // ---------------
01091 
01092                 void set_ref_node(gdtnode);
01093                 void set_ref_edge(gdtedge);
01094                 void set_angle_value(angle_type);
01095         
01096                 // --------------------
01097                 // private constructors
01098                 // --------------------
01099 
01100                 struct_constraint_angle_sweep (gdtnode, gdtedge, angle_type, undi_graph&);
01101 
01102 
01103         protected:
01104         
01105                 // ---------------------------------------------------------
01106                 // Updating operations (intelligent handling of constraints)
01107                 // ---------------------------------------------------------
01108                 
01109                 bool update_after_del_edge (gdtedge e);                         // update constraint after gdtedge e is deleted and return true if the constraint can be deleted after updating
01110                 bool update_after_del_node (gdtnode v);                         // update constraint after gdtnode v is deleted and return true if the constraint can be deleted after updating         
01111                 
01112                 bool update_after_split_edge (gdtedge e, gdtedge e1, gdtedge e2);       // update constraint after gdtedge e is splitted into two new edges e1, e2 and return true if the constraint can be deleted after updating
01113                 bool update_after_split_node (gdtnode v, gdtnode v1, gdtnode v2);       // update constraint after gdtnode v is splitted into two new nodes v1, ve and return true if the constraint can be deleted after updating
01114                 
01115                 bool update_after_merge_edges (gdtedge e1, gdtedge e2, gdtedge e);      // update constraint after edges e1, e2 are merged into an gdtedge e, and return true if the constraint can be deleted after updating
01116                 bool update_after_merge_nodes (gdtnode v1, gdtnode v2, gdtnode v);      // update constraint after nodes v1, v2 are merged into a gdtnode v, and return true if the constraint can be deleted after updating
01117 
01118                 void update_after_edge_translation 
01119                         (
01120                         gdtedge e  , 
01121                         gdtnode ve1, 
01122                         gdtnode ve2, 
01123                         gdtedge d  ,
01124                         gdtnode vd1,
01125                         gdtnode vd2
01126                         );                                                      // see below..
01127                         
01128                         // --------------------------------------------------
01129                         // translate the constraint from gdtedge e to gdtedge d.
01130                         // vd1 and vd2 are the extremal nodes of d that 
01131                         // replace the extremal nodes ve1 and ve2 of e, 
01132                         // respectively.
01133                         // --------------------------------------------------
01134                         
01135                 
01136                 void update_on_path_replacing_edge
01137                         (
01138                         gdtedge e,
01139                         gdt::gdtlist<gdtedge> path,
01140                         undi_graph& ug
01141                         );                                                      // see below..
01142                 
01143                 // ---------------------------------------------------------------------------------------
01144                 // generate new constraints for path, which replaces gdtedge e, based on this constraint.
01145                 // If gdtedge e is not present in constraint, nothing to do.
01146                 // NOTICE: - path is a sequence of edges of ug;
01147                 //         - e is an gdtedge of owner_graph of c (not necessarily ug) 
01148                 //         - the extremal nodes of e must have the same id than the extremal nodes of path
01149                 // ---------------------------------------------------------------------------------------
01150 
01151         public: 
01152 
01153                 // --------------------------
01154                 // Constructors and Operators
01155                 // --------------------------
01156 
01157                  ~struct_constraint_angle_sweep();
01158 
01159                 // -----------------
01160                 // Access operations
01161                 // -----------------
01162 
01163                  gdtnode                get_ref_node()    const;
01164                  gdtedge        get_ref_edge()    const;
01165                  angle_type     get_angle_value() const;
01166 
01167                 // --------------------
01168                 // Translate operations
01169                 // --------------------
01170                 
01171                  constraint copy(undi_graph&);  // copy current constraint from owner_graph to undi_graph, if it is possible,
01172                                                 // and the new constraint (NULL_CONSTRAINT if constraint is not copied)
01173 
01174                 // -------------------------
01175                 // Input / output operations
01176                 // -------------------------
01177 
01178                  void print (std::ostream& os=std::cout) const;
01179 
01180         };
01181 
01182 
01183 //-----------------------------------------------------------------------------
01184 // EDGE_ATTACHMENT_WRT_PREVIOUS_CORNER constraint: fixes the distance between an
01185 // gdtedge attachment and the previous (clockwise) corner of a vertex
01186 //-----------------------------------------------------------------------------
01187 
01188         class GDT_NONSTANDARD_DECL
01189 struct_constraint_edge_attachment_wrt_previous_corner: public struct_constraint
01190         {
01191         friend class undi_graph;
01192                 
01193         private:
01194 
01195                 // -----------------
01196                 // private variables
01197                 // -----------------
01198 
01199                 gdtnode                 ref_node;
01200                 gdtedge                 ref_edge;
01201                 int             attachment;
01202 
01203                 // ---------------
01204                 // private methods
01205                 // ---------------
01206 
01207                 void set_ref_node(gdtnode);
01208                 void set_ref_edge(gdtedge);
01209                 void set_attachment(int);
01210         
01211                 // --------------------
01212                 // private constructors
01213                 // --------------------
01214 
01215                 struct_constraint_edge_attachment_wrt_previous_corner 
01216                         (gdtnode, gdtedge, int, undi_graph&);   
01217 
01218 
01219         protected:
01220         
01221                 // ---------------------------------------------------------
01222                 // Updating operations (intelligent handling of constraints)
01223                 // ---------------------------------------------------------
01224                 
01225                 bool update_after_del_edge (gdtedge e);                         // update constraint after gdtedge e is deleted and return true if the constraint can be deleted after updating
01226                 bool update_after_del_node (gdtnode v);                         // update constraint after gdtnode v is deleted and return true if the constraint can be deleted after updating         
01227                 
01228                 bool update_after_split_edge (gdtedge e, gdtedge e1, gdtedge e2);       // update constraint after gdtedge e is splitted into two new edges e1, e2 and return true if the constraint can be deleted after updating
01229                 bool update_after_split_node (gdtnode v, gdtnode v1, gdtnode v2);       // update constraint after gdtnode v is splitted into two new nodes v1, ve and return true if the constraint can be deleted after updating
01230                 
01231                 bool update_after_merge_edges (gdtedge e1, gdtedge e2, gdtedge e);      // update constraint after edges e1, e2 are merged into an gdtedge e, and return true if the constraint can be deleted after updating
01232                 bool update_after_merge_nodes (gdtnode v1, gdtnode v2, gdtnode v);      // update constraint after nodes v1, v2 are merged into a gdtnode v, and return true if the constraint can be deleted after updating
01233 
01234                 void update_after_edge_translation 
01235                         (
01236                         gdtedge e  , 
01237                         gdtnode ve1, 
01238                         gdtnode ve2, 
01239                         gdtedge d  ,
01240                         gdtnode vd1,
01241                         gdtnode vd2
01242                         );                                                      // see below..
01243                         
01244                         // --------------------------------------------------
01245                         // translate the constraint from gdtedge e to gdtedge d.
01246                         // vd1 and vd2 are the extremal nodes of d that 
01247                         // replace the extremal nodes ve1 and ve2 of e, 
01248                         // respectively.
01249                         // --------------------------------------------------
01250                         
01251 
01252                 void update_on_path_replacing_edge
01253                         (
01254                         gdtedge e,
01255                         gdt::gdtlist<gdtedge> path,
01256                         undi_graph& ug
01257                         );                                                      // see below..
01258                 
01259                 // ---------------------------------------------------------------------------------------
01260                 // generate new constraints for path, which replaces gdtedge e, based on this constraint.
01261                 // If gdtedge e is not present in constraint, nothing to do.
01262                 // NOTICE: - path is a sequence of edges of ug;
01263                 //         - e is an gdtedge of owner_graph of c (not necessarily ug) 
01264                 //         - the extremal nodes of e must have the same id than the extremal nodes of path
01265                 // ---------------------------------------------------------------------------------------
01266 
01267         public: 
01268 
01269                 // --------------------------
01270                 // Constructors and Operators
01271                 // --------------------------
01272 
01273                  ~struct_constraint_edge_attachment_wrt_previous_corner();
01274 
01275                 // -----------------
01276                 // Access operations
01277                 // -----------------
01278 
01279                  gdtnode                get_ref_node()    const;
01280                  gdtedge        get_ref_edge()    const;
01281                  int            get_attachment()  const;
01282 
01283                 // --------------------
01284                 // Translate operations
01285                 // --------------------
01286                 
01287                  constraint copy(undi_graph&);  // copy current constraint from owner_graph to undi_graph, if it is possible,
01288                                                 // and the new constraint (NULL_CONSTRAINT if constraint is not copied)
01289 
01290                 // -------------------------
01291                 // Input / output operations
01292                 // -------------------------
01293 
01294                  void print (std::ostream& os=std::cout) const;
01295         
01296         };
01297 
01298 
01299 //---------------------------------------------------------------------------------------
01300 // MIN_TIEING constraint: it is a global constraint, it is not associated to any element.
01301 // Using this constraint the user can specify the lower boud in the tieing compacion
01302 // This means that any distance (horizontal and vertical) between two nodes and the 
01303 // length of any gdtedge segment in the drawing will be greather than the specified distance.
01304 //---------------------------------------------------------------------------------------
01305 
01306         class GDT_NONSTANDARD_DECL
01307 struct_constraint_min_tieing: public struct_constraint
01308         {
01309         friend class undi_graph;
01310 
01311         private:
01312 
01313         const int the_value;
01314 
01315         struct_constraint_min_tieing( int x, undi_graph& ug):
01316           struct_constraint(MIN_TIEING, ug),
01317           the_value(x) 
01318           {}
01319 
01320         private:
01321 
01322         virtual bool update_after_del_edge (gdtedge e) { return false; }
01323         virtual bool update_after_del_node (gdtnode e) { return false; }
01324         
01325         virtual bool update_after_split_edge (gdtedge e, gdtedge e1, gdtedge e2) { return false; }
01326         virtual bool update_after_split_node (gdtnode v, gdtnode v1, gdtnode v2) { return false; }
01327                 
01328         virtual bool update_after_merge_edges (gdtedge e1, gdtedge e2, gdtedge e) { return false; }
01329         virtual bool update_after_merge_nodes (gdtnode v1, gdtnode v2, gdtnode v) { return false; }
01330         virtual void update_after_edge_translation
01331                         (
01332                         gdtedge e  ,
01333                         gdtnode ve1,
01334                         gdtnode ve2,
01335                         gdtedge d  ,
01336                         gdtnode vd1,
01337                         gdtnode vd2
01338                         ) {}
01339         virtual void update_on_path_replacing_edge
01340                         (
01341                         gdtedge e,
01342                         gdt::gdtlist<gdtedge> path,
01343                         undi_graph& ug
01344                         ) {}
01345 
01346 
01347         public:
01348 
01349 
01350         virtual constraint copy(undi_graph&);
01351 
01352         virtual void       print (std::ostream& os=std::cout) const;
01353 
01354         int get_value() const
01355             { return the_value; }
01356 
01357         };
01358 
01359 
01360 #endif // RM3_CONSTRAINTS_H

Generated on Thu Jan 10 14:48:01 2008 for GDToolkit GAPI by  doxygen 1.5.3