Skip to content
Snippets Groups Projects
Commit 8aef6787 authored by Cyrille Valladeau's avatar Cyrille Valladeau
Browse files

ENH: add the return of the added example

parent 0b10fdcf
No related branches found
No related tags found
No related merge requests found
......@@ -107,12 +107,12 @@ private:
SetDocExampleParameterValue("out", "smoothedImage_mean.png uchar");
SetDocExampleParameterValue("type", "mean");
AddExample( "Image smoothing using an anisotropic diffusion filter." );
SetDocExampleParameterValue("in", "poupees.tif", 1);
SetDocExampleParameterValue("out", "smoothedImage_ani.png uchar", 1);
SetDocExampleParameterValue("type", "anidif", 1);
SetDocExampleParameterValue("type.anidif.timestep", "0.1", 1);
SetDocExampleParameterValue("type.anidif.nbiter", "5", 1);
unsigned int exId = AddExample( "Image smoothing using an anisotropic diffusion filter." );
SetDocExampleParameterValue("in", "poupees.tif", exId);
SetDocExampleParameterValue("out", "smoothedImage_ani.png uchar", exId);
SetDocExampleParameterValue("type", "anidif", exId);
SetDocExampleParameterValue("type.anidif.timestep", "0.1", exId);
SetDocExampleParameterValue("type.anidif.nbiter", "5", exId);
}
void DoUpdateParameters()
......
......@@ -534,18 +534,13 @@ public:
this->Modified();
}
void AddExample( const std::string & comm )
unsigned int AddExample( const std::string & comm="" )
{
m_DocExample->AddExample( comm );
unsigned int id = m_DocExample->AddExample( comm );
this->Modified();
return id;
}
void AddExample()
{
m_DocExample->AddExample();
this->Modified();
}
std::string GetCLExample()
{
return m_DocExample->GenerateCLExample();
......
......@@ -144,13 +144,7 @@ DocExampleStructure::SetExampleComment( const std::string & comm, unsigned int i
}
void
DocExampleStructure:: AddExample()
{
this->AddExample( "" );
}
void
unsigned int
DocExampleStructure::AddExample( const std::string & comm )
{
m_ExampleCommentList.push_back( comm );
......@@ -158,6 +152,8 @@ DocExampleStructure::AddExample( const std::string & comm )
// Add a field for the values
for( unsigned int i=0; i<m_ParameterList.size(); i++)
m_ParameterList[i].m_Values.push_back("");
return m_ExampleCommentList.size()-1;
}
......
......@@ -131,11 +131,8 @@ public:
/** Set one example comment */
void SetExampleComment( const std::string & comm, unsigned int i);
/** Add an example */
void AddExample();
/** Add an example using comment.*/
void AddExample( const std::string & comm);
/** Add an example using comment. Retrun the index of the new example.*/
unsigned int AddExample( const std::string & comm = "");
/** Generation of the documentation for CommandLine for one specific
* example. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment