From: Eduardo DAVILA Date: Wed, 26 Mar 2014 09:05:54 +0000 (+0100) Subject: 2346 creaMaracasVisu Feature New Normal ManualContour Box X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=b3204f9f9a51581a515da84ac6ffa9a24c83f237;p=creaMaracasVisu.git 2346 creaMaracasVisu Feature New Normal ManualContour Box --- diff --git a/bbtk/bbs/appli/exampleManualContour.bbg b/bbtk/bbs/appli/exampleManualContour.bbg new file mode 100644 index 0000000..de6ba24 --- /dev/null +++ b/bbtk/bbs/appli/exampleManualContour.bbg @@ -0,0 +1,47 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/All/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleManualContour.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:4 +BOX +vtk:LoadHola:Box00 +ISEXEC:FALSE +-2.186339:41.873746:-900.000000 +43.388661:31.873746:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box01 +ISEXEC:TRUE +-7.855229:14.279667:-900.000000 +52.784771:4.279667:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ContourControlPoints:Box02 +ISEXEC:FALSE +-20.955005:-30.491537:-900.000000 +50.219995:-40.491537:-900.000000 +FIN_BOX +BOX +wx:CommandButton:Box03 +ISEXEC:TRUE +-69.773673:18.395444:-900.000000 +-24.198673:8.395444:-900.000000 +FIN_BOX +CONNECTIONS:3 +CONNECTION +Box00:Out:Box01:In +NumberOfControlPoints:0 +CONNECTION +Box03:BoxChange:Box02:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box01:wxVtkBaseView4:Box02:wxVtkBaseView +NumberOfControlPoints:0 +APP_END diff --git a/bbtk/bbs/appli/exampleManualContour.bbs b/bbtk/bbs/appli/exampleManualContour.bbs new file mode 100644 index 0000000..34a1a43 --- /dev/null +++ b/bbtk/bbs/appli/exampleManualContour.bbs @@ -0,0 +1,38 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /home/davila/Creatis/All/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleManualContour.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include vtk +include creaMaracasVisu +include wx + +author "Author ??" +description "Description ??" +category "" + +new LoadHola Box00 + +new ViewerNV Box01 + +new ContourControlPoints Box02 + +new CommandButton Box03 + + +connect Box00.Out Box01.In + +connect Box03.BoxChange Box02.BoxExecute + +connect Box01.wxVtkBaseView4 Box02.wxVtkBaseView + + + +# Complex input ports +exec Box01 +exec Box03 diff --git a/bbtk/src/bbcreaMaracasVisuContourControlPoints.cxx b/bbtk/src/bbcreaMaracasVisuContourControlPoints.cxx new file mode 100644 index 0000000..a65b894 --- /dev/null +++ b/bbtk/src/bbcreaMaracasVisuContourControlPoints.cxx @@ -0,0 +1,104 @@ +//===== +// 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 "bbcreaMaracasVisuContourControlPoints.h" +#include "bbcreaMaracasVisuPackage.h" + + + +namespace bbcreaMaracasVisu +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ContourControlPoints) +BBTK_BLACK_BOX_IMPLEMENTATION(ContourControlPoints,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 ContourControlPoints::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') + +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <SetModel( _mContourModel_1 ); + _mViewContour_1->SetWxVtkBaseView( bbGetInputwxVtkBaseView() ); + _mViewContour_1->SetRange( 2 ); + _mViewContour_1->SetZ( 1000 ); + +//JSTG 18-06-07 + _mContourModel_1->SetNumberOfPointsSpline(100); + + +//EED 3 oct 2006 +// _mViewContour_1->SetSpacing(spc); + + +//EED 3 oct 2006 + _mViewContour_1->SetColorNormalContour(0, 0, 1); + _mViewContour_1->SetColorEditContour(0.5, 0.5, 0.5); + + + _manContourControl_1->SetModelView( _mContourModel_1 , _mViewContour_1 ); + ((vtkInteractorStyleBaseView*)bbGetInputwxVtkBaseView()->GetInteractorStyleBaseView())->AddInteractorStyleMaracas( _manContourControl_1 ); + _manContourControl_1->CreateNewManualContour(); + _manContourControl_1->SetActive(true); + _mViewContour_1->RefreshContour(); + + +} +//===== +// 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 ContourControlPoints::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputwxVtkBaseView(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 ContourControlPoints::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 ContourControlPoints::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaMaracasVisu + + diff --git a/bbtk/src/bbcreaMaracasVisuContourControlPoints.h b/bbtk/src/bbcreaMaracasVisuContourControlPoints.h new file mode 100644 index 0000000..2efdba5 --- /dev/null +++ b/bbtk/src/bbcreaMaracasVisuContourControlPoints.h @@ -0,0 +1,58 @@ +//===== +// 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 __bbcreaMaracasVisuContourControlPoints_h_INCLUDED__ +#define __bbcreaMaracasVisuContourControlPoints_h_INCLUDED__ +#include "bbcreaMaracasVisu_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "manualContourControler.h" +#include "manualContourModel.h" +#include "manualViewContour.h" + + +namespace bbcreaMaracasVisu +{ + +class bbcreaMaracasVisu_EXPORT ContourControlPoints + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(ContourControlPoints,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(wxVtkBaseView,wxVtkBaseView*); +// BBTK_DECLARE_OUTPUT(Out,double); + BBTK_PROCESS(Process); + void Process(); + + manualContourControler *_manContourControl_1; + manualContourModel *_mContourModel_1; + manualViewContour *_mViewContour_1; + + +//===== +// 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(ContourControlPoints,bbtk::AtomicBlackBox); + BBTK_NAME("ContourControlPoints"); + BBTK_AUTHOR("Info-Dev Creatis"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(ContourControlPoints,wxVtkBaseView,"wxVtkBaseView",wxVtkBaseView*,""); +// BBTK_OUTPUT(ContourControlPoints,Out,"First output",double,""); + +BBTK_END_DESCRIBE_BLACK_BOX(ContourControlPoints); +//===== +// 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 bbcreaMaracasVisu + +#endif // __bbcreaMaracasVisuContourControlPoints_h_INCLUDED__ +