~ubuntu-branches/ubuntu/saucy/gfan/saucy-proposed

« back to all changes in this revision

Viewing changes to triangulation.h

  • Committer: Package Import Robot
  • Author(s): Cédric Boutillier
  • Date: 2013-07-09 10:44:01 UTC
  • mfrom: (2.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20130709104401-5q66ozz5j5af0dak
Tags: 0.5+dfsg-3
* Upload to unstable.
* modify remove_failing_tests_on_32bits.patch to replace command of
  0009RenderStairCase test with an empty one instead of deleting it.
* remove lintian override about spelling error

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef TRIANGULATION_H_INCLUDED
 
2
#define TRIANGULATION_H_INCLUDED
 
3
 
 
4
#include "matrix.h"
 
5
#include <list>
 
6
 
 
7
using namespace std;
 
8
 
 
9
class Triangulation{
 
10
 public:
 
11
  /**
 
12
     This class represents an oriented simplex. The simplex is stored
 
13
     as the list of indices of the vertices it contains together with
 
14
     an orientation flag which is either +1 or -1. The ordering of the
 
15
     indices is important. The list of indices can be sorted by
 
16
     calling coneSort(). This will change the orientation flag
 
17
     appropriately.
 
18
   */
 
19
  class Cone : public list<int>
 
20
  {
 
21
  public:
 
22
    int changeSign;
 
23
  Cone():
 
24
    changeSign(1)
 
25
      {
 
26
      }
 
27
  };
 
28
  /**
 
29
     The class Cone2 is just a short name for a list of integers.
 
30
   */
 
31
  typedef list<int> Cone2;
 
32
  // private:
 
33
  static int coneDim(Cone2 const &c, IntegerMatrix const &rays);
 
34
  static IntegerVectorList coneToVectorList(Cone2 const &c, IntegerMatrix const &rays);
 
35
  static void coneSort(Cone &c);
 
36
  static Cone firstSimplex(Cone const &c, IntegerMatrix const &rays);
 
37
  static IntegerVectorList coneComplement(Cone c, IntegerMatrix const &rays);//returns generators of orth. complement.
 
38
  static int signVisible(int v, Cone const &c, IntegerVectorList const &complement, IntegerMatrix const &rays);
 
39
  static list<Cone> triangulateRek(int d, Cone2 const &c, IntegerMatrix const &rays, bool revlex=false, bool ignoreContainedRays=false);
 
40
 
 
41
 public:
 
42
  /**
 
43
     Computes a triangulation of the rows of the matrix rays indexed
 
44
     by c. The tringulation is lexicographic unless revlex is set in
 
45
     which case a reverse lexicographic triangulation is
 
46
     computed. Notice that a reverselex triangulation does not always
 
47
     exist.
 
48
     CHOOSING REVLEX DOES NOT WORK YET.
 
49
   */
 
50
  static list<Cone> triangulate(Cone2 c, IntegerMatrix const &rays, bool revlex=false); //computes a lexicographic triangulation
 
51
  static list<Cone> triangulate(IntegerMatrix const &rays, bool revlex=false); //computes a lexicographic triangulation
 
52
  static list<Cone> boundary(list<Cone> cones);
 
53
  static IntegerVectorList normals(IntegerMatrix &rays);
 
54
  /**
 
55
     Takes a Cone list and turns it into a vector of lists of integers, thereby remove the orientation flag stored in the Cones.
 
56
   */
 
57
  static vector<list<int> > removeOrientation(list<Cone> const &triangulation);
 
58
  /**
 
59
     Takes a Cone vector and turns it into a vector of lists of integers, thereby remove the orientation flag stored in the Cones.
 
60
   */
 
61
  static vector<list<int> > removeOrientation(vector<Cone> const &triangulation);
 
62
};
 
63
 
 
64
#endif