]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBoxModel.cxx
v1.1.0
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsKernelEditorGraphic / GBoxModel.cxx
index 7f8f798330101348995f76815ae3a8e8e0acc976..46deada9ca5bdc2d9decfb46f48206bd998131b7 100644 (file)
@@ -96,13 +96,13 @@ namespace bbtk
 
                //Refresh inputs position
                int i;
-               for(i=0;i<_inputs.size();i++)
+               for(i=0;i<(int)_inputs.size();i++)
                {
                        _inputs[i]->updatePortPosition();
                }
                
                //Refresh outputs position
-               for(i=0;i<_outputs.size();i++)
+               for(i=0;i<(int)_outputs.size();i++)
                {
                        _outputs[i]->updatePortPosition();
                }
@@ -144,7 +144,7 @@ namespace bbtk
 
        GPortModel* GBoxModel::getInputPort(std::string name)
        {
-               for(int i = 0; i<_inputs.size();i++)
+               for(int i = 0; i<(int)_inputs.size();i++)
                {
                        if(_inputs[i]->getBBTKName()==name)
                        {
@@ -158,7 +158,7 @@ namespace bbtk
        
        GPortModel* GBoxModel::getOutputPort(std::string name)
        {
-               for(int i = 0; i<_outputs.size();i++)
+               for(int i = 0; i<(int)_outputs.size();i++)
                {
                        if(_outputs[i]->getBBTKName()==name)
                        {
@@ -186,7 +186,7 @@ namespace bbtk
 
        void GBoxModel::updatePorts()
        {
-               for(int i = 0; i<_inputs.size();i++)
+               for(int i = 0; i<(int)_inputs.size();i++)
                {       
                        _inputs[i]->updatePortPosition();
                        _inputs[i]->notifyObservers(_objectId);
@@ -199,6 +199,38 @@ namespace bbtk
                }
        }
 
+       
+       //=========================================================================
+       //JPR
+       void GBoxModel::addColons(std::string &text)
+       {
+               printf("EED JPR >>>>>>>>>>>>>>> %s\n",text.c_str() );
+               std::string character("&&2P&&");                                
+               size_t pos;
+               pos = text.find(character);
+               while(pos != std::string::npos)
+               {
+               //We replace the character "&&2P&&" with ":" for all the string
+                       text.replace(pos, character.length(),":");
+                       pos = text.find(character, pos);
+               }
+       }
+
+       //=========================================================================
+       //JPR
+       void GBoxModel::removeColons(std::string &text)
+       {
+               std::string character(":");                             
+               size_t pos;
+               pos = text.find(character);
+               while(pos != std::string::npos)
+               {
+                       //We replace the character ":" with "&&2P&&" for all the string
+                       text.replace(pos, character.length(),"&&2P&&");
+                       pos = text.find(character, pos);
+                       }
+       }
+
        //=========================================================================