1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: PlaneGCSSolver_PointWrapper.cpp
4 // Created: 14 Dec 2015
5 // Author: Artem ZHIDKOV
7 #include <PlaneGCSSolver_PointWrapper.h>
9 PlaneGCSSolver_PointWrapper::PlaneGCSSolver_PointWrapper(
10 const AttributePtr theAttribute, const GCSPointPtr thePoint)
14 myBaseAttribute = theAttribute;
17 void PlaneGCSSolver_PointWrapper::setGroup(const GroupID& theGroup)
20 std::list<EntityWrapperPtr>::iterator aSubsIt = mySubEntities.begin();
21 for (; aSubsIt != mySubEntities.end(); ++aSubsIt)
22 (*aSubsIt)->setGroup(theGroup);
23 std::list<ParameterWrapperPtr>::iterator aPIt = myParameters.begin();
24 for (; aPIt != myParameters.end(); ++aPIt)
25 (*aPIt)->setGroup(theGroup);
28 bool PlaneGCSSolver_PointWrapper::isUsed(AttributePtr theAttribute) const
30 return isBase(theAttribute);
33 bool PlaneGCSSolver_PointWrapper::isEqual(const EntityWrapperPtr& theOther)
35 if (type() != theOther->type())
38 // Verify equality of parameters
39 const std::list<ParameterWrapperPtr>& anOtherParams = theOther->parameters();
40 if (myParameters.size() != anOtherParams.size())
42 std::list<ParameterWrapperPtr>::const_iterator aMyIt = myParameters.begin();
43 std::list<ParameterWrapperPtr>::const_iterator anOtherIt = anOtherParams.begin();
44 for (; aMyIt != myParameters.end(); ++aMyIt, ++anOtherIt)
45 if (!(*aMyIt)->isEqual(*anOtherIt))
50 bool PlaneGCSSolver_PointWrapper::update(const EntityWrapperPtr& theOther)
52 bool isUpdated = false;
53 std::list<ParameterWrapperPtr> aMyParams = parameters();
54 std::list<ParameterWrapperPtr> anOtherParams = theOther->parameters();
55 std::list<ParameterWrapperPtr>::const_iterator aMyParIt = aMyParams.begin();
56 std::list<ParameterWrapperPtr>::const_iterator anOtherParIt = anOtherParams.begin();
57 for (; aMyParIt != aMyParams.end() && anOtherParIt != anOtherParams.end();
58 ++aMyParIt, ++anOtherParIt)
59 isUpdated = (*aMyParIt)->update(*anOtherParIt);