~ubuntu-branches/ubuntu/karmic/gmsh/karmic

« back to all changes in this revision

Viewing changes to Geo/GEdgeLoop.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme, Daniel Leidert
  • Date: 2008-05-18 12:46:05 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20080518124605-716xqbqeo07o497k
Tags: 2.2.0-2
[Christophe Prud'homme]
* Bug fix: "gmsh ships no .desktop", thanks to Vassilis Pandis (Closes:
  #375770). Applied the Ubuntu patch.

[Daniel Leidert]
* debian/control (Vcs-Svn): Fixed.
  (Build-Depends): Use texlive instead of tetex-bin.
* debian/gmsh.doc-base (Section): Fixed accordingly to doc-base (>= 0.8.10).
* debian/rules: Removed some variable declarations, that lead to double
  configuration and seem to be useless.
  (build/gmsh): Try to avoid multiple runs by using a stamp.
  (orig-tarball): Renamed to get-orig-source and changed to use uscan.
* debian/watch: Added.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// $Id: GEdgeLoop.cpp,v 1.5 2007-01-19 15:34:05 geuzaine Exp $
 
1
// $Id: GEdgeLoop.cpp,v 1.13 2008-03-20 11:44:04 geuzaine Exp $
2
2
//
3
 
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 
3
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
4
4
//
5
5
// This program is free software; you can redistribute it and/or modify
6
6
// it under the terms of the GNU General Public License as published by
19
19
// 
20
20
// Please report all bugs and problems to <gmsh@geuz.org>.
21
21
 
 
22
#include <algorithm>
22
23
#include "GEdgeLoop.h"
23
 
#include "Message.h"
 
24
 
 
25
#if defined(HAVE_GMSH_EMBEDDED)
 
26
#  include "GmshEmbedded.h"
 
27
#else
 
28
#  include "Message.h"
 
29
#endif
24
30
 
25
31
void GEdgeSigned::print() const
26
32
{
67
73
    GEdge *ge = *it;
68
74
    if(countInList(possibleChoices, ge) == 2){
69
75
      wire.erase(std::remove_if(wire.begin(), wire.end(), 
70
 
                                std::bind2nd(std::equal_to<GEdge*>(), ge)), 
71
 
                 wire.end());
 
76
                                std::bind2nd(std::equal_to<GEdge*>(), ge)), 
 
77
                 wire.end());
72
78
      wire.push_back(ge);
73
79
      GVertex *v1 = ge->getBeginVertex();
74
80
      GVertex *v2 = ge->getEndVertex();
84
90
    GEdge *ge = *it;
85
91
    if(ge != thisOne->ge){
86
92
      wire.erase(std::remove_if(wire.begin(),wire.end(), 
87
 
                                std::bind2nd(std::equal_to<GEdge*>(), ge)), 
88
 
                 wire.end());
 
93
                                std::bind2nd(std::equal_to<GEdge*>(), ge)), 
 
94
                 wire.end());
89
95
      GVertex *v1 = ge->getBeginVertex();
90
96
      GVertex *v2 = ge->getEndVertex();
91
97
      if(v1 == gv) return GEdgeSigned(1, ge);   
117
123
 
118
124
  GEdgeSigned *prevOne = 0;
119
125
 
120
 
  Msg(INFO,"Building a wire");
 
126
  //  Msg(INFO,"Building a wire");
121
127
  GEdgeSigned ges(0,0);
122
128
  while(wire.size()){
123
129
    ges = nextOne(prevOne, wire);
126
132
      break;
127
133
    }
128
134
    prevOne = &ges;
129
 
    ges.print();
 
135
    //    ges.print();
130
136
    loop.push_back(ges);
131
137
  }
132
138
}
 
139
 
 
140
 
 
141
GEdgeLoop::GEdgeLoop(const std::list<GEdge*> &cwire, const std::list<int> &dir)
 
142
{
 
143
  std::list<GEdge*>::const_iterator it = cwire.begin();
 
144
  std::list<int>::const_iterator itdir = dir.begin();
 
145
  for ( ; it != cwire.end() ; ++it,++itdir){
 
146
    loop.push_back(GEdgeSigned(*itdir,*it));
 
147
  }
 
148
}
 
149