//==================================================================
/// Computes the final IOStatus of inputs and outputs after processing
- void bbComputePostProcessStatus();
+virtual void bbComputePostProcessStatus();
//@}
//==================================================================
//@{
/// Connects the input <name> to the connection c
- virtual void bbConnectInput( const std::string& name,
- Connection* c);
+ virtual void bbConnectInput( const std::string& name, Connection* c);
/// Connects the output <name> to the connection c
- virtual void bbConnectOutput( const std::string& name,
- Connection* c);
+ virtual void bbConnectOutput( const std::string& name, Connection* c);
/// Disconnects the input <name> from the connection c
- virtual void bbDisconnectInput( const std::string& name,
- Connection* c);
+ virtual void bbDisconnectInput( const std::string& name, Connection* c);
/// Disconnects the output <name> from the connection c
- virtual void bbDisconnectOutput( const std::string& name,
- Connection* c);
+ virtual void bbDisconnectOutput( const std::string& name, Connection* c);
//@}
//==================================================================
/// Sets the bbmExecuting bool returned by bbGetExecuting
void bbSetExecuting(bool b) { bbmExecuting = b; }
- protected:
-
//==================================================================
protected:
namespace bbstd
{
+ void MagicBox::bbComputePostProcessStatus()
+ {
+ AtomicBlackBox::bbComputePostProcessStatus();
+
+ if (bbGetInputActive()==false)
+ {
+printf("EED MagicBox::bbComputePostProcessStatus 1\n");
+ // Update the output statuses
+ IOStatus new_output_status = UPTODATE;
+ OutputConnectorMapType::iterator o;
+ for ( o = bbGetOutputConnectorMap().begin(); o!= bbGetOutputConnectorMap().end(); ++o)
+ {
+ o->second->SetStatus(new_output_status);
+ } // for o
+ } // if
+
+ }
+
void MagicBox::bbUserSetDefaultValues()
{
+ bbSetInputActive(true);
}
+
void MagicBox::bbUserInitializeProcessing()
{
}
+
void MagicBox::bbUserFinalizeProcessing()
{
}
+
void MagicBox::DoProcess()
{
-printf("EED MagicBox::DoProcess Start\n");
- bbSetOutputOut( bbGetInputIn() );
+ if (bbGetInputActive()==true)
+ {
+printf("EED MagicBox::DoProcess Start %p\n", this);
+ bbSetOutputOut( bbGetInputIn() );
printf("EED MagicBox::DoProcess End\n");
+ } // Active
+ else
+ {
+ printf("EED MagicBox::DoProcess FALSE\n");
+ }
}
BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,MagicBox);
{
BBTK_BLACK_BOX_INTERFACE(MagicBox,bbtk::AtomicBlackBox);
BBTK_DECLARE_INPUT(In,bbtk::Data);
+ BBTK_DECLARE_INPUT(Active,bool);
BBTK_DECLARE_OUTPUT(Out,bbtk::Data);
BBTK_PROCESS(DoProcess);
void DoProcess();
+
+ virtual void bbComputePostProcessStatus();
};
//==================================================================
(&MagicBox::bbGetInputIn),
new MagicBoxSetFunctor (&MagicBox::bbSetInputIn) ) );
+ BBTK_INPUT(MagicBox, Active, "Active True/False (default True)",bool,"");
+
+
AddOutputDescriptor
(new bbtk::AtomicBlackBoxOutputDescriptor
(typeid(MagicBoxDescriptor),
<vtkobject>vtkSphereSource</vtkobject>
<output name="Out" type="vtkPolyData*" description="Output Sphere" special="vtk output"/>
+<input name="Active" type="bool" description="Active True/False (default True)"/>
<input name="CenterX" type="double" description="Center X coord"/>
<input name="CenterY" type="double" description="Center Y coord"/>
<input name="CenterZ" type="double" description="Center Z coord"/>
<process>
<PRE>
+if (bbGetInputActive()==true)
+{
-bbGetVtkObject()->SetCenter(bbGetInputCenterX(),
- bbGetInputCenterY(),
- bbGetInputCenterZ());
-//bbGetVtkObject()->SetPhiResolution(bbGetInputPhiResolution());
-//bbGetVtkObject()->SetThetaResolution(bbGetInputThetaResolution());
-//bbGetVtkObject()->SetRadius(bbGetInputRadius());
-//printf("EED box vtk:SphereSource theta=%d phi=%d\n", bbGetInputThetaResolution() , bbGetInputPhiResolution());
+ bbGetVtkObject()->SetCenter(bbGetInputCenterX(), bbGetInputCenterY(), bbGetInputCenterZ());
+ //bbGetVtkObject()->SetPhiResolution(bbGetInputPhiResolution());
+ //bbGetVtkObject()->SetThetaResolution(bbGetInputThetaResolution());
+ //bbGetVtkObject()->SetRadius(bbGetInputRadius());
+ //printf("EED box vtk:SphereSource theta=%d phi=%d\n", bbGetInputThetaResolution() , bbGetInputPhiResolution());
+ bbGetVtkObject()->Update();
+}
-bbGetVtkObject()->Update();
</PRE>
</process>
+<defaultValues><PRE>
+ bbSetInputActive(true);
+</PRE></defaultValues>
+
</blackbox>