Added operator== implementation
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006-2009, Haiku.
|
* Copyright 2006-2012, Haiku.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -317,6 +317,34 @@ VectorPath::operator=(const VectorPath& from)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
VectorPath::operator==(const VectorPath& other) const
|
||||||
|
{
|
||||||
|
if (fClosed != other.fClosed)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (fPointCount != other.fPointCount)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (fPath == NULL && other.fPath == NULL)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (fPath == NULL || other.fPath == NULL)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for (int32 i = 0; i < fPointCount; i++) {
|
||||||
|
if (fPath[i].point != other.fPath[i].point
|
||||||
|
|| fPath[i].point_in != other.fPath[i].point_in
|
||||||
|
|| fPath[i].point_out != other.fPath[i].point_out
|
||||||
|
|| fPath[i].connected != other.fPath[i].connected) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
VectorPath::MakeEmpty()
|
VectorPath::MakeEmpty()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006-2007, Haiku.
|
* Copyright 2006-2012, Haiku.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -89,7 +89,7 @@ class VectorPath {
|
|||||||
|
|
||||||
// VectorPath
|
// VectorPath
|
||||||
VectorPath& operator=(const VectorPath& from);
|
VectorPath& operator=(const VectorPath& from);
|
||||||
// bool operator==(const VectorPath& from) const;
|
bool operator==(const VectorPath& from) const;
|
||||||
|
|
||||||
void MakeEmpty();
|
void MakeEmpty();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user