Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
includeLinks/MsqVertex.hpp
Go to the documentation of this file.
1 /* *****************************************************************
2  MESQUITE -- The Mesh Quality Improvement Toolkit
3 
4  Copyright 2004 Sandia Corporation and Argonne National
5  Laboratory. Under the terms of Contract DE-AC04-94AL85000
6  with Sandia Corporation, the U.S. Government retains certain
7  rights in this software.
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Lesser General Public
11  License as published by the Free Software Foundation; either
12  version 2.1 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public License
20  (lgpl.txt) along with this library; if not, write to the Free Software
21  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 
23  diachin2@llnl.gov, djmelan@sandia.gov, mbrewer@sandia.gov,
24  pknupp@sandia.gov, tleurent@mcs.anl.gov, tmunson@mcs.anl.gov
25 
26  ***************************************************************** */
27 
34 #ifndef MSQVERTEX_HPP
35 #define MSQVERTEX_HPP
36 
37 #include "Mesquite.hpp"
38 #include "Vector3D.hpp"
39 
40 namespace Mesquite
41 {
42  class MeshSet;
43 
53  class MsqVertex : public Vector3D
54  {
55  public:
57  MsqVertex(double x, double y, double z)
58  : Vector3D(x, y, z), vertexBitFlags(0)
59  {}
60 
62  MsqVertex(const Vector3D &vec)
63  : Vector3D(vec), vertexBitFlags(0)
64  {}
65 
68  : Vector3D(0,0,0), vertexBitFlags(0)
69  {}
70 
74  {}
75 
78  { Vector3D::operator=(rhs);
79  vertexBitFlags = 0;
80  return *this; }
81 
82  // This allows for 8 flag bits.
83  // I don't think we'll want more than that (yet).
84  typedef unsigned char FlagMask;
85 
92  {
94  MSQ_ALGO_FLAG0 = 1<<0,
95  MSQ_SOFT_FIXED = 1<<1,
96  MSQ_HARD_FIXED = 1<<2,
98  MSQ_FLAG_3 = 1<<4,
99  MSQ_FLAG_4 = 1<<5,
100  MSQ_ALGO_FLAG1 = 1<<6,
102  };
104  bool is_free_vertex() const
105  { return (vertexBitFlags & (MSQ_SOFT_FIXED|MSQ_HARD_FIXED)) == 0; }
106 
109 
111  { vertexBitFlags &= (~MSQ_SOFT_FIXED); }
112 
115 
117  { vertexBitFlags|=flag; }
118 
120  { vertexBitFlags &= (~flag); }
121 
122  bool is_flag_set(FlagMaskID flag) const
123  { return (vertexBitFlags & flag) != 0; }
124 
125  private:
127 
128  friend class Mesquite::MeshSet;
129  };
130 
131 } //namespace
132 
133 
134 #endif // MsqVertex_hpp
void remove_vertex_flag(FlagMaskID flag)
Vector3D & operator=(const Vector3D &to_copy)
NT rhs
MsqVertex(const MsqVertex &rhs)
Construct default vertex with coordinates (0.0,0.0,0.0)
vertex is fixed. This flag can be set on and off.
Vector3D is the object that effeciently stores information about about three-deminsional vectors...
free bit, to be used by algorithm if needed.
MsqVertex(double x, double y, double z)
Construct vertex using three doubles.
MsqVertex & operator=(const Vector3D &rhs)
Initializes with coordinates. Sets tag data/pointer to 0.
bool is_free_vertex() const
Returns true if vertex is ``free&#39;&#39;.
FlagMaskID
Those are the available flags...
vertex is always fixed. This can only be set on and never off.
void set_vertex_flag(FlagMaskID flag)
free bit, to be used by algorithm if needed.
MsqVertex(const Vector3D &vec)
Construct vertex using Vector3D.
bool is_flag_set(FlagMaskID flag) const
MsqVertex is the Mesquite object that stores information about the vertices in the mesh...
The MeshSet class stores one or more Mesquite::Mesh pointers and manages access to the mesh informati...
MsqVertex()
Construct default vertex with coordinates (0.0,0.0,0.0)