Ignore:
Timestamp:
06/22/15 13:36:12 (9 years ago)
Author:
mhnguyen
Message:

Implementing the first prototype of filter

+) Create new class filter
+) Implement class for specific algorithm
+) Implement inversing algorithm

Test
+) On Curie
+) Grid with one axis: passed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/axis.cpp

    r609 r619  
    8787 
    8888      StdSize true_size = value.numElements(); 
    89       if (size != true_size) 
     89      if (this->ni.getValue() != true_size) 
    9090         ERROR("CAxis::checkAttributes(void)", 
    9191               << "The array \'value\' of axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] has a different size that the one defined by the \'size\' attribute"); 
     
    306306  } 
    307307 
     308  bool CAxis::hasTransformation() 
     309  { 
     310    return (!transformations_.empty()); 
     311  } 
     312 
     313  void CAxis::setTransformations(const std::vector<ETransformationType>& transformations) 
     314  { 
     315    transformations_ = transformations; 
     316  } 
     317 
     318  void CAxis::solveInheritanceTransformation() 
     319  { 
     320    if (this->hasTransformation()) return; 
     321 
     322    std::vector<CAxis*> refAxis; 
     323    CAxis* refer_sptr; 
     324    CAxis* refer_ptr = this; 
     325    while (refer_ptr->hasDirectAxisReference()) 
     326    { 
     327      refAxis.push_back(refer_ptr); 
     328      refer_sptr = refer_ptr->getDirectAxisReference(); 
     329      refer_ptr  = refer_sptr; 
     330      if (refer_ptr->hasTransformation()) break; 
     331    } 
     332 
     333    if (refer_ptr->hasTransformation()) 
     334      for (int idx = 0; idx < refAxis.size(); ++idx) 
     335        refAxis[idx]->setTransformations(refer_ptr->getTransformations()); 
     336  } 
     337 
     338  void CAxis::parse(xml::CXMLNode & node) 
     339  { 
     340    SuperClass::parse(node); 
     341 
     342    if (node.goToChildElement()) 
     343    { 
     344      StdString tranformation("transformation"); 
     345      do 
     346      { 
     347        if (node.getElementName() == tranformation) { 
     348           this->getVirtualTransformationGroup()->parseChild(node); 
     349           transformations_.push_back(eInverse); 
     350        } 
     351      } while (node.goToNextElement()) ; 
     352      node.goToParentElement(); 
     353    } 
     354  } 
     355 
     356  const std::vector<ETransformationType>& CAxis::getTransformations() 
     357  { 
     358    return transformations_; 
     359  } 
     360 
    308361   DEFINE_REF_FUNC(Axis,axis) 
    309362 
Note: See TracChangeset for help on using the changeset viewer.