COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
coFeatureLines.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3  You can use it under the terms of the GNU Lesser General Public License
4  version 2.1 or later, see lgpl-2.1.txt.
5 
6  * License: LGPL 2+ */
7 
8 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9 // CLASS coFeatureLines
10 //
11 // coFeatureLines contains utilities for feature line extraction
12 //
13 // Initial version: 21.05.2004 Sergio Leseduarte
14 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15 // (C) 2004 by VirCinity IT Consulting
16 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
17 // Changes:
18 
19 #ifndef _COVISE_FEATURE_LINES_H_
20 #define _COVISE_FEATURE_LINES_H_
21 
22 #include "coMiniGrid.h"
23 #include "MagmaUtils.h"
24 
25 namespace covise
26 {
27 
29 {
30 public:
31  // cutPoly separates triangles whose normals span an angle whose cosinus
32  // is smaller than argument coseno. connList and {x,y,z}coord are used
33  // for input and output. xn,yn,zn are the normals per cell.
34  // !!!! At the moment this function is limited to triangular grids !!!!
35  // If this condition is not satisfied by your grid, you may want to
36  // use function Triangulate.
37  static void cutPoly(float coseno,
38  const vector<int> &elemList,
39  // connectivity list (input and output)
40  vector<int> &connList,
41  // coordinate points (input and output)
42  vector<float> &xcoord,
43  vector<float> &ycoord,
44  vector<float> &zcoord,
45  // input normals (per cell)
46  const vector<float> &xn,
47  const vector<float> &yn,
48  const vector<float> &zn,
49  // feature lines are returned in these arrays
50  vector<int> &ll,
51  vector<int> &cl,
52  vector<float> &lx,
53  vector<float> &ly,
54  vector<float> &lz,
55  // domain lines are returned in these arrays
56  vector<int> &dll,
57  vector<int> &dcl,
58  vector<float> &dlx,
59  vector<float> &dly,
60  vector<float> &dlz);
61  // Triangulate triangulates a grid of polygons, which are assumed
62  // to be convex.
63  // In tri_conn_list you get a connectivity list describing
64  // the triangulated grid, which reuses the same coordinate lists: x,y,z
65  static void
66  Triangulate(vector<int> &tri_conn_list, // tri_conn_list is the output.
67  vector<int> &tri_codes, // for each triangle we get the
68  // label of the polygon it is part of.
69  int num_poly, // number of original polygons.
70  int num_conn, // length of the connectivity list.
71  const int *poly_list,
72  const int *conn_list,
73  const float *x, const float *y, const float *z);
74 
75 private:
76  // DifferentOrientation returns true when two cells (cell and other cell)
77  // are 'almost' parallel oriented. xn,yn,zn are normals per cell.
78  static bool
79  DifferentOrientation(float coseno,
80  int elem,
81  int other_cell,
82  const vector<float> &xn,
83  const vector<float> &yn,
84  const vector<float> &zn);
85  // SplitNode performs the splitting of a grid referred
86  // to in the comments to cutPoly around
87  // a node 'node'. Nodal and cell neighbourhoods are required
88  // as defined by class MagmaUtils. mini_kanten is the set
89  // of feature edges in the whole grid separating cells
90  // which are NOT 'almost' parallel.
91  // A mini-grid is calculated, as the set of cells around node 'node'
92  // and the RainAlgorithm is calculated is calculated in this grid
93  // restricting mini_kanten to the edges of mini-grid. Node 'node'
94  // is then duplicated for each 'extra'-subdomain of the rain
95  // algorithm. So, in successive calls of SplitNode, the grid
96  // gets separated.
97  // You may think of possible alternatives, for instance, not
98  // dupplicating a node for a subdomain, when you may find a cell
99  // in the subdomain at issue and another in another subdomain
100  // for which DifferentOrientation returns false..
101  static void
102  SplitNode(int node,
103  const vector<int> &elemList,
104  vector<int> &connList,
105  vector<float> &xcoord,
106  vector<float> &ycoord,
107  vector<float> &zcoord,
108  const vector<int> &nodal_number_neigh,
109  const vector<int> &nodal_start_neigh,
110  const vector<int> &nodal_neighbours,
111  const vector<int> &elem_start_neigh,
112  const vector<int> &elem_number_neigh,
113  const vector<int> &elem_neighbours,
114  const vector<MagmaUtils::Edge> &edge_neighbours,
115  const coMiniGrid::Border &mini_kanten);
116  // MaxAngleVertex returns the vertex of a polygon
117  // with the largest angle
118  static int
119  MaxAngleVertex(int num_conn,
120  // const int *start_conn,
121  const float *x,
122  const float *y,
123  const float *z);
124 };
125 }
126 #endif
Definition: coMiniGrid.h:71
GLint GLint GLint GLint GLint GLint y
Definition: khronos-glext.h:6346
Definition: Triangulate.h:23
Definition: coFeatureLines.h:28
GLdouble GLdouble z
Definition: khronos-glext.h:6565
#define ALGEXPORT
Definition: coExport.h:313
GLint GLint GLint GLint GLint x
Definition: khronos-glext.h:6346