Program: bbtk
Module: $RCSfile: bbtkBlackBox.cxx,v $
Language: C++
- Date: $Date: 2009/06/08 14:50:02 $
- Version: $Revision: 1.48 $
+ Date: $Date: 2010/01/21 16:03:17 $
+ Version: $Revision: 1.49 $
=========================================================================*/
/* ---------------------------------------------------------------------
bbmParent()
{
+ //JCP 02-11-09
+ // bbmBoxProcessMode = "Pipeline";
+//std::cout<<"JCP BlackBox::BlackBox(const std::string &name) name=" <<name
+// <<"bbmBoxProcessMode="<<bbmBoxProcessMode<<std::endl;
bbtkBlackBoxDebugMessage("object",4,"==> BlackBox::BlackBox(\""
<<name<<"\")"<<std::endl);
bbtkBlackBoxDebugMessage("object",4,"<== BlackBox::BlackBox(\""
bbmParent()
{
+ //JCP 02-11-09
+ //bbmBoxProcessMode = from.bbmBoxProcessMode;
+ //std::cout<<"JCP BlackBox::BlackBox(const std::string &name) name=" <<name
+ // <<"bbmBoxProcessMode="<<bbmBoxProcessMode<<std::endl;
bbtkBlackBoxDebugMessage("object",4,"==> BlackBox::BlackBox("
<<from.bbGetFullName()<<",\""
<<name<<"\")"<<std::endl);
(p == "Always") || (p == "always") ) return Always;
if ( (p == "2") ||
(p == "R") || (p == "r") ||
- (p == "Reactive") || (p == "reactive") ) return Reactive;
+ (p == "Reactive") || (p == "reactive") )
+ return Reactive;
/*
if ( (p == "3") ||
(p == "F") || (p == "f") ||
o->second->SetStatus(OUTOFDATE);
o->second->SignalChange(GetThisPointer<BlackBox>(),o->first);
}
- }
+ }
if ( ( bbBoxProcessModeIsReactive() ||
(c==bbGetInputConnectorMap().find("BoxExecute")->second))
Program: bbtk
Module: $RCSfile: bbtkFactory.cxx,v $
Language: C++
- Date: $Date: 2009/10/05 22:44:48 $
- Version: $Revision: 1.46 $
+ Date: $Date: 2010/01/21 16:03:17 $
+ Version: $Revision: 1.47 $
=========================================================================*/
/* ---------------------------------------------------------------------
// Builds the index map
PackageMapType::const_iterator i;
for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
- {
- Package::Pointer pack = i->second;
- if (pack->GetName()=="user") continue;
- Package::DescriptorMapType::const_iterator j;
- for (j = pack->GetDescriptorMap().begin();
- j!= pack->GetDescriptorMap().end();
- ++j)
- {
+ {
+ Package::Pointer pack = i->second;
+ if (pack->GetName()=="user") continue;
+ Package::DescriptorMapType::const_iterator j;
+ for (j = pack->GetDescriptorMap().begin();
+ j!= pack->GetDescriptorMap().end();
+ ++j)
+ {
// Skip adaptors
- if ( type==Adaptors )
- {
- if (j->second->GetKind() == BlackBoxDescriptor::STANDARD )
- continue;
- }
- else
- if (j->second->GetKind() != BlackBoxDescriptor::STANDARD )
- continue;
+ if ( type==Adaptors )
+ {
+ if (j->second->GetKind() == BlackBoxDescriptor::STANDARD )
+ continue;
+ }
+ else
+ if (j->second->GetKind() != BlackBoxDescriptor::STANDARD )
+ continue;
- std::vector<std::string> keys;
- if (type==Packages)
- {
- std::string k("");
- k += pack->GetName();
- keys.push_back(k);
- title = "Boxes by package";
- }
- else if ((type==Initials) || (type==Adaptors))
- {
- std::string init(" ");
- init[0] = std::toupper(j->second->GetTypeName()[0]);
- keys.push_back(init);
- title = "Alphabetical list";
- }
- else if (type==Categories)
- {
- // Split the category string
- std::string delimiters = ";,";
- Utilities::SplitString(j->second->GetCategory(),
- delimiters,keys);
- if (keys.size()==0)
- keys.push_back(" NONE");
- title = "Boxes by category";
- }
-
-
- std::vector<std::string>::const_iterator k;
- for (k=keys.begin(); k!=keys.end(); ++k )
- {
- IndexType::iterator p;
- p = index.find(*k);
- if (p != index.end())
- {
- p->second.push_back(j->second);
- }
- else
- {
- std::vector<BlackBoxDescriptor::Pointer> v;
- v.push_back(j->second);
- index[*k] = v;
- }
- }
-
- }
- }
+ std::vector<std::string> keys;
+ if (type==Packages)
+ {
+ std::string k("");
+ k += pack->GetName();
+ keys.push_back(k);
+ title = "Boxes by package";
+ }
+ else if ((type==Initials) || (type==Adaptors))
+ {
+ std::string init(" ");
+ init[0] = std::toupper(j->second->GetTypeName()[0]);
+ keys.push_back(init);
+ title = "Alphabetical list";
+ }
+ else if (type==Categories)
+ {
+ // Split the category string
+ std::string delimiters = ";,";
+ Utilities::SplitString(j->second->GetCategory(),
+ delimiters,keys);
+ if (keys.size()==0)
+ keys.push_back(" NONE");
+ title = "Boxes by category";
+ }
+
+
+ std::vector<std::string>::const_iterator k;
+ for (k=keys.begin(); k!=keys.end(); ++k )
+ {
+ IndexType::iterator p;
+ p = index.find(*k);
+ if (p != index.end())
+ {
+ p->second.push_back(j->second);
+ }
+ else
+ {
+ std::vector<BlackBoxDescriptor::Pointer> v;
+ v.push_back(j->second);
+ index[*k] = v;
+ }
+ }
+
+ }
+ }
// Creates the file
//---------------------
// Open output file
IndexType::iterator ii;
for (ii=index.begin();ii!=index.end();++ii)
{
- s << "<a href=\"#"<<ii->first<<"\">"<<ii->first<<"</a> ";
+ s << "<a href=\"#"<<ii->first<<"\">"<<ii->first<<"</a> ";
}
for (ii=index.begin();ii!=index.end();++ii)
s << " - \n";
s << "<a name=\"doxygen\"></a>\n";
-//EED 26Mars2009
+
+//EED 26Mars2009
+ /*JCP 19 Nov 2009
std::string bin_path = bbtk::ConfigurationFile::GetInstance().Get_bin_path();
s << "<a href=" << bin_path <<"/../share/bbtk/doc/doxygen/" << ii->first << "/main.html>(Doxygen documentation of the source)</a>\n";
+ JCP 19 Nov 2009*/
+ std::string bin_path = bbtk::ConfigurationFile::GetInstance().Get_bin_path();
+ s << "<a href=" << bin_path <<"/../share/bbtk/doc/doxygen/" << ii->first << "/main.html>(Doxygen documentation of the source)</a>\n";
}
else
{
Program: bbtk
Module: $RCSfile: bbvtkImagePlanes.cxx,v $
Language: C++
- Date: $Date: 2009/09/01 13:59:48 $
- Version: $Revision: 1.30 $
+ Date: $Date: 2010/01/21 16:03:19 $
+ Version: $Revision: 1.31 $
=========================================================================*/
/* ---------------------------------------------------------------------
};
//================================================================
- //vtkCxxRevisionMacro(ImagePlanes::VtkCallbackType, "$Revision: 1.30 $");
+ //vtkCxxRevisionMacro(ImagePlanes::VtkCallbackType, "$Revision: 1.31 $");
//================================================================
picker->SetTolerance(0.005);
// The 3 image plane widgets
- vtkImagePlaneWidget* planeWidgetX = vtkImagePlaneWidget::New();
- planeWidgetX->DisplayTextOn();
- planeWidgetX->SetPicker(picker);
- planeWidgetX->SetKeyPressActivationValue('x');
- vtkProperty* prop1 = planeWidgetX->GetPlaneProperty();
- prop1->SetColor(1, 0, 0);
-
- vtkImagePlaneWidget* planeWidgetY = vtkImagePlaneWidget::New();
- planeWidgetY->DisplayTextOn();
- planeWidgetY->SetPicker(picker);
- planeWidgetY->SetKeyPressActivationValue('y');
- vtkProperty* prop2 = planeWidgetY->GetPlaneProperty();
- prop2->SetColor(1, 1, 0);
+ vtkImagePlaneWidget* planeWidgetX = GetPlaneWidget('x', 1, 0, 0, picker);
+ vtkImagePlaneWidget* planeWidgetY = GetPlaneWidget('y', 1, 1, 0, picker);
planeWidgetY->SetLookupTable(planeWidgetX->GetLookupTable());
- vtkImagePlaneWidget* planeWidgetZ = vtkImagePlaneWidget::New();
- planeWidgetZ->DisplayTextOn();
- planeWidgetZ->SetPicker(picker);
- planeWidgetZ->SetKeyPressActivationValue('z');
- vtkProperty* prop3 = planeWidgetZ->GetPlaneProperty();
- prop3->SetColor(0, 0, 1);
+ vtkImagePlaneWidget* planeWidgetZ = GetPlaneWidget('z', 0, 0, 1, picker);
planeWidgetZ->SetLookupTable(planeWidgetX->GetLookupTable());
- vtkImagePlaneWidget* planeWidget3Pts = vtkImagePlaneWidget::New();
- //vtkPlaneWidget* planeWidget3Pts = vtkPlaneWidget::New();
- planeWidget3Pts->DisplayTextOn();
- planeWidget3Pts->SetPicker(picker);
- planeWidget3Pts->SetKeyPressActivationValue('3');
- vtkProperty* prop3Pts = planeWidget3Pts->GetPlaneProperty();
- prop3Pts->SetColor(0, 1, 1);
+ vtkImagePlaneWidget* planeWidget3Pts = GetPlaneWidget('3', 0, 1, 1, picker);
planeWidget3Pts->SetLookupTable(planeWidgetX->GetLookupTable());
bbSetOutputPlaneX(planeWidgetX);
bbSetOutputImageX(planeWidgetX->GetResliceOutput());
bbSetOutputImageY(planeWidgetY->GetResliceOutput());
bbSetOutputImageZ(planeWidgetZ->GetResliceOutput());
+ bbSetInputInteractor(0);
//bbSetOutputImage3Pts(planeWidget3Pts->GetResliceOutput());
picker->UnRegister(NULL);
0.5*(range[1]+range[0]));
}
+ updateInteractor();
+
}
// UPDATE DES SORTIES
bbGetOutputPlaneX()->GetResliceOutput()->Update();
std::vector<int> pointsy = bbGetInputPointsY();
std::vector<int> pointsz = bbGetInputPointsZ();
- std::cout<<pointsx.size()<<pointsy.size()<<pointsz.size()<<std::endl;
+ //std::cout<<pointsx.size()<<pointsy.size()<<pointsz.size()<<std::endl;
if(pointsx.size()==pointsy.size() && pointsx.size()==pointsz.size()&&pointsx.size()>=3){
}
}
-
+void ImagePlanes::updateInteractor(){
+
+ vtkRenderWindowInteractor* interactor = bbGetInputInteractor();
+
+ if(interactor){
+ bbGetOutputPlaneX()->SetInteractor(interactor);
+ bbGetOutputPlaneX()->EnabledOn();
+ bbGetOutputPlaneY()->SetInteractor(interactor);
+ bbGetOutputPlaneY()->EnabledOn();
+ bbGetOutputPlaneZ()->SetInteractor(interactor);
+ bbGetOutputPlaneZ()->EnabledOn();
+ bbGetOutputPlane3Pts()->SetInteractor(interactor);
+ bbGetOutputPlane3Pts()->EnabledOn();
+ }
+}
//-----------------------------------------------------------------
void vtkImageDataPointerRelay::bbUserSetDefaultValues()
{
+
}
//-----------------------------------------------------------------
{
}
-
+ vtkImagePlaneWidget* ImagePlanes::GetPlaneWidget(unsigned char activationkey, double r, double g, double b, vtkCellPicker* picker){
+
+ vtkProperty* prop1 = 0;
+ vtkImagePlaneWidget* planeWidget = 0;
+
+ planeWidget = vtkImagePlaneWidget::New();
+ planeWidget->DisplayTextOn();
+ planeWidget->SetPicker(picker);
+ planeWidget->SetKeyPressActivationValue(activationkey);
+ prop1 = planeWidget->GetPlaneProperty();
+ prop1->SetColor(r, g, b);
+
+ return planeWidget;
+ }
double* ImagePlanes::getCrossProduct(double* vect0,double* vect1){
double* vectCross;
Program: bbtk
Module: $RCSfile: bbvtkImagePlanes.h,v $
Language: C++
- Date: $Date: 2009/07/02 07:17:33 $
- Version: $Revision: 1.19 $
+ Date: $Date: 2010/01/21 16:03:19 $
+ Version: $Revision: 1.20 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_DECLARE_INPUT(PointsX, std::vector<int>);
BBTK_DECLARE_INPUT(PointsY, std::vector<int>);
BBTK_DECLARE_INPUT(PointsZ, std::vector<int>);
+ BBTK_DECLARE_INPUT(Interactor, vtkRenderWindowInteractor*);
BBTK_DECLARE_OUTPUT(PlaneX, vtkImagePlaneWidget*);
BBTK_DECLARE_OUTPUT(PlaneY, vtkImagePlaneWidget*);
double* getNormal(double* vect);
double getMagnitud(double* vect);
double* makeVector(double podouble0[3], double podouble1[3]);
+ void updateInteractor();
+
+ vtkImagePlaneWidget* GetPlaneWidget(unsigned char activationkey, double r, double g, double b, vtkCellPicker* picker);
};
//=================================================================
BBTK_INPUT(ImagePlanes, PointsX, "Points in X", std::vector<int>, "");
BBTK_INPUT(ImagePlanes, PointsY, "Points in Y", std::vector<int>, "");
BBTK_INPUT(ImagePlanes, PointsZ, "Points in Z", std::vector<int>, "");
+ BBTK_INPUT(ImagePlanes, Interactor, "Interactor for the planes", vtkRenderWindowInteractor*, "");
BBTK_OUTPUT(ImagePlanes,PlaneX, "The image plane in X direction", vtkImagePlaneWidget*, "");
BBTK_OUTPUT(ImagePlanes,PlaneY, "The image plane in Y direction", vtkImagePlaneWidget*, "");