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

Implementing generic transformation algorithm (local commit)

+) Change a little bit to make sure everything work in order

Test
+) test_new_features passe with inverse

File:
1 edited

Legend:

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

    r620 r621  
    1818      , CAxisAttributes(), isChecked(false), relFiles(), baseRefObject(), areClientAttributesChecked_(false) 
    1919      , isDistributed_(false) 
    20    { /* Ne rien faire de plus */ } 
     20      , transformationMap_() 
     21   { 
     22   } 
    2123 
    2224   CAxis::CAxis(const StdString & id) 
     
    2426      , CAxisAttributes(), isChecked(false), relFiles(), baseRefObject(), areClientAttributesChecked_(false) 
    2527      , isDistributed_(false) 
    26    { /* Ne rien faire de plus */ } 
     28      , transformationMap_() 
     29   { 
     30   } 
    2731 
    2832   CAxis::~CAxis(void) 
     
    308312  bool CAxis::hasTransformation() 
    309313  { 
    310     return (!transformations_.empty()); 
    311   } 
    312  
    313   void CAxis::setTransformations(const std::vector<CTransformation*>& transformations) 
    314   { 
    315     transformations_ = transformations; 
    316   } 
    317  
    318   std::vector<CTransformation*> CAxis::getAllTransformations(void) 
    319   { 
    320     if (!hasTransformation()) 
    321       setTransformations(this->getVirtualTransformationGroup()->getAllChildren()); 
    322  
    323     return transformations_; 
     314    return (!transformationMap_.empty()); 
     315  } 
     316 
     317  void CAxis::setTransformations(const TransMapTypes& axisTrans) 
     318  { 
     319    transformationMap_ = axisTrans; 
     320  } 
     321 
     322  CAxis::TransMapTypes CAxis::getAllTransformations(void) 
     323  { 
     324    return transformationMap_; 
     325  } 
     326 
     327  /*! 
     328    Check the validity of all transformations applied on axis 
     329  This functions is called AFTER all inherited attributes are solved 
     330  */ 
     331  void CAxis::checkTransformations() 
     332  { 
     333    TransMapTypes::const_iterator itb = transformationMap_.begin(), it, 
     334                                  ite = transformationMap_.end(); 
     335    for (it = itb; it != ite; ++it) 
     336    { 
     337      (it->second)->checkValid(this); 
     338    } 
    324339  } 
    325340 
     
    350365    if (node.goToChildElement()) 
    351366    { 
    352       StdString tranformation("transformation"); 
     367      StdString inverseAxisDefRoot("inverse_axis_definition"); 
     368      StdString inverse("inverse_axis"); 
     369      StdString zoomAxisDefRoot("zoom_axis_definition"); 
     370      StdString zoom("zoom_axis"); 
    353371      do 
    354372      { 
    355         if (node.getElementName() == tranformation) { 
    356            this->getVirtualTransformationGroup()->parseChild(node); 
     373        if (node.getElementName() == inverse) { 
     374          CInverseAxis* tmp = (CInverseAxisGroup::get(inverseAxisDefRoot))->createChild(); 
     375          tmp->parse(node); 
     376          transformationMap_[TRANS_INVERSE_AXIS] = tmp; 
     377        } else if (node.getElementName() == zoom) { 
     378          CZoomAxis* tmp = (CZoomAxisGroup::get(zoomAxisDefRoot))->createChild(); 
     379          tmp->parse(node); 
     380          transformationMap_[TRANS_ZOOM_AXIS] = tmp; 
    357381        } 
    358382      } while (node.goToNextElement()) ; 
    359383      node.goToParentElement(); 
    360384    } 
    361     setTransformations(this->getVirtualTransformationGroup()->getAllChildren()); 
    362385  } 
    363386 
Note: See TracChangeset for help on using the changeset viewer.