Added Path::contains(Instance*) method.
This commit is contained in:
parent
087ef239c2
commit
88081fae12
|
@ -233,6 +233,17 @@ bool Path::isEmpty() const
|
|||
return (_sharedPath == NULL);
|
||||
}
|
||||
|
||||
int32_t Path::contains(Instance* element) const
|
||||
// ********************************************
|
||||
{
|
||||
int32_t depth = 0;
|
||||
for ( Instance* instance : getInstances() ) {
|
||||
if (instance == element) return depth;
|
||||
++depth;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void Path::makeEmpty()
|
||||
// *******************
|
||||
{
|
||||
|
|
|
@ -17,9 +17,7 @@
|
|||
// not, see <http://www.gnu.org/licenses/>.
|
||||
// ****************************************************************************************************
|
||||
|
||||
#ifndef HURRICANE_PATH
|
||||
#define HURRICANE_PATH
|
||||
|
||||
#pragma once
|
||||
#include "hurricane/Instances.h"
|
||||
#include "hurricane/Transformation.h"
|
||||
|
||||
|
@ -87,6 +85,7 @@ class Path {
|
|||
// **********
|
||||
|
||||
public: bool isEmpty() const;
|
||||
public: int32_t contains(Instance*) const;
|
||||
|
||||
// Updators
|
||||
// ********
|
||||
|
@ -115,9 +114,6 @@ class Path {
|
|||
INSPECTOR_PR_SUPPORT(Hurricane::Path);
|
||||
|
||||
|
||||
#endif // HURRICANE_PATH
|
||||
|
||||
|
||||
// ****************************************************************************************************
|
||||
// Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
|
||||
// ****************************************************************************************************
|
||||
|
|
Loading…
Reference in New Issue