Ejemplo n.º 1
0
void GraphToFibers::handleNotification(Field* field)
{
  if (field == _inGraphFld)
  {
    ml::Base *inValue = _inGraphFld->getBaseValue();

    if (inValue)
    {
      if (ML_BASE_IS_A(inValue, ml::Graph))
      {
        ml::Graph* inGraph = ((ml::Graph*)inValue);
        _inGraph = *inGraph;
      }
    }
    else
    {
      _inGraph.clearGraph();
    }

    _updateOutput();

  }

}
Ejemplo n.º 2
0
void SavePRC::handleNotification (Field* field)
{
  if (field == _mlSaveFld) 
  {
    saveButtonClicked();
  } 

  if (field == _inPointPositionsFld)
  {
    ml::Base *inBaseValue = _inPointPositionsFld->getBaseValue();

    if (inBaseValue)
    {
      if (ML_BASE_IS_A(inBaseValue, ml::XMarkerList))
      {
        ml::XMarkerList* inList = ((ml::XMarkerList*)inBaseValue);
        _inPointPositions.fromXMarkerList(*inList);
      }
      else
      {
        ml::ColoredMarkerList* inList = ((ml::ColoredMarkerList*)inBaseValue);
         _inPointPositions = *inList;
      }
    }
    else
    {
      _inPointPositions.clear();
    }
  }

  if (field == _inLinePositionsFld)
  {
    ml::Base *inBaseValue = _inLinePositionsFld->getBaseValue();

    if (inBaseValue)
    {
      if (ML_BASE_IS_A(inBaseValue, ml::XMarkerList))
      {
        ml::XMarkerList* inList = ((ml::XMarkerList*)inBaseValue);
        _inLinePositions.fromXMarkerList(*inList);
      }
      else
      {
        ml::ColoredMarkerList* inList = ((ml::ColoredMarkerList*)inBaseValue);
         _inLinePositions = *inList;
      }
    }
    else
    {
      _inLinePositions.clear();
    }
  }

  if (field == _inLineConnectionsFld)
  {
    ml::IndexPairList* inList = ((ml::IndexPairList*)_inLineConnectionsFld->getBaseValue());

    if (inList != NULL)
    {
      _inLineConnections = (*inList);
    }
    else
    {
      _inLineConnections.clear();
    }

  }

  if (field == _newSpecificationAddFld)
  {
    AddNewSpecification();
  }

  if (field == _newSpecificationTypeFld)
  {
    UpdateObjectTypeTabView();
  }

  if ( (field == _newSpecificationTypeFld) ||
       (field == _newSpecificationObjectNameFld) ||
       (field == _newSpecificationGroupPathFld) ||
       (field == _newSpecificationUseDefaultColorFld) ||
       (field == _newSpecificationUseDefaultSpecularColorFld) ||
       (field == _newSpecificationColorFld) ||
       (field == _newSpecificationColorAlphaFld) ||
       (field == _newSpecificationSpecularColorFld) ||
       (field == _newSpecificationModelVisibilityFld) ||
       (field == _newSpecificationMetaDataKeyFld) ||
       (field == _newSpecificationMetaDataValueFld) ||
       (field == _newSpecificationWEMLabelFld) ||
       (field == _newSpecificationPositionTypesFld) ||
       (field == _newSpecificationConnectionTypesFld)  
     )
  {
    UpdateNewSpecification();
  }

  // call parent class and handle apply/autoApply and in/outputs
  WEMInspector::handleNotification(field);
}