Skip to content

Commit

Permalink
Refs #10135. Made comparison function const
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Wedel committed Aug 24, 2014
1 parent 9aa5fff commit 8cc7717
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 29 deletions.
Expand Up @@ -38,10 +38,11 @@ namespace Geometry
virtual ~PointGroup() {}
/// Name of the point group
virtual std::string getName() = 0;
/// Return true if the hkls are in same group
virtual bool isEquivalent(Kernel::V3D hkl, Kernel::V3D hkl2) = 0;
virtual CrystalSystem crystalSystem() const = 0;

/// Return true if the hkls are in same group
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const = 0;

/// Returns a vector with all equivalent hkls
std::vector<Kernel::V3D> getEquivalents(const Kernel::V3D &hkl) const;
/// Returns the same hkl for all equivalent hkls
Expand Down Expand Up @@ -71,7 +72,7 @@ namespace Geometry
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(Kernel::V3D hkl, Kernel::V3D hkl2);
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};

Expand All @@ -84,7 +85,7 @@ namespace Geometry
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(Kernel::V3D hkl, Kernel::V3D hkl2);
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};

Expand All @@ -97,7 +98,7 @@ namespace Geometry
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(Kernel::V3D hkl, Kernel::V3D hkl2);
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};

Expand All @@ -110,7 +111,7 @@ namespace Geometry
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(Kernel::V3D hkl, Kernel::V3D hkl2);
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};

Expand All @@ -123,7 +124,7 @@ namespace Geometry
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(Kernel::V3D hkl, Kernel::V3D hkl2);
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};

Expand All @@ -136,7 +137,7 @@ namespace Geometry
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(Kernel::V3D hkl, Kernel::V3D hkl2);
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};

Expand All @@ -149,7 +150,7 @@ namespace Geometry
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(Kernel::V3D hkl, Kernel::V3D hkl2);
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};

Expand All @@ -162,7 +163,7 @@ namespace Geometry
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(Kernel::V3D hkl, Kernel::V3D hkl2);
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};

Expand All @@ -175,7 +176,7 @@ namespace Geometry
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(Kernel::V3D hkl, Kernel::V3D hkl2);
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};

Expand All @@ -188,7 +189,7 @@ namespace Geometry
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(Kernel::V3D hkl, Kernel::V3D hkl2);
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};

Expand All @@ -201,7 +202,7 @@ namespace Geometry
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(Kernel::V3D hkl, Kernel::V3D hkl2);
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};

Expand All @@ -214,7 +215,7 @@ namespace Geometry
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(Kernel::V3D hkl, Kernel::V3D hkl2);
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};

Expand All @@ -227,7 +228,7 @@ namespace Geometry
/// Name of the point group
virtual std::string getName();
/// Return true if the hkls are equivalent.
virtual bool isEquivalent(Kernel::V3D hkl, Kernel::V3D hkl2);
virtual bool isEquivalent(const Kernel::V3D &hkl, const Kernel::V3D &hkl2) const;
virtual PointGroup::CrystalSystem crystalSystem() const;
};

Expand Down
26 changes: 13 additions & 13 deletions Code/Mantid/Framework/Geometry/src/Crystal/PointGroup.cpp
Expand Up @@ -160,7 +160,7 @@ namespace Geometry
return "-1 (Triclinic)";
}

bool PointGroupLaue1::isEquivalent(V3D hkl, V3D hkl2)
bool PointGroupLaue1::isEquivalent(const V3D &hkl, const V3D &hkl2) const
{
double h=hkl[0];
double k=hkl[1];
Expand All @@ -187,7 +187,7 @@ namespace Geometry
return "1 2/m 1 (Monoclinic, unique axis b)";
}

bool PointGroupLaue2::isEquivalent(V3D hkl, V3D hkl2)
bool PointGroupLaue2::isEquivalent(const V3D &hkl, const V3D &hkl2) const
{
double h=hkl[0];
double k=hkl[1];
Expand All @@ -214,7 +214,7 @@ namespace Geometry
return "1 1 2/m (Monoclinic, unique axis c)";
}

bool PointGroupLaue3::isEquivalent(V3D hkl, V3D hkl2)
bool PointGroupLaue3::isEquivalent(const V3D &hkl, const V3D &hkl2) const
{
double h=hkl[0];
double k=hkl[1];
Expand Down Expand Up @@ -242,7 +242,7 @@ namespace Geometry
return "mmm (Orthorombic)";
}

bool PointGroupLaue4::isEquivalent(V3D hkl, V3D hkl2)
bool PointGroupLaue4::isEquivalent(const V3D &hkl, const V3D &hkl2) const
{
double h=hkl[0];
double k=hkl[1];
Expand Down Expand Up @@ -271,7 +271,7 @@ namespace Geometry
return "4/m (Tetragonal)";
}

bool PointGroupLaue5::isEquivalent(V3D hkl, V3D hkl2)
bool PointGroupLaue5::isEquivalent(const V3D &hkl, const V3D &hkl2) const
{
double h=hkl[0];
double k=hkl[1];
Expand Down Expand Up @@ -301,7 +301,7 @@ namespace Geometry
return "4/mmm (Tetragonal)";
}

bool PointGroupLaue6::isEquivalent(V3D hkl, V3D hkl2)
bool PointGroupLaue6::isEquivalent(const V3D &hkl, const V3D &hkl2) const
{
double h=hkl[0];
double k=hkl[1];
Expand Down Expand Up @@ -333,7 +333,7 @@ namespace Geometry
return "-3 (Trigonal - Hexagonal)";
}

bool PointGroupLaue7::isEquivalent(V3D hkl, V3D hkl2)
bool PointGroupLaue7::isEquivalent(const V3D &hkl, const V3D &hkl2) const
{
double h=hkl[0];
double k=hkl[1];
Expand Down Expand Up @@ -362,7 +362,7 @@ namespace Geometry
return "-3m1 (Trigonal - Rhombohedral)";
}

bool PointGroupLaue8::isEquivalent(V3D hkl, V3D hkl2)
bool PointGroupLaue8::isEquivalent(const V3D &hkl, const V3D &hkl2) const
{
double h=hkl[0];
double k=hkl[1];
Expand Down Expand Up @@ -393,7 +393,7 @@ namespace Geometry
return "-31m (Trigonal - Rhombohedral)";
}

bool PointGroupLaue9::isEquivalent(V3D hkl, V3D hkl2)
bool PointGroupLaue9::isEquivalent(const V3D &hkl, const V3D &hkl2) const
{
double h=hkl[0];
double k=hkl[1];
Expand Down Expand Up @@ -423,7 +423,7 @@ namespace Geometry
return "6/m (Hexagonal)";
}

bool PointGroupLaue10::isEquivalent(V3D hkl, V3D hkl2)
bool PointGroupLaue10::isEquivalent(const V3D &hkl, const V3D &hkl2) const
{
double h=hkl[0];
double k=hkl[1];
Expand Down Expand Up @@ -454,7 +454,7 @@ namespace Geometry
return "6/mmm (Hexagonal)";
}

bool PointGroupLaue11::isEquivalent(V3D hkl, V3D hkl2)
bool PointGroupLaue11::isEquivalent(const V3D &hkl, const V3D &hkl2) const
{
double h=hkl[0];
double k=hkl[1];
Expand Down Expand Up @@ -490,7 +490,7 @@ namespace Geometry
return "m-3 (Cubic)";
}

bool PointGroupLaue12::isEquivalent(V3D hkl, V3D hkl2)
bool PointGroupLaue12::isEquivalent(const V3D &hkl, const V3D &hkl2) const
{
double h=hkl[0];
double k=hkl[1];
Expand Down Expand Up @@ -526,7 +526,7 @@ namespace Geometry
return "m-3m (Cubic)";
}

bool PointGroupLaue13::isEquivalent(V3D hkl, V3D hkl2)
bool PointGroupLaue13::isEquivalent(const V3D &hkl, const V3D &hkl2) const
{
double h=hkl[0];
double k=hkl[1];
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/Geometry/test/PointGroupTest.h
Expand Up @@ -234,7 +234,7 @@ class PointGroupTest : public CxxTest::TestSuite
~TestablePointGroup() {}

MOCK_METHOD0(getName, std::string());
MOCK_METHOD2(isEquivalent, bool(V3D hkl, V3D hkl2));
MOCK_CONST_METHOD2(isEquivalent, bool(const V3D &hkl, const V3D &hkl2));
MOCK_CONST_METHOD0(crystalSystem, PointGroup::CrystalSystem());
};

Expand Down

0 comments on commit 8cc7717

Please sign in to comment.