void
CoreModule::AutoConfigFilters()
{
  for( int i = 0; i < mParamlist.Size(); ++i )
    mParamlist[i].Unchanged();

  ParamList restoreParams;
  if( !mAutoConfig )
  {
    restoreParams = mParamlist;
    if( restoreParams.Exists( "SubjectRun" ) )
      restoreParams.Delete( "SubjectRun" ); // special case for backward compatibility reasons
  }

  EnvironmentBase::EnterPreflightPhase( &mParamlist, &mStatelist, &mStatevector );
  SignalProperties Output( 0, 0 );
  GenericFilter::PreflightFilters( mInputSignal.Properties(), Output );
  EnvironmentBase::EnterNonaccessPhase();
  mOutputSignal = GenericSignal( Output );

  ModuleConnection& conn = IsLastModule() ? mOperator : mNextModule;
  if( conn.IsLocal() && conn.Protocol().Provides( ProtocolVersion::SharedSignalStorage ) )
    mOutputSignal.ShareAcrossModules();

  for( int i = 0; i < restoreParams.Size(); ++i )
  {
    const Param& r = restoreParams[i];
    Param& p = mParamlist[r.Name()];
    if( p.Changed() )
    {
      p = r;
      p.Unchanged();
    }
  }
  if( mParamlist.Exists( "DebugLevel" ) && ::atoi( mParamlist["DebugLevel"].Value().c_str() ) )
  {
    for( int i = 0; i < mParamlist.Size(); ++i )
      if( mParamlist[i].Changed() )
        bciout << "AutoConfig: " << mParamlist[i];
  }
  if( mAutoConfig && bcierr__.Empty() )
  {
    BroadcastParameterChanges();
    if( !mOperator.Send( Output ) )
      bcierr << "Could not send output properties to Operator module" << endl;
  }
}
Example #2
0
void CameraOptions::RiProjection(char *name,ParamList parameters)
{
  if (!strcmp(name,"orthographic"))
    cameraProjection=RtOrthographic;
  else
  {
    if (!strcmp(name,"perspective"))
    {
      cameraProjection=RtPerspective;
      if (parameters.Exists("fov"))
      {
	fieldOfView=parameters.Float("fov");
      }
    }
    else
      RiError("Projection type `%s' not understood",name);
  }
}
Example #3
0
//=======================================
// Constructor
//---------------------------------------
Spotlight::Spotlight(ParamList parameters)
{
  int i;

  from=Point3(0,0,0);
  to=Point3(0,0,1);
  intensity=1;
  coneangle=0.5*30;
  conedeltaangle=0.5*5;
  beamdistribution=2;
  colour=Colour(1,1,1);

  if (parameters.Exists("from"))             from=parameters.Vector("from");
  if (parameters.Exists("to"))               to=parameters.Vector("to");
  if (parameters.Exists("intensity"))        intensity=parameters.Float("intensity");
  if (parameters.Exists("color"))            colour=parameters.Vector("color");
  if (parameters.Exists("coneangle"))        coneangle=0.5*parameters.Float("coneangle");
  if (parameters.Exists("conedeltaangle"))   conedeltaangle=0.5*parameters.Float("conedeltaangle");
  if (parameters.Exists("beamdistribution")) beamdistribution=parameters.Float("beamdistribution");

  from=RiGlobal.tWorldToCamera*RiCurrent.transform*from;
  to=RiGlobal.tWorldToCamera*RiCurrent.transform*to;
}