msbGrid  1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
geometricentity.hh
Go to the documentation of this file.
1 /*****************************************************************************
2 * This program is part of the msbGrid software *
3 * *
4 * msbGrid stands for multi-structured block Grid generator *
5 * *
6 * msbGrid is a free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 2 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * msbGrid is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * See the file COPYING for full copying permissions. *
17 *****************************************************************************/
23 #ifndef _GEOMETRIC_ENTITY_HH_
24 #define _GEOMETRIC_ENTITY_HH_
25 
26 namespace msbGrid
27 {
28 class GeometricEntity;
29 class Point;
30 class Edge;
31 class Cell;
32 }
33 
34 class msbGrid :: GeometricEntity
35 {
36 public:
41 
42  std :: vector< Scalar > pos_;
43  std :: vector< Point * > vPt_;
44  std :: vector< Edge * > vEd_;
45  std :: vector< Cell * > vCel_;
46 
47 private:
49  unsigned int Id_;
50  bool mark_;
52 
53 public:
55  {
56  color_ = Black;
57  Id_ = 0;
58  mark_ = false;
59  onBlockBoundary_ = false;
60  }
61 
63 
64  const Color &color() const
65  { return color_; }
66 
68  { return color_; }
69 
70  const unsigned int &Id() const
71  { return Id_; }
72 
73  unsigned int &Id()
74  { return Id_; }
75 
76  const bool hasId() const
77  { return ( Id_ != 0 ); }
78 
79  const bool &mark() const
80  { return mark_; }
81 
82  bool &mark()
83  { return mark_; }
84 
85  const bool &onBlockBoundary() const
86  { return onBlockBoundary_; }
87 
89  { return onBlockBoundary_; }
90 
91  const std :: vector< Scalar > &pos() const
92  { return pos_; }
93 
94  std :: vector< Scalar > &pos()
95  { return pos_; }
96 
97  const std :: vector< Point * > &vPt() const
98  { return vPt_; }
99 
100  std :: vector< Point * > &vPt()
101  { return vPt_; }
102 
103  const std :: vector< Edge * > &vEd() const
104  { return vEd_; }
105 
106  std :: vector< Edge * > &vEd()
107  { return vEd_; }
108 
109  const std :: vector< Cell * > &vCel() const
110  { return vCel_; }
111 
112  std :: vector< Cell * > &vCel()
113  { return vCel_; }
114 
115  bool isIt(const GeometricEntity *ge0) const
116  { return ( ge0 == this ); }
117 
118  void infos() const
119  {
120  std :: cout << "# geometricEntity : ";
121 
122  std :: cout << "color = " << colorName( this->color() )
123  << " , Id = " << this->Id()
124  << " , mark = " << this->mark()
125  << " , onBlockBoundary = " << this->onBlockBoundary() << "\n";
126  }
127 }; /* class GeometricEntity */
128 
129 #include <point.hh>
130 #include <edge.hh>
131 #include <cell.hh>
132 
133 #endif /* #ifndef _GEOMETRIC_ENTITY_HH_ */