2 // 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)
4 #include "bbcreaMaracasVisuContourControlPoints.h"
5 #include "bbcreaMaracasVisuPackage.h"
7 namespace bbcreaMaracasVisu
10 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ContourControlPoints)
11 BBTK_BLACK_BOX_IMPLEMENTATION(ContourControlPoints,bbtk::AtomicBlackBox);
13 // 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)
15 void ContourControlPoints::Process()
17 // THE MAIN PROCESSING METHOD BODY
18 // Here we simply set the input 'In' value to the output 'Out'
19 // And print out the output value
20 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
21 // void bbSet{Input|Output}NAME(const TYPE&)
22 // const TYPE& bbGet{Input|Output}NAME() const
24 // * NAME is the name of the input/output
25 // (the one provided in the attribute 'name' of the tag 'input')
26 // * TYPE is the C++ type of the input/output
27 // (the one provided in the attribute 'type' of the tag 'input')
29 // bbSetOutputOut( bbGetInputIn() );
30 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
35 if ( bbGetInputwxVtkBaseView() != NULL )
37 if (_manContourControl_1==NULL)
39 _manContourControl_1 = new manualContourControler();
40 _mContourModel_1 = new manualContourModel();
41 _mViewContour_1 = new manualViewContour();
42 _mContourModel_1 -> SetCloseContour( bbGetInputOpenClose() );
43 _mViewContour_1->SetModel( _mContourModel_1 );
44 _mViewContour_1->SetWxVtkBaseView( bbGetInputwxVtkBaseView() );
45 _mViewContour_1->SetRange( 2 );
46 _mViewContour_1->SetZ( 1000 );
48 _mContourModel_1->SetNumberOfPointsSpline(100);
51 bbGetInputwxVtkBaseView()->GetSpacing(spc);
52 _mViewContour_1->SetSpacing(spc);
54 _mViewContour_1->SetColorNormalContour(0, 0, 1);
55 _mViewContour_1->SetColorEditContour(0.5, 0.5, 0.5);
56 _manContourControl_1->SetModelView( _mContourModel_1 , _mViewContour_1 );
57 ((vtkInteractorStyleBaseView*)bbGetInputwxVtkBaseView()->GetInteractorStyleBaseView())->AddInteractorStyleMaracas( _manContourControl_1 );
58 _manContourControl_1->CreateNewManualContour();
59 _manContourControl_1->SetActive( bbGetInputActive() );
60 _mViewContour_1->RefreshContour();
61 } // _manContourControl_1
62 _mContourModel_1 -> SetCloseContour( bbGetInputOpenClose() );
63 _manContourControl_1->SetActive( bbGetInputActive() );
64 if ( bbGetInputVisible() == true)
66 _mViewContour_1->AddCompleteContourActor (true);
68 _mViewContour_1->RemoveCompleteContourActor ();
70 double width = bbGetInputWidthLine();
71 _mViewContour_1->SetWidthLine( width );
72 _mViewContour_1->SetRange( 2*width );
73 _mViewContour_1->RefreshContour();
74 bbSetOutputManualBaseModel( _mContourModel_1 );
79 // 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)
81 void ContourControlPoints::bbUserSetDefaultValues()
84 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
85 // Here we initialize the input 'In' to 0
86 bbSetInputActive(false);
87 bbSetInputVisible(true);
88 bbSetInputOpenClose(true);
89 bbSetInputwxVtkBaseView(NULL);
90 bbSetInputWidthLine(1);
91 _manContourControl_1 = NULL;
92 _mContourModel_1 = NULL;
93 _mViewContour_1 = NULL;
97 // 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)
99 void ContourControlPoints::bbUserInitializeProcessing()
102 // THE INITIALIZATION METHOD BODY :
104 // but this is where you should allocate the internal/output pointers
110 // 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)
112 void ContourControlPoints::bbUserFinalizeProcessing()
115 // THE FINALIZATION METHOD BODY :
117 // but this is where you should desallocate the internal/output pointers
122 // EO namespace bbcreaMaracasVisu