From: Eduardo Davila Date: Fri, 3 Feb 2012 07:03:46 +0000 (+0000) Subject: no message X-Git-Tag: v1.0.4~30 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=0cc1383dff9255c9929097bbe9f44a6f4f31c97a;p=creaMaracasVisu.git no message --- diff --git a/bbtk/src/bbcreaMaracasVisuTubeFilter.cxx b/bbtk/src/bbcreaMaracasVisuTubeFilter.cxx index 1644192..995c58d 100644 --- a/bbtk/src/bbcreaMaracasVisuTubeFilter.cxx +++ b/bbtk/src/bbcreaMaracasVisuTubeFilter.cxx @@ -55,6 +55,13 @@ namespace bbcreaMaracasVisu this->lstPointZ = lstPointZ; } + + void MaracasTubeFilter::SetlstColour( std::vector lstColour ) + { + this->lstColour=lstColour; + } + + void MaracasTubeFilter::SetlstRadius( std::vector lstRadius ) { this->lstRadius = lstRadius; @@ -77,6 +84,8 @@ namespace bbcreaMaracasVisu void MaracasTubeFilter::Run() { + + unsigned int i; unsigned int nTv = 8; // No. of surface elements for each tube vertex @@ -87,23 +96,20 @@ namespace bbcreaMaracasVisu points->InsertPoint(i, lstPointX[i], lstPointY[i], lstPointZ[i]); } - vtkSmartPointer lines = - vtkSmartPointer::New(); + vtkSmartPointer lines = vtkSmartPointer::New(); lines->InsertNextCell( lstPointX.size() ); for (i = 0; i < lstPointX.size(); i++) { lines->InsertCellPoint(i); } - vtkSmartPointer polyData = - vtkSmartPointer::New(); + vtkSmartPointer polyData = vtkSmartPointer::New(); polyData->SetPoints(points); polyData->SetLines(lines); // Varying tube radius using sine-function - vtkSmartPointer tubeRadius = - vtkSmartPointer::New(); + vtkSmartPointer tubeRadius = vtkSmartPointer::New(); tubeRadius->SetName("TubeRadius"); tubeRadius->SetNumberOfTuples( lstRadius.size() ); for (i=0 ;i colors = - vtkSmartPointer::New(); + vtkSmartPointer colors = vtkSmartPointer::New(); colors->SetName("Colors"); colors->SetNumberOfComponents(3); colors->SetNumberOfTuples( lstPointX.size() ); + int numberOfColours = lstColour.size()/3; + int indexcolour; for (i = 0; i < lstPointX.size() ;i++) - { - colors->InsertTuple3(i, 255 , 0.0 , 0.0 ); - } + { + if (numberOfColours==0){ + colors->InsertTuple3(i, 1 , 1 , 1 ); + } else { + if (iInsertTuple3(i, 255*lstColour[indexcolour+0] , 255*lstColour[indexcolour+1] , 255*lstColour[indexcolour+2] ); + } + } // for polyData->GetPointData()->AddArray(colors); - vtkSmartPointer tube - = vtkSmartPointer::New(); + vtkSmartPointer tube = vtkSmartPointer::New(); tube->SetInput(polyData); tube->SetNumberOfSides(nTv); tube->SetVaryRadiusToVaryRadiusByAbsoluteScalar(); - vtkSmartPointer mapper = - vtkSmartPointer::New(); + vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(tube->GetOutputPort()); mapper->ScalarVisibilityOn(); mapper->SetScalarModeToUsePointFieldData(); @@ -144,7 +158,6 @@ namespace bbcreaMaracasVisu actor->SetMapper(mapper); actor->GetProperty()->SetOpacity( opacity ); - if ( transform!=NULL ) { actor->SetUserTransform( transform ); @@ -194,6 +207,7 @@ void TubeFilter::Process() tubefilter->SetlstRadius( bbGetInputlstRadio() ); tubefilter->SetOpacity( bbGetInputOpacity() ); tubefilter->SetTransform( bbGetInputTransform() ); + tubefilter->SetlstColour( bbGetInputColour() ); tubefilter->Run(); bbSetOutputOutAxis( tubefilter->GetActor() ); printf("EED TubeFilter::Process end \n"); @@ -208,7 +222,15 @@ void TubeFilter::bbUserSetDefaultValues() // Here we initialize the input 'In' to 0 bbSetInputOpacity(1); bbSetInputTransform(NULL); - + + std::vector colour; + // 0- gray + colour.push_back(1.0); + colour.push_back(0.0); + colour.push_back(0.0); + bbSetInputColour(colour); + + } //===== diff --git a/bbtk/src/bbcreaMaracasVisuTubeFilter.h b/bbtk/src/bbcreaMaracasVisuTubeFilter.h index c23d1fa..993f10f 100644 --- a/bbtk/src/bbcreaMaracasVisuTubeFilter.h +++ b/bbtk/src/bbcreaMaracasVisuTubeFilter.h @@ -26,6 +26,7 @@ namespace bbcreaMaracasVisu void SetvtkRenderer( vtkRenderer *render); void SetlstPoints( std::vector lstPointX , std::vector lstPointY , std::vector lstPointZ ); void SetlstRadius( std::vector lstRadius ); + void SetlstColour( std::vector lstColour ); void SetOpacity(double opacity); void SetTransform( vtkLinearTransform* transform ); vtkActor *GetActor(); @@ -40,6 +41,7 @@ namespace bbcreaMaracasVisu std::vector lstPointY; std::vector lstPointZ; std::vector lstRadius; + std::vector lstColour; }; diff --git a/bbtk/src/bbcreaMaracasVisuTubeTreeFilter.cxx b/bbtk/src/bbcreaMaracasVisuTubeTreeFilter.cxx index 8f2a3ce..f431595 100644 --- a/bbtk/src/bbcreaMaracasVisuTubeTreeFilter.cxx +++ b/bbtk/src/bbcreaMaracasVisuTubeTreeFilter.cxx @@ -10,11 +10,182 @@ #include #include #include +#include "vtkObjectFactory.h" + + vtkStandardNewMacro(vtkLookupTableEED); + + // Construct with range=(0,1); and hsv ranges set up for rainbow color table + // (from red to blue). + vtkLookupTableEED::vtkLookupTableEED(int sze, int ext) + { + this->TableRange[0] = 0.0; + this->TableRange[1] = 1.0; + } + + //---------------------------------------------------------------------------- + vtkLookupTableEED::~vtkLookupTableEED() + { + } + + + + unsigned char *vtkLookupTableEED::MapValue(double v) + { + + //int idx = this->GetIndex(v); + //return (this->Table->GetPointer(0) + 4*idx); + + return 0; + } + + void vtkLookupTableEED::GetColor(double v, double rgb[3]) + { + // unsigned char *rgb8 = this->MapValue(v); + // rgb[0] = rgb8[0]/255.0; + // rgb[1] = rgb8[1]/255.0; + // rgb[2] = rgb8[2]/255.0; + + rgb[0] = 1; + rgb[1] = 1; + rgb[2] = 0; + } + + + void vtkLookupTableEED::SetTableRange(double r[2]) + { + this->SetTableRange(r[0],r[1]); + } + + //---------------------------------------------------------------------------- + // Set the minimum/maximum scalar values for scalar mapping. Scalar values + // less than minimum range value are clamped to minimum range value. + // Scalar values greater than maximum range value are clamped to maximum + // range value. + void vtkLookupTableEED::SetTableRange(double rmin, double rmax) + { + if (rmax < rmin) + { + vtkErrorMacro("Bad table range: ["<TableRange[0] == rmin && this->TableRange[1] == rmax) + { + return; + } + + this->TableRange[0] = rmin; + this->TableRange[1] = rmax; + + this->Modified(); + } + + + + //---------------------------------------------------------------------------- + // Although this is a relatively expensive calculation, + // it is only done on the first render. Colors are cached + // for subsequent renders. + template + void vtkLookupTableMapDirVectorEED(vtkLookupTableEED *self, T *input, + unsigned char *output, int length, + int inIncr, int outFormat) + { + double tmp,sum; + // double *mag; + int i, j; + double dirx,diry,dirz; + + + printf("EED length %d %p\n", length,input); + // mag = new double[length]; + for (i = 0; i < length; ++i) + { + dirx = 0; + diry = 0; + dirz = 0; + sum = 0; + for (j = 0; j < inIncr; ++j) + { + if (j==0) dirx= static_cast(*input); + if (j==1) diry= static_cast(*input); + if (j==2) dirz= static_cast(*input); + tmp = static_cast(*input); + sum += (tmp * tmp); + ++input; + } + sum=sqrt(sum); + *output++ = (unsigned char) abs( (255*dirx/sum) ); + *output++ = (unsigned char) abs( (255*diry/sum) ); + *output++ = (unsigned char) abs( (255*dirz/sum) ); + *output++ = 255; + // printf("%d %d %d ",(int)(255*dirx/sum),(int)(255*diry/sum),(int)(255*dirz/sum)); + } + + // vtkLookupTableMapData(self, mag, output, length, 1, outFormat); + + // delete [] mag; + } + + + + //---------------------------------------------------------------------------- + void vtkLookupTableEED::MapScalarsThroughTable2(void *input, + unsigned char *output, + int inputDataType, + int numberOfValues, + int inputIncrement, + int outputFormat) + { + + printf("vtkLookupTableEED::MapScalarsThroughTable2 inputIncrement=%d inputDataType=%d\n",inputIncrement,inputDataType); + + + // if (this->UseMagnitude && inputIncrement > 1) + // { + switch (inputDataType) + { + vtkTemplateMacro( + vtkLookupTableMapDirVectorEED(this,static_cast(input),output, + numberOfValues,inputIncrement,outputFormat); + return + ); + case VTK_BIT: + vtkErrorMacro("Cannot comput magnitude of bit array."); + break; + default: + vtkErrorMacro(<< "MapImageThroughTable: Unknown input ScalarType"); + } + // } + + } + + + //---------------------------------------------------------------------------- + void vtkLookupTableEED::PrintSelf(ostream& os, vtkIndent indent) + { + this->Superclass::PrintSelf(os,indent); + } + + + + + //---------------------------------- + //---------------------------------- + //---------------------------------- + //---------------------------------- + //---------------------------------- + + + namespace bbcreaMaracasVisu { + + + BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,TubeTreeFilter) BBTK_BLACK_BOX_IMPLEMENTATION(TubeTreeFilter,bbtk::AtomicBlackBox); @@ -98,17 +269,21 @@ void TubeTreeFilter::DrawOneTube(int iGeneral,int numPoints, int iTube) sphereActorEnd->SetPosition(bbGetInputlstPointX()[i]*spc[0], bbGetInputlstPointY()[i]*spc[1], bbGetInputlstPointZ()[i]*spc[2] ); vtkSmartPointer tube = vtkSmartPointer::New(); -//EED vtkTubeFilter *tube = vtkTubeFilter::New(); tube->SetInput(polyData); tube->SetNumberOfSides(nTv); tube->SetVaryRadiusToVaryRadiusByAbsoluteScalar(); + + vtkLookupTableEED* vLutEED = vtkLookupTableEED::New(); vtkSmartPointer mapper = vtkSmartPointer::New(); -//EED vtkPolyDataMapper *mapper = vtkPolyDataMapper::New(); mapper->SetInputConnection(tube->GetOutputPort()); mapper->ScalarVisibilityOn(); - mapper->SetScalarModeToUsePointFieldData(); - + +// EED fev 02/ 20112 + mapper->SetScalarModeToUsePointFieldData(); + mapper->SetLookupTable( vLutEED ); + mapper->SelectColorArray( "points_axe" ); + // vtkSmartPointer actor =vtkSmartPointer::New(); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); diff --git a/bbtk/src/bbcreaMaracasVisuTubeTreeFilter.h b/bbtk/src/bbcreaMaracasVisuTubeTreeFilter.h index d819ed7..f0a090e 100644 --- a/bbtk/src/bbcreaMaracasVisuTubeTreeFilter.h +++ b/bbtk/src/bbcreaMaracasVisuTubeTreeFilter.h @@ -18,10 +18,58 @@ #include "vtkCellArray.h" #include "vtkProperty.h" #include "vtkLinearTransform.h" +#include "vtkLookupTable.h" +#include "vtkScalarsToColors.h" + + + +class /*VTK_COMMON_EXPORT*/ vtkLookupTableEED : public vtkScalarsToColors + { + public: + // Description: + // Construct with range=[0,1]; and hsv ranges set up for rainbow color table + // (from red to blue). + static vtkLookupTableEED *New(); + + vtkTypeMacro(vtkLookupTableEED,vtkScalarsToColors); + void PrintSelf(ostream& os, vtkIndent indent); + + double *GetRange() { return this->GetTableRange(); }; + void SetRange(double min, double max) { this->SetTableRange(min, max); }; + void SetRange(double rng[2]) { this->SetRange(rng[0], rng[1]); }; + + void SetTableRange(double r[2]); + virtual void SetTableRange(double min, double max); + vtkGetVectorMacro(TableRange,double,2); + + unsigned char *MapValue(double v); + + void GetColor(double x, double rgb[3]); + + void MapScalarsThroughTable2(void *input, unsigned char *output, + int inputDataType, int numberOfValues, + int inputIncrement, int outputIncrement); + + + protected: + + double TableRange[2]; + vtkLookupTableEED(int sze=256, int ext=256); + ~vtkLookupTableEED(); + + + private: + vtkLookupTableEED(const vtkLookupTableEED&); // Not implemented. + void operator=(const vtkLookupTableEED&); // Not implemented. +}; + + + namespace bbcreaMaracasVisu { + class bbcreaMaracasVisu_EXPORT TubeTreeFilter : diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx index 8b80071..97ffe0a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx @@ -67,6 +67,8 @@ void wxDlgTransformByDimensionBySpacingByPixel::GetTransformType(wxWindow *paren ColorLayerImageViewPanel::ColorLayerImageViewPanel(wxWindow* parent, int min, int max, int type) : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN) { + printf("EED ColorLayerImageViewPanel::ColorLayerImageViewPanel start \n"); + _spcBase[0] = _spcBase[1] = _spcBase[2] = 0; _dimBase[0] = _dimBase[1] = _dimBase[2] = 0; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx index c6d8465..ea912f3 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx @@ -25,7 +25,7 @@ ColorLayerImageBasevtkInteractor::~ColorLayerImageBasevtkInteractor() //--------------------------------------------------------------------------------------------- bool ColorLayerImageBasevtkInteractor::OnMouseMove() { - + printf("EED ColorLayerImageBasevtkInteractor::OnMouseMove \n"); if (_vtkInteractorStyleBaseView->GetRefresh_waiting()==true) { _layerImageBase->GetvtkImageReslice()->Modified(); @@ -94,10 +94,14 @@ void LayerImageBase::SetImage(vtkImageData* image) //---------------------------------------------------------------------------- void LayerImageBase::SetwxVtkBaseView(wxVtkBaseView *baseview) { + printf("EED LayerImageBase::SetwxVtkBaseView start baseview:%p \n", baseview); + _baseView = baseview; vtkInteractorStyleBaseView *isbv = (vtkInteractorStyleBaseView*)(_baseView->GetInteractorStyleBaseView()); isbv->AddInteractorStyleMaracas( new ColorLayerImageBasevtkInteractor(this) ); + + printf("EED LayerImageBase::SetwxVtkBaseView end \n"); } //---------------------------------------------------------------------------- @@ -145,7 +149,9 @@ int LayerImageBase::CleanZ(int z) //---------------------------------------------------------------------------- void LayerImageBase::onThreshold() { - + + printf("EED LayerImageBase::onThreshold start \n"); + if ((_image!=NULL) && (_baseView!=NULL)) { int z=CleanZ( GetZ() ); @@ -189,7 +195,12 @@ void LayerImageBase::onThreshold() _thresholdMapper->SetInput( img ); _thresholdMapper->SetLookupTable( _thresholdTable ); _thresholdActor->SetInput( _thresholdMapper->GetOutput() ); + + printf("EED LayerImageBase::onThreshold working \n"); + + } // _image + printf("EED LayerImageBase::onThreshold end"); } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/buttonGroupFactory.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/buttonGroupFactory.cxx index ccba053..ab0af60 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/buttonGroupFactory.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/buttonGroupFactory.cxx @@ -19,10 +19,9 @@ namespace creaButtonContainer ButtonGroupFactory::~ButtonGroupFactory( ) { } + // ---------------------------------------------------------------------------------- - ButtonGroupFactory::ButtonGroupContainer - ButtonGroupFactory::CreateButtonGroupContainer( wxWindow* parent, - ButtonGroupModel* settings ) + ButtonGroupFactory::ButtonGroupContainer ButtonGroupFactory::CreateButtonGroupContainer( wxWindow* parent, ButtonGroupModel* settings ) { ButtonGroupContainer groupView; try @@ -31,11 +30,8 @@ namespace creaButtonContainer for( ButtonGroupMap::iterator it = map.begin( ); it != map.end( ); ++it ) { wxString groupNameAux( ( *it ).first.c_str( ), wxConvUTF8 ); - wxStaticText* wxGroupName = new wxStaticText( parent, -1, - groupNameAux, wxDefaultPosition, wxDefaultSize, 0, - _T("GroupText") ); - ButtonGroup* group = new ButtonGroup( wxGroupName, - this->GetButtons( parent, ( *it ).second ) ); + wxStaticText* wxGroupName = new wxStaticText( parent, -1, groupNameAux, wxDefaultPosition, wxDefaultSize, 0, _T("GroupText") ); + ButtonGroup* group = new ButtonGroup( wxGroupName, this->GetButtons( parent, ( *it ).second ) ); groupView.push_back( group ); }//rof }//yrt @@ -47,9 +43,9 @@ namespace creaButtonContainer }//chtac return ( groupView ); } + // ---------------------------------------------------------------------------------- - ButtonGroupFactory::ButtonContainer - ButtonGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel ) + ButtonGroupFactory::ButtonContainer ButtonGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel ) { ButtonContainer buttonList; try @@ -68,7 +64,8 @@ namespace creaButtonContainer << "ButtonGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel )" << "exception: " << e.what( ) << std::endl; }//chtac - return ( buttonList ); // JPR + + return ( buttonList ); // JPR } // ---------------------------------------------------------------------------------- }//ecapseman diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.cxx index 323e2a7..901da6c 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.cxx @@ -12,12 +12,12 @@ namespace creaButtonContainer namespace view { // ---------------------------------------------------------------------------------- - Button::Button( wxWindow* parent, long id, ButtonPair* pair ) + Button::Button( wxWindow* parent, long id, ButtonPair* pair ) { - this->m_ButtonPair = pair; - StringType wXbuttonName = this->m_ButtonPair->first->first; - StringType wXiconPath = this->m_ButtonPair->first->second; - StringType wXdescription = this->m_ButtonPair->second->first; + this->m_ButtonPair = pair; + StringType wXbuttonName = this->m_ButtonPair->first->first; + StringType wXiconPath = this->m_ButtonPair->first->second; + StringType wXdescription = this->m_ButtonPair->second->first; wxString buttonName( wXbuttonName.c_str( ), wxConvUTF8 ); wxString imageIcon( wXiconPath.c_str( ), wxConvUTF8 ); wxString description( wXdescription.c_str( ), wxConvUTF8 ); @@ -28,28 +28,33 @@ namespace creaButtonContainer buttonName ); this->SetToolTip( description ); } + // ---------------------------------------------------------------------------------- Button::~Button( ) { } + // ---------------------------------------------------------------------------------- StringType Button::GetButtonName( ) { return ( this->m_ButtonPair->first->first ); } + // ---------------------------------------------------------------------------------- StringType Button::GetIconPath( ) { return ( this->m_ButtonPair->first->second ); } + // ---------------------------------------------------------------------------------- StringType Button::GetDescription( ) { return ( this->m_ButtonPair->second->first ); } + // ---------------------------------------------------------------------------------- void Button::Execute( ) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.cxx index 93feebc..15d2c0e 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.cxx @@ -17,51 +17,44 @@ namespace creaButtonContainer END_EVENT_TABLE() // ---------------------------------------------------------------------------------- - ButtonContainerPanel::ButtonContainerPanel( wxWindow* parent, - ButtonGroupSettings* settings ) : - wxScrolledWindow( - parent, - -1, - wxDefaultPosition, - wxDefaultSize, - wxTAB_TRAVERSAL | wxVSCROLL | wxHSCROLL - | wxFULL_REPAINT_ON_RESIZE, _T("creaButtonContainer") ) + ButtonContainerPanel::ButtonContainerPanel( wxWindow* parent, ButtonGroupSettings* settings ) + : wxScrolledWindow(parent,-1, wxDefaultPosition,wxDefaultSize, wxTAB_TRAVERSAL | wxVSCROLL | wxHSCROLL | wxFULL_REPAINT_ON_RESIZE, _T("creaButtonContainer") ) { ButtonGroupFactory factory; - this->SetGroupContainer( - factory.CreateButtonGroupContainer( this, settings ) ); + this->SetGroupContainer( factory.CreateButtonGroupContainer( this, settings ) ); this->PanelInit( ); this->m_ButtonCController = new BCController( this ); this->m_ButtonCController->AddEvents( ); this->SetEventHandler( this->m_ButtonCController ); } + // ---------------------------------------------------------------------------------- ButtonContainerPanel::~ButtonContainerPanel( ) { } + // ---------------------------------------------------------------------------------- - void - ButtonContainerPanel::SetGroupContainer( ButtonGroupList groupContainer ) + void ButtonContainerPanel::SetGroupContainer( ButtonGroupList groupContainer ) { this->m_ButtonGroupList = groupContainer; } + // ---------------------------------------------------------------------------------- - void - ButtonContainerPanel::PanelInit( ) + void ButtonContainerPanel::PanelInit( ) { try { + +// EED 20/01/2012 flag 01 this->m_Sizer = new Sizer( 0, 1, 0, 0 ); - for( ButtonGroupList::iterator it = this->m_ButtonGroupList.begin( ); it - != this->m_ButtonGroupList.end( ); ++it ) + for( ButtonGroupList::iterator it = this->m_ButtonGroupList.begin( ); it != this->m_ButtonGroupList.end( ); ++it ) { GroupManager* manager = new GroupManager( this, *it ); this->m_GroupManagerList[ manager->GetButtonID( ) ] = manager; this->m_Sizer->Add( manager, 1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 ); - std::cout << "creaButtonContainer: New ButtonGroup Sizer Added" - << std::endl; } this->SetSizer( this->m_Sizer ); + this->Layout( ); this->FitSizer( ); }//yrt catch ( const std::exception& e ) @@ -70,9 +63,9 @@ namespace creaButtonContainer << e.what( ) << std::endl; }//hctac } + // ---------------------------------------------------------------------------------- - void - ButtonContainerPanel::FitSizer( ) + void ButtonContainerPanel::FitSizer( ) { this->m_Sizer->Fit( this ); this->m_Sizer->FitInside( this ); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonGroup.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonGroup.cxx index 6dfeaa8..dd14a93 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonGroup.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonGroup.cxx @@ -12,28 +12,31 @@ namespace creaButtonContainer namespace view { // ---------------------------------------------------------------------------------- - ButtonGroup::ButtonGroup( wxStaticText* groupName, - ButtonContainer cartoButtons ) + ButtonGroup::ButtonGroup( wxStaticText* groupName, ButtonContainer cartoButtons ) { this->m_GroupName = groupName; this->m_Buttons = cartoButtons; } + // ---------------------------------------------------------------------------------- ButtonGroup::~ButtonGroup( ) { } + // ---------------------------------------------------------------------------------- ButtonGroup::ButtonContainer ButtonGroup::GetButtonContainer( ) { return ( this->m_Buttons ); } + // ---------------------------------------------------------------------------------- wxStaticText* ButtonGroup::GetGroupName( ) { return ( this->m_GroupName ); } + // ---------------------------------------------------------------------------------- ButtonGroup::IdButtonContainer ButtonGroup::GetButtonIdContainer( ) @@ -54,6 +57,7 @@ namespace creaButtonContainer }//hctac return ( idContainer ); } + // ---------------------------------------------------------------------------------- Button* ButtonGroup::GetButton( long id ) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonManager.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonManager.cxx index 8d00a5d..e788f82 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonManager.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonManager.cxx @@ -16,6 +16,8 @@ namespace creaButtonContainer wxFlexGridSizer( 0, 1, 0, 0 ) { } + +//EED 20/01/2012 Flag03 // ---------------------------------------------------------------------------------- ButtonManager::ButtonManager( ButtonGroup* buttonGroup ) : wxFlexGridSizer( 0, 1, 0, 0 ) @@ -30,30 +32,31 @@ namespace creaButtonContainer std::cerr << "Button::Execute( ) exception: " << e.what( ) << std::endl; }//hctac } + // ---------------------------------------------------------------------------------- ButtonManager::~ButtonManager( ) { } + // ---------------------------------------------------------------------------------- - void - ButtonManager::SetGroupName( wxStaticText* groupName ) + void ButtonManager::SetGroupName( wxStaticText* groupName ) { this->m_GroupName = groupName; this->Add( this->m_GroupName, -1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 ); } + // ---------------------------------------------------------------------------------- - void - ButtonManager::SetButtonManager( ButtonContainer buttonContainer ) + void ButtonManager::SetButtonManager( ButtonContainer buttonContainer ) { try { if ( this->m_GroupName != NULL ) { this->m_GridSizer = new wxGridSizer( 0, 3, 0, 0 ); - for( ButtonContainer::iterator it = buttonContainer.begin( ); it - != buttonContainer.end( ); ++it ) - this->m_GridSizer->Add( ( *it ).second, -1, - wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 ); + for( ButtonContainer::iterator it = buttonContainer.begin( ); it!= buttonContainer.end( ); ++it ) + { + this->m_GridSizer->Add( ( *it ).second, -1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 ); + } this->Add( m_GridSizer, -1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 ); }//fi }//yrt diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/groupManager.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/groupManager.cxx index 86a461a..116d48d 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/groupManager.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/groupManager.cxx @@ -15,55 +15,61 @@ namespace creaButtonContainer GroupManager::GroupManager( wxWindow* parent, ButtonGroup* buttonGroup ) : wxFlexGridSizer( 1, 0, 0, 0 ) { +//EED 20/01/2012 flag 02 this->m_IDExpButton = wxNewId( ); - this->m_ExpansionButton = new ExpansionButton( parent, - this->m_IDExpButton, _("-"), wxDefaultPosition, wxSize( 20, 20 ), 0, - wxDefaultValidator, _T("EXPBUTTON") ); + this->m_ExpansionButton = new ExpansionButton( parent, this->m_IDExpButton, _("-"), wxDefaultPosition, wxSize( 20, 20 ), 0, wxDefaultValidator, _T("EXPBUTTON") ); this->Add( m_ExpansionButton, 1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 ); this->m_ButtonManager = new ButtonManager( buttonGroup ); - this->Add( this->m_ButtonManager, 1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, - 5 ); + this->Add( this->m_ButtonManager, 1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 ); } + // ---------------------------------------------------------------------------------- GroupManager::~GroupManager( ) { } + // ---------------------------------------------------------------------------------- long GroupManager::GetButtonID( ) { return ( this->m_IDExpButton ); } + // ---------------------------------------------------------------------------------- GroupManager::ExpansionButton* GroupManager::GetButton( ) { return ( this->m_ExpansionButton ); } + // ---------------------------------------------------------------------------------- ButtonManager* GroupManager::GetButtonManager( ) { return ( this->m_ButtonManager ); } + // ---------------------------------------------------------------------------------- void GroupManager::SetButtonID( long id ) { this->m_IDExpButton = id; } + // ---------------------------------------------------------------------------------- void GroupManager::SetButton( ExpansionButton* button ) { this->m_ExpansionButton = button; } + // ---------------------------------------------------------------------------------- void GroupManager::SetButtonManager( ButtonManager* container ) { this->m_ButtonManager = container; } + // ---------------------------------------------------------------------------------- void GroupManager::HideSubPanel( bool hide ) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/creaPanelButtonContainer.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/creaPanelButtonContainer.cxx index 7477a38..9e77d00 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/creaPanelButtonContainer.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/creaPanelButtonContainer.cxx @@ -14,38 +14,28 @@ namespace creaPanelButtonContainer //*) END_EVENT_TABLE() // ---------------------------------------------------------------------------------- - typedef creaButtonContainer::model::TConcreteFunctor< PanelButtonContainer > - TConcreteFunctor; + typedef creaButtonContainer::model::TConcreteFunctor< PanelButtonContainer > TConcreteFunctor; // ---------------------------------------------------------------------------------- - PanelButtonContainer::PanelButtonContainer( wxWindow* parent, - ButtonContainerSettings* bcSettings ) : - wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, - wxDEFAULT_FRAME_STYLE, _T("creaPanelButtonContainer") ) + PanelButtonContainer::PanelButtonContainer( wxWindow* parent, ButtonContainerSettings* bcSettings ) + : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("creaPanelButtonContainer") ) { this->m_ButtonContainerSettings = bcSettings; this->m_ButtonPanel = new wxPanel( this ); //Class that manages the event!!! - TConcreteFunctor* functor = new TConcreteFunctor( this, - &PanelButtonContainer::GenericButtonEvent ); + //EED 20/01/2012 + TConcreteFunctor* functor = new TConcreteFunctor( this, &PanelButtonContainer::GenericButtonEvent ); +// TConcreteFunctor* functor = new TConcreteFunctor( this->m_ButtonPanel, &PanelButtonContainer::GenericButtonEvent ); //end of the event definition - this->m_ButtonContainerPanel = new ButtonContainerPanel( this, - this->m_ButtonContainerSettings->GetButtonGroupSettings( functor ) ); + this->m_ButtonContainerPanel = new ButtonContainerPanel( this, this->m_ButtonContainerSettings->GetButtonGroupSettings( functor ) ); //Using AuiManager to Manage the Panels this->m_AuiManager = new wxAuiManager( this, wxAUI_MGR_DEFAULT ); - this->m_AuiManager->AddPane( - this->m_ButtonPanel, - wxAuiPaneInfo( ).Name( _T("ButtonPanel") ).Caption( _("Panel") ). CaptionVisible( - true ).CloseButton( false ).Bottom( ).Resizable( true ) ); + this->m_AuiManager->AddPane(this->m_ButtonPanel, wxAuiPaneInfo( ).Name( _T("ButtonPanel") ).Caption( _("Panel") ). CaptionVisible(true ).CloseButton( false ).Bottom( ).Resizable( true ) ); //CartoButtonPanel Management - this->m_AuiManager->AddPane( - this->m_ButtonContainerPanel, - wxAuiPaneInfo( ).Name( _T("creaButtonContainer") ).Caption( - _("creaButtonContainer") ). CaptionVisible( false ).CloseButton( - false ).Center( ).Resizable( true ) ); + this->m_AuiManager->AddPane( this->m_ButtonContainerPanel,wxAuiPaneInfo( ).Name( _T("creaButtonContainer") ).Caption(_("creaButtonContainer") ). CaptionVisible( false ).CloseButton(false ).Center( ).Resizable( true ) ); this->m_AuiManager->Update( ); } // ---------------------------------------------------------------------------------- @@ -61,16 +51,14 @@ namespace creaPanelButtonContainer //Hiding the last CartoSettingsPanel this->m_ButtonPanel->Show( false ); //Finding the CartoSettingsPanel of the ButtonClicket - this->m_ButtonPanel = this->m_ButtonContainerSettings->GetPanelButton( - buttonName ); + this->m_ButtonPanel = this->m_ButtonContainerSettings->GetPanelButton(buttonName ); //changing the parent of the panel! if ( this->m_ButtonPanel->GetParent( ) != this ) { this->m_ButtonPanel->Reparent( this ); }//fi //CartoSettingsPanel Management - this->m_AuiManager->GetPane( _T("ButtonPanel") ).window - = this->m_ButtonPanel; + this->m_AuiManager->GetPane( _T("ButtonPanel") ).window = this->m_ButtonPanel; //Updating the manager this->m_AuiManager->Update( ); }//yrt