fixed some const correctness issues on tetrahedrons

This commit is contained in:
korialis 2021-11-16 15:29:10 +01:00
parent ba3e4370bb
commit 5556f4184c
4 changed files with 8 additions and 5 deletions

View File

@ -250,7 +250,7 @@ public:
return V;
}
static ScalarType ComputeMeshVolume(const MeshType & m)
static ScalarType ComputeMeshVolume(MeshType & m)
{
Inertia<MeshType> I(m);
return I.Mass();

View File

@ -2049,7 +2049,7 @@ public:
}
template <class ATTR_TYPE>
static typename MeshType::template ConstPerTetraAttributeHandle<ATTR_TYPE> FindPerTetraAttribute(MeshType &m, const std::string &name)
static typename MeshType::template ConstPerTetraAttributeHandle<ATTR_TYPE> FindPerTetraAttribute(const MeshType &m, const std::string &name)
{
if(!name.empty()){
PointerToAttribute h1;

View File

@ -48,7 +48,7 @@ template <class T> class EmptyCore : public T {
public:
//Empty vertexref
inline typename T::VertexType * & V( const int ) { assert(0); static typename T::VertexType *vp=0; return vp; }
inline typename T::VertexType * const & V( const int ) const { assert(0); static typename T::VertexType *vp=0; return vp; }
inline const typename T::VertexType * V( const int ) const { assert(0); static typename T::VertexType *vp=0; return vp; }
inline const typename T::VertexType * cV( const int ) const { assert(0); static typename T::VertexType *vp=0; return vp; }
inline typename T::CoordType & P( const int ) { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; }
inline const typename T::CoordType & P( const int ) const { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; }
@ -181,7 +181,8 @@ public:
typedef typename T::VertexType::ScalarType ScalarType;
inline typename T::VertexType * & V( const int j ) { assert(j>=0 && j<4); return v[j]; }
inline const typename T::VertexType * cV( const int j ) { assert(j>=0 && j<4); return v[j]; }
inline const typename T::VertexType * V( const int j ) const { assert(j>=0 && j<4); return v[j]; }
inline const typename T::VertexType * cV( const int j ) const { assert(j>=0 && j<4); return v[j]; }
inline size_t cFtoVi (const int f, const int j) const { assert(f >= 0 && f < 4); assert(j >= 0 && j < 3); return findices[f][j]; }
@ -457,7 +458,8 @@ public:
typename T::TetraPointer const cVTp( const int j ) const { assert( j >= 0 && j < 4 ); return _vtp[j]; }
char & VTi( const int j ) { return _vti[j]; }
const char & cVTi( const int j ) const { return _vti[j]; }
char VTi( const int j ) const { return _vti[j]; }
char cVTi( const int j ) const { return _vti[j]; }
static bool HasVTAdjacency() { return true; }
static bool HasVTAdjacencyOcc() { return false; }

View File

@ -572,6 +572,7 @@ public:
typename T::TetraPointer &VTp() { return _tp; }
typename T::TetraPointer cVTp() const { return _tp; }
int &VTi() {return _zp; }
int VTi() const { return _zp; }
int cVTi() const { return _zp; }
static bool HasVTAdjacency() { return true; }
static void Name( std::vector< std::string > & name ) { name.push_back( std::string("VTAdj") ); T::Name(name); }