From 32f572e3d47f4c17b65787a6616a73e9d718c04e Mon Sep 17 00:00:00 2001 From: Eduardo Davila Date: Wed, 15 Feb 2012 13:16:29 +0000 Subject: [PATCH] no message --- kernel/appli/bbi/bbi.cxx | 9 +-- packages/vtk/src/bbvtkPolyDataToActor.cxx | 2 +- packages/vtk/src/bbvtkPolyDataToActor.h | 2 +- packages/vtk/src/bbvtkText3D.cxx | 95 +++++++++++++++++++++++ packages/vtk/src/bbvtkText3D.h | 61 +++++++++++++++ 5 files changed, 161 insertions(+), 8 deletions(-) create mode 100644 packages/vtk/src/bbvtkText3D.cxx create mode 100644 packages/vtk/src/bbvtkText3D.h diff --git a/kernel/appli/bbi/bbi.cxx b/kernel/appli/bbi/bbi.cxx index 891ffbf..954b384 100644 --- a/kernel/appli/bbi/bbi.cxx +++ b/kernel/appli/bbi/bbi.cxx @@ -171,12 +171,9 @@ bool wxBBIApp::OnInit( ) I->SetInputs(cmd.param_map); bool help_on_script = cmd.help && (cmd.input_file.size() > 0); - if (help_on_script) - I->SetNoExecMode(true); - if (cmd.graphical_dialog) - I->SetDialogMode(bbtk::VirtualExec::GraphicalDialog); - if (cmd.text_dialog) - I->SetDialogMode(bbtk::VirtualExec::TextDialog); + if (help_on_script) I->SetNoExecMode(true); + if (cmd.graphical_dialog) I->SetDialogMode(bbtk::VirtualExec::GraphicalDialog); + if (cmd.text_dialog) I->SetDialogMode(bbtk::VirtualExec::TextDialog); std::vector::const_iterator i; bool error = false; diff --git a/packages/vtk/src/bbvtkPolyDataToActor.cxx b/packages/vtk/src/bbvtkPolyDataToActor.cxx index 5462494..b956019 100644 --- a/packages/vtk/src/bbvtkPolyDataToActor.cxx +++ b/packages/vtk/src/bbvtkPolyDataToActor.cxx @@ -60,7 +60,7 @@ namespace bbvtk bbSetInputRenderer(NULL); bbSetInputTransform(NULL); bbSetInputOpacity(1); - bbSetInputRepresentation(1); + bbSetInputRepresentation(2); bbSetInputLineWidth(1); polydatamapper = NULL; diff --git a/packages/vtk/src/bbvtkPolyDataToActor.h b/packages/vtk/src/bbvtkPolyDataToActor.h index c1f0fbe..f510c9f 100644 --- a/packages/vtk/src/bbvtkPolyDataToActor.h +++ b/packages/vtk/src/bbvtkPolyDataToActor.h @@ -101,7 +101,7 @@ namespace bbvtk BBTK_INPUT(PolyDataToActor,Colour,"r g b",vectorcolour,"colour"); BBTK_INPUT(PolyDataToActor,Renderer,"3D scene in which to insert the surface",vtkRenderer*,""); BBTK_INPUT(PolyDataToActor,Transform,"Linear Transform (4x4 homogeneous)",vtkLinearTransform*,""); - BBTK_INPUT(PolyDataToActor,Representation,"0 points, 1(default) surface, 2 wireframe",int,""); + BBTK_INPUT(PolyDataToActor,Representation,"0 points,1 wireframe, 2(default) surface",int,""); BBTK_INPUT(PolyDataToActor,LineWidth,"Width of the wireframe (1 default)",double,""); BBTK_OUTPUT(PolyDataToActor,Out,"Extracted iso-surface",vtkProp3D *,""); diff --git a/packages/vtk/src/bbvtkText3D.cxx b/packages/vtk/src/bbvtkText3D.cxx new file mode 100644 index 0000000..bf831ad --- /dev/null +++ b/packages/vtk/src/bbvtkText3D.cxx @@ -0,0 +1,95 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbvtkText3D.h" +#include "bbvtkPackage.h" + +#include "vtkTextActor3D.h" +#include "vtkTextProperty.h" + + +namespace bbvtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,Text3D) +BBTK_BLACK_BOX_IMPLEMENTATION(Text3D,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void Text3D::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + + vtkTextActor3D *textActor = vtkTextActor3D::New(); + vtkTextProperty *textprop = vtkTextProperty::New(); + textprop->SetColor( bbGetInputColour()[0] , bbGetInputColour()[1], bbGetInputColour()[2] ); + textprop->SetFontSize( 14 ); + + textActor->SetTextProperty( textprop ); + + textActor->SetInput( bbGetInputIn().c_str() ); + textActor->SetPosition( bbGetInputX(), bbGetInputY(),bbGetInputZ() ); + bbGetInputRenderer()->AddActor( textActor ); + bbSetOutputOut(textActor); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void Text3D::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputIn(""); + bbSetInputX(0); + bbSetInputY(0); + bbSetInputZ(0); + + std::vector colour; + colour.push_back(1); + colour.push_back(0); + colour.push_back(0); + bbSetInputColour(colour); + bbSetInputRenderer(NULL); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void Text3D::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void Text3D::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbvtk + + diff --git a/packages/vtk/src/bbvtkText3D.h b/packages/vtk/src/bbvtkText3D.h new file mode 100644 index 0000000..0afce28 --- /dev/null +++ b/packages/vtk/src/bbvtkText3D.h @@ -0,0 +1,61 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbvtkText3D_h_INCLUDED__ +#define __bbvtkText3D_h_INCLUDED__ +#include "bbvtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkProp3D.h" +#include "vtkRenderer.h" + +namespace bbvtk +{ + +class bbvtk_EXPORT Text3D + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(Text3D,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(In,std::string); + BBTK_DECLARE_INPUT(X,int); + BBTK_DECLARE_INPUT(Y,int); + BBTK_DECLARE_INPUT(Z,int); + BBTK_DECLARE_INPUT(Colour,std::vector); + BBTK_DECLARE_INPUT(Renderer,vtkRenderer*); + BBTK_DECLARE_OUTPUT(Out,vtkProp3D*); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(Text3D,bbtk::AtomicBlackBox); +BBTK_NAME("Text3D"); +BBTK_AUTHOR("Info-Deb"); +BBTK_DESCRIPTION("Text in 3D vtkRender"); +BBTK_CATEGORY(""); + + BBTK_INPUT(Text3D,In,"Input Text",std::string,""); + BBTK_INPUT(Text3D,X,"position X",int,""); + BBTK_INPUT(Text3D,Y,"position Y",int,""); + BBTK_INPUT(Text3D,Z,"position Z",int,""); + BBTK_INPUT(Text3D,Colour,"Colour vector RGB",std::vector,""); + BBTK_INPUT(Text3D,Renderer,"vtk Renderer",vtkRenderer*,""); + + BBTK_OUTPUT(Text3D,Out,"vtk Actor",vtkProp3D*,""); + +BBTK_END_DESCRIBE_BLACK_BOX(Text3D); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbvtk + +#endif // __bbvtkText3D_h_INCLUDED__ + -- 2.47.1