コード例 #1
0
void METKAutoFading::activateAttachments()
{
	getFieldContainer()->getField("inObjectContainer")->attachField(oReceiver->getFieldContainer()->getField("inObjectContainer"),true);
	getFieldContainer()->getField("inObjectContainer")->attachField(myObjMgr->getFieldContainer()->getField("inObjectContainer"),true);

	// Don't forget to call the super class functionality, it enables field
	// notifications for your module again.
	// SUPER_CLASS is the class you derive from (usually BaseOp).
	ObjMgrClient::activateAttachments();
}
コード例 #2
0
//----------------------------------------------------------------------------------
//! 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();
}
コード例 #3
0
//----------------------------------------------------------------------------------
//! 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();
}
コード例 #4
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();
}
コード例 #5
0
//----------------------------------------------------------------------------------
//! 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();
}
コード例 #6
0
//----------------------------------------------------------------------------------
//! 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();
}
コード例 #7
0
//----------------------------------------------------------------------------------
//! 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();
}
コード例 #8
0
//----------------------------------------------------------------------------------
//! 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();
}
コード例 #9
0
void
QFieldContainerView::setAspect(UInt32 uiAspect)
{
    // TODO: check if this can be done smarter

    _uiAspect = uiAspect;

    clearTable();

    fillTable(getFieldContainer(), _uiAspect);
}
コード例 #10
0
ファイル: OSGQFieldView_qt.cpp プロジェクト: mlimper/OpenSG1x
void
QMFieldView::mouseDoubleClickEvent(QMouseEvent *pEvent)
{
    bool   bValid  = false;
    UInt32 uiIndex = pointToIndex(pEvent->pos(), bValid);

    if(bValid && (uiIndex < getFieldPtr()->getSize()))
    {
        emit doubleClicked(getFieldContainer(), getFieldId(), 
                           uiIndex,             pEvent->button());
    }
}
コード例 #11
0
//----------------------------------------------------------------------------------
//! 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);
}
コード例 #12
0
//----------------------------------------------------------------------------------
//! 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();
}
コード例 #13
0
ファイル: OSGQFieldView_qt.cpp プロジェクト: mlimper/OpenSG1x
void
QSFieldView::setFieldContainer(FieldContainerPtr pFC)
{
    if(pFC == getFieldContainer())
        return;

    endEdit();

    delete _pLabel;
    delete _pEditor;

    Inherited::setFieldContainer(pFC);

    initSelf();
}
コード例 #14
0
//----------------------------------------------------------------------------------
//! 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();
}
コード例 #15
0
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();
}
コード例 #16
0
ファイル: OSGQFieldView_qt.cpp プロジェクト: mlimper/OpenSG1x
void
QMFieldView::setFieldContainer(FieldContainerPtr pFC)
{
    if(pFC == getFieldContainer())
        return;

    endEdit();

    deleteAllLabels();
    delete _pEditor;

    Inherited::setFieldContainer(pFC);

    initSelf     ();
    initScrollbar();

    _bContentsChanged = true;
}
コード例 #17
0
//! 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;
}
コード例 #18
0
//----------------------------------------------------------------------------------
//! 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();
}
コード例 #19
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();
}
コード例 #20
0
//----------------------------------------------------------------------------------
//! 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();
}
コード例 #21
0
//----------------------------------------------------------------------------------
//! 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.
}
コード例 #22
0
  //-------------------------------------------------------------------
  // Constructor.
  //-------------------------------------------------------------------
  WorldInfo::WorldInfo(): BaseOp(1,0)
  {
    ML_TRACE_IN("WorldInfo::WorldInfo()")

    // Initialize all field pointer to NULL to avoid that
    // on creation handling of fields cause checks of invalid field pointers.
    _sizeXFld        = NULL;
    _sizeYFld        = NULL;
    _sizeZFld        = NULL;
    _sizeCFld        = NULL;
    _sizeTFld        = NULL;
    _sizeUFld        = NULL;
    _sizeFld         = NULL;

    _psizeXFld       = NULL;
    _psizeYFld       = NULL;
    _psizeZFld       = NULL;
    _psizeCFld       = NULL;
    _psizeTFld       = NULL;
    _psizeUFld       = NULL;
    _psizeFld        = NULL;
    
    _minFld          = NULL;
    _maxFld          = NULL;
    _dTypeFld        = NULL;
    _pImgInfoFld     = NULL;

    _matFld          = NULL;

    _x0Fld           = NULL;
    _y0Fld           = NULL;
    _z0Fld           = NULL;
    _a0Fld           = NULL;

    _x1Fld           = NULL;
    _y1Fld           = NULL;
    _z1Fld           = NULL;
    _a1Fld           = NULL;

    _x2Fld           = NULL;
    _y2Fld           = NULL;
    _z2Fld           = NULL;
    _a2Fld           = NULL;

    _x3Fld           = NULL;
    _y3Fld           = NULL;
    _z3Fld           = NULL;
    _a3Fld           = NULL;

    _voxelSizeFld   = NULL;
    
    _originXFld     = NULL;
    _originYFld     = NULL;
    _originZFld     = NULL;
    _originFld      = NULL;

    _extentXFld     = NULL;
    _extentYFld     = NULL;
    _extentZFld     = NULL;
    _extentFld      = NULL;

    _wSizeXFld      = NULL;
    _wSizeYFld      = NULL;
    _wSizeZFld      = NULL;
    _wSizeFld       = NULL;

    _centerXFld     = NULL;
    _centerYFld     = NULL;
    _centerZFld     = NULL;
    _centerFld      = NULL;
    
    _boxFld         = NULL;
    _alignToAxisFld  = NULL;

    ///TB 16.8.2001
    // Fields for C/T/U-Dim infos
    _cDimInfoFld     = NULL;
    _tDimInfoFld     = NULL;
    _uDimInfoFld     = NULL;

    ///TB 15.11.2001: Added table for time points info
    _tDimTableFld    = NULL;

    _updateFld       = NULL;
    _memImgFld       = NULL;
    _memImg2Fld      = NULL;
    _bypassIndexFld  = NULL;
    _inPlaceIndexFld = NULL;
    _opNameFld       = NULL;
    _inConnFld       = NULL;
    _inputValidFld   = NULL;

    (_sizeXFld       = getFieldContainer()->addInt("sizeX"))         ->setIntValue(0);
    (_sizeYFld       = getFieldContainer()->addInt("sizeY"))         ->setIntValue(0);
    (_sizeZFld       = getFieldContainer()->addInt("sizeZ"))         ->setIntValue(0);
    (_sizeCFld       = getFieldContainer()->addInt("sizeC"))         ->setIntValue(0);
    (_sizeTFld       = getFieldContainer()->addInt("sizeT"))         ->setIntValue(0);
    (_sizeUFld       = getFieldContainer()->addInt("sizeU"))         ->setIntValue(0);
    (_sizeFld        = getFieldContainer()->addVector("size"))       ->setStringValue("0 0 0 0 0 0");

    (_psizeXFld      = getFieldContainer()->addInt("pageSizeX"))     ->setIntValue(0);
    (_psizeYFld      = getFieldContainer()->addInt("pageSizeY"))     ->setIntValue(0);
    (_psizeZFld      = getFieldContainer()->addInt("pageSizeZ"))     ->setIntValue(0);
    (_psizeCFld      = getFieldContainer()->addInt("pageSizeC"))     ->setIntValue(0);
    (_psizeTFld      = getFieldContainer()->addInt("pageSizeT"))     ->setIntValue(0);
    (_psizeUFld      = getFieldContainer()->addInt("pageSizeU"))     ->setIntValue(0);
    (_psizeFld       = getFieldContainer()->addVector("pageSize"))   ->setStringValue("0 0 0 0 0 0");

    (_minFld         = getFieldContainer()->addDouble("minValue"))   ->setDoubleValue(0);
    (_maxFld         = getFieldContainer()->addDouble("maxValue"))   ->setDoubleValue(0);

    (_vXFld          = getFieldContainer()->addDouble("voxelSizeX")) ->setDoubleValue(0);
    (_vYFld          = getFieldContainer()->addDouble("voxelSizeY")) ->setDoubleValue(0);
    (_vZFld          = getFieldContainer()->addDouble("voxelSizeZ")) ->setDoubleValue(0);
    (_voxelSizeFld   = getFieldContainer()->addVec3f ("voxelSize"))  ->setStringValue("0 0 0");
    (_VoxelVolFld    = getFieldContainer()->addDouble("voxelVolume"))->setDoubleValue(0);

    //_vVolFld will contain the volume of a voxel in ml (not micro liter!)
    (_TotalVolFld    = getFieldContainer()->addDouble("totalVolume"))->setDoubleValue(0);
    (_MegaVoxelFld   = getFieldContainer()->addDouble("megaVoxels")) ->setDoubleValue(0);

    (_dTypeFld       = getFieldContainer()->addString("dataType"))   ->setStringValue("Unknown");
    (_pImgInfoFld    = getFieldContainer()->addString("pagedImgInfo"))->setStringValue("No Connection");

    (_typeInfoFld    = getFieldContainer()->addString("typeInfo"))   ->setStringValue("No Info");

#ifdef _ML_SHOW_EXTENDED_IMAGE_PROPERTIES
    (_imgPropExtFld  = getFieldContainer()->addString("imgPropExt"))->setStringValue("");
#endif

    mat4 m;
    (_matFld         = getFieldContainer()->addMatrix("worldMatrix"))->setMatrixValue(m);

    (_x0Fld          = getFieldContainer()->addDouble("a00"))        ->setDoubleValue(0);
    (_y0Fld          = getFieldContainer()->addDouble("a01"))        ->setDoubleValue(0);
    (_z0Fld          = getFieldContainer()->addDouble("a02"))        ->setDoubleValue(0);
    (_a0Fld          = getFieldContainer()->addDouble("a03"))        ->setDoubleValue(0);

    (_x1Fld          = getFieldContainer()->addDouble("a10"))        ->setDoubleValue(0);
    (_y1Fld          = getFieldContainer()->addDouble("a11"))        ->setDoubleValue(0);
    (_z1Fld          = getFieldContainer()->addDouble("a12"))        ->setDoubleValue(0);
    (_a1Fld          = getFieldContainer()->addDouble("a13"))        ->setDoubleValue(0);

    (_x2Fld          = getFieldContainer()->addDouble("a20"))        ->setDoubleValue(0);
    (_y2Fld          = getFieldContainer()->addDouble("a21"))        ->setDoubleValue(0);
    (_z2Fld          = getFieldContainer()->addDouble("a22"))        ->setDoubleValue(0);
    (_a2Fld          = getFieldContainer()->addDouble("a23"))        ->setDoubleValue(0);

    (_x3Fld          = getFieldContainer()->addDouble("a30"))        ->setDoubleValue(0);
    (_y3Fld          = getFieldContainer()->addDouble("a31"))        ->setDoubleValue(0);
    (_z3Fld          = getFieldContainer()->addDouble("a32"))        ->setDoubleValue(0);
    (_a3Fld          = getFieldContainer()->addDouble("a33"))        ->setDoubleValue(0);

    (_originXFld     = getFieldContainer()->addDouble("originX"))->setDoubleValue(0.0);
    (_originYFld     = getFieldContainer()->addDouble("originY"))->setDoubleValue(0.0);
    (_originZFld     = getFieldContainer()->addDouble("originZ"))->setDoubleValue(0.0);
    (_originFld      = getFieldContainer()->addVec3f ("origin" ))->setStringValue("0 0 0");

    (_extentXFld     = getFieldContainer()->addDouble("extentX"))->setDoubleValue(0.0);
    (_extentYFld     = getFieldContainer()->addDouble("extentY"))->setDoubleValue(0.0);
    (_extentZFld     = getFieldContainer()->addDouble("extentZ"))->setDoubleValue(0.0);
    (_extentFld      = getFieldContainer()->addVec3f ("extent" ))->setStringValue("0 0 0");

    (_wSizeXFld      = getFieldContainer()->addDouble("worldSizeX"))->setDoubleValue(0.0);
    (_wSizeYFld      = getFieldContainer()->addDouble("worldSizeY"))->setDoubleValue(0.0);
    (_wSizeZFld      = getFieldContainer()->addDouble("worldSizeZ"))->setDoubleValue(0.0);
    (_wSizeFld       = getFieldContainer()->addVec3f ("worldSize" ))->setStringValue("0 0 0");

    (_centerXFld     = getFieldContainer()->addDouble("centerX"))->setDoubleValue(0.0);
    (_centerYFld     = getFieldContainer()->addDouble("centerY"))->setDoubleValue(0.0);
    (_centerZFld     = getFieldContainer()->addDouble("centerZ"))->setDoubleValue(0.0);
    (_centerFld      = getFieldContainer()->addVec3f ("center" ))->setStringValue("0 0 0");

    (_boxFld         = getFieldContainer()->addSubImgBoxf("box")) ->setSubImgBoxfValue( SubImgBoxf() );
    (_alignToAxisFld = getFieldContainer()->addBool("alignToAxis"))->setBoolValue( true );
    (_useVoxelCenterFld = getFieldContainer()->addBool( "useVoxelCenter" ))->setBoolValue( false );
    (_includeAllVoxelsFld  = getFieldContainer()->addBool( "includeAllVoxels"))->setBoolValue( false );


    (_rotationFld    = (RotationField *) getFieldContainer()->addField ("rotation", "Rotation", ""))->setRotationValue( Rotation() );

    ///TB 16.8.2001
    // Fields for C/T/U-Dim infos
    (_cDimInfoFld    = getFieldContainer()->addString("cDimInfo"))    ->setStringValue("");
    (_tDimInfoFld    = getFieldContainer()->addString("tDimInfo"))    ->setStringValue("");
    (_uDimInfoFld    = getFieldContainer()->addString("uDimInfo"))    ->setStringValue("");

    ///TB 15.11.2001: Added table for time points info
    (_tDimTableFld   = getFieldContainer()->addString("tDimTable"))  ->setStringValue("");

    (_updateFld      = getFieldContainer()->addNotify("update"));
    (_memImgFld      = getFieldContainer()->addString("memoryImage"))   ->setStringValue("");
    (_memImg2Fld     = getFieldContainer()->addString("memoryImage2"))  ->setStringValue("");
    (_bypassIndexFld = getFieldContainer()->addInt   ("bypassIndex"))   ->setIntValue(-1);
    (_inPlaceIndexFld= getFieldContainer()->addInt   ("inPlaceIndex"))  ->setIntValue(-1);
    (_opNameFld      = getFieldContainer()->addString("moduleName"))    ->setStringValue("");
    (_inConnFld      = getFieldContainer()->addBool("connectionValid")) ->setBoolValue(false);
    (_inputValidFld  = getFieldContainer()->addBool("dataValid"))       ->setBoolValue(false);


    // Activate maximum support of all input voxel data types.
    setVoxelDataTypeSupport(BaseOp::MINIMUM_OPERATIONAL);
  }
コード例 #23
0
//----------------------------------------------------------------------------------
//! Handle field changes of the field \c field.
//----------------------------------------------------------------------------------
void METKAutoFading::handleNotification (Field *field)
{
	ML_TRACE_IN("METKAutoFading::handleNotification()")
	inherited::handleNotification(field);

	// ... field notification handling code
	if (field == getFieldContainer()->getField("inObjectContainer"))
	{
		if (getFieldContainer()->getField("inObjectContainer")->getDestinationField (0) == NULL)
		{
			//Verbinden aller inObjectContainer innerhalb des Moduls!!!
			//Diese Zeile hat mich fast 2 Tage und sehr viele Nerven gekostet ;-) (aus METKObjContainer geklaut)			
			getFieldContainer()->getField("inObjectContainer")->attachField(myObjMgr->getFieldContainer()->getField("inObjectContainer"),1);
			getFieldContainer()->getField("inObjectContainer")->attachField(oReceiver->getFieldContainer()->getField("inObjectContainer"),1);
		}	
	}
	
	else if (field == _init)
	{
		string sPath;
		if (!myObjMgr->getObjAttributeString(O_CASEOBJECT, LAY_CASEOBJECT_CASE, INF_CASEOBJECT_CASE_DIRECTORY, sPath))
		{
			std::cout << "FEHLER: Keine Falldaten vorhanden!" << std::endl;
		}
		else
		{
			_dataPath->setStringValue(sPath);
		}		
	}

	else if (field == _dataPath)
	{
		if (_dataPath->getStringValue() != "")
		{
			float fX,fY,fZ,fR;
			int iDiv;
			m_calcVis.setData(_dataPath->getStringValue());
			//m_calcVis.logResults();
			if (m_calcVis.hasData())
			{
				m_calcVis.getSphereValues(fX,fY,fZ,fR,iDiv);
				m_soViewer->createSphere(fX,fY,fZ,fR,iDiv);
				m_soViewer->setSphereMode(2);
				m_calcVis.setStackSize(10);
			}
		}
	}

	
	else if (field == _ViewerName)
	{
//		setAcceptedEvents();
	}
	
	else if (field == _EnableFading)
	{
//		setAcceptedEvents();

		if (_EnableFading->getBoolValue())
		{			
			myObjMgr->setObjAttribute(_ViewerName->getStringValue(), LAY_VIEWER_PROPERTIES, INF_VIEWER_PROPERTIES_PROTOCOLVIEWERSTATUS, new bool(true), omINFOTYPE_BOOL, true, false);
		}
		else
		{
			myObjMgr->setObjAttribute(_ViewerName->getStringValue(), LAY_VIEWER_PROPERTIES, INF_VIEWER_PROPERTIES_PROTOCOLVIEWERSTATUS, new bool(false), omINFOTYPE_BOOL, true, false);
		}		
		sendNotification();
	}

	else if (field == _calc)
	{
		calcNewPosition();
		m_soViewer->setDataField(m_calcVis.getStackField(1));
		m_soViewer->touch();

		timerSensor->schedule();
	}

	else if (field == _camOrientation)
	{
		if (_EnableFading->getBoolValue())
		{
			_calc->notify();
		}
	}

	else if (field == _messageData)
	{
		std::cout << "fading field == _messageData=" << _messageData->getStringValue() << std::endl;

		vector<string> VecSplit;
		kBasics::split(_messageData->getStringValue(),' ',2,&VecSplit);
		if (VecSplit.size() < 2) 
		{
			cout<<"FEHLER: MessageString Format für Fading falsch!"<<endl;
			timerSensor->schedule();
		}
		else
		{
			_EnableFading->setBoolValue(kBasics::toUp(VecSplit[1])=="TRUE");
			_UseMETKValues->setBoolValue(kBasics::toUp(VecSplit[1])=="TRUE");

			if (VecSplit[0]!="NONE")
			{
				_CurrentObject->setStringValue(VecSplit[0]);
				_calc->notify();
			}
			else
			{
				_CurrentObject->setStringValue("");
//				std::cout << "6" << std::endl;
				resetAllCurrentOccluders();
//				std::cout << "7" << std::endl;
				timerSensor->schedule();
			}
		}
	}
}
コード例 #24
0
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();
}
コード例 #25
0
ファイル: OSGQFieldView_qt.cpp プロジェクト: mlimper/OpenSG1x
void
QSFieldView::mouseDoubleClickEvent(QMouseEvent *pEvent)
{
    emit doubleClicked(getFieldContainer(), getFieldId(), 0, pEvent->button());
}
コード例 #26
0
ファイル: OSGQFieldView_qt.cpp プロジェクト: mlimper/OpenSG1x
void
QSFieldView::mousePressEvent(QMouseEvent *pEvent)
{
    emit clicked(getFieldContainer(), getFieldId(), 0, pEvent->button());
}
コード例 #27
0
void setupAnimation(void)
{
    //Color Keyframe Sequence
    ColorKeyframes = KeyframeColorsSequence3f::create();
    ColorKeyframes->addKeyframe(Color4f(1.0f,0.0f,0.0f,1.0f),0.0f);
    ColorKeyframes->addKeyframe(Color4f(0.0f,1.0f,0.0f,1.0f),2.0f);
    ColorKeyframes->addKeyframe(Color4f(0.0f,0.0f,1.0f,1.0f),4.0f);
    ColorKeyframes->addKeyframe(Color4f(1.0f,0.0f,0.0f,1.0f),6.0f);

	//Vector Keyframe Sequence
    VectorKeyframes = KeyframeVectorsSequence3f::create();
    VectorKeyframes->addKeyframe(Vec3f(0.0f,0.0f,0.0f),0.0f);
    VectorKeyframes->addKeyframe(Vec3f(0.0f,1.0f,0.0f),1.0f);
    VectorKeyframes->addKeyframe(Vec3f(1.0f,1.0f,0.0f),2.0f);
    VectorKeyframes->addKeyframe(Vec3f(1.0f,0.0f,0.0f),3.0f);
    VectorKeyframes->addKeyframe(Vec3f(0.0f,0.0f,0.0f),4.0f);
    
	//Rotation Keyframe Sequence
    RotationKeyframes = KeyframeRotationsSequenceQuat::create();
    RotationKeyframes->addKeyframe(Quaternion(Vec3f(0.0f,1.0f,0.0f), 3.14159f*0.0),0.0f);
    RotationKeyframes->addKeyframe(Quaternion(Vec3f(0.0f,1.0f,0.0f), 3.14159f*0.5),1.0f);
    RotationKeyframes->addKeyframe(Quaternion(Vec3f(0.0f,1.0f,0.0f), 3.14159f*1.0),2.0f);
    RotationKeyframes->addKeyframe(Quaternion(Vec3f(0.0f,1.0f,0.0f), 3.14159f*1.5),3.0f);
    RotationKeyframes->addKeyframe(Quaternion(Vec3f(0.0f,1.0f,0.0f), 3.14159f*0.0),4.0f);

	//Transformation Keyframe Sequence
    TransformationKeyframes = KeyframeTransformationsSequence44f::create();
	Matrix TempMat;
	TempMat.setTransform(Vec3f(0.0f,0.0f,0.0f), Quaternion(Vec3f(0.0f,1.0f,0.0f), 3.14159f*0.0));
    TransformationKeyframes->addKeyframe(TempMat,1.0f);
	TempMat.setTransform(Vec3f(0.0f,1.0f,0.0f), Quaternion(Vec3f(0.0f,1.0f,0.0f), 3.14159f*0.5));
    TransformationKeyframes->addKeyframe(TempMat,2.0f);
	TempMat.setTransform(Vec3f(1.0f,1.0f,0.0f), Quaternion(Vec3f(0.0f,1.0f,0.0f), 3.14159f*1.0));
    TransformationKeyframes->addKeyframe(TempMat,3.0f);
	TempMat.setTransform(Vec3f(1.0f,0.0f,0.0f), Quaternion(Vec3f(0.0f,1.0f,0.0f), 3.14159f*1.5));
    TransformationKeyframes->addKeyframe(TempMat,4.0f);
	TempMat.setTransform(Vec3f(0.0f,0.0f,0.0f), Quaternion(Vec3f(0.0f,1.0f,0.0f), 3.14159f*0.0));
    TransformationKeyframes->addKeyframe(TempMat,5.0f);
    
    //Animator
    TheAnimator = KeyframeAnimator::create();
    beginEditCP(TheAnimator, KeyframeAnimator::KeyframeSequenceFieldMask);
        TheAnimator->setKeyframeSequence(TransformationKeyframes);
    endEditCP(TheAnimator, KeyframeAnimator::KeyframeSequenceFieldMask);
    
    //Animation
    TheAnimation = FieldAnimation::create();
    beginEditCP(TheAnimation);
        TheAnimation->setAnimator(TheAnimator);
        TheAnimation->setInterpolationType(LINEAR_INTERPOLATION);
        TheAnimation->setCycling(-1);
    endEditCP(TheAnimation);
	TheAnimation->setAnimatedField(getFieldContainer("Transform",std::string("TorusNodeTransformationCore")), std::string("matrix"));

    //Animation Listener
    TheAnimation->addAnimationListener(&TheAnimationListener);

    //Animation Advancer
    TheAnimationAdvancer = ElapsedTimeAnimationAdvancer::create();
    beginEditCP(TheAnimationAdvancer);
    ElapsedTimeAnimationAdvancer::Ptr::dcast(TheAnimationAdvancer)->setStartTime( 0.0 );
    beginEditCP(TheAnimationAdvancer);
}
コード例 #28
0
FieldContainer *getFieldContainer(const std::string &szTypeName, 
                                  const std::string &szName)
{
    return getFieldContainer(
        FieldContainerFactory::the()->findType(szTypeName.c_str()), szName);
}
コード例 #29
0
FieldContainerUnrecPtr getFieldContainer(const std::string &szTypeName, const std::string &namestring)
{
   return getFieldContainer(FieldContainerFactory::the()->findType(szTypeName.c_str()), namestring);
}