this->lstPointZ = lstPointZ;
}
+
+ void MaracasTubeFilter::SetlstColour( std::vector<double> lstColour )
+ {
+ this->lstColour=lstColour;
+ }
+
+
void MaracasTubeFilter::SetlstRadius( std::vector<double> lstRadius )
{
this->lstRadius = lstRadius;
void MaracasTubeFilter::Run()
{
+
+
unsigned int i;
unsigned int nTv = 8; // No. of surface elements for each tube vertex
points->InsertPoint(i, lstPointX[i], lstPointY[i], lstPointZ[i]);
}
- vtkSmartPointer<vtkCellArray> lines =
- vtkSmartPointer<vtkCellArray>::New();
+ vtkSmartPointer<vtkCellArray> lines = vtkSmartPointer<vtkCellArray>::New();
lines->InsertNextCell( lstPointX.size() );
for (i = 0; i < lstPointX.size(); i++)
{
lines->InsertCellPoint(i);
}
- vtkSmartPointer<vtkPolyData> polyData =
- vtkSmartPointer<vtkPolyData>::New();
+ vtkSmartPointer<vtkPolyData> polyData = vtkSmartPointer<vtkPolyData>::New();
polyData->SetPoints(points);
polyData->SetLines(lines);
// Varying tube radius using sine-function
- vtkSmartPointer<vtkDoubleArray> tubeRadius =
- vtkSmartPointer<vtkDoubleArray>::New();
+ vtkSmartPointer<vtkDoubleArray> tubeRadius = vtkSmartPointer<vtkDoubleArray>::New();
tubeRadius->SetName("TubeRadius");
tubeRadius->SetNumberOfTuples( lstRadius.size() );
for (i=0 ;i<lstRadius.size() ; i++)
// RBG array (could add Alpha channel too I guess...)
// Varying from blue to red
- vtkSmartPointer<vtkUnsignedCharArray> colors =
- vtkSmartPointer<vtkUnsignedCharArray>::New();
+ vtkSmartPointer<vtkUnsignedCharArray> colors = vtkSmartPointer<vtkUnsignedCharArray>::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 (i<numberOfColours){
+ indexcolour=i*3;
+ } else {
+ indexcolour=(numberOfColours-1)*3;
+ }
+ colors->InsertTuple3(i, 255*lstColour[indexcolour+0] , 255*lstColour[indexcolour+1] , 255*lstColour[indexcolour+2] );
+ }
+ } // for
polyData->GetPointData()->AddArray(colors);
- vtkSmartPointer<vtkTubeFilter> tube
- = vtkSmartPointer<vtkTubeFilter>::New();
+ vtkSmartPointer<vtkTubeFilter> tube = vtkSmartPointer<vtkTubeFilter>::New();
tube->SetInput(polyData);
tube->SetNumberOfSides(nTv);
tube->SetVaryRadiusToVaryRadiusByAbsoluteScalar();
- vtkSmartPointer<vtkPolyDataMapper> mapper =
- vtkSmartPointer<vtkPolyDataMapper>::New();
+ vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
mapper->SetInputConnection(tube->GetOutputPort());
mapper->ScalarVisibilityOn();
mapper->SetScalarModeToUsePointFieldData();
actor->SetMapper(mapper);
actor->GetProperty()->SetOpacity( opacity );
-
if ( transform!=NULL )
{
actor->SetUserTransform( transform );
tubefilter->SetlstRadius( bbGetInputlstRadio() );
tubefilter->SetOpacity( bbGetInputOpacity() );
tubefilter->SetTransform( bbGetInputTransform() );
+ tubefilter->SetlstColour( bbGetInputColour() );
tubefilter->Run();
bbSetOutputOutAxis( tubefilter->GetActor() );
printf("EED TubeFilter::Process end \n");
// Here we initialize the input 'In' to 0
bbSetInputOpacity(1);
bbSetInputTransform(NULL);
-
+
+ std::vector<double> colour;
+ // 0- gray
+ colour.push_back(1.0);
+ colour.push_back(0.0);
+ colour.push_back(0.0);
+ bbSetInputColour(colour);
+
+
}
//=====
void SetvtkRenderer( vtkRenderer *render);
void SetlstPoints( std::vector<double> lstPointX , std::vector<double> lstPointY , std::vector<double> lstPointZ );
void SetlstRadius( std::vector<double> lstRadius );
+ void SetlstColour( std::vector<double> lstColour );
void SetOpacity(double opacity);
void SetTransform( vtkLinearTransform* transform );
vtkActor *GetActor();
std::vector<double> lstPointY;
std::vector<double> lstPointZ;
std::vector<double> lstRadius;
+ std::vector<double> lstColour;
};
#include <vtkPointData.h>
#include <vtkTubeFilter.h>
#include <vtkSphereSource.h>
+#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: ["<<rmin<<", "<<rmax<<"]");
+ return;
+ }
+
+ if (this->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<class T>
+ 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<double>(*input);
+ if (j==1) diry= static_cast<double>(*input);
+ if (j==2) dirz= static_cast<double>(*input);
+ tmp = static_cast<double>(*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<VTK_TT*>(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);
sphereActorEnd->SetPosition(bbGetInputlstPointX()[i]*spc[0], bbGetInputlstPointY()[i]*spc[1], bbGetInputlstPointZ()[i]*spc[2] );
vtkSmartPointer<vtkTubeFilter> tube = vtkSmartPointer<vtkTubeFilter>::New();
-//EED vtkTubeFilter *tube = vtkTubeFilter::New();
tube->SetInput(polyData);
tube->SetNumberOfSides(nTv);
tube->SetVaryRadiusToVaryRadiusByAbsoluteScalar();
+
+ vtkLookupTableEED* vLutEED = vtkLookupTableEED::New();
vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::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<vtkActor> actor =vtkSmartPointer<vtkActor>::New();
vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
actor->SetMapper(mapper);
#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
:
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;
//---------------------------------------------------------------------------------------------
bool ColorLayerImageBasevtkInteractor::OnMouseMove()
{
-
+ printf("EED ColorLayerImageBasevtkInteractor::OnMouseMove \n");
if (_vtkInteractorStyleBaseView->GetRefresh_waiting()==true)
{
_layerImageBase->GetvtkImageReslice()->Modified();
//----------------------------------------------------------------------------
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");
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
void LayerImageBase::onThreshold()
{
-
+
+ printf("EED LayerImageBase::onThreshold start \n");
+
if ((_image!=NULL) && (_baseView!=NULL))
{
int z=CleanZ( GetZ() );
_thresholdMapper->SetInput( img );
_thresholdMapper->SetLookupTable( _thresholdTable );
_thresholdActor->SetInput( _thresholdMapper->GetOutput() );
+
+ printf("EED LayerImageBase::onThreshold working \n");
+
+
} // _image
+ printf("EED LayerImageBase::onThreshold end");
}
ButtonGroupFactory::~ButtonGroupFactory( )
{
}
+
// ----------------------------------------------------------------------------------
- ButtonGroupFactory::ButtonGroupContainer
- ButtonGroupFactory::CreateButtonGroupContainer( wxWindow* parent,
- ButtonGroupModel* settings )
+ ButtonGroupFactory::ButtonGroupContainer ButtonGroupFactory::CreateButtonGroupContainer( wxWindow* parent, ButtonGroupModel* settings )
{
ButtonGroupContainer groupView;
try
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
}//chtac
return ( groupView );
}
+
// ----------------------------------------------------------------------------------
- ButtonGroupFactory::ButtonContainer
- ButtonGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel )
+ ButtonGroupFactory::ButtonContainer ButtonGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel )
{
ButtonContainer buttonList;
try
<< "ButtonGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel )"
<< "exception: " << e.what( ) << std::endl;
}//chtac
- return ( buttonList ); // JPR
+
+ return ( buttonList ); // JPR
}
// ----------------------------------------------------------------------------------
}//ecapseman
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 );
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( )
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 )
<< e.what( ) << std::endl;
}//hctac
}
+
// ----------------------------------------------------------------------------------
- void
- ButtonContainerPanel::FitSizer( )
+ void ButtonContainerPanel::FitSizer( )
{
this->m_Sizer->Fit( this );
this->m_Sizer->FitInside( this );
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( )
}//hctac
return ( idContainer );
}
+
// ----------------------------------------------------------------------------------
Button*
ButtonGroup::GetButton( long id )
wxFlexGridSizer( 0, 1, 0, 0 )
{
}
+
+//EED 20/01/2012 Flag03
// ----------------------------------------------------------------------------------
ButtonManager::ButtonManager( ButtonGroup* buttonGroup ) :
wxFlexGridSizer( 0, 1, 0, 0 )
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
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 )
//*)
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( );
}
// ----------------------------------------------------------------------------------
//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