当前位置: 首页>>代码示例>>C++>>正文


C++ SO_ENGINE_OUTPUT函数代码示例

本文整理汇总了C++中SO_ENGINE_OUTPUT函数的典型用法代码示例。如果您正苦于以下问题:C++ SO_ENGINE_OUTPUT函数的具体用法?C++ SO_ENGINE_OUTPUT怎么用?C++ SO_ENGINE_OUTPUT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SO_ENGINE_OUTPUT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SO_ENGINE_OUTPUT

void SoConditionalTrigger::evaluate()
{
    /*boolIn.getValues(0);
    floatIn.getValues(0);
    intIn.getValues(0);
    timeIn.getValues(0);
    stringIn.getValues(0);*/

	SO_ENGINE_OUTPUT(boolOut, SoSFBool, setValue(tempBool));

	//SoDebugError::postInfo("SoConditionalTrigger::evaluate()",
	//		"%s: boolOut: %i",
	//		this->getName().getString(),tempBool);

    if (trigger.isEnabled()) {
        //printf("About to output ... %d\n", tmp);
        SO_ENGINE_OUTPUT(tokenOut, SoSFString, setValue(token.getValue()));
	    SO_ENGINE_OUTPUT(trigger, SoSFTrigger, setValue());

        if (forwardInput.getValue())
        {
            SO_ENGINE_OUTPUT(intValueOut, SoSFInt32, setValue(intIn[0]));
        }
		//SoDebugError::postInfo("SoConditionalTrigger::evaluate()",
		//		"%s: Token: %s, trigger fired!",
		//		this->getName().getString(),token.getValue().getString());
    }

    trigger.enable(FALSE);
    tokenOut.enable(FALSE);
}
开发者ID:astanin,项目名称:mirror-studierstube,代码行数:31,代码来源:SoConditionalTrigger.cpp

示例2: SO_ENGINE_OUTPUT

void SoNodeToName::evaluate()
{   
    // make room as necessary
    SO_ENGINE_OUTPUT(output, SoMFString, setNum(input.getNum()));
    int next = 0;
    for( int i = 0; i < input.getNum(); i++ )
    {
        SoNode * node = input[i];
        if( node == NULL || node->getName() == "" )
        {
            if(  compact.getValue() == FALSE )
            {
                SO_ENGINE_OUTPUT(output, SoMFString, set1Value(next, ""));
                next++;
            }
        }
        else
        {
            SO_ENGINE_OUTPUT(output, SoMFString, set1Value(next, node->getName().getString()));
            next++;
        }        
    }
    // truncate as necessary
    SO_ENGINE_OUTPUT(output, SoMFString, setNum(next));
}
开发者ID:astanin,项目名称:mirror-studierstube,代码行数:25,代码来源:SoNodeToName.cpp

示例3: PRIVATE

void
SoVRMLCoordinateInterpolator::evaluate(void)
{
  if (!this->value_changed.isEnabled()) return;

  float interp;
  int i, idx = this->getKeyValueIndex(interp, this->keyValue.getNum());
  if (idx < 0) return;

  PRIVATE(this)->tmplist.truncate(0);
  const int numkeys = this->key.getNum();
  const int numcoords = this->keyValue.getNum() / numkeys;

  const SbVec3f * c0 = this->keyValue.getValues(idx*numcoords);
  const SbVec3f * c1 = c0;
  if (interp > 0.0f) c1 = this->keyValue.getValues((idx+1)*numcoords);

  for (i = 0; i < numcoords; i++) {
    PRIVATE(this)->tmplist.append(c0[i] + (c1[i]-c0[i]) * interp);
  }

  const SbVec3f * coords = PRIVATE(this)->tmplist.getArrayPtr();

  SO_ENGINE_OUTPUT(value_changed, SoMFVec3f, setNum(numcoords));
  SO_ENGINE_OUTPUT(value_changed, SoMFVec3f, setValues(0, numcoords, coords));
}
开发者ID:Alexpux,项目名称:Coin3D,代码行数:26,代码来源:CoordinateInterpolator.cpp

示例4: appendContour

void
SoXipOverlayExtractContour::evaluate()
{
	SoMFVec3f pointTmp;
	SoMFInt32 coordIndexTmp;

	for( int i = 0; i < overlays.getNum(); ++ i )
	{
		SoXipShapeList* shapeList = (SoXipShapeList *) overlays[i];
		if( !shapeList )
		{
			SoDebugError::post( __FILE__, "Warning. Should not have NULL pointer in list of overlays" );
			continue ;
		}

		int numShapes = shapeList->getNumChildren();
		for( int j = 0; j < numShapes; ++ j )
		{
			SoXipManipulableShape* shape = (SoXipManipulableShape *) shapeList->getChild(j);
			if( !shape )
			{
				SoDebugError::post( __FILE__, "Warning. Should not have NULL pointer in list of overlays" );
				continue ;
			}

			appendContour( shape, pointTmp, coordIndexTmp );
		}
	}

	SO_ENGINE_OUTPUT( point, SoMFVec3f, copyFrom( pointTmp ) );
	SO_ENGINE_OUTPUT( coordIndex, SoMFInt32, copyFrom( coordIndexTmp ) );
}
开发者ID:OpenXIP,项目名称:xip-libraries,代码行数:32,代码来源:SoXipOverlayExtractContour.cpp

示例5: SO_ENGINE_OUTPUT

void SoMap2ImagePt::updateOutput()
{
	if (refInput.getNum() <= 0 ||coordinates.getNum() <= 0)
		return;

	SoMFInt32 _points;
	SbString _sopInstanceUID;

	for (int i = 0; i < coordinates.getNum(); i++){
		SbVec3f point = coordinates[i];

		int pt[2];
		SbString uid;
		if (getMappingPoint(pt, uid, point) && point != SbVec3f(0, 0, 0)){
			_points.set1Value(_points.getNum(), pt[0]);
			_points.set1Value(_points.getNum(), pt[1]);
			_sopInstanceUID = uid;
		}
	}

//	if (_points.getNum() > 0)
	{
		SO_ENGINE_OUTPUT( points, SoMFInt32, setValues(0, _points.getNum(), _points.getValues(0)) );	
		SO_ENGINE_OUTPUT( sopInstanceUID, SoSFString, setValue(_sopInstanceUID) );	
	}
}
开发者ID:OpenXIP,项目名称:avt-util,代码行数:26,代码来源:SoMap2ImagePt.cpp

示例6: SbXipImage

void SoXipDicomExtractSlice::evaluate()
{
	if (mOutput)
	{
		mOutput->unref();
		mOutput = 0;
	}

	int nSlices = 0;

	if (image.getValue())
	{
		nSlices = image.getValue()->getNumSlices();

		if ((sliceIndex.getValue() < nSlices) && (sliceIndex.getValue() >= 0))
		{
			// convert dicom data to xip image
			SbXipImage *img = new SbXipImage();
			if (!img)
			{
				SoMemoryError::post("SbXipImage");
			}
			else if (image.getValue()->getPixelData(*img, sliceIndex.getValue()))
			{
				// create instance of SoXipDataImage
				mOutput = new SoXipDataImage();
				mOutput->ref();
				mOutput->set(img);
			}
		}
	}

	SO_ENGINE_OUTPUT(numSlices, SoSFShort, setValue(nSlices));
	SO_ENGINE_OUTPUT(output, SoXipSFDataImage, setValue(mOutput));	
}
开发者ID:OpenXIP,项目名称:xip-libraries,代码行数:35,代码来源:SoXipDicomExtractSlice.cpp

示例7: SO_ENGINE_OUTPUT

void TTracker::SetEngineOutputRotation(SbRotation rotation)
{
	SO_ENGINE_OUTPUT( outputTranslation, SoSFVec3f, setValue( SbVec3f( 0.0, 0.0, 0.0 ) ) );
	SO_ENGINE_OUTPUT( outputRotation, SoSFRotation, setValue( rotation ) );
	SO_ENGINE_OUTPUT( outputScaleFactor, SoSFVec3f, setValue( SbVec3f( 1.0, 1.0, 1.0 ) ) );
	SO_ENGINE_OUTPUT( outputScaleOrientation, SoSFRotation, setValue( SbRotation() ) );
	SO_ENGINE_OUTPUT( outputCenter, SoSFVec3f, setValue( SbVec3f( 0.0, 0.0, 0.0 ) ) );
}
开发者ID:pierre-haessig,项目名称:tonatiuh,代码行数:8,代码来源:TTracker.cpp

示例8: SO_ENGINE_OUTPUT

// Doc in parent
void
SoVRMLTimeSensor::evaluate(void)
{
  SO_ENGINE_OUTPUT(time, SoSFTime, setValue(PRIVATE(this)->currtime));
  SO_ENGINE_OUTPUT(isActive, SoSFBool, setValue(PRIVATE(this)->running));
  SO_ENGINE_OUTPUT(cycleTime, SoSFTime, setValue(PRIVATE(this)->cyclestart));
  SO_ENGINE_OUTPUT(fraction_changed, SoSFFloat, setValue(PRIVATE(this)->fraction));
}
开发者ID:Alexpux,项目名称:Coin3D,代码行数:9,代码来源:TimeSensor.cpp

示例9: reset

void SoVtkGridTransform::evaluate()
{
	try
	{
		// Get the input type(s)
		// Deletion of the objects if they exist
		if ( mDisplacementGrid )
		{
		
			mDisplacementGrid->unref();
			mDisplacementGrid = 0;
		}
		
		if ( mInverse )
		{
		
			mInverse->unref();
			mInverse = 0;
		}
		
		if ( mOutput )
		{
		
			mOutput->unref();
			mOutput = 0;
		}
		
		if ( addCalled )
		{
			reset();
			addCalled = 0;
		}

		mObject->GetDisplacementGrid();
		mDisplacementGrid = new SoVtkObject();
		mDisplacementGrid->ref();
		mDisplacementGrid->setPointer( mObject->GetDisplacementGrid() );

		mObject->GetInverse();
		mInverse = new SoVtkObject();
		mInverse->ref();
		mInverse->setPointer( mObject->GetInverse() );

		mOutput = new SoVtkObject();
		mOutput->ref();
		mOutput->setPointer( mObject );

	}
	catch(...)
	{
		SoDebugError::post( __FILE__, "Unknown Exception" );
		return;
	}
	SO_ENGINE_OUTPUT( oDisplacementGrid, SoSFVtkObject, setValue( mDisplacementGrid ) );
	SO_ENGINE_OUTPUT( oInverse, SoSFVtkObject, setValue( mInverse ) );
	SO_ENGINE_OUTPUT( Output, SoSFVtkObject, setValue( mOutput ) );
}
开发者ID:OpenXIP,项目名称:xip-libraries,代码行数:57,代码来源:SoVtkGridTransform.cpp

示例10: reset

void SoVtkImageDataGeometryFilter::evaluate()
{
	try
	{
		// Get the input type(s)
		SoVtkAlgorithmOutput *inputPortPtr = InputConnection.getValue();
		
		if (inputPortPtr)
			mObject->SetInputConnection(inputPortPtr->getPointer());

		// Deletion of the objects if they exist
		if ( mOutput )
		{
		
			mOutput->unref();
			mOutput = 0;
		}
		
		if ( mOutputPort )
		{
		
			mOutputPort->unref();
			mOutputPort = 0;
		}
		
		if ( addCalled )
		{
			reset();
			addCalled = 0;
		}

		mObject->GetOutput()->Register(0);
		mOutput = new SoVtkObject();
		mOutput->ref();
		mOutput->setPointer( mObject->GetOutput() );

		if ( mObject->GetNumberOfOutputPorts() > 0 )
		{
			mObject->GetOutputPort()->Register(0);
			mOutputPort = new SoVtkAlgorithmOutput();
			mOutputPort->ref();
			mOutputPort->setPointer( mObject->GetOutputPort() );
		}

	}
	catch(...)
	{
		SoDebugError::post( __FILE__, "Unknown Exception" );
		return;
	}
	SO_ENGINE_OUTPUT( Output, SoSFVtkObject, setValue( mOutput ) );
	SO_ENGINE_OUTPUT( OutputPort, SoSFVtkAlgorithmOutput, setValue( mOutputPort ) );
}
开发者ID:OpenXIP,项目名称:xip-libraries,代码行数:53,代码来源:SoVtkImageDataGeometryFilter.cpp

示例11: SO_ENGINE_OUTPUT

void
SoItkConvertItkImageToXipImage::evaluate()
{
	if( mXipImage )
	{
		mXipImage->unref();
		mXipImage = 0;
		SO_ENGINE_OUTPUT( output, SoXipSFDataImage, setValue(0) );
	}

	SoItkDataImage* xipItkImage = input.getValue();

	if (!xipItkImage)
	    return;

	if (xipItkImage->getType() != SoItkDataImage::UNSIGNED_SHORT &&
	    xipItkImage->getType() != SoItkDataImage::FLOAT &&
	    xipItkImage->getType() != SoItkDataImage::UNSIGNED_CHAR &&
	    xipItkImage->getType() != SoItkDataImage::SHORT)
	{
	    SoDebugError::post( __FILE__, "Itk image only supports UNSIGNED_SHORT, UNSIGNED_CHAR, SHORT or FLOAT" );
	    return ;
	}

	try
	{
            switch (xipItkImage->getNumDimension())
            {
	    case 1:
		mXipImage = createXipImage<1>(xipItkImage);
		break;
	    case 2:
		mXipImage = createXipImage<2>(xipItkImage);
		break;
	    case 3:
		mXipImage = createXipImage<3>(xipItkImage);
		break;
	    }
	}
	catch( itk::ExceptionObject& e )
	{
		SoDebugError::post( e.GetFile(), "line %d: %s", e.GetLine(), e.GetDescription() );
		return ;
	}
	catch(...)
	{
		SoDebugError::post( __FILE__, "Unknown exception" );
		return ;
	}

	SO_ENGINE_OUTPUT( output, SoXipSFDataImage, setValue( mXipImage ) );
}
开发者ID:OpenXIP,项目名称:xip-libraries,代码行数:52,代码来源:SoItkConvertItkImageToXipImage.cpp

示例12: SoVtkObject

void SoVtkConeSource::evaluate()
{
	try
	{
		// Deletion of the objects if they exist
		if ( mOutput )
		{
		
			mOutput->unref();
			mOutput = 0;
		}
		
		if ( mOutputPort )
		{
		
			mOutputPort->unref();
			mOutputPort = 0;
		}
		
		// Get the input type(s)
		SoVtkObject *inputPtr = Input.getValue();
		
		if (inputPtr && inputPtr->getPointer()->IsA("vtkDataObject"))
			mObject->SetInput(vtkDataObject::SafeDownCast(inputPtr->getPointer()));

		SoVtkAlgorithmOutput *inputPortPtr = InputConnection.getValue();
		if (inputPortPtr)
			mObject->SetInputConnection(inputPortPtr->getPointer());

		mObject->GetOutput()->Register(0);
		mOutput = new SoVtkObject();
		mOutput->ref();
		mOutput->setPointer( mObject->GetOutput() );

		if ( mObject->GetNumberOfOutputPorts() > 0 )
		{
			mObject->GetOutputPort()->Register(0);
			mOutputPort = new SoVtkAlgorithmOutput();
			mOutputPort->ref();
			mOutputPort->setPointer( mObject->GetOutputPort() );
		}

	}
	catch(...)
	{
		SoDebugError::post( __FILE__, "Unknown Exception" );
		return;
	}
	SO_ENGINE_OUTPUT( Output, SoSFVtkObject, setValue( mOutput ) );
	SO_ENGINE_OUTPUT( OutputPort, SoSFVtkAlgorithmOutput, setValue( mOutputPort ) );
}
开发者ID:OpenXIP,项目名称:xip-libraries,代码行数:51,代码来源:SoVtkConeSource.cpp

示例13: float

// Documented in superclass.
void
SoOneShot::evaluate(void)
{
  SbTime elapsed = this->timeIn.getValue() - this->starttime;
  SbTime durationval = this->duration.getValue();

  SbTime timeoutval;
  float rampval = -999.0f; // Explicit init to kill bogus egcs-2.91.66 warning.

  if (this->running) {
    if (elapsed < durationval) {
      timeoutval = elapsed;
      rampval = float(elapsed.getValue()) / float(durationval.getValue());
    }
    else {
      this->running = FALSE;

      if (this->flags.getValue() & SoOneShot::HOLD_FINAL) {
        this->holdduration = durationval;
        this->holdramp = 1.0f;
      }
    }
  }

  // Don't use "else" here, as the value of this->running might change
  // in the if-block above.
  if (!this->running) {
    if (this->flags.getValue() & SoOneShot::HOLD_FINAL) {
      timeoutval = this->holdduration;
      rampval = this->holdramp;
    }
    else {
      timeoutval = 0.0;
      rampval = 0.0f;
    }
  }

  // Values should be distributed on evaluate() even though outputs
  // are not initially enabled.
  //
  // enable-settings will be restored again on the next
  // inputChanged().
  this->timeOut.enable(TRUE);
  this->ramp.enable(TRUE);
  this->isActive.enable(TRUE);

  SO_ENGINE_OUTPUT(isActive, SoSFBool, setValue(this->running));
  SO_ENGINE_OUTPUT(timeOut, SoSFTime, setValue(timeoutval));
  SO_ENGINE_OUTPUT(ramp, SoSFFloat, setValue(rampval));
}
开发者ID:Alexpux,项目名称:Coin3D,代码行数:51,代码来源:SoOneShot.cpp

示例14: SO_ENGINE_OUTPUT

/*
*! Used to get the bitsUsed from the server
*/
void SoXipRemoteVolume::getBitsUsed()
{
	if(!mStream)
		return;
	
	//send the request for modelMatrix
	mReqSender.initSender(mStream, GET_VOLUME_BITSUSED);
	mReqSender.send();	


	// expect the  response from the server.
	mReqReceiver.initReceiver(mStream);
	mReqReceiver.receive();


	// if there is some error or the  sorting operation did not result in a valid volume.
	if( (mReqReceiver.getFirstElementId() != GET_VOLUME_BITSUSED))
	{
		SoError::post("RemoteVolume: Server getBitsused request error!\n");
		return;
	}

	int Bits;
	if(!mReqReceiver.getUniqueIntElement(GETVOLUMEBITSUSEDRESPONSE, Bits))
	{
		SoError::post("RemoteVolume: Server getBitsused request error!\n");
		return;
	}

	mReqReceiver.rNtohl(&Bits);


	SO_ENGINE_OUTPUT(bitsUsedOutput, SoSFInt32, setValue(Bits));
}
开发者ID:OpenXIP,项目名称:xip-libraries,代码行数:37,代码来源:SoXipRemoteVolume.cpp

示例15: SO_ENGINE_OUTPUT

void
SoItkRigid2DTransform::evaluate()
{
    if( mOutput )
    {
        mOutput->unref();
        mOutput = 0;
        SO_ENGINE_OUTPUT( Output, SoItkSFDataTransform, setValue( 0 ) );
    }
    
    try
    {
		typedef itk::Rigid2DTransform< double > TransformType;
		TransformType::Pointer transform = TransformType::New();

		if( Parameters.getNum() )
		{
			SO_ITK_SET_FIELD_ARRAY( transform, Parameters, double );
		}
		else
		{
			if( UseMatrix.getValue() )
			{
				SO_ITK_SET_FIELD_MATRIX( transform, Matrix, double, 2, 2 );
				SO_ITK_SET_FIELD_VECTOR( transform, Offset, double, 2 );
			}
			else
			{
				SO_ITK_SET_FIELD_POINT( transform, Center, double, 2 );
				SO_ITK_SET_FIELD_VECTOR( transform, Translation, double, 2 );
			}
			transform->SetAngle( Angle.getValue() );
		}
开发者ID:OpenXIP,项目名称:xip-libraries,代码行数:33,代码来源:SoItkRigid2DTransform.cpp


注:本文中的SO_ENGINE_OUTPUT函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。