//---------------------------------------------------------------------------------- //! Constructor //---------------------------------------------------------------------------------- WEMNodesToFile::WEMNodesToFile (std::string type) : WEMInspector(type) { ML_TRACE_IN("WEMNodesToFile::WEMNodesToFile()") FieldContainer *fields = getFieldContainer(); ML_CHECK(fields); // Suppress calls of handleNotification on field changes. handleNotificationOff(); // Add filename field _filenameFld = fields->addString("filename"); _filenameFld->setStringValue(""); // Add transformix option field _transformixCompatibleFld = fields->addBool("transformixCompatible"); _transformixCompatibleFld->setBoolValue(false); // Add save button _saveFld = fields->addNotify("save"); // Reactivate calls of handleNotification on field changes. handleNotificationOn(); }
//---------------------------------------------------------------------------------- //! 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 //---------------------------------------------------------------------------------- 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 //---------------------------------------------------------------------------------- StringToCurve::StringToCurve () : BaseOp(0, 0) { ML_TRACE_IN("StringToCurve::StringToCurve ()") handleNotificationOff(); FieldContainer *fieldC = getFieldContainer(); m_OutCurveList = new CurveList; f_OutCurveList = fieldC->addBase( "outCurveList" ); f_OutCurveList->setBaseValue( m_OutCurveList ); f_CurveString = fieldC->addString("curveString"); f_CurveString->setStringValue(""); f_IndexString = fieldC->addString("indexString"); f_IndexString->setStringValue(""); f_ValueSeparator = fieldC->addString("valueSeparator"); f_ValueSeparator->setStringValue(" "); f_CurveSeparator = fieldC->addString( "curveSeparator" ); f_CurveSeparator->setStringValue(";"); handleNotificationOn(); }
DicomSurfaceSegmentationLoad::DicomSurfaceSegmentationLoad(std::string type) : WEMGenerator(type) { //Suppress calls of handleNotification on field changes to //avoid side effects during initialization phase. handleNotificationOff(); // Init globals _datasetPointer.reset(); // Output fields (_outPointSetPositionsFld = addBase("outPointSetPositions")) ->setBaseValueAndAddAllowedType(&_outPointSetPositions); (_outLineSetPositionsFld = addBase("outLineSetPositions")) ->setBaseValueAndAddAllowedType(&_outLineSetPositions); //(_outLineSetConnectionsFld = addBase("outLineSetConnections")) ->setBaseValueAndAddAllowedType(&_outLineSetConnections); // UI fields _filenameFld = addString("filename", ""); _unloadFld = addNotify("unload"); _outputValidFld = addBool("outputValid", false); _numPointSetsFld = addInt("numPointSets", 0); _numLineSetsFld = addInt("numLineSets", 0); _numMeshesFld = addInt("numMeshes", 0); _numUnknownObjectsFld = addInt("numUnknownObjects", 0); _pointSetsInfoFld = addString("pointSetsInfo", POINTSETINFOCOLUMNS); _lineSetsInfoFld = addString("lineSetsInfo", LINESETINFOCOLUMNS); _meshesInfoFld = addString("meshesInfo", MESHINFOCOLUMNS); _unknownObjectsInfoFld = addString("unknownObjectsInfo", UNKNOWNOBJECTINFOCOLUMNS); _pointSetsExportMarkerTypeStartValueFld = addInt("pointSetsExportMarkerTypeStartValue", 1); _lineSetsExportMarkerTypeStartValueFld = addInt("lineSetsExportMarkerTypeStartValue", 1); _meshesIDStartValueFld = addInt("meshesIDStartValueFld", 1); _allDicomTagsFld = addString("allDicomTags", ""); _tagName0Fld = addString("tagName0", ""); _tagName1Fld = addString("tagName1", ""); _tagName2Fld = addString("tagName2", ""); _tagName3Fld = addString("tagName3", ""); _tagName4Fld = addString("tagName4", ""); _tagName5Fld = addString("tagName5", ""); _tagName6Fld = addString("tagName6", ""); _tagName7Fld = addString("tagName7", ""); _tagName8Fld = addString("tagName8", ""); _tagName9Fld = addString("tagName9", ""); _tagValue0Fld = addString("tagValue0", ""); _tagValue1Fld = addString("tagValue1", ""); _tagValue2Fld = addString("tagValue2", ""); _tagValue3Fld = addString("tagValue3", ""); _tagValue4Fld = addString("tagValue4", ""); _tagValue5Fld = addString("tagValue5", ""); _tagValue6Fld = addString("tagValue6", ""); _tagValue7Fld = addString("tagValue7", ""); _tagValue8Fld = addString("tagValue8", ""); _tagValue9Fld = addString("tagValue9", ""); //Reactivate calls of handleNotification on field changes handleNotificationOn(); }
LoadPointLineGeometry::LoadPointLineGeometry() : Module(0, 0) { // Suppress calls of handleNotification on field changes to // avoid side effects during initialization phase. handleNotificationOff(); // Add output field (_outPositionsListFld = addBase("outPositionsList"))->setBaseValueAndAddAllowedType(&_outPositionsList); (_outConnectionsListFld = addBase("outConnectionsList"))->setBaseValueAndAddAllowedType(&_outConnectionsList); (_outFibersFld = addBase("outFibers"))->setBaseValueAndAddAllowedType(&_outFiberSetContainer); (_outCachedPositionsListFld = addBase("outCachedPositionsList"))->setBaseValueAndAddAllowedType(&_outCachedPositionsList); (_outCachedConnectionsListFld = addBase("outCachedConnectionsList"))->setBaseValueAndAddAllowedType(&_outCachedConnectionsList); // Add parameter fields _filenameFld = addString("filename",""); _filterFld = addString("filter",""); _numberDelimiterFld = addString("numberDelimiter", ";"); _numberDelimiterSpaceFld = addBool("numberDelimiterSpace", true); _decimalSeparatorFld = addString("decimalSeparator", "."); _loadFld = addNotify("load"); _unloadFld = addNotify("unload"); _autoLoadFld = addBool("autoLoad", false); _positionsLoadedFld = addBool("positionsLoaded", false); _connectionsLoadedFld = addBool("connectionsLoaded", false); _addToCacheFld = addNotify("addToCache"); _clearCacheFld = addNotify("clearCache"); _autoAddToCacheFld = addBool("autoAddToCache", false); // 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(); }
void DicomSurfaceSegmentationLoad::_updateOutputFields() { handleNotificationOff(); _outPointSetPositions.clear(); _outLineSetPositions.clear(); //_outLineSetConnections.clear(); _cleanup(); for (std::size_t i=0; i<_dicomPointSetsVector.size(); i++) { _addPointSetToOutput((int)i); } for (std::size_t i=0; i<_dicomLineSetsVector.size(); i++) { _addLineSetToOutput((int)i); } for (std::size_t i=0; i<_dicomMeshesVector.size(); i++) { _addMeshToOutput((int)i); } handleNotificationOn(); _outPointSetPositionsFld->touch(); _outLineSetPositionsFld->touch(); //_outLineSetConnectionsFld->touch(); _notifyObservers(); }
GraphToFibers::GraphToFibers() : Module(0, 0) { // Suppress calls of handleNotification on field changes to // avoid side effects during initialization phase. handleNotificationOff(); // Add fields to the module and set their values. (_inGraphFld = addBase("inGraph"))->setBaseValueAndAddAllowedType(&_inGraph); (_outNodePositionsFld = addBase("outNodePositions"))->setBaseValueAndAddAllowedType(&_outNodePositions); (_outEdgePositionsFld = addBase("outEdgePositions"))->setBaseValueAndAddAllowedType(&_outEdgePositions); (_outEdgeConnectionsFld = addBase("outEdgeConnections"))->setBaseValueAndAddAllowedType(&_outEdgeConnections); (_outFibersFld = addBase("outFibers"))->setBaseValueAndAddAllowedType(&_outFiberSetContainer); // Reactivate calls of handleNotification on field changes. handleNotificationOn(); // Activate inplace data buffers for output outputIndex and input inputIndex. // setOutputImageInplace(outputIndex, inputIndex); // Activate page data bypass from input inputIndex to output outputIndex. // Note that the module must still be able to calculate the output image. // setBypass(outputIndex, inputIndex); }
void ListModifyProperties::_updateOutputListBase() { ML_TRACE_IN("void ListModifyProperties::_updateOutputListBase()"); ListBase* newOutList = NULL; ListBase* inList = static_cast<ListBase*>(_inListFld->getBaseValue()); if (inList) { const RuntimeType* inListType = inList->getTypeId(); ML_CHECK_RUNTIME_TYPE(inListType); // Create new output list newOutList = static_cast<ListBase*>(inListType->createInstance()); // If instance creation was successful if (newOutList) { MLssize_t insertPos = 0; // Now loop through all input list items for (MLssize_t i = 0; i < static_cast<MLssize_t>(inList->getSize()); i++) { BaseItem* inListItem = inList->getItemAt(i); if (inListItem) { // Nothing to do for BaseItem lists in this version -> just copy lists newOutList->insertItemAt(insertPos, inListItem); insertPos++; } else { ML_PRINT_ERROR("void ListModifyProperties::_updateOutput()", ML_BAD_BASE_FIELD_CONTENT, "Error: An input list contains elements not derived from Base."); } } } else { ML_PRINT_ERROR("void ListModifyProperties::_updateOutput()", ML_BAD_STATE, "Error: Output list could not be created."); } } // if (_inList) handleNotificationOff(); ListBase* oldOutList = static_cast<ListBase*>(_outListFld->getBaseValue()); ML_DELETE(oldOutList); handleNotificationOn(); _outListFld->setBaseValue(newOutList); }
//---------------------------------------------------------------------------------- //! Constructor / Destructor //---------------------------------------------------------------------------------- METKGlobalMessages::METKGlobalMessages (void) : inherited(0,0,ObjMgrClient::EVENTS_SELECTED) { ML_TRACE_IN("METKGlobalMessages::METKGlobalMessages()"); // Suppress calls of handleNotification on field changes. handleNotificationOff(); loadedFld = getFieldContainer()->addNotify("loaded"); cleanupFld = getFieldContainer()->addNotify("cleanup"); lastMessageFld = getFieldContainer()->addString("lastMessage"); // Reactivate calls of handleNotification on field changes. handleNotificationOn(); }
AnalyzeHeader::AnalyzeHeader() : BaseOp(0, 0) { ML_TRACE_IN("AnalyzeHeader::AnalyzeHeader()") handleNotificationOff(); (_filenameFld = getFieldContainer()->addString("filename"))->setStringValue(""); (_funused1Fld = getFieldContainer()->addFloat("funused1"))->setFloatValue(0.0f); (_funused2Fld = getFieldContainer()->addFloat("funused2"))->setFloatValue(0.0f); (_funused3Fld = getFieldContainer()->addFloat("funused3"))->setFloatValue(0.0f); (_dimensionsFld = getFieldContainer()->addVec4f("dimensions"))->setVec4fValue(vec4(0.0f,0.0f,0.0f,0.0f)); (_voxelSizeFld = getFieldContainer()->addVec4f("voxelSize"))->setVec4fValue(vec4(0.0f,0.0f,0.0f,0.0f)); (_originFld = getFieldContainer()->addVec3f("origin"))->setVec3fValue(vec3(0.0f,0.0f,0.0f)); handleNotificationOn(); }
ListModifyProperties::ListModifyProperties () : Engine () { ML_TRACE_IN("ListModifyProperties::ListModifyProperties () : Engine (), _needsCompleteRebuild(true)"); handleNotificationOff(); (_outListFld = addBase("outList", NULL))->addAllowedType<ListBase>(); (_inListFld = addBase("inList", NULL))->addAllowedType<ListBase>(); _updateFld = addNotify("update"); (_autoUpdateModeFld = addEnum("updateMode", AutoUpdateModeNames, AutoUpdateModeCount))->setEnumValue(AutoUpdateModeAutoUpdate); _clearFld = addNotify("clear"); _changeTypeValueFld = addInt("changeTypeValue", 0); handleNotificationOn(); }
U3DLoad::U3DLoad() : U3DGenerator() { // Suppress calls of handleNotification on field changes to // avoid side effects during initialization phase. handleNotificationOff(); // Add input fields to the module and set allowed types. // Add output fields to the module and set allowed types. // Add and initialize parameter fields // Init global variables // Reactivate calls of handleNotification on field changes. handleNotificationOn(); }
//---------------------------------------------------------------------------------- //! Constructor //---------------------------------------------------------------------------------- METKAutoFading::METKAutoFading (void) : inherited(0,0,ObjMgrClient::EVENTS_SELECTED) { ML_TRACE_IN("METKAutoFading::METKAutoFading()") myObjMgr = new ObjMgrCommunicator(); myCamera = new kCamera(); FieldContainer *fields = getFieldContainer(); // Suppress calls of handleNotification on field changes. handleNotificationOff(); _outScene = getFieldContainer()->addSoNode("outScene"); (_EnableFading = fields->addBool("EnableFading"))->setBoolValue(FALSE); (_UseMETKValues = fields->addBool("UseMETKValues"))->setBoolValue(FALSE); (_CurrentObject = fields->addString("CurrentObject"))->setStringValue(""); (_ViewerName = fields->addString("ViewerName"))->setStringValue("METKViewer3D"); _init = fields->addNotify("init"); _calc = fields->addNotify("calc"); (_dataPath = fields->addString("dataPath"))->setStringValue(""); _similarPosition = fields->addVec3f("similarPosition"); _camPosition = fields->addVec3f("camPosition"); _camOrientation = fields->addVec4f("camOrientation"); setAcceptedEvents(); m_soViewer = new SoVisDataViewer(); _outScene->setSoNodeValue(m_soViewer); oReceiver = new METKMsgReceiver(); oReceiver->messageFld->setStringValue("fading"); /*_message = (StringField*) getFieldContainer()->addField(oReceiver->getFieldContainer()->getField("message")); _messageData = (StringField*) getFieldContainer()->addField(oReceiver->getFieldContainer()->getField("data"));*/ _message = getFieldContainer()->addString("message"); oReceiver->messageFld->attachField(_message,0); _messageData = getFieldContainer()->addString("data"); oReceiver->getFieldContainer()->getField("data")->attachField(_messageData,0); timerSensor = new SoTimerSensor((SoSensorCB*)METKAutoFading::timerEvent, this); timerSensor->setInterval(SbTime(1.0/1000.0)); timerSensor->unschedule(); // Reactivate calls of handleNotification on field changes. handleNotificationOn(); }
SavePDFTemplate::SavePDFTemplate() : PDFGenerator() { // Suppress calls of handleNotification on field changes to // avoid side effects during initialization phase. handleNotificationOff(); // Add fields for demo data _imageFilenameFld = addString("imageFilename", ""); _modelFilenameFld = addString("modelFilename", ""); _posterFilenameFld = addString("posterFilename", ""); // Reactivate calls of handleNotification on field changes. handleNotificationOn(); // Activate inplace data buffers for output outputIndex and input inputIndex. // setOutputImageInplace(outputIndex, inputIndex); // Activate page data bypass from input inputIndex to output outputIndex. // Note that the module must still be able to calculate the output image. // setBypass(outputIndex, inputIndex); }
PixelCoordinates::PixelCoordinates() : Module(1, 1) { // Suppress calls of handleNotification on field changes to // avoid side effects during initialization phase. handleNotificationOff(); // Add fields to the module and set their values. _OutputFld = addString("Output", ""); // Reactivate calls of handleNotification on field changes. handleNotificationOn(); // Activate inplace data buffers for output outputIndex and input inputIndex. // setOutputImageInplace(outputIndex, inputIndex); // Activate page data bypass from input inputIndex to output outputIndex. // Note that the module must still be able to calculate the output image. // setBypass(outputIndex, inputIndex); }
ListInfo::ListInfo () : Engine () { ML_TRACE_IN("ListInfo::ListInfo () : Engine (), _needsCompleteRebuild(true)"); handleNotificationOff(); (_inListFld = addBase("inList1", NULL))->addAllowedType<ListBase>(); _listTypeFld = addString("listType", ""); _lengthFld = addInt("listLength",0); _typeMinFld = addInt("typeMinValue",0); _typeMaxFld = addInt("typeMaxValue",0); _numDifferentTypesFld = addInt("numDifferentTypes",0); _boundingBoxMinFld = addVector3("boundingBoxMin",0,0,0); _boundingBoxMaxFld = addVector3("boundingBoxMax",0,0,0); handleNotificationOn(); }
//---------------------------------------------------------------------------------- //! Constructor //---------------------------------------------------------------------------------- kAviWriter::kAviWriter (void) : BaseOp(1, 0) { ML_TRACE_IN("kAviWriter::kAviWriter()") handleNotificationOff(); (_enableRecordingFld = getFieldContainer()->addBool ("enableRecording"))->setBoolValue(false); (_outputFilenameFld = getFieldContainer()->addString("outputFilename")) ->setStringValue(""); (_codecCodeFld = getFieldContainer()->addString("codecCode")) ->setStringValue("cvid"); (_framesPerSecondFld = getFieldContainer()->addInt ("framesPerSecond"))->setIntValue(24); (_numFramesFld = getFieldContainer()->addInt ("numFrames")) ->setIntValue(0); (_messageFld = getFieldContainer()->addString("message")) ->setStringValue(""); (_availableCodecsFld = getFieldContainer()->addString("availableCodecs"))->setStringValue(""); _triggerResetFld = getFieldContainer()->addNotify("triggerReset"); _triggerMakeAviFld = getFieldContainer()->addNotify("triggerMakeAvi"); #ifdef WIN32 _codecName[0] = 'c'; _codecName[1] = 'v'; _codecName[2] = 'i'; _codecName[3] = 'd'; _avi = NULL; _hbitmap = NULL; _bits = NULL; _imgWidth = 0; _imgHeight = 0; #else _messageFld->setStringValue("Module available only under Windows!"); #endif handleNotificationOn(); }
//---------------------------------------------------------------------------------- //! Constructor //---------------------------------------------------------------------------------- FuzzyConnectedness::FuzzyConnectedness () : BaseOp(2, 2) { ML_TRACE_IN("FuzzyConnectedness::FuzzyConnectedness ()"); // Suppress calls of handleNotification on field changes to // avoid side effects during initialization phase. handleNotificationOff(); //Initialise fields _startButtonFld = getFieldContainer()->addNotify("startButton"); _autoUpdateFld = getFieldContainer()->addBool("autoUpdate"); // Reactivate calls of handleNotification on field changes. handleNotificationOn(); // Activate parallel execution of calcOutSubImage. setThreadSupport(NO_THREAD_SUPPORT ); // Specify whether the module can only process standard scalar voxel types or // also registered voxel types (vec2, mat2, complexf, Vector, etc.) setVoxelDataTypeSupport(ONLY_STANDARD_TYPES); }
//---------------------------------------------------------------------------------- //! Constructor //---------------------------------------------------------------------------------- WEMCenterOfMass::WEMCenterOfMass (std::string type) : WEMInspector(type) { ML_TRACE_IN("WEMCenterOfMass::WEMCenterOfMass()") FieldContainer *fieldC = getFieldContainer(); ML_CHECK(fieldC); // Suppress calls of handleNotification on field changes. handleNotificationOff(); // Add output fields _centerOfMass = fieldC->addVec3f("centerOfMass"); _centerOfMass->setVec3fValue(vec3(0.0,0.0,0.0)); _inverseCenterOfMass = fieldC->addVec3f("inverseCenterOfMass"); _inverseCenterOfMass->setVec3fValue(vec3(0.0,0.0,0.0)); _useSurface = fieldC->addBool("useSurface"); _useSurface->setBoolValue( false ); // Reactivate calls of handleNotification on field changes. handleNotificationOn(); }
//---------------------------------------------------------------------------------- //! Constructor //---------------------------------------------------------------------------------- SyncFields::SyncFields () : BaseOp(0, 0) { ML_TRACE_IN("SyncFields::SyncFields ()"); handleNotificationOff(); FieldContainer *fieldC = getFieldContainer(); const char* syncModes[] = {"Float","MultiFloat","Vector","MultiVector"}; f_Mode = fieldC->addEnum("mode",syncModes,4); f_Mode->setEnumValue( FLOAT ); f_On = fieldC->addBool("on"); f_On->setBoolValue( true ); f_Precision = fieldC->addDouble("precision"); f_Precision->setDoubleValue( 1e-3f ); for (unsigned int iFloat=0; iFloat < NFIELDS; ++iFloat ){ std::stringstream ss; ss << iFloat; std::string currentName = "float" + ss.str(); m_FloatsFields.push_back(fieldC->addDouble(currentName.c_str()) ); m_FloatsFields[iFloat]->setDoubleValue( 0.0f ); } for (unsigned int iVector =0; iVector < NFIELDS; ++iVector ){ std::stringstream ss; ss << iVector; std::string currentName = "vector" + ss.str(); m_Vec6Fields.push_back( fieldC->addVec6f(currentName.c_str()) ); m_Vec6Fields[iVector]->setVec6fValue( vec6() ); } m_Updating = false; handleNotificationOn(); }
//---------------------------------------------------------------------------------- //! 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(); }
PDFCalcCamera::PDFCalcCamera() : Module(0, 0) { // Suppress calls of handleNotification on field changes to // avoid side effects during initialization phase. handleNotificationOff(); //! Inventor camera fields (needed for calculation of PDF view camera from Inventor camera settings) _calculateCameraFromInventorSceneFld = addNotify("calculateCameraFromInventorScene"); (_autoCalculateCameraFromInventorSceneFld = addBool("autoCalculateCameraFromInventorScene"))->setBoolValue(false); (_inventorCameraPositionFld = addVector3("inventorCameraPosition"))->setVector3Value(Vector3(0, 0, 0)); (_inventorCameraOrientationFld = addVector4("inventorCameraOrientation"))->setVector4Value(Vector4(0, 0, 1, 0)); (_inventorCameraFocalDistanceFld = addFloat("inventorCameraFocalDistance"))->setFloatValue(0); (_inventorCameraHeightFld = addFloat("inventorCameraHeight"))->setFloatValue(0); //! PDF view camera fields (_cameraCenterOfOrbitFld = addVector3("cameraCenterOfOrbit"))->setVector3Value(Vector3(0)); (_cameraCenterToCameraFld = addVector3("cameraCenterToCamera"))->setVector3Value(Vector3(0)); (_cameraRadiusOfOrbitFld = addFloat("cameraRadiusOfOrbit"))->setFloatValue(0); (_cameraFOVAngleFld = addFloat("cameraFOVAngle"))->setFloatValue(90.0f); (_cameraRollAngleFld = addFloat("cameraRollAngle"))->setFloatValue(0); // Reactivate calls of handleNotification on field changes. handleNotificationOn(); }
//---------------------------------------------------------------------------------- //! Constructor / Destructor //---------------------------------------------------------------------------------- METKSurfaceDistance3D::METKSurfaceDistance3D (void) : inherited(1,0,ObjMgrClient::EVENTS_SELECTED) { ML_TRACE_IN("METKSurfaceDistance3D::METKSurfaceDistance3D()"); // Suppress calls of handleNotification on field changes. handleNotificationOff(); _outInventor = getFieldContainer()->addSoNode("outInventor"); _nearDistance = getFieldContainer()->addFloat("nearDistance"); _nearDistanceColor = getFieldContainer()->addColor("nearDistanceColor"); _farDistance = getFieldContainer()->addFloat("farDistance"); _farDistanceColor = getFieldContainer()->addColor("farDistanceColor"); _nearDistance->setFloatValue(2.0); _farDistance->setFloatValue(5.0); _nearDistanceColor->setColorValue(1,0,0); _farDistanceColor->setColorValue(1,1,0); _outGroup = new SoSeparator(); // everything this group contains will always be valid _outGroup->ref(); _outInventor->setSoNodeValue(_outGroup); _inputImageIsValid = false; _image = NULL; _inImageBox = NULL; _memSlice = 0; clearAcceptedObjectIDs(); addAcceptedObjectID("*"); clearAcceptedInfoLayerNames(); addAcceptedInfoLayerName(LAY_APPEARANCE); // Reactivate calls of handleNotification on field changes. handleNotificationOn(); }
void ListModifyProperties::_updateOutputListSpecialized() { ML_TRACE_IN("void ListModifyProperties::_updateOutputListBase()"); ListBase* newOutList = NULL; ListBase* inList = static_cast<ListBase*>(_inListFld->getBaseValue()); if (inList) { const RuntimeType* inListType = inList->getTypeId(); ML_CHECK_RUNTIME_TYPE(inListType); MLint changeTypeValue = _changeTypeValueFld->getIntValue(); // Create new output list newOutList = static_cast<ListBase*>(inListType->createInstance()); // If instance creation was successful if (newOutList) { MLssize_t insertPos = 0; // copy list 0: for (MLssize_t i = 0; i < static_cast<MLssize_t>(inList->getSize()); i++) { ItemType* inListItem = static_cast<ItemType*>(inList->getItemAt(i)); ItemType newItem = *inListItem; if (inListItem) { if ( changeTypeValue != 0 ) { newItem.type += (int)changeTypeValue; } newOutList->insertItemAt(insertPos, &newItem); insertPos++; } else { ML_PRINT_ERROR("void ListModifyProperties::_updateOutput()", ML_BAD_BASE_FIELD_CONTENT, "Error: An input list contains elements not derived from Base."); } } } else { ML_PRINT_ERROR("void ListModifyProperties::_updateOutput()", ML_BAD_STATE, "Error: Output list could not be created."); } } // if (_inList) handleNotificationOff(); ListBase* oldOutList = static_cast<ListBase*>(_outListFld->getBaseValue()); ML_DELETE(oldOutList); handleNotificationOn(); _outListFld->setBaseValue(newOutList); }
//---------------------------------------------------------------------------------- //! Constructor //---------------------------------------------------------------------------------- SegmentationEvaluationMetric::SegmentationEvaluationMetric () : BaseOp(2, 0) { ML_TRACE_IN("SegmentationEvaluationMetric::SegmentationEvaluationMetric ()"); // Suppress calls of handleNotification on field changes to // avoid side effects during initialization phase. handleNotificationOff(); // Get reference to the container for parameters/fields. FieldContainer &fields = *getFieldContainer(); // Add fields to the module and set their values. // Also attach them to the output images to notify connected modules about changes. (_segmentationThresholdFld = fields.addInt("segmentationThreshold"))->setIntValue(0); (_referenceThresholdFld = fields.addInt("referenceThreshold"))->setIntValue(0); (_truePositiveFld = fields.addInt("truePositive"))->setIntValue(0); (_trueNegativeFld = fields.addInt("trueNegative"))->setIntValue(0); (_falsePositiveFld = fields.addInt("falsePositive"))->setIntValue(0); (_falseNegativeFld = fields.addInt("falseNegative"))->setIntValue(0); (_sensitivityFld = fields.addDouble("sensitivity"))->setDoubleValue(0.0); (_specificityFld = fields.addDouble("specificity"))->setDoubleValue(0.0); (_prevalenceFld = fields.addDouble("prevalence"))->setDoubleValue(0.0); (_levelOfTestFld = fields.addDouble("levelOfTest"))->setDoubleValue(0.0); (_diceSimilarityCoefficientFld = fields.addDouble("diceSimilarityCoefficient"))->setDoubleValue(0.0); (_cFactorFld = fields.addDouble("cFactor"))->setDoubleValue(0.0); (_isAutoApplyFld = fields.addBool("isAutoApply"))->setBoolValue(false); _applyFld = fields.addNotify("apply"); // Connect input field(s) with output field(s) to notify // connected modules if input image(s) change. for (int inIdx=0; inIdx < 2; ++inIdx){ for (int outIdx=0; outIdx < 0; ++outIdx){ getInField(inIdx)->attachField(getOutField(outIdx)); } } // Reactivate calls of handleNotification on field changes. handleNotificationOn(); // Activate inplace data buffers for output outIndex and input inIndex. // setOutImgInplace(outIndex, inIndex); // Activate page data bypass from input inIdx to output outIdx. // Note that the module must still be able to calculate the output image. // setBypass(outIndex, inIndex); // Activate parallel execution of calcOutSubImage. // setThreadSupport(supportMode); // with supportMode = // NO_THREAD_SUPPORT //! The module is not thread safe at all. // CALC_OUTSUBIMAGE_ON_STD_TYPES //! calcOutSubImage can be called in parallel for scalar voxel types. // CALC_OUTSUBIMAGE_ON_CARRIER_TYPES //! calcOutSubImage can be called in parallel for carrier voxel types. // CALC_OUTSUBIMAGE_ON_ALL_TYPES //! calcOutSubImage can be called in parallel for all voxel types. // Warning: You should be familiar with multithreading before activating this feature. // Specify whether the module can only process standard scalar voxel types or // also registered voxel types (vec2, mat2, complexf, Vector, etc.) // setVoxelDataTypeSupport(permittedTypes); // with permittedTypes = // ONLY_STANDARD_TYPES //! Only standard scalar voxels are supported. // FULLY_OPERATIONAL //! Scalar and registered voxels types are supported. // MINIMUM_OPERATIONAL //! Scalar and registered voxel types are supported. // //! Voxel operators are not used by algorithm. // // See ML Programming Guide, "Configuring Image Processing Behaviour of the BaseOp" // for further details. }
//---------------------------------------------------------------------------------- //! Handle field changes of the field field. //---------------------------------------------------------------------------------- void SyncFields::handleNotification (Field *field) { ML_TRACE_IN("SyncFields::handleNotification ()"); if ( m_Updating ||!f_On->getBoolValue() ) { return; } if ( field == f_Mode || field == f_On || field == f_Precision ) { switch ( f_Mode->getEnumValue() ){ case FLOAT: case MULTIFLOAT: this->handleNotification( m_FloatsFields[0] ); break; case VECTOR: case MULTIVECTOR: this->handleNotification( m_Vec6Fields[0] ); break; default: break; } } else { m_Updating = true; mlDebug( "Handling notification from: " << field->getName() ); unsigned int nFields = NFIELDS; switch ( f_Mode->getEnumValue() ){ case FLOAT : nFields = 2; case MULTIFLOAT: { std::vector< bool > changed(nFields,false); const double precision = f_Precision->getDoubleValue(); double newValue = 0.0; // determine the changed field for (unsigned int iFloat = 0; iFloat < nFields; ++iFloat){ if ( field == m_FloatsFields[iFloat] ){ changed[iFloat]= true; newValue = m_FloatsFields[iFloat]->getDoubleValue(); } else { changed[iFloat] = false; } } // Prevent notifications while updating all values handleNotificationOff(); // updated fields if necessary for (unsigned int iFloat = 0; iFloat < nFields; ++iFloat){ if ( !changed[iFloat] && DiffTest(newValue, m_FloatsFields[iFloat]->getDoubleValue(), precision ) ){ m_FloatsFields[iFloat]->setDoubleValue( newValue ); changed[iFloat] = true; } } handleNotificationOn(); for (unsigned int iFloat = 0; iFloat < nFields; ++iFloat){ if ( changed[iFloat] ){ m_FloatsFields[iFloat]->notifyAttachments(); } } break; } case VECTOR: nFields = 2; case MULTIVECTOR: { std::vector< bool > changed(nFields,false); const double precision = f_Precision->getDoubleValue(); vec6 newValue; for (unsigned int iVector = 0; iVector < nFields; ++iVector){ if ( field == m_Vec6Fields[iVector] ){ changed[iVector]= true; newValue = m_Vec6Fields[iVector]->getVec6fValue(); } else { changed[iVector] = false; } } // Prevent notifications while updating all values handleNotificationOff(); // Update fields if necessary for (unsigned int iVector = 0; iVector < nFields; ++iVector){ if ( !changed[iVector] && DiffTest(newValue, m_Vec6Fields[iVector]->getVec6fValue(), precision ) ){ m_Vec6Fields[iVector]->setVec6fValue( newValue ); changed[ iVector ] = true; } } handleNotificationOn(); for (unsigned int iVector = 0; iVector < nFields; ++iVector){ if ( changed[iVector] ){ m_Vec6Fields[iVector]->notifyAttachments(); } } break; } default: break; } } m_Updating = false; }
CSODistance::CSODistance() : BaseOp(0, 0) { ML_TRACE_IN("CSODistance::CSODistance(int numInImages, int numOutImages) : BaseOp(numInImages, numOutImages)"); handleNotificationOff(); _csoList0 = NULL; _csoList1 = NULL; _tableHeader = "Id1,Id2,min,max,mean,stdDev"; FieldContainer* fieldC = getFieldContainer(); ML_CHECK(fieldC); (_input0CSOFld = fieldC->addBase("inCSOList"))->setBaseValue(NULL); (_input1CSOFld = fieldC->addBase("inCSOList1"))->setBaseValue(NULL); ////////////////////////////////////////////////////////////////////////// char* distanceModes[LASTMODE]; distanceModes[ FIRST2 ] = "First 2 CSOs"; distanceModes[ INPLANE ] = "Match in plane"; distanceModes[ INDEX ] = "Match index"; _modeFld = fieldC->addEnum("mode",distanceModes,LASTMODE); _modeFld->setEnumValue( FIRST2 ); ////////////////////////////////////////////////////////////////////////// (_minimumDistanceFld = fieldC->addFloat("minimumDistance"))->setFloatValue(0); (_minimumDistancePoint1Fld = fieldC->addVec3f("minimumDistancePoint1"))->setVec3fValue(vec3(0.0,0.0,0.0)); (_minimumDistancePoint2Fld = fieldC->addVec3f("minimumDistancePoint2"))->setVec3fValue(vec3(0.0,0.0,0.0)); _distancesFld = addString("distances",_tableHeader ); _AverageMinimumDistanceFld = addDouble("averageMinimumDistance", 0.0 ); _AverageMeanDistanceFld = addDouble("averageMeanDistance", 0.0 ); _AverageMaxDistanceFld = addDouble("averageMaximumDistance", 0.0 ); ////////////////////////////////////////////////////////////////////////// _tolleranceFld = addDouble("tollerance", 0.0001 ); ////////////////////////////////////////////////////////////////////////// _applyFld = fieldC->addNotify("apply"); (_autoApplyFld = fieldC->addBool("autoApply"))->setBoolValue(true); _statusFld = fieldC->addString("status"); _statusFld->setStringValue("Ready"); ////////////////////////////////////////////////////////////////////////// (_listenToRepaintNotificationsFld = fieldC->addBool("listenToRepaintNotifications")) ->setBoolValue(false); (_listenToFinishingNotificationsFld = fieldC->addBool("listenToFinishingNotifications")) ->setBoolValue(true); (_listenToSelectionChangedNotificationsFld = fieldC->addBool("listenToSelectionChangedNotifications")) ->setBoolValue(false); char* statisticsNames[LASTSTATISTIC]; statisticsNames[ MIN ] = "Minimum"; statisticsNames[ MAX ] = "Maximum"; statisticsNames[ MEAN ] = "Mean"; statisticsNames[ STDEV ] = "StDev"; _curveStatistic = addEnum("curveStatistic",statisticsNames,LASTSTATISTIC ); _isInNotificationCB = false; ML_CHECK_NEW(_outputXMarkerList,XMarkerList()); (_outputXMarkerListFld = getFieldContainer()->addBase("outputXMarkerList"))->setBaseValue(NULL); _outputCurveList = new CurveList; (_outputCurveListFld = getFieldContainer()->addBase("outputCurveList"))->setBaseValue( _outputCurveList ); handleNotificationOn(); }
SavePRC::SavePRC (std::string type) : WEMInspector(type) { // Suppress calls of handleNotification on field changes to // avoid side effects during initialization phase. handleNotificationOff(); // Add input fields to the module and set allowed types. (_inPointPositionsFld = addBase("inPointPositions"))->setBaseValueAndAddAllowedType(&_inPointPositions); (_inLinePositionsFld = addBase("inLinePositions"))->setBaseValueAndAddAllowedType(&_inLinePositions); (_inLineConnectionsFld = addBase("inLineConnections"))->setBaseValueAndAddAllowedType(&_inLineConnections); // Add fields for selecting simple, straightforward mode (_simpleModePointSetFld = addBool("simpleModePointSet"))->setBoolValue(false); (_simpleModeLineSetFld = addBool("simpleModeLineSet"))->setBoolValue(false); (_simpleModeMeshFld = addBool("simpleModeMesh"))->setBoolValue(false); // Add fields to the module and set their values. (_modelPrefixPointCloudsFld = addString("modelPrefixPointClouds"))->setStringValue("PointSet"); (_modelPrefixLineSetsFld = addString("modelPrefixLineSets"))->setStringValue("LineSet"); (_modelPrefixMeshesFld = addString("modelPrefixMeshes"))->setStringValue("Mesh"); //(_modelPrefixGlyphsFld = addString("modelPrefixGlyphs"))->setStringValue("Glyph"); // Not supported by Acrobat (_pointCloudSpecificationFld = addString("pointCloudSpecification"))->setStringValue(""); (_lineSetSpecificationFld = addString("lineSetSpecification"))->setStringValue(""); (_meshSpecificationFld = addString("meshSpecification"))->setStringValue(""); //(_glyphSpecificationFld = addString("glyphSpecification"))->setStringValue(""); // Not supported by Acrobat //(_viewsSpecificationFld = addString("viewsSpecification"))->setStringValue(""); //(_lightsSpecificationFld = addString("lightsSpecification"))->setStringValue(""); //(_metaDataSpecificationFld = addString("metaDataSpecification"))->setStringValue(""); //(_defaultViewNameFld = addString("defaultViewName"))->setStringValue("DefaultView"); //(_defaultLightNameFld = addString("defaultLightName"))->setStringValue("DefaultAmbientLight"); //(_defaultMaterialDiffuseColorFld = addColor("defaultMaterialDiffuseColor"))->setVector3Value(Vector3(0.65f,0.65f,0.65f)); //(_defaultMaterialSpecularColorFld = addColor("defaultMaterialSpecularColor"))->setVector3Value(Vector3(0.75f,0.75f,0.75f)); //(_defaultMaterialAmbientColorFld = addColor("defaultMaterialAmbientColor"))->setVector3Value(Vector3(0.0f,0.0f,0.0f)); //(_defaultMaterialEmissiveColorFld = addColor("defaultMaterialEmissiveColor"))->setVector3Value(Vector3(0.0f,0.0f,0.0f)); //(_defaultMaterialTransparencyFld = addFloat("defaultMaterialTransparency"))->setFloatValue(0.0f); //(_defaultLightColorFld = addColor("defaultLightColor"))->setVector3Value(Vector3(1.0f,1.0f,1.0f)); //(_defaultLightIntensityFld = addDouble("defaultLightIntensity"))->setDoubleValue(1.0f); //(_defaultBoundingBoxMetaDataFld = addBool("defaultBoundingBoxMetaData"))->setBoolValue(true); //(_addDefaultViewNodeFld = addBool("addDefaultViewNode"))->setBoolValue(true); //(_addDefaultLightNodeFld = addBool("addDefaultLightNode"))->setBoolValue(true); (_mlFileNameFld = addString("filename"))->setStringValue(""); _mlSaveFld = addNotify("save"); (_statusFld = addString("status")) ->setStringValue("Idle."); (_progressFld = addProgress("progress"))->setFloatValue(0.0f); //------------------------------------------------------------------- //! Strings for enum field: specification type //------------------------------------------------------------------- const char* const NEW_SPECIFICATION_OBJECTTYPE_STRINGS[mlPDF::NUM_OBJECTTYPES] = { "OBJECTTYPE_POINTCLOUD", "OBJECTTYPE_LINESET", "OBJECTTYPE_MESH", "OBJECTTYPE_METADATA" }; //------------------------------------------------------------------- //! Strings for enum field: model visibility //------------------------------------------------------------------- const char* const NEW_SPECIFICATION_MODELVISIBILITY_STRINGS[mlPDF::NUM_MODELVISIBILITY] = { "MODELVISIBILITY_NOTVISIBLE", "MODELVISIBILITY_FRONTVISIBLE", "MODELVISIBILITY_BACKVISIBLE", "MODELVISIBILITY_FRONTANDBACKVISIBLE" }; //! Add fields for Specification Generator (_newSpecificationFld = addString("newSpecification"))->setStringValue(""); (_newSpecificationSelectedTabFld = addInt("selectedTab"))->setIntValue(0); (_newSpecificationOutputValidFld = addBool("newSpecificationOutputValid"))->setBoolValue(false); _newSpecificationAddFld = addNotify("newSpecificationAdd"); (_newSpecificationTypeFld = addEnum("newSpecificationType", NEW_SPECIFICATION_OBJECTTYPE_STRINGS, mlPDF::NUM_OBJECTTYPES))->setEnumValue(mlPDF::OBJECTTYPE_MESH); (_newSpecificationObjectNameFld = addString("newSpecificationObjectName"))->setStringValue(""); (_newSpecificationGroupPathFld = addString("newSpecificationGroupPath"))->setStringValue(""); (_newSpecificationUseDefaultColorFld = addBool("newSpecificationUseDefaultColor"))->setBoolValue(true); (_newSpecificationUseDefaultSpecularColorFld = addBool("newSpecificationUseDefaultSpecularColor"))->setBoolValue(true); (_newSpecificationColorFld = addColor("newSpecificationColor"))->setVector3Value(Vector3(0.651f,0.651f,0.651f)); (_newSpecificationColorAlphaFld = addFloat("newSpecificationColorAlpha"))->setFloatValue(1.0f); (_newSpecificationSpecularColorFld = addColor("newSpecificationSpecularColor"))->setVector3Value(Vector3(0.75f,0.75f,0.75f)); (_newSpecificationModelVisibilityFld = addEnum("newSpecificationModelVisibility", NEW_SPECIFICATION_MODELVISIBILITY_STRINGS, mlPDF::NUM_MODELVISIBILITY))->setEnumValue(mlPDF::MODELVISIBILITY_FRONTANDBACKVISIBLE); (_newSpecificationMetaDataKeyFld = addString("newSpecificationMetaDataKey"))->setStringValue(""); (_newSpecificationMetaDataValueFld = addString("newSpecificationMetaDataValue"))->setStringValue(""); (_newSpecificationWEMLabelFld = addString("newSpecificationWEMLabel"))->setStringValue(""); (_newSpecificationPositionTypesFld = addString("newSpecificationPositionTypes"))->setStringValue(""); (_newSpecificationConnectionTypesFld = addString("newSpecificationConnectionTypes"))->setStringValue(""); // Turn off the automatic saving on all notifications _listenToFinishingNotificationsFld ->setBoolValue(false); _listenToRepaintNotificationsFld ->setBoolValue(false); _listenToSelectionChangedNotificationsFld->setBoolValue(false); _autoUpdateFld->setBoolValue(false); _autoApplyFld->setBoolValue(false); // Reactivate calls of handleNotification on field changes. handleNotificationOn(); }