Flow123d  release_2.2.0-33-g759111d
intersectionLocal.h
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License version 3 as published by the
7  * Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12  *
13  *
14  * @file intersectionLocal.h
15  * @brief
16  */
17 
18 #ifndef IntersectionLocalH
19 #define IntersectionLocalH
20 
21 #include <iostream>
22 #include <vector>
23 #include <stdio.h>
24 
25 using namespace std;
26 
27 
28 //class IntersectionPoint - two vectors of local coords
30 public:
32  : coord1(c1), coord2(c2) {}
34  : coord1(LC.coord1), coord2(LC.coord2) {}
35  inline const std::vector<double> &el1_coord() const
36  {return coord1;}
37  inline const std::vector<double> &el2_coord() const
38  {return coord2;}
39  bool operator ==(const IntersectionPoint&);
40 protected:
43 
44  friend class IntersectionLocal;
46 };
47 IntersectionPoint *interpolate(const IntersectionPoint &A1, const IntersectionPoint &A2, double t);
48 
49 
51 public:
52  typedef enum {
57 
58  IntersectionLocal(IntersectionType i_type);
61 
62  void add_local_coord(const std::vector<double> &coordin1, const std::vector<double> &coordin2); //add coords to i_points
63  void add_local_point(IntersectionPoint *InPoint);
64  void print(FILE *out_file);
65 
66  static int getNumInstances() {
68  }
69 
70  inline IntersectionType get_type() const
71  {return type; }
72  inline unsigned int n_points() const {
73  return i_points.size();
74  }
75  inline const IntersectionPoint * get_point(const unsigned int index) const
76  {
77  if (index >= i_points.size() ) return NULL;
78  else return i_points[index];
79  }
80 
81 private:
82  static int numberInstance;
83  int id;
84 
85  std::vector<IntersectionPoint *> i_points; //vektor ukazatelu na dvojice lokal. souradnic
86  IntersectionType type;
87 
88 
89  int generateId();
90 };
91 
92 #endif /* IntersectionLocalH */
unsigned int n_points() const
std::vector< double > coord2
IntersectionPoint * interpolate(const IntersectionPoint &A1, const IntersectionPoint &A2, double t)
FMT_API void print(std::FILE *f, CStringRef format_str, ArgList args)
Definition: format.cc:489
const IntersectionPoint * get_point(const unsigned int index) const
static int numberInstance
const std::vector< double > & el2_coord() const
IntersectionPoint(const std::vector< double > &c1, const std::vector< double > &c2)
std::vector< double > coord1
bool operator==(const Null &, const Null &)
static int getNumInstances()
const std::vector< double > & el1_coord() const
std::vector< IntersectionPoint * > i_points
IntersectionPoint(const IntersectionPoint &LC)
IntersectionType type
IntersectionType get_type() const