Пример #1
0
//----------------------------------------------------------------------------------
//! Constructor
//----------------------------------------------------------------------------------
WEMVolume::WEMVolume (std::string type)
  : WEMInspector(type)
{
  ML_TRACE_IN("WEMVolume::WEMVolume()")

  FieldContainer *fields = getFieldContainer();
  ML_CHECK(fields);

  // Suppress calls of handleNotification on field changes.
  handleNotificationOff();

  // Add min, max volume, and corresponding index fields
  _minVolumeFld = fields->addFloat("minVolume");
  _minVolumeFld->setFloatValue(0.0f);
  _maxVolumeFld = fields->addFloat("maxVolume");
  _maxVolumeFld->setFloatValue(0.0f);
  _minVolumeIndexFld = fields->addInt("minVolumePatchIndex");
  _minVolumeIndexFld->setIntValue(0);
  _maxVolumeIndexFld = fields->addInt("maxVolumePatchIndex");
  _maxVolumeIndexFld->setIntValue(0);
  
  // Add output curve field
  _outputVolumeCurveFld = fields->addBase("outputVolumeCurve");
  _outputVolumeCurveFld->setBaseValue(&_outputVolumeCurve);

  // Reactivate calls of handleNotification on field changes.
  handleNotificationOn();
}
//----------------------------------------------------------------------------------
//! Constructor
//----------------------------------------------------------------------------------
WEMCMSelectPatches::WEMCMSelectPatches (std::string type)
  : WEMProcessor(type, false)
{
  ML_TRACE_IN("WEMCMSelectPatches::WEMCMSelectPatches()")

  FieldContainer *fields = getFieldContainer();
  ML_CHECK(fields);

  // Suppress calls of hanbdleNotification on field changes.
  handleNotificationOff();

  // WEM Patch start and end index field
  _patchStartIndexFld = fields->addInt("patchStartIndex");
  _patchStartIndexFld->setIntValue(0);
  _patchEndIndexFld = fields->addInt("patchEndIndex");
  _patchEndIndexFld->setIntValue(0);

  // Bool field to enable to select only one patch based on start index value
  _onePatchFld = fields->addBool("onePatch");
  _onePatchFld->setBoolValue(false);
  
  // Set auto apply fields
  _autoApplyFld->setBoolValue(true);

  _notifyFld = fields->addNotify("notify");
 
  // Reactivate calls of handleNotification on field changes.
  handleNotificationOn();
}
//----------------------------------------------------------------------------------
//! Constructor
//----------------------------------------------------------------------------------
CalcCodedSegmentation::CalcCodedSegmentation (void) : BaseOp(1, 1)
{
  ML_TRACE_IN("CalcCodedSegmentation::CalcCodedSegmentation()")

  FieldContainer *fields = getFieldContainer();

  // Suppress calls of handleNotification on field changes.
  handleNotificationOff();

  MAX_SIZE = SHRT_MAX; //32767

  _fld_Add = fields->addNotify("Add");  
  (_fld_NameToAdd = fields->addString("NameToAdd"))->setStringValue("");
  (_fld_addMinValue = fields->addInt("addMinValue"))->setIntValue(1);
  (_fld_addMaxValue = fields->addInt("addMaxValue"))->setIntValue(ML_INT_MAX);
  (_fld_addAllExceptNull = fields->addBool("addAllExceptNull"))->setBoolValue(false);
  _fld_Reset = fields->addNotify("Reset");
  _fld_Purge = fields->addNotify("Purge");
  _fld_Finish = fields->addNotify("Finish");
  (_fld_ImageValues = fields->addString("ImageValues"))->setStringValue("");
  (_fld_ObjectValues = fields->addString("ObjectValues"))->setStringValue("");

  //All pointer values need to be set NULL here, before reset, otherwise, default random values of pointe can be interpreted as real values and a non existing pointer is tried to delete ... uuhhhh
  _virtualVolume = NULL;
  replaceValues = NULL;
  objectValues = NULL;
  valuesForObjects = NULL;
  objectNames = NULL;

  reset();

  // Reactivate calls of handleNotification on field changes.
  handleNotificationOn();
}
//! Constructor
ColoredMarkerListContainer::ColoredMarkerListContainer()
: ListContainerTemplate<ColoredMarkerList>(0, 0)
{
    ML_TRACE_IN("ColoredMarkerListContainer::ColoredMarkerListContainer(): ListContainerTemplate<ColoredMarkerList>(0, 0)");

    FieldContainer *fields = getFieldContainer();
    
    // Suppress handleNotification()
    _lockNotification = 1;
    
    // Position fields
    (_fldPos3D    = fields->addVector3("posXYZ")) ->setVector3Value(Vector3(0));
    (_fldPosC     = fields->addFloat("posC"))     ->setFloatValue(0);
    (_fldPosT     = fields->addFloat("posT"))     ->setFloatValue(0);
    (_fldPosU     = fields->addFloat("posU"))     ->setFloatValue(0);

    // Color fields
    (_fldColor    = fields->addColor("color"))    ->setColorValue(0,0,0);
    (_fldAlpha    = fields->addFloat("alpha"))    ->setFloatValue(1);
    _fldAlpha->setFloatMinValue(0);
    _fldAlpha->setFloatMaxValue(1);

    // Type field
    (_fldType = fields->addInt("type"))->setIntValue(0);
    

    // Template position fields
    (_fldNewPos3D = fields->addVector3("newPosXYZ")) ->setVector3Value(Vector3(0));
    (_fldNewPosC  = fields->addFloat("newPosC"))     ->setFloatValue(0);
    (_fldNewPosT  = fields->addFloat("newPosT"))     ->setFloatValue(0);
    (_fldNewPosU  = fields->addFloat("newPosU"))     ->setFloatValue(0);

    // Template color fields
    (_fldNewColor = fields->addColor("newColor"))    ->setColorValue(0,0,0);
    (_fldNewAlpha = fields->addFloat("newAlpha"))    ->setFloatValue(1);
    _fldNewAlpha->setFloatMinValue(0);
    _fldNewAlpha->setFloatMaxValue(1);    

    // Template Type field
    (_fldNewType = fields->addInt("newType"))->setIntValue(0);

    // Template Enable handleNotification()
    _lockNotification = 0;
}
//----------------------------------------------------------------------------------
//! Constructor
//----------------------------------------------------------------------------------
CSOPointsToXMarkers::CSOPointsToXMarkers (void)
  : BaseOp(0, 0), _inputCSOList(NULL)
{
  ML_TRACE_IN("CSOPointsToXMarkers::CSOPointsToXMarkers()")

  FieldContainer *fields = getFieldContainer();

  // Suppress calls of handleNotification on field changes.
  handleNotificationOff();

  // Input CSO List field
  _inputCSOListFld = fields->addBase("inputCSOList");
  _inputCSOListFld->setBaseValue(NULL);

  // Output XMarkerList field
  _outputXMarkerListFld = fields->addBase("outputXMarkerList");
  _outputXMarkerListFld->setBaseValue(&_outputXMarkerList);
  
  // List index field
  _listIndexFld = fields->addInt("listIndexFld");
  _listIndexFld->setIntValue(0);

  // Bool to enable/disable to also export the path points
  _convertPathPoints=fields->addBool("convertPathPoints");

  // Bool to enable/disable to export CSO normals
  _outputCSONormals = fields->addBool("outputCSONormals");
  _outputCSONormals->setBoolValue(false);

  // Bool, if checked the cso id is put in the marker type
  // (instead of the conventional index)
  _setIdInMarkerTypeFld = fields->addBool("setIdInMarkerType");
  _setIdInMarkerTypeFld->setBoolValue(false);

  // Reactivate calls of handleNotification on field changes.
  handleNotificationOn();
}